ch
2021-09-23 9c32237b97a0e5381350c3dc382a297884d3a0df
新增了器具采购入库单扫码、提交方法
3个文件已修改
1130 ■■■■ 已修改文件
CLOUDWEB/WebService1.asmx.cs 1130 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DLL/DAL.dll 补丁 | 查看 | 原始文档 | blame | 历史
DLL/Model.dll 补丁 | 查看 | 原始文档 | blame | 历史
CLOUDWEB/WebService1.asmx.cs
@@ -994,7 +994,7 @@
        {
            DAL.ClsCLD_StockPlace_View dal = new DAL.ClsCLD_StockPlace_View();
            return dal.GetWHSPInfoByID(sHWhID, sHSPID);
        }
        //根据CLOUD仓库代码返回仓库信息 (判断文本框TAG历史信息)
@@ -1301,7 +1301,7 @@
        #endregion
        #region CLOUD 生产领料单--来源单据      *
        //返回CLOUD生产投料单列表
        /// <summary>
        /// 返回CLOUD生产投料单列表
@@ -1416,7 +1416,7 @@
            return dal.DisSourceBillList(sWhere);
        }
        #endregion
@@ -2615,73 +2615,56 @@
        //保存到出入库条码临时表(一张单据,存在相同物料)
        [WebMethod]
        public bool set_SavePonderationBillMain_Temp_Select_Qty(Model.ClsKF_PonderationBillMain_Temp oMain, Double sQty, ref string sErrMsg)
        public bool set_SavePonderationBillMain_Temp_Select_Qty_Mould(Model.ClsSc_MouldStockBillMain_Temp oMain, Double sQty, ref string sErrMsg)
        {
            DAL.ClsKF_PonderationBillMain_Temp_Ctl dal = new DAL.ClsKF_PonderationBillMain_Temp_Ctl();
            DAL.ClsGy_BarCodeBill_View oBar = new DAL.ClsGy_BarCodeBill_View();
            DAL.ClsKF_PonderationBillMain_Temp_Ctl_Mould dal = new DAL.ClsKF_PonderationBillMain_Temp_Ctl_Mould();
            DAL.ClsGy_BarCodeBill_View_Mould oBar = new DAL.ClsGy_BarCodeBill_View_Mould();
            dal.oModel = oMain;
            if (!oBar.GetInfoByNumber_View(oMain.HBarCode))
            if (!oBar.GetInfoByNumber(oMain.HBarCode))
            {
                sErrMsg = "无效条码";
                return false;
            }
            else
            {
                if (oBar.omodel_View.HBarCodeType == "托盘条码")
                if (oBar.omodel_View.HBarCodeType == "唯一条码")
                {
                    if (!dal.IsBarCode_Pack(oMain.HBarCode, oMain.HInterID, oMain.HBillType))
                    if (!dal.IsBarCode(oMain.HBarCode, oMain.HInterID, oMain.HErpClsID, oMain.HBillType))
                    {
                        sErrMsg = "存在相同条码,请勿重复扫描!";
                        return false;
                    }
                    if (dal.AddNew_More_Select(ref sErrMsg))
                    {
                        //sErrMsg = "保存成功!";
                        return true;
                    }
                    else
                    {
                        //sErrMsg = "保存失败!";
                        return false;
                    }
                }
                if (dal.AddNew_Mould(oMain.HInterID,oMain.HMouldID,oMain.HBillType,oMain.HWhID,oMain.HSCWHID,oMain.HStockPlaceID,oMain.HOutStockPlaceID,oMain.HBarCode,oMain.HMaker,oMain.HOWNERID,oMain.HStockOrgID,oMain.HBillNo,oMain.HOtherOrgID))
                {
                    //sErrMsg = "保存成功!";
                    return true;
                }
                else
                {
                    if (oBar.omodel_View.HBarCodeType == "唯一条码")
                    {
                        if (!dal.IsBarCode(oMain.HBarCode, oMain.HInterID, oMain.HErpClsID, oMain.HBillType))
                        {
                            sErrMsg = "存在相同条码,请勿重复扫描!";
                            return false;
                        }
                        //一次扫码控制,同一条码、同一单据类型,在WMS表和TEMP表里,只允许进行一次扫码
                        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
                        DataSet ds= oCn.RunProcReturn("exec h_p_WMS_CheckBarCodeOneScan " + oMain.HInterID.ToString() + ",'" + oMain.HBarCode + "','" + oMain.HBillType + "'," + oMain.HWhID.ToString() + "," + oMain.HStockPlaceID.ToString() + "," + oMain.HSCWHID.ToString() + "," + oMain.HOutStockPlaceID.ToString() + ",'" + oMain.HMaker+"'", "h_p_WMS_CheckBarCodeOneScan");
                        if (ds == null || ds.Tables[0].Rows.Count == 0)
                        {
                        }
                        else
                        {
                            if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0][0]) == 1)
                            {
                                sErrMsg = "对不起,您扫描的条形码已被扫描过,不符合一次扫码系统参数的要求!";
                                return false;
                            }
                        }
                    }
                    if (dal.AddNew_Source(sQty, ref sErrMsg))
                    {
                        //sErrMsg = "保存成功!";
                        return true;
                    }
                    else
                    {
                        //sErrMsg = "保存失败!";
                        return false;
                    }
                    //sErrMsg = "保存失败!";
                    return false;
                }
            }
        }
        //缓存列表界面,返回缓存列表信息(工序汇报转移单)
        [WebMethod]
        public DataSet GetKf_PonderationBillMain_TempList_ProcReportMove(string sHBillType, string sHMaker, Int64 sHOWNERID, Int64 sHSubBillType)
        {
            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
            DataSet Ds = oCn.RunProcReturn("exec h_p_KF_GetPonderationBillMain_TempList_ProcReportMove '" + sHBillType + "','" + sHMaker + "'," + sHOWNERID.ToString() + "," + sHSubBillType.ToString(), "h_p_KF_GetPonderationBillMain_TempList_ProcReportMove");
            if (Ds == null || Ds.Tables[0].Rows.Count == 0)
            {
                return null;
            }
            else
            {
                return Ds;
            }
        }
        //保存到出入库条码临时表(单条码,一张单据一条条码)
        [WebMethod]
@@ -2909,8 +2892,8 @@
                        //}
                        //else
                        //{
                            //sErrMsg = "保存失败!";
                            return false;
                        //sErrMsg = "保存失败!";
                        return false;
                        //}
                    }
                }
@@ -3138,7 +3121,7 @@
                    sHSupName = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HSupName"]);
                    sHDeptID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HDeptID"]);
                    sHDeptName = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HDeptName"]);
                    if (sSourceBillNo =="")
                    if (sSourceBillNo == "")
                    {
                        sErrMsg = "";
                        return true;
@@ -3339,7 +3322,7 @@
                }
                else
                {
                    if (dal.AddNew_CheckAdd(sQty,ref sErrMsg))
                    if (dal.AddNew_CheckAdd(sQty, ref sErrMsg))
                    {
                        //sErrMsg = "保存成功!";
                        return true;
@@ -3646,6 +3629,20 @@
            return dal.GetInfoByID_View(HInterID, sBillType, sWhere);
        }
        //返回出入库条码临时表(器具条码)
        /// <summary>
        /// 返回出入库条码临时表
        /// </summary>
        /// <param name="sWhere">过滤条件</param>
        /// <returns></returns>
        [WebMethod]
        public DataSet GetKf_PonderationBillMain_Temp_Mould(long HInterID, string sBillType, string sWhere)
        {
            DAL.ClsKF_PonderationBillMain_Temp_View_Mould dal = new DAL.ClsKF_PonderationBillMain_Temp_View_Mould();
            return dal.GetInfoByID_View(HInterID, sBillType, sWhere);
        }
        //返回出入库条码临时表(领料出库、收料通知单审核)
        /// <summary>
        /// 返回出入库条码临时表(领料出库、收料通知单审核)
@@ -3854,10 +3851,10 @@
        /// <param name="sWhere">过滤条件</param>
        /// <returns></returns>
        [WebMethod]
        public DataSet Get_ICInventoryByMaterID(long HMaterID,long HWhID, string sWhere)
        public DataSet Get_ICInventoryByMaterID(long HMaterID, long HWhID, string sWhere)
        {
            DAL.ClsKF_PonderationBillMain_Temp_View dal = new DAL.ClsKF_PonderationBillMain_Temp_View();
            return dal.Get_ICInventoryByMaterID(HMaterID,HWhID, sWhere);
            return dal.Get_ICInventoryByMaterID(HMaterID, HWhID, sWhere);
        }
        //返回条码对应客户表
@@ -4057,7 +4054,7 @@
                //审核单据
                //if (oSystemParameterMain.Sc_DoorOutCheckBill_AutoCheck == "Y") //系统参数  自动审核 
                //{
                    //审核单据
                //审核单据
                oCn.RunProc("Update Sc_DoorOutCheckBillMain Set HChecker='" + oMain.HMaker + "',HCheckDate=getdate() where HInterID= " + oMain.HInterID.ToString());
                //}
@@ -4263,17 +4260,17 @@
            //if (sHSourceType == "3710")   //源单:生产订单
            //{
            if (SaveICMOReportBill_ICMO_CLD(oMain, sHSourceType, oSystemParameterMain, ref sErrMsg))
                {
                    //"保存成功!";
                    sErrMsg = "保存成功!" + oMain.HBillNo;
                    return true;
                }
                else
                {
                    //"保存失败!";
                    sErrMsg = "单据号:" + oMain.HBillNo + ",单据ID:" + oMain.HInterID + ";" + sErrMsg;
                    return false;
                }
            {
                //"保存成功!";
                sErrMsg = "保存成功!" + oMain.HBillNo;
                return true;
            }
            else
            {
                //"保存失败!";
                sErrMsg = "单据号:" + oMain.HBillNo + ",单据ID:" + oMain.HInterID + ";" + sErrMsg;
                return false;
            }
            //}
            //else
            //{
@@ -4398,12 +4395,12 @@
                        //自定义字段处理
                        if (oSystemParameterMain.WMS_CampanyName == "四维尔") //系统参数  客户定制化名称     空白为通用
                        {
                            sJson_EntryCustom = "\"FBILLSTATUS\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBILLSTATUS"]) + "\","+         //单据状态
                            sJson_EntryCustom = "\"FBILLSTATUS\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBILLSTATUS"]) + "\"," +         //单据状态
                                                "\"F_abcd_Datetime\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["F_abcd_Datetime"]) + "\","; //计划开工日期
                        }
                        else if (oSystemParameterMain.WMS_CampanyName == "韩电") //系统参数  客户定制化名称     空白为通用
                        {
                            sJson_EntryCustom = "\"F_QOUL_ASSISTANT\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["F_QOUL_ASSISTANT"]) + "\"},"+     //产品等级
                            sJson_EntryCustom = "\"F_QOUL_ASSISTANT\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["F_QOUL_ASSISTANT"]) + "\"}," +     //产品等级
                                                "\"F_QOUL_TEXT\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["F_QOUL_TEXT"]) + "\",";                             //销售订单号
                        }
                        else
@@ -4767,12 +4764,12 @@
                        //自定义字段处理
                        if (oSystemParameterMain.WMS_CampanyName == "四维尔") //系统参数  客户定制化名称     空白为通用
                        {
                            sJson_EntryCustom = "\"FBILLSTATUS\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBILLSTATUS"]) + "\","+         //单据状态
                            sJson_EntryCustom = "\"FBILLSTATUS\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBILLSTATUS"]) + "\"," +         //单据状态
                                                "\"F_abcd_Datetime\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["F_abcd_Datetime"]) + "\","; //计划开工日期
                        }
                        //
                        sJson_Entry = sJson_Entry + " {" +
                            //" \"FEntryID\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["HEntryID"]) + "," +
                        //" \"FEntryID\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["HEntryID"]) + "," +
                        " \"FSRCENTRYID\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCENTRYID"]) + "," +
                        " \"FIsNew\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FIsNew"]) + "," +
                        " \"FMATERIALID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMATERIALID"]) + "\"}," +
@@ -4780,9 +4777,9 @@
                        " \"FREPORTTYPE\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FREPORTTYPE"]) + "\"}," +
                        " \"FUNITID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FUNITID"]) + "\"}," +
                        " \"FWORKSHIPID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FWORKSHOPID"]) + "\"}," +
                            //\"FShiftGroupId\":{\"FNumber\":\"\"},
                        //\"FShiftGroupId\":{\"FNumber\":\"\"},
                        sJson_BatchNo +
                            //\"FDeptId\":{\"FNumber\":\"\"},
                        //\"FDeptId\":{\"FNumber\":\"\"},
                        sJson_StockPlace +
                        " \"FMTONO\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMTONO"]) + "\"," +
                        " \"FCHECKPRODUCT\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FCHECKPRODUCT"]) + "," +
@@ -4790,22 +4787,22 @@
                        " \"FSRCBILLTYPE\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCBILLTYPE"]) + "\"," +
                        " \"FMOBILLNO\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMOBILLNO"]) + "\"," +
                        " \"FAUXPROPID\":{\"FAUXPROPID__FF100002\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FAUXPROPID"]) + "\"}}," +
                            //\"FHumanQty\":\"0\",
                        //\"FHumanQty\":\"0\",
                        " \"FSRCBILLNO\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCBILLNO"]) + "\"," +
                            //\"FMachineQty\":\"0\",
                            //\"FMaterialUnitID\":{\"FNumber\":\"\"},
                            //\"FStartTime\":\"1900-01-01\",
                            //\"FEndTime\":\"1900-01-01\",
                            //\"FTimeUnitId\":\"\",
                        //\"FMachineQty\":\"0\",
                        //\"FMaterialUnitID\":{\"FNumber\":\"\"},
                        //\"FStartTime\":\"1900-01-01\",
                        //\"FEndTime\":\"1900-01-01\",
                        //\"FTimeUnitId\":\"\",
                        " \"FMOENTRYSEQ\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMOENTRYSEQ"]) + "," +
                            //" \"FSTANDHOURUNITID\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSTANDHOURUNITID"]) + "\"," +
                        //" \"FSTANDHOURUNITID\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSTANDHOURUNITID"]) + "\"," +
                        " \"FPROJECTNO\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FPROJECTNO"]) + "\"," +
                        " \"FSTDMANHOUR\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSTDMANHOUR"]) + "," +
                        " \"FHRPREPARETIME\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FHRPREPARETIME"]) + "," +
                            //\"FHrWorkTime\":\"0\",
                        //\"FHrWorkTime\":\"0\",
                        " \"FMACPREPARETIME\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMACPREPARETIME"]) + "," +
                            //\"FMacWorkTime\":\"0\",
                            //\"FDescriptionE\":\"\",
                        //\"FMacWorkTime\":\"0\",
                        //\"FDescriptionE\":\"\",
                        " \"FSRCINTERID\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCINTERID"]) + "," +
                        " \"FSRCENTRYSEQ\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCENTRYSEQ"]) + "," +
                        " \"FMOID\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMOID"]) + "," +
@@ -4818,9 +4815,9 @@
                        " \"FSTOCKID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSTOCKID"]) + "\"}," +
                        " \"FCOSTRATE\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FCOSTRATE"]) + "," +
                        " \"FSNUNITID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSNUNITID"]) + "\"}," +
                            //\"FSNQty\":\"0\",
                            //\"FProduceDate\":\"1900-01-01\",
                            //\"FExpiryDate\":\"1900-01-01\",
                        //\"FSNQty\":\"0\",
                        //\"FProduceDate\":\"1900-01-01\",
                        //\"FExpiryDate\":\"1900-01-01\",
                        " \"FISBACKFLUSH\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FISBACKFLUSH"]) + "," +
                        " \"FMOMAINENTRYID\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMOMAINENTRYID"]) + "," +
                        " \"FQAIP\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FQAIP"]) + "\"," +
@@ -4836,16 +4833,16 @@
                        sJson_EntryCustom +
                        //\"FSerialSubEntity\":[{\"FDetailID\":\"0\",
                            //\"FQCMaterialId\":{\"FNUMBER\":\"\"},
                            //\"FInspectResult\":\"\",
                            //\"FQcAuxPropId\":{\"FQCAUXPROPID__FF100002\":{\"FNumber\":\"\"}},
                            //\"FQCQty\":\"0\",
                            //\"FSerialNo\":\"\",
                            //\"FSerialId\":{\"FNUMBER\":\"\"},
                            //\"FQCStockInSelQty\":\"0\",
                            //\"FSerialNote\":\"\",
                            //\"FBaseQCQty\":\"0\",
                            //\"FBaseQCStockInSelQty\":\"0\"}]
                        //\"FQCMaterialId\":{\"FNUMBER\":\"\"},
                        //\"FInspectResult\":\"\",
                        //\"FQcAuxPropId\":{\"FQCAUXPROPID__FF100002\":{\"FNumber\":\"\"}},
                        //\"FQCQty\":\"0\",
                        //\"FSerialNo\":\"\",
                        //\"FSerialId\":{\"FNUMBER\":\"\"},
                        //\"FQCStockInSelQty\":\"0\",
                        //\"FSerialNote\":\"\",
                        //\"FBaseQCQty\":\"0\",
                        //\"FBaseQCStockInSelQty\":\"0\"}]
                        " \"FEntity_Link\": [{" +
                            " \"FEntity_Link_FFlowId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FFlowId"]) + "\"," +
@@ -4882,7 +4879,7 @@
                    //生成 生产汇报单 
                    string HReturn;
                    string HReturn2 = "";
                    string HReturn2 = "";
                    ApiClient client = new ApiClient(Pub_Class.ClsPub.sCLOUDUrl);
                    string dbId = Pub_Class.ClsPub.sCLOUDAcc; //AotuTest117
@@ -4923,7 +4920,7 @@
                        {
                            if (HReturn2.Contains("\"IsSuccess\":false") == true)
                            {
                                sErrMsg = "生成生产入库单失败!" + HReturn2 ;
                                sErrMsg = "生成生产入库单失败!" + HReturn2;
                            }
                            else
                            {
@@ -5501,7 +5498,7 @@
                        else
                        {
                            //调入仓位
                            if (Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSrcStockLocId"])=="")
                            if (Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSrcStockLocId"]) == "")
                            {
                                sJson_SrcStockPlace = "";
                            }
@@ -5544,7 +5541,7 @@
                        //"\"FDestStockLocId\":{\"FDESTSTOCKLOCID__FF100002\":{\"FNUMBER\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FDestStockLocId"]) + "\"}}," +
                        "\"FSrcStockStatusId\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSrcStockStatusId"]) + "\" }," +
                        "\"FDestStockStatusId\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FDestStockStatusId"]) + "\" }," +
                       // "\"FBusinessDate\":\"" + oMain.HDate.ToShortDateString() + "\"," +
                        // "\"FBusinessDate\":\"" + oMain.HDate.ToShortDateString() + "\"," +
                        "\"FOwnerTypeOutId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FOwnerTypeOutId"]) + "\"," +
                        "\"FOwnerOutId\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FOwnerOutId"]) + "\" }," +
                        "\"FOwnerTypeId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FOwnerTypeId"]) + "\"," +
@@ -5802,7 +5799,7 @@
                        //"\"FDestStockLocId\":{\"FDESTSTOCKLOCID__FF100002\":{\"FNUMBER\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FDestStockLocId"]) + "\"}}," +
                        "\"FSrcStockStatusId\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSrcStockStatusId"]) + "\" }," +
                        "\"FDestStockStatusId\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FDestStockStatusId"]) + "\" }," +
                        "\"FBusinessDate\":\"" +oMain.HDate.ToShortDateString()+ "\"," +
                        "\"FBusinessDate\":\"" + oMain.HDate.ToShortDateString() + "\"," +
                        "\"FOwnerTypeOutId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FOwnerTypeOutId"]) + "\"," +
                        "\"FOwnerOutId\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FOwnerOutId"]) + "\" }," +
                        "\"FOwnerTypeId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FOwnerTypeId"]) + "\"," +
@@ -6300,7 +6297,7 @@
                        "\"FDestStockLocId\":{\"FDESTSTOCKLOCID__FF100002\":{\"FNUMBER\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FDestStockLocId"]) + "\"}}," +
                        "\"FSrcStockStatusId\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSrcStockStatusId"]) + "\" }," +
                        "\"FDestStockStatusId\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FDestStockStatusId"]) + "\" }," +
                            //"\"FBusinessDate\":\"" + oMain.HDate.ToShortDateString() + "\"," +
                        //"\"FBusinessDate\":\"" + oMain.HDate.ToShortDateString() + "\"," +
                        "\"FOwnerTypeInId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FOwnerTypeOutId"]) + "\"," +
                        "\"FOwnerInId\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FOwnerInId"]) + "\" }," +
                        "\"FOwnerTypeId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FOwnerTypeId"]) + "\"," +
@@ -6532,7 +6529,7 @@
            sErrMsg = "保存调拨单失败!" + sErrMsg;
            return false;
        }
        //核对虚仓调拨K3
        [WebMethod]
        public bool set_CheckXCMoveStockBill(Model.ClsKf_XCMoveStockBillMain_K3 oMain, ref string sErrMsg)
@@ -7676,16 +7673,16 @@
            //if (oSystemParameter.omodel.Kf_MoveStockStepOutBill_ERPMode.ToUpper() == "CLOUD")  //判断同步模式是金蝶CLOUD
            //{
                if (set_SaveMoveStockStepOutBill_CLD_New(oMain, sHSourceType, oSystemParameter.omodel, ref sErrMsg) == true)
                {
                    //"保存成功!";
                    return true;
                }
                else
                {
                    //"保存失败!";
                    return false;
                }
            if (set_SaveMoveStockStepOutBill_CLD_New(oMain, sHSourceType, oSystemParameter.omodel, ref sErrMsg) == true)
            {
                //"保存成功!";
                return true;
            }
            else
            {
                //"保存失败!";
                return false;
            }
            //}
            sErrMsg = "保存分步式调出单失败!" + sErrMsg;
@@ -8154,7 +8151,7 @@
                        }
                        //
                        sJson_Entry = sJson_Entry + " {" +
                            //\"FEntryID\":\"0\",
                        //\"FEntryID\":\"0\",
                        "\"FMaterialId\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMaterialId"]) + "\" }," +
                        "\"FQty\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FQty"]) + "\"," +
                        " \"FAUXPROPID\":{\"FAUXPROPID__FF100002\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FAUXPROPID"]) + "\"}}," +
@@ -8164,43 +8161,43 @@
                        sJson_SrcStockPlace +
                        "\"FDestStockId\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FDestStockId"]) + "\" }," +
                        sJson_DestStockPlace +
                            //\"FBOMID\":{\"FNumber\":\"\"},
                        //\"FBOMID\":{\"FNumber\":\"\"},
                        "\"FSrcStockStatusId\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSrcStockStatusId"]) + "\" }," +
                            //"\"FDELICHKQUALIFYTYPE\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FDELICHKQUALIFYTYPE"]) + "\"," +
                        //"\"FDELICHKQUALIFYTYPE\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FDELICHKQUALIFYTYPE"]) + "\"," +
                        "\"FDestStockStatusId\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FDestStockStatusId"]) + "\" }," +
                            //\"FProduceDate\":\"1900-01-01\",
                            //\"FBusinessDate\":\"1900-01-01\",
                        //\"FProduceDate\":\"1900-01-01\",
                        //\"FBusinessDate\":\"1900-01-01\",
                        "\"FOwnerTypeId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FOwnerTypeId"]) + "\"," +
                        "\"FOwnerId\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FOwnerId"]) + "\" }," +
                        "\"FOwnerTypeInId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FOWNERTYPEINID"]) + "\"," +
                        "\"FOwnerInId\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FOwnerInId"]) + "\" }," +
                            //\"FEntryNote\":\"\",
                        //\"FEntryNote\":\"\",
                        "\"FKeeperTypeInId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FKEEPERTYPEINID"]) + "\"," +
                        "\"FKeeperInId\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FKeeperInId"]) + "\" }," +
                            //"\"FDestMaterialId\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FDestMaterialId"]) + "\" }," +
                            //"\"FBaseUnitId\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBaseUnitId"]) + "\" }," +
                            //\"FExtAuxUnitId\":{\"FNumber\":\"\"},
                            //\"FExtAuxUnitQty\":\"0\",
                        //"\"FDestMaterialId\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FDestMaterialId"]) + "\" }," +
                        //"\"FBaseUnitId\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBaseUnitId"]) + "\" }," +
                        //\"FExtAuxUnitId\":{\"FNumber\":\"\"},
                        //\"FExtAuxUnitQty\":\"0\",
                        "\"FKeeperTypeId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FKeeperTypeId"]) + "\"," +
                        "\"FKeeperId\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FKeeperId"]) + "\" }," +
                            //\"FQmEntryId\":\"0\",
                            //\"FConvertEntryId\":\"0\",
                            //"\"FSecUnitID\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSecUnitID"]) + "\" }," +
                            //"\"FBaseQty\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBaseQty"]) + "\"," +
                            //"\"FISFREE\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FISFREE"]) + "\"," +
                            //"\"FTransReserveLink\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FTransReserveLink"]) + "\"," +
                            //"\"FCheckDelivery\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FCheckDelivery"]) + "\"," +
                        //\"FQmEntryId\":\"0\",
                        //\"FConvertEntryId\":\"0\",
                        //"\"FSecUnitID\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSecUnitID"]) + "\" }," +
                        //"\"FBaseQty\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBaseQty"]) + "\"," +
                        //"\"FISFREE\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FISFREE"]) + "\"," +
                        //"\"FTransReserveLink\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FTransReserveLink"]) + "\"," +
                        //"\"FCheckDelivery\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FCheckDelivery"]) + "\"," +
                        "\"FSRCBILLTYPEID\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCBILLTYPEID"]) + "\"," +
                        "\"FSRCBILLNO\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCBILLNO"]) + "\"," +
                            //"\"FORDERTYPE\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FORDERTYPE"]) + "\" }," +
                            //"\"FORDERNO\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FORDERNO"]) + "\"," +
                        //"\"FORDERTYPE\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FORDERTYPE"]) + "\" }," +
                        //"\"FORDERNO\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FORDERNO"]) + "\"," +
                        "\"FRowType\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FRowType"]) + "\"," +
                        "\"FSTOCKOUTFLAG\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSTOCKOUTFLAG"]) + "\"," +
                        "\"FSRCTYPE\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCTYPE"]) + "\"," +
                        //\"FSerialSubEntity\":[{\"FDetailID\":\"0\",
                            //\"FSerialNo\":\"\",
                            //\"FSerialNote\":\"\"}]
                        //\"FSerialNo\":\"\",
                        //\"FSerialNote\":\"\"}]
                        "\"FSTKTSTKRANSFEROUTENTRY_Link\": [ {  " +
                        "\"FSTKTSTKRANSFEROUTENTRY_Link_FRuleId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FRuleId"]) + "\"," +
@@ -8542,15 +8539,15 @@
                        "\"FKeeperId\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FKEEPERINID"]) + "\" }," +
                        //\"FBasePathLossQty\":\"0\",
                        //"\"FBaseUnitId\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBaseUnitId"]) + "\" }," +
                            //\"FThirdSrcEntryId\":\"\",
                            //"\"FSRCBILLTYPEID\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCBILLTYPEID"]) + "\" }," +
                        //\"FThirdSrcEntryId\":\"\",
                        //"\"FSRCBILLTYPEID\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCBILLTYPEID"]) + "\" }," +
                        "\"FSRCBILLTYPE\": \"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCBILLTYPE"]) + "\"," +
                        "\"FSRCBILLNAME\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCBILLNAME"]) + "\" }," +
                        "\"FSRCBILLNO\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCBILLNO"]) + "\"," +
                        "\"FRowType\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FRowType"]) + "\"," +
                        "\"FSTOCKOUTFLAG\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSTOCKOUTFLAG"]) + "\"," +
                        "\"FSRCTYPE\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCTYPE"]) + "\"," +
                        //\"FSerialSubEntity\":[{\"FDetailID\":\"0\",
                        //\"FSerialNo\":\"\",
                        //\"FIsPathLoss\":\"false\",
@@ -10133,7 +10130,7 @@
                    "\"FOwnerIdHead\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FOwnerIdHead"]) + "\"}," +
                    //\"FScanBox\":\"\",
                    //\"FCDateOffsetUnit\":\"\",
                     //\"FCDateOffsetValue\":\"0\",
                    //\"FCDateOffsetValue\":\"0\",
                    "\"FIsTotalServiceOrCost\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FIsTotalServiceOrCost"]) + "\"," +
                    //
                    "\"FBussinessType\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FBussinessType"]) + "\"," +
@@ -10784,9 +10781,9 @@
            //获取系统参数
            Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
            if (oSystemParameter.ShowBill(ref sErrMsg)==false)
            if (oSystemParameter.ShowBill(ref sErrMsg) == false)
            {
                sErrMsg ="获取系统参数失败! " +  sErrMsg;
                sErrMsg = "获取系统参数失败! " + sErrMsg;
                return false;
            }
            //
@@ -10823,7 +10820,7 @@
                else
                {
                    //源单  发货通知单
                    if (sHSourceType == "1402"||sHSourceType == "-1")
                    if (sHSourceType == "1402" || sHSourceType == "-1")
                    {
                        if (dal.AddBill_PDA(ref sErrMsg))
                        {
@@ -12193,17 +12190,17 @@
                        " } ]," +
                        //\"FSerialSubEntity\":[{\"FDetailID\":\"0\",
                            //\"FSerialNo\":\"\",\"FSerialNote\":\"\"}]}],
                        //\"FSerialNo\":\"\",\"FSerialNote\":\"\"}]}],
                        //\"FOutStockTrace\":[{\"FEntryID\":\"0\",
                            //\"FLogComId\":{\"FCODE\":\"\"},
                            //\"FDelTime\":\"1900-01-01\",
                            //\"FCarryBillNo\":\"\",
                            //\"FTraceStatus\":\"\",
                        //\"FLogComId\":{\"FCODE\":\"\"},
                        //\"FDelTime\":\"1900-01-01\",
                        //\"FCarryBillNo\":\"\",
                        //\"FTraceStatus\":\"\",
                        //\"FOutStockTraceDetail\":[{\"FDetailID\":\"0\",
                            //\"FTraceTime\":\"\",
                            //\"FTraceDetail\":\"\"}]
                        //\"FTraceTime\":\"\",
                        //\"FTraceDetail\":\"\"}]
                        " \"FEntity_Link\": [{" +
                            " \"FEntity_Link_FFlowId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntity_Link_FFlowId"]) + "\"," +
@@ -12496,7 +12493,7 @@
                        "\"FEntryTaxRate\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FEntryTaxRate"]) + "\"," +
                        "\"FStockID\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FStockID"]) + "\" }," +
                        sJson_StockPlace +
                            //"\"FStockLocId\":{\"FSTOCKLOCID__FF100002\":{\"FNUMBER\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FStockLocId"]) + "\"}}," +
                        //"\"FStockLocId\":{\"FSTOCKLOCID__FF100002\":{\"FNUMBER\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FStockLocId"]) + "\"}}," +
                        "\"FStockStatusID\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FStockStatusID"]) + "\" }," +
                        "\"FSalUnitID\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSalUnitID"]) + "\" }," +
                        "\"FSALUNITQTY\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSALUNITQTY"]) + "\"," +
@@ -12505,11 +12502,11 @@
                        "\"FOUTCONTROL\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FOUTCONTROL"]) + "\"," +
                        "\"FIsOverLegalOrg\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FIsOverLegalOrg"]) + "\"," +
                        "\"FARNOTJOINQTY\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FARNOTJOINQTY"]) + "\"," +
                            //"\"F_PAEZ_Text\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["F_PAEZ_Text"]) + "\"," +
                            //"\"F_PAEZ_Text1\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["F_PAEZ_Text1"]) + "\"," +
                        //"\"F_PAEZ_Text\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["F_PAEZ_Text"]) + "\"," +
                        //"\"F_PAEZ_Text1\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["F_PAEZ_Text1"]) + "\"," +
                        sJson_BatchNo +
                            //"\"FLot\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FLot"]) + "\" }," +
                            //"\"FCheckDelivery\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FCheckDelivery"]) + "\"," +
                        //"\"FLot\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FLot"]) + "\" }," +
                        //"\"FCheckDelivery\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FCheckDelivery"]) + "\"," +
                        "\"FSRCBILLNO\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCBILLNO"]) + "\"," +
                        "\"FSOORDERNO\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSOORDERNO"]) + "\"," +
                        "\"FSRCTYPE\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCTYPE"]) + "\"," +
@@ -12786,7 +12783,7 @@
                            "  \"FPARENTMATERIALID\" : { \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FPARENTMATERIALID"]) + "\" } , " +
                            "  \"FUNITID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FUNITID"]) + "\"}, " +
                            "\"FBASEUNITID\" :  {\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBASEUNITID"]) + "\"} , " +
                           sJson_BatchNo+
                           sJson_BatchNo +
                            "  \"FBASESTOCKACTUALQTY\": " + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBASESTOCKACTUALQTY"]) + " ," +
                            "\"FSTOCKUNITID\" : {\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSTOCKUNITID"]) + "\"}  ,  " +
                            "  \"FMOBILLNO\" :  \"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMOBILLNO"]) + "\" , " +
@@ -12862,7 +12859,7 @@
                        string sJson4 = "{\"CreateOrgId\":0,\"Numbers\":[\"" + oMain.HBillNo + "\"]}";
                        var result4 = client.Execute<string>("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Delete",
                        new object[] { "PRD_PickMtrl", sJson4 });
                        var result = client.Execute<string>("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Save",
                        new object[] { "PRD_PickMtrl", sJson });
@@ -12874,7 +12871,7 @@
                        var result3 = client.Execute<string>("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Audit",
                        new object[] { "PRD_PickMtrl", sJson3 });
                        string HReturn = result4.ToString() + "," + result.ToString() +"," + result2.ToString() + "," + result3.ToString();
                        string HReturn = result4.ToString() + "," + result.ToString() + "," + result2.ToString() + "," + result3.ToString();
                        if (HReturn.Contains("\"IsSuccess\":false") == true)
                        {
                            sErrMsg = "生产领料单失败!" + HReturn + sJson;
@@ -16519,10 +16516,10 @@
                else
                {
                    string sJson_Main = "{\"Creator\":\"\",\"NeedUpDateFields\":[]," +
                        "\"Model\":{ "+     //\"FID\":" + oMain.HInterID.ToString() + "," +
                        "\"Model\":{ " +     //\"FID\":" + oMain.HInterID.ToString() + "," +
                         "\"FBillNo\":\"" + oMain.HBillNo + "\"," +
                        "\"FBillType\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FBillType"]) + "\" }," +
                       // "\"FDate\":\"" + oMain.HDate.ToShortDateString() + "\"," +
                        // "\"FDate\":\"" + oMain.HDate.ToShortDateString() + "\"," +
                        "\"FStockOrgId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FStockOrgId"]) + "\"}," +
                        "\"FSubOrgId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FStockOrgId"]) + "\"}," +
@@ -16579,8 +16576,8 @@
                        "\"FStockId\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FStockId"]) + "\" }," +
                            sJson_StockPlace +
                       //"\"FStockLocId\":{\"FSTOCKLOCID__FF100002\":{\"FNUMBER\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FStockLocId"]) + "\"}}," +
                            // "\"FLOT\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FLOT"]) + "\" }," +
                       sJson_BatchNo+
                       // "\"FLOT\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FLOT"]) + "\" }," +
                       sJson_BatchNo +
                        "\"FSRCBIZENTRYSEQ\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCBIZENTRYSEQ"]) + "\"," +
                        "\"FSRCBIZBILLTYPE\":{ \"FID\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCBIZBILLTYPE"]) + "\" }," +
                        "\"FSRCBIZBILLNO\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCBIZBILLNO"]) + "\"," +
@@ -17888,7 +17885,7 @@
                            "\"FStockId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FStockId"]) + "\"}," +
                            sJson_StockPlace +
                            //"\"FStockLocId\":{\"FSTOCKLOCID__FF100002\":{\"FNUMBER\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FStockLocId"]) + "\"}}," +
                            sJson_BatchNo+
                            sJson_BatchNo +
                            "\"FPRODUCTGROUPID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FPRODUCTGROUPID"]) + "\"}," +
                            "\"FOWNERTYPEID\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FOWNERTYPEID"]) + "\"," +
                            "\"FOwnerId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FOwnerId"]) + "\"}," +
@@ -19244,7 +19241,7 @@
                        //    //"FDetailID": 0
                        //" } ]," +
                       "\"FTaxDetailSubEntity\": [ {  " +
                            //"FDetailID": 0,
                       //"FDetailID": 0,
                       "\"FTAXRATEID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FTAXRATEID"]) + "\"}," +
                        "\"FTAXRATE\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FTAXRATE"]) + "," +
                        "\"FTAXAMOUNT\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FTAXAMOUNT"]) + "," +
@@ -19556,9 +19553,9 @@
        {
            //获取系统参数
            Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
            if (oSystemParameter.ShowBill(ref sErrMsg)==false)
            if (oSystemParameter.ShowBill(ref sErrMsg) == false)
            {
                sErrMsg ="获取系统参数失败! " +  sErrMsg;
                sErrMsg = "获取系统参数失败! " + sErrMsg;
                return false;
            }
            //
@@ -20054,59 +20051,59 @@
                    {
                        sJson_Custom = "\"F_PAEZ_Combo\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["F_PAEZ_Combo"]) + "\", ";             //送货单号
                    }
                string sJson_Main = "{\"Creator\":\"\",\"NeedUpDateFields\":[],\"NeedReturnFields\":[],\"IsDeleteEntry\":\"True\",\"SubSystemId\":\"\",\"IsVerifyBaseDataField\":\"false\"," +
                    "\"IsEntryBatchFill\":\"True\",\"ValidateFlag\":\"True\",\"NumberSearch\":\"True\",\"InterationFlags\":\"\"," +
                    "\"Model\": { \"FBILLNO\":\"" + oMain.HBillNo + "\"," +
                    //\"FID\":\"0\",
                    "\"FBillTypeID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FBillTypeID"]) + "\"}," +
                    //\"FBillNo\":\"\",
                    "\"FDate\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FDate"]) + "\"," +
                    "\"FStockOrgId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FStockOrgId"]) + "\"}," +
                    "\"FStockDeptId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FStockDeptId"]) + "\"}," +
                    "\"FStockerGroupId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FStockerGroupId"]) + "\"}," +
                    "\"FStockerId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FStockerId"]) + "\"}," +
                    "\"FDemandOrgId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FDemandOrgId"]) + "\"}," +
                    "\"FCorrespondOrgId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FCorrespondOrgId"]) + "\"}," +
                    "\"FPurchaseOrgId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FPurchaseOrgId"]) + "\"}," +
                    "\"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"]) + "\"}," +  //移最下方
                    "\"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"]) + "\"}," +
                    "\"FChargeId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FChargeId"]) + "\"}," +
                    "\"FOwnerTypeIdHead\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FOwnerTypeIdHead"]) + "\"," +
                    "\"FOwnerIdHead\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FOwnerIdHead"]) + "\"}," +
                    //\"FConfirmerId\":{\"FUserID\":\"\"},
                    //\"FConfirmDate\":\"1900-01-01\",
                    //\"FScanBox\":\"\",
                    //\"FCDateOffsetUnit\":\"\",
                    //\"FCDateOffsetValue\":\"0\",
                    "\"FProviderContactID\":{\"FCONTACTNUMBER\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FProviderContactID"]) + "\"}," +
                    //
                    "\"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\",
                    "\"FPayOrgId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FPayOrgId"]) + "\"}," +
                    "\"FSettleOrgId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSettleOrgId"]) + "\"}," +
                    "\"FSettleTypeId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSettleTypeId"]) + "\"}," +
                    "\"FPayConditionId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FPayConditionId"]) + "\"}," +
                    "\"FSettleCurrId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSettleCurrId"]) + "\"}," +
                    "\"FIsIncludedTax\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FIsIncludedTax"]) + "," +
                    "\"FPriceTimePoint\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FPriceTimePoint"]) + "\"," +
                    //\"FPriceListId\":{\"FNumber\":\"\"},
                    //\"FDiscountListId\":{\"FNumber\":\"\"},
                    "\"FLocalCurrId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FLocalCurrId"]) + "\"}," +
                    "\"FExchangeTypeId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FExchangeTypeId"]) + "\"}," +
                    "\"FExchangeRate\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FExchangeRate"]) + "," +
                    "\"FISPRICEEXCLUDETAX\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FISPRICEEXCLUDETAX"]) + "}," +
                     "\"FInStockEntry\": [  ";
                    string sJson_Main = "{\"Creator\":\"\",\"NeedUpDateFields\":[],\"NeedReturnFields\":[],\"IsDeleteEntry\":\"True\",\"SubSystemId\":\"\",\"IsVerifyBaseDataField\":\"false\"," +
                        "\"IsEntryBatchFill\":\"True\",\"ValidateFlag\":\"True\",\"NumberSearch\":\"True\",\"InterationFlags\":\"\"," +
                        "\"Model\": { \"FBILLNO\":\"" + oMain.HBillNo + "\"," +
                        //\"FID\":\"0\",
                        "\"FBillTypeID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FBillTypeID"]) + "\"}," +
                        //\"FBillNo\":\"\",
                        "\"FDate\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FDate"]) + "\"," +
                        "\"FStockOrgId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FStockOrgId"]) + "\"}," +
                        "\"FStockDeptId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FStockDeptId"]) + "\"}," +
                        "\"FStockerGroupId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FStockerGroupId"]) + "\"}," +
                        "\"FStockerId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FStockerId"]) + "\"}," +
                        "\"FDemandOrgId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FDemandOrgId"]) + "\"}," +
                        "\"FCorrespondOrgId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FCorrespondOrgId"]) + "\"}," +
                        "\"FPurchaseOrgId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FPurchaseOrgId"]) + "\"}," +
                        "\"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"]) + "\"}," +  //移最下方
                        "\"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"]) + "\"}," +
                        "\"FChargeId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FChargeId"]) + "\"}," +
                        "\"FOwnerTypeIdHead\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FOwnerTypeIdHead"]) + "\"," +
                        "\"FOwnerIdHead\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FOwnerIdHead"]) + "\"}," +
                        //\"FConfirmerId\":{\"FUserID\":\"\"},
                        //\"FConfirmDate\":\"1900-01-01\",
                        //\"FScanBox\":\"\",
                        //\"FCDateOffsetUnit\":\"\",
                        //\"FCDateOffsetValue\":\"0\",
                        "\"FProviderContactID\":{\"FCONTACTNUMBER\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FProviderContactID"]) + "\"}," +
                        //
                        "\"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\",
                        "\"FPayOrgId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FPayOrgId"]) + "\"}," +
                        "\"FSettleOrgId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSettleOrgId"]) + "\"}," +
                        "\"FSettleTypeId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSettleTypeId"]) + "\"}," +
                        "\"FPayConditionId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FPayConditionId"]) + "\"}," +
                        "\"FSettleCurrId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSettleCurrId"]) + "\"}," +
                        "\"FIsIncludedTax\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FIsIncludedTax"]) + "," +
                        "\"FPriceTimePoint\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FPriceTimePoint"]) + "\"," +
                        //\"FPriceListId\":{\"FNumber\":\"\"},
                        //\"FDiscountListId\":{\"FNumber\":\"\"},
                        "\"FLocalCurrId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FLocalCurrId"]) + "\"}," +
                        "\"FExchangeTypeId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FExchangeTypeId"]) + "\"}," +
                        "\"FExchangeRate\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FExchangeRate"]) + "," +
                        "\"FISPRICEEXCLUDETAX\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FISPRICEEXCLUDETAX"]) + "}," +
                         "\"FInStockEntry\": [  ";
                    string sJson_Entry = "";
                    for (int i = 0; i < Ds.Tables[1].Rows.Count; i++)
                    {
@@ -20747,9 +20744,9 @@
                    }
                    string sJson_Main = "{\"Creator\":\"\",\"NeedUpDateFields\":[],\"NeedReturnFields\":[],\"IsDeleteEntry\":\"True\",\"SubSystemId\":\"\",\"IsVerifyBaseDataField\":\"false\", " +
                 "\"IsEntryBatchFill\":\"True\",\"Model\":{" +
                        //\"FID\":\"" + oMain.HInterID.ToString() + "\"," +
                 //\"FID\":\"" + oMain.HInterID.ToString() + "\"," +
                 "\"FBillTypeID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FBillTypeID"]) + "\"}," +
                        //"\"FBUSINESSTYPE\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FBUSINESSTYPE"]) + "\"," +
                 //"\"FBUSINESSTYPE\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FBUSINESSTYPE"]) + "\"," +
                 "\"FBillNo\":\"" + oMain.HBillNo + "\"," +
                 "\"FDate\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FDate"]) + "\"," +
                 "\"FStockOrgId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FStockOrgId"]) + "\"}," +
@@ -20775,7 +20772,7 @@
                 "\"FLocalCurrId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FLocalCurrId"]) + "\"}," +
                 "\"FExchangeTypeId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FExchangeTypeId"]) + "\"}," +
                 "\"FExchangeRate\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FExchangeRate"]) + "" +
                        //"\"FISPRICEEXCLUDETAX\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FISPRICEEXCLUDETAX"]) + " " +
                 //"\"FISPRICEEXCLUDETAX\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FISPRICEEXCLUDETAX"]) + " " +
                 "  },  \"FInStockEntry\": [  ";
                    string sJson_Entry = "";
                    for (int i = 0; i < Ds.Tables[1].Rows.Count; i++)
@@ -20855,13 +20852,13 @@
                            "\"FSetPriceUnitID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSetPriceUnitID"]) + "\"}," +
                            "\"FRemainInStockUnitId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FRemainInStockUnitId"]) + "\"}, " +
                            "\"FBILLINGCLOSE\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBILLINGCLOSE"]) + "," +
                            //"\"FRemainInStockQty\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FRemainInStockQty"]) + "," +
                            //"\"FAPNotJoinQty\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FAPNotJoinQty"]) + "," +
                            //"\"FRemainInStockBaseQty\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FRemainInStockBaseQty"]) + "," +
                            //"\"FBASEUNITQTYOLD\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBASEUNITQTYOLD"]) + "," +
                            //"\"FPURBASENUM\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FPURBASENUM"]) + "," +
                            //"\"FSTOCKBASEDEN\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSTOCKBASEDEN"]) + "," +
                            //"\"FREMAININSTOCKBASEQTYOLD\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FREMAININSTOCKBASEQTYOLD"]) + "," +
                             //"\"FRemainInStockQty\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FRemainInStockQty"]) + "," +
                             //"\"FAPNotJoinQty\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FAPNotJoinQty"]) + "," +
                             //"\"FRemainInStockBaseQty\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FRemainInStockBaseQty"]) + "," +
                             //"\"FBASEUNITQTYOLD\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBASEUNITQTYOLD"]) + "," +
                             //"\"FPURBASENUM\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FPURBASENUM"]) + "," +
                             //"\"FSTOCKBASEDEN\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSTOCKBASEDEN"]) + "," +
                             //"\"FREMAININSTOCKBASEQTYOLD\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FREMAININSTOCKBASEQTYOLD"]) + "," +
                             "\"FBASEUNITQTY\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBASEUNITQTY"]) + "," +
                            "\"FREMAININSTOCKBASEQTY\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FREMAININSTOCKBASEQTY"]) + "," +
                            "\"FTaxPrice\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FTaxPrice"]) + "," +
@@ -21015,7 +21012,7 @@
                    }
                    string sJson_Main = "{\"Creator\":\"\",\"NeedUpDateFields\":[],\"NeedReturnFields\":[],\"IsDeleteEntry\":\"True\",\"SubSystemId\":\"\",\"IsVerifyBaseDataField\":\"false\", " +
                 "\"IsEntryBatchFill\":\"True\",\"ValidateFlag\":\"True\",\"NumberSearch\":\"True\",\"InterationFlags\":\"\",\"Model\":{" +
                        //"\"FID\":\"" + oMain.HInterID.ToString() + "\"," +
                 //"\"FID\":\"" + oMain.HInterID.ToString() + "\"," +
                 "\"FBillTypeID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FBillTypeID"]) + "\"}," +
                 "\"FDate\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FDate"]) + "\"," +
                 "\"FBillNo\":\"" + oMain.HBillNo + "\"," +
@@ -21118,10 +21115,10 @@
                            "\"FRemainInStockQty\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FRemainInStockQty"]) + "," +
                            "\"FAPNotJoinQty\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FAPNotJoinQty"]) + "," +
                            "\"FRemainInStockBaseQty\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FRemainInStockBaseQty"]) + "," +
                            //"\"FBASEUNITQTYOLD\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBASEUNITQTYOLD"]) + "," +
                            //"\"FPURBASENUM\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FPURBASENUM"]) + "," +
                            //"\"FSTOCKBASEDEN\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSTOCKBASEDEN"]) + "," +
                            //"\"FREMAININSTOCKBASEQTYOLD\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FREMAININSTOCKBASEQTYOLD"]) + "," +
                             //"\"FBASEUNITQTYOLD\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBASEUNITQTYOLD"]) + "," +
                             //"\"FPURBASENUM\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FPURBASENUM"]) + "," +
                             //"\"FSTOCKBASEDEN\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSTOCKBASEDEN"]) + "," +
                             //"\"FREMAININSTOCKBASEQTYOLD\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FREMAININSTOCKBASEQTYOLD"]) + "," +
                             "\"FBASEUNITQTY\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBASEUNITQTY"]) + "," +
                            "\"FREMAININSTOCKBASEQTY\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FREMAININSTOCKBASEQTY"]) + "," +
                            "\"FTaxPrice\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FTaxPrice"]) + "," +
@@ -21336,7 +21333,7 @@
                            int s = y + 1;
                            HBillNo = oMain.HBillNo + "-" + s;
                            sJson_Model_PL = sJson_Model_PL + "{ \"FBILLNO\":\"" + HBillNo + "\"," +
                                /*\"FID\":\"" + oMain.HInterID.ToString() + "\"," +*/
                        /*\"FID\":\"" + oMain.HInterID.ToString() + "\"," +*/
                        "\"FStockOrgId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HStockORGID"]) + "\"},  " +
                        "\"FPRDORGID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HPRDORGID"]) + "\"}, " +
                        "\"FOwnerId0\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HOWNERID"]) + "\"}," +
@@ -21388,13 +21385,13 @@
                                }
                                sJson_Entry_PL = sJson_Entry_PL + " {  \"FOWNERID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["HOWNERID"]) + "\"}," +
                                    //     "\"FSEQ\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSEQ"]) + "\",  " +
                        //     "\"FSEQ\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSEQ"]) + "\",  " +
                        " \"FBFLOWID\":{\"FID\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBFLOWID"]) + "\"} ,  " +
                        " \"FMOBILLNO\" :  \"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMOBILLNO"]) + "\" , " +
                        " \"FMOID\" : \"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMOID"]) + "\" ,  " +
                        " \"FMOENTRYID\" : " + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMOENTRYID"]) + " , " +
                        " \"FMOENTRYSEQ\" : \"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMOENTRYSEQ"]) + "\" , " +
                                    // " \"F_PAEZ_TEXT\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["F_PAEZ_TEXT"]) + "\", " +
                        // " \"F_PAEZ_TEXT\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["F_PAEZ_TEXT"]) + "\", " +
                        " \"FSRCBILLTYPE\" : \"PRD_MO\" ,  \"FSRCBILLNO\" :  \"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCBILLNO"]) + "\" , " +
                        " \"FSRCINTERID\" : \"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCINTERID"]) + "\" , " +
                        " \"FSRCENTRYID\" : " + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCENTRYID"]) + " ,  " +
@@ -21407,13 +21404,13 @@
                        " \"FBASEUNITID\" :  {\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBASEUNITID"]) + "\"} , " +
                        " \"FSTOCKID\":    {\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSTOCKID"]) + "\"}, " +
                        sJson_StockPlace +
                                    //"\"FStockLocId\":{\"FSTOCKLOCID__FF100002\":{\"FNUMBER\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FStockLocId"]) + "\"}}," +
                        //"\"FStockLocId\":{\"FSTOCKLOCID__FF100002\":{\"FNUMBER\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FStockLocId"]) + "\"}}," +
                        " \"FPRODUCTTYPE\" : \"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FPRODUCTTYPE"]) + "\"  ,  " +
                        " \"FMUSTQty\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMUSTQty"]) + "\", " +
                        " \"FRealQty\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FRealQty"]) + "\",  " +
                        " \"FCOSTRATE\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FCOSTRATE"]) + "\",  " +
                            sJson_BatchNo +
                                    //"\"FLot\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FLot"]) + "\"}," +
                        //"\"FLot\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FLot"]) + "\"}," +
                        "  \"FMOMAINENTRYID\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMOMAINENTRYID"]) + "\" ,  " +
                        "  \"FREQSRC\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FREQSRC"]) + "\" ,  " +
                        "  \"FREQBILLID\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FREQBILLID"]) + "\" ,  " +
@@ -21590,12 +21587,12 @@
                            sJson_BatchNo = "";
                        }
                        sJson_Entry = sJson_Entry + " {  \"FOWNERID\":{\"FNumber\":\"" + oMain.HORGANIZATIONSNO.ToString() + "\"}," +
                            //     "\"FSEQ\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSEQ"]) + "\",  " +
                        //     "\"FSEQ\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSEQ"]) + "\",  " +
                        " \"FMOBILLNO\" :  \"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMOBILLNO"]) + "\" , " +
                        " \"FMOID\" : \"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMOID"]) + "\" ,  " +
                        " \"FMOENTRYID\" : " + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMOENTRYID"]) + " , " +
                        " \"FMOENTRYSEQ\" : \"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMOENTRYSEQ"]) + "\" , " +
                            // " \"F_PAEZ_TEXT\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["F_PAEZ_TEXT"]) + "\", " +
                        // " \"F_PAEZ_TEXT\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["F_PAEZ_TEXT"]) + "\", " +
                        " \"FSRCBILLTYPE\" : \"PRD_MO\" ,  \"FSRCBILLNO\" :  \"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCBILLTYPE"]) + "\" , " +
                        " \"FSRCINTERID\" : \"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCINTERID"]) + "\" , " +
                        " \"FSRCENTRYID\" : " + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCENTRYID"]) + " ,  " +
@@ -21610,7 +21607,7 @@
                        " \"FMUSTQty\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMUSTQty"]) + "\", " +
                        " \"FRealQty\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FRealQty"]) + "\",  " +
                            sJson_BatchNo +
                            //"\"FLot\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FLot"]) + "\"}," +
                        //"\"FLot\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FLot"]) + "\"}," +
                        "  \"FMOMAINENTRYID\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMOMAINENTRYID"]) + "\" ,  " +
                        "  \"FREQSRC\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FREQSRC"]) + "\" ,  " +
                        "  \"FREQBILLID\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FREQBILLID"]) + "\" ,  " +
@@ -23120,13 +23117,13 @@
                        //
                        sJson_Entry = sJson_Entry + " {  \"FOWNERID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["HOWNERID"]) + "\"}," +
                            //     "\"FSEQ\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSEQ"]) + "\",  " +
                        //     "\"FSEQ\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSEQ"]) + "\",  " +
                        " \"FBFLOWID\":{\"FID\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBFLOWID"]) + "\"} ,  " +
                        " \"FMOBILLNO\" :  \"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMOBILLNO"]) + "\" , " +
                        " \"FMOID\" : \"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMOID"]) + "\" ,  " +
                        " \"FMOENTRYID\" : " + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMOENTRYID"]) + " , " +
                        " \"FMOENTRYSEQ\" : \"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMOENTRYSEQ"]) + "\" , " +
                            // " \"F_PAEZ_TEXT\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["F_PAEZ_TEXT"]) + "\", " +
                        // " \"F_PAEZ_TEXT\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["F_PAEZ_TEXT"]) + "\", " +
                        " \"FSRCBILLTYPE\" : \"PRD_MO\" ,  \"FSRCBILLNO\" :  \"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCBILLNO"]) + "\" , " +
                        " \"FSRCINTERID\" : \"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCINTERID"]) + "\" , " +
                        " \"FSRCENTRYID\" : " + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCENTRYID"]) + " ,  " +
@@ -23143,7 +23140,7 @@
                        " \"FRealQty\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FRealQty"]) + "\",  " +
                        " \"FCOSTRATE\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FCOSTRATE"]) + "\",  " +
                            sJson_BatchNo +
                            //"\"FLot\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FLot"]) + "\"}," +
                        //"\"FLot\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FLot"]) + "\"}," +
                        "  \"FMOMAINENTRYID\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMOMAINENTRYID"]) + "\" ,  " +
                        "  \"FREQSRC\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FREQSRC"]) + "\" ,  " +
                        "  \"FREQBILLID\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FREQBILLID"]) + "\" ,  " +
@@ -24430,12 +24427,12 @@
                else
                {
                    string sJson_Main = "{\"Creator\":\"\",\"NeedUpDateFields\":[],\"NeedReturnFields\":[],\"IsDeleteEntry\":\"True\",\"SubSystemId\":\"\",\"IsVerifyBaseDataField\":\"false\", " +
                 "\"IsEntryBatchFill\":\"True\",\"Model\":{"+
                 "\"IsEntryBatchFill\":\"True\",\"Model\":{" +
                 //\"FID\":\"" + oMain.HInterID.ToString() + "\"," +
                 "\"FBillTypeID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FBillTypeID"]) + "\"}," +
                 "\"FBUSINESSTYPE\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FBUSINESSTYPE"]) + "\"," +
                 "\"FBillNo\":\"" + oMain.HBillNo + "\"," +
                // "\"FDate\":\"" + oMain.HDate.ToShortDateString() + "\"," +
                 // "\"FDate\":\"" + oMain.HDate.ToShortDateString() + "\"," +
                 "\"FStockOrgId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FStockOrgId"]) + "\"}," +
                 "\"FStockDeptId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FStockDeptId"]) + "\"}," +
                 "\"FStockerId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FStockerId"]) + "\"}," +
@@ -24495,10 +24492,10 @@
                            "\"FPriceUnitID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FPriceUnitID"]) + "\"}," +
                            "\"FPrice\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FPrice"]) + ", " +
                            "\"FTaxCombination\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FTaxCombination"]) + "\"}," +
                            sJson_BatchNo+
                            sJson_BatchNo +
                            "\"FStockId\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FStockId"]) + "\"}," +
                            sJson_StockPlace +
                             //"\"FStockLocId\":{\"FSTOCKLOCID__FF100002\":{\"FNUMBER\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FStockLocId"]) + "\"}}," +
                            //"\"FStockLocId\":{\"FSTOCKLOCID__FF100002\":{\"FNUMBER\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FStockLocId"]) + "\"}}," +
                            //"\"FDisPriceQty\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FDisPriceQty"]) + ", " +
                            "\"FSRCBILLTYPEID\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSRCBILLTYPEID"]) + "\"," +
                            "\"FRECEIVESTOCKSTATUS\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FRECEIVESTOCKSTATUS"]) + "\"}," +
@@ -24535,7 +24532,7 @@
                            //"\"FSupplierLot\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FSupplierLot"]) + "," +
                            //"\"FExpiryDate\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FExpiryDate"]) + "," +
                            //"\"FAuxUnitQty\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FAuxUnitQty"]) + "," +
                           // "\"FBeforeDisPriceQty\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBeforeDisPriceQty"]) + ", " +
                            // "\"FBeforeDisPriceQty\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FBeforeDisPriceQty"]) + ", " +
                            "\"FInStockEntry_Link\": [ {  " +
                            "\"FInStockEntry_Link_FRuleId\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FInStockEntry_Link_FRuleId"]) + "\" ,  " +
                            "\"FInStockEntry_Link_FSTableName\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FInStockEntry_Link_FSTableName"]) + "\" ,  " +
@@ -25273,7 +25270,7 @@
                        {
                            //审核单据
                            oCn.RunProc("Update Kf_ICStockBillMain Set HChecker='" + oMain.HMaker + "',HCheckDate=convert(varchar(10),getdate(),120) where HInterID= " + oMain.HInterID.ToString());
                            //审核K3单据
                            oCn.RunProc("exec h_p_IFK3_ToERP_OtherInBill_Check_New " + oMain.HInterID.ToString() + "," + oMain.HBillerID.ToString());
                        }
@@ -25586,6 +25583,106 @@
        #endregion
        //生成器具采购入库单
        [WebMethod]
        public bool set_SaveMouldProdInBill_New(Model.ClsSc_MouldProdInBillMain oMain, string sHSourceType, ref string sErrMsg)
        {
            //获取系统参数
            Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
            if (oSystemParameter.ShowBill(ref sErrMsg) == false)
            {
                sErrMsg = "获取系统参数失败! " + sErrMsg;
                return false;
            }
            //
            //if (oSystemParameter.omodel.Kf_OtherInBill_ERPMode.ToUpper() == "CLOUD")  //判断同步模式是金蝶CLOUD
            //{
                //上传前必填项判断
                //if (oMain.HDeptID == 0)
                //{
                //    sErrMsg = "部门没有选择!";
                //    return false;
                //}
                if (set_SaveMouldProdInBill_New(oMain, sHSourceType, oSystemParameter.omodel, ref sErrMsg) == true)
                {
                    //"保存成功!";
                    return true;
                }
                else
                {
                    //"保存失败!";
                    return false;
                }
            //}
            sErrMsg = "保存器具采购入库单失败!" + sErrMsg;
            return false;
        }
        /// <summary>
        /// 器具采购入库单
        /// </summary>
        /// <param name="oMain"></param>
        /// <param name="sErrMsg"></param>
        /// <returns></returns>
        public bool set_SaveMouldProdInBill_New(Model.ClsSc_MouldProdInBillMain oMain, string sHSourceType, Pub_Class.ClsXt_SystemParameterMain oSystemParameterMain, ref string sErrMsg)
        {
            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
            try
            {
                //判断会计期是否合理
                string s = "";
                int sYear = 0;
                int sPeriod = 0;
                if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(oMain.HDate, ref sYear, ref sPeriod, ref s) == false)
                {
                    sErrMsg = s;
                    return false;
                }
                oMain.HYear = sYear;
                oMain.HPeriod = sPeriod;
                sErrMsg = DBUtility.ClsPub.isStrNull(oMain.HInterID) + DBUtility.ClsPub.isStrNull(oMain.HBillNo);
                oCn.BeginTran();
                //生成出入库单据
                //插入子表
                //插入主表
                oCn.RunProc("EXEC h_p_Kf_MouldProdInBill_Insert_New " + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "'");
                //插入主表
                oCn.RunProc("Insert Into Sc_MouldStockBillMain   " +
                "(HBillType,HBillSubType,HInterID,HDate,HBillNo" +
                ",HBillStatus,HRemark,HMaker,HMakeDate,HSCWHID" +
                ",HSupID,HEmpID,HManagerID,HWHID,HSecManagerID" +
                ",HKeeperID,HDeptID,HExplanation,HInnerBillNo,HRedBlueFlag" +
                ") " +
                " values('3801','3801'," + oMain.HInterID.ToString() + ",convert(varchar(10),getdate(),120),'" + oMain.HBillNo + "'" +
                ", '" + oMain.HBillStatus + "','" + oMain.HRemark + "','" + oMain.HMaker + "',convert(varchar(10),getdate(),120)," + oMain.HSCWHID.ToString() +
                ", " + oMain.HSupID.ToString() + "," + oMain.HEmpID.ToString() + "," + oMain.HManagerID.ToString() + "," + oMain.HWHID.ToString() + "," + oMain.HManagerID.ToString() +
                ", " + oMain.HKeeperID.ToString() + "," + oMain.HDeptID.ToString() + ",'" + oMain.HExplanation + "','" + oMain.HInnerBillNo + "'," + DBUtility.ClsPub.BoolToString(oMain.HRedBlueFlag) +
                ") ");
                oCn.Commit();
                //更新关联数量
                //if (oSystemParameterMain.Kf_OtherInBill_AutoCheck == "Y") //系统参数  自动审核
                //{
                //    //审核单据
                //    //oCn.RunProc("Update Kf_ICStockBillMain Set HChecker='" + oMain.HMaker + "',HCheckDate=convert(varchar(10),getdate(),120) where HInterID= " + oMain.HInterID.ToString());
                //}
                return true;
            }
            catch (Exception e)
            {
                sErrMsg = "器具采购入库单失败!" + e.Message;
                oCn.RollBack();
                return false;
            }
        }
        #region 其它入库CLOUD   *
        //生成入库单 
@@ -25671,7 +25768,7 @@
                    {
                        sJson_StockStyle = "";
                    }
                    string sJson_Main = "{\"Creator\":\"\",\"NeedUpDateFields\":[],\"NeedReturnFields\":[],\"IsDeleteEntry\":\"True\",\"SubSystemId\":\"\",\"IsVerifyBaseDataField\":\"false\",\"IsEntryBatchFill\":\"True\",\"Model\":{\"FBillNo\":\"" +oMain.HBillNo+ "\"," +
                    string sJson_Main = "{\"Creator\":\"\",\"NeedUpDateFields\":[],\"NeedReturnFields\":[],\"IsDeleteEntry\":\"True\",\"SubSystemId\":\"\",\"IsVerifyBaseDataField\":\"false\",\"IsEntryBatchFill\":\"True\",\"Model\":{\"FBillNo\":\"" + oMain.HBillNo + "\"," +
                        //\"FID\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FID"]) + "\"," +
                        "\"FBillTypeID\":{\"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FBillTypeID"]) + "\"}," +
@@ -26012,7 +26109,7 @@
            if (SaveProExchReport_CLD(HQty, HProcessFailQty, HMaterialFailQty, HFReworkQty, HQuaQty, HProcNo, HProcExchBillNo, HEmpID, HTime, HORGANIZATIONSNO, HBillNo, ref sErrMsg))
            {
                //"保存成功!";
                sErrMsg = "保存成功!" ;
                sErrMsg = "保存成功!";
                return true;
            }
            else
@@ -26091,12 +26188,12 @@
                             "\"FPlanningQty\":" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FPlanningQty"]) + "  , " +
                             "\"FActivity1Id\" : { \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FActivity1Id"]) + "\" } , " +
                             "\"FActivity1UnitID\" : { \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FActivity1UnitID"]) + "\" } , " +
                            //,\"FSetStartTime\":\"2018-12-31 11:20:07\"
                            //,\"FSetEndTime\":\"2018-12-31 11:20:07\"
                            //,\"FProcessStartTime\":\"2018-12-31 11:20:07\"
                            //,\"FProcessEndTime\":\"2018-12-31 00:00:00\"
                            //,\"FTeardownStartTime\":\"2018-12-31 00:00:00\"
                            //,\"FTeardownEndTime\":\"2018-12-31 00:00:00\",
                             //,\"FSetStartTime\":\"2018-12-31 11:20:07\"
                             //,\"FSetEndTime\":\"2018-12-31 11:20:07\"
                             //,\"FProcessStartTime\":\"2018-12-31 11:20:07\"
                             //,\"FProcessEndTime\":\"2018-12-31 00:00:00\"
                             //,\"FTeardownStartTime\":\"2018-12-31 00:00:00\"
                             //,\"FTeardownEndTime\":\"2018-12-31 00:00:00\",
                             "\"FStockInOrgId\" : { \"FNumber\":\"" + HORGANIZATIONSNO.ToString() + "\" } , " +
                             "\"FMoPrdOrgId\" : { \"FNumber\":\"" + HORGANIZATIONSNO.ToString() + "\" } , " +
                             "\"FMoPrdDept\" : { \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[1].Rows[i]["FMoPrdDept"]) + "\" } , " +
@@ -26163,7 +26260,7 @@
                        var result3 = client.Execute<string>("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Audit",
                        new object[] { "SFC_OperationReport", sJson3 });
                        string HReturn = result.ToString()+"," + result2.ToString() + "," + result3.ToString();
                        string HReturn = result.ToString() + "," + result2.ToString() + "," + result3.ToString();
                        if (HReturn.Contains("\"IsSuccess\":false") == true)
                        {
                            sErrMsg = "工序汇报单失败!" + HReturn + sJson;
@@ -26189,7 +26286,7 @@
        }
        #endregion
        #region 不良评审单        *
        //生成不良评审单
@@ -26210,7 +26307,7 @@
            //}
            //if (oSystemParameter.omodel.Sc_ICMOReportBill_ERPMode.ToUpper() == "CLOUD")  //判断同步模式是金蝶CLOUD
            //{
            if (SaveNoPassProdCheckBill_CLD_New(oMain, sHSourceType, oSystemParameter.omodel,BadReasonList, ref sErrMsg) == true)
            if (SaveNoPassProdCheckBill_CLD_New(oMain, sHSourceType, oSystemParameter.omodel, BadReasonList, ref sErrMsg) == true)
            {
                //"保存成功!";
                return true;
@@ -26226,7 +26323,7 @@
            return false;
        }
        public bool SaveNoPassProdCheckBill_CLD_New(Model.ClsQC_NoPassProdCheckBillMain oMain, string sHSourceType, Pub_Class.ClsXt_SystemParameterMain oSystemParameterMain,string BadReasonList, ref string sErrMsg)
        public bool SaveNoPassProdCheckBill_CLD_New(Model.ClsQC_NoPassProdCheckBillMain oMain, string sHSourceType, Pub_Class.ClsXt_SystemParameterMain oSystemParameterMain, string BadReasonList, ref string sErrMsg)
        {
            try
            {
@@ -26242,7 +26339,7 @@
                //获取单号
                string sBillNo = "";
                Int64 sInterID = 0;
                if (get_MaxBillNoAndID_New("7509", ref sBillNo, ref sInterID, ref DBUtility.ClsPub.sExeReturnInfo)==false)
                if (get_MaxBillNoAndID_New("7509", ref sBillNo, ref sInterID, ref DBUtility.ClsPub.sExeReturnInfo) == false)
                {
                    sErrMsg = "获取单号失败";
                    return false;
@@ -26309,7 +26406,7 @@
                        oSub.HMustQty = 1;
                        oSub.HBadQty = 1;
                        oSub.HBadPCSQty = 1;
                        if(oSource.GetInfoByName(sBadReason[i]))
                        if (oSource.GetInfoByName(sBadReason[i]))
                        {
                            oSub.HBadReasonID = oSource.omodel.HItemID;
                        }
@@ -26327,7 +26424,7 @@
                    }
                }
                //
                if (BillNew.AddBill(ref  DBUtility.ClsPub.sExeReturnInfo))
                if (BillNew.AddBill(ref DBUtility.ClsPub.sExeReturnInfo))
                {
                    sErrMsg = "生成不良评审单成功!";
                    return true;
@@ -26340,7 +26437,7 @@
            }
            catch (Exception e)
            {
                sErrMsg = "生成不良评审单失败!" + e.Message;
                sErrMsg = "生成不良评审单失败!" + e.Message;
                return false;
            }
        }
@@ -26688,7 +26785,7 @@
        public bool Get_CheakBarCodeAndCP(long HCusID, string sCPStr, string sBarCode, ref string sReturn)
        {
            DAL.ClsKF_PonderationBillMain_Temp_View dal = new DAL.ClsKF_PonderationBillMain_Temp_View();
            if (dal.CheakBarCodeAndCP(HCusID,sCPStr,sBarCode,ref sReturn))
            if (dal.CheakBarCodeAndCP(HCusID, sCPStr, sBarCode, ref sReturn))
            {
                return true;
            }
@@ -27014,7 +27111,7 @@
            try
            {
                //获取系统参数
                string sErrMsg="";
                string sErrMsg = "";
                Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
                if (oSystemParameter.ShowBill(ref sErrMsg) == false)
                {
@@ -27175,7 +27272,7 @@
            {
                DataSet ds;
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                ds = oCN.RunProcReturn("exec h_p_Xt_UserRelationOrg_Check '" + HUserNumber + "','" + HOrgName+"'", "h_p_Xt_UserRelationOrg_Check");
                ds = oCN.RunProcReturn("exec h_p_Xt_UserRelationOrg_Check '" + HUserNumber + "','" + HOrgName + "'", "h_p_Xt_UserRelationOrg_Check");
                if (ds == null && ds.Tables[0].Rows.Count == 0)
                {
                    return null;
@@ -27504,7 +27601,7 @@
        [WebMethod]
        //根据条码得到相应信息(条码档案)
        public Model.ClsGy_BarCodeBill_WMS_Model_View get_InfoByBarCode_Source(string sBarCode,Int64 sInterID,ref bool sBool, ref string sErrMsg)
        public Model.ClsGy_BarCodeBill_WMS_Model_View get_InfoByBarCode_Source(string sBarCode, Int64 sInterID, ref bool sBool, ref string sErrMsg)
        {
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            DAL.ClsGy_BarCodeBill_View dal = new DAL.ClsGy_BarCodeBill_View();
@@ -27513,20 +27610,20 @@
                sErrMsg = "";
                //-------------获取TMP中的原单主内码和子内码
                DataSet ds = oCN.RunProcReturn("exec h_p_WMS_GetBarCodeSourceInterID " + sInterID.ToString() + ",'" + sBarCode + "' ", "h_p_WMS_GetBarCodeSourceInterID");
                if(ds==null || ds.Tables[0].Rows.Count==0 )
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                }
                else
                {
                     if(DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0][0])==0)
                     {
                         dal.omodel_View.HSourceBillNo = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HSourceBillNo"]);
                         dal.omodel_View.HSourceEntryID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HSourceEntryID"]);
                         dal.omodel_View.HSourceInterID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HSourceInterID"]);
                         dal.omodel_View.HinitQty = DBUtility.ClsPub.isDoule(ds.Tables[0].Rows[0]["HQtyMust"]);
                         sBool = true;
                     }
                    if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0][0]) == 0)
                    {
                        dal.omodel_View.HSourceBillNo = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HSourceBillNo"]);
                        dal.omodel_View.HSourceEntryID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HSourceEntryID"]);
                        dal.omodel_View.HSourceInterID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HSourceInterID"]);
                        dal.omodel_View.HinitQty = DBUtility.ClsPub.isDoule(ds.Tables[0].Rows[0]["HQtyMust"]);
                        sBool = true;
                    }
                }
                return dal.omodel_View;
            }
@@ -27598,7 +27695,7 @@
            {
                DataSet ds;
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                ds = oCN.RunProcReturn("exec h_p_IF_CheckBillIDExists_WMS  " + HInterID + ",'" + HBillNo+"'", "h_p_IF_CheckBillIDExists_WMS");
                ds = oCN.RunProcReturn("exec h_p_IF_CheckBillIDExists_WMS  " + HInterID + ",'" + HBillNo + "'", "h_p_IF_CheckBillIDExists_WMS");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    sErrMsg = "存在重复单据内码或单据号的单据,不允许新增,请退出后重新登录!";
@@ -27938,7 +28035,7 @@
        #region   先进先出生成
        [WebMethod]
        public bool SetFIFOPonderationBillMain_Temp(string HBillNo, Int64 HInterID,long HUserOrgID, ref string sErr)
        public bool SetFIFOPonderationBillMain_Temp(string HBillNo, Int64 HInterID, long HUserOrgID, ref string sErr)
        {
            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
            //根据源单
@@ -27954,8 +28051,8 @@
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                NeedQty = DBUtility.ClsPub.isDoule(ds.Tables[0].Rows[0]["HQTY"]);
                int HWHID=DBUtility.ClsPub.isInt(ds.Tables[0].Rows[0]["HWHID"]);
                ds2 = oCn.RunProcReturn("exec h_p_Kf_GetCanUseICInventory " + HInterID.ToString()+","+HWHID.ToString()+","+HUserOrgID.ToString(), "h_p_Kf_GetCanUseICInventory");
                int HWHID = DBUtility.ClsPub.isInt(ds.Tables[0].Rows[0]["HWHID"]);
                ds2 = oCn.RunProcReturn("exec h_p_Kf_GetCanUseICInventory " + HInterID.ToString() + "," + HWHID.ToString() + "," + HUserOrgID.ToString(), "h_p_Kf_GetCanUseICInventory");
                if (ds2 == null || ds2.Tables[0].Rows.Count == 0)
                {
                    sErr = "可用库存不足!";
@@ -27966,7 +28063,7 @@
                {
                    int HEntryID = DBUtility.ClsPub.isInt(ds.Tables[0].Rows[0]["领料单子内码"]);
                    int HMaterID = DBUtility.ClsPub.isInt(ds.Tables[0].Rows[0]["物料内码"]);
                    string  HBatchNo = DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBatchNo"]);
                    string HBatchNo = DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBatchNo"]);
                    int HSPID = DBUtility.ClsPub.isInt(ds2.Tables[0].Rows[0]["HSPID"]);
                    for (int j = 0; j < ds2.Tables[0].Rows.Count; j++)
@@ -29765,7 +29862,7 @@
                    if (sBarBillType == "基础资料条码")
                    {
                        oBar = get_BaseSet(sBarCode, HOWNERID, sBarBillName, ref sErrMsg);
                        if(oBar==null)
                        if (oBar == null)
                        {
                            return null;
                        }
@@ -30244,7 +30341,7 @@
                return false;
            }
            //当单据参数是 多原单模式时, 则 SourceFlag 设置为 TRUE  Sc_ICMOReportBill_MulSourceBill
            if (HBillType == "3711" && oSystemParameter.omodel.Sc_ICMOReportBill_MulSourceBill=="Y")
            if (HBillType == "3711" && oSystemParameter.omodel.Sc_ICMOReportBill_MulSourceBill == "Y")
            {
                SourceFlag = true;
                sHSourceBillType = "3710";  //返回
@@ -30253,7 +30350,7 @@
                sHSupName = "";             //返回
                sHDeptID = 0;               //返回
                sHDeptName = "";            //返回
                HSourceBillType = "3710";
                HSourceBillType = "3710";
            }
            //蓝字产品入库、外购入库、委外入库、生产汇报,根据物料条码得到对应源单信息,非多源单模式
            //未扫描源单的情况下,第一次扫描物料条码获取源单信息并存入临时表
@@ -30326,9 +30423,9 @@
                if (HBillType == "3711" && oSystemParameter.omodel.Sc_ICMOReportBill_MulSourceBill == "Y")
                {
                    //再判断 条码 档案里  原单类型是否正确; 原单内码 是否存在
                    if(dal.omodel_View.HSourceBillType!="3710"
                        || dal.omodel_View.HSourceInterID <= 0
                        || dal.omodel_View.HSourceEntryID <= 0 )
                    if (dal.omodel_View.HSourceBillType != "3710"
                        || dal.omodel_View.HSourceInterID <= 0
                        || dal.omodel_View.HSourceEntryID <= 0)
                    {
                        sErrMsg = "多源单模式下,扫描物料条码的原单信息必须正确!";
                        return false;
@@ -30387,7 +30484,7 @@
                    {
                        sRelQty = HQty;
                    }
                    else if(dal.omodel_View.HinitQty>0)
                    else if (dal.omodel_View.HinitQty > 0)
                    {
                        sRelQty = dal.omodel_View.HinitQty;
                    }
@@ -30705,7 +30802,7 @@
                                            oBar.HSupID = sHSupID;
                                            oBar.HSupName = sHSupName;
                                            oBar.HDeptID = sHDeptID;
                                            oBar.HDeptName = sHDeptName;
                                            oBar.HDeptName = sHDeptName;
                                            SourceFlag = true;
                                        }
                                        else
@@ -31961,5 +32058,454 @@
        //器具一键扫码模式,根据条码前缀走 不同方法(仓库、仓位、部门)(源单、物料条码)
        [WebMethod]
        public Model.ClsKf_ICStockBill_Mould get_CheckTypeByBarCode_Mould(string sBarCode, Int64 HBillID, string HBillType, string HBillNo, string HMaker, Int64 HWhID, Int64 HSPID, Double HQty, bool HRedBlueFlag, bool SourceFlag, string HSourceBillNo, string HSourceBillType, Int64 HOWNERID, string HExpressNumber, ref string sErrMsg)
        {
            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
            Model.ClsKf_ICStockBill_Mould oBar = new Model.ClsKf_ICStockBill_Mould();
            DAL.ClsKF_PonderationBillMain_Temp_Ctl_Mould tem = new DAL.ClsKF_PonderationBillMain_Temp_Ctl_Mould();
            Model.ClsSc_MouldStockBillMain_Temp model = new Model.ClsSc_MouldStockBillMain_Temp();
            string sHSourceBillType = "";
            string sHSourceBillNo = "";
            Int64 sHSupID = 0;
            string sHSupName = "";
            Int64 sHDeptID = 0;
            string sHDeptName = "";
            string sHBarType = "";
            //获取系统参数
            Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
            if (oSystemParameter.ShowBill(ref sErrMsg) == false)
            {
                sErrMsg = "获取系统参数失败! " + sErrMsg;
                return null;
            }
            //判断是否启用一键扫码模式,Y为启用,未启用时只扫描物料条码
            if (oSystemParameter.omodel.WMS_OneKeyMode.ToUpper() == "N")
            {
                //将物料条码信息写入出入库条码临时表
                if (set_SavePonderationBillMain_Temp_BarCode_Mould(sBarCode, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, HRedBlueFlag, SourceFlag, HSourceBillNo, HSourceBillType, HOWNERID, HExpressNumber, ref sHSourceBillNo, ref sHSourceBillType, ref sHSupID, ref sHSupName, ref sHDeptID, ref sHDeptName, ref sErrMsg))
                {
                    oBar.HSourceBillType = sHSourceBillType;
                    oBar.HSourceBillNo = sHSourceBillNo;
                    oBar.HSupID = sHSupID;
                    oBar.HSupName = sHSupName;
                    oBar.HDeptID = sHDeptID;
                    oBar.HDeptName = sHDeptName;
                }
                else
                {
                    sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HBillID + ";扫描失败!" + sErrMsg;
                    return null;
                }
                return oBar;
            }
            //一键扫码模式,根据条码前缀走 不同方法(仓库、仓位、部门)(源单、物料条码)
            else
            {
                string sRedBlue = "蓝字";
                if (HRedBlueFlag)
                {
                    sRedBlue = "红字";
                }
                else
                {
                    sRedBlue = "蓝字";
                }
                DataSet Dss;
                //根据递入的条码前三位,判断条码类型(仓库、仓位、部门、源单、物料条码)
                Dss = oCn.RunProcReturn(" select HSourceName,BarCodeType from Xt_BarCodeType where HSourceNumber= '" + sBarCode.Substring(0, 3) + "'", "Xt_BarCodeType");
                //无返回数据则为物料条码
                if (Dss == null || Dss.Tables[0].Rows.Count == 0)
                {
                    //将物料条码信息写入出入库条码临时表
                    if (set_SavePonderationBillMain_Temp_BarCode_Mould(sBarCode, HBillID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, HRedBlueFlag, SourceFlag, HSourceBillNo, HSourceBillType, HOWNERID, HExpressNumber, ref sHSourceBillNo, ref sHSourceBillType, ref sHSupID, ref sHSupName, ref sHDeptID, ref sHDeptName, ref sErrMsg))
                    {
                        oBar.HSourceBillType = sHSourceBillType;
                        oBar.HSourceBillNo = sHSourceBillNo;
                        oBar.HSupID = sHSupID;
                        oBar.HSupName = sHSupName;
                        oBar.HDeptID = sHDeptID;
                        oBar.HDeptName = sHDeptName;
                    }
                    else
                    {
                        sErrMsg = "单据号:" + HBillNo + ",单据ID:" + HBillID + ";扫描失败!" + sErrMsg;
                        return null;
                    }
                    return oBar;
                }
                else
                {
                    string sBarBillName = Pub_Class.ClsPub.isStrNull(Dss.Tables[0].Rows[0]["HSourceName"]);
                    string sBarBillType = Pub_Class.ClsPub.isStrNull(Dss.Tables[0].Rows[0]["BarCodeType"]);
                    //判断条码类型为 基础资料条码 或 源单条码
                    if (sBarBillType == "基础资料条码")
                    {
                        //仓库条码
                        if (sBarBillName == "仓库")
                        {
                            DAL.ClsIF_Warehouse_View dal = new DAL.ClsIF_Warehouse_View();
                            //将递入的条码去掉前三位后转化成整形,TryParse不能转换成整数时返回false,并返回ID=0
                            int ID;
                            if (int.TryParse(sBarCode.Remove(0, 3), out ID))
                            {
                                if (dal.GetInfoByID(ID, HOWNERID))
                                {
                                    oBar.HBarType = "仓库条码";
                                    oBar.HWhID = dal.omodel.HItemID;
                                    oBar.HWhNumber = dal.omodel.HNumber;
                                    oBar.HWhName = dal.omodel.HName;
                                    oBar.HSPFlag = dal.omodel.HIsStockMgr;
                                    return oBar;
                                }
                                else
                                {
                                    sErrMsg = "无效仓库条码!";
                                    return null;
                                }
                            }
                            else
                            {
                                sErrMsg = "错误的仓库条码!";
                                return null;
                            }
                        }
                        //仓位条码
                        else if (sBarBillName == "仓位")
                        {
                            DAL.ClsIF_StockPlace_View dal = new DAL.ClsIF_StockPlace_View();
                            //将递入的条码去掉前三位后转化成整形
                            int sHSPID;
                            int sHWHID;
                            string[] sArray = sBarCode.Remove(0, 3).Split(';');
                            if (int.TryParse(sArray[1], out sHSPID) && int.TryParse(sArray[0], out sHWHID))
                            {
                                if (dal.GetInfoByID(sHSPID, sHWHID, HOWNERID))
                                {
                                    oBar.HBarType = "仓位条码";
                                    oBar.HSPID = dal.omodel.HItemID;
                                    oBar.HSPNumber = dal.omodel.HNumber;
                                    oBar.HSPName = dal.omodel.HName;
                                    oBar.HWhID = dal.omodel.HWHID;
                                    oBar.HWhNumber = dal.omodel.HWhNumber;
                                    oBar.HWhName = dal.omodel.HWhName;
                                    return oBar;
                                }
                                else
                                {
                                    sErrMsg = "无效仓位条码!";
                                    return null;
                                }
                            }
                            else
                            {
                                sErrMsg = "错误的仓位条码!";
                                return null;
                            }
                        }
                        //部门条码
                        else if (sBarBillName == "部门")
                        {
                            DAL.ClsIF_Department_View dal = new DAL.ClsIF_Department_View();
                            //将递入的条码去掉前三位后转化成整形
                            int ID;
                            if (int.TryParse(sBarCode.Remove(0, 3), out ID))
                            {
                                if (dal.GetInfoByID(ID))
                                {
                                    oBar.HBarType = "部门条码";
                                    oBar.HDeptID = dal.omodel.HItemID;
                                    oBar.HDeptNumber = dal.omodel.HNumber;
                                    oBar.HDeptName = dal.omodel.HName;
                                    return oBar;
                                }
                                else
                                {
                                    sErrMsg = "无效部门条码!";
                                    return null;
                                }
                            }
                            else
                            {
                                sErrMsg = "错误的部门条码!";
                                return null;
                            }
                        }
                        else
                        {
                            sErrMsg = "无效基础资料条码!";
                            return null;
                        }
                    }
                    else
                    {
                        sErrMsg = "无效条码类型!";
                        return null;
                    }
                }
            }
        }
        //保存到出入库条码临时表(一张单据,存在相同物料)
        [WebMethod]
        public bool set_SavePonderationBillMain_Temp_Select_Qty(Model.ClsKF_PonderationBillMain_Temp oMain, Double sQty, ref string sErrMsg)
        {
            DAL.ClsKF_PonderationBillMain_Temp_Ctl dal = new DAL.ClsKF_PonderationBillMain_Temp_Ctl();
            DAL.ClsGy_BarCodeBill_View oBar = new DAL.ClsGy_BarCodeBill_View();
            dal.oModel = oMain;
            if (!oBar.GetInfoByNumber_View(oMain.HBarCode))
            {
                sErrMsg = "无效条码";
                return false;
            }
            else
            {
                if (oBar.omodel_View.HBarCodeType == "托盘条码")
                {
                    if (!dal.IsBarCode_Pack(oMain.HBarCode, oMain.HInterID, oMain.HBillType))
                    {
                        sErrMsg = "存在相同条码,请勿重复扫描!";
                        return false;
                    }
                    if (dal.AddNew_More_Select(ref sErrMsg))
                    {
                        //sErrMsg = "保存成功!";
                        return true;
                    }
                    else
                    {
                        //sErrMsg = "保存失败!";
                        return false;
                    }
                }
                else
                {
                    if (oBar.omodel_View.HBarCodeType == "唯一条码")
                    {
                        if (!dal.IsBarCode(oMain.HBarCode, oMain.HInterID, oMain.HErpClsID, oMain.HBillType))
                        {
                            sErrMsg = "存在相同条码,请勿重复扫描!";
                            return false;
                        }
                        //一次扫码控制,同一条码、同一单据类型,在WMS表和TEMP表里,只允许进行一次扫码
                        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
                        DataSet ds = oCn.RunProcReturn("exec h_p_WMS_CheckBarCodeOneScan " + oMain.HInterID.ToString() + ",'" + oMain.HBarCode + "','" + oMain.HBillType + "'," + oMain.HWhID.ToString() + "," + oMain.HStockPlaceID.ToString() + "," + oMain.HSCWHID.ToString() + "," + oMain.HOutStockPlaceID.ToString() + ",'" + oMain.HMaker + "'", "h_p_WMS_CheckBarCodeOneScan");
                        if (ds == null || ds.Tables[0].Rows.Count == 0)
                        {
                        }
                        else
                        {
                            if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0][0]) == 1)
                            {
                                sErrMsg = "对不起,您扫描的条形码已被扫描过,不符合一次扫码系统参数的要求!";
                                return false;
                            }
                        }
                    }
                    if (dal.AddNew_Source(sQty, ref sErrMsg))
                    {
                        //sErrMsg = "保存成功!";
                        return true;
                    }
                    else
                    {
                        //sErrMsg = "保存失败!";
                        return false;
                    }
                }
            }
        }
        //删除出入库条码临时表 扫描记录
        [WebMethod]
        public bool DeleteMould(long HInterID,string HBillNo, ref string sErrMsg)
        {
            DAL.ClsKF_PonderationBillMain_Temp_Ctl_Mould dal = new DAL.ClsKF_PonderationBillMain_Temp_Ctl_Mould();
            if (dal.DeleteMould(HInterID, HBillNo))
            {
                sErrMsg = "删除成功!";
                return true;
            }
            else
            {
                sErrMsg = "删除失败!";
                return false;
            }
        }
        //扫描物料条码    保存到出入库条码临时表(物料)
        [WebMethod]
        public bool set_SavePonderationBillMain_Temp_BarCode_Mould(string sBarCode, Int64 HBillID, string HBillType, string HBillNo, string HMaker, Int64 HWhID, Int64 HSPID, Double HQty, bool HRedBlueFlag, bool SourceFlag, string HSourceBillNo, string HSourceBillType, Int64 HOWNERID, string HExpressNumber, ref string sHSourceBillNo, ref string sHSourceBillType, ref long sHSupID, ref string sHSupName, ref long sHDeptID, ref string sHDeptName, ref string sErrMsg)
        {
            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
            DAL.ClsKF_PonderationBillMain_Temp_Ctl_Mould tem = new DAL.ClsKF_PonderationBillMain_Temp_Ctl_Mould();
            Model.ClsSc_MouldStockBillMain_Temp model = new Model.ClsSc_MouldStockBillMain_Temp();
            double sRelQty = 0;
            string sRedBlue = "蓝字";
            if (HRedBlueFlag)
            {
                sRedBlue = "红字";
            }
            else
            {
                sRedBlue = "蓝字";
            }
            //判断条码是否含特殊符号 # ,如果含有则 拆分
            string[] NewBarCode;
            if (sBarCode.CompareTo("#") > 0)
            {
                NewBarCode = sBarCode.Split(Convert.ToChar("#"));
                sBarCode = NewBarCode[0];
            }
            //获取系统参数
            Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
            if (oSystemParameter.ShowBill(ref sErrMsg) == false)
            {
                sErrMsg = "获取系统参数失败! " + sErrMsg;
                return false;
            }
            //蓝字产品入库、外购入库、委外入库、生产汇报,根据物料条码得到对应源单信息,非多源单模式
            //未扫描源单的情况下,第一次扫描物料条码获取源单信息并存入临时表
            //采购入库(1201)、产品入库(1202)、委外入库(1210)、生产汇报(3711)
            if (SourceFlag == false && (HBillType == "1201" || HBillType == "1202" || HBillType == "1210" || HBillType == "3711"))
            {
            }
            else
            {
                //无源单状态,设置源单类型为-1
                if (SourceFlag == false)
                {
                    //销售出库不允许无源单出库
                    if (HBillType == "1205")
                    {
                        sErrMsg = "不允许无源单出库,请先扫描源单!";
                        return false;
                    }
                    HSourceBillType = "-1";
                }
            }
            //根据条码获取条码信息,存在相同物料时自动获取一行源单信息
            DAL.ClsGy_BarCodeBill_View_Mould dal = new DAL.ClsGy_BarCodeBill_View_Mould();
            if (dal.GetInfoByNumber(sBarCode))
            {
            }
            else
            {
                sErrMsg = "无效条码";
                return false;
            }
            //判断并获取 仓库 仓位信息
            DataSet ds4 = oCn.RunProcReturn("exec h_p_WMS_GetBillWHID " + HBillID.ToString() + ",'" + HBillType + "','" + sBarCode + "'," + HWhID.ToString() + "," + HSPID.ToString(), "h_p_WMS_GetBillWHID");
            if (ds4 == null || ds4.Tables[0].Rows.Count == 0)
            {
                sErrMsg = "判断并获取仓库仓位信息,未知错误!";
                return false;
            }
            else
            {
                if (DBUtility.ClsPub.isLong(ds4.Tables[0].Rows[0][0]) == 0)
                {
                    HWhID = DBUtility.ClsPub.isLong(ds4.Tables[0].Rows[0]["HWHID"]);
                    HSPID = DBUtility.ClsPub.isLong(ds4.Tables[0].Rows[0]["HSPID"]);
                }
                else
                {
                    sErrMsg = DBUtility.ClsPub.isStrNull(ds4.Tables[0].Rows[0]["HRemark"]);
                    return false;
                }
            }
            //判断条码扫描数量   返回剩余未扫描数量
            //if (tem.IsBarCode_New(sBarCode, HBillType, HRedBlueFlag, ref sRelQty, ref sErrMsg))
            //{
            //}
            //else
            //{
            //    sErrMsg = sErrMsg;
            //    return false;
            //}
            model.HInterID = HBillID;
            model.HBillNo = HBillNo;
            model.HBillType = HBillType;
            model.HMaker = HMaker;
            //
            model.HMouldID = dal.omodel_View.HMaterID;
            model.HAuxPropID = dal.omodel_View.HAuxPropID;
            //model.HQty = sRelQty;
            //model.HQtyMust = dal.omodel_View.HinitQty;
            model.HQty = 1;
            model.HQtyMust = 1;
            model.HBarCode = sBarCode;
            model.HBatchNo = dal.omodel_View.HBatchNo;
            model.HMTONo = dal.omodel_View.HMTONo;
            model.HWhID = HWhID;
            model.HStockPlaceID = HSPID;
            model.HSourceInterID = dal.omodel_View.HSourceInterID;
            model.HSourceEntryID = dal.omodel_View.HSourceEntryID;
            model.HSourceBillNo = dal.omodel_View.HSourceBillNo;
            model.HSourceBillType = HSourceBillType;
            model.HRedBlueFlag = HRedBlueFlag;
            model.HPieceQty = 1;
            model.HOtherOrgID = HOWNERID;
            model.HOWNERID = HOWNERID;
            ////获取系统参数
            //Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
            //if (oSystemParameter.ShowBill(ref sErrMsg) == false)
            //{
            //    sErrMsg = "获取系统参数失败! " + sErrMsg;
            //    return false;
            //}
            //物料条码写入临时表时,判断仓库仓位是否正确
            DataSet ds5 = oCn.RunProcReturn("exec h_p_WMS_CheckWHandSP " + model.HWhID.ToString() + "," + model.HStockPlaceID.ToString(), "h_p_WMS_CheckWHandSP");
            if (ds5 == null || ds5.Tables[0].Rows.Count == 0)
            {
                sErrMsg = "扫描物料条码存入临时表时判断仓库仓位是否正确,未知错误!";
                return false;
            }
            else
            {
                if (DBUtility.ClsPub.isLong(ds5.Tables[0].Rows[0][0]) == 1)
                {
                    sErrMsg = DBUtility.ClsPub.isStrNull(ds5.Tables[0].Rows[0]["HRemark"]);
                    return false;
                }
            }
            //将物料条码信息写入出入库条码临时表
            if (set_SavePonderationBillMain_Temp_Select_Qty_Mould(model, HQty, ref sErrMsg))
            {
            }
            else
            {
                sErrMsg = "扫描失败!" + sErrMsg;
                return false;
            }
            return true;
        }
    }
}
DLL/DAL.dll
Binary files differ
DLL/Model.dll
Binary files differ