| | |
| | | if (oItemSub.HQty == 0) |
| | | continue; |
| | | //检验打印数量(HQTY)和未打印数量 |
| | | string sql = $"select HQty -HBarcodeCount as HNotBarcodeCount ,* from Cg_POOrderBillSub where HEntryID = ={oItemSub.HSourceEntryID}"; |
| | | string sql = $"select HQty -HBarcodeCount as HNotBarcodeCount ,* from Cg_POOrderBillSub where HEntryID = {oItemSub.HSourceEntryID}"; |
| | | DataSet ds = oCn.RunProcReturn(sql,"tables"); |
| | | if (Convert.ToInt32(ds.Tables[0].Rows[0][0]) < oItemSub.HQty) |
| | | { |
| | |
| | | oCn.RunProc($"exec h_p_SRM_UpDatePPBomRelationQty {HinterID}"); |
| | | } |
| | | //判断未关联数量是否为0 |
| | | DataSet ds = oCn.RunProcReturn($"select * from H_v_SRM_POOrderBillList where hsubid in ({string.Join(", ", entryList)}) ", "H_v_SRM_POOrderBillList"); |
| | | DataSet ds = oCn.RunProcReturn($"select hqty-hrelationqty as hqty from Cg_POOrderBillSub where hentryid in ({string.Join(", ", entryList)}) ", "H_v_SRM_POOrderBillList"); |
| | | DataTable dt = ds.Tables[0]; |
| | | if (dt.Rows.Count > 0) |
| | | { |
| | | DataRow[] dr = dt.Select("未关联数量 = " + 0); |
| | | DataRow[] dr = dt.Select("hqty <=" + 0); |
| | | if (dr.Count() > 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = $"请检查数据,单据号:{dr[0]["单据号"]},物料代码:{dr[0]["物料代码"]},未关联数量为0,已全部生成送货单!"; |
| | | objJsonResult.Message = $"请检查数据,单据号:{dr[0]["单据号"]},物料代码:{dr[0]["物料代码"]},未发货数量为0,已全部生成送货单!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |