Merge branch 'release/FixCalcoloImporti'
This commit is contained in:
@@ -608,6 +608,7 @@ namespace SHERPA.BBM.CORE.Controllers
|
||||
.Where(x => (x.IsActive || ShowAll) && (x.Negotiation.BasketId == BasketId || BasketId == 1) && (x.NegotiationId == NegotiationId || NegotiationId == 1))
|
||||
.Include(d => d.Negotiation)
|
||||
.Include(d => d.FattNav)
|
||||
.Include(d => d.ResNav)
|
||||
.OrderByDescending(x => x.CodDoc)
|
||||
.OrderByDescending(x => x.DataIns)
|
||||
.ToList();
|
||||
|
||||
@@ -5,8 +5,6 @@ VisualStudioVersion = 16.0.31911.196
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VersGen", "VersGen\VersGen.csproj", "{6AE920DD-D404-4781-B6D6-CABCA89FB42D}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SHERPA.BBM", "SHERPA.BBM\SHERPA.BBM.csproj", "{248D0FE3-14C4-4205-AB5B-536755B93951}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SHERPA.BBM.UI", "SHERPA.BBM.UI\SHERPA.BBM.UI.csproj", "{BE36EFC1-CFCA-4A96-B75F-1CB233976B56}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SHERPA.BBM.CORE", "SHERPA.BBM.CORE\SHERPA.BBM.CORE.csproj", "{7F034BDE-53D8-4B08-B6C8-25BBCC70BB23}"
|
||||
@@ -21,10 +19,6 @@ Global
|
||||
{6AE920DD-D404-4781-B6D6-CABCA89FB42D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{6AE920DD-D404-4781-B6D6-CABCA89FB42D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{6AE920DD-D404-4781-B6D6-CABCA89FB42D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{248D0FE3-14C4-4205-AB5B-536755B93951}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{248D0FE3-14C4-4205-AB5B-536755B93951}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{248D0FE3-14C4-4205-AB5B-536755B93951}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{248D0FE3-14C4-4205-AB5B-536755B93951}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{BE36EFC1-CFCA-4A96-B75F-1CB233976B56}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{BE36EFC1-CFCA-4A96-B75F-1CB233976B56}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{BE36EFC1-CFCA-4A96-B75F-1CB233976B56}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
|
||||
@@ -126,12 +126,18 @@
|
||||
<div>@record.Descript</div>
|
||||
<div class="small">@record.Note</div>
|
||||
</td>
|
||||
<td class="text-right" title="Importo"><b>@getImporto(@record.Anno, @record.DocId).Result.ToString("C2")</b></td>
|
||||
<td class="text-right" title="Importo">
|
||||
<b>@getImporto(record).ToString("C2")</b>
|
||||
@*<b>@getImporto(@record.Anno, @record.DocId).Result.ToString("C2")</b>*@
|
||||
</td>
|
||||
<td class="text-right">
|
||||
@if (record.DocType == BbmDocType.ConfermaOrdine || record.DocType == BbmDocType.Licenza)
|
||||
{
|
||||
<div title="Fatturato"><b>@getFatturato(@record.Anno, @record.DocId).Result.ToString("C2")</b> [F]</div>
|
||||
<div title="Incassato" class="small">@getIncassato(@record.Anno, @record.DocId).Result.ToString("C2") [I]</div>
|
||||
<div title="Fatturato">
|
||||
<b>@getFatturato(record).ToString("C2")</b> [F]
|
||||
</div>
|
||||
<div title="Incassato" class="small">@getIncassato(record).ToString("C2") [I]</div>
|
||||
@*<div title="Incassato" class="small">@getIncassato(@record.Anno, @record.DocId).Result.ToString("C2") [I]</div>*@
|
||||
}
|
||||
</td>
|
||||
<td class="text-right"><button class="btn btn-sm btn-danger" @onclick="() => Delete(record)"><span class="oi oi-trash"></span></button></td>
|
||||
|
||||
@@ -187,6 +187,7 @@ namespace SHERPA.BBM.UI.Pages
|
||||
await ReloadAllData();
|
||||
}
|
||||
|
||||
#if false
|
||||
protected async Task<decimal> getFatturato(int anno, int docId)
|
||||
{
|
||||
decimal fatturato = 0;
|
||||
@@ -198,8 +199,7 @@ namespace SHERPA.BBM.UI.Pages
|
||||
catch
|
||||
{ }
|
||||
return fatturato;
|
||||
}
|
||||
|
||||
}
|
||||
protected async Task<double> getImporto(int anno, int docId)
|
||||
{
|
||||
double grandTot = 0;
|
||||
@@ -210,7 +210,7 @@ namespace SHERPA.BBM.UI.Pages
|
||||
}
|
||||
return grandTot;
|
||||
}
|
||||
|
||||
|
||||
protected async Task<decimal> getIncassato(int anno, int docId)
|
||||
{
|
||||
decimal incassato = 0;
|
||||
@@ -223,6 +223,43 @@ namespace SHERPA.BBM.UI.Pages
|
||||
{ }
|
||||
return incassato;
|
||||
}
|
||||
#endif
|
||||
|
||||
protected decimal getFatturato(CORE.DbModels.DocsModel currRecord)
|
||||
{
|
||||
decimal fatturato = 0;
|
||||
try
|
||||
{
|
||||
fatturato = currRecord.FattNav.Sum(f => f.Importo);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return fatturato;
|
||||
}
|
||||
|
||||
protected double getImporto(CORE.DbModels.DocsModel currRecord)
|
||||
{
|
||||
double grandTot = 0;
|
||||
try
|
||||
{
|
||||
grandTot = currRecord.ResNav.Sum(r => r.FinalPrice);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return grandTot;
|
||||
}
|
||||
|
||||
protected decimal getIncassato(CORE.DbModels.DocsModel currRecord)
|
||||
{
|
||||
decimal fatturato = 0;
|
||||
try
|
||||
{
|
||||
fatturato = currRecord.FattNav.Sum(f => f.Incassato);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return fatturato;
|
||||
}
|
||||
|
||||
protected async Task NewRelease(CORE.DbModels.DocsModel currRecord)
|
||||
{
|
||||
@@ -231,14 +268,6 @@ namespace SHERPA.BBM.UI.Pages
|
||||
|
||||
// recupero counter
|
||||
int lastDot = currRecord.CodDoc.LastIndexOf(".");
|
||||
#if false
|
||||
// se è licenza duplico " a pari livello"...
|
||||
if (currRecord.DocType >= BbmDocType.Licenza)
|
||||
{
|
||||
lastDot = currRecord.CodDoc.Substring(0, lastDot).LastIndexOf(".");
|
||||
}
|
||||
#endif
|
||||
|
||||
string oldCode = currRecord.CodDoc.Substring(0, lastDot);
|
||||
string newCode = BBMService.CounterGetNext(oldCode, 2);
|
||||
CORE.DbModels.DocsModel newRecord = new CORE.DbModels.DocsModel()
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<UserSecretsId>60fcdaab-6c1e-4bec-9d88-f7727ef1c12c</UserSecretsId>
|
||||
<ApplicationIcon>wwwroot\favicon.ico</ApplicationIcon>
|
||||
<Version>1.0.2112.0315</Version>
|
||||
<Version>1.0.2112.0316</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user