| | |
| | | //判断条码类型是否为托盘条码,如果是托盘条码则分解并模拟扫码 |
| | | if (dal.omodel_View.HBarCodeType == "托盘条码") |
| | | { |
| | | if(oSystemParameter.omodel.WMS_CampanyName == "杭州斯莫尔") |
| | | { |
| | | //分解托盘条码得到明细条码信息写入条码出入库临时表 |
| | | DataSet dsTBarCode = oCn.RunProcReturn("exec h_p_WMS_BeforeCheckToTPBarCode '" + sBarCode + "'", "h_p_WMS_BeforeCheckToTPBarCode"); |
| | | if (dsTBarCode == null || dsTBarCode.Tables[0].Rows.Count == 0) |
| | |
| | | } |
| | | } |
| | | return oBar; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //将托条码信息写入条码出入库临时表 |
| | | oBar = get_SavePonderationBillMain_Temp_PackBarCode(dal.omodel_View, HInterID, HBillType, HBillNo, HMaker, HWhID, HSPID, 0, 0, SourceFlag, HSourceBillType, HStockOrgID, HStockOrgID, HCustom1, HCustom2, oSystemParameter.omodel, ref sErrMsg); |
| | | if (oBar == null) |
| | | { |
| | | sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HInterID + ";扫描失败!" + sErrMsg; |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | return oBar; |
| | | } |
| | | } |
| | | } |
| | | else |
| | |
| | | //判断条码类型是否为托盘条码,如果是托盘条码则分解并模拟扫码 |
| | | if (dal.omodel_View.HBarCodeType == "托盘条码") |
| | | { |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "杭州斯莫尔") |
| | | { |
| | | //分解托盘条码得到明细条码信息写入条码出入库临时表 |
| | | DataSet dsTBarCode = oCn.RunProcReturn("exec h_p_WMS_BeforeCheckToTPBarCode '" + sBarCode + "'", "h_p_WMS_BeforeCheckToTPBarCode"); |
| | | if (dsTBarCode == null || dsTBarCode.Tables[0].Rows.Count == 0) |
| | |
| | | } |
| | | } |
| | | return oBar; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //将托条码信息写入条码出入库临时表 |
| | | oBar = get_SavePonderationBillMain_Temp_PackBarCode(dal.omodel_View, HInterID, HBillType, HBillNo, HMaker, HWhID, HSPID, 0, 0, SourceFlag, HSourceBillType, HStockOrgID, HStockOrgID, HCustom1, HCustom2, oSystemParameter.omodel, ref sErrMsg); |
| | | if (oBar == null) |
| | | { |
| | | sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HInterID + ";扫描失败!" + sErrMsg; |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | return oBar; |
| | | } |
| | | } |
| | | } |
| | | else |
| | |
| | | if (HSourceBillType != "-1" && (SourceFlag == false || sMulSourceCtl == "Y") |
| | | && (HBillType == "1201" || HBillType == "1202" || HBillType == "1203" || HBillType == "1210" || HBillType == "3711")) |
| | | { |
| | | //判断托条码对应源单是否唯一 |
| | | DataSet dsSource = oCn.RunProcReturn("exec h_p_WMS_AddPackBarCode_Source '" + omodel_View.HBarCode + "'," + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "'", "h_p_WMS_AddPackBarCode_Source"); |
| | | if (dsSource == null || dsSource.Tables[0].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "判断托条码对应源单是否唯一发生错误!"; |
| | | oCn.RollBack(); |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(dsSource.Tables[0].Rows[0][0]) == 1) |
| | | { |
| | | if(SourceFlag == false) |
| | | { |
| | | sErrMsg = DBUtility.ClsPub.isStrNull(dsSource.Tables[0].Rows[0]["HRemark"]); |
| | | oCn.RollBack(); |
| | | return null; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | omodel_View.HSourceBillNo = DBUtility.ClsPub.isStrNull(dsSource.Tables[0].Rows[0]["HSourceBillNo"]); |
| | | omodel_View.HSourceBillType = DBUtility.ClsPub.isStrNull(dsSource.Tables[0].Rows[0]["HSourceBillType"]); |
| | | if(omodel_View.HSourceBillNo!="") |
| | | { |
| | | Int64 HAccessFlag = 1; //是否物料条码带出源单信息标志(0为直接扫源单条码,1为物料条码带出源单信息) |
| | | oBar = get_SourceBill_MaterBarCode(HInterID, HBillNo, HBillType, omodel_View.HSourceBillNo, omodel_View.HSourceBillType, HMaker, HStockOrgID, HAccessFlag, oSystemParameterMain, ref sErrMsg); |
| | | if (oBar == null) |
| | |
| | | else |
| | | { |
| | | SourceFlag = true; |
| | | } |
| | | } |
| | | else if (SourceFlag == false) |
| | | { |
| | | HSourceBillType = "-1"; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else |
| | |
| | | |
| | | //生产领料(1204)、销售出库(1205)、其他出库蓝字(1206)、委外出库(1211)、生产补料(1254) |
| | | //外购退料(1239)、产品退库(1245)、其他入库红字(1248)、委外退库(1246) |
| | | //直接调拨单(1207)、分步式调出单(1250) |
| | | //出库、红字入库,判断条码库存、ERP库存 |
| | | if (HBillType == "1204" || HBillType == "1205" || HBillType == "1206" || HBillType == "1211" || HBillType == "1254" |
| | | || HBillType == "1239" || HBillType == "1245" || HBillType == "1248" || HBillType == "1246") |
| | | || HBillType == "1239" || HBillType == "1245" || HBillType == "1248" || HBillType == "1246" |
| | | || HBillType == "1207" || HBillType == "1250") |
| | | { |
| | | //库存控制-ERP负库存控制 私有云模式 |
| | | if (oSystemParameterMain.WMS_ERPStockCtl == "Y" && oSystemParameterMain.WMS_CloudMode == "Y") |
| | |
| | | //判断条码类型是否为托盘条码,如果是托盘条码则分解并模拟扫码 |
| | | else if (dal.omodel_View.HBarCodeType == "托盘条码") |
| | | { |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "杭州斯莫尔") |
| | | { |
| | | //分解托盘条码得到明细条码信息写入条码出入库临时表 |
| | | DataSet dsTBarCode = oCn.RunProcReturn("exec h_p_WMS_BeforeCheckToTPBarCode '" + sBarCode + "'", "h_p_WMS_BeforeCheckToTPBarCode"); |
| | | if (dsTBarCode == null || dsTBarCode.Tables[0].Rows.Count == 0) |
| | |
| | | } |
| | | oBar.HBarType = "物料条码"; |
| | | return oBar; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //将托条码信息写入条码出入库临时表 |
| | | oBar = get_SavePonderationBillMain_Temp_PackBarCode(dal.omodel_View, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HSCWHID, HSCSPID, SourceFlag, HSourceBillType, HStockInOrgID, HStockOutOrgID, HCustom1, HCustom2, oSystemParameter.omodel, ref sErrMsg); |
| | | if (oBar == null) |
| | | { |
| | | sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HBillID + ";扫描失败!" + sErrMsg; |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | return oBar; |
| | | } |
| | | } |
| | | } |
| | | else |
| | |
| | | //判断条码类型是否为托盘条码,如果是托盘条码则分解并模拟扫码 |
| | | else if (dal.omodel_View.HBarCodeType == "托盘条码") |
| | | { |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "杭州斯莫尔") |
| | | { |
| | | //分解托盘条码得到明细条码信息写入条码出入库临时表 |
| | | DataSet dsTBarCode = oCn.RunProcReturn("exec h_p_WMS_BeforeCheckToTPBarCode '" + sBarCode + "'", "h_p_WMS_BeforeCheckToTPBarCode"); |
| | | if (dsTBarCode == null || dsTBarCode.Tables[0].Rows.Count == 0) |
| | |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //将托条码信息写入条码出入库临时表 |
| | | oBar = get_SavePonderationBillMain_Temp_PackBarCode(dal.omodel_View, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HSCWHID, HSCSPID, SourceFlag, HSourceBillType, HStockInOrgID, HStockOutOrgID, HCustom1, HCustom2, oSystemParameter.omodel, ref sErrMsg); |
| | | if (oBar == null) |
| | | { |
| | | sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HBillID + ";扫描失败!" + sErrMsg; |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | return oBar; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | //条码类型不为托盘条码 |
| | | { |
| | | //将物料条码信息写入条码出入库临时表 |