| | |
| | | "\"FPurchaseDeptId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FPurchaseDeptId"]) + "\"}," + |
| | | "\"FPurchaserGroupId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FPurchaserGroupId"]) + "\"}," + |
| | | "\"FPurchaserId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FPurchaserId"]) + "\"}," + |
| | | "\"FSupplierId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSupplierId"]) + "\"}," + |
| | | //"\"FSupplierId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSupplierId"]) + "\"}," + //移最下方 |
| | | "\"FSupplyId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSupplyId"]) + "\"}," + |
| | | "\"FSupplyAddress\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSupplyAddress"]) + "\"," + |
| | | "\"FSettleId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSettleId"]) + "\"}," + |
| | |
| | | "\"FDeliveryBill\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FDeliveryBill"]) + "\"," + |
| | | "\"FTakeDeliveryBill\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FTakeDeliveryBill"]) + "\"," + |
| | | "\"FBusinessType\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FBusinessType"]) + "\"," + |
| | | "\"FSupplierId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSupplierId"]) + "\"}," + |
| | | |
| | | "\"FInStockFin\":{" + |
| | | //\"FEntryId\":\"0\", |
| | |
| | | "\"FPurchaseDeptId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FPurchaseDeptId"]) + "\"}," + |
| | | "\"FPurchaserGroupId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FPurchaserGroupId"]) + "\"}," + |
| | | "\"FPurchaserId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FPurchaserId"]) + "\"}," + |
| | | "\"FSupplierId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSupplierId"]) + "\"}," + |
| | | //"\"FSupplierId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSupplierId"]) + "\"}," + //移最下方 |
| | | "\"FSupplyId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSupplyId"]) + "\"}," + |
| | | "\"FSupplyAddress\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSupplyAddress"]) + "\"," + |
| | | "\"FSettleId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSettleId"]) + "\"}," + |
| | |
| | | "\"FDeliveryBill\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FDeliveryBill"]) + "\"," + |
| | | "\"FTakeDeliveryBill\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FTakeDeliveryBill"]) + "\"," + |
| | | "\"FBusinessType\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FBusinessType"]) + "\"," + |
| | | "\"FSupplierId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSupplierId"]) + "\"}," + |
| | | |
| | | "\"FInStockFin\":{" + |
| | | //\"FEntryId\":\"0\", |
| | |
| | | //获取条码数量 |
| | | if (dal.omodel_View.HBarCodeType != "托盘条码") |
| | | { |
| | | if (dal.omodel_View.HBarCodeType == "唯一条码" && HQty > 0 && dal.omodel_View.HQty < HQty) |
| | | if (dal.omodel_View.HBarCodeType == "唯一条码") |
| | | { |
| | | sRelQty = dal.omodel_View.HQty; |
| | | } |
| | | else if (HQty > 0) |
| | | { |
| | | sRelQty = HQty; |
| | | if (HQty > 0 && dal.omodel_View.HQty > HQty) |
| | | { |
| | | sRelQty = HQty; |
| | | } |
| | | else |
| | | { |
| | | sRelQty = dal.omodel_View.HQty; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | sRelQty = dal.omodel_View.HQty; |
| | | if (HQty > 0) |
| | | { |
| | | sRelQty = HQty; |
| | | } |
| | | else if(dal.omodel_View.HinitQty>0) |
| | | { |
| | | sRelQty = dal.omodel_View.HinitQty; |
| | | } |
| | | else |
| | | { |
| | | sRelQty = dal.omodel_View.HQty; |
| | | } |
| | | } |
| | | |
| | | //if (dal.omodel_View.HBarCodeType == "唯一条码" && HQty > 0 && dal.omodel_View.HQty < HQty) |
| | | //{ |
| | | // sRelQty = dal.omodel_View.HQty; |
| | | //} |
| | | //else if (HQty > 0) |
| | | //{ |
| | | // sRelQty = HQty; |
| | | //} |
| | | //else |
| | | //{ |
| | | // sRelQty = dal.omodel_View.HQty; |
| | | //} |
| | | //采购入库(1201)、产品入库(1202)、其他入库蓝字(1203)、委外入库(1210) |
| | | //生产退料(1244)、销售退库(1247)、其他出库红字(1249)、委外退料(1238) |
| | | //生产领料(1204)、销售出库(1205)、其他出库蓝字(1206)、委外出库(1211) |
| | |
| | | //非唯一条码扫描时判断仓库仓位是否已选择 |
| | | if (dal.omodel_View.HBarCodeType != "唯一条码") |
| | | { |
| | | if (HWhID == 0) |
| | | if (oSystemParameter.omodel.WMS_ERPStockCtl == "N") |
| | | { |
| | | sErrMsg = "仓库没有选择!"; |
| | | return false; |
| | | if (HWhID == 0) |
| | | { |
| | | sErrMsg = "仓库没有选择!"; |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | //根据仓库ID,判断是否启用仓位 |
| | | DataSet ds3 = oCn.RunProcReturn(" select HSPFlag from Gy_Warehouse with(nolock) where HItemID= " + HWhID.ToString(), "Gy_Warehouse"); |
| | | if (ds3 == null || ds3.Tables[0].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "仓库内码错误!"; |
| | | return false; |
| | | } |
| | | else if (HSPID == 0 && DBUtility.ClsPub.isBool(ds3.Tables[0].Rows[0]["HSPFlag"]) == true) |
| | | { |
| | | sErrMsg = "仓位没有选择!"; |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //根据仓库ID,判断是否启用仓位 |
| | | DataSet ds3 = oCn.RunProcReturn(" select HSPFlag from Gy_Warehouse with(nolock) where HItemID= " + HWhID.ToString(), "Gy_Warehouse"); |
| | | if (ds3 == null || ds3.Tables[0].Rows.Count == 0) |
| | | //判断ERP库存 返回ERP库存数量 |
| | | DataSet ds6 = oCn.RunProcReturn("exec h_p_IF_CheckQtyByERPICInventory " + HBillID.ToString() + ",'" + HBillType + "','" + sBarCode + "'," + HWhID.ToString() + "," + HSPID.ToString() + "," + dal.omodel_View.HMaterID.ToString() + "," + dal.omodel_View.HAuxPropID.ToString() + ",'" + dal.omodel_View.HBatchNo + "'," + sRelQty.ToString() + "," + HOWNERID.ToString(), "h_p_IF_CheckQtyByERPICInventory"); |
| | | if (ds6 == null || ds6.Tables[0].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "仓库内码错误!"; |
| | | sErrMsg = "判断ERP库存,未知错误!"; |
| | | return false; |
| | | } |
| | | else if (HSPID == 0 && DBUtility.ClsPub.isBool(ds3.Tables[0].Rows[0]["HSPFlag"]) == true) |
| | | else |
| | | { |
| | | sErrMsg = "仓位没有选择!"; |
| | | return false; |
| | | if (DBUtility.ClsPub.isLong(ds6.Tables[0].Rows[0][0]) == 0) |
| | | { |
| | | dal.omodel_View.HMaterID = DBUtility.ClsPub.isLong(ds6.Tables[0].Rows[0]["HMaterID"]); |
| | | HQty = DBUtility.ClsPub.isDoule(ds6.Tables[0].Rows[0]["HQty"]); |
| | | } |
| | | else |
| | | { |
| | | sErrMsg = DBUtility.ClsPub.isStrNull(ds6.Tables[0].Rows[0]["HRemark"]); |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | } |