Update InvoiceController.cs

This commit is contained in:
MarcEricMartel 2022-11-22 08:07:06 -08:00
parent 891d6b015d
commit adb5c8bcc6

View File

@ -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 :