diff --git a/DM_Weight/ViewModels/InvoiceAddDialogViewModel.cs b/DM_Weight/ViewModels/InvoiceAddDialogViewModel.cs index 798ccc7..6d72fa3 100644 --- a/DM_Weight/ViewModels/InvoiceAddDialogViewModel.cs +++ b/DM_Weight/ViewModels/InvoiceAddDialogViewModel.cs @@ -302,6 +302,9 @@ namespace DM_Weight.ViewModels { accountBookG2Day.ManuStock = accountBookG2Day.ManuStock + it.AddQuantity; accountBookG2Day.AddQuantity = accountBookG2Day.AddQuantity + it.AddQuantity; + //负数直接记0 + accountBookG2Day.TotalStock = (accountBookEmpty != null ? (accountBookEmpty.TotalStock > 0 && accountBookEmpty.TotalStock > it.AddQuantity ? accountBookEmpty.TotalStock - it.AddQuantity : 0) : 0); + SqlSugarHelper.Db.Updateable(accountBookG2Day).ExecuteCommand(); manuStock= accountBookG2Day.ManuStock; }