跟踪语句_业务单据_BOM

select * from t_TableDescription where Ftablename like '%ICBOM%'
select * from t_FieldDescription where FTableID=250000 order by FFieldName
select * from t_FieldDescription where FTableID=250001 order by FFieldName

SELECT FErpClsID FROM t_ICItem WHERE FItemID= 39420

SELECT * FROM ICBomGroup WHERE  FInterID=1052

declare @p2 int
set @p2=1148
exec GetICMaxNum 'ICBom',@p2 output,1,16394
select @p2

INSERT INTO ICBomChild 
(FInterID,FEntryID,FBrNo,FItemID,FAuxPropID,
FUnitID,FMaterielType,FMarshalType,FQty,FAuxQty,
FBeginDay,FEndDay,FPercent,FScrap,FPositionNo,
FItemSize,FItemSuite,FOperSN,FOperID,FMachinePos,
FOffSetDay,FBackFlush,FStockID,FSPID,FNote,
FNote1,FNote2,FNote3,FPDMImportDate,FDetailID,FCostPercentage)  
SELECT 1148,1,'0',42494,0,
39265,371,385,1,1,
'1900-01-01','2100-01-01',100,0,'',
'','',0,0,'',
0,1059,0,0,'',
'','','','','{D4C30E3E-F017-4764-8C4F-7E92CE04E049}',0 

INSERT INTO ICBom
(FInterID,FBomNumber,FBrNo,FTranType,FCancellation,
FStatus,FVersion,FUseStatus,FItemID,FUnitID,
FAuxPropID,FAuxQty,FYield,FNote,FCheckID,
FCheckDate,FOperatorID,FEntertime,FRoutingID,FBomType,
FCustID,FParentID,FAudDate,FImpMode,FPDMImportDate,
FBOMSkip,FUseDate,FPrintCount) 
SELECT 1148,'BOM000010','0',50,0,
0,'','1073',39420,'39249',
0,1,100,'',16394,
'2018-05-02',16394,'2018-05-02',0,0,
0,1052,Null,0,Null,
'1059',Null,0

UPDATE ICBom SET FOperatorID=16394,FEnterTime=Convert(Varchar(10),Getdate(),120) WHERE FInterID=1148

 Update t1 set t1.FQty=cast(t1.FAuxQty as decimal(28,15)) * cast( isnull(t3.FCoefficient,1)  + cast(isnull(t3.FScale,0) as float) as decimal(28,15) )
 from ICBOMChild  t1,t_MeasureUnit t3
 Where t3.FItemID = t1.FUnitID and t1.FInterID=1148

 IF EXISTS (SELECT 1 FROM ICBOM WHERE FInterId = 1148 AND FBomtype <> 0) 
    UPDATE ICBomChild SET FBeginDay = '1900-01-01', FEndDay = '2100-01-01' WHERE FInterID = 1148

    UPDATE d SET FHasChar=CASE WHEN LEN(ISNULL(CONVERT(NVARCHAR(128),s.FDetailID),''))=0 THEN 0 ELSE 1 END FROM ICBOMChild d 
LEFT JOIN ICPlan_BOMChildChar s ON s.FDetailID=d.FDetailID
WHERE d.FInterID=1148

UPDATE ICBOMChild SET FPDMImportDate = NULL  FROM ICBOM WHERE ICBOM.FInterID=ICBOMChild.FInterID AND ICBOM.FBomNumber='BOM000010' AND ICBOMChild.FPDMImportDate = '' 
View Code

相关文章:

  • 2021-03-27
  • 2021-10-05
  • 2021-08-29
  • 2021-12-24
  • 2021-08-07
  • 2021-07-05
  • 2021-11-16
  • 2021-11-12
猜你喜欢
  • 2021-12-31
  • 2021-09-26
  • 2021-12-18
  • 2021-12-12
  • 2022-01-01
  • 2021-10-29
  • 2021-11-04
  • 2021-10-19
相关资源
相似解决方案