| | |
| | | { |
| | | foreach (DataRow dr in dt.Rows) |
| | | { |
| | | //采购订单下推生成送货单 时候 判断是否有生成采购订单变更单 如果有且变更单状态不为已审核 限制下推 |
| | | objJsonResult = TestPOOrder(dr["FEntryID"].ToString()); |
| | | if (objJsonResult.code == "0") |
| | | return objJsonResult; |
| | | } |
| | | foreach (DataRow dr in dt.Rows) |
| | | { |
| | | if (fidList.Contains(dr["HINTERID"].ToString())) |
| | | continue; |
| | | else |
| | |
| | | FentityModel.Add("FPreDeliveryDate", DateTime.Now.ToString("yyyy-MM-dd")); //预计到货日期 |
| | | FentityModel.Add("FPriceUnitId", new JObject() { ["Fnumber"] = item["FUNITNUMBER"].ToString() }); // 计价单位 |
| | | FentityModel.Add("FStockUnitID", new JObject() { ["Fnumber"] = item["FUNITNUMBER"].ToString() }); // 库存单位 |
| | | FentityModel.Add("FStockID", new JObject() { ["Fnumber"] = "BJCK-SH.01.005" }); // 库存单位 |
| | | FentityModel.Add("FActReceiveQty", Convert.ToDecimal(item["HQTY"])); // 供应商送货数量(提料计划数量 - 已生成送货单数量) |
| | | FentityModel.Add("FOwnerTypeId", "BD_OwnerOrg");//货主类型 |
| | | FentityModel.Add("FOwnerID", new JObject() { ["Fnumber"] = dr["FPURCHASEORGNUMBER"].ToString() });//货主 |
| | |
| | | { |
| | | var kdTbaleName = Util.GetConfigKey(AppDomain.CurrentDomain.BaseDirectory + "/Config/kdapi.config", "DataBaseName"); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | string sql = string.Format("select HinterID,HERPBillNO,HERPInterID from Cg_POInStockBillMain where HERPInterID>0 and hinterid in (" + hinterid + ")"); |
| | | string FCusName = oSystemParameter.GetSingleSystemParameter("WMS_CampanyName", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | if (FCusName == "夏宝电器") |
| | | sql = $"select HinterID,HERPBillNO,HERPInterID from Cg_POInStockBillMain t1 join {kdTbaleName}..T_PUR_RECEIVE t2 on t1.HERPInterID = t2.FID where HERPInterID>0 and hinterid in (" + hinterid + ")"; |
| | | else if (FCusName.Contains("瑞与祺") || FCusName == "") |
| | | sql = $"select HinterID,HERPBillNO,HERPInterID from Cg_POInStockBillMain t1 join {kdTbaleName}..T_PUR_RECEIVE t2 on t1.HERPInterID = t2.FID where HERPInterID>0 and hinterid in (" + hinterid + ")"; |
| | | //string sql = string.Format("select HinterID,HERPBillNO,HERPInterID from Cg_POInStockBillMain where HERPInterID>0 and hinterid in (" + hinterid + ")"); |
| | | //string FCusName = oSystemParameter.GetSingleSystemParameter("WMS_CampanyName", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | var sql = $"select HinterID,HERPBillNO,HERPInterID from Cg_POInStockBillMain t1 join {kdTbaleName}..T_PUR_RECEIVE t2 on t1.HERPInterID = t2.FID where HERPInterID>0 and hinterid in (" + hinterid + ")"; |
| | | DataTable dt = oCN.RunProcReturn(sql, "deleteDt").Tables[0]; |
| | | if (dt.Rows.Count == 0) |
| | | { |
| | |
| | | //LogService.Write("api结果删除:" + result); |
| | | if (JObject.Parse(result)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE") |
| | | { |
| | | //var errorsList = JObject.Parse(result)["Result"]["ResponseStatus"]["Errors"]; |
| | | //List<string> errList = new List<string>(); |
| | | //foreach (var item in errorsList) |
| | | //{ |
| | | // errList.Add(item["Message"].ToString()+ "\r\n"); |
| | | //} |
| | | //string err = string.Join(",", errList); |
| | | objjson.code = "0"; |
| | | objjson.count = 0; |
| | | objjson.Message = "对应金蝶收料通知单删除失败 !\r\n" + result; |
| | |
| | | JOIN Gy_Material E ON B.HMaterID = E.HItemID |
| | | JOIN {1}..T_PUR_POORDERENTRY C ON B.HInterID = C.FID AND B.HEntryID = C.FENTRYID |
| | | LEFT join {1}..T_PUR_POCHANGEENTRY D ON C.FENTRYID = D.FOFENTRYID |
| | | LEFT join {1}..T_PUR_POCHANGE F ON D.FID = F.FID |
| | | where b.HEntryID in ({0}) |
| | | LEFT join {1}..T_PUR_POCHANGE F ON D.FID = F.FID |
| | | where b.HEntryID in ({0}) |
| | | and F.FDOCUMENTSTATUS <> 'C'" |
| | | , entryids, kdTbaleName); |
| | | ds = oCn.RunProcReturn(sql, "temp"); |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据号:" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + ",物料编码:" + ds.Tables[0].Rows[0]["HNumber"].ToString() + ",有对应采购订单变更单:" + ds.Tables[0].Rows[0]["FBILLNO"].ToString() + "未审核,不能下推送货单!"; |
| | | objJsonResult.Message = "单据号:" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + ",物料编码:" + ds.Tables[0].Rows[0]["HNumber"].ToString() + ",存在对应采购订单变更单:" + ds.Tables[0].Rows[0]["FBILLNO"].ToString() + "未审核,不能下推送货单!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //采购订单下推生成送货单 时候 判断是否有生成采购订单新变更单 如果有且变更单状态不为已审核 限制下推 |
| | | sql = string.Format(@" |
| | | select M.HBillNo,B.HMaterID,E.HNumber,E.HName,F.FBILLNO |
| | | FROM Cg_POOrderBillSub B |
| | | JOIN Cg_POOrderBillMAIN M ON B.HINTERID = M.HINTERID |
| | | JOIN Gy_Material E ON B.HMaterID = E.HItemID |
| | | JOIN {1}..T_PUR_POORDERENTRY C ON B.HInterID = C.FID AND B.HEntryID = C.FENTRYID |
| | | LEFT join {1}..t_PUR_XPOOrderENTRY D ON C.FENTRYID = D.FPKIDX |
| | | LEFT join {1}..t_PUR_XPOOrder F ON D.FID = F.FID |
| | | where F.FDOCUMENTSTATUS <> 'C' and b.HEntryID in ({0}) " |
| | | , entryids, kdTbaleName); |
| | | ds = oCn.RunProcReturn(sql, "temp"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据号:" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + ",物料编码:" + ds.Tables[0].Rows[0]["HNumber"].ToString() + ",存在对应采购订单新变更单:" + ds.Tables[0].Rows[0]["FBILLNO"].ToString() + "未审核,不能下推送货单!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |