--单据插入
INSERT INTO ICStockBill(FInterID,FBillNo,FBrNo,FTranType,FCancellation,FStatus,FUpStockWhenSave,FROB,FHookStatus,Fdate,FDeptID,Fuse,FCheckDate,FFManagerID,FSManagerID,FBillerID,FSupplyID,FBillTypeID,FMultiCheckDate1,FMultiCheckDate2,FMultiCheckDate3,FMultiCheckDate4,FMultiCheckDate5,FMultiCheckDate6,FVchInterID,FPOOrdBillNo,FRelateBrID,FSelTranType,FBrID,FManagerID,FEmpID,FManageType,FPrintCount,FObjectItem)
SELECT 67885,'QTCK-16050300','0',29,0,0,0,1,0,'2016-05-20',9999,'库存转换',Null,7150,7150,16394,0,0,Null,Null,Null,Null,Null,Null,0,'',0,83,0,0,0,0,0,0
--单据头
INSERT INTO ICStockBillEntry (FInterID,FEntryID,FBrNo,FMapNumber,FMapName,FItemID,FAuxPropID,FBatchNo,FQty,FUnitID,Fauxqty,FSecCoefficient,FSecQty,FAuxPlanPrice,FPlanAmount,Fauxprice,Famount,Fnote,FKFDate,FKFPeriod,FPeriodDate,FIsVMI,FEntrySupply,FDCStockID,FDCSPID,FSNListID,FSourceBillNo,FSourceTranType,FSourceInterId,FSourceEntryID,FOrderBillNo,FOrderInterID,FOrderEntryID,FPlanMode,FMTONo,FSEOutBillNo,FSEOutEntryID,FSEOutInterID)
SELECT 67885,1,'0','','',8565,0,'2015',100,580,100,0,0,0,0,1,100,'',Null,0,Null,0,0,6003,0,0,'',0,0,0,'',0,0,14036,'','',0,0
union all
SELECT 67885,2,'0','','',2013,0,'2015',200,580,200,0,0,0,0,1,200,'',Null,0,Null,0,0,6003,0,0,'',0,0,0,'',0,0,14036,'','',0,0
union all
SELECT 67885,3,'0','','',2015,0,'2015',300,580,300,0,0,0,0,1,300,'',Null,0,Null,0,0,6003,0,0,'',0,0,0,'',0,0,14036,'','',0,0
--单据体,三条分录
EXEC p_UpdateBillRelateData 29,67885,'ICStockBill','ICStockBillEntry'
--UPDATE t_BillCodeBy SET FNumMax=301 WHERE FBillTypeID = '29' AND FFormatChar='1605' AND FProjectVal='yymm|'
-- 更改流水号
--内码
select * from icmaxnum where FTableName='ICStockBill'
select * from ic_maxnum where FTableName='ICStockBill'
K3 插入单据,以其他出库为例
最新推荐文章于 2022-11-07 15:42:20 发布