using System;
using System.Collections.Generic;
using System.Text;
namespace DAL
{
public class K3_BaseFun
{
#region 产品入库
///
/// 返回产品入库单 新增主表SQL
///
///
public static string Fun_GetAddBillMainSQL_ProdIn(Model.ClsKf_ProductInBillMain_K3 omodel, string VNum)
{
string RSql="";
switch (VNum )
{
case "12.2":
RSql = "INSERT INTO ICStockBill(" +
"FInterID,FBillNo,FBrNo,FTranType,FCancellation,FStatus," +
"FUpStockWhenSave,FROB,FHookStatus,Fdate,FDeptID,FCheckDate," +
"FFManagerID,FSManagerID,FBillerID,FMultiCheckDate1," +
"FMultiCheckDate2,FMultiCheckDate3,FMultiCheckDate4," +
"FMultiCheckDate5,FMultiCheckDate6,FVchInterID,FSelTranType," +
"FManageType,FPrintCount,FNote" +
") Values (" +
omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','0','" + omodel.HBillType + "',0,0" +
",0,1,0,'" + omodel.HDate.ToString() + "'," + omodel.FDeptID.ToString() + ",null" +
"," + omodel.FFManagerID.ToString() + "," + omodel.FSManagerID.ToString() + "," + omodel.HBillerID + ",null" +
",null,null,null" +
",null,null,0," + omodel.FSelTranType.ToString() +
",0,0,'" + omodel.HRemark + "'" +
")";
break;
case "12.1":
RSql = "INSERT INTO ICStockBill(" +
"FInterID,FBillNo,FBrNo,FTranType,FCancellation,FStatus," +
"FUpStockWhenSave,FROB,FHookStatus,Fdate,FDeptID,FCheckDate," +
"FFManagerID,FSManagerID,FBillerID,FMultiCheckDate1," +
"FMultiCheckDate2,FMultiCheckDate3,FMultiCheckDate4," +
"FMultiCheckDate5,FMultiCheckDate6,FVchInterID,FSelTranType," +
"FManageType,FPrintCount,FNote,FHeadSelfA0228" +
") Values (" +
omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','0','" + omodel.HBillType + "',0,0" +
",0,1,0,'" + omodel.HDate.ToString() + "'," + omodel.FDeptID.ToString() + ",null" +
"," + omodel.FFManagerID.ToString() + "," + omodel.FSManagerID.ToString() + "," + omodel.HBillerID + ",null" +
",null,null,null" +
",null,null,0," + omodel.FSelTranType.ToString() +
",0,0,'" + omodel.HRemark + "'," +omodel.HGroupID.ToString() +
")";
break;
default:
RSql = "INSERT INTO ICStockBill(" +
"FInterID,FBillNo,FBrNo,FTranType,FCancellation,FStatus," +
"FUpStockWhenSave,FROB,FHookStatus,Fdate,FDeptID,FCheckDate," +
"FFManagerID,FSManagerID,FBillerID,FMultiCheckDate1," +
"FMultiCheckDate2,FMultiCheckDate3,FMultiCheckDate4," +
"FMultiCheckDate5,FMultiCheckDate6,FVchInterID,FSelTranType," +
"FManageType,FPrintCount,FNote,FHeadSelfA0228" +
") Values (" +
omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','0','" + omodel.HBillType + "',0,0" +
",0,1,0,'" + omodel.HDate.ToString() + "'," + omodel.FDeptID.ToString() + ",null" +
"," + omodel.FFManagerID.ToString() + "," + omodel.FSManagerID.ToString() + "," + omodel.HBillerID + ",null" +
",null,null,null" +
",null,null,0," + omodel.FSelTranType.ToString() +
",0,0,'" + omodel.HRemark + "'," + omodel.HGroupID.ToString() +
")";
break;
}
return RSql;
}
public static string Fun_GetAddBillSubSQL_ProdIn(Model.ClsKf_ProductInBillSub_K3 oSub, string VNum)
{
string RSql = "";
switch (VNum)
{
case "12.2":
RSql = "INSERT INTO ICStockBillEntry (" +
"FInterID,FEntryID,FBrNo,FItemID,FAuxPropID," +
"FBatchNo,FQtyMust,FQty,FUnitID,FAuxQtyMust," +
"Fauxqty,FSecCoefficient,FSecQty,FAuxPlanPrice," +
"FPlanAmount,Fauxprice,Famount,Fnote,FKFDate," +
"FKFPeriod,FPeriodDate,FDCStockID,FDCSPID,FSNListID," +
"FSourceBillNo,FSourceTranType,FSourceInterId,FSourceEntryID," +
"FSecUnitID,FEntrySelfA0236," +
"FICMOBillNo,FICMOInterID,FPPBomEntryID,FPlanMode,FMTONo,FChkPassItem" +
") Values (" +
oSub.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'0'," + oSub.FItemID.ToString() + "," + oSub.HPropertyID.ToString() + "" +
",'" + oSub.FBatchNo + "'," + oSub.Fauxqty.ToString() + "," + oSub.Fauxqty.ToString() + "," + oSub.FUnitID.ToString() + "," + oSub.Fauxqty.ToString() +
"," + oSub.Fauxqty.ToString() + ",0,0,0" +
",0," + oSub.Fauxprice.ToString() + "," + oSub.Famount.ToString() + ",'" + oSub.Fnote + "',null" +
",0,null," + oSub.FDCStockID.ToString() + "," + oSub.HSPID.ToString() + ",0" +
"," + oSub.HSecUnitID.ToString() + "," + oSub.HSecUnitQty.ToString() + "" +
",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() +
",'" + oSub.FICMOBillNo + "'," + oSub.FICMOInterID.ToString() + ",0,14036,'',0" +
")";
break;
case "12.1":
RSql = "INSERT INTO ICStockBillEntry (" +
"FInterID,FEntryID,FBrNo,FItemID,FAuxPropID," +
"FBatchNo,FQtyMust,FQty,FUnitID,FAuxQtyMust," +
"Fauxqty,FSecCoefficient,FSecQty,FAuxPlanPrice," +
"FPlanAmount,Fauxprice,Famount,Fnote,FKFDate," +
"FKFPeriod,FPeriodDate,FDCStockID,FDCSPID,FSNListID," +
"FSourceBillNo,FSourceTranType,FSourceInterId,FSourceEntryID," +
"FEntrySelfA0236," +
"FICMOBillNo,FICMOInterID,FPPBomEntryID,FPlanMode,FMTONo,FChkPassItem" +
") Values (" +
oSub.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'0'," + oSub.FItemID.ToString() + "," + oSub.HPropertyID.ToString() + "" +
",'" + oSub.FBatchNo + "'," + oSub.Fauxqty.ToString() + "," + oSub.Fauxqty.ToString() + "," + oSub.FUnitID.ToString() + "," + oSub.Fauxqty.ToString() +
"," + oSub.Fauxqty.ToString() + ",0,0,0" +
",0," + oSub.Fauxprice.ToString() + "," + oSub.Famount.ToString() + ",'" + oSub.Fnote + "',null" +
",0,null," + oSub.FDCStockID.ToString() + "," + oSub.HSPID.ToString() + ",0" +
",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() +
"," + oSub.HSecUnitQty.ToString() + "" +
",'" + oSub.FICMOBillNo + "'," + oSub.FICMOInterID.ToString() + ",0,'14036','',1058" +
")";
break;
case "14.0":
RSql = "INSERT INTO ICStockBillEntry (" +
"FInterID,FEntryID,FBrNo,FItemID,FAuxPropID," +
"FBatchNo,FQtyMust,FQty,FUnitID,FAuxQtyMust," +
"Fauxqty,FSecCoefficient,FSecQty,FAuxPlanPrice," +
"FPlanAmount,Fauxprice,Famount,Fnote,FKFDate," +
"FKFPeriod,FPeriodDate,FDCStockID,FDCSPID,FSNListID," +
"FSourceBillNo,FSourceTranType,FSourceInterId,FSourceEntryID," +
"FEntrySelfA0236," +
"FICMOBillNo,FICMOInterID,FPPBomEntryID,FPlanMode,FMTONo,FChkPassItem" +
") Values (" +
oSub.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'0'," + oSub.FItemID.ToString() + "," + oSub.HPropertyID.ToString() + "" +
",'" + oSub.FBatchNo + "'," + oSub.Fauxqty.ToString() + "," + oSub.Fauxqty.ToString() + "," + oSub.FUnitID.ToString() + "," + oSub.Fauxqty.ToString() +
"," + oSub.Fauxqty.ToString() + ",0,0,0" +
",0," + oSub.Fauxprice.ToString() + "," + oSub.Famount.ToString() + ",'" + oSub.Fnote + "',null" +
",0,null," + oSub.FDCStockID.ToString() + "," + oSub.HSPID.ToString() + ",0" +
",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() +
"," + oSub.HSecUnitQty.ToString() + "" +
",'" + oSub.FICMOBillNo + "'," + oSub.FICMOInterID.ToString() + ",0,'14036','',1058" +
")";
break;
default:
RSql = "INSERT INTO ICStockBillEntry (" +
"FInterID,FEntryID,FBrNo,FItemID,FAuxPropID," +
"FBatchNo,FQtyMust,FQty,FUnitID,FAuxQtyMust," +
"Fauxqty,FSecCoefficient,FSecQty,FAuxPlanPrice," +
"FPlanAmount,Fauxprice,Famount,Fnote,FKFDate," +
"FKFPeriod,FPeriodDate,FDCStockID,FDCSPID,FSNListID," +
"FSourceBillNo,FSourceTranType,FSourceInterId,FSourceEntryID," +
"FEntrySelfA0236," +
"FICMOBillNo,FICMOInterID,FPPBomEntryID,FPlanMode,FMTONo,FChkPassItem" +
") Values (" +
oSub.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'0'," + oSub.FItemID.ToString() + "," + oSub.HPropertyID.ToString() + "" +
",'" + oSub.FBatchNo + "'," + oSub.Fauxqty.ToString() + "," + oSub.Fauxqty.ToString() + "," + oSub.FUnitID.ToString() + "," + oSub.Fauxqty.ToString() +
"," + oSub.Fauxqty.ToString() + ",0,0,0" +
",0," + oSub.Fauxprice.ToString() + "," + oSub.Famount.ToString() + ",'" + oSub.Fnote + "',null" +
",0,null," + oSub.FDCStockID.ToString() + "," + oSub.HSPID.ToString() + ",0" +
",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() +
"," + oSub.HSecUnitQty.ToString() + "" +
",'" + oSub.FICMOBillNo + "'," + oSub.FICMOInterID.ToString() + ",0,'14036','',1058" +
")";
break;
}
return RSql;
}
#endregion
#region 外购入库
///
/// 返回外购入库单 新增主表SQL
///
///
public static string Fun_GetAddBillMainSQL_POStockIn(Model.ClsKf_POStockInBillMain_K3 omodel, string VNum)
{
string RSql = "";
switch (VNum)
{
case "12.2":
RSql = "Insert Into ICStockBill " +
"(FInterID,FBillNo,FBrNo,FTranType,FCancellation,FStatus" +
",FUpStockWhenSave,FVchInterID,FROB,FHookStatus,Fdate,FSupplyID" +
",FCheckDate,FFManagerID,FSManagerID,FBillerID,FPOStyle,FMultiCheckLevel1" +
",FMultiCheckDate1,FMultiCheckLevel2,FMultiCheckDate2,FMultiCheckLevel3,FMultiCheckDate3,FMultiCheckLevel4" +
",FMultiCheckDate4,FMultiCheckLevel5,FMultiCheckDate5,FMultiCheckLevel6,FMultiCheckDate6" +
",FPOOrdBillNo,FRelateBrID,FOrgBillInterID,FSelTranType" +
",FBrID,FExplanation,FDeptID,FManagerID,FEmpID,FCussentAcctID" +
") " +
" values(" + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','0','" + omodel.HBillType + "',0,0" +
",0,0," + omodel.HRedBlueFlag.ToString() + ",0,'" + omodel.HDate.ToShortDateString() + "'," + omodel.HSupID.ToString() +
",null," + omodel.HSecManagerID.ToString() + "," + omodel.HKeeperID.ToString() + "," + omodel.HBillerID + "," + omodel.HPOStyle.ToString() + ",null" +
",null,null,null,null,null,null" +
",null,null,null,null,null" +
",'',0,0,0" +
",0,'" + omodel.HExplanation + "'," + omodel.HDeptID.ToString() + "," + omodel.HManagerID.ToString() + "," + omodel.HEmpID.ToString() + "," + omodel.HCussentAcctID.ToString() +
") ";
break;
case "12.1":
RSql = "Insert Into ICStockBill " +
"(FInterID,FBillNo,FBrNo,FTranType,FCancellation,FStatus" +
",FUpStockWhenSave,FVchInterID,FROB,FHookStatus,Fdate,FSupplyID" +
",FCheckDate,FFManagerID,FSManagerID,FBillerID,FPOStyle,FMultiCheckLevel1" +
",FMultiCheckDate1,FMultiCheckLevel2,FMultiCheckDate2,FMultiCheckLevel3,FMultiCheckDate3,FMultiCheckLevel4" +
",FMultiCheckDate4,FMultiCheckLevel5,FMultiCheckDate5,FMultiCheckLevel6,FMultiCheckDate6" +
",FPOOrdBillNo,FRelateBrID,FOrgBillInterID,FSelTranType,FPOMode,FOrderAffirm,FPayCondition" +
",FBrID,FExplanation,FDeptID,FManagerID,FEmpID,FCussentAcctID,FManageType,FSettleDate,FPrintCount" +
") " +
" values(" + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','0','" + omodel.HBillType + "',0,0" +
",0,0," + omodel.HRedBlueFlag.ToString() + ",0,'" + omodel.HDate.ToShortDateString() + "'," + omodel.HSupID.ToString() +
",null," + omodel.HSecManagerID.ToString() + "," + omodel.HKeeperID.ToString() + "," + omodel.HBillerID + "," + omodel.HPOStyle.ToString() + ",null" +
",null,null,null,null,null,null" +
",null,null,null,null,null" +
",'',0,0,72,36680,0,0" +
",0,'" + omodel.HExplanation + "'," + omodel.HDeptID.ToString() + "," + omodel.HManagerID.ToString() + "," + omodel.HEmpID.ToString() + "," + omodel.HCussentAcctID.ToString() +
",0,'" + omodel.HDate.ToShortDateString() + "',0) ";
break;
default:
break;
}
return RSql;
}
public static string Fun_GetAddBillSubSQL_POStockIn(Model.ClsKf_POStockInBillSub_K3 oSub, string VNum)
{
string RSql = "";
switch (VNum)
{
case "12.2":
RSql = "Insert into ICStockBillEntry " +
" (FInterID,FEntryID,FBrNo,FMapNumber,FMapName" +
",FItemID,FAuxPropID,FBatchNo,FQtyMust,FQty" +
",FUnitID,FAuxQtyMust,Fauxqty,FSecCoefficient,FSecQty" +
",FAuxPlanPrice,FPlanAmount,Fauxprice,Famount,Fnote" +
",FKFDate,FKFPeriod,FPeriodDate,FDCStockID,FDCSPID" +
",FOrgBillEntryID,FSNListID,FSourceBillNo,FSourceTranType,FSourceInterId" +
",FSourceEntryID,FContractBillNo,FContractInterID,FContractEntryID,FOrderBillNo" +
",FOrderInterID,FOrderEntryID,FAllHookQTY,FAllHookAmount,FCurrentHookQTY" +
",FCurrentHookAmount,FAuxQtyInvoice,FQtyInvoice,FChkPassItem" +
") values("
+ oSub.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'0','',''" +
"," + oSub.HMaterID.ToString() + "," + oSub.HPropertyID.ToString() + ",'" + oSub.HBatchNo.ToString() + "'," + oSub.HQtyMust.ToString() + "," + oSub.HQty.ToString() +
"," + oSub.HUnitID.ToString() + "," + oSub.HQtyMust.ToString() + "," + oSub.HAuxQty.ToString() + ",0,0" +
",0,0," + oSub.HPrice.ToString() + "," + oSub.HMoney.ToString() + ",'" + oSub.HRemark + "'" +
",null,0,null," + oSub.HWHID.ToString() + "," + oSub.HSPID.ToString() +
",0,0,'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HSourceInterID.ToString() +
"," + oSub.HSourceEntryID.ToString() + ",'',0,0,'" + oSub.HPOOrderBillNo + "'" +
"," + oSub.HPOOrderInterID.ToString() + "," + oSub.HPOOrderEntryID.ToString() + ",0,0,0" +
",0,0,0,1058)";
break;
case "12.1":
RSql = "Insert into ICStockBillEntry " +
" (FInterID,FEntryID,FBrNo,FMapNumber,FMapName" +
",FItemID,FAuxPropID,FBatchNo,FQtyMust,FQty" +
",FUnitID,FAuxQtyMust,Fauxqty,FSecCoefficient,FSecQty" +
",FAuxPlanPrice,FPlanAmount,Fauxprice,Famount,Fnote" +
",FKFDate,FKFPeriod,FPeriodDate,FDCStockID,FDCSPID" +
",FOrgBillEntryID,FSNListID,FSourceBillNo,FSourceTranType,FSourceInterId" +
",FSourceEntryID,FContractBillNo,FContractInterID,FContractEntryID,FOrderBillNo" +
",FOrderInterID,FOrderEntryID,FAllHookQTY,FAllHookAmount,FCurrentHookQTY" +
",FCurrentHookAmount,FAuxQtyInvoice,FQtyInvoice,FSecInvoiceQty,FPlanMode,FMTONo,FChkPassItem" +
") values("
+ oSub.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'0','',''" +
"," + oSub.HMaterID.ToString() + "," + oSub.HPropertyID.ToString() + ",'" + oSub.HBatchNo.ToString() + "'," + oSub.HQtyMust.ToString() + "," + oSub.HQty.ToString() +
"," + oSub.HUnitID.ToString() + "," + oSub.HQtyMust.ToString() + "," + oSub.HAuxQty.ToString() + ",0,0" +
",0,0," + oSub.HPrice.ToString() + "," + oSub.HMoney.ToString() + ",'" + oSub.HRemark + "'" +
",null,0,null," + oSub.HWHID.ToString() + "," + oSub.HSPID.ToString() +
",0,0,'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HSourceInterID.ToString() +
"," + oSub.HSourceEntryID.ToString() + ",'',0,0,'" + oSub.HPOOrderBillNo + "'" +
"," + oSub.HPOOrderInterID.ToString() + "," + oSub.HPOOrderEntryID.ToString() + ",0,0,0" +
",0,0,0,0,14036,'',1058)";
break;
default:
break;
}
return RSql;
}
#endregion
#region 其他入库
///
/// 返回其他入库单 新增主表SQL
///
///
public static string Fun_GetAddBillMainSQL_OtherIn(Model.ClsKf_OtherInBillMain_K3 omodel, string VNum)
{
string RSql = "";
switch (VNum)
{
case "12.2":
RSql = "INSERT INTO ICStockBill" +
"(FInterID,FBillNo,FBrNo,FTranType,FCancellation" +
",FStatus,FUpStockWhenSave,FROB,FHookStatus,Fdate" +
",FSupplyID,FCheckDate,FFManagerID,FSManagerID" +
",FBillerID,FDeptID,FBillTypeID,FMultiCheckDate1" +
",FMultiCheckDate2,FMultiCheckDate3,FMultiCheckDate4" +
",FMultiCheckDate5,FVchInterID,FMultiCheckDate6" +
",FPOOrdBillNo,FRelateBrID,FSelTranType,FBrID" +
",FManagerID,FEmpID,FExplanation,FNote) " +
"VALUES " +
"(" + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','0'," + omodel.HBillType + ",0" +
",0,0,1,0,'" + omodel.HDate.ToShortDateString() + "'" +
"," + omodel.HSupplyID + ",Null," + omodel.HFManagerID + "," + omodel.HManagerID + "" +
"," + omodel.HBillerID.ToString() + "," + omodel.HDeptID.ToString() + ",0,Null" +
",Null,Null,Null" +
",Null,0,Null" +
",'',0,0,0" +
"," + omodel.HManagerID + "," + omodel.HEmpID + ",'" + omodel.HExplanation + "','" + omodel.HRemark +
"') ";
break;
case "12.1":
RSql = "INSERT INTO ICStockBill" +
"(FInterID,FBillNo,FBrNo,FTranType,FCancellation" +
",FStatus,FUpStockWhenSave,FROB,FHookStatus,Fdate" +
",FSupplyID,FCheckDate,FFManagerID,FSManagerID" +
",FBillerID,FDeptID,FBillTypeID,FMultiCheckDate1" +
",FMultiCheckDate2,FMultiCheckDate3,FMultiCheckDate4" +
",FMultiCheckDate5,FVchInterID,FMultiCheckDate6" +
",FPOOrdBillNo,FRelateBrID,FSelTranType,FBrID" +
",FManagerID,FEmpID,FExplanation,FNote,FManageType) " +
"VALUES " +
"(" + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','0'," + omodel.HBillType + ",0" +
",0,0,1,0,'" + omodel.HDate.ToShortDateString() + "'" +
"," + omodel.HSupplyID + ",Null," + omodel.HFManagerID + "," + omodel.HSManagerID + "" +
"," + omodel.HBillerID.ToString() + "," + omodel.HDeptID.ToString() + ",0,Null" +
",Null,Null,Null" +
",Null,0,Null" +
",'',0,0,0" +
"," + omodel.HManagerID + "," + omodel.HEmpID + ",'" + omodel.HExplanation + "','" + omodel.HRemark +
"',0) ";
break;
default:
break;
}
return RSql;
}
public static string Fun_GetAddBillSubSQL_OtherIn(Model.ClsKf_OtherInBillSub_K3 oSub, string VNum)
{
string RSql = "";
switch (VNum)
{
case "12.2":
RSql = "INSERT INTO ICStockBillEntry " +
"(FInterID,FEntryID,FBrNo,FMapNumber,FMapName" +
",FItemID,FAuxPropID,FBatchNo,FQtyMust,FQty" +
",FUnitID,FAuxQtyMust,Fauxqty,FSecCoefficient" +
",FSecQty,FAuxPlanPrice,FPlanAmount,Fauxprice" +
",Famount,Fnote,FKFDate,FKFPeriod,FPeriodDate" +
",FDCStockID,FDCSPID,FSNListID" +
",FSourceBillNo,FSourceTranType,FSourceInterId,FSourceEntryID" +
",FOrderBillNo,FOrderInterID,FOrderEntryID,FChkPassItem)" +
"VALUES " +
"(" + oSub.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'0','',''" +
"," + oSub.HMaterID + "," + oSub.HPropertyID + ",'" + oSub.HBatchNo + "'," + oSub.HQtyMust + "," + oSub.HQty + "" +
"," + oSub.HUnitID + "," + oSub.HAuxQtyMust + "," + oSub.HAuxqty + ",0" +
",0," + oSub.HAuxPlanPrice + ",0," + oSub.HAuxprice + "" +
"," + oSub.HAmount + ",'" + oSub.HRemark + "',Null,0,Null" +
"," + oSub.HDCStockID + "," + oSub.HDCSPID + ",0" +
",'',0,0,0" +
",'',0,0,1058)";
break;
case "12.1":
RSql = "INSERT INTO ICStockBillEntry " +
"(FInterID,FEntryID,FBrNo,FMapNumber,FMapName" +
",FItemID,FAuxPropID,FBatchNo,FQtyMust,FQty" +
",FUnitID,FAuxQtyMust,Fauxqty,FSecCoefficient" +
",FSecQty,FAuxPlanPrice,FPlanAmount,Fauxprice" +
",Famount,Fnote,FKFDate,FKFPeriod,FPeriodDate" +
",FDCStockID,FDCSPID,FSNListID" +
",FSourceBillNo,FSourceTranType,FSourceInterId,FSourceEntryID" +
",FOrderBillNo,FOrderInterID,FOrderEntryID,FPlanMode,FMTONo,FCostPercentage,FChkPassItem)" +
"VALUES " +
"(" + oSub.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'0','',''" +
"," + oSub.HMaterID + "," + oSub.HPropertyID + ",'" + oSub.HBatchNo + "'," + oSub.HQtyMust + "," + oSub.HQty + "" +
"," + oSub.HUnitID + "," + oSub.HAuxQtyMust + "," + oSub.HAuxqty + ",0" +
",0," + oSub.HAuxPlanPrice + ",0," + oSub.HAuxprice + "" +
"," + oSub.HAmount + ",'" + oSub.HRemark + "',Null,0,Null" +
"," + oSub.HDCStockID + "," + oSub.HDCSPID + ",0" +
",'',0,0,0" +
",'',0,0,14036,'',0,1058)";
break;
default:
break;
}
return RSql;
}
#endregion
#region 调拨单
///
/// 返回调拨单 新增主表SQL
///
///
public static string Fun_GetAddBillMainSQL_MoveStock(Model.ClsKf_MoveStockBillMain_K3 omodel, string VNum)
{
string RSql = "";
switch (VNum)
{
case "12.2":
RSql = "Insert Into ICStockBill " +
"(FInterID,FBillNo,FBrNo,FTranType,FCancellation " +
",FStatus,FUpStockWhenSave,FHookStatus,Fdate,FCheckDate " +
",FFManagerID,FSManagerID,FBillerID,FMultiCheckDate1,FMultiCheckDate2 " +
",FMultiCheckDate3,FMultiCheckDate4,FMultiCheckDate5,FMultiCheckDate6 " +
",FSelTranType,FBrID,FDeptID,FEmpID,FRefType" +
") " +
" values(" + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','0'," + omodel.HBillType + ",0" +
",0,0,0,'" + omodel.HDate.ToShortDateString() + "',null" +
"," + omodel.HSecManagerID.ToString() + "," + omodel.HKeeperID.ToString() + "," + omodel.HBillerID.ToString() + ",null,null" +
",null,null,null,null" +
",0,0," + omodel.HDeptID.ToString() + "," + omodel.HEmpID.ToString() + ",12561" +
") ";
break;
case "12.1":
RSql = "Insert Into ICStockBill " +
"(FInterID,FBillNo,FBrNo,FTranType,FCancellation " +
",FStatus,FUpStockWhenSave,FHookStatus,Fdate,FCheckDate " +
",FFManagerID,FSManagerID,FBillerID,FMultiCheckDate1,FMultiCheckDate2 " +
",FMultiCheckDate3,FMultiCheckDate4,FMultiCheckDate5,FMultiCheckDate6 " +
",FSelTranType,FBrID,FDeptID,FEmpID,FRefType" +
") " +
" values(" + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','0'," + omodel.HBillType + ",0" +
",0,0,0,'" + omodel.HDate.ToShortDateString() + "',null" +
"," + omodel.HSecManagerID.ToString() + "," + omodel.HKeeperID.ToString() + "," + omodel.HBillerID.ToString() + ",null,null" +
",null,null,null,null" +
",0,0," + omodel.HDeptID.ToString() + "," + omodel.HEmpID.ToString() + ",12561" +
") ";
break;
default:
break;
}
return RSql;
}
public static string Fun_GetAddBillSubSQL_MoveStock(Model.ClsKf_MoveStockBillSub_K3 oSub, string VNum)
{
string RSql = "";
switch (VNum)
{
case "12.2":
RSql = "Insert into ICStockBillEntry " +
" (FInterID,FEntryID,FBrNo,FItemID,FAuxPropID " +
",FBatchNo,FQty,FUnitID,Fauxqty,FSecCoefficient" +
",FSecQty,FAuxPlanPrice,FPlanAmount,Fauxprice,Famount" +
",FAuxPriceRef,FAmtRef,Fnote,FKFDate,FKFPeriod,FPeriodDate" +
",FSCStockID,FSCSPID,FDCStockID,FDCSPID" +
",FSNListID,FSourceBillNo,FSourceTranType,FSourceInterId,FSourceEntryID" +
",FICMOBillNo,FICMOInterID,FPPBomEntryID,FOrderBillNo,FOrderInterID" +
",FOrderEntryID,FChkPassItem" +
") values("
+ oSub.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'0'," + oSub.HMaterID.ToString() + "," + oSub.HPropertyID.ToString() + "" +
",'" + oSub.HBatchNo.ToString() + "'," + oSub.HQty.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HQty.ToString() + ",0" +
",0,0,0" + oSub.HPrice.ToString() + "," + oSub.HMoney.ToString() + ",0" +
",0,0,'" + oSub.HRemark + "',null,0,null" +
"," + oSub.HSCWHID.ToString() + "," + oSub.HSCSPID.ToString() + "," + oSub.HWHID.ToString() + "," + oSub.HSPID.ToString() +
",0,'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() +
",'',0,0,'',0" +
",0,1058" +
")";
break;
case "12.1":
RSql = "Insert into ICStockBillEntry " +
" (FInterID,FEntryID,FBrNo,FItemID,FAuxPropID " +
",FBatchNo,FQty,FUnitID,Fauxqty,FSecCoefficient" +
",FSecQty,FAuxPlanPrice,FPlanAmount,Fauxprice,Famount" +
",FAuxPriceRef,FAmtRef,Fnote,FKFDate,FKFPeriod,FPeriodDate" +
",FSCStockID,FSCSPID,FDCStockID,FDCSPID" +
",FSNListID,FSourceBillNo,FSourceTranType,FSourceInterId,FSourceEntryID" +
",FICMOBillNo,FICMOInterID,FPPBomEntryID,FOrderBillNo,FOrderInterID" +
",FOrderEntryID,FPlanMode,FMTONo,FChkPassItem" +
") values("
+ oSub.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'0'," + oSub.HMaterID.ToString() + "," + oSub.HPropertyID.ToString() + "" +
",'" + oSub.HBatchNo.ToString() + "'," + oSub.HQty.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HQty.ToString() + ",0" +
",0,0,0" + oSub.HPrice.ToString() + "," + oSub.HMoney.ToString() + ",0" +
",0,0,'" + oSub.HRemark + "',null,0,null" +
"," + oSub.HSCWHID.ToString() + "," + oSub.HSCSPID.ToString() + "," + oSub.HWHID.ToString() + "," + oSub.HSPID.ToString() +
",0,'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() +
",'',0,0,'',0" +
",0,14036,'',1058" +
")";
break;
default:
break;
}
return RSql;
}
#endregion
#region 生产任务单
///
/// 返回生产任务单 新增主表SQL
///
///
public static string Fun_GetAddBillMainSQL_ICMO(Model.ClsSc_ICMOBillMain_K3 omodel, string VNum)
{
string RSql = "";
switch (VNum)
{
case "13.0":
RSql = "";
break;
case "12.2":
RSql = "";
break;
case "12.1":
RSql = "INSERT INTO ICMO(FInterID,FBillNo,FBrNo,FTranType,FCancellation " +
",FCheckDate,Fstatus,FMRP,FItemID,FCostObjID " +
",FBomInterID,FRoutingID,FWorkShop,FSupplyID,FWorktypeID " +
",FUnitID,Fauxqty,FPlanCommitDate,FPlanFinishDate,Fnote " +
",FCommitDate,FBillerID,FOrderInterID,FParentInterID,FPPOrderInterID,FType " +
",FSourceEntryID,FProcessPrice,FProcessFee,FPlanOrderInterID,FScheduleID " +
",FCustID,FMultiCheckDate1,FMultiCheckDate2,FMultiCheckDate3 " +
",FMultiCheckDate4,FMultiCheckDate5,FMultiCheckDate6,FConfirmDate " +
",FInHighLimit,FAuxInHighLimitQty,FInLowLimit,FAuxInLowLimitQty,FGMPBatchNo " +
",FChangeTimes,FMrpLockFlag,FCloseDate,FPlanMode,FMtoNo " +
",FHeadSelfJ0196,FHeadSelfJ0197,FHeadSelfJ0198,FHeadSelfJ0199 " +
",FHeadSelfJ01100,FHeadSelfJ01101,FHeadSelfJ01102,FHeadSelfJ01103,FHeadSelfJ01104 " +
",FPlanConfirmed,FPrintCount,FCardClosed,FHRReadyTime,FFinClosed " +
",FFinCloseer,FFinClosedate,FStockFlag) " +
"VALUES (" + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','0','" + omodel.HBillType + "',0" +
",getdate(),0,1052," + omodel.HMaterID.ToString() + "," + omodel.HCostObjID.ToString() +
"," + omodel.HBomID.ToString() + "," + omodel.HRoutingInterID.ToString() + "," + omodel.HDeptID.ToString() + ",0,56" +
"," + omodel.HUnitID.ToString() + "," + omodel.HPlanQty.ToString() + ",'" + omodel.HPlanBeginDate.ToShortDateString() + "','" + omodel.HPlanEndDate.ToShortDateString() + "','" + omodel.HRemark + "'" +
",Null," + omodel.HBillerID.ToString() + "," + omodel.HSeOrderInterID.ToString() + ",0,0,'" + DBUtility.ClsPub.isStrNull(omodel.HType) + "'" +
"," + omodel.HSeOrderEntryID.ToString() + ",0,0,0,0" +
"," + omodel.HCusID.ToString() + ",Null,Null,Null" +
",Null,Null,Null,Null" +
",0," + omodel.HPlanQty.ToString() + ",0," + omodel.HPlanQty.ToString() + ",'" + omodel.HBatchNo + "'" +
",0,0,Null,14036,''" +
"," + omodel.HAreaID.ToString() + "," + omodel.HRoutingID.ToString() + ",'" + omodel.HDiameter1.ToString() + "','" + omodel.HDiameter2.ToString() +
"','" + omodel.HDiameter3.ToString() + "'," + omodel.HWhID.ToString() + "," + omodel.HBillingID.ToString() + "," + omodel.HFormulaID.ToString() + "," + omodel.HBillingID.ToString() +
",0,0,1059,0,0" +
",0,Null,14215 )";
break;
default:
break;
}
return RSql;
}
#endregion
}
}