diff --git a/Pilot_KD_Parino/SAL_DELIVERYNOTICE/Bill.cs b/Pilot_KD_Parino/SAL_DELIVERYNOTICE/Bill.cs index 51fc2de..a0e5a16 100644 --- a/Pilot_KD_Parino/SAL_DELIVERYNOTICE/Bill.cs +++ b/Pilot_KD_Parino/SAL_DELIVERYNOTICE/Bill.cs @@ -39,9 +39,9 @@ namespace Pilot_KD_Parino.SAL_DELIVERYNOTICE var groupId = groupIdObj == null ? "" : groupIdObj.Convert(); if (!groupId.IsNullOrEmptyOrWhiteSpace()) { - var groupItemObj = this.View.Model.GetValue("F_GroupItem", e.Row); - var groupItem = groupItemObj == null ? "" : groupItemObj.Convert(); - if (groupItem.IsNullOrEmptyOrWhiteSpace()) + var groupItemObj = this.View.Model.GetValue("F_IsGroupItem", e.Row); + var groupItem = groupItemObj == null ? false : groupItemObj.Convert(); + if (!groupItem) { var entrys = this.View.Model.DataObject["SAL_DELIVERYNOTICEENTRY"] as DynamicObjectCollection; if (entrys != null && entrys.Count > 0) @@ -51,8 +51,8 @@ namespace Pilot_KD_Parino.SAL_DELIVERYNOTICE foreach (var entry in entrys) { var currGroup = entry["FGroup"].Convert(); - var currGroupItem = entry["F_GroupItem"].Convert(); - if (currGroup.EqualsIgnoreCase(groupId) && !currGroupItem.IsNullOrEmptyOrWhiteSpace()) + var currGroupItem = entry["F_IsGroupItem"].Convert(); + if (currGroup.EqualsIgnoreCase(groupId) && currGroupItem) { var currGroupDosage = entry["F_GroupDosage"].Convert(); this.View.Model.SetValue("FQty", mainQty * currGroupDosage, currIndex); @@ -67,6 +67,10 @@ namespace Pilot_KD_Parino.SAL_DELIVERYNOTICE } + /// + /// 删除主体物料时,删除其对应的配件物料 + /// + /// public override void AfterDeleteRow(AfterDeleteRowEventArgs e) { @@ -79,9 +83,9 @@ namespace Pilot_KD_Parino.SAL_DELIVERYNOTICE if (groupId.IsNullOrEmptyOrWhiteSpace()) return; - var groupItemObj = currDataEntity["F_GroupItem"]; - var groupItem = groupItemObj == null ? "" : groupItemObj.Convert(); - if (!groupItem.IsNullOrEmptyOrWhiteSpace()) + var groupItemObj = this.View.Model.GetValue("F_IsGroupItem", e.Row); + var groupItem = groupItemObj == null ? false : groupItemObj.Convert(); + if (!groupItem) return; var entrys = this.View.Model.DataObject["SAL_DELIVERYNOTICEENTRY"] as DynamicObjectCollection; @@ -93,8 +97,8 @@ namespace Pilot_KD_Parino.SAL_DELIVERYNOTICE foreach (var entry in entrys) { var currGroup = entry["FGroup"].Convert(); - var currGroupItem = entry["F_GroupItem"].Convert(); - if (currGroup.EqualsIgnoreCase(groupId) && !currGroupItem.IsNullOrEmptyOrWhiteSpace()) + var currGroupItem = entry["F_IsGroupItem"].Convert(); + if (currGroup.EqualsIgnoreCase(groupId) && currGroupItem) { deleteIndexs.Add(rowIndex); } diff --git a/Pilot_KD_Parino/SAL_DELIVERYNOTICE/ConvertServicePlugIn/SaleOrder_DeliveryNoticeConvert.cs b/Pilot_KD_Parino/SAL_DELIVERYNOTICE/ConvertServicePlugIn/SaleOrder_DeliveryNoticeConvert.cs index 42a6085..2abc7be 100644 --- a/Pilot_KD_Parino/SAL_DELIVERYNOTICE/ConvertServicePlugIn/SaleOrder_DeliveryNoticeConvert.cs +++ b/Pilot_KD_Parino/SAL_DELIVERYNOTICE/ConvertServicePlugIn/SaleOrder_DeliveryNoticeConvert.cs @@ -44,7 +44,6 @@ namespace Pilot_KD_Parino.SAL_DELIVERYNOTICE.ConvertServicePlugIn var qty = entry["Qty"].Convert(); var guid = Guid.NewGuid().ToString("N"); - //entry["FGroup"] = guid; sqlL.Add($"SELECT {idx} 'Idx',{materialId} MaterialId,{qty} MaterialQty,'{guid}' GroupId"); idx++; @@ -92,18 +91,16 @@ namespace Pilot_KD_Parino.SAL_DELIVERYNOTICE.ConvertServicePlugIn //单位 billView.Model.SetItemValueByID("FUnitID", item["FCHILDUNITID"].Long2Int(), rowIndex); billView.InvokeFieldUpdateService("FUnitID", rowIndex); + //仓库 + billView.Model.SetItemValueByID("FStockID", item["FSTOCKID"].Long2Int(), rowIndex); + billView.InvokeFieldUpdateService("FStockID", rowIndex); - billView.Model.SetValue("F_GroupItem", Guid.NewGuid().ToString("N"), rowIndex); + //表体备注 + billView.Model.SetValue("FNoteEntry", item["FNOTE"], rowIndex); + + //billView.Model.SetValue("F_GroupItem", Guid.NewGuid().ToString("N"), rowIndex); + billView.Model.SetValue("F_IsGroupItem", true, rowIndex); - //billView.GetFieldEditor("FMaterialID", rowIndex).Enabled = false; - //billView.GetFieldEditor("FUnitID", rowIndex).Enabled = false; - //billView.GetFieldEditor("FQty", rowIndex).Enabled = false; - //billView.GetFieldEditor("FIsFree", rowIndex).Enabled = false; - //billView.GetFieldEditor("FDeliveryDate", rowIndex).Enabled = false; - ////billView.GetFieldEditor("FStockID", rowIndex).Enabled = false; - ////billView.GetFieldEditor("FStockLocID", rowIndex).Enabled = false; - //billView.GetFieldEditor("FTaxPrice", rowIndex).Enabled = false; - //billView.GetFieldEditor("FEntryTaxRate", rowIndex).Enabled = false; } } } diff --git a/Pilot_KD_Parino/SQL/SqlManage.cs b/Pilot_KD_Parino/SQL/SqlManage.cs index 18b870e..431b781 100644 --- a/Pilot_KD_Parino/SQL/SqlManage.cs +++ b/Pilot_KD_Parino/SQL/SqlManage.cs @@ -528,11 +528,6 @@ namespace Pilot_KD_Parino.SQL return DBServiceHelper.ExecuteDynamicObject(ctx, sql.ToString(), null, null, CommandType.Text, null) as DynamicObjectCollection; } - - - - - /// /// 更新销售订单的是否分摊 /// @@ -590,6 +585,7 @@ namespace Pilot_KD_Parino.SQL {string.Join(" UNION ALL ", sqlL)} ) SELECT tt.*,t0.FMATERIALID,t0.FAUXQTY,t0e.FSEQ,t0e.FMATERIALIDCHILD,t0e.FQTY,t0e.FCHILDUNITID + ,t0e.FNOTE,t0e.FSTOCKID FROM #基础数据 tt INNER JOIN t_MainDodyParts t0 on t0.FMATERIALID = tt.MaterialId INNER JOIN t_MainDodyPartsEntry t0e on t0.FID = t0e.FID