diff --git a/DM_Weight/App.config b/DM_Weight/App.config index 6104183..16114ac 100644 --- a/DM_Weight/App.config +++ b/DM_Weight/App.config @@ -28,7 +28,7 @@ - + diff --git a/DM_Weight/ViewModels/AccountWindowViewModel.cs b/DM_Weight/ViewModels/AccountWindowViewModel.cs index 0fcd484..ab62790 100644 --- a/DM_Weight/ViewModels/AccountWindowViewModel.cs +++ b/DM_Weight/ViewModels/AccountWindowViewModel.cs @@ -304,8 +304,9 @@ namespace DM_Weight.ViewModels //账册中没有记录则把库存中的所有数据都要生成一条账册记录 // 保存数据 出/入库记录 // 获取药品总库存 + string drugId= channelStockList[i].DrugId; int channelStockQuantity = SqlSugarHelper.Db.Queryable() - .Where(cs => cs.DrugId.Equals(channelStockList[i].DrugId)).Sum(it => it.Quantity); + .Where(cs => cs.DrugId.Equals(drugId)).Sum(it => it.Quantity); string InvoiceId = "Account_" + CurrentTimeMillis(); @@ -314,7 +315,7 @@ namespace DM_Weight.ViewModels MachineId = channelStockList[i].MachineId, DrawerNo = 0,//channelStockList[i].DrawerNo, ColNo = 0,//channelStockList[i].ColNo, - DrugId = channelStockList[i].DrugId, + DrugId = drugId, ManuNo = "",// channelStockList[i].ManuNo, EffDate = null,// !String.IsNullOrEmpty(channelStockList[i].EffDate) ? DateTime.ParseExact(channelStockList[i].EffDate, "yyyy-MM-dd", System.Globalization.CultureInfo.CurrentCulture) : null, Operator = HomeWindowViewModel.Operator?.Id,