aggiunti metodi per:
-mostrare flusso selezionato -duplicare flusso -eliminare flusso -modificare flusso
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
{
|
||||
|
||||
|
||||
<div class="card my-2" style="height: 33rem;">
|
||||
<div class="card my-2" style="height: 40rem;">
|
||||
<div class="card-header d-flex justify-content-between ">
|
||||
<div class="d-flex flex-wrap align-content-center">
|
||||
<b>Dettagli articolo</b>
|
||||
@@ -21,7 +21,7 @@
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="w-100 modItem">
|
||||
<div class="form-floating mb-1">
|
||||
<div class="form-floating mb-2">
|
||||
<select id="pos" @bind="@itemToDet.ItemFamilyId" class="form-select" style="@enable">
|
||||
@if (itemFams != null)
|
||||
{
|
||||
@@ -33,23 +33,23 @@
|
||||
</select>
|
||||
<label for="famid" class="form-label">Categoria</label>
|
||||
</div>
|
||||
<div class="form-floating">
|
||||
<div class="form-floating mb-2">
|
||||
<textarea id="descArt" @bind="@itemToDet.Descr" class="form-control w-100" rows="3" style="@enable"></textarea>
|
||||
<label for="descArt" class="form-label">Descr. Articolo</label>
|
||||
</div>
|
||||
<div class="form-floating">
|
||||
<div class="form-floating mb-2">
|
||||
<input id="codArt" @bind="@itemToDet.CodInt" class="form-control w-100 my-1" style="@enable" />
|
||||
<label for="codArt" class="form-label">Cod. Articolo</label>
|
||||
</div>
|
||||
<div class="form-floating">
|
||||
<div class="form-floating mb-2">
|
||||
<input id="codExt" @bind="@itemToDet.CodExt" class="form-control w-100 my-1" style="@enable" />
|
||||
<label for="codExt" class="form-label">Cod. Fornitore</label>
|
||||
</div>
|
||||
<div class="form-floating">
|
||||
<textarea id="descExt" @bind="@itemToDet.DescrExt" class="form-control w-100" rows="5" style="@enable"></textarea>
|
||||
<div class="form-floating mb-2">
|
||||
<textarea id="descExt" @bind="@itemToDet.DescrExt" class="form-control w-100" rows="6" style="@enable"></textarea>
|
||||
<label for="descExt" class="form-label">Descr. Fornitore</label>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="row mb-2">
|
||||
<div class="form-floating col">
|
||||
<input id="qtaMin" type="number" @bind="@itemToDet.QtaMin" class="form-control w-100 my-1" style="@enable" />
|
||||
<label for="qtaMin" class="form-label">Giacenza Minima</label>
|
||||
@@ -59,7 +59,7 @@
|
||||
<label for="qtaBatch" class="form-label">Lotto Acquisto</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="row mb-2">
|
||||
<div class="form-floating col">
|
||||
<input id="currVal" type="number" @bind="@itemToDet.CurrValue" class="form-control w-100 my-1" style="@enable" />
|
||||
<label for="currVal" class="form-label">Valore Unit.</label>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
.modItem select {
|
||||
font-size: 0.8rem;
|
||||
background-color: #e9ecef;
|
||||
height: auto;
|
||||
}
|
||||
.buttonGlobal {
|
||||
border-radius: 50%;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
.modItem input, .modItem textarea, .modItem select {
|
||||
font-size: 0.8rem;
|
||||
background-color: #e9ecef;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.buttonGlobal {
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
.modItem input,.modItem textarea,.modItem select{font-size:.8rem;background-color:#e9ecef;}.buttonGlobal{border-radius:50%;padding:.5rem;width:2.8rem;height:2.8rem;border:0;padding:0;text-align:center;margin-right:1rem;}.btnMod{border-radius:50%;padding:.5rem;width:2.8rem;height:2.8rem;border:0;padding:0;text-align:center;margin-right:1rem;background-color:rgba(52,152,219,.2);color:#3498db;}.btnAccept{border-radius:50%;padding:.5rem;width:2.8rem;height:2.8rem;border:0;padding:0;text-align:center;margin-right:1rem;background-color:rgba(86,184,167,.2);color:#56b8a7;}.btnDecline{border-radius:50%;padding:.5rem;width:2.8rem;height:2.8rem;border:0;padding:0;text-align:center;margin-right:1rem;background-color:rgba(192,57,43,.2);color:#c0392b;}
|
||||
.modItem input,.modItem textarea,.modItem select{font-size:.8rem;background-color:#e9ecef;height:auto;}.buttonGlobal{border-radius:50%;padding:.5rem;width:2.8rem;height:2.8rem;border:0;padding:0;text-align:center;margin-right:1rem;}.btnMod{border-radius:50%;padding:.5rem;width:2.8rem;height:2.8rem;border:0;padding:0;text-align:center;margin-right:1rem;background-color:rgba(52,152,219,.2);color:#3498db;}.btnAccept{border-radius:50%;padding:.5rem;width:2.8rem;height:2.8rem;border:0;padding:0;text-align:center;margin-right:1rem;background-color:rgba(86,184,167,.2);color:#56b8a7;}.btnDecline{border-radius:50%;padding:.5rem;width:2.8rem;height:2.8rem;border:0;padding:0;text-align:center;margin-right:1rem;background-color:rgba(192,57,43,.2);color:#c0392b;}
|
||||
@@ -39,7 +39,7 @@ else
|
||||
@if (!editMode)
|
||||
{
|
||||
<td class="d-flex justify-content-center">
|
||||
<button class="btnDet" @onclick="()=>selectItem(item)"><i class="fa-solid fa-magnifying-glass-plus"></i></button>
|
||||
<button class="btnDet" @onclick="()=>selectItem(item)"><i class="fa-solid fa-magnifying-glass"></i></button>
|
||||
<button class="btnEdit" @onclick="()=>enableEdit(item.Id)"><i class="fa-solid fa-pen-to-square"></i></button>
|
||||
</td>
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="w-50 d-flex justify-content-between">
|
||||
<div class="form-floating">
|
||||
<div class="w-50 d-flex row py-1">
|
||||
<div class="form-floating col">
|
||||
<select id="fam" @bind="searchFamily" class="form-select">
|
||||
<option value="*">--TUTTI--</option>
|
||||
@if (itemFamList != null)
|
||||
@@ -13,7 +13,7 @@
|
||||
</select>
|
||||
<label for="fam">Famiglia articoli</label>
|
||||
</div>
|
||||
<div class="form-floating">
|
||||
<div class="form-floating col">
|
||||
<input id="search" @bind="searchVal" class="form-control" />
|
||||
<label for="search">Search</label>
|
||||
</div>
|
||||
@@ -99,7 +99,7 @@ else
|
||||
{
|
||||
<tr class="small">
|
||||
<td class="d-flex justify-content-center">
|
||||
<button class="btnDet" @onclick="()=>selItemToDet(item.Id)"><i class="fa-solid fa-magnifying-glass-plus"></i></button>
|
||||
<button class="btnDet" @onclick="()=>selItemToDet(item.Id)"><i class="fa-solid fa-magnifying-glass"></i></button>
|
||||
</td>
|
||||
<td>
|
||||
@item.CodInt
|
||||
@@ -134,7 +134,7 @@ else
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="modalNewFamLabel">Aggiungere nuova famiglia articoli</h1>
|
||||
<h1 class="modal-title fs-5" id="modalNewFamLabel">Aggiungere nuovo articolo</h1>
|
||||
<button type="button" class="btn-close" aria-label="Close" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<div class="card my-2 @cardCss">
|
||||
<div class="card-header @headerCss">
|
||||
<b>Stock Giacenze</b>
|
||||
<div class="card my-2 ">
|
||||
<div class="card-header">
|
||||
<b>Movimenti</b>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-striped table-bordered">
|
||||
@@ -56,6 +56,21 @@
|
||||
<td>
|
||||
@flux.ExtLocationId
|
||||
</td>
|
||||
<td>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="d-flex justify-content-between">
|
||||
<button class="btnAccept" @onclick="()=>setItem(flux)" data-bs-toggle="modal" data-bs-target="#modalShowFlux"><i class="fa-solid fa-magnifying-glass"></i></button>
|
||||
<button class="btnDup" @onclick="()=>dupItem(flux)" data-bs-toggle="modal" data-bs-target="#modalShowFlux"><i class="fa-solid fa-copy"></i></button>
|
||||
</div>
|
||||
@if (flux.DtExport == null)
|
||||
{
|
||||
<div class="d-flex justify-content-between">
|
||||
<button class="btnMod" @onclick="()=>editMode(flux)" data-bs-toggle="modal" data-bs-target="#modalShowFlux"><i class="fa-solid fa-pen-to-square"></i></button>
|
||||
<button class="btnDecline" @onclick="()=>delete(flux)"><i class="fa-solid fa-trash-can"></i></button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
}
|
||||
@@ -63,9 +78,115 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<DataPager @ref="pagerItemDetails" PageSize="@numRecord" currPage="@currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="@totalCount" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@if (fluxToShow != null)
|
||||
{
|
||||
<div class="modal fade" id="modalShowFlux" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header bg-primary text-light">
|
||||
<h1 class="modal-title fs-5" id="modalNewFamLabel">Movimento #@fluxToShow.Id </h1>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="w-100">
|
||||
<div class="my-2">
|
||||
@if (fluxToShow.MovTypeId == "CAR")
|
||||
{
|
||||
<div class="form-floating col">
|
||||
<input id="tipoMov" value="Carico da fornitore" class="form-control w-100 my-1" disabled />
|
||||
<label for="tipoMov" class="form-label">Tipo di movimento</label>
|
||||
</div>
|
||||
<div class="form-floating col">
|
||||
|
||||
<select id="forn" @bind="@fluxToShow.ExtLocationId" class="form-select" style="@enable">
|
||||
@if (listLocation != null)
|
||||
{
|
||||
@foreach (var item in listLocation.Where(x => x.LocTypeId == "FOR").ToList())
|
||||
{
|
||||
<option value="@item.Id">@item.Descr</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
<label for="forn" class="form-label">Fornitore </label>
|
||||
</div>
|
||||
}
|
||||
else if (fluxToShow.MovTypeId == "SCAR" || fluxToShow.MovTypeId == "RETT")
|
||||
{
|
||||
<div class="form-floating col">
|
||||
<input id="tipoMov" value="Scarico da magazzino" class="form-control w-100 my-1" disabled />
|
||||
<label for="tipoMov" class="form-label">Tipo di movimento</label>
|
||||
</div>
|
||||
<div class="form-floating col">
|
||||
<select id="cliente" @bind="@fluxToShow.ExtLocationId" class="form-select" style="@enable">
|
||||
@if (listLocation != null)
|
||||
{
|
||||
@foreach (var item in listLocation.Where(x => x.LocTypeId == "CLI").ToList())
|
||||
{
|
||||
<option value="@item.Id">@item.Descr</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
<label for="cliente" class="form-label">Cliente </label>
|
||||
</div>
|
||||
}
|
||||
<div class="row">
|
||||
<div class="form-floating col">
|
||||
<input id="doc" @bind="@fluxToShow.CodDoc" class="form-control w-100 my-1" style="@enable" />
|
||||
<label for="doc" class="form-label">Documento</label>
|
||||
</div>
|
||||
<div class="form-floating col">
|
||||
<input id="data" type="date" @bind="@fluxToShow.DtMov" class="form-control w-100 my-1" style="@enable" />
|
||||
<label for="data" class="form-label">Data documento </label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-floating col">
|
||||
<input id="qta" type="number" @bind="@fluxToShow.Qta" class="form-control w-100 my-1" style="@enable" />
|
||||
<label for="qta" class="form-label">Quantità</label>
|
||||
</div>
|
||||
<div class="form-floating col">
|
||||
<input id="importo" type="number" @bind="@fluxToShow.TotValue" class="form-control w-100 my-1" style="@enable" />
|
||||
<label for="importo" class="form-label">Importo</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-floating col">
|
||||
<select id="pos" @bind="@fluxToShow.LocationId" class="form-select" style="@enable">
|
||||
@if (listLocation != null)
|
||||
{
|
||||
@foreach (var item in listLocation.Where(x => x.LocTypeId == "MAG").ToList())
|
||||
{
|
||||
<option value="@item.Id">@item.Descr</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
<label for="pos" class="form-label">Posizione</label>
|
||||
</div>
|
||||
<div class="form-floating col mt-2">
|
||||
<textarea id="note" @bind="@fluxToShow.Note" class="form-control w-100" rows="3" style="@enable"></textarea>
|
||||
<label for="note" class="form-label">Note</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-end">
|
||||
@if (isDup)
|
||||
{
|
||||
<button class="btnAccept" @onclick="()=>duplicate()"><i class="fa-regular fa-circle-check"></i></button>
|
||||
}
|
||||
else if (isMod)
|
||||
{
|
||||
<button class="btnAccept" @onclick="()=>edit()"><i class="fa-regular fa-circle-check"></i></button>
|
||||
}
|
||||
<button class="btnDecline" data-bs-dismiss="modal"><i class="fa-solid fa-ban"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@@ -57,6 +57,18 @@ namespace StockMan.CORE.Components
|
||||
|
||||
listLocation = await SDService.LocationGetAll();
|
||||
}
|
||||
private async Task setItem(ItemFluxModel flux)
|
||||
{
|
||||
await Task.Delay(1);
|
||||
|
||||
fluxToShow = flux;
|
||||
}
|
||||
private async Task dupItem(ItemFluxModel flux)
|
||||
{
|
||||
await Task.Delay(1);
|
||||
isDup = true;
|
||||
fluxToShow = flux;
|
||||
}
|
||||
private async Task saveCarico()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
@@ -107,46 +119,80 @@ namespace StockMan.CORE.Components
|
||||
public int ItemID { get; set; } = 0;
|
||||
[Parameter]
|
||||
public decimal valoreUnit { get; set; } = 0.0M;
|
||||
protected ItemFluxModel fluxToShow { get; set; } = new ItemFluxModel();
|
||||
|
||||
protected bool isCarico { get; set; } = false;
|
||||
protected bool isScarico { get; set; } = false;
|
||||
protected bool isRettifica { get; set; } = false;
|
||||
|
||||
protected void carico()
|
||||
protected string enable
|
||||
{
|
||||
isScarico = false;
|
||||
isRettifica = false;
|
||||
isCarico = true;
|
||||
get => (isDup || isMod ) ? "Background-color: #fff" : "Background-color: #e9ecef; pointer-events: none";
|
||||
}
|
||||
|
||||
protected void scarico()
|
||||
protected async Task dupMode()
|
||||
{
|
||||
isRettifica = false;
|
||||
isCarico = false;
|
||||
isScarico = true;
|
||||
await Task.Delay(1);
|
||||
isDup = true;
|
||||
}
|
||||
protected async Task duplicate()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
|
||||
ItemFluxModel newRec = new ItemFluxModel()
|
||||
{
|
||||
ItemId = fluxToShow.ItemId,
|
||||
LocationId = fluxToShow.LocationId,
|
||||
MovTypeId = fluxToShow.MovTypeId,
|
||||
ExtLocationId = fluxToShow.ExtLocationId,
|
||||
DtMov = DateTime.Now.Date,
|
||||
Qta = fluxToShow.Qta,
|
||||
TotValue = fluxToShow.TotValue,
|
||||
OperatorId = "ND",
|
||||
Note = "---DUPLICATED---",
|
||||
CodDoc = fluxToShow.CodDoc,
|
||||
ModOperatorId = "ND"
|
||||
};
|
||||
|
||||
var done = await SDService.FluxAdd(newRec);
|
||||
if (done)
|
||||
{
|
||||
NavManager.NavigateTo(NavManager.Uri, true);
|
||||
}
|
||||
}
|
||||
|
||||
protected void rettifica()
|
||||
|
||||
protected async Task delete(ItemFluxModel flux)
|
||||
{
|
||||
isScarico = false;
|
||||
isCarico = false;
|
||||
isRettifica = true;
|
||||
await Task.Delay(1);
|
||||
|
||||
var done = await SDService.DeleteFlux(flux);
|
||||
if (done)
|
||||
{
|
||||
NavManager.NavigateTo(NavManager.Uri, true);
|
||||
}
|
||||
}
|
||||
protected void close()
|
||||
protected async Task edit()
|
||||
{
|
||||
isScarico = false;
|
||||
isRettifica = false;
|
||||
isCarico = false;
|
||||
await Task.Delay(1);
|
||||
|
||||
var done = await SDService.FluxMod(fluxToShow);
|
||||
if (done)
|
||||
{
|
||||
NavManager.NavigateTo(NavManager.Uri, true);
|
||||
}
|
||||
}
|
||||
protected string headerCss
|
||||
protected async Task editMode(ItemFluxModel flux)
|
||||
{
|
||||
get => (isCarico || isScarico || isRettifica) ? "bg-primary text-light" : "";
|
||||
await Task.Delay(1);
|
||||
fluxToShow = flux;
|
||||
isMod = true;
|
||||
}
|
||||
|
||||
protected string cardCss
|
||||
{
|
||||
get => (isCarico || isScarico || isRettifica) ? "border border-primary" : "";
|
||||
}
|
||||
|
||||
|
||||
protected bool isDup { get; set; } = false;
|
||||
protected bool isMod { get; set; } = false;
|
||||
|
||||
|
||||
protected string _fornitore { get; set; } = "";
|
||||
|
||||
|
||||
@@ -49,4 +49,16 @@
|
||||
margin-right: 1rem;
|
||||
background-color: rgba(192, 57, 43, 0.2);
|
||||
color: #C0392B;
|
||||
}
|
||||
.btnDup {
|
||||
border-radius: 50%;
|
||||
padding: 0.5rem;
|
||||
width: 2.8rem;
|
||||
height: 2.8rem;
|
||||
border: none;
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
margin-right: 1rem;
|
||||
background-color: rgba(254, 152, 83, 0.2);
|
||||
color: #fe9853;
|
||||
}
|
||||
@@ -31,3 +31,9 @@
|
||||
background-color: rgba(192, 57, 43, 0.2);
|
||||
color: #C0392B;
|
||||
}
|
||||
|
||||
.btnDup {
|
||||
.buttonGlobal;
|
||||
background-color: rgba(254,152,83,0.2);
|
||||
color: #fe9853;
|
||||
}
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
.modItem input,.modItem textarea,.modItem select{font-size:.8rem;background-color:#e9ecef;}.buttonGlobal{border-radius:50%;padding:.5rem;width:2.8rem;height:2.8rem;border:0;padding:0;text-align:center;margin-right:1rem;}.btnMod{border-radius:50%;padding:.5rem;width:2.8rem;height:2.8rem;border:0;padding:0;text-align:center;margin-right:1rem;background-color:rgba(52,152,219,.2);color:#3498db;}.btnAccept{border-radius:50%;padding:.5rem;width:2.8rem;height:2.8rem;border:0;padding:0;text-align:center;margin-right:1rem;background-color:rgba(86,184,167,.2);color:#56b8a7;}.btnDecline{border-radius:50%;padding:.5rem;width:2.8rem;height:2.8rem;border:0;padding:0;text-align:center;margin-right:1rem;background-color:rgba(192,57,43,.2);color:#c0392b;}
|
||||
.modItem input,.modItem textarea,.modItem select{font-size:.8rem;background-color:#e9ecef;}.buttonGlobal{border-radius:50%;padding:.5rem;width:2.8rem;height:2.8rem;border:0;padding:0;text-align:center;margin-right:1rem;}.btnMod{border-radius:50%;padding:.5rem;width:2.8rem;height:2.8rem;border:0;padding:0;text-align:center;margin-right:1rem;background-color:rgba(52,152,219,.2);color:#3498db;}.btnAccept{border-radius:50%;padding:.5rem;width:2.8rem;height:2.8rem;border:0;padding:0;text-align:center;margin-right:1rem;background-color:rgba(86,184,167,.2);color:#56b8a7;}.btnDecline{border-radius:50%;padding:.5rem;width:2.8rem;height:2.8rem;border:0;padding:0;text-align:center;margin-right:1rem;background-color:rgba(192,57,43,.2);color:#c0392b;}.btnDup{border-radius:50%;padding:.5rem;width:2.8rem;height:2.8rem;border:0;padding:0;text-align:center;margin-right:1rem;background-color:rgba(254,152,83,.2);color:#fe9853;}
|
||||
@@ -61,19 +61,28 @@
|
||||
{
|
||||
<button class="btn btn-warning col mx-1"><i class="fa-solid fa-pen-to-square"></i> Rettifica </button>
|
||||
}
|
||||
</div>@*
|
||||
@if (isCarico || isScarico || isRettifica)
|
||||
{
|
||||
|
||||
|
||||
}*@
|
||||
<div class="modal fade" id="modalCarScarRett" tabindex="-1" aria-hidden="true">
|
||||
</div>
|
||||
<div class="modal fade" id="modalCarScarRett" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="modalNewFamLabel">Modificare lo stock giacenze</h1>
|
||||
<button type="button" class="btn-close" aria-label="Close" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
@if (isCarico)
|
||||
{
|
||||
<div class="modal-header bg-success text-light">
|
||||
<h1 class="modal-title fs-5" id="modalNewFamLabel">Modalità carico</h1>
|
||||
</div>
|
||||
}
|
||||
else if (isScarico)
|
||||
{
|
||||
<div class="modal-header bg-danger text-light">
|
||||
<h1 class="modal-title fs-5" id="modalNewFamLabel">Modalità scarico</h1>
|
||||
</div>
|
||||
}
|
||||
else if (isRettifica)
|
||||
{
|
||||
<div class="modal-header bg-warning text-dark">
|
||||
<h1 class="modal-title fs-5" id="modalNewFamLabel">Modalità rettifica</h1>
|
||||
</div>
|
||||
}
|
||||
<div class="modal-body">
|
||||
<div class="w-100">
|
||||
<div class="my-2">
|
||||
@@ -155,4 +164,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -136,6 +136,20 @@ namespace StockMan.CORE.Data
|
||||
await Task.Delay(1);
|
||||
return dbResult;
|
||||
}
|
||||
/// <summary>
|
||||
/// Aggiornamento record selezionato flusso
|
||||
/// </summary>
|
||||
/// <param name="currRec"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> FluxMod(ItemFluxModel currRec)
|
||||
{
|
||||
var dbResult = await dbController.FluxMod(currRec);
|
||||
// elimino cache redis...
|
||||
RedisValue pattern = new RedisValue($"{rKeyItemFlux}:*");
|
||||
bool answ = await ExecFlushRedisPattern(pattern);
|
||||
await Task.Delay(1);
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -195,6 +209,20 @@ namespace StockMan.CORE.Data
|
||||
await Task.Delay(1);
|
||||
return dbResult;
|
||||
}
|
||||
/// <summary>
|
||||
/// eliminazione record flux
|
||||
/// </summary>
|
||||
/// <param name="currRec"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> DeleteFlux(ItemFluxModel currRec)
|
||||
{
|
||||
var dbResult = await dbController.DeleteFlux(currRec);
|
||||
// elimino cache redis...
|
||||
RedisValue pattern = new RedisValue($"{rKeyItemFlux}:*");
|
||||
bool answ = await ExecFlushRedisPattern(pattern);
|
||||
await Task.Delay(1);
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Lista Permessi
|
||||
|
||||
@@ -17,4 +17,110 @@
|
||||
else
|
||||
{
|
||||
<div class="alert alert-warning">Articolo non trovato!</div>
|
||||
}
|
||||
}
|
||||
|
||||
@*if (flux != null)
|
||||
{
|
||||
<div class="modal fade" id="modalCarScarRett" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
@if (isCarico)
|
||||
{
|
||||
<div class="modal-header bg-success text-light">
|
||||
<h1 class="modal-title fs-5" id="modalNewFamLabel">Modificare lo stock giacenze</h1>
|
||||
</div>
|
||||
}
|
||||
else if (isScarico)
|
||||
{
|
||||
<div class="modal-header bg-danger text-light">
|
||||
<h1 class="modal-title fs-5" id="modalNewFamLabel">Modificare lo stock giacenze</h1>
|
||||
</div>
|
||||
}
|
||||
else if (isRettifica)
|
||||
{
|
||||
<div class="modal-header bg-warning text-dark">
|
||||
<h1 class="modal-title fs-5" id="modalNewFamLabel">Modificare lo stock giacenze</h1>
|
||||
</div>
|
||||
}
|
||||
<button type="button" class="btn-close" aria-label="Close" data-bs-dismiss="modal"></button>
|
||||
<div class="modal-body">
|
||||
<div class="w-100">
|
||||
<div class="my-2">
|
||||
<div class="form-floating col">
|
||||
@if (isCarico)
|
||||
{
|
||||
<select id="forn" @bind="@fornitore" class="form-select">
|
||||
@if (listLocation != null)
|
||||
{
|
||||
@foreach (var item in listLocation.Where(x => x.LocTypeId == "FOR").ToList())
|
||||
{
|
||||
<option value="@item.Id">@item.Descr</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
<label for="forn" class="form-label">Fornitore </label>
|
||||
}
|
||||
else if (isScarico || isRettifica)
|
||||
{
|
||||
<select id="cliente" @bind="@cliente" class="form-select">
|
||||
@if (listLocation != null)
|
||||
{
|
||||
@foreach (var item in listLocation.Where(x => x.LocTypeId == "CLI").ToList())
|
||||
{
|
||||
<option value="@item.Id">@item.Descr</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
<label for="cliente" class="form-label">Cliente </label>
|
||||
}
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-floating col">
|
||||
<input id="doc" @bind="@documento" class="form-control w-100 my-1" />
|
||||
<label for="doc" class="form-label">Documento</label>
|
||||
</div>
|
||||
<div class="form-floating col">
|
||||
<input id="data" type="date" @bind="@dataDocumento" class="form-control w-100 my-1" />
|
||||
<label for="data" class="form-label">Data documento </label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-floating col">
|
||||
<input id="qta" type="number" @bind="@qta" class="form-control w-100 my-1" />
|
||||
<label for="qta" class="form-label">Quantità</label>
|
||||
</div>
|
||||
<div class="form-floating col">
|
||||
<input id="importo" type="number" @bind="@importo" class="form-control w-100 my-1" />
|
||||
<label for="importo" class="form-label">Importo</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-floating col">
|
||||
<select id="pos" @bind="@pos" class="form-select">
|
||||
@if (listLocation != null)
|
||||
{
|
||||
@foreach (var item in listLocation.Where(x => x.LocTypeId == "MAG").ToList())
|
||||
{
|
||||
<option value="@item.Id">@item.Descr</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
<label for="pos" class="form-label">Posizione</label>
|
||||
</div>
|
||||
<div class="form-floating col mt-2">
|
||||
<textarea id="note" @bind="@note" class="form-control w-100" rows="3"></textarea>
|
||||
<label for="note" class="form-label">Note</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-end">
|
||||
@* @if ((!string.IsNullOrEmpty(fornitore) || !string.IsNullOrEmpty(cliente)) && !string.IsNullOrEmpty(pos))
|
||||
{
|
||||
<button class="btnAccept" @onclick="()=>saveCarico()"><i class="fa-regular fa-circle-check"></i></button>
|
||||
}
|
||||
<button class="btnDecline" @onclick="()=>close()" data-bs-dismiss="modal"><i class="fa-solid fa-ban"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}*@
|
||||
@@ -30,7 +30,7 @@ namespace StockMan.CORE.Pages
|
||||
protected List<ItemModel> listItemsSearch { get; set; } = new List<ItemModel>();
|
||||
protected ItemModel itemToDet { get; set; } = new ItemModel();
|
||||
protected List<ItemFamilyModel> itemFams { get; set; } = new List<ItemFamilyModel>();
|
||||
protected List<ItemFluxModel> itemFlux { get; set; } = new List<ItemFluxModel>();
|
||||
//protected ItemFluxModel? flux { get; set; } = null;
|
||||
protected List<LocationModel> listLocation { get; set; } = new List<LocationModel>();
|
||||
protected DataPager? pagerItemDetails = null!;
|
||||
protected override async Task OnInitializedAsync()
|
||||
@@ -50,14 +50,12 @@ namespace StockMan.CORE.Pages
|
||||
{
|
||||
itemToDet = listItemsSearch.FirstOrDefault();
|
||||
}
|
||||
if(itemToDet != null)
|
||||
if (itemToDet != null)
|
||||
{
|
||||
valoreUnit = itemToDet.CurrValue;
|
||||
}
|
||||
await Task.Delay(1);
|
||||
|
||||
itemFlux = await SDService.ItemFluxGetById(itemToDet.Id);
|
||||
|
||||
itemFams = await SDService.ItemFamilyGetAll();
|
||||
|
||||
listLocation = await SDService.LocationGetAll();
|
||||
@@ -69,6 +67,21 @@ namespace StockMan.CORE.Pages
|
||||
await Task.Delay(1);
|
||||
isMod = true;
|
||||
}
|
||||
//protected void setFlux(ItemFluxModel currFlux)
|
||||
//{
|
||||
// ItemID = currFlux.ItemId;
|
||||
// pos = currFlux.LocationId,
|
||||
// movTipo = currFlux.MovTypeId,
|
||||
// ExtLocationId = cliOrForn,
|
||||
// DtMov = DateTime.Now.Date,
|
||||
// Qta = qtaScarCar,
|
||||
// TotValue = importo,
|
||||
// OperatorId = "ND",
|
||||
// Note = note,
|
||||
// CodDoc = documento,
|
||||
// ModOperatorId = "ND"
|
||||
// fornitore = currFlux.;
|
||||
//}
|
||||
protected int ItemID { get; set; } = 0;
|
||||
protected decimal valoreUnit { get; set; } = 0.00M;
|
||||
protected bool isMod { get; set; } = false;
|
||||
@@ -119,25 +132,25 @@ namespace StockMan.CORE.Pages
|
||||
get => _fornitore;
|
||||
set => _fornitore = value;
|
||||
}
|
||||
protected string _cliente{ get; set; } = "";
|
||||
protected string _cliente { get; set; } = "";
|
||||
protected string cliente
|
||||
{
|
||||
get => _cliente;
|
||||
set => _cliente = value;
|
||||
}
|
||||
protected string _documento{ get; set; } = "RDA/DDT/FT";
|
||||
protected string _documento { get; set; } = "RDA/DDT/FT";
|
||||
protected string documento
|
||||
{
|
||||
get => _documento;
|
||||
set => _documento = value;
|
||||
}
|
||||
protected DateTime _dataDocumento{ get; set; } = DateTime.Now.Date;
|
||||
}
|
||||
protected DateTime _dataDocumento { get; set; } = DateTime.Now.Date;
|
||||
protected DateTime dataDocumento
|
||||
{
|
||||
get => _dataDocumento;
|
||||
set => _dataDocumento = value;
|
||||
}
|
||||
protected int _qta{ get; set; } = 0;
|
||||
protected int _qta { get; set; } = 0;
|
||||
protected int qta
|
||||
{
|
||||
get => _qta;
|
||||
|
||||
@@ -42,5 +42,9 @@
|
||||
{
|
||||
"outputFile": "Components/StockGiacenze.razor.css",
|
||||
"inputFile": "Components/StockGiacenze.razor.less"
|
||||
},
|
||||
{
|
||||
"outputFile": "Components/Movimenti.razor.css",
|
||||
"inputFile": "Components/Movimenti.razor.less"
|
||||
}
|
||||
]
|
||||
@@ -196,6 +196,54 @@ namespace StockMan.Data.Controllers
|
||||
}
|
||||
return fatto;
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Modifica flux
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> FluxMod(ItemFluxModel editRec)
|
||||
{
|
||||
bool fatto = false;
|
||||
//List<ItemModel> dbResult = new List<ItemModel>();
|
||||
using (StockManContext localDbCtx = new StockManContext(_configuration))
|
||||
{
|
||||
try
|
||||
{
|
||||
var currRec = localDbCtx
|
||||
.DbSetItemFlux
|
||||
.Where(x => x.Id == editRec.Id)
|
||||
.FirstOrDefault();
|
||||
if (currRec != null)
|
||||
{
|
||||
currRec.ItemId = editRec.ItemId;
|
||||
currRec.LocationId = editRec.LocationId;
|
||||
currRec.MovTypeId = editRec.MovTypeId;
|
||||
currRec.ExtLocationId = editRec.ExtLocationId;
|
||||
currRec.DtMov = editRec.DtMov;
|
||||
currRec.Qta = editRec.Qta;
|
||||
currRec.TotValue = editRec.TotValue;
|
||||
currRec.OperatorId = "ND";
|
||||
currRec.Note = editRec.Note;
|
||||
currRec.CodDoc = editRec.CodDoc;
|
||||
currRec.ModOperatorId = "ND";
|
||||
localDbCtx.Entry(currRec).State = EntityState.Modified;
|
||||
}
|
||||
else
|
||||
{
|
||||
localDbCtx
|
||||
.DbSetItemFlux
|
||||
.Add(editRec);
|
||||
}
|
||||
await localDbCtx.SaveChangesAsync();
|
||||
fatto = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione durante FluxMod;{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return fatto;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -358,6 +406,38 @@ namespace StockMan.Data.Controllers
|
||||
}
|
||||
return fatto;
|
||||
}
|
||||
/// <summary>
|
||||
/// Flux Delete
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> DeleteFlux(ItemFluxModel currRec)
|
||||
{
|
||||
bool fatto = false;
|
||||
using (StockManContext localDbCtx = new StockManContext(_configuration))
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var dbResult = localDbCtx
|
||||
.DbSetItemFlux
|
||||
.Where(x => x.Id == currRec.Id)
|
||||
.FirstOrDefault();
|
||||
if (dbResult != null)
|
||||
{
|
||||
localDbCtx
|
||||
.DbSetItemFlux
|
||||
.Remove(dbResult);
|
||||
await localDbCtx.SaveChangesAsync();
|
||||
fatto = true;
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione durante DeleteFlux{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return fatto;
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// Lista Items da ricerca
|
||||
|
||||
Reference in New Issue
Block a user