Update generali gestione ordine

This commit is contained in:
Samuele Locatelli
2024-02-10 12:32:38 +01:00
parent f810f0bdee
commit 341abbfcc0
19 changed files with 143 additions and 32 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>2.0.2402.0217</Version>
<Version>2.0.2402.1012</Version>
<Copyright>Egalware 2021+</Copyright>
</PropertyGroup>
+3 -3
View File
@@ -78,7 +78,7 @@ namespace SHERPA.BBM.CORE.DbModels
{
answ = (decimal)ResNav.Sum(r => r.FinalPrice);
}
return answ;
return Math.Round(answ, 2);
}
}
@@ -99,13 +99,13 @@ namespace SHERPA.BBM.CORE.DbModels
answ = B2ONav.Sum(f => f.Amount);
//answ = B2ONav.Sum(f => f.BillNav.Amount);
}
return answ;
return Math.Round(answ, 2);
}
}
[NotMapped]
public decimal AmountOpen
{
get => AmountReq - BillTot;
get => Math.Round(AmountReq - BillTot, 2);
}
[NotMapped]
@@ -81,6 +81,12 @@ namespace SHERPA.BBM.UI.Components
#endregion Protected Fields
#region Protected Properties
#endregion Protected Properties
#region Protected Methods
protected async Task ForceReload(int newNum)
+30 -1
View File
@@ -203,6 +203,8 @@ namespace SHERPA.BBM.UI.Data
{
dbResult = dbResult.Where(x => x.Descript.Contains(SearchVal, StringComparison.InvariantCultureIgnoreCase)).ToList();
}
// riordino x codice...
dbResult = dbResult.OrderByDescending(x => x.CodBasket).ToList();
stopWatch.Stop();
LogDebug($"BasketsGetAsync | {source} ", stopWatch.Elapsed);
return Task.FromResult(dbResult);
@@ -802,7 +804,7 @@ namespace SHERPA.BBM.UI.Data
dbController.CustomerUpdate(currItem);
await FlushRedisCache();
}
catch(Exception exc)
catch (Exception exc)
{
Log.Error($"Eccezione in CustomerUpdate{Environment.NewLine}{exc}");
}
@@ -922,6 +924,12 @@ namespace SHERPA.BBM.UI.Data
return dbResult;
}
/// <summary>
/// sposta documento nella negoziazione richiesta
/// </summary>
/// <param name="DocId"></param>
/// <param name="NegotiationId"></param>
/// <returns></returns>
public async Task<bool> DocsMoveNegot(int DocId, int NegotiationId)
{
bool answ = false;
@@ -1373,6 +1381,27 @@ namespace SHERPA.BBM.UI.Data
return Task.FromResult(dbController.NegotGetByKey(NegotId));
}
/// <summary>
/// Sposta negoziazione nel basket indicato
/// </summary>
/// <param name="NegotiationId"></param>
/// <param name="BasketId"></param>
/// <returns></returns>
public async Task<bool> NegotiationMoveBasket(int NegotiationId, int BasketId)
{
bool answ = false;
try
{
answ = dbController.NegotiationMoveBasket(NegotiationId, BasketId);
await FlushRedisCache();
}
catch (Exception exc)
{
LogException("Eccezione durante NegotiationMoveBasket", exc);
}
return answ;
}
public Task<List<NegotiationsModel>> NegotiationsGetAllAsync()
{
return Task.FromResult(dbController.NegotGetAllDesc());
+3 -1
View File
@@ -124,6 +124,7 @@ namespace SHERPA.BBM.UI.Pages
CodBasket = newCode,
DataIns = DateTime.Now,
Descript = "New Basket",
Anno = DateTime.Today.Year,
IsActive = true
};
currItem = newRecord;
@@ -450,7 +451,8 @@ namespace SHERPA.BBM.UI.Pages
{
// init variabili
var filtSelData = new BBM_SelectData();
filtSelData.YearSel = 0;
filtSelData.YearSel = currRecord.Anno;
//filtSelData.YearSel = 0;
filtSelData.CompanyId = currRecord.CompanyId;
// salvo codice company...
var currComp = CompanyList.Where(x => x.CompanyId == currRecord.CompanyId).FirstOrDefault();
+18 -4
View File
@@ -34,6 +34,21 @@ namespace SHERPA.BBM.UI.Pages
protected int SelNegIdDx { get; set; }
protected int SelNegIdSx { get; set; }
protected int YearSel
{
get => yearSel;
set
{
if (yearSel != value)
{
yearSel = value;
// condiziono visualizzazione...
var pUpd = Task.Run(async () => await ReloadAllData());
pUpd.Wait();
}
}
}
#endregion Protected Properties
#region Protected Methods
@@ -69,14 +84,14 @@ namespace SHERPA.BBM.UI.Pages
protected async Task ReloadDataDx()
{
CustomersList = await BBMService.CustomersGetAll("");
BasketListDx = await BBMService.BasketsGetAsync(1, 0);
BasketListDx = await BBMService.BasketsGetAsync(1, YearSel);
NegotiationListDx = await BBMService.NegotiationsGetAsync(YearSel, 1, SelCustomerIdDx, SelBasketIdDx, "");
}
protected async Task ReloadDataSx()
{
CustomersList = await BBMService.CustomersGetAll("");
BasketListSx = await BBMService.BasketsGetAsync(1, 0);
BasketListSx = await BBMService.BasketsGetAsync(1, YearSel);
NegotiationListSx = await BBMService.NegotiationsGetAsync(YearSel, 1, SelCustomerIdSx, SelBasketIdSx, "");
}
@@ -93,8 +108,7 @@ namespace SHERPA.BBM.UI.Pages
private List<vNegotiationsDataModel> NegotiationListDx = new List<vNegotiationsDataModel>();
private List<vNegotiationsDataModel> NegotiationListSx = new List<vNegotiationsDataModel>();
private int YearSel = 0;
private int yearSel = 0;
private List<int> yearsList = new List<int>();
+1 -1
View File
@@ -9,7 +9,7 @@ else
{
<div class="card">
<div class="card-header bg-dark text-light">
<OrderFilt FilterUpdated="SetFilter" Title="Riconciliazione" SelCustId="SelCustId" SelBaskId="SelBaskId"></OrderFilt>
<OrderFilt FilterUpdated="SetFilter" Title="Riconciliazione" SelCustId="SelCustId" SelBaskId="SelBaskId" SelYearRef="@SelFilter.YearSel"></OrderFilt>
</div>
<div class="card-body p-1">
<div class="row small">
+7 -2
View File
@@ -50,7 +50,8 @@ namespace SHERPA.BBM.UI.Pages
// era intero pagato, ora prendo il valore del movimento
// decimal pagato = (BillPaid == BillNetTot || BillPaid == BillAmountTot) ? BillPaid : 0;
//decimal pagato = AccMovSel.Amount;
decimal pagato = AccMovSel.Paid;
//decimal pagato = AccMovSel.Paid;
decimal pagato = (BillPaid == BillNetTot || BillPaid == BillAmountTot) ? AccMovSel.Amount : AccMovSel.Paid;
await BBMService.AccMovUpdateBill(AccMovSel.AccMovId, SelIdxBill, pagato);
}
MService.SearchVal = "";
@@ -175,7 +176,11 @@ namespace SHERPA.BBM.UI.Pages
private bool LinkEnabled
{
get => OrdAmountTot != 0 && ((OrdAmountTot == BillAmountTot || OrdAmountTot == BillNetTot) || (forceLink && (Math.Abs(OrdAmountTot) <= Math.Abs(BillNetTot))));
get
{
bool answ = OrdAmountTot != 0 && ((OrdAmountTot == BillAmountTot || OrdAmountTot == BillNetTot) || (forceLink && (Math.Abs(OrdAmountTot) <= Math.Abs(BillNetTot))));
return answ;
}
}
private decimal OrdAmountTot
+1 -1
View File
@@ -74,8 +74,8 @@
<tr class="@checkSelect(@record.ResourceId)">
<td>
<button class="btn btn-sm btn-info" @onclick="() => Edit(record)"><span class="fas fa-pen"></span></button>
<button class="btn btn-sm btn-outline-info" @onclick="() => Move(record, 1)"><span class="oi oi-arrow-top"></span></button>&nbsp;<button class="btn btn-sm btn-outline-info" @onclick="() => Move(record, -1)"><span class="oi oi-arrow-bottom"></span></button>
<button class="btn btn-sm btn-info" @onclick="() => Clone(record)"><span class="fas fa-magic"></span></button>
</td>
<td>
<div class="d-flex justify-content-between font-weight-bold">
+24 -8
View File
@@ -63,7 +63,7 @@ namespace SHERPA.BBM.UI.Pages
if (currDoc != null)
{
// nuovo record risorsa
CORE.DbModels.ResourcesModel newRecord = new CORE.DbModels.ResourcesModel()
ResourcesModel newRecord = new ResourcesModel()
{
DocId = currDoc.DocId,
ItemId = 0,
@@ -77,7 +77,7 @@ namespace SHERPA.BBM.UI.Pages
}
}
protected async Task Delete(CORE.DbModels.ResourcesModel currRecord)
protected async Task Delete(ResourcesModel currRecord)
{
if (!await JSRuntime.InvokeAsync<bool>("confirm", $"Sicuro di voler eliminare il Documento '{currRecord.ResourceId}'?"))
return;
@@ -86,10 +86,26 @@ namespace SHERPA.BBM.UI.Pages
await UpdateData();
}
protected void Edit(CORE.DbModels.ResourcesModel currRecord)
protected void Edit(ResourcesModel currRecord)
{
currItem = currRecord;
}
protected void Clone(ResourcesModel currRecord)
{
int newOrd = SearchRecords != null ? SearchRecords.Count + 1 : 1;
currItem = new ResourcesModel()
{
DocId = currRecord.DocId,
ItemId = currRecord.ItemId,
Anno = currRecord.Anno,
Note = currRecord.Note,
QtyPrev = currRecord.QtyPrev,
QtyOff = currRecord.QtyOff,
UnitPriceOff = currRecord.UnitPriceOff,
Ordinal = newOrd
};
}
protected async Task ForceReload(int newNum)
{
@@ -127,7 +143,7 @@ namespace SHERPA.BBM.UI.Pages
return grandTot;
}
protected async Task Move(CORE.DbModels.ResourcesModel currRecord, int move)
protected async Task Move(ResourcesModel currRecord, int move)
{
await BBMService.ResourceUpdateOrder(currRecord.ResourceId, move);
await updateTable();
@@ -183,12 +199,12 @@ namespace SHERPA.BBM.UI.Pages
#region Private Fields
private CORE.DbModels.DocsModel? currDoc = null;
private DocsModel? currDoc = null;
private CORE.DbModels.ResourcesModel? currItem = null;
private ResourcesModel? currItem = null;
private List<CORE.DbModels.ResourcesModel> ListRecords = new List<CORE.DbModels.ResourcesModel>();
private List<CORE.DbModels.ResourcesModel> SearchRecords = new List<CORE.DbModels.ResourcesModel>();
private List<ResourcesModel> ListRecords = new List<ResourcesModel>();
private List<ResourcesModel> SearchRecords = new List<ResourcesModel>();
#endregion Private Fields
+6 -1
View File
@@ -81,7 +81,12 @@ else
</div>
<div class="px-2 flex-fill h3 text-right">
<b>@item.Incassato.ToString("C2")</b>
<div class="small" title="Fatture Incassate"><sub>@((item.Incassato / item.Fatturato).ToString("P1"))</sub></div>
<div class="small" title="Fatture Incassate"><sub>
@if (item.Fatturato > 0)
{
@((item.Incassato / item.Fatturato).ToString("P1"))
}
</sub></div>
</div>
</div>
</div>
+1 -1
View File
@@ -4,7 +4,7 @@
<TargetFramework>net6.0</TargetFramework>
<UserSecretsId>60fcdaab-6c1e-4bec-9d88-f7727ef1c12c</UserSecretsId>
<ApplicationIcon>wwwroot\favicon.ico</ApplicationIcon>
<Version>2.0.2402.0217</Version>
<Version>2.0.2402.1012</Version>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Copyright>Egalware 2021+</Copyright>
+9 -1
View File
@@ -45,6 +45,14 @@
</span>
</NavLink>
</div>
<div class="nav-item px-2">
<NavLink class="nav-link" href="NegotMover">
<span title="Spostamento Trattative">
<i class="fas fa-exchange-alt px-3" aria-hidden="true"></i>
<span class="@hideText">Sposta Tratt.</span>
</span>
</NavLink>
</div>
<div class="nav-item px-2">
<NavLink class="nav-link" href="Docs">
<span title="Documenti, Offerte, Conferme">
@@ -56,7 +64,7 @@
<div class="nav-item px-2">
<NavLink class="nav-link" href="DocMover">
<span title="Spostamento Documenti">
<i class="fas fa-exchange-alt pr-3" aria-hidden="true"></i>
<i class="fas fa-exchange-alt px-3" aria-hidden="true"></i>
<span class="@hideText">Sposta Docs</span>
</span>
</NavLink>
+1 -1
View File
@@ -40,7 +40,7 @@
}
.nav-item {
font-size: 0.9rem;
padding-bottom: 0.5rem;
padding-bottom: 0.2rem;
}
.nav-item:first-of-type {
padding-top: 1rem;
+1 -1
View File
@@ -46,7 +46,7 @@
.nav-item {
font-size: 0.9rem;
padding-bottom: 0.5rem;
padding-bottom: 0.2rem;
}
.nav-item:first-of-type {
+1 -1
View File
@@ -1 +1 @@
.navbar-toggler{background-color:rgba(255,255,255,.1);}.navbar-home{background-color:#f7dfc7;}.top-row{height:3.5rem;background:linear-gradient(90deg,#000 0%,#212121 60%,#2e2e2e 100%);}.navbar{padding:.25rem .25rem;}.navbar-brand{font-size:1.5rem;font-weight:bold;background:-webkit-linear-gradient(135deg,#d8951c,#faf2a2,#c8850c);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-size:400% 400%;animation:gradient-bg 8s linear infinite;}@keyframes gradient-bg{0%,80%{background-position:0% 50%;}90%{background-position:100% 50%;}100%{background-position:0% 50%;}}.oi{width:2rem;font-size:1.1rem;vertical-align:text-top;top:-2px;}.nav-item{font-size:.9rem;padding-bottom:.5rem;}.nav-item:first-of-type{padding-top:1rem;}.nav-item:last-of-type{padding-bottom:1rem;}.nav-item ::deep a{color:#d7d7d7;border-radius:4px;height:3rem;display:flex;align-items:center;line-height:3rem;}.nav-item ::deep a.active{background-color:rgba(255,255,255,.25);color:#fff;}.nav-item ::deep a:hover{background-color:rgba(255,255,255,.1);color:#fff;}@media(min-width:641px){.navbar-toggler{display:none;}.collapse{display:block;}}
.navbar-toggler{background-color:rgba(255,255,255,.1);}.navbar-home{background-color:#f7dfc7;}.top-row{height:3.5rem;background:linear-gradient(90deg,#000 0%,#212121 60%,#2e2e2e 100%);}.navbar{padding:.25rem .25rem;}.navbar-brand{font-size:1.5rem;font-weight:bold;background:-webkit-linear-gradient(135deg,#d8951c,#faf2a2,#c8850c);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-size:400% 400%;animation:gradient-bg 8s linear infinite;}@keyframes gradient-bg{0%,80%{background-position:0% 50%;}90%{background-position:100% 50%;}100%{background-position:0% 50%;}}.oi{width:2rem;font-size:1.1rem;vertical-align:text-top;top:-2px;}.nav-item{font-size:.9rem;padding-bottom:.2rem;}.nav-item:first-of-type{padding-top:1rem;}.nav-item:last-of-type{padding-bottom:1rem;}.nav-item ::deep a{color:#d7d7d7;border-radius:4px;height:3rem;display:flex;align-items:center;line-height:3rem;}.nav-item ::deep a.active{background-color:rgba(255,255,255,.25);color:#fff;}.nav-item ::deep a:hover{background-color:rgba(255,255,255,.1);color:#fff;}@media(min-width:641px){.navbar-toggler{display:none;}.collapse{display:block;}}
+4 -4
View File
@@ -7,10 +7,6 @@
"outputFile": "wwwroot/css/fonts.css",
"inputFile": "wwwroot/css/fonts.less"
},
{
"outputFile": "Shared/NavMenu.razor.css",
"inputFile": "Shared/NavMenu.razor.less"
},
{
"outputFile": "Shared/MainLayout.razor.css",
"inputFile": "Shared/MainLayout.razor.less"
@@ -26,5 +22,9 @@
{
"outputFile": "Pages/Unauthorized.razor.css",
"inputFile": "Pages/Unauthorized.razor.less"
},
{
"outputFile": "Shared/NavMenu.razor.css",
"inputFile": "Shared/NavMenu.razor.less"
}
]
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long