diff --git a/SHERPA.AD/Components/AccDocDetail.razor b/SHERPA.AD/Components/AccDocDetail.razor new file mode 100644 index 0000000..f896f7c --- /dev/null +++ b/SHERPA.AD/Components/AccDocDetail.razor @@ -0,0 +1,95 @@ +@if (CurrRecord == null) +{ + + Nessun record selezionato + +} +else +{ +
+
+
+ +
+
+ @if(ReadOnly) + { + + } + else + { + + } +
+
+
+
+
+ + + + +
+
+ + + + +
+
+ + +
+
+
+ +
+
+
+
+ Righe Documento +
+
+ btn +
+
+
+ Form compilazione + dett righe +
+
+ @*
+
+
+ Materiali / servizi +
+
+ btn +
+
+
+ Form compilazione + dett righe +
+
*@ +} diff --git a/SHERPA.AD/Components/AccDocDetail.razor.cs b/SHERPA.AD/Components/AccDocDetail.razor.cs new file mode 100644 index 0000000..efbfc3a --- /dev/null +++ b/SHERPA.AD/Components/AccDocDetail.razor.cs @@ -0,0 +1,60 @@ +using Microsoft.AspNetCore.Components; +using SHERPA.AD.Data; +using SHERPA.Data.DbModels; + +namespace SHERPA.AD.Components +{ + public partial class AccDocDetail + { + #region Public Properties + + [Parameter] + public vDocsExplModel? CurrRecord { get; set; } = null; + + #endregion Public Properties + + #region Protected Properties + + protected string cssEdit + { + get => ReadOnly ? "bg-default text-dark" : "bg-primary text-light"; + } + + protected List ListSelCli { get; set; } = new List(); + + protected List ListSelGruppi { get; set; } = new List(); + + protected List ListSelTipo { get; set; } = new List(); + + [Inject] + protected SADDataService SDService { get; set; } = null!; + + #endregion Protected Properties + + #region Protected Methods + + protected override async Task OnInitializedAsync() + { + ListSelCli = await SDService.VSelCliGetAll(); + ListSelGruppi = await SDService.VSelGruppiGetAll(); + ListSelTipo = await SDService.VSelTipoGetAll(); + } + + #endregion Protected Methods + + #region Private Fields + + private bool ReadOnly = true; + + #endregion Private Fields + + #region Private Methods + + private void toggleEdit() + { + ReadOnly = !ReadOnly; + } + + #endregion Private Methods + } +} \ No newline at end of file diff --git a/SHERPA.AD/Components/AccDocManager.razor b/SHERPA.AD/Components/AccDocManager.razor index ab258c6..542fb33 100644 --- a/SHERPA.AD/Components/AccDocManager.razor +++ b/SHERPA.AD/Components/AccDocManager.razor @@ -1,23 +1,4 @@ -@if (CurrRecord != null) -{ -
-
-
-
-
- Nuovo Documento -
-
-
-
-
- Form compilazione -
-
-
-
-} -@if (IsLoading) +@if (IsLoading) { } @@ -118,8 +99,8 @@ else } @if (SelRecord != null) { -
- dett righe +
+
}
diff --git a/SHERPA.AD/Components/AccDocManager.razor.cs b/SHERPA.AD/Components/AccDocManager.razor.cs index 8542795..e76d4a6 100644 --- a/SHERPA.AD/Components/AccDocManager.razor.cs +++ b/SHERPA.AD/Components/AccDocManager.razor.cs @@ -204,8 +204,6 @@ namespace SHERPA.AD.Components #region Private Properties - private vDocsExplModel? CurrRecord { get; set; } = null; - private vDocsExplModel? SelRecord { get; set; } = null; #endregion Private Properties diff --git a/SHERPA.AD/Components/FiltDocExp.razor.cs b/SHERPA.AD/Components/FiltDocExp.razor.cs index aa43afc..ebdfc3b 100644 --- a/SHERPA.AD/Components/FiltDocExp.razor.cs +++ b/SHERPA.AD/Components/FiltDocExp.razor.cs @@ -1,6 +1,6 @@ using Microsoft.AspNetCore.Components; -using SHERPA.Data.DbModels; using SHERPA.AD.Data; +using SHERPA.Data.DbModels; namespace SHERPA.AD.Components { @@ -87,6 +87,11 @@ namespace SHERPA.AD.Components protected SelectDocExp CurrFilter { get; set; } = new SelectDocExp(); + protected bool hasFilter + { + get => (!CurrFilter.Equals(new SelectDocExp())); + } + protected List ListSelCli { get; set; } = new List(); protected List ListSelGruppi { get; set; } = new List(); @@ -110,6 +115,12 @@ namespace SHERPA.AD.Components ListSelTipo = await SDService.VSelTipoGetAll(); } + protected void ResetAll() + { + CurrFilter = new SelectDocExp(); + ReportUpdate(); + } + protected void ResetCli() { SelCli = 0; @@ -136,13 +147,51 @@ namespace SHERPA.AD.Components SelTipo = "*"; } - protected void ResetAll() + #endregion Protected Methods + + #region Private Properties + + private string cssBtnResCli { - CurrFilter = new SelectDocExp(); - ReportUpdate(); + get => SelCli == 0 ? "btn btn-secondary" : "btn btn-primary"; } - #endregion Protected Methods + private string cssBtnResGrp + { + get => SelGruppo == "0" ? "btn btn-secondary" : "btn btn-primary"; + } + + private string cssBtnResSearch + { + get => SearchVal == "" ? "btn btn-secondary" : "btn btn-primary"; + } + + private string cssBtnResTipo + { + get => SelTipo == "*" ? "btn btn-secondary" : "btn btn-primary"; + } + + private string cssLblCli + { + get => SelCli == 0 ? "" : "bg-primary text-light"; + } + + private string cssLblGrp + { + get => SelGruppo == "0" ? "" : "bg-primary text-light"; + } + + private string cssLblSearch + { + get => SearchVal == "" ? "" : "bg-primary text-light"; + } + + private string cssLblTipo + { + get => SelTipo == "*" ? "" : "bg-primary text-light"; + } + + #endregion Private Properties #region Private Methods @@ -152,43 +201,5 @@ namespace SHERPA.AD.Components } #endregion Private Methods - - private string cssBtnResGrp - { - get => SelGruppo == "0" ? "btn btn-secondary" : "btn btn-primary"; - } - private string cssLblGrp - { - get => SelGruppo == "0" ? "" : "bg-primary text-light"; - } - private string cssBtnResCli - { - get => SelCli == 0 ? "btn btn-secondary" : "btn btn-primary"; - } - private string cssLblTipo - { - get => SelTipo == "*" ? "" : "bg-primary text-light"; - } - private string cssBtnResTipo - { - get => SelTipo == "*" ? "btn btn-secondary" : "btn btn-primary"; - } - private string cssLblCli - { - get => SelCli == 0 ? "" : "bg-primary text-light"; - } - private string cssBtnResSearch - { - get => SearchVal == "" ? "btn btn-secondary" : "btn btn-primary"; - } - private string cssLblSearch - { - get => SearchVal == "" ? "" : "bg-primary text-light"; - } - - protected bool hasFilter - { - get => (!CurrFilter.Equals(new SelectDocExp())); - } } } \ No newline at end of file diff --git a/SHERPA.AD/Pages/AccuDoc.razor.cs b/SHERPA.AD/Pages/AccuDoc.razor.cs index ade124b..4b3df9b 100644 --- a/SHERPA.AD/Pages/AccuDoc.razor.cs +++ b/SHERPA.AD/Pages/AccuDoc.razor.cs @@ -1,19 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Components; -using System.Net.Http; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Components.Authorization; -using Microsoft.AspNetCore.Components.Forms; -using Microsoft.AspNetCore.Components.Routing; -using Microsoft.AspNetCore.Components.Web; -using Microsoft.AspNetCore.Components.Web.Virtualization; -using Microsoft.JSInterop; -using SHERPA.AD; -using SHERPA.AD.Shared; -using SHERPA.Data.DbModels; using SHERPA.AD.Data; namespace SHERPA.AD.Pages @@ -22,29 +6,12 @@ namespace SHERPA.AD.Pages { #region Protected Properties - protected SelectDocExp SelFilter { get; set; } = new SelectDocExp(); - - #endregion Protected Properties #region Protected Methods - protected void SetNumRec(int newNum) - { - numRecord = newNum; - } - - protected void SetCurrPage(int newNum) - { - currPage = newNum; - } - protected void SetCount(int newNum) - { - totalCount = newNum; - } - protected override void OnInitialized() { numRecord = 10; @@ -53,7 +20,26 @@ namespace SHERPA.AD.Pages SelFilter.IdxCli = 0; SelFilter.OnlySync = false; } - + + protected void SetCount(int newNum) + { + totalCount = newNum; + } + + protected void SetCurrPage(int newNum) + { + currPage = newNum; + } + + protected void SetFilter(SelectDocExp NewFilter) + { + SelFilter = NewFilter; + } + + protected void SetNumRec(int newNum) + { + numRecord = newNum; + } #endregion Protected Methods @@ -64,11 +50,6 @@ namespace SHERPA.AD.Pages private int numRecord { get; set; } = 10; private int totalCount { get; set; } = 0; - protected void SetFilter(SelectDocExp NewFilter) - { - SelFilter = NewFilter; - } - #endregion Private Properties } } \ No newline at end of file diff --git a/SHERPA.AD/SHERPA.AD.csproj b/SHERPA.AD/SHERPA.AD.csproj index 099e1fd..70c6157 100644 --- a/SHERPA.AD/SHERPA.AD.csproj +++ b/SHERPA.AD/SHERPA.AD.csproj @@ -4,7 +4,7 @@ net6.0 enable enable - 1.0.2301.3117 + 1.0.2301.3119 diff --git a/SHERPA.BBM.UI/SHERPA.BBM.UI.csproj b/SHERPA.BBM.UI/SHERPA.BBM.UI.csproj index fcb07c5..a09323b 100644 --- a/SHERPA.BBM.UI/SHERPA.BBM.UI.csproj +++ b/SHERPA.BBM.UI/SHERPA.BBM.UI.csproj @@ -4,7 +4,7 @@ net6.0 60fcdaab-6c1e-4bec-9d88-f7727ef1c12c wwwroot\favicon.ico - 1.0.2301.3117 + 1.0.2301.3118 diff --git a/SHERPA.Data/Controllers/SInManController.cs b/SHERPA.Data/Controllers/SInManController.cs index df78227..da5a7df 100644 --- a/SHERPA.Data/Controllers/SInManController.cs +++ b/SHERPA.Data/Controllers/SInManController.cs @@ -215,6 +215,7 @@ namespace SHERPA.Data.Controllers } return dbResult; } + /// /// Ricerca Customer da idx /// @@ -227,7 +228,7 @@ namespace SHERPA.Data.Controllers { dbResult = dbCtx .DbSetCustomers - .Where(x => (x.IdxCli== idxCli)) + .Where(x => (x.IdxCli == idxCli)) .FirstOrDefault(); } return dbResult; @@ -415,6 +416,109 @@ namespace SHERPA.Data.Controllers return done; } + /// + /// Elenco VAT / CIva + /// + /// + /// + public List VATGetAll(string searchVal) + { + List dbResult = new List(); + using (SHERPAFattContext dbCtx = new SHERPAFattContext(_configuration)) + { + dbResult = dbCtx + .DbSetVat + .Where(x => (x.Descrizione.Contains(searchVal) || string.IsNullOrEmpty(searchVal))) + .OrderBy(x => x.Descrizione) + .ToList(); + } + return dbResult; + } + + /// + /// Ricerca VAT / CIva da idx + /// + /// + /// + public VatModel? VATGetByKey(int idxVat) + { + VatModel? dbResult = new VatModel(); + using (SHERPAFattContext dbCtx = new SHERPAFattContext(_configuration)) + { + dbResult = dbCtx + .DbSetVat + .Where(x => (x.IdxVat == idxVat)) + .FirstOrDefault(); + } + return dbResult; + } + + /// + /// Elenco VAT / CIva che richiedono sync tramite stored + /// + /// Tipo doc, * = tutti + /// Anno doc, 0=tutti + /// Indica se solo non caricati (1 = NON caricati) + /// + public List VATToSync(string tipoDoc, int anno, bool notUpl) + { + List dbResult = new List(); + using (SHERPAFattContext dbCtx = new SHERPAFattContext(_configuration)) + { + SqlParameter Tipo = new SqlParameter("@tipo", tipoDoc); + SqlParameter Anno = new SqlParameter("@anno", anno); + SqlParameter NotUpl = new SqlParameter("@notUpl", notUpl); + + dbResult = dbCtx + .DbSetVat + .FromSqlRaw("EXEC stp_VAT_getByAnno @tipo,@anno,@notUpl", Tipo, Anno, NotUpl) + .ToList(); + } + return dbResult; + } + + /// + /// Aggiorna un record VAT / CIva + /// + /// + /// + public bool VATUpdate(VatModel updItem) + { + bool done = false; + using (SHERPAFattContext dbCtx = new SHERPAFattContext(_configuration)) + { + try + { + var currData = dbCtx + .DbSetVat + .Where(x => x.IdxVat == updItem.IdxVat) + .FirstOrDefault(); + if (currData != null) + { + currData.Iva = updItem.Iva; + currData.Descrizione = updItem.Descrizione; + currData.Enabled = updItem.Enabled; + currData.SplitPay = updItem.SplitPay; + currData.id_ext = updItem.id_ext; + dbCtx.Entry(currData).State = EntityState.Modified; + } + else + { + dbCtx + .DbSetVat + .Add(updItem); + } + dbCtx.SaveChanges(); + done = true; + } + catch (Exception exc) + { + Log.Error($"Eccezione in VATUpdate{Environment.NewLine}{exc}"); + } + } + return done; + } + /// /// Elenco AccoDoc (Accounting Document) filtrati /// @@ -490,110 +594,6 @@ namespace SHERPA.Data.Controllers return dbResult; } - - - /// - /// Elenco VAT / CIva - /// - /// - /// - public List VATGetAll(string searchVal) - { - List dbResult = new List(); - using (SHERPAFattContext dbCtx = new SHERPAFattContext(_configuration)) - { - dbResult = dbCtx - .DbSetVat - .Where(x => (x.Descrizione.Contains(searchVal) || string.IsNullOrEmpty(searchVal))) - .OrderBy(x => x.Descrizione) - .ToList(); - } - return dbResult; - } - /// - /// Ricerca VAT / CIva da idx - /// - /// - /// - public VatModel? VATGetByKey(int idxVat) - { - VatModel? dbResult = new VatModel(); - using (SHERPAFattContext dbCtx = new SHERPAFattContext(_configuration)) - { - dbResult = dbCtx - .DbSetVat - .Where(x => (x.IdxVat == idxVat)) - .FirstOrDefault(); - } - return dbResult; - } - - /// - /// Elenco VAT / CIva che richiedono sync tramite stored - /// - /// Tipo doc, * = tutti - /// Anno doc, 0=tutti - /// Indica se solo non caricati (1 = NON caricati) - /// - public List VATToSync(string tipoDoc, int anno, bool notUpl) - { - List dbResult = new List(); - using (SHERPAFattContext dbCtx = new SHERPAFattContext(_configuration)) - { - SqlParameter Tipo = new SqlParameter("@tipo", tipoDoc); - SqlParameter Anno = new SqlParameter("@anno", anno); - SqlParameter NotUpl = new SqlParameter("@notUpl", notUpl); - - dbResult = dbCtx - .DbSetVat - .FromSqlRaw("EXEC stp_VAT_getByAnno @tipo,@anno,@notUpl", Tipo, Anno, NotUpl) - .ToList(); - } - return dbResult; - } - - /// - /// Aggiorna un record VAT / CIva - /// - /// - /// - public bool VATUpdate(VatModel updItem) - { - bool done = false; - using (SHERPAFattContext dbCtx = new SHERPAFattContext(_configuration)) - { - try - { - var currData = dbCtx - .DbSetVat - .Where(x => x.IdxVat == updItem.IdxVat) - .FirstOrDefault(); - if (currData != null) - { - currData.Iva = updItem.Iva; - currData.Descrizione = updItem.Descrizione; - currData.Enabled= updItem.Enabled; - currData.SplitPay= updItem.SplitPay; - currData.id_ext = updItem.id_ext; - dbCtx.Entry(currData).State = EntityState.Modified; - } - else - { - dbCtx - .DbSetVat - .Add(updItem); - } - dbCtx.SaveChanges(); - done = true; - } - catch (Exception exc) - { - Log.Error($"Eccezione in VATUpdate{Environment.NewLine}{exc}"); - } - } - return done; - } - #endregion Public Methods #region Private Fields diff --git a/SHERPA/DocArchive.aspx.designer.cs b/SHERPA/DocArchive.aspx.designer.cs index 8ed1bde..d1b8635 100644 --- a/SHERPA/DocArchive.aspx.designer.cs +++ b/SHERPA/DocArchive.aspx.designer.cs @@ -1,77 +1,79 @@ //------------------------------------------------------------------------------ -// -// Codice generato da uno strumento. +// +// This code was generated by a tool. // -// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se -// il codice viene rigenerato. -// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// //------------------------------------------------------------------------------ -namespace SHERPA { - - - public partial class DocArchive { - +namespace SHERPA +{ + + + public partial class DocArchive + { + /// - /// Controllo mod_searchParam. + /// mod_searchParam control. /// /// - /// Campo generato automaticamente. - /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::SHERPA.WebUserControls.mod_searchParam mod_searchParam; - + /// - /// Controllo divTopFooter. + /// divTopFooter control. /// /// - /// Campo generato automaticamente. - /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlGenericControl divTopFooter; - + /// - /// Controllo mod_billAdvFunHor. + /// mod_billAdvFunHor control. /// /// - /// Campo generato automaticamente. - /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::SHERPA.WebUserControls.mod_billAdvFunHor mod_billAdvFunHor; - + /// - /// Controllo divElenco. + /// divElenco control. /// /// - /// Campo generato automaticamente. - /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlGenericControl divElenco; - + /// - /// Controllo mod_DocsArchive. + /// mod_DocsArchive control. /// /// - /// Campo generato automaticamente. - /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::SHERPA.WebUserControl.mod_DocsArchive mod_DocsArchive; - + /// - /// Controllo divDetail. + /// divDetail control. /// /// - /// Campo generato automaticamente. - /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.HtmlControls.HtmlGenericControl divDetail; - + /// - /// Controllo mod_DocsDetail. + /// mod_DocsDetail control. /// /// - /// Campo generato automaticamente. - /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::SHERPA.WebUserControl.mod_DocsDetail mod_DocsDetail; }