diff --git a/DM_Weight/ViewModels/InvoiceAddDialogViewModel.cs b/DM_Weight/ViewModels/InvoiceAddDialogViewModel.cs index c8c8ed7..f0c88d0 100644 --- a/DM_Weight/ViewModels/InvoiceAddDialogViewModel.cs +++ b/DM_Weight/ViewModels/InvoiceAddDialogViewModel.cs @@ -259,12 +259,11 @@ namespace DM_Weight.ViewModels }).UpdateColumns(it => new { it.Quantity, it.ManuNo, it.EffDate, it.PosNo }).ExecuteCommand(); // 获取更新完库存后的药品库存 List nowChannels = SqlSugarHelper.Db.Queryable() - .Where(cs => cs.MachineId.Equals(it.MachineId)||cs.MachineId.Equals(ConfigurationManager.AppSettings["jj_machineId"])) + .Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"]) ||cs.MachineId.Equals(ConfigurationManager.AppSettings["jj_machineId"])) .Where(cs => cs.DrugId.Equals(it.DrugId)) .Where(cs=>cs.ManuNo.Equals(it.ManuNo)) .Where(cs => cs.DrawerType == 1) .ToList(); - // 保存数据 出/入库记录 SqlSugarHelper.Db.Insertable(new MachineRecord() { @@ -280,7 +279,8 @@ namespace DM_Weight.ViewModels Quantity = it.AddQuantity, Type = 1, InvoiceId = InvoiceId - //,StockQuantity = nowChannels.Sum(it => it.Quantity) + , + ReturnQuantity1 = nowChannels.Sum(it => it.Quantity) }).ExecuteCommand(); //查询上一条账册中的空瓶数