Update InvoiceController.cs
This commit is contained in:
parent
891d6b015d
commit
adb5c8bcc6
@ -163,9 +163,9 @@ public class InvoiceController : Controller {
|
|||||||
|
|
||||||
foreach (var prod in sinv.ProdQuant) { // Update de quantités dans l'inventaire.
|
foreach (var prod in sinv.ProdQuant) { // Update de quantités dans l'inventaire.
|
||||||
ProductModel inventProd = prods.Where(x => x.Id == prod.Key).First();
|
ProductModel inventProd = prods.Where(x => x.Id == prod.Key).First();
|
||||||
if (inventProd.Quantity > prod.Value)
|
if (inventProd.Quantity < prod.Value)
|
||||||
badprods.Add(prod.Key, prod.Value);
|
badprods.Add(prod.Key, inventProd.Quantity);
|
||||||
if (inventProd.Quantity == prod.Value) {
|
else if (inventProd.Quantity == prod.Value) {
|
||||||
inventProd.Quantity = 0;
|
inventProd.Quantity = 0;
|
||||||
inventProd.Status = inventProd.Status == ProductModel.States.Clearance ?
|
inventProd.Status = inventProd.Status == ProductModel.States.Clearance ?
|
||||||
ProductModel.States.Discontinued :
|
ProductModel.States.Discontinued :
|
||||||
|
Loading…
Reference in New Issue
Block a user