fix gestione acquisizioni
This commit is contained in:
@@ -34,7 +34,14 @@
|
||||
<li class="list-group-item">
|
||||
Quantità:
|
||||
<div class="input-group input-group-sm">
|
||||
<input class="form-control @reqQtaMod" @bind-value="@quantitaScan" type="number" />
|
||||
@if (currLotto != null)
|
||||
{
|
||||
<input class="form-control" @bind-value="@quantitaScan" type="number" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<input class="form-control @reqQtaMod" @bind-value="@quantitaScan" type="number" />
|
||||
}
|
||||
@if ((canMod != "false") || (tipo != "UDC"))
|
||||
{
|
||||
<button title="Mod quantità" @onclick="@cssDisableQta" class="btn btn-sm btn-primary">
|
||||
@@ -51,8 +58,23 @@
|
||||
</li>
|
||||
</ul>
|
||||
<div class="btn-group col-12" role="group" aria-label="Basic example">
|
||||
<button type="button" class="btn btn-success col-6" @onclick="()=>insertScan()">Conferma</button>
|
||||
<button type="button" class="btn btn-danger col-6" @onclick="()=>resetAll()">Annulla</button>
|
||||
@if (articoloScan != "" && quantitaScan != 0)
|
||||
{
|
||||
<button type="button" class="btn btn-success col-6" @onclick="()=>insertScan()">Conferma</button>
|
||||
<button type="button" class="btn btn-danger col-6" @onclick="()=>resetAll()">Annulla</button>
|
||||
}
|
||||
else if (articoloScan == "" && quantitaScan != 0)
|
||||
{
|
||||
<div class="alert bg-warning col-12">Dati mancanti: Codice articolo</div>
|
||||
}
|
||||
else if (quantitaScan == 0 && articoloScan != "")
|
||||
{
|
||||
<div class="alert bg-warning col-12">Dati mancanti: Quantità a "0"</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="alert bg-warning col-12">Dati mancanti: Codice articolo e Quantità </div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
else if (alreadyScan != null)
|
||||
@@ -103,6 +125,11 @@ else if (alreadyScan != null)
|
||||
<button type="button" class="btn btn-success col-6" @onclick="()=>insertScan()">Conferma</button>
|
||||
<button type="button" class="btn btn-danger col-6" @onclick="()=>resetAll()">Annulla</button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="alert bg-warning col-12">Questo oggetto risulta essere univoco perciò non è possibile salvare una nuova scansione</div>
|
||||
}
|
||||
|
||||
</div>
|
||||
}
|
||||
else
|
||||
@@ -118,19 +145,41 @@ else
|
||||
<li class="list-group-item">
|
||||
Articolo:
|
||||
<div class="input-group input-group-sm">
|
||||
<input class="form-control " @bind-value="@articoloScan" type="text" />
|
||||
@if (lastScan != null && lastScan != "")
|
||||
{
|
||||
<input class="form-control " @bind-value="@articoloScan" type="text" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<input class="form-control " @bind-value="@articoloScan" type="text" disabled />
|
||||
}
|
||||
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
Quantità:
|
||||
<div class="input-group input-group-sm">
|
||||
<input class="form-control" @bind-value="@quantitaScan" type="number" />
|
||||
@if (lastScan != null && lastScan != "")
|
||||
{
|
||||
<input class="form-control" @bind-value="@quantitaScan" type="number" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<input class="form-control" @bind-value="@quantitaScan" type="number" disabled />
|
||||
}
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
Note:
|
||||
<div class="input-group input-group-sm">
|
||||
<input class="form-control " @bind-value="@noteScan" type="text" />
|
||||
@if (lastScan != null && lastScan != "")
|
||||
{
|
||||
<input class="form-control " @bind-value="@noteScan" type="text" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<input class="form-control" @bind-value="@quantitaScan" type="number" disabled />
|
||||
}
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -140,7 +189,7 @@ else
|
||||
<button type="button" class="btn btn-success col-6" @onclick="()=>insertScan()">Conferma</button>
|
||||
<button type="button" class="btn btn-danger col-6" @onclick="()=>resetAll()">Annulla</button>
|
||||
}
|
||||
else if(articoloScan == "" && quantitaScan != 0)
|
||||
else if (articoloScan == "" && quantitaScan != 0)
|
||||
{
|
||||
<div class="alert bg-warning col-12">Dati mancanti: Codice articolo</div>
|
||||
}
|
||||
|
||||
@@ -127,6 +127,7 @@ namespace MP.INVE.Components
|
||||
currLotto = lotto;
|
||||
lottoScan = lotto.Lotto;
|
||||
articoloScan = lotto.CodArt;
|
||||
quantitaScan = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -146,88 +147,97 @@ namespace MP.INVE.Components
|
||||
protected decimal qtaLotto = 0;
|
||||
protected async void insertScan()
|
||||
{
|
||||
var alertInsert = await JSRuntime.InvokeAsync<bool>("confirm", $"Confermi di voler salvare la seguente scansione per la sessione {sessID}?");
|
||||
if (alertInsert)
|
||||
|
||||
var artExists = await MIService.artBySearch(articoloScan);
|
||||
|
||||
if (artExists != null)
|
||||
{
|
||||
|
||||
if (currUdc != null)
|
||||
var alertInsert = await JSRuntime.InvokeAsync<bool>("confirm", $"Confermi di voler salvare la seguente scansione per la sessione {sessID}?");
|
||||
if (alertInsert)
|
||||
{
|
||||
if ((currUdc.lottoNav.CodArt != udc.lottoNav.CodArt) || (currUdc.Qta != udc.Qta))
|
||||
|
||||
if (currUdc != null)
|
||||
{
|
||||
isForced = true;
|
||||
if ((currUdc.lottoNav.CodArt != udc.lottoNav.CodArt) || (currUdc.Qta != udc.Qta))
|
||||
{
|
||||
isForced = true;
|
||||
}
|
||||
//if()
|
||||
|
||||
ScanDataModel newScan = new ScanDataModel()
|
||||
{
|
||||
DtScan = DateTime.Now,
|
||||
UserScan = userScan,
|
||||
ScanValue = lastScan,
|
||||
IsForced = isForced,
|
||||
CodArticolo = currUdc.lottoNav.CodArt,
|
||||
Lotto = currUdc.lottoNav.Lotto,
|
||||
RifExt = currUdc.lottoNav.RifExt,
|
||||
Qty = currUdc.Qta,
|
||||
Note = currUdc.Note,
|
||||
IsKnown = true,
|
||||
IsUnique = true,
|
||||
InveSessID = sessID
|
||||
};
|
||||
|
||||
|
||||
|
||||
await MIService.InsertNewScansione(newScan);
|
||||
NavManager.NavigateTo(NavManager.Uri, true);
|
||||
}
|
||||
//if()
|
||||
|
||||
ScanDataModel newScan = new ScanDataModel()
|
||||
else if (currLotto != null)
|
||||
{
|
||||
DtScan = DateTime.Now,
|
||||
UserScan = userScan,
|
||||
ScanValue = lastScan,
|
||||
IsForced = isForced,
|
||||
CodArticolo = currUdc.lottoNav.CodArt,
|
||||
Lotto = currUdc.lottoNav.Lotto,
|
||||
RifExt = currUdc.lottoNav.RifExt,
|
||||
Qty = currUdc.Qta,
|
||||
Note = currUdc.Note,
|
||||
IsKnown = true,
|
||||
IsUnique = true,
|
||||
InveSessID = sessID
|
||||
};
|
||||
|
||||
|
||||
|
||||
await MIService.InsertNewScansione(newScan);
|
||||
NavManager.NavigateTo(NavManager.Uri, true);
|
||||
ScanDataModel newScan = new ScanDataModel()
|
||||
{
|
||||
DtScan = DateTime.Now,
|
||||
UserScan = userScan,
|
||||
ScanValue = lastScan,
|
||||
IsForced = true,
|
||||
CodArticolo = currLotto.CodArt,
|
||||
Lotto = currLotto.Lotto,
|
||||
RifExt = currLotto.RifExt,
|
||||
Qty = qtaLotto,
|
||||
Note = currLotto.Note,
|
||||
IsKnown = true,
|
||||
IsUnique = false,
|
||||
InveSessID = sessID
|
||||
};
|
||||
await MIService.InsertNewScansione(newScan);
|
||||
NavManager.NavigateTo(NavManager.Uri, true);
|
||||
}
|
||||
else if (alreadyScan != null)
|
||||
{
|
||||
ScanDataModel newScan = new ScanDataModel()
|
||||
{
|
||||
DtScan = DateTime.Now,
|
||||
UserScan = userScan,
|
||||
ScanValue = lastScan,
|
||||
IsForced = true,
|
||||
CodArticolo = alreadyScan.CodArticolo,
|
||||
Lotto = alreadyScan.Lotto,
|
||||
RifExt = alreadyScan.RifExt,
|
||||
Qty = alreadyScan.Qty,
|
||||
Note = alreadyScan.Note,
|
||||
IsKnown = alreadyScan.IsKnown,
|
||||
IsUnique = alreadyScan.IsUnique,
|
||||
InveSessID = sessID
|
||||
};
|
||||
await MIService.InsertNewScansione(newScan);
|
||||
NavManager.NavigateTo(NavManager.Uri, true);
|
||||
}
|
||||
}
|
||||
else if (currLotto != null)
|
||||
else
|
||||
{
|
||||
ScanDataModel newScan = new ScanDataModel()
|
||||
{
|
||||
DtScan = DateTime.Now,
|
||||
UserScan = userScan,
|
||||
ScanValue = lastScan,
|
||||
IsForced = true,
|
||||
CodArticolo = currLotto.CodArt,
|
||||
Lotto = currLotto.Lotto,
|
||||
RifExt = currLotto.RifExt,
|
||||
Qty = qtaLotto,
|
||||
Note = currLotto.Note,
|
||||
IsKnown = true,
|
||||
IsUnique = false,
|
||||
InveSessID = sessID
|
||||
};
|
||||
await MIService.InsertNewScansione(newScan);
|
||||
NavManager.NavigateTo(NavManager.Uri, true);
|
||||
}
|
||||
else if (alreadyScan != null)
|
||||
{
|
||||
ScanDataModel newScan = new ScanDataModel()
|
||||
{
|
||||
DtScan = DateTime.Now,
|
||||
UserScan = userScan,
|
||||
ScanValue = lastScan,
|
||||
IsForced = true,
|
||||
CodArticolo = alreadyScan.CodArticolo,
|
||||
Lotto = alreadyScan.Lotto,
|
||||
RifExt = alreadyScan.RifExt,
|
||||
Qty = alreadyScan.Qty,
|
||||
Note = alreadyScan.Note,
|
||||
IsKnown = alreadyScan.IsKnown,
|
||||
IsUnique = alreadyScan.IsUnique,
|
||||
InveSessID = sessID
|
||||
};
|
||||
await MIService.InsertNewScansione(newScan);
|
||||
currLotto = null;
|
||||
currUdc = null;
|
||||
alreadyScan = null;
|
||||
NavManager.NavigateTo(NavManager.Uri, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
currLotto = null;
|
||||
currUdc = null;
|
||||
alreadyScan = null;
|
||||
NavManager.NavigateTo(NavManager.Uri, true);
|
||||
var artSbagliato = await JSRuntime.InvokeAsync<bool>("alert", $"l'articolo {articoloScan} non risulta presente nelle nostre anagrafiche. Inserire un articolo giusto o controllare di non aver sbagliato a digitare");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -363,6 +363,18 @@ namespace MP.INVE.Data
|
||||
await Task.Delay(1);
|
||||
return dbResult;
|
||||
}
|
||||
/// <summary>
|
||||
/// Aggiornamento record selezionato
|
||||
/// </summary>
|
||||
/// <param name="currRec"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<AnagArticoli_MAG> artBySearch(string artSearch)
|
||||
{
|
||||
var dbResult = dbController.artBySearch(artSearch);
|
||||
// elimino cache redis...
|
||||
await Task.Delay(1);
|
||||
return dbResult;
|
||||
}
|
||||
public List<AnagUdcModel> ElencoUDC()
|
||||
{
|
||||
string source = "";
|
||||
|
||||
Reference in New Issue
Block a user