Inizio conversione gest tipoDoc
This commit is contained in:
@@ -50,9 +50,10 @@ else
|
||||
<div class="col-md-4">
|
||||
<label class="form-label small text-secondary mb-0">Tipo</label>
|
||||
<select class="form-select" @bind="@CurrRecord.tipo" disabled="@(DocReadOnly)">
|
||||
<option value="0">--- Tutti ---</option>
|
||||
@foreach (var item in ListSelTipo)
|
||||
{
|
||||
<option value="@item.value">@item.label</option>
|
||||
<option value="@item.IdxTipo">@item.Descrizione</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace SHERPA.AD.Components
|
||||
protected List<vSelCliModel> ListSelCli { get; set; } = new List<vSelCliModel>();
|
||||
|
||||
protected List<vSelGruppiModel> ListSelGruppi { get; set; } = new List<vSelGruppiModel>();
|
||||
protected List<vSelTipoModel> ListSelTipo { get; set; } = new List<vSelTipoModel>();
|
||||
protected List<AnagTipoDocModel> ListSelTipo { get; set; } = new List<AnagTipoDocModel>();
|
||||
protected List<VatModel> ListSelVat { get; set; } = new List<VatModel>();
|
||||
|
||||
[Inject]
|
||||
@@ -56,7 +56,7 @@ namespace SHERPA.AD.Components
|
||||
{
|
||||
ListSelCli = await SDService.VSelCliGetAll();
|
||||
ListSelGruppi = await SDService.VSelGruppiGetAll();
|
||||
ListSelTipo = await SDService.VSelTipoGetAll();
|
||||
ListSelTipo = await SDService.TipoDocGetAll();
|
||||
var rawVat = await SDService.VATGetAll();
|
||||
ListSelVat = rawVat.Where(x => x.Enabled).ToList();
|
||||
}
|
||||
|
||||
@@ -293,7 +293,10 @@ namespace SHERPA.AD.Components
|
||||
|
||||
private void selTipo(vDocsExplModel selItem)
|
||||
{
|
||||
CurrFilter.CodTipo = selItem.tipo;
|
||||
CurrFilter.IdxTipo = selItem.IdxTipo;
|
||||
#if false
|
||||
CurrFilter.CodTipo = selItem.tipo;
|
||||
#endif
|
||||
FiltUpdated.InvokeAsync(CurrFilter);
|
||||
}
|
||||
|
||||
|
||||
@@ -211,7 +211,7 @@ namespace SHERPA.AD.Components
|
||||
// verifico se sia "showAll"..
|
||||
if (CurrFilter.ShowFilt)
|
||||
{
|
||||
allRec = await SDService.CustomersToSync(CurrFilter.CodTipo, CurrFilter.Anno, false);
|
||||
allRec = await SDService.CustomersToSync(CurrFilter.IdxTipo, CurrFilter.Anno, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -8,9 +8,10 @@
|
||||
<div class="input-group input-group-sm mb-1">
|
||||
<label class="input-group-text @cssLblTipo" style="width: 5rem;">Tipo Doc</label>
|
||||
<select class="form-select" @bind="@SelTipo">
|
||||
<option value="0">--- Tutti ---</option>
|
||||
@foreach (var item in ListSelTipo)
|
||||
{
|
||||
<option value="@item.value">@item.label</option>
|
||||
<option value="@item.IdxTipo">@item.Descrizione</option>
|
||||
}
|
||||
</select>
|
||||
<button class="@cssBtnResTipo" @onclick="ResetTipo"><i class="fa-solid fa-rotate-right"></i></button>
|
||||
|
||||
@@ -20,8 +20,11 @@ namespace SHERPA.AD.Components
|
||||
get => CurrFilter.Fine;
|
||||
set
|
||||
{
|
||||
CurrFilter.Fine = value;
|
||||
ReportUpdate();
|
||||
if (CurrFilter.Fine != value)
|
||||
{
|
||||
CurrFilter.Fine = value;
|
||||
ReportUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,8 +33,11 @@ namespace SHERPA.AD.Components
|
||||
get => CurrFilter.Inizio;
|
||||
set
|
||||
{
|
||||
CurrFilter.Inizio = value;
|
||||
ReportUpdate();
|
||||
if (CurrFilter.Inizio != value)
|
||||
{
|
||||
CurrFilter.Inizio = value;
|
||||
ReportUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,8 +46,11 @@ namespace SHERPA.AD.Components
|
||||
get => CurrFilter.SearchVal;
|
||||
set
|
||||
{
|
||||
CurrFilter.SearchVal = value;
|
||||
ReportUpdate();
|
||||
if (CurrFilter.SearchVal != value)
|
||||
{
|
||||
CurrFilter.SearchVal = value;
|
||||
ReportUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,6 +59,9 @@ namespace SHERPA.AD.Components
|
||||
get => CurrFilter.Anno;
|
||||
set
|
||||
{
|
||||
if (CurrFilter.Anno != value)
|
||||
{
|
||||
}
|
||||
CurrFilter.Anno = value;
|
||||
ReportUpdate();
|
||||
}
|
||||
@@ -60,8 +72,11 @@ namespace SHERPA.AD.Components
|
||||
get => CurrFilter.IdxCli;
|
||||
set
|
||||
{
|
||||
CurrFilter.IdxCli = value;
|
||||
ReportUpdate();
|
||||
if (CurrFilter.IdxCli != value)
|
||||
{
|
||||
CurrFilter.IdxCli = value;
|
||||
ReportUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,18 +85,24 @@ namespace SHERPA.AD.Components
|
||||
get => CurrFilter.IdxGruppo;
|
||||
set
|
||||
{
|
||||
CurrFilter.IdxGruppo = value;
|
||||
ReportUpdate();
|
||||
if (CurrFilter.IdxGruppo != value)
|
||||
{
|
||||
CurrFilter.IdxGruppo = value;
|
||||
ReportUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string SelTipo
|
||||
public int SelTipo
|
||||
{
|
||||
get => CurrFilter.CodTipo;
|
||||
get => CurrFilter.IdxTipo;
|
||||
set
|
||||
{
|
||||
CurrFilter.CodTipo = value;
|
||||
ReportUpdate();
|
||||
if (CurrFilter.IdxTipo != value)
|
||||
{
|
||||
CurrFilter.IdxTipo = value;
|
||||
ReportUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +133,7 @@ namespace SHERPA.AD.Components
|
||||
|
||||
protected List<vSelCliModel> ListSelCli { get; set; } = new List<vSelCliModel>();
|
||||
protected List<vSelGruppiModel> ListSelGruppi { get; set; } = new List<vSelGruppiModel>();
|
||||
protected List<vSelTipoModel> ListSelTipo { get; set; } = new List<vSelTipoModel>();
|
||||
protected List<AnagTipoDocModel> ListSelTipo { get; set; } = new List<AnagTipoDocModel>();
|
||||
|
||||
[Inject]
|
||||
protected SADDataService SDService { get; set; } = null!;
|
||||
@@ -153,7 +174,7 @@ namespace SHERPA.AD.Components
|
||||
Fine = new DateTime(anno + 1, 1, 1);
|
||||
ListSelCli = await SDService.VSelCliGetAll();
|
||||
ListSelGruppi = await SDService.VSelGruppiGetAll();
|
||||
ListSelTipo = await SDService.VSelTipoGetAll();
|
||||
ListSelTipo = await SDService.TipoDocGetAll();
|
||||
}
|
||||
|
||||
protected void ResetAll()
|
||||
@@ -186,7 +207,7 @@ namespace SHERPA.AD.Components
|
||||
|
||||
protected void ResetTipo()
|
||||
{
|
||||
SelTipo = "*";
|
||||
SelTipo = 0;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
@@ -216,7 +237,7 @@ namespace SHERPA.AD.Components
|
||||
|
||||
private string cssBtnResTipo
|
||||
{
|
||||
get => SelTipo == "*" ? "btn btn-secondary" : "btn btn-primary";
|
||||
get => SelTipo == 0 ? "btn btn-secondary" : "btn btn-primary";
|
||||
}
|
||||
|
||||
private string cssLblCli
|
||||
@@ -236,7 +257,7 @@ namespace SHERPA.AD.Components
|
||||
|
||||
private string cssLblTipo
|
||||
{
|
||||
get => SelTipo == "*" ? "" : "bg-primary text-light";
|
||||
get => SelTipo == 0 ? "" : "bg-primary text-light";
|
||||
}
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
@@ -20,6 +20,9 @@ namespace SHERPA.AD.Components
|
||||
[Parameter]
|
||||
public bool EditEnab { get; set; } = false;
|
||||
|
||||
[Parameter]
|
||||
public int IdxTipoDoc { get; set; } = 0;
|
||||
|
||||
[Parameter]
|
||||
public bool OnlyNeedSync { get; set; } = false;
|
||||
|
||||
@@ -35,9 +38,6 @@ namespace SHERPA.AD.Components
|
||||
[Parameter]
|
||||
public bool SelEnab { get; set; } = false;
|
||||
|
||||
[Parameter]
|
||||
public string TipoDoc { get; set; } = "*";
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<int> UpdateCount { get; set; }
|
||||
|
||||
@@ -188,7 +188,7 @@ namespace SHERPA.AD.Components
|
||||
}
|
||||
else
|
||||
{
|
||||
allRec = await SDService.VATToSync(TipoDoc, Anno, false);
|
||||
allRec = await SDService.VATToSync(IdxTipoDoc, Anno, false);
|
||||
}
|
||||
if (OnlyNeedSync)
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
public int NumRecord { get; set; } = 10;
|
||||
public bool OnlySync { get; set; } = false;
|
||||
public string SearchVal { get; set; } = "";
|
||||
public string CodTipo { get; set; } = "*";
|
||||
public int IdxTipo { get; set; } = 0;
|
||||
public bool ShowFilt { get; set; } = true;
|
||||
public bool HideInactive { get; set; } = false;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
NumRecord = this.NumRecord,
|
||||
OnlySync= this.OnlySync,
|
||||
SearchVal = this.SearchVal,
|
||||
CodTipo = this.CodTipo,
|
||||
IdxTipo = this.IdxTipo,
|
||||
ShowFilt = this.ShowFilt,
|
||||
HideInactive = this.HideInactive
|
||||
};
|
||||
@@ -57,7 +57,7 @@
|
||||
if (OnlySync != item.OnlySync)
|
||||
return false;
|
||||
|
||||
if (CodTipo != item.CodTipo)
|
||||
if (IdxTipo != item.IdxTipo)
|
||||
return false;
|
||||
|
||||
if (ShowFilt != item.ShowFilt)
|
||||
|
||||
@@ -27,9 +27,10 @@
|
||||
<div class="input-group input-group-sm mb-1">
|
||||
<label class="input-group-text" style="width: 5rem;">Tipo Doc</label>
|
||||
<select class="form-select" @bind="@SelTipo">
|
||||
<option value="0">--- Tutti ---</option>
|
||||
@foreach (var item in ListSelTipo)
|
||||
{
|
||||
<option value="@item.value">@item.label</option>
|
||||
<option value="@item.IdxTipo">@item.Descrizione</option>
|
||||
}
|
||||
</select>
|
||||
<button class="btn btn-secondary" @onclick="ResetTipo"><i class="fa-solid fa-rotate-right"></i></button>
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace SHERPA.AD.Pages
|
||||
get => HideInactive ? "Solo Attivi" : "Mostra tutti";
|
||||
}
|
||||
|
||||
protected List<vSelTipoModel> ListSelTipo { get; set; } = new List<vSelTipoModel>();
|
||||
protected List<AnagTipoDocModel> ListSelTipo { get; set; } = new List<AnagTipoDocModel>();
|
||||
|
||||
[Inject]
|
||||
protected MessageService MService { get; set; } = null!;
|
||||
@@ -61,10 +61,10 @@ namespace SHERPA.AD.Pages
|
||||
set => ActFilter.Anno = value;
|
||||
}
|
||||
|
||||
protected string SelTipo
|
||||
protected int SelTipo
|
||||
{
|
||||
get => ActFilter.CodTipo;
|
||||
set => ActFilter.CodTipo = value;
|
||||
get => ActFilter.IdxTipo;
|
||||
set => ActFilter.IdxTipo = value;
|
||||
}
|
||||
|
||||
protected bool showAll
|
||||
@@ -84,7 +84,7 @@ namespace SHERPA.AD.Pages
|
||||
MService.NotifyHeadChanged();
|
||||
ActFilter.EditEnab = true;
|
||||
SelAnno = DateTime.Today.Year;
|
||||
ListSelTipo = await SDService.VSelTipoGetAll();
|
||||
ListSelTipo = await SDService.TipoDocGetAll();
|
||||
toggleSync.leftString = "Tutti";
|
||||
toggleSync.rightString = "Filtro Tipo Doc + Anno";
|
||||
}
|
||||
@@ -162,7 +162,7 @@ namespace SHERPA.AD.Pages
|
||||
|
||||
private void ResetTipo()
|
||||
{
|
||||
SelTipo = "*";
|
||||
SelTipo = 0;
|
||||
}
|
||||
|
||||
private void SetClonedRec(CustomerModel itemSel)
|
||||
|
||||
@@ -99,7 +99,10 @@ namespace SHERPA.AD.Pages
|
||||
Anno = DateTime.Today.Year,
|
||||
IdxCli = 0,
|
||||
OnlySync = false,
|
||||
CodTipo = "Fattura"
|
||||
IdxTipo = 0
|
||||
#if false
|
||||
CodTipo = "Fattura"
|
||||
#endif
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -22,9 +22,10 @@
|
||||
<div class="input-group input-group-sm mb-1">
|
||||
<label class="input-group-text" style="width: 5rem;">Tipo Doc</label>
|
||||
<select class="form-select" @bind="@SelTipo">
|
||||
<option value="0">--- Tutti ---</option>
|
||||
@foreach (var item in ListSelTipo)
|
||||
{
|
||||
<option value="@item.value">@item.label</option>
|
||||
<option value="@item.IdxTipo">@item.Descrizione</option>
|
||||
}
|
||||
</select>
|
||||
<button class="btn btn-secondary" @onclick="ResetTipo"><i class="fa-solid fa-rotate-right"></i></button>
|
||||
@@ -58,7 +59,7 @@
|
||||
</button>
|
||||
</h2>
|
||||
<div id="accColl02" class="accordion-collapse collapse p-2" aria-labelledby="accHeadTwo" data-bs-parent="#accCloudSync">
|
||||
<VatManager Anno="@SelAnno" TipoDoc="@SelTipo" OnlyNeedSync="@needSync" CurrFilter="@VatFilter"></VatManager>
|
||||
<VatManager Anno="@SelAnno" IdxTipoDoc="@SelTipo" OnlyNeedSync="@needSync" CurrFilter="@VatFilter"></VatManager>
|
||||
</div>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace SHERPA.AD.Pages
|
||||
|
||||
protected SelectCli CliFilter { get; set; } = new SelectCli();
|
||||
protected SelectDocExp DocFilter { get; set; } = new SelectDocExp();
|
||||
protected List<vSelTipoModel> ListSelTipo { get; set; } = new List<vSelTipoModel>();
|
||||
protected List<AnagTipoDocModel> ListSelTipo { get; set; } = new List<AnagTipoDocModel>();
|
||||
|
||||
[Inject]
|
||||
protected MessageService MService { get; set; } = null!;
|
||||
@@ -41,13 +41,13 @@ namespace SHERPA.AD.Pages
|
||||
}
|
||||
}
|
||||
|
||||
protected string SelTipo
|
||||
protected int SelTipo
|
||||
{
|
||||
get => DocFilter.CodTipo;
|
||||
get => DocFilter.IdxTipo;
|
||||
set
|
||||
{
|
||||
DocFilter.CodTipo = value;
|
||||
CliFilter.CodTipo = value;
|
||||
DocFilter.IdxTipo = value;
|
||||
CliFilter.IdxTipo = value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace SHERPA.AD.Pages
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
SelAnno = DateTime.Today.Year;
|
||||
ListSelTipo = await SDService.VSelTipoGetAll();
|
||||
ListSelTipo = await SDService.TipoDocGetAll();
|
||||
toggleSync.leftString = "Tutti";
|
||||
toggleSync.rightString = "Need Sync";
|
||||
MService.NotifyHeadChanged();
|
||||
@@ -74,7 +74,7 @@ namespace SHERPA.AD.Pages
|
||||
|
||||
protected void ResetTipo()
|
||||
{
|
||||
SelTipo = "*";
|
||||
SelTipo = 0;
|
||||
}
|
||||
|
||||
protected void updToggSync(Toggler.SelectGlobalToggle newTogg)
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="@mainCss">
|
||||
<VatManager Anno="0" TipoDoc="*" OnlyNeedSync="false" EditEnab="true" SelEnab="true" CurrFilter="@ActFilter" UpdateCount="SetCount" RecSelected="SetCurrRec" RecCloned="SetClonedRec"></VatManager>
|
||||
<VatManager Anno="0" idxTipoDoc="*" OnlyNeedSync="false" EditEnab="true" SelEnab="true" CurrFilter="@ActFilter" UpdateCount="SetCount" RecSelected="SetCurrRec" RecCloned="SetClonedRec"></VatManager>
|
||||
</div>
|
||||
@if (SelRecord != null)
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace SHERPA.AD.Pages
|
||||
set => ActFilter.CurrPage = value;
|
||||
}
|
||||
|
||||
protected List<vSelTipoModel> ListSelTipo { get; set; } = new List<vSelTipoModel>();
|
||||
protected List<AnagTipoDocModel> ListSelTipo { get; set; } = new List<AnagTipoDocModel>();
|
||||
|
||||
[Inject]
|
||||
protected MessageService MService { get; set; } = null!;
|
||||
@@ -60,7 +60,7 @@ namespace SHERPA.AD.Pages
|
||||
{
|
||||
toggleSync.leftString = "Tutti";
|
||||
toggleSync.rightString = "Solo Attivi";
|
||||
ListSelTipo = await SDService.VSelTipoGetAll();
|
||||
ListSelTipo = await SDService.TipoDocGetAll();
|
||||
MService.NotifyHeadChanged();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>2.0.2308.3116</Version>
|
||||
<Version>2.0.2308.3117</Version>
|
||||
<Copyright>Egalware 2021+</Copyright>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<UserSecretsId>60fcdaab-6c1e-4bec-9d88-f7727ef1c12c</UserSecretsId>
|
||||
<ApplicationIcon>wwwroot\favicon.ico</ApplicationIcon>
|
||||
<Version>2.0.2308.3116</Version>
|
||||
<Version>2.0.2308.3117</Version>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Copyright>Egalware 2021+</Copyright>
|
||||
|
||||
@@ -370,22 +370,22 @@ namespace SHERPA.Data.Controllers
|
||||
/// <summary>
|
||||
/// Elenco Customers che richiedono sync tramite stored
|
||||
/// </summary>
|
||||
/// <param name="tipoDoc">Tipo doc, * = tutti</param>
|
||||
/// <param name="anno">Anno doc, 0=tutti</param>
|
||||
/// <param name="notUpl">Indica se solo non caricati (1 = NON caricati)</param>
|
||||
/// <param name="idxTipoDoc">Tipo doc, 0: tutti</param>
|
||||
/// <param name="anno">Anno doc, 0: tutti</param>
|
||||
/// <param name="notUpl">Indica se solo non caricati (1: NON caricati)</param>
|
||||
/// <returns></returns>
|
||||
public List<CustomerModel> CustomersToSync(string tipoDoc, int anno, bool notUpl)
|
||||
public List<CustomerModel> CustomersToSync(int idxTipoDoc, int anno, bool notUpl)
|
||||
{
|
||||
List<CustomerModel> dbResult = new List<CustomerModel>();
|
||||
using (SHERPAFattContext dbCtx = new SHERPAFattContext(_configuration))
|
||||
{
|
||||
SqlParameter Tipo = new SqlParameter("@tipo", tipoDoc);
|
||||
SqlParameter IdxTipo = new SqlParameter("@idxTipo", idxTipoDoc);
|
||||
SqlParameter Anno = new SqlParameter("@anno", anno);
|
||||
SqlParameter NotUpl = new SqlParameter("@notUpl", notUpl);
|
||||
|
||||
dbResult = dbCtx
|
||||
.DbSetCustomers
|
||||
.FromSqlRaw("EXEC stp_clienti_getByAnno @tipo,@anno,@notUpl", Tipo, Anno, NotUpl)
|
||||
.FromSqlRaw("EXEC stp_clienti_getByAnno @idxTipo,@anno,@notUpl", IdxTipo, Anno, NotUpl)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
@@ -935,22 +935,22 @@ namespace SHERPA.Data.Controllers
|
||||
/// <summary>
|
||||
/// Elenco VAT / CIva che richiedono sync tramite stored
|
||||
/// </summary>
|
||||
/// <param name="tipoDoc">Tipo doc, * = tutti</param>
|
||||
/// <param name="anno">Anno doc, 0=tutti</param>
|
||||
/// <param name="idxTipoDoc">Tipo doc, 0: tutti</param>
|
||||
/// <param name="anno">Anno doc, 0: tutti</param>
|
||||
/// <param name="notUpl">Indica se solo non caricati (1 = NON caricati)</param>
|
||||
/// <returns></returns>
|
||||
public List<VatModel> VATToSync(string tipoDoc, int anno, bool notUpl)
|
||||
public List<VatModel> VATToSync(int idxTipoDoc, int anno, bool notUpl)
|
||||
{
|
||||
List<VatModel> dbResult = new List<VatModel>();
|
||||
using (SHERPAFattContext dbCtx = new SHERPAFattContext(_configuration))
|
||||
{
|
||||
SqlParameter Tipo = new SqlParameter("@tipo", tipoDoc);
|
||||
SqlParameter IdxTipo = new SqlParameter("@idxTipo", idxTipoDoc);
|
||||
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)
|
||||
.FromSqlRaw("EXEC stp_VAT_getByAnno @idxTipo,@anno,@notUpl", IdxTipo, Anno, NotUpl)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
@@ -1003,32 +1003,34 @@ namespace SHERPA.Data.Controllers
|
||||
/// </summary>
|
||||
/// <param name="anno">anno di riferimento (0: tutti)</param>
|
||||
/// <param name="idxCli">Idx Cliente (0: tutti)</param>
|
||||
/// <param name="tipoDoc">tipo Doc (*=tutti)</param>
|
||||
/// <param name="idxTipoDoc">tipo Doc (0: tutti)</param>
|
||||
/// <param name="idxGruppo">Idx Gruppo (0: tutti)</param>
|
||||
/// <param name="ragSoc">tipo Doc (*=tutti)</param>
|
||||
/// <param name="ragSoc">tipo Doc (*: tutti)</param>
|
||||
/// <param name="inizio">Data inizio ricerca (emissione)</param>
|
||||
/// <param name="fine">Data inizio ricerca (emissione)</param>
|
||||
/// <param name="aperta">0 = tutto / 1 = aperta, NON pagata</param>
|
||||
/// <param name="aperta">0: tutto / 1: aperta, NON pagata</param>
|
||||
/// <param name="searchVal">Ricerca libera</param>
|
||||
/// <returns></returns>
|
||||
public List<vDocsExplModel> VDocExplGetFilt(int anno, int idxCli, string tipoDoc, string idxGruppo, string ragSoc, DateTime inizio, DateTime fine, int aperta, string searchVal)
|
||||
public List<vDocsExplModel> VDocExplGetFilt(int anno, int idxCli, int idxTipoDoc, string idxGruppo, string ragSoc, DateTime inizio, DateTime fine, int aperta, string searchVal)
|
||||
{
|
||||
List<vDocsExplModel> dbResult = new List<vDocsExplModel>();
|
||||
using (SHERPAFattContext dbCtx = new SHERPAFattContext(_configuration))
|
||||
{
|
||||
SqlParameter Anno = new SqlParameter("@anno", anno);
|
||||
SqlParameter IdxCli = new SqlParameter("@idxCli", idxCli);
|
||||
SqlParameter Tipo = new SqlParameter("@tipo", tipoDoc);
|
||||
SqlParameter IdxTipo = new SqlParameter("@idxTipo", idxTipoDoc);
|
||||
//SqlParameter Tipo = new SqlParameter("@tipo", tipoDoc);
|
||||
SqlParameter IdxGruppo = new SqlParameter("@idxGruppo", idxGruppo);
|
||||
SqlParameter RagSoc = new SqlParameter("@ragSoc", ragSoc);
|
||||
SqlParameter DataFrom = new SqlParameter("@inizio", inizio);
|
||||
SqlParameter DataTo = new SqlParameter("@fine", fine);
|
||||
SqlParameter Aperta = new SqlParameter("@aperta", aperta);
|
||||
SqlParameter Search = new SqlParameter("@search", searchVal);
|
||||
//SqlParameter Search = new SqlParameter("@search", searchVal);
|
||||
|
||||
dbResult = dbCtx
|
||||
.DbSetDocExpl
|
||||
.FromSqlRaw("EXEC stp_docs_getFilt @anno,@idxCli,@tipo,@idxGruppo,@ragSoc,@inizio,@fine,@aperta,@search", Anno, IdxCli, Tipo, IdxGruppo, RagSoc, DataFrom, DataTo, Aperta, Search)
|
||||
.FromSqlRaw("EXEC stp_docs_getFilt @anno,@idxCli,@idxTipo,@idxGruppo,@ragSoc,@inizio,@fine,@aperta", Anno, IdxCli, IdxTipo, IdxGruppo, RagSoc, DataFrom, DataTo, Aperta)
|
||||
//.FromSqlRaw("EXEC stp_docs_getFilt @anno,@idxCli,@idxTipo,@idxGruppo,@ragSoc,@inizio,@fine,@aperta,@search", Anno, IdxCli, IdxTipo, IdxGruppo, RagSoc, DataFrom, DataTo, Aperta, Search)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
@@ -1040,10 +1042,10 @@ namespace SHERPA.Data.Controllers
|
||||
/// <param name="showAll">0 = solo scadute ad oggi / 1 = Tutte</param>
|
||||
/// <param name="idxCli">Idx Cliente (0: tutti)</param>
|
||||
/// <param name="idxGruppo">Idx Gruppo (0: tutti)</param>
|
||||
/// <param name="idxDoc">IDX Doc (0=tutti)</param>
|
||||
/// <param name="tipoDoc">tipo Doc (*=tutti)</param>
|
||||
/// <param name="idxDoc">IDX Doc (0: tutti)</param>
|
||||
/// <param name="idxTipoDoc">tipo Doc (0: tutti)</param>
|
||||
/// <returns></returns>
|
||||
public List<vFattAperteModel> VFattAperteGetFilt(bool showAll, int idxCli, string idxGruppo, int idxDoc, string tipoDoc)
|
||||
public List<vFattAperteModel> VFattAperteGetFilt(bool showAll, int idxCli, string idxGruppo, int idxDoc, int idxTipoDoc)
|
||||
{
|
||||
List<vFattAperteModel> dbResult = new List<vFattAperteModel>();
|
||||
using (SHERPAFattContext dbCtx = new SHERPAFattContext(_configuration))
|
||||
@@ -1052,11 +1054,11 @@ namespace SHERPA.Data.Controllers
|
||||
SqlParameter IdxCli = new SqlParameter("@idxCli", idxCli);
|
||||
SqlParameter IdxGruppo = new SqlParameter("@idxGruppo", idxGruppo);
|
||||
SqlParameter IdxDoc = new SqlParameter("@idxDoc", idxDoc);
|
||||
SqlParameter TipoDoc = new SqlParameter("@tipoDoc", tipoDoc);
|
||||
SqlParameter IdxTipoDoc = new SqlParameter("@idxTipo", idxTipoDoc);
|
||||
|
||||
dbResult = dbCtx
|
||||
.DbSetFattAperte
|
||||
.FromSqlRaw("EXEC stp_fattureAperte @showAll,@idxCli,@idxGruppo,@idxDoc,@tipoDoc", ShowAll, IdxCli, IdxGruppo, IdxDoc, TipoDoc)
|
||||
.FromSqlRaw("EXEC stp_fattureAperte @showAll,@idxCli,@idxGruppo,@idxDoc,@idxTipo", ShowAll, IdxCli, IdxGruppo, IdxDoc, IdxTipoDoc)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
@@ -1128,6 +1130,7 @@ namespace SHERPA.Data.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
#if false
|
||||
public List<vSelTipoModel> VSelTipoGetAll()
|
||||
{
|
||||
List<vSelTipoModel> dbResult = new List<vSelTipoModel>();
|
||||
@@ -1139,7 +1142,8 @@ namespace SHERPA.Data.Controllers
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
public List<AnagTipoDocModel> TipoDocGetAll()
|
||||
{
|
||||
@@ -1148,6 +1152,7 @@ namespace SHERPA.Data.Controllers
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetTipoDoc
|
||||
.Where(x => x.IsActive)
|
||||
.OrderBy(x => x.Descrizione)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
@@ -6,9 +6,12 @@
|
||||
|
||||
public int Anno { get; set; } = 0;
|
||||
public int Aperta { get; set; } = 0;
|
||||
public string CodTipo { get; set; } = "*";
|
||||
#if false
|
||||
public string CodTipo { get; set; } = "*";
|
||||
#endif
|
||||
public DateTime Fine { get; set; } = new DateTime(DateTime.Today.Year + 1, 1, 1);
|
||||
public int IdxCli { get; set; } = 0;
|
||||
public int IdxTipo { get; set; } = 0;
|
||||
public string IdxGruppo { get; set; } = "0";
|
||||
public DateTime Inizio { get; set; } = new DateTime(DateTime.Today.Year, 1, 1);
|
||||
public bool OnlySync { get; set; } = false;
|
||||
@@ -25,7 +28,10 @@
|
||||
{
|
||||
Anno = this.Anno,
|
||||
IdxCli = this.IdxCli,
|
||||
CodTipo = this.CodTipo,
|
||||
#if false
|
||||
CodTipo = this.CodTipo,
|
||||
#endif
|
||||
IdxTipo= this.IdxTipo,
|
||||
IdxGruppo = this.IdxGruppo,
|
||||
RagSoc = this.RagSoc,
|
||||
Inizio = this.Inizio,
|
||||
@@ -51,9 +57,14 @@
|
||||
if (IdxCli != item.IdxCli)
|
||||
return false;
|
||||
|
||||
if (CodTipo != item.CodTipo)
|
||||
if (IdxTipo!= item.IdxTipo)
|
||||
return false;
|
||||
|
||||
#if false
|
||||
if (CodTipo != item.CodTipo)
|
||||
return false;
|
||||
#endif
|
||||
|
||||
if (IdxGruppo != item.IdxGruppo)
|
||||
return false;
|
||||
|
||||
|
||||
@@ -440,15 +440,15 @@ namespace SHERPA.Data.Services
|
||||
/// <summary>
|
||||
/// Elenco Customers che richiedono sync tramite stored
|
||||
/// </summary>
|
||||
/// <param name="tipoDoc">Tipo doc, * = tutti</param>
|
||||
/// <param name="anno">Anno doc, 0=tutti</param>
|
||||
/// <param name="idxTipoDoc">Tipo doc, 0: tutti</param>
|
||||
/// <param name="anno">Anno doc, 0: tutti</param>
|
||||
/// <param name="notUpl">Indica se solo non caricati (1 = NON caricati)</param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<CustomerModel>> CustomersToSync(string tipoDoc, int anno, bool notUpl)
|
||||
public async Task<List<CustomerModel>> CustomersToSync(int idxTipoDoc, int anno, bool notUpl)
|
||||
{
|
||||
string source = "DB";
|
||||
List<CustomerModel>? dbResult = new List<CustomerModel>();
|
||||
string currKey = $"{rKeySyncCust}:{anno}:{tipoDoc}:{notUpl}";
|
||||
string currKey = $"{rKeySyncCust}:{anno}:{idxTipoDoc}:{notUpl}";
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
string? rawData = await redisDb.StringGetAsync(currKey);
|
||||
@@ -467,7 +467,7 @@ namespace SHERPA.Data.Services
|
||||
}
|
||||
else
|
||||
{
|
||||
dbResult = dbController.CustomersToSync(tipoDoc, anno, notUpl);
|
||||
dbResult = dbController.CustomersToSync(idxTipoDoc, anno, notUpl);
|
||||
rawData = JsonConvert.SerializeObject(dbResult, JSSettings);
|
||||
await redisDb.StringSetAsync(currKey, rawData, FastCache);
|
||||
}
|
||||
@@ -912,15 +912,15 @@ namespace SHERPA.Data.Services
|
||||
/// <summary>
|
||||
/// Elenco VAT / CIva che richiedono sync tramite stored
|
||||
/// </summary>
|
||||
/// <param name="tipoDoc">Tipo doc, * = tutti</param>
|
||||
/// <param name="anno">Anno doc, 0=tutti</param>
|
||||
/// <param name="idxTipoDoc">Tipo doc, 0: tutti</param>
|
||||
/// <param name="anno">Anno doc, 0: tutti</param>
|
||||
/// <param name="notUpl">Indica se solo non caricati (1 = NON caricati)</param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<VatModel>> VATToSync(string tipoDoc, int anno, bool notUpl)
|
||||
public async Task<List<VatModel>> VATToSync(int idxTipoDoc, int anno, bool notUpl)
|
||||
{
|
||||
string source = "DB";
|
||||
List<VatModel>? dbResult = new List<VatModel>();
|
||||
string currKey = $"{rKeySyncVat}:{anno}:{tipoDoc}:{notUpl}";
|
||||
string currKey = $"{rKeySyncVat}:{anno}:{idxTipoDoc}:{notUpl}";
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
string? rawData = await redisDb.StringGetAsync(currKey);
|
||||
@@ -939,7 +939,7 @@ namespace SHERPA.Data.Services
|
||||
}
|
||||
else
|
||||
{
|
||||
dbResult = dbController.VATToSync(tipoDoc, anno, notUpl);
|
||||
dbResult = dbController.VATToSync(idxTipoDoc, anno, notUpl);
|
||||
rawData = JsonConvert.SerializeObject(dbResult, JSSettings);
|
||||
await redisDb.StringSetAsync(currKey, rawData, FastCache);
|
||||
}
|
||||
@@ -983,7 +983,7 @@ namespace SHERPA.Data.Services
|
||||
{
|
||||
string source = "DB";
|
||||
List<vDocsExplModel>? dbResult = new List<vDocsExplModel>();
|
||||
string currKey = $"{rKeyDocExp}:{cFilt.Anno}:{cFilt.IdxCli}:{cFilt.CodTipo}:{cFilt.IdxGruppo}:{cFilt.RagSoc}:{cFilt.Inizio:yyyyMMdd}:{cFilt.Fine:yyyyMMdd}:{cFilt.Aperta}:{cFilt.SearchVal}";
|
||||
string currKey = $"{rKeyDocExp}:{cFilt.Anno}:{cFilt.IdxCli}:{cFilt.IdxTipo}:{cFilt.IdxGruppo}:{cFilt.RagSoc}:{cFilt.Aperta}:{cFilt.Inizio:yyyyMMdd}:{cFilt.Fine:yyyyMMdd}:{cFilt.SearchVal}";
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
string? rawData = await redisDb.StringGetAsync(currKey);
|
||||
@@ -1002,7 +1002,7 @@ namespace SHERPA.Data.Services
|
||||
}
|
||||
else
|
||||
{
|
||||
dbResult = dbController.VDocExplGetFilt(cFilt.Anno, cFilt.IdxCli, cFilt.CodTipo, cFilt.IdxGruppo, cFilt.RagSoc, cFilt.Inizio, cFilt.Fine, cFilt.Aperta, cFilt.SearchVal);
|
||||
dbResult = dbController.VDocExplGetFilt(cFilt.Anno, cFilt.IdxCli, cFilt.IdxTipo, cFilt.IdxGruppo, cFilt.RagSoc, cFilt.Inizio, cFilt.Fine, cFilt.Aperta, cFilt.SearchVal);
|
||||
rawData = JsonConvert.SerializeObject(dbResult, JSSettings);
|
||||
await redisDb.StringSetAsync(currKey, rawData, LongCache);
|
||||
}
|
||||
@@ -1010,6 +1010,13 @@ namespace SHERPA.Data.Services
|
||||
{
|
||||
dbResult = new List<vDocsExplModel>();
|
||||
}
|
||||
// eventuale filtro in memoria x searchVal...
|
||||
if (!string.IsNullOrEmpty(cFilt.SearchVal) && cFilt.SearchVal != "*" && dbResult.Count > 0)
|
||||
{
|
||||
dbResult = dbResult
|
||||
.Where(x => x.Descrizione.Contains(cFilt.SearchVal, StringComparison.InvariantCultureIgnoreCase))
|
||||
.ToList();
|
||||
}
|
||||
sw.Stop();
|
||||
LogDebug($"VDocExplGetFilt | {source}", sw.Elapsed);
|
||||
return dbResult;
|
||||
@@ -1025,7 +1032,7 @@ namespace SHERPA.Data.Services
|
||||
{
|
||||
string source = "DB";
|
||||
List<vFattAperteModel>? dbResult = new List<vFattAperteModel>();
|
||||
string currKey = $"{rKeyFattAper}:{cFilt.Anno}:{cFilt.IdxCli}:{cFilt.CodTipo}:{cFilt.IdxGruppo}:{cFilt.Inizio:yyyyMMdd}:{cFilt.Fine:yyyyMMdd}:{cFilt.Aperta}:{cFilt.SearchVal}:{IdxDoc}";
|
||||
string currKey = $"{rKeyFattAper}:{cFilt.Anno}:{cFilt.IdxCli}:{cFilt.IdxTipo}:{cFilt.IdxGruppo}:{cFilt.Inizio:yyyyMMdd}:{cFilt.Fine:yyyyMMdd}:{cFilt.Aperta}:{IdxDoc}";
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
string? rawData = await redisDb.StringGetAsync(currKey);
|
||||
@@ -1044,7 +1051,7 @@ namespace SHERPA.Data.Services
|
||||
}
|
||||
else
|
||||
{
|
||||
dbResult = dbController.VFattAperteGetFilt(true, cFilt.IdxCli, cFilt.IdxGruppo, IdxDoc, cFilt.CodTipo);
|
||||
dbResult = dbController.VFattAperteGetFilt(true, cFilt.IdxCli, cFilt.IdxGruppo, IdxDoc, cFilt.IdxTipo);
|
||||
rawData = JsonConvert.SerializeObject(dbResult, JSSettings);
|
||||
await redisDb.StringSetAsync(currKey, rawData, LongCache);
|
||||
}
|
||||
@@ -1128,6 +1135,7 @@ namespace SHERPA.Data.Services
|
||||
LogDebug($"VSelGruppiGetAll | {source}", sw.Elapsed);
|
||||
return dbResult;
|
||||
}
|
||||
#if false
|
||||
/// <summary>
|
||||
/// DEPRECATED: Elenco tipo doc
|
||||
/// </summary>
|
||||
@@ -1166,7 +1174,8 @@ namespace SHERPA.Data.Services
|
||||
sw.Stop();
|
||||
LogDebug($"VSelTipoGetAll | {source}", sw.Elapsed);
|
||||
return dbResult;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Elenco tipo documenti
|
||||
|
||||
Reference in New Issue
Block a user