open-insight/LSL2/STPROC/PRINT_WO_RELEASE.txt
Infineon\StieberD 7762b129af pre cutover push
2024-09-04 20:33:41 -07:00

342 lines
9.0 KiB
Plaintext

compile SUBROUTINE Print_WO_Release( WONo )
DECLARE FUNCTION SECURITY_CHECK, SET_PRINTER, GET_PRINTER, MSG, FIELDCOUNT, ENTID, REPOSITORY, PRINTER_SELECT
DECLARE FUNCTION OBJ_INSTALL
DECLARE SUBROUTINE SECURITY_ERR_MSG, ErrMsg
$INSERT SECURITY_RIGHTS_EQU
$INSERT OIPRINT_EQUATES
$INSERT MSG_EQUATES
$INSERT QUOTE_EQU
$INSERT ORDER_EQU
$INSERT ORDER_DET_EQU
$INSERT WO_LOG_EQU
$INSERT WO_MAT_EQUATES
$INSERT APPCOLORS
$INSERT COC_EQU
EQU PI$LEFT TO 1
EQU PI$TOP TO 2
EQU PI$RIGHT TO 3
EQU PI$BOTTOM TO 4
EQU PI$WIDTH TO 5
EQU PI$HEIGHT TO 6
EQU PI$SIZE TO 7
IF NOT(ASSIGNED(WONo)) THEN RETURN
WORec = XLATE('WO_LOG',WONo,'','X')
* * * PRINT SETUP * * *
PageInfo = ''
PageInfo<PI$LEFT> = 0.5 ;* Margins
PageInfo<PI$TOP> = 1.35
PageInfo<PI$RIGHT> = 0.5
PageInfo<PI$BOTTOM> = 0.50
PageSetup = 0 ;* 1 = Landscape mode
PrintSetup = 2 ;* 0 = Print to printer without Preview
stat = Set_Printer("INIT",'Printing','Work Order Release',PageInfo,PageSetup,PrintSetup)
font = 'Arial' ;* Font basics
font<2> = 10
font<4> = 0
stat = Set_Printer('FONTHEADFOOT', font)
stat = Set_Printer('FOOTER',"Page 'P' ":@VM:@VM:"'T' 'D'")
stat = Set_Printer('LINESTYLE', PS_SOLID:@FM:2)
stat = Set_Printer('LINE', -0.1:@FM:-1.2:@FM:7.5:@FM:-1.2, 1)
stat = Set_Printer('LINE', -0.1:@FM:-0.1:@FM:7.5:@FM:-0.1, 1)
location = -.15:@fm:-1.150:@fm:1.57:@fm:1
stat = Set_Printer('BMP',obj_Install('Get_Prop','ColorBMP'),location, 0,1)
* * * * Added 10/8/2015 JCH - Updated 'CONFIG','COMPANY' * * * *
InstDat = obj_Install('Get_Prop','Company':@FM:'Division')
Company = InstDat<1>
Division = InstDat<2>
font = 'Arial'
font<2> = '12' ;* Big type
font<4> = 1 ;* Bold on
font<5> = 0 ;* Italics
stat = Set_Printer('TEXTXY',Company,5.7:@FM:-1.15,font,1)
stat = Set_Printer('TEXTXY',Division,5.7:@FM:-0.970,font,1)
font<2> = 10 ;* 10 point font
font<4> = 0 ;* Bold off
font<5> = 0 ;* Italics Off
stat = Set_Printer('TEXTXY',obj_Install('Get_Prop','Address'), 5.7:@fm:-0.775, font,1)
stat = Set_Printer('TEXTXY',obj_Install('Get_Prop','CSZC'), 5.7:@fm:-0.625, font,1)
stat = Set_Printer('TEXTXY','Tel: ':obj_Install('Get_Prop','Phone'), 5.7:@fm:-0.475, font, 1)
stat = Set_Printer('TEXTXY','FAX: ':obj_Install('Get_Prop','FAX'), 5.7:@fm:-0.325, font, 1)
* * * * End of changes 10/8/2015 JCH * * * *
stat = Set_Printer('TEXTXY','Work Order No: ':WONo,2.7:@FM:-0.325,font,1)
font<2> = '18' ;* Big type
font<4> = 1 ;* Bold on
font<5> = 1 ;* Italics
stat = Set_Printer('TEXTXY','Work Order Release',2.2:@FM:-0.80,font,0)
font<2> = '10'
font<4> = 0 ;* Bold off
font<5> = 0 ;* Italics Off
stat = Set_Printer('FONT', font) ;* Problem with default font getting set by 'TEXTXY' messages above
WORec = XLATE('WO_LOG',WONo,'','X')
CustNo = WORec<WO_LOG_CUST_NO$>
OrderNo = WORec<WO_LOG_ORDER_NO$>
CustBillToInfo = XLATE('ORDER',OrderNo,'BILL_TO_INFO','X')
CustShipToInfo = XLATE('ORDER',OrderNo,'SHIP_TO_INFO','X')
OrderRec = XLATE('ORDER',OrderNo,'','X')
VisionOrderNo = OrderRec<ORDER_VISION_ORDER_NO$>
PONo = OrderRec<ORDER_PO_NO$>
POLine = OrderRec<ORDER_PO_LINE$>
PORel = OrderRec<ORDER_PO_REL$>
WoOrderItems = WORec<WO_LOG_ORDER_ITEM$>
Quote = XLATE('ORDER_DET',OrderNo:'*':WoOrderItems<1,1>,ORDER_DET_QUOTE_NO$,'X') ;*
IF POLine NE '' THEN
PONo := CRLF$:'Line ':POLine
END
IF PORel NE '' THEN
PONo := CRLF$:'Rel ':PORel
END
SWAP @TM WITH CRLF$ IN CustBillToInfo
SWAP @TM WITH CRLF$ IN CustShipToInfo
CycleTime = WORec<WO_LOG_CYCLE_TIME$>
BEGIN CASE
CASE CycleTime = 'P' ; CycleTime = '2 Days'
CASE CycleTime = 'E' ; CycleTime = '7 Days'
CASE CycleTime = 'F' ; CycleTime = '14 Days'
CASE 1 ; CycleTime = 'Error'
END CASE
CommitDt = OCONV(WORec<WO_LOG_COMMIT_DATE$>,'D4/')
CustShipDt = OCONV(WORec<WO_LOG_CUST_SHIP_DATE$>,'D4/')
RelBy = OCONV(WORec<WO_LOG_REL_BY$,'[XLATE_CONV,LSL_USERS*FIRST_LAST]')
WOMatKeys = WORec<WO_LOG_WO_MAT_KEY$>
WOStepKeys = WORec<WO_LOG_WO_STEP_KEY$>
WOStepRDSKeys = ''
WOStepCnt = COUNT(WOStepKeys,@VM) + (WOStepKeys NE '')
FOR I = 1 TO WOStepCnt
WOStepKey = WOStepKeys<1,I>
WOStepRDSKeys<I> = XLATE('WO_STEP',WOStepKey,6,'X')
NEXT I
CassDetail = ''
FOR I = 1 TO COUNT(WOMatKeys,@VM) + (WOMatKeys NE '')
CassNo = FIELD(WOMatKeys<1,I>,'*',2)
WOMatRec = XLATE('WO_MAT',WONo:'*':CassNo,'','X')
IF NOT(ASSIGNED(RxDTM)) THEN
RxDTM = OCONV(WOMatRec<WO_MAT_RX_DTM$>,'DT4/^HS')
RelDTM = OCONV(WOMatRec<WO_MAT_REL_DTM$>,'DT4/^HS')
RelBy = OCONV(WOMatRec<WO_MAT_REL_BY$>,'[XLATE_CONV,LSL_USERS*FIRST_LAST]')
END
CassLine = CassNo:@VM
CassLine := WOMatRec<WO_MAT_LOT_NO$>:@VM
CassLine := WOMatRec<WO_MAT_WAFER_QTY$>:@VM
CassLine := WOMatRec<WO_MAT_CUST_PART_NO$>:@VM
CassLine := WOMatRec<WO_MAT_SUB_PART_NO$>:@VM
FOR N = 1 TO WOStepCnt
CassLine := WOStepRDSKeys<N,I>:@VM
NEXT N
IF CassLine[-1,1] = @VM THEN CassLine[-1,1] = ''
CassDetail<I> = CassLine
NEXT I
WOSteps = ''
FOR I = 1 TO COUNT(WOStepKeys,@VM) + (WOStepKeys NE '')
WOStepKey = WOStepKeys<1,I>
WOSteps<1,I> = FIELD(WOStepKey,'*',2)
NEXT I
WOStepPSNs = XLATE('WO_STEP',WOStepKeys,1,'X')
WOStepDescs = XLATE('WO_STEP',WOStepKeys,8,'X')
SWAP @VM WITH CRLF$ IN WOSteps
SWAP @VM WITH CRLF$ IN WOStepPSNs
SWAP @VM WITH CRLF$ IN WOStepDescs
* Basic Order Information
colHeader = 'Order No' ; colFormat = '^1440'
colHeader<1,2> = 'Vision Order No' ; colFormat<1,2> = '^1440'
colHeader<1,3> = 'Quote No' ; colFormat<1,3> = '^1440'
colHeader<1,4> = 'PO No' ; colFormat<1,4> = '^1800'
colHeader<1,5> = 'Step No' ; colFormat<1,5> = '^720'
colHeader<1,6> = 'PSN' ; colFormat<1,6> = '^720'
colHeader<1,7> = 'Step Description' ; colFormat<1,7> = '<3240'
colData = OrderNo
colData<1,2> = VisionOrderNo
colData<1,3> = Quote
colData<1,4> = PONo
colData<1,5> = WOSteps
colData<1,6> = WOStepPSNs
colData<1,7> = WOStepDescs
font = 'Arial' ;* Font basics
font<2> = 10
font<4> = 1 ;* Bold
font<5> = 0 ;* Italic Off
stat = Set_Printer('FONT',font)
IF stat < 0 THEN GOTO OIPrintErr
stat = Set_Printer('ADDTABLE', colFormat,colHeader,'',LTGREY$,'',0,7) ;* Print column headings bold w/grey background
font<4> = 0 ;* Bold off
stat = Set_Printer('FONT',font)
stat = Set_Printer('ADDTABLE',colFormat,'',colData,LTGREY$,'',1,7) ;* Print column data
stat = Set_Printer('TEXT')
colHeader = 'Received' ; colFormat = '^2520'
colHeader<1,2> = 'Released' ; colFormat<1,2> = '^2520'
colHeader<1,3> = 'Released By' ; colFormat<1,3> = '^1980'
colHeader<1,4> = 'Cycle Time' ; colFormat<1,4> = '^1260'
colHeader<1,5> = 'Commit Dt' ; colFormat<1,5> = '^1260'
colHeader<1,6> = 'Cust Ship Dt' ; colFormat<1,6> = '^1260'
colData = RxDTM
colData<1,2> = RelDTM
colData<1,3> = RelBy
colData<1,4> = CycleTime
colData<1,5> = CommitDt
colData<1,6> = CustShipDt
font<4> = 0 ;* Bold
stat = Set_Printer('FONT',font)
stat = Set_Printer('ADDTABLE', colFormat,colHeader,'',LTGREY$,'',0,7) ;* Print column headings bold w/grey background
font<4> = 0 ;* Bold off
stat = Set_Printer('FONT',font)
stat = Set_Printer('ADDTABLE',colFormat,'',colData,LTGREY$,'',1,7) ;* Print column data
stat = Set_Printer('TEXT')
* Bill to and Ship to Information *
colHeader = 'Bill To' ; colFormat = '<5400'
colHeader<1,2> = 'Ship To' ; colFormat<1,2> = '<5400'
colData = CustBillToInfo
colData<1,2> = CustShipToInfo
font<2> = 10 ;* 10 point
font<4> = 0 ;* Bold
stat = Set_Printer('FONT',font)
stat = Set_Printer('ADDTABLE',colFormat,colHeader,'',LTGREY$,'',0,7)
font<4> = 0 ;* Bold
stat = Set_Printer('FONT',font)
stat = Set_Printer('ADDTABLE',colFormat,'',colData,LTGREY$,'',1,7)
stat = Set_Printer('TEXT')
stat = Set_Printer('TEXT')
* RDS Information *
colHeader = 'Cass':CRLF$:'No' ; colFormat = '^720'
colHeader<1,2> = 'Lot No' ; colFormat<1,2> = '<2880'
colHeader<1,3> = 'Wafer':CRLF$:'Qty' ; colFormat<1,3> = '>720'
colHeader<1,4> = 'Part No' ; colFormat<1,4> = '<1800'
colHeader<1,5> = 'Substrate PN' ; colFormat<1,5> = '<1800'
FOR I = 6 TO WOStepCnt + 5
colHeader<1,I> = 'WO Step ':I-5:CRLF$:'RDS No' ; colFormat<1,I> = '^1440'
NEXT I
colData = CassDetail
font<2> = 10 ;* 10 point
font<4> = 1 ;* Bold
stat = Set_Printer('FONT',font)
stat = Set_Printer('ADDTABLE','^10800','C a s s e t t e D e t a i l','','','',0,7)
font<4> = 0 ;* Bold
stat = Set_Printer('FONT',font)
stat = Set_Printer('ADDTABLE', colFormat,colHeader,'',LTGREY$,'',0,7) ;* Print column headings bold w/grey background
font<4> = 0 ;* Bold off
stat = Set_Printer('FONT',font)
stat = Set_Printer('ADDTABLE',colFormat,'',colData,LTGREY$,'',1,7) ;* Print column data
Void = set_printer( 'TEXT', '' )
Void = set_printer( 'TEXT', '' )
Void = Set_Printer('TERM')
RETURN
* * * * * * *
OIPrintErr:
* * * * * * *
ErrMsg(ErrorTitle:@SVM:ErrorMsg)
ErrMsg(ErrorTitle:@SVM:'Set_Printer returned errorcode ':stat)
stat = Set_Printer('TERM',1)
RETURN