From b86b292c1640931bd14bef7bc270cd56f7494715 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E5=B7=A7?= <625215135@qq.com> Date: Sun, 28 Sep 2025 09:18:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=8B=A8=E5=85=A5=E5=BA=93=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=AE=B0=E5=BD=95=E7=A9=BA=E7=93=B6=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DM_Weight/ViewModels/InvoiceAddDialogViewModel.cs | 3 +++ 1 file changed, 3 insertions(+) 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; }