added LSL2 stored procedures

This commit is contained in:
Infineon\StieberD 2024-03-25 14:46:21 -07:00
parent 09f1a66046
commit c667dd56eb
1655 changed files with 527967 additions and 0 deletions

View File

@ -141,3 +141,4 @@ Service GetComputerDomain()
end service

139
LSL2/STPROC/AC_RPT1.txt Normal file
View File

@ -0,0 +1,139 @@
compile function AC_RPT1()
begin condition
pre:
post:
end condition
declare function getprinterlist, getprofilestring, writeprofilestring, extdevicemode
declare function msg, set_property, send_event, dialog_box, utility, get_property
declare function set_printer, Printer_Select
declare subroutine rlist, or_view, activate_save_select, yield, ac_rpt1_prn
$insert rlist_equates
$insert msg_equates
Params = dialog_box( 'AC_RPT1', @window, '*CENTER' )
if Params = 'CANCEL' or Params = '' then
return 0
end
open 'SYSLISTS' to SysListsTable else
MsgInfo = ''
MsgInfo<mcol$> = -2
MsgInfo<mrow$> = -2
MsgInfo<mtext$> = 'Unable to open SYSLISTS...'
Void = msg( '', MsgInfo )
return 0
end
ListsId = 'AC_RPT1*':@station
write '' on SysListsTable, ListsId else
MsgInfo = ''
MsgInfo<mcol$> = -2
MsgInfo<mrow$> = -2
MsgInfo<mtext$> = 'Unable to clear SYSLISTS ':ListsId:'...'
Void = msg( '', MsgInfo )
return 0
end
convert '*' to @fm in Params
EntryDateFrom = Params<1>
EntryDateThru = Params<2>
Custs = Params<3>
Open = Params<4>
Closed = Params<5>
DirToPrinter = Params<6>
Stat = utility( 'CURSOR', 'H' )
Stmt = 'SELECT ANNUAL_CONTRACTS BY CUST_NAME'
RestStmt = ''
if EntryDateFrom and EntryDateThru then
RestStmt := ' WITH ENTRY_DATE FROM ':QUOTE(EntryDateFrom):' TO ':QUOTE(EntryDateThru)
end else
if EntryDateFrom then
RestStmt := " WITH ENTRY_DATE GE ":QUOTE(EntryDateFrom)
end
if EntryDateThru then
RestStmt := " WITH ENTRY_DATE LE ":QUOTE(EntryDateThru)
end
end
if Custs then
swap @vm with "' '" in Custs
Custs = "'":Custs:"'"
if RestStmt then
RestStmt := ' AND WITH CUST_NO = ':Custs
end else
RestStmt := ' WITH CUST_NO = ':Custs
end
end
if Open then
if RestStmt then
RestStmt := ' AND WITH STATUS = "O"'
end else
RestStmt := ' WITH STATUS = "O"'
end
end
if Closed then
if RestStmt then
RestStmt := ' AND WITH STATUS = "C"'
end else
RestStmt := ' WITH STATUS = "C"'
end
end
Stmt := RestStmt
rlist( Stmt, target_savelist$, ListsId, '', '' )
activate_save_select( ListsId )
if @reccount then
Cmd = "LIST ANNUAL_CONTRACTS JUSTLEN 4 CUST_NAME JUSTLEN 30 PO JUSTLEN 18 "
Cmd:= "STATUS JUSTLEN 6 TOT_CONTRACT_AMOUNT TOT_REL_AMOUNT BALANCE "
Cmd:= "HEADING ":'"':" Annual Contracts by Company 'D' 'T' PAGE # 'PPL'":'"'
if DirToPrinter = 'Yes' then
PrintPath = Printer_Select('',1) ;* Get default printer path
Void = set_printer( 'INIT', '', '', '':@fm:1.25, 1, '',PrintPath )
ac_rpt1_prn( '' )
Void = set_printer( 'TERM' )
Void = set_printer( 'INIT', '', '', '', 0, '' )
Void = set_printer( 'TERM' )
end else
or_view( '', Cmd )
Void = set_property( 'ORPRV.PRINT', 'ENABLED', 0 )
WinId = 'ORPRV'
loop
while get_property( WinId, 'HANDLE' )
yield()
repeat
ToPrint = ''
MsgInfo = ''
MsgInfo<mtext$> = 'Do you want to print this report?'
MsgInfo<micon$> = '?'
MsgInfo<mtype$> = 'BNY'
MsgInfo<mcol$> = -2
MsgInfo<mrow$> = -2
MsgInfo<mdefbtn$> = 2 ;* default to no
ToPrint = msg( @window, MsgInfo )
if ToPrint then
activate_save_select( ListsId )
Void = set_printer( 'INIT', '', '', '':@fm:1.25, 1, '' )
ac_rpt1_prn( '' )
Void = set_printer( 'TERM' )
Void = set_printer( 'INIT', '', '', '', 0, '' )
Void = set_printer( 'TERM' )
end
end
end else
MsgInfo = ''
MsgInfo<mcol$> = -2
MsgInfo<mrow$> = -2
MsgInfo<mtext$> = 'NO Records meeting your date criteria!!'
MsgInfo<micon$> = '!'
Void = MSG( '', MsgInfo )
end
write '' on SysListsTable, ListsId else
MsgInfo = ''
MsgInfo<mcol$> = -2
MsgInfo<mrow$> = -2
MsgInfo<mtext$> = 'Unable to clear SYSLISTS ':ListsId:'...'
Void = msg( '', MsgInfo )
return 0
end
return 0

139
LSL2/STPROC/AC_RPT1_PRN.txt Normal file
View File

@ -0,0 +1,139 @@
SUBROUTINE AC_RPT1_PRN(Dummy)
Dummy = ''
* LIST ANNUAL_CONTRACTS JUSTLEN 4 CUST_NAME JUSTLEN 30 PO JUSTLEN 18 STATUS JUSTLEN 6 TOT_CONTRACT_AMOUNT TOT_REL_AMOUNT BALANCE HEADING " Annual Contracts by Company 'T' PAGE # 'PPL'"
*
DECLARE FUNCTION SET_STATUS, SET_FSERROR, SEND_INFO, SET_ROWDEF, SET_PRINTER
* HEADING/FOOTING
TheHeader = " Annual Contracts by Company 'D' 'T' PAGE # 'P'"
HeadPos = '.75,2.5,1.25,1,1.5,1.5,1.5'
convert ',' to @fm in HeadPos
ColHeader = "Key" : @vm : "Customer" : @vm : "PO" : @vm : "Status" : @vm : "Contract Amount" : @vm : "Release Amount":@vm: "Balance"
ColHeader<-1> = str( '-', 5 ):@vm:str( '-', 25 ):@vm:str( '-', 15 ):@vm:str( '-', 15 ):@vm:str( '-', 17 ):@vm:str( '-', 17 ):@vm:str( '-', 17 )
Void = set_printer( 'FONTHEADFOOT' )
Void = set_printer( 'HEADER', TheHeader, HeadPos, ColHeader )
*
@RECCOUNT=0
FIRST.PASS=1
LAST.RECORD=0
READERR=0
*
* OPEN DICT AND DATA FILES
*
OPEN "DICT","ANNUAL_CONTRACTS" TO @DICT ELSE RETURN
OPEN "","ANNUAL_CONTRACTS" TO FILE.IN ELSE RETURN
*
* MAKE COLUMN HEADING
*
READRECORD:
*
*
READNEXT @ID, WHICH.VALUE ELSE
IF STATUS() GT 0 THEN
STATX = SET_FSERROR()
RETURN
END
IF @FILE.ERROR<1> EQ 421 THEN
STATX = SET_FSERROR()
GOTO READRECORD
END
IF @FILE.ERROR<1> NE 111 THEN
@ANS = @FILE.ERROR<1>
STATX = set_printer( 'TEXT', {RLIST_TEXT_4} )
READERR += 1
GOTO READRECORD
END
LAST.RECORD=1
END
@FILE.ERROR.MODE=0
*
S.ATID = @ID
*
IF FIRST.PASS AND LAST.RECORD THEN
STATX = set_printer( 'TEXT', {RLIST_TEXT_2} )
RETURN
END
*
IF LAST.RECORD THEN GOTO BREAKS
*
IF @REDUCTION.DONE THEN
READO @RECORD FROM FILE.IN, @ID ELSE
@FILE.ERROR.MODE = 0
IF STATUS() GT 0 THEN
STATX = SET_FSERROR()
RETURN
END
IF @FILE.ERROR<1> NE 100 THEN
READERR += 1
END
GOTO READRECORD
END
END
*
@RECCOUNT += 1
*
*
* CALCULATE VALUE(S) FOR COLUMN(S)
*
S.ATID={@ID}
I.ATID=S.ATID
S.CUSTULNAME={CUST_NAME}
I.CUSTULNAME=S.CUSTULNAME
S.PO={PO}
I.PO=S.PO
S.STATUS={STATUS}
I.STATUS=S.STATUS
S.TOTULCONTRACTULAMOUNT={TOT_CONTRACT_AMOUNT}
I.TOTULCONTRACTULAMOUNT=S.TOTULCONTRACTULAMOUNT
S.TOTULRELULAMOUNT={TOT_REL_AMOUNT}
I.TOTULRELULAMOUNT=S.TOTULRELULAMOUNT
S.BALANCE={BALANCE}
I.BALANCE=S.BALANCE
*
*
IF FIRST.PASS THEN
FIRST.PASS=0
GOTO DETAIL
END
*
*
BREAKS:
*
*
* PERFORM LAST RECORD OUTPUT IF DONE
*
IF LAST.RECORD THEN
IF READERR THEN
@ANS=READERR
STATX = set_printer( 'TEXT', {RLIST_TEXT_3} )
END
RETURN
END
*
DETAIL:
*
* DO CONVERSIONS IF ANY
*
IF S.STATUS NE "" THEN S.STATUS=OCONV(S.STATUS,"[AC_STATUS_CONV]")
IF S.TOTULCONTRACTULAMOUNT NE "" THEN S.TOTULCONTRACTULAMOUNT=OCONV(S.TOTULCONTRACTULAMOUNT,"MD2,$")
IF S.TOTULRELULAMOUNT NE "" THEN S.TOTULRELULAMOUNT=OCONV(S.TOTULRELULAMOUNT,"MD2,$")
IF S.BALANCE NE "" THEN S.BALANCE=OCONV(S.BALANCE,"MD2,$")
*
* PRINT DETAIL LINE
*
PRINTLINE = ""
PRINTLINE := S.ATID:@vm
PRINTLINE := S.CUSTULNAME:@vm
PRINTLINE := S.PO:@vm
PRINTLINE := S.STATUS:@vm
PRINTLINE := S.TOTULCONTRACTULAMOUNT:@vm
PRINTLINE := S.TOTULRELULAMOUNT:@vm
PRINTLINE := S.BALANCE:@vm
TableColInfo = '<+1080':@vm:'<+3600':@vm:'<+1800':@vm:'<+1440':@vm:'>+2160':@vm:'>+2160':@vm:'>+2160'
Void = set_printer( 'ADDTABLE', TableColInfo, '', PRINTLINE, '', '', 1, TB_NONE )
*STATX = set_printer( 'TEXTCOL', PRINTLINE )
*
*
GOTO READRECORD
*
END

166
LSL2/STPROC/AC_SRPT1.txt Normal file
View File

@ -0,0 +1,166 @@
compile function AC_SRPT1()
begin condition
pre:
post:
end condition
declare function msg, set_property, send_event, dialog_box, utility, get_property, PrintSetup, Set_Printer
declare function set_printer, obj_Install
declare subroutine rlist, or_view, activate_save_select, yield
declare subroutine order_srpt1
$insert rlist_equates
$insert msg_equates
$insert oiprint_equates
$insert rpt_cfg_equ
$INSERT PRINTSETUP_EQUATES
TimeX = Oconv(Time(),'MTS')
CrLf = Char(13):Char(10)
CurDte = OCONV(Date(),"D4/")
ReportID = "AC001_SRPTCFG"
ReportControl = "AC_SRPT1"
TableName = 'ANNUAL_CONTRACTS'
open 'CONFIG' to ConfigTable else
Void = msg( '', 'Unable to open CONFIG...' )
return 0
end
Read SRptConfig From ConfigTable,ReportID Else
Void = msg( '', 'Unable to read ': ReportID:' From CONFIG table!' )
return 0
End
Params = dialog_box( ReportControl, @window, '*CENTER' )
if Params = 'CANCEL' or Params = '' then
return 0
end
open 'SYSLISTS' to SysListsTable else
Void = msg( '', 'Unable to open SYSLISTS...' )
return 0
end
ListsId = ReportControl:'*':@station
write '' on SysListsTable, ListsId else
Void = msg( '', 'Unable to clear SYSLISTS ':ListsId:'...' )
return 0
end
convert '*' to @fm in Params
EntryDateFrom = Params<1>
EntryDateThru = Params<2>
Custs = Params<3>
Open = Params<4>
Closed = Params<5>
Stat = utility( 'CURSOR', 'H' )
WithStmt = 'SELECT ':TableName:' '
WthSwt = 0
Begin Case
Case EntryDateFrom and EntryDateThru
WthSwt = 1
WithStmt := " WITH ENTRY_DATE FROM '": EntryDateFrom:"' TO '":EntryDateThru: "' "
TtlLin2 = 'Entry Dates: From ':EntryDateFrom:' To ':EntryDateThru
Case EntryDateFrom
WthSwt = 1
WithStmt := " WITH ENTRY_DATE GE '":EntryDateFrom:"' "
TtlLin2 = 'Entry Dates: From ':EntryDateFrom:' To Latest'
Case EntryDateThru
WthSwt = 1
WithStmt := " WITH ENTRY_DATE LE '":EntryDateThru:"' "
TtlLin2 = 'Entry Dates: From Earliest To ':EntryDateThru
Case 1
TtlLin2 = 'Entry Dates: ALL'
End Case
If Custs then
CustCnt = Count(@vm,Custs)
If CustCnt > 20 Then
TtlLin3 = 'Customers: More Than 20 Selected'
End Else
TtlLin3 = Custs
swap @vm with ", " in TtlLin3
TtlLin3 = 'Customers: ':TtlLin3
End
swap @vm with "' '" in Custs
Custs = "'":Custs:"'"
If WthSwt Then WithStmt := ' AND '
WithStmt := ' WITH CUST_NO = ':Custs
WthSwt = 1
end else
TtlLin3 = 'Customers: ALL'
end
If Open then
If WthSwt Then WithStmt := ' AND '
WithStmt := ' WITH STATUS = "O" '
end
If Closed then
If WthSwt Then WithStmt := ' AND '
WithStmt := ' WITH STATUS = "C" '
end
rlist( WithStmt, target_savelist$, ListsId, '', '' )
activate_save_select( ListsId )
Script = SRptConfig<SlistScript$>
RptWdt = SRptConfig<Width$>
Title = obj_Install('Get_Prop','Company'):' ':SRptConfig<Title$>
Margin = INT((RptWdt - LEN(Title))/2)
LMargin = Margin - 10 ;* 10 equals length of the date
RMargin = Margin - 8 ;* 8 equals length of 'Page....'
Title = OCONV(Date(),'D4/'):SPACE(LMargin):Title:SPACE(RMargin):"Page'PP''L'"
SWAP '~Title~' WITH Title IN Script
TitleLine2 = TtlLin2
TitleLine3 = TtlLin3
TitleLine4 = ''
IF TitleLine2 NE '' THEN
Margin = INT((RptWdt - LEN(TitleLine2))/2)
LMargin = Margin - 7 ;* 7 equals length of time (12:15PM)
RMargin = Margin
TitleLine2 = OCONV(Time(),'MTH'):SPACE(LMargin):TitleLine2:SPACE(RMargin)
SWAP '~SecondTitleLine~' WITH TitleLine2 IN Script
END ELSE
SWAP '~SecondTitleLine~' WITH '' IN Script
END
IF TitleLine3 NE '' THEN
Margin = INT((RptWdt - LEN(TitleLine3))/2)
SWAP '~ThirdTitleLine~' WITH "'L'":TitleLine3 IN Script
END ELSE
SWAP '~ThirdTitleLine~' WITH '' IN Script
END
IF TitleLine4 NE '' THEN
Margin = INT((RptWdt - LEN(TitleLine4))/2)
SWAP '~FourthTitleLine~' WITH "'L'":TitleLine4 IN Script
END ELSE
SWAP '~FourthTitleLine~' WITH '' IN Script
END
Script := ' FOOTING "* Status O = Open; C = Closed" '
* Added after upgrade to OI4.13a to reset default printer in OIPI32 engine.
DefaultPrinter = ''
PrintCount = PrintSetup(PRN_GET$,'',Printers,DefaultPrinter)
CONVERT ',' TO @FM IN DefaultPrinter
DefPrintPath = DefaultPrinter<1>:@FM:DefaultPrinter<3>
Void = set_printer( 'INIT', '', '', .63:@fm:.63:@fm:.25:@fm:'', 0,'',DefPrintPath )
Void = Set_Printer('TERM')
call slist( Script )
Void = utility( 'CURSOR', 'A' )
write '' on SysListsTable, ListsId else
Void = msg( '', 'Unable to clear SYSLISTS ':ListsId:'...' )
return 0
end
RETURN 0

View File

@ -0,0 +1,28 @@
SUBROUTINE AC_STATUS_CONV(ConvType, DataIo, SubrLabel, ReturnedValue)
*
begin condition
pre:
post:
end condition
$insert logical
equ valid$ to 0 ;* successful
equ invalid_msg$ to 1 ;* bad data - print error message window
equ invalid_conv$ to 2 ;* bad conversion - " "
equ invalid_nomsg$ to 3 ;* bad but do not print the error message window
status() = Valid$
begin case
case ConvType = 'ICONV'
ReturnedValue = DataIo
case ConvType = 'OCONV'
begin case
case DataIo = 'O'
ReturnedValue = 'Open'
case DataIo = 'C'
ReturnedValue = 'Closed'
end case
case otherwise$
status() = invalid_msg$
end case
return

View File

@ -0,0 +1,110 @@
Function ADCSVR_Events(CtrlEntId, Event, Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10)
/********************************************************************************
*********************************************************************************/
#pragma precomp SRP_PreCompiler
#Window ADCSVR
$INSERT ENVIRON_CONSTANTS
$INSERT LOGICAL
EQU STOP$ TO 0
EQU START$ TO 1
EQU CRLF$ TO \0D0A\
ErrTitle = 'Error in Comm_Dialog_ADCSVR routine'
DECLARE SUBROUTINE Center_Window, StatusLine, Set_Property, End_Dialog, Send_Event, Set_Status, Adios
DECLARE SUBROUTINE ErrMsg, Send_Message, obj_Tables, Post_Event, ShowWindow, obj_ADCSVR, Yield, Utility
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, FindWindow
GoToEvent Event for CtrlEntId
Return RetVal else 1
//////////////////////////////////////////////////////////////////////////////
// Events
//////////////////////////////////////////////////////////////////////////////
Event WINDOW.CREATE(CreateParam)
Set_Status(0)
otParms = 'SYSOBJ':@RM:'ADC_SERVER'
obj_Tables('LockRec',otParms) ;* Places lock on fictional record
IF Get_Status(errCode) THEN
ErrorMsg = ErrTitle:@SVM:'Another ADC server is already running.'
ErrMsg(ErrorMsg)
Post_Event(@WINDOW,'CLOSE')
end else
Set_Property(@WINDOW,'@ADC_SERVER',STOP$) ;* Set ADC server property '@ADC_SERVER' to stop
GoSub StartStop
end
end event
Event WINDOW.TIMER()
Yield(); Yield(); Yield(); Yield(); Yield(); Yield(); Yield(); Yield(); Yield()
StartStop = Get_Property(@WINDOW,'@ADC_SERVER')
IF (StartStop = START$) THEN
obj_ADCSVR('MetrologyData','')
END
end event
Event WINDOW.CLOSE(CancelFlag)
otParms = 'SYSOBJ':@RM:'ADC_SERVER'
obj_Tables('LockRec',otParms) ;* Places lock on fictional record
Set_Status(0)
obj_Tables('UnlockRec',otParms) ;* Removes lock on fictional record
Utility('DESTROY', 'SYSTEM')
end event
Event START_STOP_BUTTON.CLICK()
GoSub StartStop
end event
//////////////////////////////////////////////////////////////////////////////
// Internal GoSubs
//////////////////////////////////////////////////////////////////////////////
**********
StartStop:
**********
StartStop = Get_Property(@WINDOW:'.START_STOP_BUTTON','TEXT')
IF (StartStop = 'Stop ADC Server') THEN
* ADC server is running
Set_Property(@WINDOW, 'TIMER', '')
Set_Property(@WINDOW,'@ADC_SERVER',STOP$) ;* Turn off ADC server
Set_Property(@WINDOW:'.START_STOP_BUTTON','TEXT', 'Start ADC Server')
Set_Property(@WINDOW:'.CLOSE_BUTTON','ENABLED',1)
END ELSE
Interval = Get_Property(@Window : '.INTERVAL', 'INVALUE')
If Interval EQ '' then
Interval = 5
Set_Property(@WINDOW:'.INTERVAL','INVALUE',Interval)
end
Set_Property(@WINDOW, 'TIMER', Interval * 1000) ;* Set timer event to 5000 msecs (5 seconds) to check for shutdown time.
Set_Property(@WINDOW:'.START_STOP_BUTTON','TEXT', 'Stop ADC Server')
Set_Property(@WINDOW,'@ADC_SERVER',START$) ;* Start the ADC server process
Set_Property(@WINDOW:'.CLOSE_BUTTON','ENABLED',0)
END
return

View File

@ -0,0 +1,61 @@
Function AddIndexTransaction(Table, Column, OldRow, NewRow, RowId)
* Function from Sprezzatura's SENL for adding index transaction from a program
DECLARE SUBROUTINE FSMsg
TransactionRow = ""
SaveRec = @Record
SaveDict = @Dict
SaveId = @Id
Open "DICT." : Table To @Dict Then
@Id = RowId
@Record = OldRow
If Num(Column) Then
OldValue = @Record<Column>
End Else
OldValue = Calculate(Column)
End
@Record = NewRow
If Num(Column) Then
NewValue = @Record<Column>
End Else
NewValue = Calculate(Column)
End
TransactionRow := Column : @Fm : RowId : @fm : OldValue : @Fm : NewValue : @Fm
Open "!" : Table To vTable Then
Lock vTable, 0 Then
Read Update From vTable, 0 Else Update = @Fm
Update := TransactionRow
Write Update On vTable, 0 Then
Status = 1
End Else
Status = 0
End
Unlock vTable, 0 Else FSMsg()
End Else
Status = 0
End
End Else
Status = 0
End
End Else
Status = 0
End
@Id = SaveId
@Dict = SaveDict
@Record = SaveRecord
Return Status

View File

@ -0,0 +1,9 @@
compile function admin_user( UserToCheck )
begin condition
pre:
post:
end condition
$insert logical
$insert lsl_users_equ
Valid = xlate( 'LSL_USERS', UserToCheck, lsl_users_admin_user$, 'X' )
return Valid

59
LSL2/STPROC/AD_TEST.txt Normal file
View File

@ -0,0 +1,59 @@
COMPILE function AD_Test()
#pragma precomp SRP_PreCompiler
Declare function SRPLogonAPI_ValidateUser, RTI_LDAP_Groups_for_user, Datetime, Time, GetTickCount
Declare Subroutine Set_Property
Username = 'Ouellette'
Password = 'IndianSc0ut2019*'
/*Domain = 'INFINEON.COM'
*Domain = 'infineon.com'
start = Datetime()
test = SRPLogonAPI_ValidateUser(Username, Password, Domain)
ADGroups = RTI_LDAP_Groups_for_User(Username, Domain)
stop = Datetime()
timeToComplete = stop - start
*/
AccessLevel = -1 ; // Assume no access for now.
// Step 1 - Validate the username and password against one of the approved non-EC domains.
ValidUser = 0 ; // Assume not valid for now.
* Domains = 'na.infineon.com,na,infineon.com'
debug
* List =''
*i = 1
* Domains = 'MESSR001.infineon.com,MESSR002.infineon.com,MESSC001.NA.INFINEON.COM,MESSC002.NA.INFINEON.COM,LEOSR001.INFINEON.COM'
Username = 'Ouellette'
Domain = 'MESSR001.infineon.com'
Groups = RTI_LDAP_Groups_for_User(Username, Domain)
return
* ValidUser = SRPLogonAPI_ValidateUser(Username, Password, Domain)
* For Each Domain in Domains using ','
* Start = GetTickCount()
* ValidUser = SRPLogonAPI_ValidateUser(Username, Password, Domain)
* Stop = GetTickCount()
* Difference = Stop - Start
* List<i, 1> = Domain
* List<i, 2> = Difference
* i=i+1
*
* Next Domain
i = 1
For Each Domain in Domains using ','
Start = GetTickCount()
Groups = RTI_LDAP_Groups_for_User(Username, Domain)
Stop = GetTickCount()
Difference = Stop - Start
List<i, 3> = Difference
i=i+1
Next Domain
Set_Property(@Window : '.TABLE_1', 'LIST', List)
return 0

View File

@ -0,0 +1,35 @@
compile subroutine array_sort( Array, SortOrder, Justification )
begin condition
pre:
post:
end condition
declare function fieldcount
declare subroutine v119
$insert logical
NumFields = fieldcount( Array, @fm )
NumValues = fieldcount( Array<1>, @vm )
TmpSort = ''
for k = 1 to NumValues
Tvar = ''
for j = 1 TO NumFields
Tvar := Array<J,K>:@vm
next j
Tvar[-1,1] = ''
TmpSort<K> = Tvar
next k
convert @fm to @rm in TmpSort
convert @vm to @fm in TmpSort
TmpSort := @rm
v119('S', '', SortOrder, Justification, TmpSort, '')
convert @fm to @vm in TmpSort
convert @rm to @fm in TmpSort
TmpSort[-1,1] = ''
for j = 1 to NumValues
for k = 1 to NumFields
Array<k,j> = TmpSort<j,k>
next k
next j

107
LSL2/STPROC/AR_INV_EXP.txt Normal file
View File

@ -0,0 +1,107 @@
compile function ar_inv_exp(Params,Manual)
declare function msg, dialog_box, fieldcount
declare subroutine rlist,activate_save_select
$insert rlist_equates
$insert logical
$insert invoice_equ
$insert invoice_srl_equ
equ CrLf$ to char(13):char(10)
convert '*' to @fm in Params
FromDate = Params<1>
ThruDate = Params<2>
DosTable = Params<3>
open 'INVOICE' to InvoiceTable else
Void = msg( '', 'Unable to open INVOICE...' )
end
TableToUse = 'INVOICE'
oswrite '' on DosTable
Tstat = status()
if Tstat then
Err = 'Bad operating system filename'
Err<-1> = 'Access Denied'
Err<-1> = 'Disk or Directory full'
Err<-1> = 'Operating system error not defined elsewhere'
Err<-1> = 'Attempt to write a read only file'
Void = msg( '', Err<Tstat> )
return 0
end
osopen DosTable to DosTableVar else
Err = 'Bad operating system filename'
Err<-1> = 'Access Denied'
Err<-1> = 'File does not exist'
Err<-1> = 'Undefined error'
Void = msg( '', Err<status()> )
return 0
end
BytePos = 0
Cmd = "SELECT ":TableToUse:" BY SEQ WITH ENTRY_DATE FROM ":QUOTE(FromDate):" TO ":QUOTE(ThruDate)
rlist( Cmd, target_activelist$, '', '', '' )
*activate_save_select( 'BRYCE' )
*DEBUG
*USED WHEN ERROR DURING THE ENDOFMONTH
NumKeys = @reccount
Cnt = 0
if @reccount then
Cnt = 0
NumKeys = @reccount
Eof = false$
loop
readnext @id else Eof = true$
until Eof
read @record from InvoiceTable, @id else
Void = msg( '', 'Unable to read ':@id:' from ':TableToUse )
return 0
end
SalesTots = xlate( TableToUse, @id, 'GL_ACCT_TOTS', 'X' )
CustName = xlate( TableToUse, @id, 'CUST_NAME', 'X' )
InvoiceAmount = oconv( xlate( TableToUse, @id, 'INVOICE_AMOUNT', 'X' ), 'MD2,$' )
Scnt = fieldcount( SalesTots, @vm )
BlobOut = ''
for i = 1 to Scnt
ThisSalesTotLine = SalesTots<1,i>
ThisSalesTotLine = trim( ThisSalesTotLine )
if len( ThisSalesTotLine ) then
SalesCode = field( ThisSalesTotLine, ' ', 1 )
SalesCodeTot = field( ThisSalesTotLine, ' ', 2 )
swap 'CM' with 'C' in @id ;* DUE TO MAS90
BlobOut := quote(@id):',':quote(CustName):','
*TCustNo = '41'
*TCustNo = ''
*TCustNo := oconv( @record<invoice_cust_no$>, 'R(0)#7' )
BlobOut := quote(@record<invoice_cust_no$>):','
BlobOut := quote(oconv(@record<invoice_entry_date$>, 'D2/')):','
BlobOut := quote(oconv(@record<invoice_due_date$>, 'D2/')):','
BlobOut := quote(@record<invoice_po$>):','
BlobOut := quote(SalesCode):','
BlobOut := quote(SalesCodeTot):','
BlobOut := quote(InvoiceAmount):','
BlobOut := quote(oconv( @record<invoice_discount_amount$>, 'MD2,$' ) )
BlobOut := CrLf$
end
next i
osbwrite BlobOut on DosTableVar AT BytePos
Tstat = status()
if Tstat then
Err = 'Bad operating system filename'
Err<-1> = 'Access Denied'
Err<-1> = 'Disk or directory full'
Err<-1> = 'File does not exist'
Err<-1> = 'Undefined error'
Err<-1> = 'Attempt to write a read only file'
Err<-1> = 'Invalid beginning byte position'
Void = msg( '', Err<Tstat> )
return 0
end
BytePos += len( BlobOut )
Cnt += 1
Percent = oconv( iconv(Cnt/NumKeys, 'MD2'), 'MD0' ):'%'
Void = send_info( Percent:' Complete Exporting...' )
repeat
end else
if Manual then
Void = msg('', "NO Records meeting your date criteria!!")
end
end
osclose DosTableVar
return 0

View File

@ -0,0 +1,30 @@
SUBROUTINE ASSIGN_CAUSE_STATUS_CONV(ConvType, DataIo, SubrLabel, ReturnedValue)
*
begin condition
pre:
post:
end condition
$insert logical
equ valid$ to 0 ;* successful
equ invalid_msg$ to 1 ;* bad data - print error message window
equ invalid_conv$ to 2 ;* bad conversion - " "
equ invalid_nomsg$ to 3 ;* bad but do not print the error message window
status() = Valid$
begin case
case ConvType = 'ICONV'
ReturnedValue = DataIo
case ConvType = 'OCONV'
begin case
case DataIo = 'A'
ReturnedValue = 'Active'
case DataIo = 'I'
ReturnedValue = 'Inactive'
case Otherwise$
ReturnedValue = ''
end case
case otherwise$
status() = invalid_msg$
end case
return

13
LSL2/STPROC/AUDIT.txt Normal file
View File

@ -0,0 +1,13 @@
COMPILE Insert AUDIT
* Equates for COA table
EQU AUDIT_TABLENAME$ TO 0.1
EQU AUDIT_USERNAME$ TO 0.2
EQU AUDIT_DATE_TIME$ TO 0.3 ;* Record key is in parts 0.4 through 0.n
EQU AUDIT_ACTION$ TO 1 ;* New,Read, Write, Delete
EQU AUDIT_FIELDS$ TO 2 ;* Field name
EQU AUDIT_OLD_VALS$ TO 3 ;* Old values for each field
EQU AUDIT_NEW_VALS$ TO 4 ;* New values for each field
EQU AUDIT_ORG_RECORD TO 5 ;* complete record stored here on DELETE action

View File

@ -0,0 +1,209 @@
Subroutine Audit_Manager(ID, Table, CurrentRecord, OrigRecord, Activity)
/***********************************************************************************************************************
This program is proprietary and is not to be used by or disclosed to others, nor is it to be copied without written
permission from SRP Computer Solutions, Inc.
Name : Audit_Manager
Description : Updates the Audit table to track modifications of a record.
Notes : This process is normally called by the Audit_Manager_MFS. It handles all of the audit trail
management logic.
Parameters :
AutoSet [in] -- Allows automatic setting of the SYSTEM_MAINTENANCE record without user intervention.
SysFlag [out] -- Returns True if the flag was set to stop people from logging in. Returns False if people
are still allowed to log into the application.
ID [in] -- ID of the record.
Table [in] -- Table name where the record being audited is stored.
CurrentRecord [in/out] -- Current record as it will be written to disk. If the Activity is "Write" then the
audit fields will be updated.
OrigRecord [in] -- If called by Audit_Manager_MFS then this is the original record, otherwise this
represents a marker for special audit tracking.
Activity [in] -- Identifies the audit activity being performed: Read, Write, Delete, or anything else
if called directly for special audit tracking.
History : (Date, Initials, Notes)
05/19/05 axf Initial Program (Original Program MFS_Update_History).
11/26/07 dmb Code clean-up and refactoring.
04/05/13 dmb Repalce SECURITY_EQUATES with Memory Services to get login security. - [SRPFW-9]
***********************************************************************************************************************/
$insert APP_INSERTS
Declare Subroutine Msg, Lock_Record
Declare Function RetStack, Memory_Services
If Assigned(ID) else ID = ""
If Assigned(Table) else Table = ""
If Assigned(CurrentRecord) else CurrentRecord = ""
If Assigned(OrigRecord) else OrigRecord = ""
AuditManagerTable = "APP_INFO"
Convert @Lower_Case to @Upper_Case In Table
AuditTable = 'AUDIT_' : Table
Username = @USERNAME
* Declare function GetNetworkUsername
* If GetNetworkUsername() EQ "dbakke1" AND Activity _NEC "READ" then debug
Open AuditTable to HistoryCheck then
RecordTracker = No$
Locked_handle = ""
Temp_activity = ""
Success = ""
Details = ""
New = No$
TrackActivity = No$
CallProgName = RetStack()<2>
Gosub App_Info
If TrackActivity EQ Yes$ then Gosub Main_Process
End
Return
App_Info:
Fields = ""
Num_fields = 0
Open AuditManagerTable to hAIT then
ReadO App_record from hAIT, "AUDIT_MANAGER_SETTINGS" then
Locate Table in App_record<1> using @VM setting vPos then
Begin Case
Case ID EQ ""
// Do nothing.
Case CallProgName[1, 18] NE "AUDIT_MANAGER_MFS*"
// Program is being called directly from a stored procedure.
If App_record<6,vPos> EQ Yes$ Then
If CurrentRecord NE "" Then
TrackActivity = Yes$
RecordTracker = Yes$ ; // Flag to indicate that special audit tracking is ocurring
Marker = OrigRecord
OrigRecord = CurrentRecord
End
End
Case Activity EQ "Write"
If App_record<3,vPos> EQ Yes$ Then
TrackActivity = Yes$
Locate Table in App_record<1> using @VM setting Position then
StartField = App_record<2, Position>
If StartField Then
CurrentRecord<StartField> = Username
CurrentRecord<StartField + 1> = Date()
CurrentRecord<StartField + 2> = Time()
End
End
End
Case Activity EQ "Delete"
If App_record<4,vPos> EQ Yes$ Then TrackActivity = Yes$
Case Activity EQ "Read"
If App_record<5,vPos> EQ Yes$ Then TrackActivity = Yes$
End Case
end else
* Msg("|Unable to locate the ":Table:" information|in the Audit Manager Settings.|")
end
end else
* Msg("|Unable to read the Audit Manager Settings Record.|")
end
end else
* Msg("|Unable to open the App_Info Table.|")
end
return
Main_Process:
Lock_Record(AuditTable, Locked_handle, ID, Lock$, No$, Yes$, Success)
If Success then
Read AuditTrail from Locked_handle, ID then
Num_items = Count(AuditTrail<1>, @VM) + (AuditTrail<1> NE "")
* If Len(AuditTrail) GT 250000 then
* For DelNumItems = 1 to 100
* For Loop = 1 to 8
* AuditTrail = Delete(AuditTrail, Loop, Num_items, 0)
* Next Loop
* Num_items -= 1
* Next DelNumItems
* end
end else
AuditTrail = ""
New = Yes$
end
Current_date = Date()
Current_time = Time()
Seq = "DR"
StationName = @Station
MacAddress = ""
Locate Current_date in AuditTrail<1> by Seq Using @VM setting Pos else Null
AuditTrail<1> = Insert(AuditTrail<1>, 1, Pos, 0, Current_Date)
AuditTrail<2> = Insert(AuditTrail<2>, 1, Pos, 0, Current_Time)
AuditTrail<3> = Insert(AuditTrail<3>, 1, Pos, 0, Username)
AuditTrail<4> = Insert(AuditTrail<4>, 1, Pos, 0, StationName)
AuditTrail<5> = Insert(AuditTrail<5>, 1, Pos, 0, MacAddress)
AuditTrail<8> = Insert(AuditTrail<8>, 1, Pos, 0, Activity)
AuditTrail<9> = "AUDIT TRACKING RECORD"
If RecordTracker EQ Yes$ Then
// Special audit tracking is occuring. Store the current program
// and the special marker in the audit trail entry.
AuditTrail<6> = Insert(AuditTrail<6>, 1, Pos, 0, RetStack()<2>)
AuditTrail<7> = Insert(AuditTrail<7>, 1, Pos, 0, Marker)
AuditTrail<10> = "PROGRAM TRACKER"
End Else
AuditTrail<6> = Insert(AuditTrail<6>, 1, Pos, 0, "")
AuditTrail<7> = Insert(AuditTrail<7>, 1, Pos, 0, "")
AuditTrail<10> = AuditTrail<10>
End
// Update the Audit Trail record.
Write AuditTrail to Locked_handle, ID Then
If Activity NE "Read" Then
// Only create an audit record if the Activity isn't Read.
AuditRecord = OrigRecord
If MacAddress EQ "" Then MacAddress = @Station
StoredRecId = ID:"*":MacAddress:"*":Current_Date:"*":Current_Time
Write AuditRecord To Locked_handle, StoredRecId Then
Read RecentlyUpdatedList from Locked_handle, "%RECENTLY_UPDATED%" Else
RecentlyUpdatedList = ""
End
Locate ID in RecentlyUpdatedList using @FM setting UpdatePos Then
RecentlyUpdatedList = Delete(RecentlyUpdatedList, UpdatePos, 0, 0)
End
If RecentlyUpdatedList EQ "" then
RecentlyUpdatedList = ID
End Else
RecentlyUpdatedList = ID:@FM:RecentlyUpdatedList
If Count(RecentlyUpdatedList, @FM) GT 499 then
RecentlyUpdatedList = Field(RecentlyUpdatedList, @FM, 1, 500)
end
End
Write RecentlyUpdatedList to Locked_handle, "%RECENTLY_UPDATED%" Else
* Msg("|Unable to Write the record %RECENTLY_UPDATED%|to the ":AuditTable:".|")
End
End Else
* Msg("|Unable to Write the record ":StoredRecId:"|to the ":AuditTable:".|")
End
End
End Else
* Msg("|Unable to Write the record ":ID:"|to the ":AuditTable:".|")
End
Lock_Record(AuditTable, Locked_handle, ID, Unlock$)
End Else
* Msg("|Unable to update ":AuditTable:" log.|")
end
return

View File

@ -0,0 +1,264 @@
Function Audit_Manager_MFS(Code, BFS, Handle, Name, FMC, Record, Status)
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
//
// This program is proprietary and is not to be used by or disclosed to others, nor is it to
// be copied without written permission from SRP Computer Solutions, Inc.
//
// Name : Audit_Manager_MFS
//
// Description: MFS for tracking the audit history of a particular record.
//
// Notes: This routine primarily passes all essential information into the Audit_Manager
// stored procedure. This way changes to the core functionality can be made
// without having to restart OpenInsight (which is necessary for changes directly
// in MFS procedures.)
//
// A check is first made to see if corresponding audit table exists for the
// database table that triggered this MFS. Audit tables use a naming convention
// of AUDIT_Tablename. therefore, if the CUSTOMERS table is being audited then
// there should be an AUDIT_CUSTOMERS table available. Audit features are managed
// by the DBW_AUDIT_MANAGER form.
//
// Parameters:
// Code [in] -- An integer value indicating the operation to be performed (1 = read a
// record, 4 = delete a record, 11 = open a file, etc.)
// BFS [in] -- The list of MFSs and the BFS name for the current file or volume. This
// is a subvalue mark-delimited array, with the current MFS name as the
// first value in the array, and the BFS name as the last value.
// Handle [in] -- The file handle of the file or media map being accessed.
// Name [in] -- The name (key) of the record or file being accessed.
// FMC [in] -- Various functions.
// Record [in] -- The entire record (for record-oriented functions) or a newly-created
// handle (for "get handle" functions).
// Status [in] -- A return code indicating the success or failure of an operation.
//
// History (Date, Initials, Notes)
// 01/04/00 pcs Original programmer
// 01/20/00 pcs CLEARFILE requires the Arev table name to be removed before processing
// 05/20/05 axf Process will now also track the accessing of records.
// 11/26/07 dmb Code clean-up. No functional changes were made.
//
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
$insert APP_INSERTS
$INSERT FILE.SYSTEM.EQUATES
$INSERT FSERRORS_HDR
Declare Subroutine Msg, Audit_Manager
ON CODE GOSUB READ.RECORD,READO.RECORD,WRITE.RECORD,DELETE.RECORD,LOCK.RECORD,UNLOCK.RECORD,SELECT,READNEXT,CLEARSELECT,CLEARFILE,OPEN.FILE,CREATE.FILE,RENAME.FILE,MOVE.FILE,DELETE.FILE,OPEN.MEDIA,CREATE.MEDIA,READ.MEDIA,WRITE.MEDIA,UNLOCK.ALL,FLUSH,INSTALL,RESERVED,RESERVED,RESERVED,OMNI.SCRIPT,CLOSE.MEDIA,RECORD.COUNT, REMAKE.FILE,CREATE.INDEX,DELETE.INDEX,UPDATE.INDEX,SELECT.INDEX,READNEXT.INDEX
Return
READ.RECORD:
// Added Check_Update_History Gosub
Activity = "Read"
GoSub Check_Update_History
GoSub Remove_Arev_Table_Name
return
READO.RECORD:
// Added Check_Update_History Gosub
Activity = "Read"
GoSub Check_Update_History
GoSub Remove_Arev_Table_Name
return
CREATE.MEDIA:
GoSub Call_NextFS
return
OPEN.MEDIA:
GoSub Call_NextFS
return
READ.MEDIA:
GoSub Call_NextFS
return
WRITE.MEDIA:
GoSub Call_NextFS
return
CLOSE.MEDIA:
GoSub Call_NextFS
return
CLEARFILE:
GoSub Remove_Arev_Table_Name
return
CREATE.FILE:
GoSub Call_NextFS
return
DELETE.FILE:
GoSub Call_NextFS
return
MOVE.FILE:
GoSub Call_NextFS
return
OPEN.FILE:
// Attaching Arev Table name to Handle for checking purposes
GoSub Call_NextFS
If Index(RECORD, @TM, 1) EQ 0 then
RECORD = NAME:@TM:RECORD
end
return
REMAKE.FILE:
GoSub Call_NextFS
return
RENAME.FILE:
GoSub Call_NextFS
return
SELECT:
GoSub Remove_Arev_Table_Name
return
READNEXT:
GoSub Remove_Arev_Table_Name
return
CLEARSELECT:
GoSub Remove_Arev_Table_Name
return
LOCK.RECORD:
GoSub Remove_Arev_Table_Name
return
UNLOCK.RECORD:
GoSub Remove_Arev_Table_Name
return
CREATE.INDEX:
GoSub Remove_Arev_Table_Name
return
UPDATE.INDEX:
GoSub Remove_Arev_Table_Name
return
DELETE.INDEX:
GoSub Remove_Arev_Table_Name
return
SELECT.INDEX:
GoSub Remove_Arev_Table_Name
return
READNEXT.INDEX:
GoSub Remove_Arev_Table_Name
return
RESERVED:
GoSub Call_NextFS
return
OMNI.SCRIPT:
GoSub Remove_Arev_Table_Name
return
RECORD.COUNT:
GoSub Remove_Arev_Table_Name
return
LOCK.SEMAPHORE:
GoSub Call_NextFS
return
UNLOCK.SEMAPHORE:
GoSub Call_NextFS
return
SET.USER.SEMAPHORE:
GoSub Call_NextFS
return
WRITE.RECORD:
GoSub Prep_Vars
Activity = "Write"
GoSub Check_Update_History
GoSub Remove_Arev_Table_Name
return
DELETE.RECORD:
Activity = "Delete"
GoSub Check_Update_History
GoSub Remove_Arev_Table_Name
return
NEXT_FS:
GoSub Call_NextFS
return
// Install, unlock all and flush are called directly, no need to call next FS.
INSTALL:
STATUS = TRUE$
return
FLUSH:
STATUS = TRUE$
return
UNLOCK.ALL:
STATUS = TRUE$
return
Prep_Vars:
TempUseTable = Field(HANDLE, @TM, 1)
UseTable = Field(TempUseTable, "*", 1)
UseID = Name
return
Check_Update_History:
Temp_File_Name = Field(HANDLE, @TM, 1)
FileName = Field(Temp_File_Name, "*", 1)
Real_Handle = Field(HANDLE, @TM, 2)
History_table = "AUDIT_":FileName
Open History_table to HistoryCheck then
GoSub Get_Original_Record
Audit_Manager(Name, FileName, Record, OrigRecord, Activity)
end
return
Get_Original_Record:
OrigRecord = ""
CALL RTP57(READO.RECORD, "RTP57", Real_Handle, NAME, FMC, OrigRecord, Temp_status)
// If Temp_status is Null then it is a new record or an error reading.
return
Call_NextFS:
FS = DELETE(BFS, 1, 1, 1)
NEXTFS = FS<1, 1, 1>
@FILE.ERROR = ""
CALL @NEXTFS(CODE, FS, HANDLE, NAME, FMC, RECORD, STATUS)
return
Remove_Arev_Table_Name:
* FileName = Field(HANDLE, @TM, 1)
* If FileName EQ HANDLE then
* Real_Handle = HANDLE
* end else
* Real_Handle = Field(HANDLE, @TM, 2)
* end
FS = DELETE(BFS, 1, 1, 1)
NEXTFS = FS<1, 1, 1>
@FILE.ERROR = ""
If Index(FS, @SVM, 1) GT 0 then
Real_Handle = HANDLE
end else
Real_Handle = Field(HANDLE, @TM, 2)
end
CALL @NEXTFS(CODE, FS, Real_Handle, NAME, FMC, RECORD, STATUS)
return

View File

@ -0,0 +1,73 @@
function Authenticate_LDAP(void)
$Insert LOGICAL
/* equates for the base registry keys */
equ HKEY_CLASSES_ROOT$ to 0x80000000
equ HKEY_CURRENT_USER$ to 0x80000001
equ HKEY_LOCAL_MACHINE$ to 0x80000002
equ HKEY_USERS$ to 0x80000003
equ HKEY_PERFORMANCE_DATA$ to 0x80000004
equ HKEY_CURRENT_CONFIG$ to 0x80000005
equ HKEY_DYN_DATA$ to 0x80000006
equ KEY_QUERY_VALUE$ to 0x0001
equ ERROR_SUCCESS to 0x0000
Declare subroutine Set_Property.Net, Utility, RegQueryValueEx, Msg, Create_User, RTI_Create_User_Details
Declare Subroutine Set_Property
Declare function Active_Directory_Services, RegOpenKeyEx, RTI_GetNetworkUserName, RegCloseKey
Declare Function Database_Services
Log = @AppId<1>
Oswrite Log to 'D:\Temp\auth.txt'
Authenticated = False$
Options = 0
SamDesired = KEY_QUERY_VALUE$
KeyHandle = 0
Hkey = HKEY_LOCAL_MACHINE$
SubKey = "SYSTEM\CurrentControlSet\Services\Tcpip\Parameters":\00\
Stat = 0
Null = ''
LockVariable KeyHandle as Long
Stat = RegOpenKeyEx(Hkey, SubKey, Options, SamDesired, KeyHandle)
If Stat = ERROR_SUCCESS Then
Domain = str(\00\, 512)
Reg_SZ = 1
CbBuf = 512
Key = "Domain":\00\
RegQueryValueEx(KeyHandle, Key, 0, Reg_SZ, Domain, CbBuf)
Domain = Domain[1, CbBuf - 1]
end
rv = RegCloseKey(KeyHandle)
UserADName = RTI_GetNetworkUserName()
UserADGroups = Active_Directory_Services('GetADGroups', UserADName, Domain)
**SSOInfo = Database_Services('ReadDataRow', 'SYSENV', 'CFG_LOGIN*':@AppId<1>)
*SSOErrorMsg = SSOInfo<9>
*SSOADGroups = Field(SSOInfo, @FM, 2, 3)
SSOADGroups = Database_Services('ReadDataRow', 'SYSENV', 'SSO*LSL2')
For GroupIndex = 3 to 1 Step -1
SSOADGroup = SSOADGroups<GroupIndex>
If InList(UserADGroups, SSOADGroup, @FM) then
@UserName = UserADName
SecurityLevel = GroupIndex - 1
@Admin = SecurityLevel
Authenticated = True$
Set_Property( "SYSTEM", "LOGININFO" , 'LSL2':@FM:UserADName:@FM:'')
end
Until Authenticated
Next GroupIndex
Swap 1 With 'True' In Authenticated
Swap 0 With 'False' In Authenticated
Log := ', Authenticated ':Authenticated
Oswrite Log to 'D:\Temp\auth.txt'
If Not(Authenticated) then
Msg(@Window, 'SSO Error')
Utility('DESTROY', 'SYSTEM')
End
Return

View File

@ -0,0 +1,263 @@
COMPILE FUNCTION Batch_WO_Purge(EntID,Event,Parm1,Parm2,Parm3,Parm4,Parm5)
/*
Commuter module for BATCH_WO_PURGE window (Purge groups of Work Orders and all affiliated data from the system)
02/16/2016 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Set_Status,Print_React_Read_Worksheet
DECLARE SUBROUTINE ErrMsg, Send_Message, Set_Property, Send_Event, obj_AppWindow,
DECLARE SUBROUTINE End_Window,obj_React_Reads
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Utility, Popup, Collect.Ixvals
DECLARE FUNCTION Send_Message, Msg, Security_Check, obj_WO_Log, WO_Purge, Set_Property
$INSERT MSG_EQUATES
$INSERT APPCOLORS
$INSERT LSL_USERS_EQU
$INSERT SECURITY_RIGHTS_EQU
$INSERT POPUP_EQUATES
EQU CRLF$ TO \0D0A\
EQU TAB$ TO \09\
EQU COL$WO_NO TO 1
EQU COL$CASS_CNT TO 2
EQU COL$START TO 3
EQU COL$STOP TO 4
EQU COL$PER_BOX TO 5
ErrTitle = 'Error in Batch_WO_Purge commuter module'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE EntID = @WINDOW
BEGIN CASE
CASE Event = 'CREATE' ; GOSUB Create
CASE Event = 'CLOSE' ; GOSUB Close
END CASE
CASE EntID = @WINDOW:'.LU_WO' AND Event = 'CLICK' ; GOSUB LUWONo
CASE EntID = @WINDOW:'.START_PURGE' AND Event = 'CLICK' ; GOSUB StartPurge
CASE EntID = @WINDOW:'.DONE' AND Event = 'CLICK' ; GOSUB Close
CASE EntID = @WINDOW:'.CLEAR' AND Event = 'CLICK' ; GOSUB Clear
CASE EntID = @WINDOW:'.WO_NO' AND Event = 'POSCHANGED' ; GOSUB WONoPC
CASE EntID = @WINDOW:'.WO_NO' AND Event = 'CLICK' ; GOSUB WOClick
CASE EntID = @WINDOW:'.WO_NO' AND Event = 'INSERTROW' ; GOSUB InsertRow
CASE EntID = @WINDOW:'.WO_NO' AND Event = 'DELETEROW' ; GOSUB DeleteRow
CASE 1
ErrorMsg = 'Unknown Parameters ':EntID:' - ':Event:' passed to commuter'
ErrMsg(ErrorMsg)
END CASE
IF ErrorMsg NE '' THEN
ErrMsg(ErrTitle:@SVM:ErrorMsg)
END
RETURN Result
* * * * * * *
Create:
* * * * * * *
obj_Appwindow('Create',@WINDOW)
GOSUB Refresh
RETURN
* * * * * * *
Close:
* * * * * * *
End_Dialog(@WINDOW,'')
RETURN
* * * * * * *
Refresh:
* * * * * * *
RETURN
* * * * * * *
Clear:
* * * * * * *
EmptyCol = STR(@VM,90)
Array = ''
Array<COL$WO_NO> = EmptyCol
Array<COL$CASS_CNT> = EmptyCol
Array<COL$START> = EmptyCol
Array<COL$STOP> = EmptyCol
Array<COL$PER_BOX> = EmptyCol
Set_Property(@WINDOW:'.WO_NO','DEFPROP',Array)
RETURN
* * * * * * *
LUWoNo:
* * * * * * *
Set_Status(0)
WOKeys = obj_WO_Log('Find')
IF Get_Status(errCode) THEN ErrMsg(ErrCode)
IF WOKeys NE '' THEN
TypeOver = ''
TypeOver<PDISPLAY$> = WOKeys
TypeOver<PMODE$> = 'K'
WOKeys = Popup(@WINDOW,TypeOver,'WO_LOG_QUERY')
IF Get_Status(errCode) THEN
ErrMsg(errCode)
END
IF WOKeys = '' THEN RETURN
WOCnt = COUNT(WOKeys,@VM) + (WOKeys NE '')
CassCnts = XLATE('WO_LOG',WOKeys,'WO_MAT_CNT','X')
WOArray = ''
WOArray<COL$WO_NO> = WOKeys:@VM
WOArray<COL$CASS_CNT> = CassCnts:@VM
WOArray<COL$START> = STR(@VM,WOCnt)
WOArray<COL$STOP> = STR(@VM,WOCnt)
WOArray<COL$PER_BOX> = STR(@VM,WOCnt)
Set_Property(@WINDOW:'.WO_NO','DEFPROP',WOArray)
END
RETURN
* * * * * * *
WOClick:
* * * * * * *
RETURN
* * * * * * *
WONoPC:
* * * * * * *
GOSUB Refresh
RETURN
* * * * * * *
InsertRow:
* * * * * * *
DEBUG
RETURN
* * * * * * *
DeleteRow:
* * * * * * *
DEBUG
RETURN
* * * * * * *
StartPurge:
* * * * * * *
CtrlEntID = @WINDOW:'.WO_NO'
WOList = Get_Property(@WINDOW:'.WO_NO','LIST')
SelPositions = Get_Property(@WINDOW:'.WO_NO','SELPOS') ;* Returns list of selected row numbers
SelectedRows = SelPositions<2>
CONVERT @VM TO @FM in SelectedRows
SelCnt = COUNT(SelectedRows,@FM) + (SelectedRows NE '')
FOR I = 1 TO SelCnt
SelectedRow = SelectedRows<I>
WONo = WOList<SelectedRow,COL$WO_NO>
StartTime = Time()
void = WO_Purge(WONo)
StopTime = Time()
BoxCnt = WOList<SelectedRow,COL$CASS_CNT>
IF StopTime = StartTime OR BoxCnt = 0 THEN
PerBox = '-'
END ELSE
PerBox = OCONV(ICONV((StopTime - StartTime)/BoxCnt,'MD2'),'MD2')
END
Set_Property(CtrlEntID,'SELPOS',1:@FM:SelectedRow) ;* Clears selection in edit table line
stat = Send_Message(CtrlEntID,'COLOR_BY_POS',0,SelectedRow,RED$)
Set_Property(CtrlEntID,'CELLPOS',OCONV(StartTime,'MTS'),COL$START:@FM:SelectedRow)
Set_Property(CtrlEntID,'CELLPOS',OCONV(StopTime,'MTS'),COL$STOP:@FM:SelectedRow)
Set_Property(CtrlEntID,'CELLPOS',PerBox,COL$PER_BOX:@FM:SelectedRow)
NEXT I
RETURN

View File

@ -0,0 +1,33 @@
SUBROUTINE BOOLEAN_CONV(ConvType, DataIo, ReturnCode, ReturnedValue)
#pragma precomp SRP_PreCompiler
$insert logical
equ valid$ to 0 ;* successful
equ invalid_msg$ to 1 ;* bad data - print error message window
equ invalid_conv$ to 2 ;* bad conversion - " "
equ invalid_nomsg$ to 3 ;* bad but do not print the error message window
status() = Valid$
IF NOT(ASSIGNED(ReturnCode)) THEN ReturnCode = ''
begin case
case ConvType = 'ICONV'
ReturnedValue = DataIo
case ConvType = 'OCONV'
If DataIO EQ '1' then
Desc = 'Yes'
end else
Desc = ''
end
ReturnedValue = Desc
case otherwise$
status() = invalid_msg$
end case
return

View File

@ -0,0 +1,70 @@
COMPILE ROUTINE BUILD_SapShipRel_DATA(Dummy)
ROWDEF(CHARSTR)
DECLARE SUBROUTINE ErrMsg, Send_Info, SetInitDirOptions, Send_Dyn, Set_Status
DECLARE FUNCTION Get_Status,Security_Check, Set_Status
DECLARE FUNCTION Repository, Send_Dyn
$INSERT COC_EQUATES
$INSERT WO_MAT_EQUATES
$INSERT PART_EQUATES
EQU CRLF$ TO \0D0A\
EQU TAB$ TO \09\
ShipNos = 97500:@VM:97600:@VM:96100
ShipCnt = 3
DEBUG
FOR I = 1 TO 1
ShipNo = ShipNos<1,I>
ShipRec = XLATE('COC',ShipNo,'','X')
WONo = ShipRec<COC_WO$>
CassNos = ShipRec<COC_CASS_NO$>
ProdOrdNo = 'M':FMT(WONo, "R(0)#6"):'.1'
CassWfrQtys = XLATE('COC',ShipNo,'CASS_WAFER_CNT','X')
ShipRelease = ''
CassCnt = COUNT(CassNos,@VM) + (CassNos NE '')
FOR Cass = 1 TO CassCnt
ShipRelLine = ShipNos<1,I>
ShipRelLine<1,2> = ProdOrdNo
ShipRelLine<1,3> = WONo
ShipRelLine<1,4> = CassNos<1,Cass>
ShipRelLine<1,5> = 'B':RND(1945)
ShipRelLine<1,6> = CassWfrQtys<1,I>
ShipRelease<-1> = ShipRelLine
NEXT Cass
* * * * Write Work Order Release * * * *
ProdOrdRelease = 'M000010.1':@VM:'PO001TEST':@VM:'03/30/11':@VM:'737883':@VM:'516956-C-IR':@VM:'1':@VM:'100':CRLF$
SWAP @FM WITH CRLF$ IN ProdOrdRelease
SWAP @VM WITH TAB$ IN ProdOrdRelease
FullPath = 'C:\FTP_IN\ProdOrdRel\'
FileName = 'PR':FMT(I,"R(0)#5"):'.tsv'
Set_Status(0)
OSWRITE ProdORdRelease TO FullPath:FileName
NEXT I
END

View File

@ -0,0 +1,483 @@
COMPILE ROUTINE BUILD_SAP_COMM_DATA(Dummy)
ROWDEF(CHARSTR)
DECLARE SUBROUTINE ErrMsg, Send_Info, SetInitDirOptions, Send_Dyn, Set_Status
DECLARE FUNCTION Get_Status,Security_Check, Set_Status
DECLARE FUNCTION Repository, Send_Dyn
$INSERT WO_LOG_EQUATES
$INSERT WO_MAT_EQUATES
$INSERT PART_EQUATES
$INSERT COC_EQUATES
EQU CRLF$ TO \0D0A\
EQU TAB$ TO \09\
* Build Inbound Production Order records
CurrPath = Drive()
dummy = CurrPath[-1,'B\'] ;* Position of OpenInsight directory
CurrPath = CurrPath[1,COL1()] ;* Path to level above OI directory
InBufferPath = CurrPath:'SAPComm\FromSAP\'
OutBufferPath = CurrPath:'SAPComm\ToSAP\'
OutBoundDirs = 'WOCreate':@FM
OutBoundDirs := 'PromiseDt':@FM
OutBoundDirs := 'WfrReject':@FM
OutBoundDirs := 'CustTW':@FM
OutBoundDirs := 'MUWafer':@FM
OutBoundDirs := 'ProdTW':@FM
OutBoundDirs := 'WOHold':@FM
OutBoundDirs := 'WOStart':@FM
OutBoundDirs := 'WOStop'
WONos = 148411:@FM ;* EpiPro
WONos := 148406:@FM ;* Delphi 2 step 40 boxes
WONos := 148381 ;* Captive
WOCnt = COUNT(WONos,@FM) + (WONos NE '')
ProdOrdSeq = 1
FOR I = 1 TO WOCnt
WONo = WONos<I>
WORec = XLATE('WO_LOG',WONo,'','X')
OrderNo = WORec<WO_LOG_ORDER_NO$>
CustPONo = XLATE('ORDER',OrderNo,41,'X') ;* 41 is PO_NO field
WORelRec = ''
GoodsRecRec = ''
ShipDocRec = ''
CloseOrdRec = ''
ProdOrdNo = 'M':FMT(ProdOrdSeq, "R(0)#6"):'.1'
WOMatKeys = WORec<WO_LOG_WO_MAT_KEY$>
Pos = 1
LOOP
REMOVE WOMatKey FROM WOMatKeys AT Pos SETTING Flag
WHILE Flag
CassNo = WOMatKey[-1,'B*']
WOMatRec = XLATE('WO_MAT',WOMatKey,'','X')
PartNo = XLATE('WO_MAT',WOMatKey,'PART_NO_SAP','X')
WORelLine = ProdOrdNo ;* Production Order No
WORelLine<1,2> = CustPONo ;* Customer PO No
WORelLine<1,3> = OCONV(WORec<WO_LOG_PROMISE_SHIP_DT$>,'D4/') ;* Promise Ship Dt
WORelLine<1,4> = PartNo ;* Mesa Part No
WORelLine<1,5> = WOMatRec<WO_MAT_SUB_PART_NO$> ;* Substrate Part No
WORelLine<1,6> = '{Substrate Revision No}' ;* Replace {Substrate Revision No} from SAP
WORelLine<1,7> = WORec<WO_LOG_WO_QTY$> ;* Total Prod Order wafer qty
WORelRec<-1> = WORelLine
ShipDocLine = ProdOrdNo ;* Production Order No
ShipDocLine<1,2> = '{SAP Ship No}' ;* Replace {SAP Ship No} with SAP Shipment No
ShipDocLine<1,3> = CassNo ;* Cassette number
ShipDocLine<1,4> = '{SAP Batch No}' ;* Replace {SAP Batch No} with SAP Batch No
ShipDocRec<-1> = ShipDocLine
GoodsRecLine = ProdOrdNo ;* Production Order No
GoodsRecLine<1,2> = CassNo ;* Cassette number
GoodsRecLine<1,3> = '{SAP Batch No}' ;* SAP Batch No
GoodsRecLine<1,4> = WOMatRec<WO_MAT_LOT_NO$> ;* Cassette Substrate Lot No
GoodsRecRec<-1> = GoodsRecLine
Send_Dyn(ProdOrdNo:' -> ':WOMatKey)
REPEAT
ProdOrdCloseFlag = 1
ProdOrdRec = ProdOrdNo:@VM:ProdOrdCloseFlag
PartRec = XLATE('PART',PartNo,'','X')
InPartRec = PartNo
InPartRec<1,2> = PartRec<PART_DESC$>
InPartRec<1,3> = PartRec<PART_CUST_NO$>
InPartRec<1,4> = XLATE('PART',PartNo,'CUST_NAME','X')
InPartRec<1,5> = XLATE('PART',PartNo,'CUST_TYPE','X')
InPartRec<1,6> = PartRec<PART_CUST_PART_NO$>
InPartRec<1,7> = PartRec<PART_SUB_PART_NO$>
InPartRec<1,8> = PartRec<PART_SUB_TYPE$>
InPartRec<1,9> = PartRec<PART_SUB_SUPPLIER$>
InPartRec<1,10> = PartRec<PART_PURCH_SPEC$>
InPartRec<1,11> = PartRec<PART_PURCH_SPEC_REV$>
InPartRec<1,12> = PartRec<PART_REACT_TYPE$>
* * * * Write Work Order Release * * * *
SWAP @FM WITH CRLF$ IN WORelRec
SWAP @VM WITH TAB$ IN WORelRec
FullPath = InBufferPath:'ProdOrdRel\'
FileName = 'PR':FMT(ProdOrdSeq,"R(0)#5"):'.tsv'
Set_Status(0)
OSWRITE WORelRec TO FullPath:FileName
* * * * Write Goods Receipt * * * *
SWAP @FM WITH CRLF$ IN GoodsRecRec
SWAP @VM WITH TAB$ IN GoodsRecRec
FullPath = InBufferPath:'GoodsRec\'
FileName = 'GR':FMT(ProdOrdSeq,"R(0)#5"):'.tsv'
Set_Status(0)
OSWRITE GoodsRecRec TO FullPath:FileName
* * * * Write Shipping Document Request * * * *
SWAP @FM WITH CRLF$ IN ShipDocRec
SWAP @VM WITH TAB$ IN ShipDocRec
FullPath = InBufferPath:'ShipDoc\'
FileName = 'SD':FMT(ProdOrdSeq,"R(0)#5"):'.tsv'
Set_Status(0)
OSWRITE ShipDocRec TO FullPath:FileName
* * * * Write Order Close * * * *
SWAP @FM WITH CRLF$ IN ProdOrdRec
SWAP @VM WITH TAB$ IN ProdOrdRec
FullPath = InBufferPath:'CloseOrder\'
FileName = 'OC':FMT(ProdOrdSeq,"R(0)#5"):'.tsv'
Set_Status(0)
OSWRITE ProdOrdRec TO FullPath:FileName
* * * * Write Part No * * * *
SWAP @FM WITH CRLF$ IN InPartRec
SWAP @VM WITH TAB$ IN InPartRec
FullPath = InBufferPath:'PartNo\'
FileName = 'PN':FMT(ProdOrdSeq,"R(0)#5"):'.tsv'
Set_Status(0)
OSWRITE InPartRec TO FullPath:FileName
FOR D = 1 TO 10
OutBoundDir = OutBoundDirs<D>
BEGIN CASE
CASE OutBoundDir = 'WOCreate'
FullPath = OutBufferPath:OutBoundDir:'\'
FileName = 'WOK':FMT(ProdOrdSeq,"R(0)#5"):'.tsv'
OutRec = ProdOrdNo:TAB$:WONo:TAB$:'1':CRLF$
Set_Status(0)
OSWRITE OutRec TO FullPath:FileName
CASE OutBoundDir = 'PromiseDt'
FullPath = OutBufferPath:OutBoundDir:'\'
FileName = 'PD':FMT(ProdOrdSeq,"R(0)#5"):'.tsv'
OutRec = ProdOrdNo:TAB$:OCONV(Date(),'D4/'):TAB$:OCONV(Date() + 10,'D4/'):CRLF$
Set_Status(0)
OSWRITE OutRec TO FullPath:FileName
*****************************************************************************
* Inventory to Scrap WIP Prod Ord No : Qty (+/-) + => From WIP to Scrap, - => From Scrap to WIP
CASE OutBoundDir = 'WfrReject'
FullPath = OutBufferPath:OutBoundDir:'\'
FileName = 'WR':FMT(ProdOrdSeq,"R(0)#5"):'.tsv'
IF ProdOrdSeq = 1 THEN TestQty = '+3' ;* Remove from Production
IF ProdOrdSeq = 2 THEN TestQty = '-13' ;* Add to Production (cancelled NCR)
IF ProdOrdSeq = 3 THEN TestQty = '+25'
OutRec = ProdOrdNo:TAB$:TestQty:CRLF$
Set_Status(0)
OSWRITE OutRec TO FullPath:FileName
CASE OutBoundDir = 'ProdTW'
FullPath = OutBufferPath:OutBoundDir:'\'
FileName = 'PT':FMT(ProdOrdSeq,"R(0)#5"):'.tsv'
IF ProdOrdSeq = 1 THEN UseQty = '+1' ;* This is a usage in production
IF ProdOrdSeq = 2 THEN UseQty = '-1' ;* This is a return from production to WIP
IF ProdOrdSeq = 3 THEN UseQty = '+2'
OutRec = ProdOrdNo:TAB$:UseQty:CRLF$
Set_Status(0)
OSWRITE OutRec TO FullPath:FileName
************************************************************************************
* Inventory Move transactions WIP Prod Ord No : MU Prod Ord NO : Qty (+/-) + => From WIP to MU, - => From MU to WIP
CASE OutBoundDir = 'CustTW'
FullPath = OutBufferPath:OutBoundDir:'\'
FileName = 'CT':FMT(ProdOrdSeq,"R(0)#5"):'.tsv'
IF ProdOrdSeq = 1 THEN UseQty = '+1' ;* This is a usage in production
IF ProdOrdSeq = 2 THEN UseQty = '-1' ;*This is a return from production to Cust Test Wafer Inentory
IF ProdOrdSeq = 3 THEN UseQty = '+2'
*OutRec = 'CUST':TAB$:To:TAB$:From:TAB$:Qty
*OutRec = 'MU' :TAB$:To:TAB$:From:TAB$:Qty
OutRec = ProdOrdNo:TAB$:'{Cust TW Part No}':TAB$:UseQty:CRLF$
Set_Status(0)
OSWRITE OutRec TO FullPath:FileName
CASE OutBoundDir = 'MUWafer'
FullPath = OutBufferPath:OutBoundDir:'\'
FileName = 'MW':FMT(ProdOrdSeq,"R(0)#5"):'.tsv'
IF ProdOrdSeq = 1 THEN UseQty = '+3' ;* This is Production to Makeup
IF ProdOrdSeq = 2 THEN UseQty = '-5' ;* This is Unflag box OR use makeup in production cassette
IF ProdOrdSeq = 3 THEN UseQty = '+6'
OutRec = ProdOrdNo:TAB$:'M':FMT(ProdOrdSeq+200, "R(0)#6"):'.1':TAB$:UseQty:CRLF$
Set_Status(0)
OSWRITE OutRec TO FullPath:FileName
CASE OutBoundDir = 'WOHold'
FullPath = OutBufferPath:OutBoundDir:'\'
FileName = 'HLD':FMT(ProdOrdSeq,"R(0)#5"):'.tsv'
IF ProdOrdSeq = 1 THEN Flag = '1' ;* WO Placed on Hold
IF ProdOrdSeq = 2 THEN Flag = '0' ;* WO Removed from Hold
IF ProdOrdSeq = 3 THEN Flag = '1' ;* WO Placed on Hold
OutRec = ProdOrdNo:TAB$:Flag:CRLF$
Set_Status(0)
OSWRITE OutRec TO FullPath:FileName
CASE OutBoundDir = 'WOStart'
FullPath = OutBufferPath:OutBoundDir:'\'
FileName = 'STR':FMT(ProdOrdSeq,"R(0)#5"):'.tsv'
OutRec = ProdOrdNo:TAB$:'1':CRLF$
Set_Status(0)
OSWRITE OutRec TO FullPath:FileName
CASE OutBoundDir = 'WOStop'
FullPath = OutBufferPath:OutBoundDir:'\'
FileName = 'STP':FMT(ProdOrdSeq,"R(0)#5"):'.tsv'
OutRec = ProdOrdNo:TAB$:'1':CRLF$
Set_Status(0)
OSWRITE OutRec TO FullPath:FileName
END CASE
NEXT D
ProdOrdSeq += 1
NEXT I
ShipNos = 97500:@VM:97600:@VM:96100
ShipCnt = 3
FOR I = 1 TO ShipCnt
ShipNo = ShipNos<1,I>
ShipRec = XLATE('COC',ShipNo,'','X')
WONo = ShipRec<COC_WO$>
CassNos = ShipRec<COC_CASS_NO$>
ProdOrdNo = 'M':FMT(WONo, "R(0)#6"):'.1'
CassWfrQtys = XLATE('COC',ShipNo,'CASS_WAFER_CNT','X')
ShipRelease = ''
CassCnt = COUNT(CassNos,@VM) + (CassNos NE '')
FOR Cass = 1 TO CassCnt
ShipRelLine = ShipNos<1,I>
ShipRelLine<1,2> = ProdOrdNo
ShipRelLine<1,3> = WONo
ShipRelLine<1,4> = CassNos<1,Cass>
ShipRelLine<1,5> = 'B':RND(1945)
ShipRelLine<1,6> = CassWfrQtys<1,I>
ShipRelease<-1> = ShipRelLine
NEXT Cass
* * * * Write Work Order Release * * * *
SWAP @FM WITH CRLF$ IN ShipRelease
SWAP @VM WITH TAB$ IN ShipRelease
FullPath = CurrPath:'SAPComm\FromSAP\ShipRel\'
FileName = 'SR':FMT(I,"R(0)#5"):'.tsv'
Set_Status(0)
OSWRITE ShipRelease TO FullPath:FileName
NEXT I
GOTO Bail
CurrPath = Drive()
dummy = CurrPath[-1,'B\'] ;* Position of OpenInsight directory
CurrPath = CurrPath[1,COL1()] ;* Path to level above OI directory
OutBufferPath = CurrPath:'SAPComm\ToSAP\'
InBufferPath = CurrPath:'SAPComm\FromSAP\'
SetInitDirOptions('D-R-H')
InitDir InBufferPath:"*.*"
InFolders = FIELD(DirList(),@FM,3,99)
InFoldCnt = COUNT(Infolders,@FM) + (Infolders NE '')
FOR I = 1 TO InfoldCnt
InFolder = InFolders<I>
InitDir InBufferPath:Infolder:'*.*'
LOOP
FileList = DirList()
UNTIL List = ""
LOOP
FileName = List[1,@FM]
FileList[1,Col2()] = ""
IF FileName[1,3] = 'ME1' THEN
LOCATE FileName IN FileNames BY 'AR' USING @FM SETTING Pos ELSE
FileNames = INSERT(FileNames,Pos,0,0,FileName)
END
END
UNTIL List = ""
REPEAT
REPEAT
NEXT I
IF FileNames[-1,1] = @FM THEN FileNames[-1,1] = ''
Test = ''
FileCnt = COUNT(FileNames,@FM) + (FileNames NE '')
FOR I = 1 TO FileCnt
Send_Info('Processing ':I:' of ':FileCnt)
FileName = FileNames<I>
StartTime = Time()
OSREAD FileIn FROM Path:FileName THEN
SWAP TAB$ WITH @VM IN FileIn
SWAP CRLF$ WITH @FM IN FileIn
DEBUG
END
NEXT I
* * * * * * *
Bail:
* * * * * * *
RETURN

View File

@ -0,0 +1,39 @@
compile subroutine calculator_resrho_valid(ConvType, DataIo, Branch, ReturnedValue)
begin condition
pre:
post:
end condition
declare function msg, get_property, set_property
declare subroutine update_index, extract_si_keys
$insert logical
$insert msg_equates
equ valid$ to 0 ;* successful
equ invalid_msg$ to 1 ;* bad data - print error message window
equ invalid_conv$ to 2 ;* bad conversion - " "
equ invalid_nomsg$ to 3 ;* bad but do not print the error message window
equ CrLf$ to char(13):char(10)
* THIS IS SIMPLY TO CALCULATE RESISTIVITY NOT TO VALIDATE RESRHO FOR THE
* CALCULATOR, CAUSE THERE IS NO SPEC
ReturnedValue = DataIo
status() = Valid$
begin case
case ConvType = 'ICONV'
Thickness = iconv( get_property( @window:'.THICKNESS_READINGS', 'ARRAY' ), 'MD2' )
SheetRHO = get_property( @window:'.SHEETRHO_READINGS', 'ARRAY' )
OffSet = str( '.001':@vm, 17 )
OffSet[-1,1] = ''
Res = oconv( SheetRHO *** Thickness *** OffSet, 'MD3' )
swap '.000' with '' in Res
Void = set_property( @window:'.RES_READINGS', 'ARRAY', Res )
case ConvType = 'OCONV'
* no output
ReturnedValue = DataIo
case otherwise$
ReturnedValue = ''
status() = invalid_conv$
end case
return

14
LSL2/STPROC/CALC_ELAP.txt Normal file
View File

@ -0,0 +1,14 @@
compile function calc_elap(DateIn, TimeIn, DateOut, TimeOut)
Tot = 0
if DateOut and DateIn then
DateDiff = DateOut - DateIn
SecondsToAdd = 0
if DateDiff then
SecondsToAdd = 86400*DateDiff
end
Tans = ( TimeOut + SecondsToAdd ) - TimeIn
Tot = ( ( Tans /3600) *100 )
end
return Tot

View File

@ -0,0 +1,267 @@
FUNCTION Calc_WO_Stats(RDSNos)
#pragma precomp SRP_PreCompiler
$INSERT RDS_EQU
$INSERT RDS_LAYER_EQUATES
$INSERT RDS_TEST_EQUATES
* Must pass keys in the same work order and they must be delimited by @VM
IF RDSNos = '' THEN RETURN
RdsCnt = COUNT(RDSNos,@VM) + (RDSNos NE '')
WOStats = ''
* Get Readings from RDS_TEST records for each RDS
MetThickAvgs = ''
MetResRHOAvgs = ''
ThickAvgLow = ''
ThickAvgHigh = ''
ThickAvgCount = 0
ThickAvgSum = ''
ResRHOAvgLow = ''
ResRHOAvgHigh = ''
ResRHOAvgCount = 0
ResRHOAvgSum = ''
FOR I = 1 to RdsCnt
RDSNo = RDSNos<1,I>
FirstLayerKey = RDSNo:'*L1'
TestKeys = XLATE('RDS_LAYER',FirstLayerKey,RDS_LAYER_RDS_TEST_KEYS$,'X')
TestKey = TestKeys<1,1> ;* There may be multiple keys for each Epi Pro reactor zone - Take just the first for now
MetrologyRec = XLATE('RDS_TEST',TestKey,'','X')
IF I = 1 THEN
SpecThickMin = MetrologyRec<RDS_TEST_SPEC_THICK_MIN$>
SpecThickMax = MetrologyRec<RDS_TEST_SPEC_THICK_MAX$>
SpecThickTarget = MetrologyRec<RDS_TEST_SPEC_THICK_TARGET$>
SpecResUnits = MetrologyRec<RDS_TEST_SPEC_RES_UNITS$>
SpecResMin = MetrologyRec<RDS_TEST_SPEC_RES_MIN$>
SpecResMax = MetrologyRec<RDS_TEST_SPEC_RES_MAX$>
SpecResTarget = MetrologyRec<RDS_TEST_SPEC_RES_TARGET$>
END
MetThickAvg = MetrologyRec<RDS_TEST_THICK_AVG$>
IF MetThickAvg <> "" THEN
MetThickAvgs<I> = MetThickAvg
ThickAvgCount += 1
ThickAvgSum += MetThickAvg
IF ThickAvgLow = '' THEN ThickAvgLow = MetThickAvg
IF ThickAvgHigh = '' THEN ThickAvgHigh = MetThickAvg
IF MetThickAvg < ThickAvgLow THEN ThickAvgLow = MetThickAvg
IF MetThickAvg > ThickAvgHigh THEN ThickAvgHigh = MetThickAvg
END
IF SpecResUnits = 'ê/Ü' THEN
SpecResLabel = 'Sheet Rho'
MetResRHOAvg = MetrologyRec<RDS_TEST_SHEETRHO_AVG$>
END ELSE
SpecResLabel = 'Resistivity'
MetResRHOAvg = MetrologyRec<RDS_TEST_RES_AVG$>
END
MetResRHOAvgs<I> = MetResRhoAvg
IF MetResRHOAvg <> "" THEN
ResRHOAvgCount += 1
ResRHOAvgSum += MetResRHOAvg
IF ResRHOAvgLow = '' THEN ResRHOAvgLow = MetResRHOAvg
IF ResRHOAvgHigh = '' THEN ResRHOAvgHigh = MetResRHOAvg
IF MetResRHOAvg < ResRHOAvgLow THEN ResRHOAvgLow = MetResRHOAvg
IF MetResRHOAvg > ResRHOAvgHigh THEN ResRHOAvgHigh = MetResRHOAvg
END
NEXT I
if @UserName EQ 'DAN_CR' Then Debug
//DPC - 3/11/2020 - hack to account for formatting/conversion issue in Thick Vals from RDS_Test
IF ThickAvgCount > 0 THEN
StatThickAvg = (ThickAvgSum/ThickAvgCount)*10
WOStats<1,1> = OCONV( StatThickAvg, 'MD3' )
END ELSE
StatThickAvg = 0
END
* * * Standard Deviation * * * *
SumDiffSq = 0
ThickMean = ''
ThickStDev = 0
IF ThickAvgSum and ThickAvgCount THEN
ThickMean = ThickAvgSum/ThickAvgCount
END ELSE
ThickMean = 0
END
FOR I = 1 TO RdsCnt
MetThickAvg = MetThickAvgs<I>
IF MetThickAvg <> "" THEN
SumDiffSq += ( MetThickAvg - ThickMean ) * ( MetThickAvg - ThickMean )
END
NEXT I
IF SumDiffSq AND ThickAvgCount THEN
ThickStDev = (SQRT( SumDiffSq/(ThickAvgCount-1) )) * 10
WOStats<1,3> = OCONV( ThickStDev, 'MD3' )
END
* Minimum and Maximum
IF ThickAvgHigh <> 0 THEN WOStats<1,5> = OCONV( ThickAvgHigh, 'MD2' ) ELSE WOStats<1,5> = ''
IF ThickAvgLow <> 0 THEN WOStats<1,7> = OCONV( ThickAvgLow, 'MD2') ELSE WOStats<1,7> = ''
* Uniformity
IF ThickAvgHigh and ThickAvgLow THEN
WOStats<1,9> = OCONV(((ThickAvgHigh - ThickAvgLow)/(ThickAvgHigh + ThickAvgLow))*10000, 'MD2' )
END
ThickCp = 0
TThickCPK = 0
* Thickness Cp
IF SpecThickMin and SpecThickMax and ThickStdev THEN
ThickCp = ((SpecThickMax-SpecThickMin)/(6*ThickStdev))*1000
WOStats<1,11> = OCONV( ThickCp, 'MD3' )
END
* Thickness CpK
IF ThickCp AND (ABS(SpecThickTarget-StatThickAvg)) AND (SpecThickMax-SpecThickMin) THEN
TThickCPK = ThickCp*(1-((ABS(SpecThickTarget-StatThickAvg))/((SpecThickMax-SpecThickMin)/2)))
WOStats<1,13> = OCONV( TThickCPK, 'MD3' )
END
* Sigma Capabilities
WOStats<1,15> = OCONV( ThickCP*3, 'MD3' ) ;* WOStats<1,11>*3
* Sigma Level
WOStats<1,17> = OCONV( TThickCPK*3, 'MD3' ) ;* WOStats<1,13>*3
* * * * * * *
* Resistivity Calculations
* * * * * * *
* * * Average * * *
IF ResRHOAvgCount THEN
StatResRHOAvg = ResRHOAvgSum/ResRHOAvgCount
IF SpecResUnits = 'ê/Ü' THEN
WOStats<1,2> = OCONV( StatResRHOAvg, 'MD3' )
END ELSE
WOStats<1,2> = OCONV( StatResRHOAvg, 'MD4' )
END
END ELSE
StatResRHOAvg = 0
END
* * * StDev * * *
SumDiffSq = 0
ResRHOStDev = 0
IF ResRHOAvgSum AND ResRHOAvgCount THEN
ResMean = ResRHOAvgSum/ResRHOAvgCount
END ELSE
ResMean = 0
END
FOR I = 1 to RdsCnt
MetResRHOAvg = MetResRHOAvgs<I>
IF MetResRHOAvg <> "" AND MetResRHOAvg <> 0 THEN
*SumDiffSq += ( MetResRHOAvg - ResMean )**2
SumDiffSq += ( MetResRHOAvg - ResMean ) * ( MetResRHOAvg - ResMean )
END
NEXT I
IF SumDiffSq AND ResRHOAvgCount THEN
ResRHOStDev = SQRT( SumDiffSq/(ResRHOAvgCount-1) )
WOStats<1,4> = OCONV( ResRHOStDev, 'MD3' )
END
* * * Minimum and Maximum * * *
IF ResRHOAvgHigh <> 0 THEN
IF SpecResUnits = 'ê/Ü' THEN
WOStats<1,6> = OCONV( ResRHOAvgHigh, 'MD3' )
END ELSE
WOStats<1,6> = OCONV( ResRHOAvgHigh, 'MD4' )
END
END ELSE
WOStats<1,6> = ''
END
IF ResRHOAvgLow <> 0 THEN
IF SpecResUnits = 'ê/Ü' THEN
WOStats<1,8> = OCONV( ResRHOAvgLow, 'MD3' )
END ELSE
WOStats<1,8> = OCONV( ResRHOAvgLow, 'MD4' )
END
END ELSE
WOStats<1,8> = ''
END
* * * uniformity * * *
IF ( ResRHOAvgHigh - ResRHOAvgLow ) and ( ResRHOAvgHigh + ResRHOAvgLow ) THEN
WOStats<1,10>= OCONV(((ResRHOAvgHigh - ResRHOAvgLow)/(ResRHOAvgHigh + ResRHOAvgLow))*10000, 'MD2' )
END
ResRHOCp = 0
TResCPK = 0
* * * Cp * * *
IF SpecResMin and SpecResMax and ResRHOStdev THEN
ResRHOCp = ((SpecResMax-SpecResMin)/(6*ResRHOStdev))*1000
WOStats<1,12> = OCONV( ResRHOCp, 'MD3' )
END
* * * CpK * * *
IF (ABS(SpecResTarget-StatResRHOAvg)) AND ( SpecResMax-SpecResMin ) THEN
TResCPK = ( ResRHOCp*(1-((ABS(SpecResTarget-StatResRHOAvg))/((SpecResMax-SpecResMin)/2))) )
IF TResCPK <> 0 THEN
WOStats<1,14> = OCONV( TResCPK, 'MD3' )
END ELSE
WOStats<1,14> = ''
END
END
* resistivity sigma capabilities
WOStats<1,16> = OCONV( ResRHOCp*3, 'MD3' ) ;* WOStats<1,12>*3
* thickness and resistivity sigma level
WOStats<1,18> = OCONV( TResCPK*3, 'MD3' ) ;* WOStats<1,14>*3
RETURN WOStats

203
LSL2/STPROC/CALIBRATION.txt Normal file
View File

@ -0,0 +1,203 @@
COMPILE FUNCTION Calibration(EntID,Event,Parm1,Parm2,Parm3,Parm4,Parm5)
/*
Commuter module for CALIBRATION (Calibrations) window
3/17/2010 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Send_Event, Set_Status, Center_Window, Post_Event
DECLARE SUBROUTINE ErrMsg, Send_Message, Set_Property, Send_Event, Btree.Extract, obj_AppWindow,
DECLARE SUBROUTINE obj_Notes, Security_Err_Msg, End_Window, Forward_Event, Start_Window, Create_Note
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Utility, Popup, Collect.Ixvals
DECLARE FUNCTION Send_Message, Msg, Security_Check, obj_React_Run_CI
$INSERT MSG_EQUATES
$INSERT APPCOLORS
$INSERT LSL_USERS_EQU
$INSERT SECURITY_RIGHTS_EQU
$INSERT CALIBRATION_EQUATES
$INSERT POPUP_EQUATES
EQU CRLF$ TO \0D0A\
EQU TAB$ TO \09\
ErrTitle = 'Error in Comm_Clean_Insp'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE EntID = @WINDOW
BEGIN CASE
CASE Event = 'CLEAR' ; GOSUB Clear
CASE Event = 'CREATE' ; GOSUB Create
CASE Event = 'CLOSE' ; GOSUB Close
CASE Event = 'READ' ; GOSUB Read
CASE Event = 'WRITE' ; GOSUB Write
CASE Event[1,3] = 'QBF' ; GOSUB Refresh
END CASE
CASE EntID = @WINDOW:'.CAL_DT' AND Event = 'GOTFOCUS' ; GOSUB CalDtGF
CASE EntID = @WINDOW:'.LU_CAL_DT' AND Event = 'CLICK' ; GOSUB LUCalDt
CASE 1
ErrorMsg = 'Unknown Parameters ':EntID:' - ':Event:' passed to commuter'
ErrMsg(ErrorMsg)
END CASE
IF ErrorMsg NE '' THEN
ErrMsg(ErrTitle:@SVM:ErrorMsg)
END
RETURN Result
* * * * * * *
Create:
* * * * * * *
/*
IF NOT(Security_Check('Reactor Event Log',READ$)) THEN
Security_Err_Msg('Reactor Event Log',READ$)
End_Window(@WINDOW)
RETURN
END
*/
obj_Appwindow('Create',@WINDOW)
* Provides compatibility with the existing messaging attachment system
IF Parm1 NE '' THEN
PassedKeys = FIELD(Parm1,'*',1)
obj_Appwindow('ViewRelated',@WINDOW:@RM:PassedKeys)
END
GOSUB Refresh
RETURN
* * * * * * *
Clear:
* * * * * * *
IF Get_Property(@WINDOW,'@READONLY') THEN
obj_AppWindow('ReadOnly',@RM:1) ;* Reenables data bound controls
Set_Property(@WINDOW,'@READONLY',0) ;* Clear flag on window
END
* * * * * * *
Refresh:
* * * * * * *
* Turn edit table symbolic column backgrounds to green
ETSymbolics = Get_Property(@WINDOW,'@ET_SYMBOLICS') ;* Loaded during 'Create' in obj_Appwindow
ETCtrls = ETSymbolics<1>
ETCols = ETSymbolics<2>
FOR I = 1 TO COUNT(ETCtrls,@VM) + (ETCtrls NE '')
ETCtrl = ETCtrls<1,I>
ETList = Get_Property(ETCtrl,'LIST')
FOR Line = 1 TO COUNT(ETList,@FM) + (ETList NE '')
IF ETList<Line,1> NE '' THEN
FOR N = 1 TO COUNT(ETCols<1,I>,@SVM) + (ETCols<1,I> NE '')
stat = Send_Message(ETCtrl,'COLOR_BY_POS',ETCols<1,I,N>,Line,GREEN$)
NEXT N
END
NEXT I
NEXT I
RETURN
* * * * * * *
Read:
* * * * * * *
GOSUB Refresh
RETURN
* * * * * * *
Write:
* * * * * * *
Post_Event(@WINDOW,'CLOSE')
Result = 1
RETURN
* * * * * * *
Close:
* * * * * * *
obj_Appwindow('DetailReturn')
RETURN
* * * * * * *
Delete:
* * * * * * *
/*
IF Security_Check('Order',Delete$) THEN
Result = 1 ;* Proceed with delete
END ELSE
Security_Err_Msg('Order',Delete$)
Result = 0 ;* Stop event chain
END
*/
RETURN
* * * * * * *
CalDtGF:
* * * * * * *
CurrDt = Get_Property(@WINDOW:'.CAL_DT','DEFPROP')
IF CurrDt = '' THEN GOSUB LUCalDt
RETURN
* * * * * * *
LUCalDt:
* * * * * * *
ReturnVal = OCONV(Dialog_Box("POPUP_MONTH",@WINDOW),'D4/')
obj_Appwindow('LUValReturn',ReturnVal:@RM:@WINDOW:'.CAL_DT':@RM:'')
RETURN

View File

@ -0,0 +1,187 @@
Compile function Calibration_Services(@Service, @Params)
#pragma precomp SRP_PreCompiler
$Insert LOGICAL
$Insert SERVICE_SETUP
$Insert CALIB_LIST_EQUATES
EQU COL$CL_NO TO 1
EQU COL$DEPT TO 2
EQU COL$EQ_INSTRUMENT TO 3
EQU COL$EQ_SN TO 4
EQU COL$EQ_LOC TO 5
EQU COL$EQ_CAL_INT TO 6
EQU COL$EQ_INT_EXT TO 7
EQU COL$EQ_LAST_CAL TO 8
EQU COL$EQ_NEXT_CAL TO 9
EQU COL$NIST_STANDARD TO 3
EQU COL$NIST_TSN TO 4
EQU COL$NIST_LOC TO 5
EQU COL$NIST_CAL_INT TO 6
EQU COL$NIST_INT_EXT TO 7
EQU COL$NIST_LAST_CAL TO 8
EQU COL$NIST_NEXT_CAL TO 9
GoToService
Return Response or ""
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Service Parameter Options
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Options BOOLEAN = True$, False$
Options CALIB_TYPES = 'Equipment', 'NIST'
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SERVICES
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Service GetCalibListData(CalibType=CALIB_TYPES, SelectActive=BOOLEAN)
If SelectActive EQ '' then SelectActive = False$
CalibListData = ''
ErrorMsg = ''
Begin Case
Case CalibType EQ 'Equipment'
OPEN 'CALIB_LIST' TO TableIn then
If SelectActive EQ False$ then
SELECT TableIn
* end else
* Select 'CALIB_LIST' By "" Using Cursor else
* ErrorMsg = 'Error in ':Service:' service. Error selecting CALIB_LIST records.'
* end
end
If ErrorMsg EQ '' then
EquipList = ''
EquipDescs = ''
Done = False$
Today = Date()
LOOP
READNEXT CLNo ELSE Done = True$
UNTIL Done
READ CalRec FROM TableIn,CLNo THEN
NextCalDt = XLATE('CALIB_LIST',CLNo,'NEXT_CAL_DT','X')
IF CalRec<CALIB_LIST_CL_TYPE$> = 'E' THEN
EquipDesc = CalRec<CALIB_LIST_EQ_DESC$>
Dept = CalRec<CALIB_LIST_DEPT$>
IF EquipDesc NE '' THEN
SortKey = Dept:'*':EquipDesc:'*':CLNo
LOCATE SortKey IN EquipDescs BY 'AL' SETTING Pos ELSE
EquipDescs = INSERT(EquipDescs,1,Pos,0,SortKey)
EquipLine = CLNo
EquipLine<1,COL$DEPT> = Dept
EquipLine<1,COL$EQ_INSTRUMENT> = CalRec<CALIB_LIST_EQ_DESC$>
EquipLine<1,COL$EQ_SN> = CalRec<CALIB_LIST_EQ_SN$>
EquipLine<1,COL$EQ_LOC> = CalRec<CALIB_LIST_EQ_LOC$>
EquipLine<1,COL$EQ_CAL_INT> = CalRec<CALIB_LIST_CAL_INTERVAL$>
EquipLine<1,COL$EQ_INT_EXT> = CalRec<CALIB_LIST_CAL_LOC$>
EquipLine<1,COL$EQ_LAST_CAL> = OCONV(XLATE('CALIB_LIST',CLNo,'LAST_CAL_DT','X'),'D4/')
EquipLine<1,COL$EQ_NEXT_CAL> = OCONV(NextCalDt,'D4/')
EquipList = INSERT(EquipList,Pos,0,0,EquipLine)
END ;* End of LOCATE SortKey
END ;* End of check for Null EquipDesc
END;* End of check for CL_TYPE = 'E'
END ;* End of CalRec read
REPEAT
CalibListData = EquipList
end
end else
ErrorMsg = 'Error in ':Service:' service. Unable to open "CALIB_LIST" table.'
end
Case CalibType EQ 'NIST'
OPEN 'CALIB_LIST' TO TableIn then
If SelectActive EQ False$ then
SELECT TableIn
* end else
* Select 'CALIB_LIST' By "" Using Cursor else
* ErrorMsg = 'Error in ':Service:' service. Error selecting CALIB_LIST records.'
* end
end
If ErrorMsg EQ '' then
NISTList = ''
StdDescs = ''
Done = False$
Today = Date()
LOOP
READNEXT CLNo ELSE Done = True$
UNTIL Done
READ CalRec FROM TableIn,CLNo THEN
NextCalDt = XLATE('CALIB_LIST',CLNo,'NEXT_CAL_DT','X')
IF CalRec<CALIB_LIST_CL_TYPE$> = 'S' THEN
StdDesc = CalRec<CALIB_LIST_STD_DESC$>
Dept = CalRec<CALIB_LIST_DEPT$>
IF StdDesc NE '' THEN
SortKey = Dept:'*':StdDesc:'*':CLNo
LOCATE SortKey IN StdDescs BY 'AL' SETTING Pos ELSE
StdDescs = INSERT(StdDescs,1,Pos,0,SortKey)
NISTLine = CLNo
NISTLine<1,COL$DEPT> = CalRec<CALIB_LIST_DEPT$>
NISTLine<1,COL$NIST_STANDARD> = CalRec<CALIB_LIST_STD_DESC$>
NISTLine<1,COL$NIST_TSN> = CalRec<CALIB_LIST_STD_SN$>
NISTLine<1,COL$NIST_LOC> = CalRec<CALIB_LIST_STD_LOC$>
NISTLine<1,COL$NIST_CAL_INT> = CalRec<CALIB_LIST_CAL_INTERVAL$>
NISTLine<1,COL$NIST_INT_EXT> = CalRec<CALIB_LIST_CAL_LOC$>
NISTLine<1,COL$NIST_LAST_CAL> = OCONV(XLATE('CALIB_LIST',CLNo,'LAST_CAL_DT','X'),'D4/')
NISTLine<1,COL$NIST_NEXT_CAL> = OCONV(NextCalDt,'D4/')
NISTList = INSERT(NISTList,Pos,0,0,NISTLine)
END ;* End of LOCATE SortKey
END ;* End of check for Null StdDesc
END ;* End of check for CL_TYPE = 'S'
END ;* End of CalRec read
REPEAT
CalibListData = NistList
end
end else
ErrorMsg = 'Error in ':Service:' service. Unable to open "CALIB_LIST" table.'
end
Case Otherwise$
ErrorMsg = 'Error in ':Service:' service. Null CalibType passed into service'
End Case
If ErrorMsg NE '' then Error_Services('Add', ErrorMsg)
Response = CalibListData
End Service

345
LSL2/STPROC/CALIB_LIST.txt Normal file
View File

@ -0,0 +1,345 @@
COMPILE FUNCTION Calib_List(EntID,Event,Parm1,Parm2,Parm3,Parm4,Parm5)
/*
Commuter module for CALIB_LIST (Calibration List) window
02/3/2010 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Send_Event, Set_Status, Center_Window, Post_Event, Set_List_Box_Data
DECLARE SUBROUTINE ErrMsg, Send_Message, Set_Property, Send_Event, Btree.Extract, obj_AppWindow
DECLARE SUBROUTINE obj_Notes, Security_Err_Msg, End_Window, Forward_Event, Start_Window, Create_Note
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Utility, Popup, Collect.Ixvals
DECLARE FUNCTION Send_Message, Msg, Security_Check, obj_React_Run_CI, NextKey, MemberOf
$INSERT MSG_EQUATES
$INSERT APPCOLORS
$INSERT LSL_USERS_EQU
$INSERT SECURITY_RIGHTS_EQU
$INSERT CALIB_LIST_EQUATES
$INSERT POPUP_EQUATES
EQU CRLF$ TO \0D0A\
EQU TAB$ TO \09\
EQU COL$CAL_DT TO 1
EQU COL$CAL_BY TO 2
EQU COL$CAL_NOTE TO 3
ErrTitle = 'Error in Calib_List routine'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE EntID = @WINDOW
BEGIN CASE
CASE Event = 'CLEAR' ; GOSUB Clear
CASE Event = 'CREATE' ; GOSUB Create
CASE Event = 'READ' ; GOSUB Read
CASE Event = 'WRITE' ; GOSUB Write
CASE Event[1,3] = 'QBF' ; GOSUB Refresh
END CASE
CASE EntID = @WINDOW:'.NEW_ITEM' AND Event = 'CLICK' ; GOSUB NewItem
CASE EntID = @WINDOW:'.LU_CL_NO' AND Event = 'CLICK' ; GOSUB LUCalibItem
CASE EntID = @WINDOW:'.LU_CL_TYPE' AND Event = 'CLICK' ; GOSUB LUCalibItemType
CASE EntID = @WINDOW:'.LU_CL_LOC' AND Event = 'CLICK' ; GOSUB LUCalibItemLoc
CASE EntID = @WINDOW:'.CALIBRATIONS' AND Event = 'DBLCLK' ; GOSUB CalibrationsDC
CASE EntID = @WINDOW:'.NEW_CALIBRATION' AND Event = 'CLICK' ; GOSUB NewCalibClick
CASE 1
ErrorMsg = 'Unknown Parameters ':EntID:' - ':Event:' passed to commuter'
ErrMsg(ErrorMsg)
END CASE
IF ErrorMsg NE '' THEN
ErrMsg(ErrTitle:@SVM:ErrorMsg)
END
RETURN Result
* * * * * * *
Create:
* * * * * * *
IF MemberOf(@USER4,'CALIBRATION') OR @USERNAME = 'BRYCE_BARB' ELSE
ErrMsg('Only authorized personnel may update the Calibration List.')
End_Window(@WINDOW)
RETURN
END
obj_Appwindow('Create',@WINDOW)
Set_List_Box_Data( @WINDOW )
GOSUB Refresh
RETURN
* * * * * * *
Clear:
* * * * * * *
IF Get_Property(@WINDOW,'@READONLY') THEN
obj_AppWindow('ReadOnly',@RM:1) ;* Reenables data bound controls
Set_Property(@WINDOW,'@READONLY',0) ;* Clear flag on window
END
* * * * * * *
Refresh:
* * * * * * *
* QBF buttons
Ctrls = @WINDOW:'.QBF_FIRST_FIX':@RM ; Props = 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_PREV_FIX':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_ABS_FIX':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_NEXT_FIX':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_LAST_FIX':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_STOP_FIX' ; Props := 'ENABLED'
IF Get_Property(@WINDOW,'QBFLIST') = '' THEN
Vals = 0:@RM:0:@RM:0:@RM:0:@RM:0:@RM:0
END ELSE
Vals = 1:@RM:1:@RM:1:@RM:1:@RM:1:@RM:1
END
Set_Property(Ctrls,Props,Vals)
* Turn edit table symbolic column backgrounds to green
ETSymbolics = Get_Property(@WINDOW,'@ET_SYMBOLICS') ;* Loaded during 'Create' in obj_Appwindow
ETCtrls = ETSymbolics<1>
ETCols = ETSymbolics<2>
FOR I = 1 TO COUNT(ETCtrls,@VM) + (ETCtrls NE '')
ETCtrl = ETCtrls<1,I>
ETList = Get_Property(ETCtrl,'LIST')
FOR Line = 1 TO COUNT(ETList,@FM) + (ETList NE '')
IF ETList<Line,1> NE '' THEN
FOR N = 1 TO COUNT(ETCols<1,Line>,@SVM) + (ETCols<1,Line> NE '')
stat = Send_Message(ETCtrl,'COLOR_BY_POS',ETCols<1,Line,N>,Line,GREEN$)
NEXT N
END
NEXT Line
NEXT I
RETURN
* * * * * * *
Read:
* * * * * * *
CLNo = Get_Property(@WINDOW:'.CL_NO','DEFPROP')
IF RowExists('CALIB_LIST',CLNo) ELSE
IF Get_Property(@WINDOW:'.ENTER_DTM','DEFPROP') = '' THEN
CurrDTM = OCONV(Date(),'D4/'):' ':OCONV(Time(),'MTH')
Set_Property(@WINDOW:'.ENTER_DTM','DEFPROP',CurrDTM)
END
END
GOSUB Refresh
RETURN
* * * * * * *
Write:
* * * * * * *
ParentVis = Get_Property('NDW_MASTER_CALIB_LIST', 'VISIBLE')
If ParentVis then Post_Event('NDW_MASTER_CALIB_LIST', 'OMNIEVENT')
RETURN
* * * * * * *
Delete:
* * * * * * *
/*
IF Security_Check('Order',Delete$) THEN
Result = 1 ;* Proceed with delete
END ELSE
Security_Err_Msg('Order',Delete$)
Result = 0 ;* Stop event chain
END
*/
RETURN
* * * * * * *
NewItem:
* * * * * * *
CLNo = Get_Property(@WINDOW:'.CL_NO','DEFPROP')
IF CLNo = '' THEN
NextCLNo = NextKey('CALIB_LIST')
obj_Appwindow('LoadFormKeys',@WINDOW:@RM:NextCLNo)
END
RETURN
* * * * * * *
LUCalibItem:
* * * * * * *
CLKeys = Popup(@WINDOW,'','CALIB_LIST')
IF Get_Status(errCode) THEN ErrMsg(ErrCode)
CONVERT @VM TO @FM IN CLKeys
IF INDEX(CLKeys,@FM,1) THEN
Send_Event(@WINDOW,'QBFINIT')
Set_Property(@WINDOW,'QBFLIST',CLKeys)
GOSUB Refresh
Send_Event(@WINDOW,'QBFIRST')
END ELSE
obj_Appwindow('LoadFormKeys',@WINDOW:@RM:CLKeys)
END
RETURN
* * * * * * *
LUCalibItemType:
* * * * * * *
CLItemType = Popup(@WINDOW,'','CALIB_LIST_TYPE')
IF Get_Status(errCode) THEN ErrMsg(ErrCode)
IF CLItemType NE '' THEN
obj_AppWindow('LUValReturn',CLItemType:@RM:@WINDOW:'.CL_TYPE')
END
RETURN
* * * * * * *
LUCalibItemLoc:
* * * * * * *
CLItemLoc = Popup(@WINDOW,'','CALIB_LIST_LOC')
IF Get_Status(errCode) THEN ErrMsg(ErrCode)
IF CLItemLoc NE '' THEN
obj_AppWindow('LUValReturn',CLItemLoc:@RM:@WINDOW:'.CAL_LOC')
END
RETURN
* * * * * *
Close:
* * * * * *
obj_Notes('Inbox',@USER4) ;* Checks for any new messages
Send_Event('MASTER_CALIB_LIST','CREATE')
RETURN
* * * * * * *
CalibrationsDC:
* * * * * * *
CtrlEntID = @WINDOW:'.CALIBRATIONS'
CurrPos = Get_Property(CtrlEntID,'SELPOS')
CurrCol = CurrPos<1>
CurrRow = CurrPos<2>
CalDt = Get_Property(CtrlEntID,'CELLPOS',COL$CAL_DT:@FM:CurrRow)
CalDt = ICONV(CalDt,'D')
CLNo = Get_Property(@WINDOW:'.CL_NO','DEFPROP')
IF CLNo NE '' AND CalDt NE '' THEN
IF Get_Property(@WINDOW,'QBFLIST') = '' THEN
Send_Event(@WINDOW,'WRITE')
END
oaParms = 'CALIBRATION':@RM
oaParms := CLNo:'*':CalDt:@RM
oaParms := '':@RM ;* Default Record
oaParms := CLNo:@RM
oaParms := @RM
oaParms := CtrlEntID:@RM
oaParms := CurrPos
obj_Appwindow('ViewNewDetail', oaParms)
END
RETURN
* * * * * * *
NewCalibClick:
* * * * * * *
CtrlEntID = @WINDOW:'.CALIBRATIONS'
CLNo = Get_Property(@WINDOW:'.CL_NO','DEFPROP')
IF CLNo NE '' THEN
IF Get_Property(@WINDOW,'QBFLIST') = '' THEN
Send_Event(@WINDOW,'WRITE')
END
oaParms = 'CALIBRATION':@RM
oaParms := CLNo:@RM
oaParms := '':@RM ;* Default Record
oaParms := CLNo:@RM
oaParms := @RM
oaParms := CtrlEntID:@RM
oaParms := 1:@FM:1
obj_Appwindow('ViewNewDetail', oaParms)
END
RETURN

View File

@ -0,0 +1,30 @@
SUBROUTINE CAR_CAUSE_STATUS_CONV(ConvType, DataIo, SubrLabel, ReturnedValue)
*
begin condition
pre:
post:
end condition
$insert logical
equ valid$ to 0 ;* successful
equ invalid_msg$ to 1 ;* bad data - print error message window
equ invalid_conv$ to 2 ;* bad conversion - " "
equ invalid_nomsg$ to 3 ;* bad but do not print the error message window
status() = Valid$
begin case
case ConvType = 'ICONV'
ReturnedValue = DataIo
case ConvType = 'OCONV'
begin case
case DataIo = 'E'
ReturnedValue = 'Execution'
case DataIo = 'C'
ReturnedValue = 'Correlation'
case DataIo = 'S'
ReturnedValue = 'System'
end case
case otherwise$
status() = invalid_msg$
end case
return

View File

@ -0,0 +1,28 @@
SUBROUTINE CAR_CONFIRM_STATUS_CONV(ConvType, DataIo, SubrLabel, ReturnedValue)
*
begin condition
pre:
post:
end condition
$insert logical
equ valid$ to 0 ;* successful
equ invalid_msg$ to 1 ;* bad data - print error message window
equ invalid_conv$ to 2 ;* bad conversion - " "
equ invalid_nomsg$ to 3 ;* bad but do not print the error message window
status() = Valid$
begin case
case ConvType = 'ICONV'
ReturnedValue = DataIo
case ConvType = 'OCONV'
begin case
case DataIo = 'C'
ReturnedValue = 'Confirmed'
case DataIo = 'U'
ReturnedValue = 'Unconfirmed'
end case
case otherwise$
status() = invalid_msg$
end case
return

143
LSL2/STPROC/CAR_RPT1.txt Normal file
View File

@ -0,0 +1,143 @@
compile function CAR_RPT1()
begin condition
pre:
post:
end condition
declare function getprinterlist, getprofilestring, writeprofilestring, extdevicemode
declare function msg, set_property, send_event, dialog_box, utility, get_property
declare function set_printer, Printer_Select
declare subroutine rlist, or_view, activate_save_select, yield, update_index
declare subroutine car_rpt1_prn
$insert rlist_equates
$insert msg_equates
Params = dialog_box( 'CAR_RPT1', @window, '*CENTER' )
if Params = 'CANCEL' or Params = '' then
return 0
end
open 'SYSLISTS' to SysListsTable else
MsgInfo = ''
MsgInfo<mcol$> = -2
MsgInfo<mrow$> = -2
MsgInfo<mtext$> = 'Unable to open SYSLISTS...'
Void = msg( '', MsgInfo )
return 0
end
ListsId = 'CAR_RPT1*':@station
write '' on SysListsTable, ListsId else
MsgInfo = ''
MsgInfo<mcol$> = -2
MsgInfo<mrow$> = -2
MsgInfo<mtext$> = 'Unable to clear SYSLISTS ':ListsId:'...'
Void = msg( '', MsgInfo )
return 0
end
convert '*' to @fm in Params
Custs = Params<1>
IssueDateFrom = Params<2>
IssueDateThru = Params<3>
Open = Params<4>
FormComplete = Params<5>
CARInPlace = Params<6>
Verified = Params<7>
DirToPrinter = Params<8>
Stat = utility( 'CURSOR', 'H' )
Stmt = 'SELECT CAR BY CUST_CITY BY ISSUE_DATE'
if IssueDateFrom and IssueDateThru then
Stmt := " WITH ISSUE_DATE FROM ":QUOTE(IssueDateFrom):' TO ':QUOTE(IssueDateThru)
end else
if IssueDateFrom then
Stmt := " WITH ISSUE_DATE GE ":QUOTE(IssueDateFrom)
end
if IssueDateThru then
Stmt := " WITH ISSUE_DATE LE ":QUOTE(IssueDateThru)
end
end
if Custs then
swap @vm with "' '" in Custs
Custs = "'":Custs:"'"
Stmt := ' AND WITH CUST_ID = ':Custs
end
CARStatusVar = ''
if Open then
CARStatusVar := " 'O'"
end
if FormComplete then
CARStatusVar := " 'F'"
end
if CARInplace then
CARStatusVar := " 'C'"
end
if Verified then
CARStatusVar := "'V'"
end
if CarStatusVar then
Stmt := ' AND WITH STATUS = ':CARStatusVar
end
rlist( Stmt, target_savelist$, ListsId, '', '' )
activate_save_select( ListsId )
if @reccount then
Cmd = "LIST CAR ID-SUPP SEQ JUSTLEN '5' COLHEAD 'CAR#' CUST_CITY JUSTLEN '50' CONTACT_NAME WO COMPLAINT_TYPE JUSTLEN '30' "
Cmd:= "ISSUE_DATE TOTAL EST_LOSS_VALUE TOTAL ACT_LOSS_VALUE "
Cmd:= " HEADING ":'"':" Customer Advisories by Customer by Issue Date 'T'"
Cmd:= " PAGE # 'P' by selected Issue dates from "
Cmd:= "(":IssueDateFrom:") Thru (":IssueDateThru:" ) ":'"'
if DirToPrinter = 'Yes' then
PrintPath = Printer_Select('',1) ;* Get default printer path
Void = set_printer( 'INIT', '', '', '':@fm:1, 1, '',PrintPath )
car_rpt1_prn( iconv( IssueDateFrom, 'D' ), iconv( IssueDateThru, 'D' ) )
Void = set_printer( 'TERM' )
Void = set_printer( 'INIT', '', '', '', 0, '' )
Void = set_printer( 'TERM' )
end else
or_view( '', Cmd )
*SysSize = get_property( 'SYSTEM', 'SIZE' )
*Void = send_event( 'ORPRV', 'SIZE', 1:@fm:1:@fm:SysSize<1>:@fm:SysSize<2> )
Void = set_property( 'ORPRV.PRINT', 'ENABLED', 0 )
WinId = 'ORPRV'
loop
while get_property( WinId, 'HANDLE' )
yield()
repeat
ToPrint = ''
MsgInfo = ''
MsgInfo<mtext$> = 'Do you want to print this report?'
MsgInfo<micon$> = '?'
MsgInfo<mtype$> = 'BNY'
MsgInfo<mcol$> = -2
MsgInfo<mrow$> = -2
MsgInfo<mdefbtn$> = 2 ;* default to no
ToPrint = msg( @window, MsgInfo )
if ToPrint then
activate_save_select( ListsId )
Void = set_printer( 'INIT', '', '', '':@fm:1, 1, '' )
car_rpt1_prn( iconv( IssueDateFrom, 'D' ), iconv( IssueDateThru, 'D' ) )
Void = set_printer( 'TERM' )
Void = set_printer( 'INIT', '', '', '', 0, '' )
Void = set_printer( 'TERM' )
end
end
end else
MsgInfo = ''
MsgInfo<mcol$> = -2
MsgInfo<mrow$> = -2
MsgInfo<mtext$> = 'NO Records meeting your date criteria!!'
MsgInfo<micon$> = '!'
Void = MSG( '', MsgInfo )
end
write '' on SysListsTable, ListsId else
MsgInfo = ''
MsgInfo<mcol$> = -2
MsgInfo<mrow$> = -2
MsgInfo<mtext$> = 'Unable to clear SYSLISTS ':ListsId:'...'
Void = msg( '', MsgInfo )
return 0
end
return 0

View File

@ -0,0 +1,206 @@
compile subroutine car_rpt1_prn( IssueDateFrom, IssueDateThru )
!
* LIST CAR ID-SUPP SEQ JUSTLEN '5' COLHEAD 'CAR#' CUST_CITY JUSTLEN '50' CONTACT_NAME WO COMPLAINT_TYPE JUSTLEN '30' EST_LOSS_VALUE ACT_LOSS_VALUE HEADING " Customer Advisories by Customer by Issue Date 'T' PAGE # 'P' by selected Issue dates from (2/1/98) Thru (3/13/98 ) "
!
*PRINTER ON
*
* HEADING/FOOTING
declare function set_printer, MSG
Font = 'Courier New,8,L,0'
convert ',' to @fm in Font
HeadPos = '.5,3,1.5,.75,1.8,.75,1,1'
convert ',' to @fm in HeadPos
TheHeader = " Customer Advisories by Customer by Issue Date 'T' PAGE # 'P' by selected issue dates from (":oconv(IssueDateFrom, 'D2/'):") Thru (":oconv(IssueDateThru, 'D2/' ):')':@fm
ColHeader = "Car#" : @vm : "Customer/City" : @vm : "Contact Name" : @vm : "WO" : @vm : "Complaint Type" : @vm : "Issue" : @vm : "Estimated" : @vm : "Actual"
ColHeader<-1> = "" : @vm : "" : @vm : "" : @vm : "" : @vm : "" : @vm : "Date" : @vm : "Loss Value" : @vm : "Loss Value"
Tvar = str( '_', 7):@vm:str( '_', 42):@vm:str( '_', 30):@vm:str( '_', 14):@vm
Tvar:= str( '_',30 ):@vm:str( '_', 12 ):@vm:str( '_', 15):@vm:str( '_', 15 )
*COLHEADER = ''
ColHeader<-1> = Tvar
*TheHeader = ''
Void = set_printer( 'FONTHEADFOOT', Font )
Void = set_printer( 'HEADER', TheHeader, HeadPos, ColHeader )
Void = set_printer( 'FONT', Font )
*FOOTING ""
*
@RECCOUNT=0
FIRST.PASS=1
LAST.RECORD=0
READERR=0
*
* OPEN DICT AND DATA FILES
*
OPEN "DICT","CAR" TO @DICT ELSE return
OPEN "","CAR" TO FILE.IN ELSE return
*
* MAKE COLUMN HEADING
*
*
* ZERO ACCUMULATORS FOR EACH BREAK
*
ESTULLOSSULVALUE.GRAND.TOTAL=0
ESTULLOSSULVALUE.GRAND.COUNT=0
*
ACTULLOSSULVALUE.GRAND.TOTAL=0
ACTULLOSSULVALUE.GRAND.COUNT=0
*
!
READRECORD:
!
*
*
@FILE.ERROR.MODE=1
READNEXT @ID,WHICH.VALUE ELSE
@FILE.ERROR.MODE=0
IF STATUS() GT 0 THEN
@ANS=@FILE.ERROR<1>
Void = set_printer( 'TEXT', {RLIST_TEXT_5} )
return
END
IF @FILE.ERROR<1> EQ 421 THEN
Void = set_printer( 'TEXT', {RLIST_TEXT_6} )
GOTO READRECORD
END
IF @FILE.ERROR<1> NE 111 THEN
@ANS=@FILE.ERROR<1>
Void = set_printer( 'TEXT', {RLIST_TEXT_4} )
READERR+=1
GOTO READRECORD
END
LAST.RECORD=1
END
@FILE.ERROR.MODE=0
*
S.ATID=@ID
*
IF FIRST.PASS AND LAST.RECORD THEN
Void = set_printer( 'TEXT', {RLIST_TEXT_2} )
return
END
*
IF LAST.RECORD THEN GOTO BREAKS
*
IF @REDUCTION.DONE THEN
@FILE.ERROR.MODE=1
READO @RECORD FROM FILE.IN,@ID ELSE
@FILE.ERROR.MODE=0
IF STATUS() GT 0 THEN
@ANS=@FILE.ERROR<1>
Void = set_printer( 'TEXT', {RLIST_TEXT_5} )
return
END
IF @FILE.ERROR<1> NE 100 THEN
@ANS=@FILE.ERROR<1>
Void = set_printer( 'TEXT', {RLIST_TEXT_4} )
READERR+=1
END
GOTO READRECORD
END
@FILE.ERROR.MODE=0
END
*
@RECCOUNT+=1
*
*
* CALCULATE VALUE(S) FOR COLUMN(S)
*
S.ATID={@ID}
I.ATID=S.ATID
S.SEQ={SEQ}
I.SEQ=S.SEQ
S.CUSTULCITY={CUST_CITY}
I.CUSTULCITY=S.CUSTULCITY
S.CONTACTULNAME={CONTACT_NAME}
I.CONTACTULNAME=S.CONTACTULNAME
S.WO={WO}
I.WO=S.WO
S.COMPLAINTULTYPE={COMPLAINT_TYPE}
I.COMPLAINTULTYPE=S.COMPLAINTULTYPE
S.ISSUEDATE={ISSUE_DATE}
I.ISSUEDATE=S.ISSUEDATE
S.ESTULLOSSULVALUE={EST_LOSS_VALUE}
I.ESTULLOSSULVALUE=S.ESTULLOSSULVALUE
S.ACTULLOSSULVALUE={ACT_LOSS_VALUE}
I.ACTULLOSSULVALUE=S.ACTULLOSSULVALUE
*
*
IF FIRST.PASS THEN
FIRST.PASS=0
GOTO DETAIL
END
*
*
!
BREAKS:
!
*
*
* PERFORM LAST RECORD OUTPUT IF DONE
*
IF LAST.RECORD THEN
PRINTLINE = "***":@vm
PRINTLINE:= "":@vm
PRINTLINE:= "":@vm
PRINTLINE:= "":@vm
PRINTLINE:= "":@vm
PRINTLINE:= "":@vm
PRINTLINE:= OCONV(ESTULLOSSULVALUE.GRAND.TOTAL ,"MD2,$"):@vm
PRINTLINE:= OCONV(ACTULLOSSULVALUE.GRAND.TOTAL ,"MD2,$"):@vm
TableColInfo = '>+720':@vm:'<+4320':@vm:'<+2160':@vm:'>+1080':@vm:'<+2592':@vm:'>+1080':@vm:'>+1440':@vm:'>+1440'
Void = set_printer( 'ADDTABLE', TableColInfo, '', PRINTLINE, '', '', 1, TB_NONE )
* PRINT
* @ANS=@REC.COUNT
* PRINT {RLIST_TEXT_1}
IF READERR THEN
@ANS=READERR
Void = set_printer( 'TEXT', {RLIST_TEXT_3} )
END
return
END
*
!
DETAIL:
!
*
* DO CONVERSIONS IF ANY
*
IF S.SEQ NE "" THEN S.SEQ=OCONV(S.SEQ,"MD0")
IF S.WO NE "" THEN S.WO=OCONV(S.WO,"MD0")
IF S.ISSUEDATE NE "" THEN S.ISSUEDATE=OCONV(S.ISSUEDATE,"D2/")
IF S.ESTULLOSSULVALUE NE "" THEN S.ESTULLOSSULVALUE=OCONV(S.ESTULLOSSULVALUE,"MD2,$")
IF S.ACTULLOSSULVALUE NE "" THEN S.ACTULLOSSULVALUE=OCONV(S.ACTULLOSSULVALUE,"MD2,$")
*
*
* ACCUMULATE TOTAL(S)
*
IF NUM(I.ESTULLOSSULVALUE) AND I.ESTULLOSSULVALUE NE "" THEN
ESTULLOSSULVALUE.GRAND.TOTAL+=I.ESTULLOSSULVALUE
ESTULLOSSULVALUE.GRAND.COUNT+=1
I.ESTULLOSSULVALUE=''
END
IF NUM(I.ACTULLOSSULVALUE) AND I.ACTULLOSSULVALUE NE "" THEN
ACTULLOSSULVALUE.GRAND.TOTAL+=I.ACTULLOSSULVALUE
ACTULLOSSULVALUE.GRAND.COUNT+=1
I.ACTULLOSSULVALUE=''
END
*
* PRINT DETAIL LINE
*
PRINTLINE = S.SEQ:@vm
PRINTLINE:= S.CUSTULCITY:@vm
PRINTLINE:= S.CONTACTULNAME:@vm
PRINTLINE:= S.WO:@vm
PRINTLINE:= S.COMPLAINTULTYPE:@vm
PRINTLINE:= S.ISSUEDATE:@vm
PRINTLINE:= S.ESTULLOSSULVALUE:@vm
PRINTLINE:= S.ACTULLOSSULVALUE
TableColInfo = '>+720':@vm:'<+4320':@vm:'<+2160':@vm:'>+1080':@vm:'<+2592':@vm:'>+1080':@vm:'>+1440':@vm:'>+1440'
Void = set_printer( 'ADDTABLE', TableColInfo, '', PRINTLINE, '', '', 1, TB_NONE )
*
*
GOTO READRECORD
*
END

202
LSL2/STPROC/CAR_SRPT1.txt Normal file
View File

@ -0,0 +1,202 @@
compile function CAR_SRPT1()
declare function msg, set_property, send_event, dialog_box, utility, get_property
declare function set_printer, PrintSetup, obj_Install
declare subroutine rlist, or_view, activate_save_select, yield
declare subroutine order_srpt1
$insert rlist_equates
$insert msg_equates
$insert oiprint_equates
$insert rpt_cfg_equ
$INSERT PRINTSETUP_EQUATES
TimeX = Oconv(Time(),'MTS')
CrLf = Char(13):Char(10)
CurDte = OCONV(Date(),"D4/")
ReportID = "CAR001_SRPTCFG"
ReportControl = "CAR_SRPT1"
TableName = 'CAR'
TtlLin1 = ''
TtlLin2 = ''
TtlLin3 = ''
TtlLin4 = ''
open 'CONFIG' to ConfigTable else
Void = msg( '', 'Unable to open CONFIG...' )
return 0
end
Read SRptConfig From ConfigTable,ReportID Else
Void = msg( '', 'Unable to read ': ReportID:' From CONFIG table!' )
return 0
End
Params = dialog_box( ReportControl, @window, '*CENTER' )
if Params = 'CANCEL' or Params = '' then
return 0
end
open 'SYSLISTS' to SysListsTable else
Void = msg( '', 'Unable to open SYSLISTS...' )
return 0
end
ListsId = ReportControl:'*':@station
write '' on SysListsTable, ListsId else
Void = msg( '', 'Unable to clear SYSLISTS ':ListsId:'...' )
return 0
end
convert '*' to @fm in Params
Custs = Params<1>
BegDte = Params<2>
EndDte = Params<3>
Open = Params<4>
FormComplete = Params<5>
CARInPlace = Params<6>
Verified = Params<7>
Void = utility( 'CURSOR', 'H' )
WithStmt = 'SELECT ':TableName:' '
WthSwt = 0
IssueDateLimit = ''
Begin Case
Case BegDte and EndDte
TtlLin2 = 'Issue Dates: From ':BegDte:' To ':EndDte
WithStmt := " WITH ISSUE_DATE FROM '": BegDte:"' TO '":EndDte: "' "
IssueDateLimit = 'LIMIT ISSUE_DATE FROM "':BegDte:'" TO "':EndDte:'" '
WthSwt = 1
Case BegDte
TtlLin2 = 'Issue Dates: From ':BegDte:' To ':CurDte
WithStmt := " WITH ISSUE_DATE GE '":BegDte:"' "
IssueDateLimit = 'LIMIT ISSUE_DATE FROM "':BegDte:'" TO "':CurDte:'" '
WthSwt = 1
Case EndDte
TtlLin2 = 'Issue Dates: From Earliest To ':EndDte
WithStmt := " WITH ISSUE_DATE LE '":EndDte:"' "
IssueDateLimit = 'LIMIT ISSUE_DATE <= "':CurDte:'" '
WthSwt = 1
Case 1
TtlLin2 = 'Issue Dates: ALL'
End Case
If Custs then
CustCnt = Count(@vm,Custs)
If CustCnt > 20 Then
TtlLin3 = 'Customers: More Than 20 Selected'
End Else
TtlLin3 = Custs
swap @vm with ", " in TtlLin3
TtlLin3 = 'Customers: ':TtlLin3
End
swap @vm with "' '" in Custs
Custs = "'":Custs:"'"
If WthSwt Then WithStmt := ' AND '
WithStmt := ' WITH CUST_ID = ':Custs
WthSwt = 1
end else
TtlLin3 = 'Customers: ALL'
end
CARStatusVar = ''
TtlLin4 = 'Status: '
CarSwt = 0
if Open then
CARStatusVar := " 'O'"
TtlLin4 := 'Open'
CarSwt = 1
end
if FormComplete then
CARStatusVar := " 'F'"
If CarSwt Then TtlLin4 := ', '
TtlLin4 := 'Form Complete'
CarSwt = 1
end
if CARInplace then
CARStatusVar := " 'C'"
If CarSwt Then TtlLin4 := ', '
TtlLin4 := 'Car In Place'
CarSwt = 1
end
if Verified then
CARStatusVar := " 'Verified'"
If CarSwt Then TtlLin4 := ', '
TtlLin4 := 'Verified'
CarSwt = 1
end
If CarSwt Else TtlLin4 := 'All'
TmpVar = Count(TtlLin4,', ')
If TmpVar Then
TmpVar = Index(TtlLin4,', ',TmpVar)
TtlLin4[TmpVar,1] = ' And'
End
if CarStatusVar then
If WthSwt Then WithStmt := ' AND '
WithStmt := ' WITH STATUS = ':CARStatusVar:' '
end
rlist( WithStmt, target_savelist$, ListsId, '', '' )
activate_save_select( ListsId )
Script = SRptConfig<SlistScript$>
RptWdt = SRptConfig<Width$>
Title = obj_Install('Get_Prop','Company'):' ':SRptConfig<Title$>
Margin = INT((RptWdt - LEN(Title))/2)
LMargin = Margin - 10 ;* 10 equals length of the date
RMargin = Margin - 8 ;* 8 equals length of 'Page....'
Title = OCONV(Date(),'D4/'):SPACE(LMargin):Title:SPACE(RMargin):"Page'PP''L'"
SWAP '~Title~' WITH Title IN Script
TitleLine2 = TtlLin2
TitleLine3 = TtlLin3
TitleLine4 = TtlLin4
IF TitleLine2 NE '' THEN
Margin = INT((RptWdt - LEN(TitleLine2))/2)
LMargin = Margin - 7 ;* 7 equals length of time (12:15PM)
RMargin = Margin
TitleLine2 = OCONV(Time(),'MTH'):SPACE(LMargin):TitleLine2:SPACE(RMargin)
SWAP '~SecondTitleLine~' WITH TitleLine2 IN Script
END ELSE
SWAP '~SecondTitleLine~' WITH '' IN Script
END
IF TitleLine3 NE '' THEN
Margin = INT((RptWdt - LEN(TitleLine3))/2)
SWAP '~ThirdTitleLine~' WITH "'L'":TitleLine3 IN Script
END ELSE
SWAP '~ThirdTitleLine~' WITH '' IN Script
END
IF TitleLine4 NE '' THEN
Margin = INT((RptWdt - LEN(TitleLine4))/2)
SWAP '~FourthTitleLine~' WITH "'L'":TitleLine4 IN Script
END ELSE
SWAP '~FourthTitleLine~' WITH '' IN Script
END
* Added after upgrade to OI4.13a to reset default printer in OIPI32 engine.
PrintCount = PrintSetup(PRN_GET$,'',Printers,DefaultPrinter)
CONVERT ',' TO @FM IN DefaultPrinter
DefPrintPath = DefaultPrinter<1>:@FM:DefaultPrinter<3>
Void = set_printer( 'INIT', '', '', .63:@fm:.63:@fm:.25:@fm:'', 0,'',DefPrintPath )
Void = Set_Printer('TERM')
call slist( Script )
Void = utility( 'CURSOR', 'A' )
write '' on SysListsTable, ListsId else
Void = msg( '', 'Unable to clear SYSLISTS ':ListsId:'...' )
return 0
end
RETURN 0

View File

@ -0,0 +1,32 @@
SUBROUTINE CAR_STATUS_CONV(ConvType, DataIo, SubrLabel, ReturnedValue)
*
begin condition
pre:
post:
end condition
$insert logical
equ valid$ to 0 ;* successful
equ invalid_msg$ to 1 ;* bad data - print error message window
equ invalid_conv$ to 2 ;* bad conversion - " "
equ invalid_nomsg$ to 3 ;* bad but do not print the error message window
status() = Valid$
begin case
case ConvType = 'ICONV'
ReturnedValue = DataIo
case ConvType = 'OCONV'
begin case
case DataIo = 'O'
ReturnedValue = 'Open'
case DataIo = 'F'
ReturnedValue = 'Form Completed'
case DataIo = 'C'
ReturnedValue = 'CAR In Place'
case DataIo = 'V'
ReturnedValue = 'Verified'
end case
case otherwise$
status() = invalid_msg$
end case
return

View File

@ -0,0 +1,34 @@
SUBROUTINE CASS_CURR_STATUS_CONV(ConvType, DataIo, SubrLabel, ReturnedValue)
*
begin condition
pre:
post:
end condition
$insert logical
equ valid$ to 0 ;* successful
equ invalid_msg$ to 1 ;* bad data - print error message window
equ invalid_conv$ to 2 ;* bad conversion - " "
equ invalid_nomsg$ to 3 ;* bad but do not print the error message window
status() = Valid$
begin case
case ConvType = 'ICONV'
ReturnedValue = DataIo
case ConvType = 'OCONV'
Vals = XLATE('SYSREPOSPOPUPS','LSL2**RDS_CURR_STATUS',8,'X')
Desc = ''
LOOP
Val = Vals[1,@VM]
Code = Val[1,@SVM]
Desc = Val[COL2()+1,@SVM]
UNTIL Code = DataIO OR Vals = ''
Vals = DELETE(Vals,1,1,0)
REPEAT
ReturnedValue = Desc
case otherwise$
status() = invalid_msg$
end case
return

View File

@ -0,0 +1,38 @@
Compile function CDM_LOG_EVENTS(CtrlEntId, Event, @PARAMS)
Declare function SRP_DateTime, Oconv, DateTime
Declare subroutine Set_Property
#pragma precomp SRP_PreCompiler
#window CDM_LOG
GoToEvent Event for CtrlEntId else
// Event not implemented
end
Return EventFlow or 1
//-----------------------------------------------------------------------------
// EVENT HANDLERS
//-----------------------------------------------------------------------------
Event WINDOW.CREATE(CreateParam)
EventFlow = 1
End Event
Event SIGN_BUTTON.CLICK()
IF @User4 EQ 'JONATHAN_O' then debug
Date = SRP_DateTime("Date", DateTime())
Time = SRP_DateTime("Time", Datetime())
iDate = OConv(Date, 'D4/H')
iTime = OConv(Time, 'MTS')
Set_Property(@Window : '.DATE_CHANGED', 'DEFPROP', iDate)
Set_Property(@Window : '.TIME_CHANGED', 'DEFPROP', iTime)
end event

View File

@ -0,0 +1,77 @@
COMPILE ROUTINE Change_Company(Dummy)
ROWDEF(CHARSTR)
DECLARE SUBROUTINE Send_Dyn,Send_Info
DECLARE FUNCTION Get_Status, Set_Printer
OPEN 'CONFIG' To ConfigTable THEN
Select ConfigTable
ConfigKeys = ''
Done = 0
LOOP
READNEXT ConfigKey ELSE Done = 1
UNTIL Done
IF ConfigKey[1,3] = 'Org' ELSE
READ ConfigRec FROM ConfigTable,ConfigKey THEN
IF INDEX(ConfigRec,'ATMI',1) THEN
Send_Dyn(ConfigKey)
END
END
END
REPEAT
ConfigKeyCnt = COUNT(ConfigKeys,@FM) + ( ConfigKeys NE '')
OPEN 'SYSPROCS' TO ProcsTable THEN
SELECT ProcsTable
Done = 0
LOOP
READNEXT @ID ELSE Done = 1
UNTIL Done
READ @RECORD FROM ProcsTable,@ID THEN
IF INDEX(@RECORD,'ATMI',1) THEN
Send_Dyn(@ID)
END
END
REPEAT
END
OPEN 'SYSREPOSEVENTS' TO ProcsTable THEN
SELECT ProcsTable
Done = 0
LOOP
READNEXT @ID ELSE Done = 1
UNTIL Done
READ @RECORD FROM ProcsTable,@ID THEN
IF INDEX(@RECORD,'ATMI',1) THEN
Send_Dyn(@ID)
END
END
REPEAT
END
IF Get_Status(errCode) THEN DEBUG
* * * * * * *
Bail:
* * * * * * *
END

View File

@ -0,0 +1,74 @@
FUNCTION CHANGE_LOG_SERVICES(@Service, @Params)
#pragma precomp SRP_PreCompiler
$Insert LOGICAL
$insert SERVICE_SETUP
$Insert REVDOTNETEQUATES
Declare function Repository, Get_Repos_Entities, SRP_DateTime, SRP_Array, Get_Status, Set_Status, Errmsg, Datetime
Declare subroutine Set_Status, Errmsg, Error_Services
Declare Function Database_Services
Declare Function Environment_Services
GoToService else
Error_Services('Add', Service : ' is not a valid service request within the ' : ServiceModule : ' services module.')
end
Return Response OR ''
//Write to sharepoint
Service WriteToSharePoint()
hSysLists = Database_Services('GetTableHandle', 'SYSLISTS')
Lock hSysLists, ServiceKeyID then
//Define the dotNet version
DotNetHandle = StartDotNet("","4.0")
//Specify the DLL
rv = Set_Property.NET(DotNetHandle, "AssemblyName", "D:\Apps\OICurrent\IFXAPI\SharePoint\SharePointTools.dll")
//Create_Class.NET(//Define the classes
SPApi = Create_Class.NET(DotNetHandle, "SharePointTools.ExportToSharePoint", 0)
//Set report start time to the past 30 minutes.
StartDateTime = Datetime()
StartDateTime = SRP_DateTime("AddMinutes", StartDateTime, -15)
//StartDateTime = SRP_DateTime('AddDays', StartDateTime, -7)
//Pull in a list of all existing entities
AllEntityIDs = Get_Repos_Entities('LSL2', '', '', 0, 1, 0, '')
EntityList = ''
Server = Environment_Services('GetServer')
IF Server EQ 'MESSA005' then
Environment = 'PROD'
end else
Environment = 'DEV'
end
For Each EntityID in AllEntityIDs using @FM
Set_Status(0)
statList = ''
Entity = Repository('GET', EntityID)
time = Entity<25>
If time GE StartDateTime then
time = OCONV(time,'DT4/^H')
(application, entityType, entityClass, entityName) using '*' = EntityID
updatedBy = Entity<26>
IF entityType NE 'STPROCDBG' AND entityType NE 'STPROCEXE' then
SharePointLog = Send_Message.NET(SPApi, "SendToList",time:@FM:application:@FM:entityType:@FM:entityClass:@FM:entityName:@FM:updatedBy:@FM:Environment, "System.String":@FM:"System.String":@FM:"System.String":@FM:"System.String":@FM:"System.String":@FM:"System.String":@FM:"System.String")
end
end
test1='test'
Next EntityID
end
Unlock hSysLists, ServiceKeyID else Null
end service

139
LSL2/STPROC/CHART_TEST.txt Normal file
View File

@ -0,0 +1,139 @@
COMPILE FUNCTION Chart_Test(EntID,Event,Parm1,Parm2,Parm3,Parm4,Parm5)
/*
Commuter module for Chart_Test collector window
11/17/2009 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Send_Event, Set_Status, Center_Window, Post_Event
DECLARE SUBROUTINE ErrMsg, Send_Message, Set_Property, Send_Event, obj_Appwindow
DECLARE SUBROUTINE obj_Notes, Security_Err_Msg, End_Window, Start_Window, Create_Note
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Notes_Comm
DECLARE FUNCTION Send_Message, Msg, Security_Check
$INSERT MSG_EQUATES
$INSERT APPCOLORS
$INSERT LOGICAL
EQU CRLF$ TO \0D0A\
EQU TAB$ TO \09\
ErrTitle = 'Error in Chart_Test commuter'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE EntID = @WINDOW
BEGIN CASE
CASE Event = 'CREATE' ; GOSUB Create
END CASE
CASE EntID = 'NOTES_ATTACH.SAVE_BUTTON' AND Event = 'CLICK' ; GOSUB Save
CASE 1
ErrorMsg = 'Unknown Parameters ':EntID:' - ':Event:' passed to commuter'
ErrMsg(ErrorMsg)
END CASE
IF ErrorMsg NE '' THEN
ErrMsg(ErrTitle:@SVM:ErrorMsg)
END
RETURN Result
* * * * * * *
Create:
* * * * * * *
obj_Appwindow('Create',@WINDOW)
DEBUG
hChart = @WINDOW:'.CHART'
strResult = Send_Message(hChart,'Clear')
c = Get_Property(hChart,'Constants')
Charts = Get_Property(hChart,'Charts')
Chart = Send_Message(hChart,'Add')
chChartTypeColumnClustered = Get_Property(c,'chChartTypeColumnClustered')
Set_Property(Chart,'Type',chChartTypeColumnClustered)
Set_Property(Chart,'HasLegend',TRUE$)
Status = OleStatus() ; IF Status THEN DEBUG
Set_Property(Chart,'HasTitle',TRUE$)
Title = Get_Property(Chart,'Title')
Set_Property(Title,'Caption','Random Walk ':TimeDate() )
SeriesCollection = Get_Property(Chart,'SeriesCollection')
FOR I = 1 TO 4
Series = Send_Message(SeriesCollection,'Add')
Set_Property(Series,'Caption','Q':I)
Categories = ''
Vals = ''
FOR J = 1 TO 5
Categories<J> = 'Region ':J
Vals<J> = RND(100)
NEXT J
CONVERT @FM TO TAB$ IN Categories
CONVERT @FM TO TAB$ IN Vals
chDimCategories = Get_Property(c,'chDimCategories')
chDimValues = Get_Property(c,'chDimValues')
chDimDataLiteral = Get_Property(c,'chDataLiteral')
x = Send_Message(Series,'SetData',chDimCategories,chDimDataLiteral,Categories)
x = Send_Message(Series,'SetData',chDimValues,chDimDataLiteral,Vals)
NEXT I
RETURN
* * * * * * *
Save:
* * * * * * *
RETURN

View File

@ -152,3 +152,4 @@ end service

View File

@ -0,0 +1,24 @@
function check_notes(Branch)
declare function set_property, fieldcount, get_property, msg, dialog_box
* begin condition
* pre:
* post:
* end condition
$insert msg_equates
$insert note_ptrs_equ
if xlate( 'NOTE_PTRS', @user4, 'NEW_MESSAGES', 'X' ) then
NotePtrRec = xlate( 'NOTE_PTRS', @user4, '', 'X' )
if NotePtrRec<note_ptrs_new$,1> = 'Yes' then
* the top one is new meaning they got a new one
MsgInfo = ''
MsgInfo<micon$> = '!'
Mtext = 'You have a new message from ':NotePtrRec<note_ptrs_from$,1>:'.'
MsgInfo<mtext$> = MText
MsgInfo<mcol$> = -2
MsgInfo<mrow$> = -2
Void = msg( '', MsgInfo )
end
end
Return 0

2149
LSL2/STPROC/CLEAN_INSP.txt Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,947 @@
Function CLEAN_INSP_Actions(Action, CalcColName, FSList, Handle, Name, FMC, Record, Status, OrigRecord, Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10)
/***********************************************************************************************************************
This program is proprietary and is not to be used by or disclosed to others, nor is it to be copied without written
permission from Infineon.
Name : CLEAN_INSP_Actions
Description : Handles calculated columns and MFS calls for the current table.
Notes : This function uses @ID, @RECORD, and @DICT to make sure {ColumnName} references work correctly.
If called from outside of a calculated column these will need to be set and restored.
Parameters :
Action [in] -- Name of the action to be taken
CalcColName [in] -- Name of the calculated column that needs to be processed. Normally this should only be
populated when the CalcField action is being used.
FSList [in] -- The list of MFSs and the BFS name for the current file or volume. This is an @SVM
delimited array, with the current MFS name as the first value in the array, and the BFS
name as the last value. Normally set by a calling MFS.
Handle [in] -- The file handle of the file or media map being accessed. Note, this does contain the
entire handle structure that the Basic+ Open statement would provide. Normally set by a
calling MFS.
Name [in] -- The name (key) of the record or file being accessed. Normally set by a calling MFS.
FMC [in] -- Various functions. Normally set by a calling MFS.
Record [in] -- The entire record (for record-oriented functions) or a newly-created handle (for
"get handle" functions). Normally set by a calling MFS.
Status [in/out] -- Indicator of the success or failure of an action. Normally set by the calling MFS but
for some actions can be set by the action handler to indicate failure.
OrigRecord [in] -- Original content of the record being processed by the current action. This is
automatically being assigned by the WRITE_RECORD and DELETE_RECORD actions within
BASE_MFS.
Param1-10 [in/out] -- Additional request parameter holders
ActionFlow [out] -- Used to control the action chain (see the ACTION_SETUP insert for more information.)
Can also be used to return a special value, such as the results of the CalcField
method.
History : (Date, Initials, Notes)
07/28/10 dmb Original programmer.
10/13/10 dmb Fix logic to extract the file handle if file has an index
03/26/11 dmb Add logic to save and restore @FILE.ERROR
01/03/17 dmb Updated the ROTR compare logic to search for a recipe match.
04/09/18 dmb Updated the ROTR compare logic to be limited to FWI stages. Also modified the default logic
to be Failed unless proven otherwise.
04/19/18 djs Update ROTR compare logic to support multiple spec recipes.
05/04/18 dmb Update the special metrology log entry log to use the GetServer service rather than the
@STATION global variable.
06/13/18 dmb Replaced CLEAN_INSP_SCAN_SUM_OF_DEF_AVG$ with CLEAN_INSP_SCAN_SUM_OF_DEF_MAX$ when comparing
against the Sum of Defects in the SurfScan recipe. - [IREPIOI-43]
09/24/18 djs Adjusted the OConv call on the ScanDefect variable within the WRITE_RECORD_PRE action.
10/29/18 djs Updated the WRITE_RECORD_PRE event to calculate the SOD average to only use wafers that
are below the USL (SOD Max) as per ROTR Project requirements. Also updated the UCL request
using QA_Services to include the scanned Tencor Recipe name in order to return the UCL
associated with the particular recipe being processed at that time.
06/07/19 djs Updated the WRITE_RECORD_PRE GoSub to support ROTR requirements for POST stage SurfScan
rundata files.
08/12/20 djs Added logging within the WRITE_RECORD_PRE GoSub to gather data for a bug within the
Metrology_Services('ImportMetrologyService') subroutine. Occasionally the DB server is
getting an out of memory error when importing metrology files.
***********************************************************************************************************************/
#pragma precomp SRP_PreCompiler
$insert APP_INSERTS
$insert FILE.SYSTEM.EQUATES
$insert ACTION_SETUP
$insert CLEAN_INSP_EQUATES
$insert REACTOR_EQUATES
$insert RDS_EQUATES
$insert WM_OUT_EQUATES
$insert WO_LOG_EQUATES
$insert ROTR_EQUATES
$insert WO_MAT_EQUATES
Equ Comma$ to ','
Declare function Error_Services, Database_Services, Environment_Services, QA_Services, RDS_Services, MemberOf
Declare subroutine Error_Services, Database_Services, Post_Metrology_Manual_Data_Entry_Log
Declare subroutine Qa_Services
If KeyID then GoSub Initialize_System_Variables
Begin Case
Case Action _EQC 'CalculateColumn' ; GoSub CalculateColumn
Case Action _EQC 'READ_RECORD_PRE' ; GoSub READ_RECORD_PRE
Case Action _EQC 'READ_RECORD' ; GoSub READ_RECORD
Case Action _EQC 'READONLY_RECORD_PRE' ; GoSub READONLY_RECORD_PRE
Case Action _EQC 'READONLY_RECORD' ; GoSub READONLY_RECORD
Case Action _EQC 'WRITE_RECORD_PRE' ; GoSub WRITE_RECORD_PRE
Case Action _EQC 'WRITE_RECORD' ; GoSub WRITE_RECORD
Case Action _EQC 'DELETE_RECORD_PRE' ; GoSub DELETE_RECORD_PRE
Case Action _EQC 'DELETE_RECORD' ; GoSub DELETE_RECORD
Case Otherwise$ ; Status = 'Invalid Action'
End Case
If KeyID then GoSub Restore_System_Variables
If Assigned(ActionFlow) else ActionFlow = ACTION_CONTINUE$
Return ActionFlow
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Calculated Columns
//
// The typical structure of a calculated column will look like this:
//
// Declare function Database_Services
//
// @ANS = Database_Services('CalculateColumn')
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
CalculateColumn:
// Make sure the ActionFlow return variable is cleared in case nothing is calculated.
ActionFlow = ''
Begin Case
Case CalcColName EQ 'INSP_REQ' ; GoSub INSP_REQ
Case CalcColName EQ 'RDS_ROTR_ACTION' ; GoSub RDS_ROTR_ACTION
End Case
return
INSP_REQ:
SkipInsp = Xlate('WO_MAT', {WO_MAT_KEY}, 'CONVERTED_MATERIAL', 'X')
If SkipInsp EQ '' then
RDSNo = {RDS_NO}
WONo = {WO_NO}
WOQty = Xlate('WO_LOG', WONo, 'QTY', 'X')
RunNo = Xlate('RDS', RDSNo, 'RUN_ORDER_NUM', 'X')
InspInterval = {INSP_INTERVAL}
LastRun = ( (RunNo * 25) EQ WOQty )
InspReq = ( (Mod((RunNo - 1), InspInterval) EQ 0) or LastRun )
ActionFlow = InspReq
end else
ActionFlow = False$
end
return
RDS_ROTR_ACTION:
ROTRAction = {ROTR_ACTION}
If ROTRAction EQ 'F' then
// Before returning a Fail, check to see if there is an acceptance for the results.
AcceptedSignature = {SIGN_ROTR_SIGNATURE}
AcceptedReason = {SIGN_ROTR_REASON}
If (AcceptedSignature NE '') AND (AcceptedReason NE '') then ROTRAction = 'A'
end
ActionFlow = ROTRAction
return
// ----- MFS calls -----------------------------------------------------------------------------------------------------
READ_RECORD_PRE:
// In order to stop a record from being read in this action these lines of code must be used:
//
// OrigFileError = 100 : @FM : KeyID
// Status = 0
// Record = ''
// ActionFlow = ACTION_STOP$
return
READ_RECORD:
// In order to stop a record from being read in this action these lines of code must be used:
//
// OrigFileError = 100 : @FM : KeyID
// Status = 0
// Record = ''
return
READONLY_RECORD_PRE:
// In order to stop a record from being read in this action these lines of code must be used:
//
// OrigFileError = 100 : @FM : KeyID
// Status = 0
// Record = ''
// ActionFlow = ACTION_STOP$
return
READONLY_RECORD:
// In order to stop a record from being read in this action these lines of code must be used:
//
// OrigFileError = 100 : @FM : KeyID
// Status = 0
// Record = ''
return
WRITE_RECORD_PRE:
OrigRecCopy = OrigRecord
RecCopy = Record
Convert @VM to '' in OrigRecCopy
Convert @VM to '' in RecCopy
// LWII Specification limits
OrigLWIISpecLPD = Trim(OrigRecCopy<CLEAN_INSP_INSP_LPD$>)
OrigLWIISpecScr = Trim(OrigRecCopy<CLEAN_INSP_INSP_SCRATCHES$>)
OrigLWIISpecScrLen = Trim(OrigRecCopy<CLEAN_INSP_INSP_SCRATCH_LEN$>)
OrigLWIISpecPits = Trim(OrigRecCopy<CLEAN_INSP_INSP_PITS$>)
OrigLWIISpecMounds = Trim(OrigRecCopy<CLEAN_INSP_INSP_MOUNDS$>)
OrigLWIISpecStack = Trim(OrigRecCopy<CLEAN_INSP_INSP_STACK_FAULTS$>)
OrigLWIISpecSpikes = Trim(OrigRecCopy<CLEAN_INSP_INSP_SPIKES$>)
OrigLWIISpecSpots = Trim(OrigRecCopy<CLEAN_INSP_INSP_SPOTS$>)
OrigLWIISpecBLDef = Trim(OrigRecCopy<CLEAN_INSP_INSP_BL_DEFECTS$>)
OrigLWIISpecFOV = Trim(OrigRecCopy<CLEAN_INSP_INSP_FOV$>)
NewLWIISpecLPD = Trim(RecCopy<CLEAN_INSP_INSP_LPD$>)
NewLWIISpecScr = Trim(RecCopy<CLEAN_INSP_INSP_SCRATCHES$>)
NewLWIISpecScrLen = Trim(RecCopy<CLEAN_INSP_INSP_SCRATCH_LEN$>)
NewLWIISpecPits = Trim(RecCopy<CLEAN_INSP_INSP_PITS$>)
NewLWIISpecMounds = Trim(RecCopy<CLEAN_INSP_INSP_MOUNDS$>)
NewLWIISpecStack = Trim(RecCopy<CLEAN_INSP_INSP_STACK_FAULTS$>)
NewLWIISpecSpikes = Trim(RecCopy<CLEAN_INSP_INSP_SPIKES$>)
NewLWIISpecSpots = Trim(RecCopy<CLEAN_INSP_INSP_SPOTS$>)
NewLWIISpecBLDef = Trim(RecCopy<CLEAN_INSP_INSP_BL_DEFECTS$>)
NewLWIISpecFOV = Trim(RecCopy<CLEAN_INSP_INSP_FOV$>)
// LWII Signature
OrigLWIISig = Trim(OrigRecCopy<CLEAN_INSP_INSP_SIG$>)
OrigLWIIDtm = Trim(OrigRecCopy<CLEAN_INSP_INSP_SIG_DTM$>)
NewLWIISig = Trim(RecCopy<CLEAN_INSP_INSP_SIG$>)
NewLWIIDtm = Trim(RecCopy<CLEAN_INSP_INSP_SIG_DTM$>)
// LWIS Specification Limits
OrigLWISRecipe = Trim(OrigRecCopy<CLEAN_INSP_SPEC_SURFSCAN_RECIPE$>)
OrigLWISSpecDef = Trim(OrigRecCopy<CLEAN_INSP_SPEC_SURF_DEFECTS$>)
OrigLWISSpecHaze = Trim(OrigRecCopy<CLEAN_INSP_SPEC_SURF_HAZE$>)
NewLWISRecipe = Trim(RecCopy<CLEAN_INSP_SPEC_SURFSCAN_RECIPE$>)
NewLWISSpecDef = Trim(RecCopy<CLEAN_INSP_SPEC_SURF_DEFECTS$>)
NewLWISSpecHaze = Trim(RecCopy<CLEAN_INSP_SPEC_SURF_HAZE$>)
// LWIS Signature
OrigLWISSig = Trim(OrigRecCopy<CLEAN_INSP_SCAN_SIG$>)
OrigLWISDtm = Trim(OrigRecCopy<CLEAN_INSP_SCAN_SIG_DTM$>)
NewLWISSig = Trim(RecCopy<CLEAN_INSP_SCAN_SIG$>)
NewLWISDtm = Trim(RecCopy<CLEAN_INSP_SCAN_SIG_DTM$>)
RDSKeyID = RecCopy<CLEAN_INSP_RDS_NO$>
// Check if run aborted and wafers were removed
WafersRemoved = Trim(RecCopy<CLEAN_INSP_WAFERS_REMOVED$>)
RDSNo = RDSKeyID
FinalQA = False$
RDSRow = Database_Services('ReadDataRow', 'RDS', RDSNo)
WorkOrderNo = RDSRow<RDS_WO$>
WorkOrderRow = Database_Services('ReadDataRow', 'WO_LOG', WorkOrderNo)
ReactType = WorkOrderRow<WO_LOG_REACT_TYPE$>
// Check to see if the Final QA signature is in place.
If ReactType EQ 'EPP' then
CassetteNos = RDSRow<RDS_OUT_CASS_NO$>
OutNCRNos = RDSRow<RDS_OUT_NCR$>
For Each CassetteNo in CassetteNos using @VM setting vPos
OutNCRNo = OutNCRNos<0, vPos>
// Ignore NCRd wafers
If OutNCRNo EQ '' then
WMOutKey = RDSRow<RDS_WO_STEP_KEY$> : '*' : CassetteNo
WMOutRow = Database_Services('ReadDataRow', 'WM_OUT', WMOutKey)
If WMOutRow<WM_OUT_SUP_VER_SIG$> NE '' then
FinalQA = True$
end
end
Until FinalQA
Next CassetteNo
end else
If RDSRow<RDS_SUP_VER_SIG$> NE '' then
FinalQA = True$
end
end
// If Final QA signature is in place, implement the control logic.
If FinalQA EQ True$ then
// User is attempting to modify this row. Set the FS104 error and log the event.
Error_Services('Add', 'FS104:FQA has already been signed. CLEAN_INSP record cannot be updated!')
OrigFileError = 104 : @FM : 'FQA has already been signed. CLEAN_INSP record cannot be updated!'
Status = 0
Record = ''
ActionFlow = ACTION_STOP$
end else
If ( (OrigLWIISpecLPD NE '') and (NewLWIISpecLPD EQ '') ) |
or ( (OrigLWIISpecScr NE '') and (NewLWIISpecScr EQ '') ) |
or ( (OrigLWIISpecScrLen NE '') and (NewLWIISpecScrLen EQ '') ) |
or ( (OrigLWIISpecPits NE '') and (NewLWIISpecPits EQ '') ) |
or ( (OrigLWIISpecMounds NE '') and (NewLWIISpecMounds EQ '') ) |
or ( (OrigLWIISpecStack NE '') and (NewLWIISpecStack EQ '') ) |
or ( (OrigLWIISpecSpikes NE '') and (NewLWIISpecSpikes EQ '') ) |
or ( (OrigLWIISpecSpots NE '') and (NewLWIISpecSpots EQ '') ) |
or ( (OrigLWIISpecBLDef NE '') and (NewLWIISpecBLDef EQ '') ) |
or ( (OrigLWIISpecFOV NE '') and (NewLWIISpecFOV EQ '') ) |
or ( (OrigLWIISig NE '') and (NewLWIISig EQ '') ) |
or ( (OrigLWIIDtm NE '') and (NewLWIIDtm EQ '') ) |
or ( (OrigLWISRecipe NE '') and (NewLWISRecipe EQ '') ) |
or ( (OrigLWISSpecDef NE '') and (NewLWISSpecDef EQ '') ) |
or ( (OrigLWISSpecHaze NE '') and (NewLWISSpecHaze EQ '') ) |
or ( (OrigLWISSig NE '') and (NewLWISSig EQ '') ) |
or ( (OrigLWISDtm NE '') and (NewLWISDtm EQ '') ) and Not(MemberOf(@User4, 'OI_ADMIN')) then
// User is attempting to erase data that is prohibited from being erased Set the FS104 error and block the write.
Error_Services('Add', 'FS104:Specification limits or signature data cannot be removed. Clean & Insp record cannot be updated!')
OrigFileError = 104 : @FM : 'Specification limits or signature data cannot be removed. Clean & Insp record cannot be updated!'
Status = 0
Record = ''
ActionFlow = ACTION_STOP$
end else
Stage = Record<CLEAN_INSP_STAGE$>
IsEpiPro = Rds_Services('IsEpiPro', RDSKeyID)
// This ROTR logic is only applicable to LWI clean & inspection rows.
CleanInspKeyID = Name
// Get the current signature required and signature entries.
SigRequired = Record<CLEAN_INSP_SPEC_SURFSCAN_REQ$>
ScanSigs = Record<CLEAN_INSP_SCAN_SIG$>
// Get the specifications
SpecRecipes = Record<CLEAN_INSP_SPEC_SURFSCAN_RECIPE$>
SpecDefects = Record<CLEAN_INSP_SPEC_SURF_DEFECTS$> ; // USL - Spec SOD Max
SpecHazes = Record<CLEAN_INSP_SPEC_SURF_HAZE$>
SpecQuantities = Record<CLEAN_INSP_SPEC_SS_SAMP_QTY$>
// Get the new scanned values
ScanRecipes = Record<CLEAN_INSP_SCAN_RECIPE$>
ScanTools = Record<CLEAN_INSP_SCAN_TOOL$>
ScanDefectsAvg = Record<CLEAN_INSP_SCAN_SUM_OF_DEF_AVG$>
ScanDefects = Record<CLEAN_INSP_SCAN_SUM_OF_DEF_MAX$>
ScanHazes = Record<CLEAN_INSP_SCAN_HAZE_AVG_AVG$>
ScanMismatch = Record<CLEAN_INSP_SCAN_RECIPE_MISMATCH$>
QtyMismatch = Record<CLEAN_INSP_SCAN_SAMPLE_QTY_MISMATCH$>
// Get scan results
ScanRecipeResults = Record<CLEAN_INSP_SCAN_RESULT$>
ScanRecipeReasons = Record<CLEAN_INSP_SCAN_RESULT_REASON$>
// Get the original scanned values
SpecRecipesOrig = OrigRecord<CLEAN_INSP_SPEC_SURFSCAN_RECIPE$>
ScanRecipesOrig = OrigRecord<CLEAN_INSP_SCAN_RECIPE$>
ScanDefectsAvgOrig = OrigRecord<CLEAN_INSP_SCAN_SUM_OF_DEF_AVG$>
ScanDefectsOrig = OrigRecord<CLEAN_INSP_SCAN_SUM_OF_DEF_MAX$>
ScanHazesOrig = OrigRecord<CLEAN_INSP_SCAN_HAZE_AVG_AVG$>
ScanMismatchOrig = OrigRecord<CLEAN_INSP_SCAN_RECIPE_MISMATCH$>
QtyMismatchOrig = OrigRecord<CLEAN_INSP_SCAN_SAMPLE_QTY_MISMATCH$>
// Get the original signature required and signature entries.
SigRequiredOrig = OrigRecord<CLEAN_INSP_SPEC_SURFSCAN_REQ$>
ScanSigsOrig = OrigRecord<CLEAN_INSP_SCAN_SIG$>
// Get the individual SOD values per wafer.
SODPerWafer = Record<CLEAN_INSP_SCAN_SOD_PER_WAFER$>
SODPerWaferOrig = OrigRecord<CLEAN_INSP_SCAN_SOD_PER_WAFER$>
// Get the 100 failure scan flags, which is null by default and set/cleared by this MFS.
FailScanFlags = Record<CLEAN_INSP_FAIL_SCAN_REQ$>
FailScanReq = Sum(FailScanFlags)
If FailScanReq GT 0 then
FailScanReq = True$
end else
FailScanReq = False$
end
CIReactor = Xlate('CLEAN_INSP', CleanInspKeyID, 'REACT_NO', 'X')
ROTREnabled = Xlate('REACTOR', CIReactor, 'ENABLE_ROTR', 'X')
ROTRFailLimit = Xlate('REACTOR', CIReactor, 'ROTR_FAIL_LIMIT', 'X')
// Get ROTR Reactor values
ROTRReactorStatus = Record<CLEAN_INSP_ROTR_REACTOR_STATUS$>
ROTRReactorStatusReason = Record<CLEAN_INSP_ROTR_REACTOR_STATUS_REASON$>
FailedWafers = Record<CLEAN_INSP_FAILED_WAFERS$>
If OrigRecord NE Record then
// Backlog Req 731 - ROTR Post Supercede
// Increase POST stage surfscan sample quantity specification to number of LWI stage failed wafers.
If Stage EQ 'POST' then
RDSNo = Record<CLEAN_INSP_RDS_NO$>
LWICIKey = Xlate('RDS', RDSNo, 'LWI_CI_NO', 'X')
If LWICIKey NE '' then
LWIFailedWafers = Xlate('CLEAN_INSP', LWICIKey, 'FAILED_WAFERS', 'X')
If LWIFailedWafers NE '' then
NewPostSpecSampleQty = Sum(LWIFailedWafers)
PostSpecRecipes = Record<CLEAN_INSP_SPEC_SURFSCAN_RECIPE$>
NumRecipes = DCount(PostSpecRecipes, @VM)
If NumRecipes GT 0 then
For RecipeIndex = 1 to NumRecipes
CurrSpec = Record<CLEAN_INSP_SPEC_SS_SAMP_QTY$, RecipeIndex>
If ( (CurrSpec EQ '') or (CurrSpec LT NewPostSpecSampleQty) ) then
Record<CLEAN_INSP_SPEC_SS_SAMP_QTY$, RecipeIndex> = NewPostSpecSampleQty
end
Next RecipeIndex
end
end
end
end
// Reset ROTR update flag so that future ROTR requests will re-trigger this routine (via BASE_MFS).
Record<CLEAN_INSP_ROTR_UPDATE_FLAG$> = False$
// Tencor data has been updated. Update the ROTR_ACTION data column in the CLEAN_INSP record.
// Check if ScanMismatch field has been set by Metrology_Services. If so, then the user attempted to
// load run data, which containted the wrong recipe name. (i.e. it did not match the spec recipe)
If (ScanMismatch EQ '') then
RDSKey = Record<CLEAN_INSP_RDS_NO$>
NumScanRecipes = DCount(ScanRecipes, @VM)
ROTRAction = ''
ROTRActionReason = ''
Begin Case
Case Stage _EQC 'LWI'
If SpecRecipes NE '' then
ReactorBlocked = False$ ;// Assume false until proven otherwise.
// ROTR Reactor/PSN Status Health Check - Uses parameters set within the ROTR Parameters form.
// We only need to run this once per CLEAN_INSP record.
ROTRStatus = 'P' ; // Assume pass until proven otherwise.
If ( (ROTREnabled EQ True$) and (ROTRReactorStatus EQ '') ) then
ROTRReactorStatus = 'W'
ROTRReactorStatusReason = 'ROTR awaiting processing'
// Set ROTR Reactor processing status so that the WRITE_RECORD_POST event will
// post an ROTR request to calculate the reactor ROTR health for this run.
QA_Services('PostROTRRequest', RDSKey)
end
// Check each scan recipe.
For each ScanRecipeName in ScanRecipes using @VM setting ScanRecipeIndex
Locate ScanRecipeName in SpecRecipes using @VM setting SpecRecipeIndex then
// Get UCL value from SPC for each spec recipe if they have not yet been retrieved.
UCL = Record<CLEAN_INSP_SPEC_SUM_OF_DEF_AVG$, SpecRecipeIndex>
If (UCL EQ '') or (UCL EQ 0) then
// The UCL has not yet been retrieved from SPC or an error could have
// occurred when the last attempt to retrieve it, so try to get it now.
UCL = QA_Services('PostUCLRequest', RDSKey, ScanRecipeName)
If (UCL NE '') and (UCL NE 0) then
Record<CLEAN_INSP_SPEC_SUM_OF_DEF_AVG$, SpecRecipeIndex> = UCL
end else
ErrorMessage = 'Error retrieving UCL value from QA_Services in CLEAN_INSP_ACTIONS'
Error_Services('Add', ErrorMessage)
end
end
SpecDefect = Oconv(SpecDefects<0, SpecRecipeIndex>, 'MD0')
SpecHaze = Oconv(SpecHazes<0, SpecRecipeIndex>, 'MD2')
SpecQty = SpecQuantities<0, SpecRecipeIndex>
ScanDefect = Oconv(ScanDefects<0, ScanRecipeIndex>, 'MD0')
ScanHaze = Oconv(ScanHazes<0, ScanRecipeIndex>, 'MD3')
ScanSig = ScanSigs<0, ScanRecipeIndex>
FailureScan = False$
// RDS < UCL (SOD Spec Avg) Check
ScanSODPerWafer = Record<CLEAN_INSP_SCAN_SOD_PER_WAFER$, ScanRecipeIndex>
ScanSortPerWafer = Record<CLEAN_INSP_SCAN_SORT_PER_WAFER$, ScanRecipeIndex>
WaferCount = 0
SODAvgSum = 0
SODAvg = OConv(ScanDefectsAvg<0, ScanRecipeIndex>, 'MD3')
NumFailedWafers = 0
For each WaferSOD in ScanSODPerWafer using @SVM setting WaferIndex
WaferSort = ScanSortPerWafer<0, ScanRecipeIndex, WaferIndex>
If ( (WaferSOD NE '') or (WaferSort NE '') ) then
// We have SOD data for this wafer so check if it is < SOD Max
If ( (WaferSOD LE SpecDefect) and (WaferSort NE 'FAIL') ) then
WaferCount += 1
SODAvgSum += WaferSOD
FailedWafers<0, WaferIndex> = False$
end else
NumFailedWafers += 1
FailedWafers<0, WaferIndex> = True$
end
end
Next WaferSOD
Record<CLEAN_INSP_NUM_FAILED_WAFERS$, ScanRecipeIndex> = NumFailedWafers
If (OrigRecord<CLEAN_INSP_SCAN_SUM_OF_DEF_AVG$, ScanRecipeIndex>) EQ '' then
// This is the first time we are recording the scanned SOD average value. Store this
// for determining reactor health. (ROTR Status)
Record<CLEAN_INSP_SCAN_SUM_OF_DEF_AVG_FAIL$, ScanRecipeIndex> = IConv(SODAvg, 'MD3')
end
If WaferCount GT 0 and SODAvgSum GT 0 then
SODAvg = SODAvgSum / WaferCount
// Update scanned SOD average to not include wafers exceeding SOD max
// Adjust value to conform to internal storage format
ScanDefectsAvg<0, ScanRecipeIndex> = IConv(SODAvg, 'MD3')
Record<CLEAN_INSP_SCAN_SUM_OF_DEF_AVG$> = ScanDefectsAvg
end
If (ROTREnabled EQ True$) then
// ROTR Sign-off Project
// We need to check if reactor recently underwent ROTR maintenance. If so, then
// we must also check if this RDS is one of the first two runs after maintenance.
// If this is the case, then the RDS must undergo a 100% scan.
MaintScanReq = QA_Services('GetMaintenanceScanStatus', RDSKey)
FailScanReq = (FailScanReq or MaintScanReq or WafersRemoved)
// Search for '100' in the recipe name to determine if this is a failure scan.
If (WafersRemoved) then
FailureScan = Index(ScanRecipes, '25', 1)
end else
FailureScan = (Index(ScanRecipes, '100', 1) or Index(ScanRecipes, '25', 1))
end
If FailureScan GT 0 then FailureScan = True$
If (FailScanReq EQ True$) and (FailureScan EQ True$) then
// Fail scan was required and submitted, so turn off all fail scan required flags.
FailScanReq = False$
NumScans = DCount(ScanRecipes, @VM)
For ScanIndex = 1 to NumScans
FailScanFlags<0, ScanIndex> = False$
Next ScanIndex
WafersRemoved = False$
end
end
Begin Case
Case WafersRemoved
ROTRAction = 'F'
ROTRActionReason = '100% scan required due to aborted run.'
Case (FailScanReq EQ True$) and (FailureScan EQ False$) and (ROTREnabled EQ True$)
If (MaintScanReq EQ True$) then
ROTRAction = 'F'
ROTRActionReason = '100% scan required due to ROTR maint.'
end else
// If ROTR maintenance flag not set, then wafer fail limit must have been met in
// an earlier Tencor run. We must set it here again due to the design of this
// MFS.
ROTRAction = 'F'
ROTRActionReason = 'Wafer fail limit met - 100% scan required'
FailScanReq = True$
FailScanFlags<0, ScanRecipeIndex> = FailScanReq
end
Case (ROTRReactorStatus EQ 'W') and (ROTREnabled EQ True$)
// Awaiting ROTR results. Request in queue. This MFS will be triggered
// once the request is processed.
ROTRAction = 'F'
ROTRActionReason = ROTRReactorStatusReason
Case (ROTRReactorStatus EQ 'F') and (ROTREnabled EQ True$)
// Check this case first as to not miss blocking the reactor if necessary.
// Block load signature on this reactor for future lots until overriden at Load button
// signature click event by supervisor, lead, or engineer.
ROTRAction = 'F'
ROTRActionReason = ROTRReactorStatusReason
CIReactorRec = Database_Services('ReadDataRow', 'REACTOR', CIReactor)
CIReactorRec<REACTOR_ROTR_STATUS$> = 'F'
CIReactorRec<REACTOR_ROTR_STATUS_REASON$> = ROTRReactorStatusReason
Database_Services('WriteDataRow','REACTOR',CIReactor,CIReactorRec, True$, False$, True$)
ReactorBlocked = True$
Case (ScanDefect EQ '') OR (ScanHaze EQ '')
ROTRAction = 'F'
ROTRActionReason = 'SurfScan data is missing.'
Case (SigRequired EQ True$) AND (ScanSig EQ '')
ROTRAction = 'F'
ROTRActionReason = 'SurfScan signature is missing.'
Case (ScanDefect GT SpecDefect) or (NumFailedWafers GE ROTRFailLimit)
If (ROTREnabled EQ True$) then
// If a Post Clean is required, then disregard the ROTRFailLimit per Tom Tillery.
CleanReq = False$
PSNo = Xlate('CLEAN_INSP', CleanInspKeyID, 'PS_NO', 'X')
PRSStages = Xlate('PROD_SPEC', PSNo, 'PRS_STAGE_KEY', 'X')
If Index(PRSStages, 'POST', 1) then
CleanReq = Xlate('PRS_STAGE', PSNo:'*POST', 'CLEAN_SIG_REQ', 'X')
end
If (NumFailedWafers LT ROTRFailLimit) or (CleanReq EQ True$) or (FailureScan EQ True$) then
ROTRAction = 'F'
ROTRActionReason = 'SurfScan data out of bounds.'
end else
ROTRAction = 'F'
ROTRActionReason = 'Wafer fail limit met - 100% scan required'
FailScanReq = True$
FailScanFlags<0, ScanRecipeIndex> = FailScanReq
end
end else
ROTRAction = 'F'
ROTRActionReason = 'SurfScan data out of bounds.'
end
Case (ScanHaze GT SpecHaze)
ROTRAction = 'F'
ROTRActionReason = 'SurfScan Haze out of bounds.'
Case Otherwise$
// This scan data is within spec.
ROTRAction = 'P'
ROTRActionReason = 'Passed'
End Case
// Store this result for final disposition
ScanRecipeResults<0, ScanRecipeIndex> = ROTRAction
ScanRecipeReasons<0, ScanRecipeIndex> = ROTRActionReason
end
Next ScanRecipeName
FinalROTRAction = 'P'
FinalROTRActionReason = ''
// Final disposition
// If no scan data or if any scan data has failed, then FinalROTRAction = F.
NumScanRecipes = DCount(ScanRecipes, @VM)
If NumScanRecipes EQ 0 then
FinalROTRAction = 'F'
If WafersRemoved then
FinalROTRActionReason = '100% scan required due to aborted run.'
end else
FinalROTRActionReason = 'Scan data is missing.'
end
end else
NumFailures = Count(ScanRecipeResults, 'F')
Begin Case
Case NumFailures EQ 0
// No failures so this is a pass.
FinalROTRAction = 'P'
FInalROTRActionReason = ''
Case NumFailures EQ 1
// Display the failure reason
Locate 'F' in ScanRecipeResults using @VM setting ScanRecipeIndex then
FailureReason = ScanRecipeReasons<0, ScanRecipeIndex>
FinalROTRAction = 'F'
FinalROTRActionReason = FailureReason
end
Case NumFailures GT 1
// Inform the user that multiple scans failed
FinalROTRAction = 'F'
FinalROTRActionReason = 'Multiple scans failed to meet criteria.'
End Case
end
ROTRAction = FinalROTRAction
ROTRActionReason = FinalROTRActionReason
end
Case Stage _EQC 'POST'
If SpecRecipes NE '' then
// Check each scan recipe.
For each ScanRecipeName in ScanRecipes using @VM setting ScanRecipeIndex
Locate ScanRecipeName in SpecRecipes using @VM setting SpecRecipeIndex then
// Get UCL value from SPC for each spec recipe if they have not yet been retrieved.
UCL = Record<CLEAN_INSP_SPEC_SUM_OF_DEF_AVG$, SpecRecipeIndex>
If (UCL EQ '') or (UCL EQ 0) then
// The UCL has not yet been retrieved from SPC or an error could have
// occurred when the last attempt to retrieve it, so try to get it now.
UCL = QA_Services('PostUCLRequest', RDSKey, ScanRecipeName)
If (UCL NE '') and (UCL NE 0) then
Record<CLEAN_INSP_SPEC_SUM_OF_DEF_AVG$, SpecRecipeIndex> = UCL
end else
ErrorMessage = 'Error retrieving UCL value from QA_Services in CLEAN_INSP_ACTIONS'
Error_Services('Add', ErrorMessage)
end
end
SpecSampleQty = Record<CLEAN_INSP_SPEC_SS_SAMP_QTY$, SpecRecipeIndex>
SpecDefect = Oconv(SpecDefects<0, SpecRecipeIndex>, 'MD0')
SpecHaze = Oconv(SpecHazes<0, SpecRecipeIndex>, 'MD2')
SpecQty = SpecQuantities<0, SpecRecipeIndex>
ScanDefect = Oconv(ScanDefects<0, ScanRecipeIndex>, 'MD0')
ScanHaze = Oconv(ScanHazes<0, ScanRecipeIndex>, 'MD3')
ScanSig = ScanSigs<0, ScanRecipeIndex>
FailureScan = False$
// RDS < UCL (SOD Spec Avg) Check
ScanSODPerWafer = Record<CLEAN_INSP_SCAN_SOD_PER_WAFER$, ScanRecipeIndex>
ScanSortPerWafer = Record<CLEAN_INSP_SCAN_SORT_PER_WAFER$, ScanRecipeIndex>
WaferCount = 0
SODAvgSum = 0
SODAvg = OConv(ScanDefectsAvg<0, ScanRecipeIndex>, 'MD3')
NumFailedWafers = 0
For each WaferSOD in ScanSODPerWafer using @SVM setting WaferIndex
WaferSort = ScanSortPerWafer<0, ScanRecipeIndex, WaferIndex>
If ( (WaferSOD NE '') or (WaferSort NE '') ) then
// We have SOD data for this wafer so check if it is < SOD Max
If ( (WaferSOD LE SpecDefect) and (WaferSort NE 'FAIL') ) then
WaferCount += 1
SODAvgSum += WaferSOD
FailedWafers<0, WaferIndex> = False$
end else
NumFailedWafers += 1
FailedWafers<0, WaferIndex> = True$
end
end
Next WaferSOD
Record<CLEAN_INSP_NUM_FAILED_WAFERS$, ScanRecipeIndex> = NumFailedWafers
If (OrigRecord<CLEAN_INSP_SCAN_SUM_OF_DEF_AVG$, ScanRecipeIndex>) EQ '' then
// This is the first time we are recording the scanned SOD average value. Store this
// for determining reactor health. (ROTR Status)
Record<CLEAN_INSP_SCAN_SUM_OF_DEF_AVG_FAIL$, ScanRecipeIndex> = IConv(SODAvg, 'MD3')
end
If WaferCount GT 0 and SODAvgSum GT 0 then
SODAvg = SODAvgSum / WaferCount
// Update scanned SOD average to not include wafers exceeding SOD max
// Adjust value to conform to internal storage format
ScanDefectsAvg<0, ScanRecipeIndex> = IConv(SODAvg, 'MD3')
Record<CLEAN_INSP_SCAN_SUM_OF_DEF_AVG$> = ScanDefectsAvg
end
Begin Case
Case (ScanDefect EQ '') OR (ScanHaze EQ '')
ROTRAction = 'F'
ROTRActionReason = 'SurfScan data is missing.'
Case (SigRequired EQ True$) AND (ScanSig EQ '')
ROTRAction = 'F'
ROTRActionReason = 'SurfScan signature is missing.'
Case (ScanDefect GT SpecDefect) or (NumFailedWafers GE ROTRFailLimit)
ROTRAction = 'F'
ROTRActionReason = 'SurfScan data out of bounds.'
Case (ScanHaze GT SpecHaze)
ROTRAction = 'F'
ROTRActionReason = 'SurfScan Haze out of bounds.'
Case Otherwise$
// This scan data is within spec.
ROTRAction = 'P'
ROTRActionReason = 'Passed'
End Case
// Store this result for final disposition
ScanRecipeResults<0, ScanRecipeIndex> = ROTRAction
ScanRecipeReasons<0, ScanRecipeIndex> = ROTRActionReason
end
Next ScanRecipeName
FinalROTRAction = 'P'
FinalROTRActionReason = ''
// Final disposition
// If no scan data or if any scan data has failed, then FinalROTRAction = F.
NumScanRecipes = DCount(ScanRecipes, @VM)
If NumScanRecipes EQ 0 then
FinalROTRAction = 'F'
FinalROTRActionReason = 'Scan data is missing.'
end else
TotalScanWfrCnt = Count(FailedWafers, '0') + Count(FailedWafers, '1')
Begin Case
Case (SpecSampleQty EQ '')
QtyMismatch = 'Error determining sample qty spec'
Case (TotalScanWfrCnt LT SpecSampleQty)
QtyMismatch = 'Min sample quantity not met.'
Case Otherwise$
QtyMismatch = ''
// Set flag to inform FQA that POST surfscan failure results should be used instead.
RDSRec = Database_Services('ReadDataRow', 'RDS', RDSNo)
RDSRec<RDS_POST_SUPERCEDE$> = True$
Database_Services('WriteDataRow', 'RDS', RDSNo, RDSRec, True$, False$, True$)
End Case
NumFailures = Count(ScanRecipeResults, 'F')
Begin Case
Case ( (QtyMismatch NE '') and Not(IsEpiPro) )
FinalROTRAction = 'F'
FInalROTRActionReason = QtyMismatch
Case NumFailures EQ 0
// No failures so this is a pass.
FinalROTRAction = 'P'
FInalROTRActionReason = ''
Case NumFailures EQ 1
// Display the failure reason
Locate 'F' in ScanRecipeResults using @VM setting ScanRecipeIndex then
FailureReason = ScanRecipeReasons<0, ScanRecipeIndex>
FinalROTRAction = 'F'
FinalROTRActionReason = FailureReason
end
Case NumFailures GT 1
// Inform the user that multiple scans failed
FinalROTRAction = 'F'
FinalROTRActionReason = 'Multiple scans failed to meet criteria.'
End Case
end
ROTRAction = FinalROTRAction
ROTRActionReason = FinalROTRActionReason
end
End Case
end else
// Recipe mismatch field set. Set ROTR to failed and inform user.
ROTRAction = 'F'
ROTRActionReason = ScanMismatch:' does not match spec.'
end
If ROTRAction EQ 'P' then
// Clear any previously set failure reasons or failure scan flags.
ROTRActionReason = ''
NumScans = DCount(ScanRecipes, @VM)
For ScanIndex = 1 to NumScans
FailScanFlags<0, ScanIndex> = False$
Next ScanIndex
Record<CLEAN_INSP_WAFERS_REMOVED$> = False$
end
Record<CLEAN_INSP_ROTR_ACTION$> = ROTRAction
Record<CLEAN_INSP_ROTR_ACTION_REASON$> = ROTRActionReason
Record<CLEAN_INSP_FAIL_SCAN_REQ$> = FailScanFlags
Record<CLEAN_INSP_SCAN_RESULT$> = ScanRecipeResults
Record<CLEAN_INSP_SCAN_RESULT_REASON$> = ScanRecipeReasons
Record<CLEAN_INSP_FAILED_WAFERS$> = FailedWafers
SaveRecord = Record
Server = Environment_Services('GetServer')
If (Server NE 'MESSA005') AND (Server NE 'MESSA01EC') then
// The metrology data was updated by an end user on a workstation. Add this information to a special log
// for Balan.
Post_Metrology_Manual_Data_Entry_Log(@USER4,'Tencor',Record<CLEAN_INSP_RDS_NO$>:' / ':CleanInspKeyID)
end
end
end
end
return
WRITE_RECORD:
WONo = Record<CLEAN_INSP_WO_NO$>
ReactType = Xlate('WO_LOG', WONo, 'REACT_TYPE', 'X')
EpiPro = (ReactType EQ 'EPP')
GaN = (ReactType EQ 'GAN')
NonEpiPro = ( (ReactType NE 'EPP') and (ReactType NE 'GAN') )
Stage = Record<CLEAN_INSP_STAGE$>
If Stage EQ 'LWI' then
RDSNo = Record<CLEAN_INSP_RDS_NO$>
PostCIKey = Xlate('RDS', RDSNo, 'POST_CI_NO', 'X')
If PostCIKey NE '' then
FailedWafers = Record<CLEAN_INSP_FAILED_WAFERS$>
If FailedWafers NE '' then
NewPostSpecSampleQty = Sum(FailedWafers)
PostCIRec = Database_Services('ReadDataRow', 'CLEAN_INSP', PostCIKey)
PostSpecRecipes = PostCIRec<CLEAN_INSP_SPEC_SURFSCAN_RECIPE$>
NumRecipes = DCount(PostSpecRecipes, @VM)
If NumRecipes GT 0 then
For RecipeIndex = 1 to NumRecipes
CurrSpec = PostCIRec<CLEAN_INSP_SPEC_SS_SAMP_QTY$, RecipeIndex>
If ( (CurrSpec EQ '') or (CurrSpec LT NewPostSpecSampleQty) ) then
PostCIRec<CLEAN_INSP_SPEC_SS_SAMP_QTY$, RecipeIndex> = NewPostSpecSampleQty
end
Next RecipeIndex
Database_Services('WriteDataRow', 'CLEAN_INSP', PostCIKey, PostCIRec, True$, False$, True$)
end
end
end
end
If NonEpiPro then
// Sync up Insp, Clean, and SurfScan signatures with WO_MAT signature profile
Stage = {STAGE}
WOMatKey = {WO_MAT_KEY}
// Update failed wafer list
QA_Services('UpdateFailedWafers', WOMatKey)
WOMatRec = Database_Services('ReadDataRow', 'WO_MAT', WOMatKey)
WOMatSigProf = WOMatRec<WO_MAT_SIG_PROFILE$>
WOMatSigs = WOMatRec<WO_MAT_SIGNATURE$>
WOMatSigDTMs = WOMatRec<WO_MAT_SIG_DTM$>
OrigInspSig = OrigRecord<CLEAN_INSP_INSP_SIG$>
OrigInspSigDTM = OrigRecord<CLEAN_INSP_INSP_SIG_DTM$>
InspSig = Record<CLEAN_INSP_INSP_SIG$>
InspSigDTM = Record<CLEAN_INSP_INSP_SIG_DTM$>
OrigCleanSig = OrigRecord<CLEAN_INSP_CLEAN_SIG$>
OrigCleanSigDTM = OrigRecord<CLEAN_INSP_CLEAN_SIG_DTM$>
CleanSig = Record<CLEAN_INSP_CLEAN_SIG$>
CleanSigDTM = Record<CLEAN_INSP_CLEAN_SIG_DTM$>
OrigScanSig = OrigRecord<CLEAN_INSP_SCAN_SIG$>
OrigScanSigDTM = OrigRecord<CLEAN_INSP_SCAN_SIG_DTM$>
ScanSig = Record<CLEAN_INSP_SCAN_SIG$>
ScanSigDTM = Record<CLEAN_INSP_SCAN_SIG_DTM$>
SigProfUpdate = False$
If ( (OrigInspSig NE InspSig) or (OrigInspSigDTM NE InspSigDTM) ) then
WOMatStage = '1':Stage:'I'
Locate WOMatStage in WOMatSigProf using @VM setting vPos then
WOMatSigs<0, vPos> = InspSig
WOMatSigDTMs<0, vPos> = InspSigDTM
SigProfUpdate = True$
end
end
If ( (OrigCleanSig NE CleanSig) or (OrigCleanSigDTM NE CleanSigDTM) ) then
WOMatStage = '1':Stage:'C'
Locate WOMatStage in WOMatSigProf using @VM setting vPos then
WOMatSigs<0, vPos> = CleanSig
WOMatSigDTMs<0, vPos> = CleanSigDTM
SigProfUpdate = True$
end
end
If ( (OrigScanSig NE ScanSig) or (OrigScanSigDTM NE ScanSigDTM) ) then
WOMatStage = '1':Stage:'S'
Locate WOMatStage in WOMatSigProf using @VM setting vPos then
WOMatSigs<0, vPos> = ScanSig
WOMatSigDTMs<0, vPos> = ScanSigDTM
SigProfUpdate = True$
end
end
If SigProfUpdate then
WOMatRec<WO_MAT_SIGNATURE$> = WOMatSigs
WOMatRec<WO_MAT_SIG_DTM$> = WOMatSigDTMs
Database_Services('WriteDataRow', 'WO_MAT', WOMatKey, WOMatRec, True$, False$, True$)
end
end
return
DELETE_RECORD_PRE:
return
DELETE_RECORD:
return
// ----- Internal Methods ----------------------------------------------------------------------------------------------
Initialize_System_Variables:
// Save these for restoration later
SaveDict = @DICT
SaveID = @ID
SaveRecord = @RECORD
OrigFileError = @FILE.ERROR
// Now make sure @DICT, ID, and @RECORD are populated
CurrentDictName = ''
If @DICT then
DictHandle = @DICT<1, 2>
Locate DictHandle in @TABLES(5) Using @FM Setting fPos then
CurrentDictName = Field(@TABLES(0), @FM, fPos, 1)
end
end
If CurrentDictName NE DictName then
Open DictName to @DICT else Status = 'Unable to initialize @DICT'
end
@ID = KeyID
If Record else
// Record might not have been passed in. Read the record from the database table just to make sure.
@FILE.ERROR = ''
Open TableName to hTable then
FullFSList = hTable[1, 'F' : @VM]
BFS = FullFSList[-1, 'B' : @SVM]
LastHandle = hTable[-1, 'B' : \0D\]
FileHandle = \0D\ : LastHandle[1, @VM]
Call @BFS(READO.RECORD, BFS, FileHandle, KeyID, FMC, Record, ReadOStatus)
end
end
@RECORD = Record
return
Restore_System_Variables:
Transfer SaveDict to @DICT
Transfer SaveID to @ID
Transfer SaveRecord to @RECORD
@FILE.ERROR = OrigFileError
return

View File

@ -0,0 +1,871 @@
Function CLEAN_INSP_Actions_Dev(Action, CalcColName, FSList, Handle, Name, FMC, Record, Status, OrigRecord, Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10)
/***********************************************************************************************************************
This program is proprietary and is not to be used by or disclosed to others, nor is it to be copied without written
permission from Infineon.
Name : CLEAN_INSP_Actions
Description : Handles calculated columns and MFS calls for the current table.
Notes : This function uses @ID, @RECORD, and @DICT to make sure {ColumnName} references work correctly.
If called from outside of a calculated column these will need to be set and restored.
Parameters :
Action [in] -- Name of the action to be taken
CalcColName [in] -- Name of the calculated column that needs to be processed. Normally this should only be
populated when the CalcField action is being used.
FSList [in] -- The list of MFSs and the BFS name for the current file or volume. This is an @SVM
delimited array, with the current MFS name as the first value in the array, and the BFS
name as the last value. Normally set by a calling MFS.
Handle [in] -- The file handle of the file or media map being accessed. Note, this does contain the
entire handle structure that the Basic+ Open statement would provide. Normally set by a
calling MFS.
Name [in] -- The name (key) of the record or file being accessed. Normally set by a calling MFS.
FMC [in] -- Various functions. Normally set by a calling MFS.
Record [in] -- The entire record (for record-oriented functions) or a newly-created handle (for
"get handle" functions). Normally set by a calling MFS.
Status [in/out] -- Indicator of the success or failure of an action. Normally set by the calling MFS but
for some actions can be set by the action handler to indicate failure.
OrigRecord [in] -- Original content of the record being processed by the current action. This is
automatically being assigned by the WRITE_RECORD and DELETE_RECORD actions within
BASE_MFS.
Param1-10 [in/out] -- Additional request parameter holders
ActionFlow [out] -- Used to control the action chain (see the ACTION_SETUP insert for more information.)
Can also be used to return a special value, such as the results of the CalcField
method.
History : (Date, Initials, Notes)
07/28/10 dmb Original programmer.
10/13/10 dmb Fix logic to extract the file handle if file has an index
03/26/11 dmb Add logic to save and restore @FILE.ERROR
01/03/17 dmb Updated the ROTR compare logic to search for a recipe match.
04/09/18 dmb Updated the ROTR compare logic to be limited to FWI stages. Also modified the default logic
to be Failed unless proven otherwise.
04/19/18 djs Update ROTR compare logic to support multiple spec recipes.
05/04/18 dmb Update the special metrology log entry log to use the GetServer service rather than the
@STATION global variable.
06/13/18 dmb Replaced CLEAN_INSP_SCAN_SUM_OF_DEF_AVG$ with CLEAN_INSP_SCAN_SUM_OF_DEF_MAX$ when comparing
against the Sum of Defects in the SurfScan recipe. - [IREPIOI-43]
09/24/18 djs Adjusted the OConv call on the ScanDefect variable within the WRITE_RECORD_PRE action.
10/29/18 djs Updated the WRITE_RECORD_PRE event to calculate the SOD average to only use wafers that
are below the USL (SOD Max) as per ROTR Project requirements. Also updated the UCL request
using QA_Services to include the scanned Tencor Recipe name in order to return the UCL
associated with the particular recipe being processed at that time.
06/07/19 djs Updated the WRITE_RECORD_PRE GoSub to support ROTR requirements for POST stage SurfScan
rundata files.
08/12/20 djs Added logging within the WRITE_RECORD_PRE GoSub to gather data for a bug within the
Metrology_Services('ImportMetrologyService') subroutine. Occasionally the DB server is
getting an out of memory error when importing metrology files.
***********************************************************************************************************************/
#pragma precomp SRP_PreCompiler
$insert APP_INSERTS
$insert FILE.SYSTEM.EQUATES
$insert ACTION_SETUP
$insert CLEAN_INSP_EQUATES
$insert REACTOR_EQUATES
$insert RDS_EQUATES
$insert WM_OUT_EQUATES
$insert WO_LOG_EQUATES
$insert ROTR_EQUATES
$insert WO_MAT_EQUATES
Equ Comma$ to ','
Declare function Error_Services, Database_Services, Environment_Services, QA_Services, Logging_Services, RDS_Services
Declare function Trim
Declare subroutine Error_Services, Database_Services, Post_Metrology_Manual_Data_Entry_Log, Logging_Services
Declare subroutine Qa_Services
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\CleanInsp'
LogDate = Oconv(Date(), 'D4/')
LogTime = Oconv(Time(), 'MTS')
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' CLEAN_INSP Log.csv'
Headers = 'Logging DTM' : @FM : 'User' : @FM : 'RDS Key ID' : @FM : 'CLEAN_INSP Key ID' : @FM : 'Notes' : @FM : 'Stack'
objLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, Comma$, Headers, '', False$, False$)
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\FQABlocked'
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' FQA Log.csv'
Headers = 'Logging DTM' : @FM : 'RDS Key ID' : @FM : 'Table' : @FM : 'Key' : @FM : 'Notes'
FQAobjLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, Comma$, Headers, '', False$, False$)
If KeyID then GoSub Initialize_System_Variables
Begin Case
Case Action _EQC 'CalculateColumn' ; GoSub CalculateColumn
Case Action _EQC 'READ_RECORD_PRE' ; GoSub READ_RECORD_PRE
Case Action _EQC 'READ_RECORD' ; GoSub READ_RECORD
Case Action _EQC 'READONLY_RECORD_PRE' ; GoSub READONLY_RECORD_PRE
Case Action _EQC 'READONLY_RECORD' ; GoSub READONLY_RECORD
Case Action _EQC 'WRITE_RECORD_PRE' ; GoSub WRITE_RECORD_PRE
Case Action _EQC 'WRITE_RECORD' ; GoSub WRITE_RECORD
Case Action _EQC 'DELETE_RECORD_PRE' ; GoSub DELETE_RECORD_PRE
Case Action _EQC 'DELETE_RECORD' ; GoSub DELETE_RECORD
Case Otherwise$ ; Status = 'Invalid Action'
End Case
If KeyID then GoSub Restore_System_Variables
If Assigned(ActionFlow) else ActionFlow = ACTION_CONTINUE$
Return ActionFlow
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Calculated Columns
//
// The typical structure of a calculated column will look like this:
//
// Declare function Database_Services
//
// @ANS = Database_Services('CalculateColumn')
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
CalculateColumn:
// Make sure the ActionFlow return variable is cleared in case nothing is calculated.
ActionFlow = ''
Begin Case
Case CalcColName EQ 'INSP_REQ' ; GoSub INSP_REQ
Case CalcColName EQ 'RDS_ROTR_ACTION' ; GoSub RDS_ROTR_ACTION
End Case
return
INSP_REQ:
RDSNo = {RDS_NO}
WONo = {WO_NO}
WOQty = Xlate('WO_LOG', WONo, 'QTY', 'X')
RunNo = Xlate('RDS', RDSNo, 'RUN_ORDER_NUM', 'X')
InspInterval = Xlate('PRS_STAGE', {PS_STAGE_KEY}, 'INSP_INTERVAL', 'X')
LastRun = ( (RunNo * 25) EQ WOQty )
InspReq = ( (Mod((RunNo - 1), InspInterval) EQ 0) or LastRun )
ActionFlow = InspReq
return
RDS_ROTR_ACTION:
ROTRAction = {ROTR_ACTION}
If ROTRAction EQ 'F' then
// Before returning a Fail, check to see if there is an acceptance for the results.
AcceptedSignature = {SIGN_ROTR_SIGNATURE}
AcceptedReason = {SIGN_ROTR_REASON}
If (AcceptedSignature NE '') AND (AcceptedReason NE '') then ROTRAction = 'A'
end
ActionFlow = ROTRAction
return
// ----- MFS calls -----------------------------------------------------------------------------------------------------
READ_RECORD_PRE:
// In order to stop a record from being read in this action these lines of code must be used:
//
// OrigFileError = 100 : @FM : KeyID
// Status = 0
// Record = ''
// ActionFlow = ACTION_STOP$
return
READ_RECORD:
// In order to stop a record from being read in this action these lines of code must be used:
//
// OrigFileError = 100 : @FM : KeyID
// Status = 0
// Record = ''
return
READONLY_RECORD_PRE:
// In order to stop a record from being read in this action these lines of code must be used:
//
// OrigFileError = 100 : @FM : KeyID
// Status = 0
// Record = ''
// ActionFlow = ACTION_STOP$
return
READONLY_RECORD:
// In order to stop a record from being read in this action these lines of code must be used:
//
// OrigFileError = 100 : @FM : KeyID
// Status = 0
// Record = ''
return
WRITE_RECORD_PRE:
OrigRecCopy = OrigRecord
RecCopy = Record
Convert @VM to '' in OrigRecCopy
Convert @VM to '' in RecCopy
// LWII Specification limits
OrigLWIISpecLPD = Trim(OrigRecCopy<CLEAN_INSP_INSP_LPD$>)
OrigLWIISpecScr = Trim(OrigRecCopy<CLEAN_INSP_INSP_SCRATCHES$>)
OrigLWIISpecScrLen = Trim(OrigRecCopy<CLEAN_INSP_INSP_SCRATCH_LEN$>)
OrigLWIISpecPits = Trim(OrigRecCopy<CLEAN_INSP_INSP_PITS$>)
OrigLWIISpecMounds = Trim(OrigRecCopy<CLEAN_INSP_INSP_MOUNDS$>)
OrigLWIISpecStack = Trim(OrigRecCopy<CLEAN_INSP_INSP_STACK_FAULTS$>)
OrigLWIISpecSpikes = Trim(OrigRecCopy<CLEAN_INSP_INSP_SPIKES$>)
OrigLWIISpecSpots = Trim(OrigRecCopy<CLEAN_INSP_INSP_SPOTS$>)
OrigLWIISpecBLDef = Trim(OrigRecCopy<CLEAN_INSP_INSP_BL_DEFECTS$>)
OrigLWIISpecFOV = Trim(OrigRecCopy<CLEAN_INSP_INSP_FOV$>)
NewLWIISpecLPD = Trim(RecCopy<CLEAN_INSP_INSP_LPD$>)
NewLWIISpecScr = Trim(RecCopy<CLEAN_INSP_INSP_SCRATCHES$>)
NewLWIISpecScrLen = Trim(RecCopy<CLEAN_INSP_INSP_SCRATCH_LEN$>)
NewLWIISpecPits = Trim(RecCopy<CLEAN_INSP_INSP_PITS$>)
NewLWIISpecMounds = Trim(RecCopy<CLEAN_INSP_INSP_MOUNDS$>)
NewLWIISpecStack = Trim(RecCopy<CLEAN_INSP_INSP_STACK_FAULTS$>)
NewLWIISpecSpikes = Trim(RecCopy<CLEAN_INSP_INSP_SPIKES$>)
NewLWIISpecSpots = Trim(RecCopy<CLEAN_INSP_INSP_SPOTS$>)
NewLWIISpecBLDef = Trim(RecCopy<CLEAN_INSP_INSP_BL_DEFECTS$>)
NewLWIISpecFOV = Trim(RecCopy<CLEAN_INSP_INSP_FOV$>)
// LWII Signature
OrigLWIISig = Trim(OrigRecCopy<CLEAN_INSP_INSP_SIG$>)
OrigLWIIDtm = Trim(OrigRecCopy<CLEAN_INSP_INSP_SIG_DTM$>)
NewLWIISig = Trim(RecCopy<CLEAN_INSP_INSP_SIG$>)
NewLWIIDtm = Trim(RecCopy<CLEAN_INSP_INSP_SIG_DTM$>)
// LWIS Specification Limits
OrigLWISRecipe = Trim(OrigRecCopy<CLEAN_INSP_SPEC_SURFSCAN_RECIPE$>)
OrigLWISSpecDef = Trim(OrigRecCopy<CLEAN_INSP_SPEC_SURF_DEFECTS$>)
OrigLWISSpecHaze = Trim(OrigRecCopy<CLEAN_INSP_SPEC_SURF_HAZE$>)
NewLWISRecipe = Trim(RecCopy<CLEAN_INSP_SPEC_SURFSCAN_RECIPE$>)
NewLWISSpecDef = Trim(RecCopy<CLEAN_INSP_SPEC_SURF_DEFECTS$>)
NewLWISSpecHaze = Trim(RecCopy<CLEAN_INSP_SPEC_SURF_HAZE$>)
// LWIS Signature
OrigLWISSig = Trim(OrigRecCopy<CLEAN_INSP_SCAN_SIG$>)
OrigLWISDtm = Trim(OrigRecCopy<CLEAN_INSP_SCAN_SIG_DTM$>)
NewLWISSig = Trim(RecCopy<CLEAN_INSP_SCAN_SIG$>)
NewLWISDtm = Trim(RecCopy<CLEAN_INSP_SCAN_SIG_DTM$>)
RDSKeyID = RecCopy<CLEAN_INSP_RDS_NO$>
RDSNo = RDSKeyID
FinalQA = False$
RDSRow = Database_Services('ReadDataRow', 'RDS', RDSNo)
WorkOrderNo = RDSRow<RDS_WO$>
WorkOrderRow = Database_Services('ReadDataRow', 'WO_LOG', WorkOrderNo)
ReactType = WorkOrderRow<WO_LOG_REACT_TYPE$>
// Check to see if the Final QA signature is in place.
If ReactType EQ 'EPP' then
CassetteNos = RDSRow<RDS_OUT_CASS_NO$>
OutNCRNos = RDSRow<RDS_OUT_NCR$>
For Each CassetteNo in CassetteNos using @VM setting vPos
OutNCRNo = OutNCRNos<0, vPos>
// Ignore NCRd wafers
If OutNCRNo EQ '' then
WMOutKey = RDSRow<RDS_WO_STEP_KEY$> : '*' : CassetteNo
WMOutRow = Database_Services('ReadDataRow', 'WM_OUT', WMOutKey)
If WMOutRow<WM_OUT_SUP_VER_SIG$> NE '' then
FinalQA = True$
end
end
Until FinalQA
Next CassetteNo
end else
If RDSRow<RDS_SUP_VER_SIG$> NE '' then
FinalQA = True$
end
end
If @USER4 EQ 'DANIEL_ST' then FinalQA = False$
// If Final QA signature is in place, implement the control logic.
If FinalQA EQ True$ then
// User is attempting to modify this row. Set the FS104 error and log the event.
Error_Services('Add', 'FS104:FQA has already been signed. CLEAN_INSP record cannot be updated!')
OrigFileError = 104 : @FM : 'FQA has already been signed. CLEAN_INSP record cannot be updated!'
LogData = ''
LogData<1> = LoggingDTM
LogData<2> = @User4
LogData<3> = RDSNo
LogData<4> = 'CLEAN_INSP'
LogData<5> = Name
LogData<6> = 'FS104:FQA has already been signed. CLEAN_INSP record cannot be updated!'
Logging_Services('AppendLog', FQAobjLog, LogData, @RM, @FM)
Status = 0
Record = ''
ActionFlow = ACTION_STOP$
end else
LogData = ''
LogData<1> = LoggingDTM
LogData<2> = @USER4
LogData<3> = RDSKeyID
LogData<4> = Name
LogData<5> = 'Begin log trace'
Stack = RetStack()
Swap @FM with ' || ' in Stack
LogData<6> = Stack
Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$)
If ( (OrigLWIISpecLPD NE '') and (NewLWIISpecLPD EQ '') ) |
or ( (OrigLWIISpecScr NE '') and (NewLWIISpecScr EQ '') ) |
or ( (OrigLWIISpecScrLen NE '') and (NewLWIISpecScrLen EQ '') ) |
or ( (OrigLWIISpecPits NE '') and (NewLWIISpecPits EQ '') ) |
or ( (OrigLWIISpecMounds NE '') and (NewLWIISpecMounds EQ '') ) |
or ( (OrigLWIISpecStack NE '') and (NewLWIISpecStack EQ '') ) |
or ( (OrigLWIISpecSpikes NE '') and (NewLWIISpecSpikes EQ '') ) |
or ( (OrigLWIISpecSpots NE '') and (NewLWIISpecSpots EQ '') ) |
or ( (OrigLWIISpecBLDef NE '') and (NewLWIISpecBLDef EQ '') ) |
or ( (OrigLWIISpecFOV NE '') and (NewLWIISpecFOV EQ '') ) |
or ( (OrigLWIISig NE '') and (NewLWIISig EQ '') ) |
or ( (OrigLWIIDtm NE '') and (NewLWIIDtm EQ '') ) |
or ( (OrigLWISRecipe NE '') and (NewLWISRecipe EQ '') ) |
or ( (OrigLWISSpecDef NE '') and (NewLWISSpecDef EQ '') ) |
or ( (OrigLWISSpecHaze NE '') and (NewLWISSpecHaze EQ '') ) |
or ( (OrigLWISSig NE '') and (NewLWISSig EQ '') ) |
or ( (OrigLWISDtm NE '') and (NewLWISDtm EQ '') ) and @User4 NE 'DANIEL_ST' then
// User is attempting to erase data that is prohibited from being erased Set the FS104 error and block the write.
Error_Services('Add', 'FS104:Specification limits or signature data cannot be removed. Clean & Insp record cannot be updated!')
OrigFileError = 104 : @FM : 'Specification limits or signature data cannot be removed. Clean & Insp record cannot be updated!'
Status = 0
Record = ''
ActionFlow = ACTION_STOP$
LogData = ''
LogData<1> = LoggingDTM
LogData<2> = @USER4
LogData<3> = RDSKeyID
LogData<4> = Name
LogData<5> = RetStack()
Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$)
end else
LogData = ''
LogData<1> = LoggingDTM
LogData<2> = @USER4
LogData<3> = RDSKeyID
LogData<4> = Name
LogData<5> = 'Log trace 1'
LogData<6> = ''
Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$)
Stage = Record<CLEAN_INSP_STAGE$>
IsEpiPro = Rds_Services('IsEpiPro', RDSKeyID)
// This ROTR logic is only applicable to LWI clean & inspection rows.
CleanInspKeyID = Name
// Get the current signature required and signature entries.
SigRequired = Record<CLEAN_INSP_SPEC_SURFSCAN_REQ$>
ScanSigs = Record<CLEAN_INSP_SCAN_SIG$>
// Get the specifications
SpecRecipes = Record<CLEAN_INSP_SPEC_SURFSCAN_RECIPE$>
SpecDefects = Record<CLEAN_INSP_SPEC_SURF_DEFECTS$> ; // USL - Spec SOD Max
SpecHazes = Record<CLEAN_INSP_SPEC_SURF_HAZE$>
SpecQuantities = Record<CLEAN_INSP_SPEC_SS_SAMP_QTY$>
// Get the new scanned values
ScanRecipes = Record<CLEAN_INSP_SCAN_RECIPE$>
ScanTools = Record<CLEAN_INSP_SCAN_TOOL$>
ScanDefectsAvg = Record<CLEAN_INSP_SCAN_SUM_OF_DEF_AVG$>
ScanDefects = Record<CLEAN_INSP_SCAN_SUM_OF_DEF_MAX$>
ScanHazes = Record<CLEAN_INSP_SCAN_HAZE_AVG_AVG$>
ScanMismatch = Record<CLEAN_INSP_SCAN_RECIPE_MISMATCH$>
QtyMismatch = Record<CLEAN_INSP_SCAN_SAMPLE_QTY_MISMATCH$>
// Get scan results
ScanRecipeResults = Record<CLEAN_INSP_SCAN_RESULT$>
ScanRecipeReasons = Record<CLEAN_INSP_SCAN_RESULT_REASON$>
// Get the original scanned values
SpecRecipesOrig = OrigRecord<CLEAN_INSP_SPEC_SURFSCAN_RECIPE$>
ScanRecipesOrig = OrigRecord<CLEAN_INSP_SCAN_RECIPE$>
ScanDefectsAvgOrig = OrigRecord<CLEAN_INSP_SCAN_SUM_OF_DEF_AVG$>
ScanDefectsOrig = OrigRecord<CLEAN_INSP_SCAN_SUM_OF_DEF_MAX$>
ScanHazesOrig = OrigRecord<CLEAN_INSP_SCAN_HAZE_AVG_AVG$>
ScanMismatchOrig = OrigRecord<CLEAN_INSP_SCAN_RECIPE_MISMATCH$>
QtyMismatchOrig = OrigRecord<CLEAN_INSP_SCAN_SAMPLE_QTY_MISMATCH$>
// Get the original signature required and signature entries.
SigRequiredOrig = OrigRecord<CLEAN_INSP_SPEC_SURFSCAN_REQ$>
ScanSigsOrig = OrigRecord<CLEAN_INSP_SCAN_SIG$>
// Get the individual SOD values per wafer.
SODPerWafer = Record<CLEAN_INSP_SCAN_SOD_PER_WAFER$>
SODPerWaferOrig = OrigRecord<CLEAN_INSP_SCAN_SOD_PER_WAFER$>
// Get the 100 failure scan flags, which is null by default and set/cleared by this MFS.
FailScanFlags = Record<CLEAN_INSP_FAIL_SCAN_REQ$>
FailScanReq = Sum(FailScanFlags)
If FailScanReq GT 0 then
FailScanReq = True$
end else
FailScanReq = False$
end
// Get ROTR Reactor values
ROTRReactorStatus = Record<CLEAN_INSP_ROTR_REACTOR_STATUS$>
ROTRReactorStatusReason = Record<CLEAN_INSP_ROTR_REACTOR_STATUS_REASON$>
If OrigRecord NE Record then
// Reset ROTR update flag so that future ROTR requests will re-trigger this routine (via BASE_MFS).
Record<CLEAN_INSP_ROTR_UPDATE_FLAG$> = False$
LogData<5> = 'Log trace 2'
Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$)
// Tencor data has been updated. Update the ROTR_ACTION data column in the CLEAN_INSP record.
// Check if ScanMismatch field has been set by Metrology_Services. If so, then the user attempted to
// load run data, which containted the wrong recipe name. (i.e. it did not match the spec recipe)
If (ScanMismatch EQ '') then
If (QtyMismatch EQ '') or (IsEpiPro EQ True$) then
RDSKey = Record<CLEAN_INSP_RDS_NO$>
NumScanRecipes = DCount(ScanRecipes, @VM)
ROTRAction = ''
ROTRActionReason = ''
Begin Case
Case Stage _EQC 'LWI'
LogData<5> = 'Log trace 3'
Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$)
CIReactor = Xlate('CLEAN_INSP', CleanInspKeyID, 'REACT_NO', 'X')
ROTREnabled = Xlate('REACTOR', CIReactor, 'ENABLE_ROTR', 'X')
ReactorBlocked = False$ ;// Assume false until proven otherwise.
// ROTR Reactor/PSN Status Health Check - Uses parameters set within the ROTR Parameters form.
// We only need to run this once per CLEAN_INSP record.
ROTRStatus = 'P' ; // Assume pass until proven otherwise.
If ( (ROTREnabled EQ True$) and (ROTRReactorStatus EQ '') ) then
ROTRReactorStatus = 'W'
ROTRReactorStatusReason = 'ROTR awaiting processing'
// Set ROTR Reactor processing status so that the WRITE_RECORD_POST event will
// post an ROTR request to calculate the reactor ROTR health for this run.
QA_Services('PostROTRRequest', RDSKey)
end
LogData<5> = 'Log trace 4'
Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$)
// Check each scan recipe.
For each ScanRecipeName in ScanRecipes using @VM setting ScanRecipeIndex
Locate ScanRecipeName in SpecRecipes using @VM setting SpecRecipeIndex then
// Get UCL value from SPC for each spec recipe if they have not yet been retrieved.
UCL = Record<CLEAN_INSP_SPEC_SUM_OF_DEF_AVG$, SpecRecipeIndex>
If (UCL EQ '') or (UCL EQ 0) then
// The UCL has not yet been retrieved from SPC or an error could have
// occurred when the last attempt to retrieve it, so try to get it now.
UCL = QA_Services('PostUCLRequest', RDSKey, SpecRecipeName)
If (UCL NE '') and (UCL NE 0) then
Record<CLEAN_INSP_SPEC_SUM_OF_DEF_AVG$, SpecRecipeIndex> = UCL
end else
ErrorMessage = 'Error retrieving UCL value from QA_Services in CLEAN_INSP_ACTIONS'
Error_Services('Add', ErrorMessage)
end
end
SpecDefect = Oconv(SpecDefects<0, SpecRecipeIndex>, 'MD0')
SpecHaze = Oconv(SpecHazes<0, SpecRecipeIndex>, 'MD2')
SpecQty = SpecQuantities<0, SpecRecipeIndex>
ScanDefect = Oconv(ScanDefects<0, ScanRecipeIndex>, 'MD0')
ScanHaze = Oconv(ScanHazes<0, ScanRecipeIndex>, 'MD3')
ScanSig = ScanSigs<0, ScanRecipeIndex>
FailureScan = False$
// RDS < UCL (SOD Spec Avg) Check
ScanSODPerWafer = Record<CLEAN_INSP_SCAN_SOD_PER_WAFER$, ScanRecipeIndex>
WaferCount = 0
SODAvgSum = 0
SODAvg = OConv(ScanDefectsAvg<0, ScanRecipeIndex>, 'MD3')
NumFailedWafers = 0
For each WaferSOD in ScanSODPerWafer using @SVM setting WaferIndex
If WaferSOD NE '' then
// We have SOD data for this wafer so check if it is < SOD Max
If WaferSOD LE SpecDefect then
WaferCount += 1
SODAvgSum += WaferSOD
end else
NumFailedWafers += 1
end
end
Next WaferSOD
Record<CLEAN_INSP_NUM_FAILED_WAFERS$, ScanRecipeIndex> = NumFailedWafers
If (OrigRecord<CLEAN_INSP_SCAN_SUM_OF_DEF_AVG$, ScanRecipeIndex>) EQ '' then
// This is the first time we are recording the scanned SOD average value. Store this
// for determining reactor health. (ROTR Status)
Record<CLEAN_INSP_SCAN_SUM_OF_DEF_AVG_FAIL$, ScanRecipeIndex> = IConv(SODAvg, 'MD3')
end
If WaferCount GT 0 and SODAvgSum GT 0 then
SODAvg = SODAvgSum / WaferCount
// Update scanned SOD average to not include wafers exceeding SOD max
// Adjust value to conform to internal storage format
ScanDefectsAvg<0, ScanRecipeIndex> = IConv(SODAvg, 'MD3')
Record<CLEAN_INSP_SCAN_SUM_OF_DEF_AVG$> = ScanDefectsAvg
end
If (ROTREnabled EQ True$) then
// ROTR Sign-off Project
// We need to check if reactor recently underwent ROTR maintenance. If so, then
// we must also check if this RDS is one of the first two runs after maintenance.
// If this is the case, then the RDS must undergo a 100% scan.
MaintScanReq = QA_Services('GetMaintenanceScanStatus', RDSKey)
FailScanReq = (FailScanReq or MaintScanReq)
// Search for '100' in the recipe name to determine if this is a failure scan.
FailureScan = (Index(ScanRecipes, '100', 1) or Index(ScanRecipes, '25', 1))
If FailureScan GT 0 then FailureScan = True$
If (FailScanReq EQ True$) and (FailureScan EQ True$) then
// Fail scan was required and submitted, so turn off all fail scan required flags.
FailScanReq = False$
NumScans = DCount(ScanRecipes, @VM)
For ScanIndex = 1 to NumScans
FailScanFlags<0, ScanIndex> = False$
Next ScanIndex
end
end
Begin Case
Case (FailScanReq EQ True$) and (FailureScan EQ False$) and (ROTREnabled EQ True$)
If MaintScanReq EQ True$ then
ROTRAction = 'F'
ROTRActionReason = '100% scan required due to ROTR maint.'
end else
// If ROTR maintenance flag not set, then wafer fail limit must have been met in
// an earlier Tencor run. We must set it here again due to the design of this
// MFS.
ROTRAction = 'F'
ROTRActionReason = 'Wafer fail limit met - 100% scan required'
FailScanReq = True$
FailScanFlags<0, ScanRecipeIndex> = FailScanReq
end
Case (ROTRReactorStatus EQ 'W') and (ROTREnabled EQ True$)
// Awaiting ROTR results. Request in queue. This MFS will be triggered
// once the request is processed.
ROTRAction = 'F'
ROTRActionReason = ROTRReactorStatusReason
Case (ROTRReactorStatus EQ 'F') and (ROTREnabled EQ True$)
// Check this case first as to not miss blocking the reactor if necessary.
// Block load signature on this reactor for future lots until overriden at Load button
// signature click event by supervisor, lead, or engineer.
ROTRAction = 'F'
ROTRActionReason = ROTRReactorStatusReason
CIReactorRec = Database_Services('ReadDataRow', 'REACTOR', CIReactor)
CIReactorRec<REACTOR_ROTR_STATUS$> = 'F'
CIReactorRec<REACTOR_ROTR_STATUS_REASON$> = ROTRReactorStatusReason
Database_Services('WriteDataRow','REACTOR',CIReactor,CIReactorRec, True$, False$, True$)
ReactorBlocked = True$
Case (ScanDefect EQ '') OR (ScanHaze EQ '')
ROTRAction = 'F'
ROTRActionReason = 'SurfScan data is missing.'
Case (SigRequired EQ True$) AND (ScanSig EQ '')
ROTRAction = 'F'
ROTRActionReason = 'SurfScan signature is missing.'
Case (ScanDefect GT SpecDefect)
If (ROTREnabled EQ True$) then
ROTRFailLimit = Xlate('REACTOR', CIReactor, 'ROTR_FAIL_LIMIT', 'X')
// If a Post Clean is required, then disregard the ROTRFailLimit per Tom Tillery.
CleanReq = False$
PSNo = Xlate('CLEAN_INSP', CleanInspKeyID, 'PS_NO', 'X')
PRSStages = Xlate('PROD_SPEC', PSNo, 'PRS_STAGE_KEY', 'X')
If Index(PRSStages, 'POST', 1) then
CleanReq = Xlate('PRS_STAGE', PSNo:'*POST', 'CLEAN_SIG_REQ', 'X')
end
If (NumFailedWafers LT ROTRFailLimit) or (CleanReq EQ True$) or (FailureScan EQ True$) then
ROTRAction = 'F'
ROTRActionReason = 'SurfScan SoD out of bounds.'
end else
ROTRAction = 'F'
ROTRActionReason = 'Wafer fail limit met - 100% scan required'
FailScanReq = True$
FailScanFlags<0, ScanRecipeIndex> = FailScanReq
end
end else
ROTRAction = 'F'
ROTRActionReason = 'SurfScan SoD out of bounds.'
end
Case (ScanHaze GT SpecHaze)
ROTRAction = 'F'
ROTRActionReason = 'SurfScan Haze out of bounds.'
Case Otherwise$
// This scan data is within spec.
ROTRAction = 'P'
ROTRActionReason = 'Passed'
End Case
LogData<5> = 'Log trace 5.':SpecRecipeIndex
Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$)
// Store this result for final disposition
ScanRecipeResults<0, ScanRecipeIndex> = ROTRAction
ScanRecipeReasons<0, ScanRecipeIndex> = ROTRActionReason
end
Next ScanRecipeName
FinalROTRAction = 'P'
FinalROTRActionReason = ''
// Final disposition
// If no scan data or if any scan data has failed, then FinalROTRAction = F.
NumScanRecipes = DCount(ScanRecipes, @VM)
If NumScanRecipes EQ 0 then
FinalROTRAction = 'F'
FinalROTRActionReason = 'Scan data is missing.'
end else
NumFailures = Count(ScanRecipeResults, 'F')
Begin Case
Case NumFailures EQ 0
// No failures so this is a pass.
FinalROTRAction = 'P'
FInalROTRActionReason = ''
Case NumFailures EQ 1
// Display the failure reason
Locate 'F' in ScanRecipeResults using @VM setting ScanRecipeIndex then
FailureReason = ScanRecipeReasons<0, ScanRecipeIndex>
FinalROTRAction = 'F'
FinalROTRActionReason = FailureReason
end
Case NumFailures GT 1
// Inform the user that multiple scans failed
FinalROTRAction = 'F'
FinalROTRActionReason = 'Multiple scans failed to meet criteria.'
End Case
end
ROTRAction = FinalROTRAction
ROTRActionReason = FinalROTRActionReason
Case Stage _EQC 'POST'
ROTRReactorStatus = 'P' ; // Assume pass until proven otherwise.
// Check each spec recipe. There must be at least one scan recorded for each spec recipe.
For Each SpecRecipeName in SpecRecipes using @VM setting SpecRecipeIndex
// Get UCL value from SPC for each spec recipe if they have not yet been retrieved.
UCL = Record<CLEAN_INSP_SPEC_SUM_OF_DEF_AVG$, SpecRecipeIndex>
If (UCL EQ '') or (UCL EQ 0) then
// The UCL has not yet been retrieved from SPC or an error could have
// occurred when the last attempt to retrieve it, so try to get it now.
UCL = QA_Services('PostUCLRequest', RDSKey, SpecRecipeName)
If (UCL NE '') and (UCL NE 0) then
Record<CLEAN_INSP_SPEC_SUM_OF_DEF_AVG$, SpecRecipeIndex> = UCL
end else
ErrorMessage = 'Error retrieving UCL value from QA_Services in CLEAN_INSP_ACTIONS'
Error_Services('Add', ErrorMessage)
end
end
// Look for the last scan entry related to the current spec recipe.
RecipeFound = False$
For ScanRecipeIndex = NumScanRecipes To 1 Step -1
ScanRecipeName = ScanRecipes<0, ScanRecipeIndex>
RecipeFound = (ScanRecipeName EQ SpecRecipeName)
Until RecipeFound
Next ScanRecipeIndex
// If a scan was found, then analyze the scan data for spec requirements. If not found, this
// automatically fails.
If RecipeFound EQ True$ then
SpecDefect = Oconv(SpecDefects<0, SpecRecipeIndex>, 'MD0')
SpecHaze = Oconv(SpecHazes<0, SpecRecipeIndex>, 'MD2')
ScanDefect = Oconv(ScanDefects<0, ScanRecipeIndex>, 'MD0')
ScanHaze = Oconv(ScanHazes<0, ScanRecipeIndex>, 'MD3')
ScanSig = ScanSigs<0, ScanRecipeIndex>
FailureScan = False$
// RDS < UCL (SOD Spec Avg) Check
ScanSODPerWafer = Record<CLEAN_INSP_SCAN_SOD_PER_WAFER$, ScanRecipeIndex>
WaferCount = 0
SODAvgSum = 0
SODAvg = OConv(ScanDefectsAvg<0, ScanRecipeIndex>, 'MD3')
NumFailedWafers = 0
For each WaferSOD in ScanSODPerWafer using @SVM setting WaferIndex
If WaferSOD NE '' then
// We have SOD data for this wafer so check if it is < SOD Max
If WaferSOD LE SpecDefect then
WaferCount += 1
SODAvgSum += WaferSOD
end else
NumFailedWafers += 1
end
end
Next WaferSOD
Record<CLEAN_INSP_NUM_FAILED_WAFERS$, ScanRecipeIndex> = NumFailedWafers
If (OrigRecord<CLEAN_INSP_SCAN_SUM_OF_DEF_AVG$, ScanRecipeIndex>) EQ '' then
// This is the first time we are recording the scanned SOD average value. Store this
// for determining reactor health. (ROTR Status)
Record<CLEAN_INSP_SCAN_SUM_OF_DEF_AVG_FAIL$, ScanRecipeIndex> = IConv(SODAvg, 'MD3')
end
If WaferCount GT 0 and SODAvgSum GT 0 then
SODAvg = SODAvgSum / WaferCount
// Update scanned SOD average to not include wafers exceeding SOD max
// Adjust value to conform to internal storage format
ScanDefectsAvg<0, ScanRecipeIndex> = IConv(SODAvg, 'MD3')
Record<CLEAN_INSP_SCAN_SUM_OF_DEF_AVG$> = ScanDefectsAvg
end
Begin Case
Case (ScanDefect EQ '')
ROTRAction = 'F'
ROTRActionReason = 'SurfScan data is missing.'
Case (ScanDefect GT SpecDefect)
ROTRAction = 'F'
ROTRActionReason = 'SurfScan SoD out of bounds.'
Case (SigRequired EQ True$) AND (ScanSig EQ '')
ROTRAction = 'F'
ROTRActionReason = 'SurfScan signature is missing.'
Case Otherwise$
// This scan data is within spec.
ROTRAction = 'P'
End Case
end else
ROTRAction = 'F'
ROTRActionReason = 'Scan data for ' : SpecRecipeName : ' is missing.'
end
Until ROTRAction EQ 'P' or ROTRActionReason _EQC 'SurfScan signature is missing.'
Next SpecRecipeName
End Case
end else
// Sample quantity mismatch field set. Set ROTR to failed and inform user.
ROTRAction = 'F'
ROTRActionReason = QtyMismatch
end
end else
// Recipe mismatch field set. Set ROTR to failed and inform user.
ROTRAction = 'F'
ROTRActionReason = ScanMismatch:' does not match spec.'
end
If ROTRAction EQ 'P' then
// Clear any previously set failure reasons or failure scan flags.
ROTRActionReason = ''
NumScans = DCount(ScanRecipes, @VM)
For ScanIndex = 1 to NumScans
FailScanFlags<0, ScanIndex> = False$
Next ScanIndex
end
Record<CLEAN_INSP_ROTR_ACTION$> = ROTRAction
Record<CLEAN_INSP_ROTR_ACTION_REASON$> = ROTRActionReason
Record<CLEAN_INSP_FAIL_SCAN_REQ$> = FailScanFlags
Record<CLEAN_INSP_SCAN_RESULT$> = ScanRecipeResults
Record<CLEAN_INSP_SCAN_RESULT_REASON$> = ScanRecipeReasons
SaveRecord = Record
LogData<5> = 'Log trace 6'
Logging_Services('AppendLog', ObjLog, LogData, @RM, @FM, False$)
Server = Environment_Services('GetServer')
If (Server NE 'MESSA005') AND (Server NE 'MESSA01EC') then
// The metrology data was updated by an end user on a workstation. Add this information to a special log
// for Balan.
Post_Metrology_Manual_Data_Entry_Log(@USER4,'Tencor',Record<CLEAN_INSP_RDS_NO$>:' / ':CleanInspKeyID)
end
end
end
end
return
WRITE_RECORD:
If @USER4 EQ 'DANIEL_ST' then
debug
// Sync up Insp, Clean, and SurfScan signatures with WO_MAT signature profile
Stage = {STAGE}
WOMatKey = {WO_MAT_KEY}
WOMatRec = Database_Services('ReadDataRow', 'WO_MAT', WOMatKey)
WOMatSigProf = WOMatRec<WO_MAT_SIG_PROFILE$>
WOMatSigs = WOMatRec<WO_MAT_SIGNATURE$>
WOMatSigDTMs = WOMatRec<WO_MAT_SIG_DTM$>
OrigInspSig = OrigRecord<CLEAN_INSP_INSP_SIG$>
OrigInspSigDTM = OrigRecord<CLEAN_INSP_INSP_SIG_DTM$>
InspSig = Record<CLEAN_INSP_INSP_SIG$>
InspSigDTM = Record<CLEAN_INSP_INSP_SIG_DTM$>
OrigCleanSig = OrigRecord<CLEAN_INSP_CLEAN_SIG$>
OrigCleanSigDTM = OrigRecord<CLEAN_INSP_CLEAN_SIG_DTM$>
CleanSig = Record<CLEAN_INSP_CLEAN_SIG$>
CleanSigDTM = Record<CLEAN_INSP_CLEAN_SIG_DTM$>
OrigScanSig = OrigRecord<CLEAN_INSP_SCAN_SIG$>
OrigScanSigDTM = OrigRecord<CLEAN_INSP_SCAN_SIG_DTM$>
ScanSig = Record<CLEAN_INSP_SCAN_SIG$>
ScanSigDTM = Record<CLEAN_INSP_SCAN_SIG_DTM$>
SigProfUpdate = False$
If ( (OrigInspSig NE InspSig) or (OrigInspSigDTM NE InspSigDTM) ) then
WOMatStage = '1':Stage:'I'
Locate WOMatStage in WOMatSigProf using @VM setting vPos then
WOMatSigs<0, vPos> = InspSig
WOMatSigDTMs<0, vPos> = InspSigDTM
SigProfUpdate = True$
end
end
If ( (OrigCleanSig NE CleanSig) or (OrigCleanSigDTM NE CleanSigDTM) ) then
WOMatStage = '1':Stage:'C'
Locate WOMatStage in WOMatSigProf using @VM setting vPos then
WOMatSigs<0, vPos> = CleanSig
WOMatSigDTMs<0, vPos> = CleanSigDTM
SigProfUpdate = True$
end
end
If ( (OrigScanSig NE ScanSig) or (OrigScanSigDTM NE ScanSigDTM) ) then
WOMatStage = '1':Stage:'S'
Locate WOMatStage in WOMatSigProf using @VM setting vPos then
WOMatSigs<0, vPos> = ScanSig
WOMatSigDTMs<0, vPos> = ScanSigDTM
SigProfUpdate = True$
end
end
If SigProfUpdate then
WOMatRec<WO_MAT_SIGNATURE$> = WOMatSigs
WOMatRec<WO_MAT_SIG_DTM$> = WOMatSigDTMs
Database_Services('WriteDataRow', 'WO_MAT', WOMatKey, WOMatRec, True$, False$, True$)
end
end
return
DELETE_RECORD_PRE:
return
DELETE_RECORD:
return
// ----- Internal Methods ----------------------------------------------------------------------------------------------
Initialize_System_Variables:
// Save these for restoration later
SaveDict = @DICT
SaveID = @ID
SaveRecord = @RECORD
OrigFileError = @FILE.ERROR
// Now make sure @DICT, ID, and @RECORD are populated
CurrentDictName = ''
If @DICT then
DictHandle = @DICT<1, 2>
Locate DictHandle in @TABLES(5) Using @FM Setting fPos then
CurrentDictName = Field(@TABLES(0), @FM, fPos, 1)
end
end
If CurrentDictName NE DictName then
Open DictName to @DICT else Status = 'Unable to initialize @DICT'
end
@ID = KeyID
If Record else
// Record might not have been passed in. Read the record from the database table just to make sure.
@FILE.ERROR = ''
Open TableName to hTable then
FullFSList = hTable[1, 'F' : @VM]
BFS = FullFSList[-1, 'B' : @SVM]
LastHandle = hTable[-1, 'B' : \0D\]
FileHandle = \0D\ : LastHandle[1, @VM]
Call @BFS(READO.RECORD, BFS, FileHandle, KeyID, FMC, Record, ReadOStatus)
end
end
@RECORD = Record
return
Restore_System_Variables:
Transfer SaveDict to @DICT
Transfer SaveID to @ID
Transfer SaveRecord to @RECORD
@FILE.ERROR = OrigFileError
return

View File

@ -0,0 +1,31 @@
SUBROUTINE CLEAN_INSP_CURR_STATUS_CONV(ConvType, DataIo, SubrLabel, ReturnedValue)
*
$insert LOGICAL
EQU valid$ TO 0 ;* successful
EQU invalid_msg$ TO 1 ;* bad data - print error message window
EQU invalid_conv$ TO 2 ;* bad conversion - " "
EQU invalid_nomsg$ TO 3 ;* bad but do not print the error message window
STATUS() = valid$
BEGIN CASE
CASE ConvType = 'ICONV'
ReturnedValue = DataIo
CASE ConvType = 'OCONV'
Vals = XLATE('SYSREPOSPOPUPS','LSL2**CLEAN_INSP_CURR_STATUS',8,'X')
Desc = ''
LOOP
Val = Vals[1,@VM]
Code = Val[1,@SVM]
Desc = Val[COL2()+1,@SVM]
UNTIL Code = DataIO OR Vals = ''
Vals = DELETE(Vals,1,1,0)
REPEAT
ReturnedValue = Desc
CASE OTHERWISE$
Status() = invalid_msg$
END CASE
RETURN

View File

@ -0,0 +1,555 @@
COMPILE FUNCTION Clean_Insp_Org(EntID,Event,Parm1,Parm2,Parm3,Parm4,Parm5)
#pragma precomp SRP_PreCompiler
/*
Commuter module for CLEAN_INSP (Clean & Inspection) window
08/5/2009 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Send_Event, Set_Status, Center_Window, Post_Event
DECLARE SUBROUTINE ErrMsg, Send_Message, Set_Property, Send_Event, Btree.Extract, obj_AppWindow,
DECLARE SUBROUTINE obj_Notes, Security_Err_Msg, End_Window, Forward_Event, Start_Window, Create_Note
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Utility, Popup, Collect.Ixvals
DECLARE FUNCTION Send_Message, Msg, Security_Check, obj_React_Run_CI, Environment_Services
$INSERT MSG_EQUATES
$INSERT APPCOLORS
$INSERT LSL_USERS_EQU
$INSERT SECURITY_RIGHTS_EQU
$INSERT REACT_EVENT_EQUATES
$INSERT POPUP_EQUATES
EQU CRLF$ TO \0D0A\
EQU TAB$ TO \09\
ErrTitle = 'Error in Comm_Clean_Insp'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE EntID = @WINDOW
BEGIN CASE
CASE Event = 'CLEAR' ; GOSUB Clear
CASE Event = 'CREATE' ; GOSUB Create
CASE Event = 'CLOSE' ; GOSUB Close
CASE Event = 'READ' ; GOSUB Read
CASE Event[1,3] = 'QBF' ; GOSUB Refresh
END CASE
CASE EntID = 'CLEAN_INSP.SEND_SPC' AND Event = 'CLICK' ; GOSUB SendSPC
CASE 1
ErrorMsg = 'Unknown Parameters ':EntID:' - ':Event:' passed to commuter'
ErrMsg(ErrorMsg)
END CASE
IF ErrorMsg NE '' THEN
ErrMsg(ErrTitle:@SVM:ErrorMsg)
END
RETURN Result
* * * * * * *
Create:
* * * * * * *
/*
IF NOT(Security_Check('Reactor Event Log',READ$)) THEN
Security_Err_Msg('Reactor Event Log',READ$)
End_Window(@WINDOW)
RETURN
END
*/
obj_Appwindow('Create',@WINDOW)
IF @USERNAME = 'BRYCE_BARB' OR @USERNAME = 'CHAD_B' THEN
Set_Property(@WINDOW:'.SEND_SPC','VISIBLE',1)
Set_Property(@WINDOW:'.SPC_DTM','VISIBLE',1)
END ELSE
Set_Property(@WINDOW:'.SEND_SPC','VISIBLE',0)
Set_Property(@WINDOW:'.SPC_DTM','VISIBLE',0)
END
* Provides compatibility with the existing messaging attachment system
IF Parm1 NE '' THEN
PassedKeys = FIELD(Parm1,'*',1)
obj_Appwindow('ViewRelated',@WINDOW:@RM:PassedKeys)
END
*IOOptions = Get_Property(@WINDOW,'IOOPTIONS')
*IOOptions<11> = 1 ;* Generate READ event on QBFLoad
*Set_Property(@WINDOW,'IOOPTIONS',IOOptions)
GOSUB Refresh
RETURN
* * * * * * *
Clear:
* * * * * * *
IF Get_Property(@WINDOW,'@READONLY') THEN
obj_AppWindow('ReadOnly',@RM:1) ;* Reenables data bound controls
Set_Property(@WINDOW,'@READONLY',0) ;* Clear flag on window
END
* * * * * * *
Refresh:
* * * * * * *
Stage = Get_Property(@WINDOW:'.STAGE','TEXT')
SpecFwiLwi = Get_Property(@WINDOW:'.SPEC_FWI_LWI','TEXT')
BEGIN CASE
CASE Stage = 'PRE' ; LabelText = 'Pre Epi Cleaning && Inspection'
CASE Stage = 'POST' ; LabelText = 'Post Epi Cleaning && Inspection'
CASE Stage = 'WFR' AND SpecFwiLwi = 'FWI' ; LabelText = 'First Wafer Inspection'
CASE Stage = 'WFR' AND SpecFwiLwi = 'LWI' ; LabelText = 'Last Wafer Inspection'
CASE Stage[1,3] = 'WFR' ; LabelText = 'Wafer ':Stage[4,99]:' Extra Inspection'
CASE 1 ; LabelText = 'Cleaning && Inspection'
END CASE
Set_Property(@WINDOW:'.WINDOW_LABEL_FIX','TEXT',LabelText)
Ctrls = @WINDOW:'.SPEC_CLEAN_SUBOXIDE':@RM ; Props = 'CHECK':@RM
Ctrls := @WINDOW:'.SPEC_CLEAN_OXIDE_ANGSTROMS':@RM ; Props := 'TEXT':@RM
Ctrls := @WINDOW:'.SPEC_CLEAN_TOOL':@RM ; Props := 'TEXT':@RM
Ctrls := @WINDOW:'.SPEC_CLEAN_AKRION_RECIPE':@RM ; Props := 'TEXT':@RM
Ctrls := @WINDOW:'.SPEC_BRIGHTLIGHT':@RM ; Props := 'CHECK':@RM
Ctrls := @WINDOW:'.SPEC_MICROSCOPE':@RM ; Props := 'CHECK':@RM
Ctrls := @WINDOW:'.SPEC_SURFSCAN':@RM ; Props := 'CHECK':@RM
Ctrls := @WINDOW:'.SPEC_SURFSCAN_RECIPE' ; Props := 'TEXT'
Vals = Get_Property(Ctrls,Props)
SCSubOxide = Vals[1,@RM]
SCAngstroms = Vals[COL2()+1,@RM]
SCTool = Vals[COL2()+1,@RM]
SCAkrionRecipe = Vals[COL2()+1,@RM]
SBrightLight = Vals[COL2()+1,@RM]
SMicroscope = Vals[COL2()+1,@RM]
SSurfscan = Vals[COL2()+1,@RM]
SSurfscanRecipe = Vals[COL2()+1,@RM]
IF SCTool = 'No' THEN SCTool = ''
DefBack = Get_Property(@WINDOW,'BACKCOLOR')
IF SCSubOxide OR SCAngstroms OR SCTool OR SCAkrionRecipe THEN
Vals = 1:@RM:1:@RM:STR(VL_GREEN$:@RM,5)
END ELSE
Vals = 0:@RM:0:@RM:STR(DefBack:@RM,5)
END
IF SBrightLight OR SMicroscope THEN
Vals := 1:@RM:1:@RM:STR(VL_GREEN$:@RM,29)
END ELSE
Vals := 0:@RM:0:@RM:STR(DefBack:@RM,29)
END
IF SSurfscan OR SSurfscanRecipe THEN
Vals := 1:@RM:1:@RM:STR(VL_GREEN$:@RM,14)
END ELSE
Vals := 0:@RM:0:@RM:STR(DefBack:@RM,14)
END
IF Vals[-1,1] = @RM THEN Vals[-1,1] = ''
Ctrls = @WINDOW:'.CLEANS_GROUP':@RM ; Props = 'ENABLED':@RM
Ctrls := @WINDOW:'.CLEAN_RESULTS_GROUP':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.CLEANS_GROUP':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.CLEAN_RESULTS_GROUP':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.SPEC_CLEAN_SUBOXIDE':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.CLEAN_TOOL_LABEL':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.SPEC_CLEAN_AKRION_RECIPE_LABEL':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.SURF_INSP_GROUP':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.INSP_RESULT_GROUP':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.SURF_INSP_GROUP':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.INSP_RESULT_GROUP':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.SPEC_BRIGHTLIGHT':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.SPEC_MICROSCOPE':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.LPD_IN_LABEL':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.LPD_OUT_LABEL':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.SPEC_MICROSCOPE':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.LPD_LABEL':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.LPD_SPEC_LABEL':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.PITS_LABEL':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.PITS_SPEC_LABEL':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.MOUNDS_LABEL':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.MOUNDS_SPEC_LABEL':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.BL_DEF_LABEL':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.BL_DEF_SPEC_LABEL':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.STACK_FAULTS_LABEL':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.STACK_FAULT_SPEC_LABEL':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.SPIKES_LABEL':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.SPIKE_SPEC_LABEL':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.LONGEST_LABEL':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.NOT_TO_EXCEED_LABEL':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.SPOTS_LABEL':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.FOV_LONG_LABEL':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.SPOTS_SPEC_LABEL':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.FOV_SPEC_LABEL':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.SCRATCH_LABEL':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.INCH_LABEL':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.SCRATCHES_SPEC_LABEL':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.INCH_SPEC_LABEL':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.SURF_SCAN_GROUP':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.SCAN_RESULT_GROUP':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.SURF_SCAN_GROUP':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.SCAN_RESULT_GROUP':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.SPEC_SURFSCAN':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.SPEC_SURFSCAN_RECIPE_LABEL':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.SAMP_QTY_LABEL':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.SS_SCAN_TOOL_LABEL':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.SS_SCAN_DTM_LABEL':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.SUM_OF_DEFECTS_LABEL':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.HAZE_AVG_PPM_LABEL':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.SS_SCRATCH_AVG_LABEL':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.SPEC_LABEL':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.MIN_LABEL':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.MAX_LABEL':@RM ; Props := 'BACKCOLOR':@RM
Ctrls := @WINDOW:'.AVG_LABEL' ; Props := 'BACKCOLOR'
Set_Property(Ctrls,Props,Vals)
IF Get_Property(@WINDOW:'.SPC_DTM','DEFPROP') = '' THEN
Set_Property(@WINDOW:'.SEND_SPC','TEXT','Send to SPC')
END ELSE
Set_Property(@WINDOW:'.SEND_SPC','TEXT','Resend to SPC')
END
* Check for out of spec on the Surface Scan results
Ctrls = @WINDOW:'.SUM_OF_DEFECTS_SPEC':@RM ; Props = 'TEXT':@RM
Ctrls := @WINDOW:'.HAZE_AVG_SPEC':@RM ; Props := 'TEXT':@RM
Ctrls := @WINDOW:'.SUM_OF_DEF_AVG':@RM ; Props := 'TEXT':@RM
Ctrls := @WINDOW:'.SUM_OF_DEF_MAX':@RM ; Props := 'TEXT':@RM
Ctrls := @WINDOW:'.HAZE_AVG_AVG' ; Props := 'TEXT'
Vals = Get_Property(Ctrls,Props)
SumOfDefectsSpec = Vals[1,@RM]
HazeAvgSpec = Vals[COL2()+1,@RM]
SumOfDefectsAvg = Vals[COL2()+1,@RM]
SumOfDefectsMax = Vals[COL2()+1,@RM]
HazeAvgAvg = Vals[COL2()+1,@RM]
OutOfSpec = ''
IF SumOfDefectsSpec NE '' THEN
IF SumOfDefectsMax GE SumOfDefectsSpec THEN
OutOfSpec = 1
Set_Property(@WINDOW:'.SUM_OF_DEF_MAX','BACKCOLOR',RED$)
END
IF SumOfDefectsAvg GE SumOfDefectsSpec THEN
OutOfSpec = 1
Set_Property(@WINDOW:'.SUM_OF_DEF_AVG','BACKCOLOR',RED$)
END
END
IF HazeAvgSpec NE '' THEN
IF HazeAvgAvg GE HazeAvgSpec THEN
OutOfSpec = 1
Set_Property(@WINDOW:'.HAZE_AVG_SPEC','BACKCOLOR',RED$)
END
END
IF OutOfSpec THEN
Set_Property(@WINDOW:'.OUT_OF_SPEC','VISIBLE',1)
END ELSE
Set_Property(@WINDOW:'.OUT_OF_SPEC','VISIBLE',0)
Set_Property(@WINDOW:'.SUM_OF_DEF_MAX','BACKCOLOR',WHITE$)
Set_Property(@WINDOW:'.SUM_OF_DEF_AVG','BACKCOLOR',WHITE$)
Set_Property(@WINDOW:'.HAZE_AVG_AVG','BACKCOLOR',WHITE$)
END
* QBF buttons
Ctrls = @WINDOW:'.QBF_FIRST_FIX':@RM ; Props = 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_PREV_FIX':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_ABS_FIX':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_NEXT_FIX':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_LAST_FIX':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_STOP_FIX' ; Props := 'ENABLED'
IF Get_Property(@WINDOW,'QBFLIST') = '' THEN
Vals = 0:@RM:0:@RM:0:@RM:0:@RM:0:@RM:0
END ELSE
Vals = 1:@RM:1:@RM:1:@RM:1:@RM:1:@RM:1
END
Set_Property(Ctrls,Props,Vals)
* Turn edit table symbolic column backgrounds to green
ETSymbolics = Get_Property(@WINDOW,'@ET_SYMBOLICS') ;* Loaded during 'Create' in obj_Appwindow
ETCtrls = ETSymbolics<1>
ETCols = ETSymbolics<2>
FOR I = 1 TO COUNT(ETCtrls,@VM) + (ETCtrls NE '')
ETCtrl = ETCtrls<1,I>
ETList = Get_Property(ETCtrl,'LIST')
FOR Line = 1 TO COUNT(ETList,@FM) + (ETList NE '')
IF ETList<Line,1> NE '' THEN
FOR N = 1 TO COUNT(ETCols<1,I>,@SVM) + (ETCols<1,I> NE '')
stat = Send_Message(ETCtrl,'COLOR_BY_POS',ETCols<1,I,N>,Line,GREEN$)
NEXT N
END
NEXT I
NEXT I
RETURN
* * * * * * *
Read:
* * * * * * *
GOSUB Refresh
RETURN
* * * * * * *
Write:
* * * * * * *
/*
OrderNo = Get_Property(@WINDOW:'.ORD_NO','TEXT')
Message = ''
IF RowExists('ORDER',OrderNo) THEN
IF Get_Property(@WINDOW,'SAVEWARN') THEN
Message = 'Order No. ':OrderNo:' has been changed.'
END
END ELSE
Message = 'New Order ':QUOTE(OrderNo):' entered into system.'
END
IF Message NE '' THEN
Recipients = XLATE('NOTIFICATION','ORDER_ENTRY',NOTIFICATION_USER_ID$,'X')
SentFrom = @USER4
Subject = 'New/Update Order':OrderNo
AttachWindow = 'ORDER2'
AttachKey = OrderNo
SendToGroup = ''
Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup
*obj_Notes('Create',Parms) ;* Per Request from Customer Service
IF Get_Status(errCode) THEN
ErrMsg(errCode)
END
END
/*/
Result = 1
RETURN
* * * * * * *
Delete:
* * * * * * *
/*
IF Security_Check('Order',Delete$) THEN
Result = 1 ;* Proceed with delete
END ELSE
Security_Err_Msg('Order',Delete$)
Result = 0 ;* Stop event chain
END
*/
RETURN
* * * * * * *
LUReactEsc:
* * * * * * *
IF NOT(ASSIGNED(Parm1)) THEN FocusControl = '' ELSE FocusControl = Parm1
IF NOT(ASSIGNED(Parm2)) THEN FocusPos = '' ELSE FocusPos = Parm2
Set_Status(0)
/*
EventKeys = obj_React_Esc('Find')
IF Get_Status(errCode) THEN ErrMsg(ErrCode)
IF INDEX(EventKeys,@VM,1) THEN
TypeOver = ''
TypeOver<PMODE$> = 'K'
TypeOver<PDISPLAY$> = EventKeys
EventKeys = Popup(@WINDOW,TypeOver,'REACT_ESC_QUERY')
END
CONVERT @VM TO @FM IN EventKeys
IF INDEX(EventKeys,@FM,1) THEN
Send_Event(@WINDOW,'QBFINIT')
Set_Property(@WINDOW,'QBFLIST',EventKeys)
GOSUB Refresh
Send_Event(@WINDOW,'QBFIRST')
END ELSE
obj_Appwindow('LoadFormKeys',@WINDOW:@RM:EventKeys)
END
*/
RETURN
* * * * * * *
Close:
* * * * * * *
*obj_Notes('Inbox',@USER4) ;* Checks for any new messages
obj_Appwindow('DetailReturn',@WINDOW)
RETURN
* * * * * * *
SendSPC:
* * * * * * *
Ctrls = @WINDOW:'.RDS_NO':@RM ; Props = 'DEFPROP':@RM
Ctrls := @WINDOW:'.STAGE':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.SS_SCAN_TOOL':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.SUM_OF_DEF_MIN':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.SUM_OF_DEF_MAX':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.SUM_OF_DEF_AVG':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.HAZE_AVG_AVG':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.SPOTS':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.FOV':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.SCRATCHES':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.SCRATCH_LEN':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.REACT_NO':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.WAFER_SIZE':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.SS_SCRATCH_MAX':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.SS_SCRATCH_AVG' ; Props := 'DEFPROP'
Vals = Get_Property(Ctrls,Props)
RDSNo = Vals[1,@RM]
Stage = Vals[COL2()+1,@RM]
ScanTool = Vals[COL2()+1,@RM]
SumOfDefMin = Vals[COL2()+1,@RM]
SumOfDefMax = Vals[COL2()+1,@RM]
SumOfDefAvg = Vals[COL2()+1,@RM]
HazeAvgAvg = Vals[COL2()+1,@RM]
Spots = Vals[COL2()+1,@RM]
FOV = Vals[COL2()+1,@RM]
Scratches = Vals[COL2()+1,@RM]
ScratchLen = Vals[COL2()+1,@RM]
ReactNo = Vals[COL2()+1,@RM]
WaferSize = Vals[COL2()+1,@RM]
SSScratchMax = Vals[COL2()+1,@RM]
SSScratchAvg = Vals[COL2()+1,@RM]
WaferSize = WaferSize[1,' '] ;* Data looks like "125 mm 6 in"
UserName = OCONV(@USER4,'[XLATE_CONV,LSL_USERS*FIRST_LAST]')
DataLine = QUOTE(ReactNo):TAB$
DataLine := QUOTE(RDSNo):TAB$
DataLine := QUOTE(Stage):TAB$
DataLine := QUOTE(ScanTool):TAB$
DataLine := QUOTE(SumOfDefMin):TAB$
DataLine := QUOTE(SumOfDefMax):TAB$
DataLine := QUOTE(SumOfDefAvg):TAB$
DataLine := QUOTE(HazeAvgAvg):TAB$
DataLine := QUOTE(Spots):TAB$
DataLine := QUOTE(FOV):TAB$
DataLine := QUOTE(Scratches):TAB$
DataLine := QUOTE(ScratchLen):TAB$
DataLine := QUOTE(UserName):TAB$
DataLine := QUOTE(SSScratchAvg):TAB$
DataLine := QUOTE(SSScratchMax):TAB$
DataLine := QUOTE(WaferSize)
IF @USERNAME = 'BRYCE_BARB' THEN
DOSFile = Environment_Services('GetApplicationRootPath') : '\SPC_Surf.TXT'
END ELSE
*DOSFile = 'R:\SPC_Surf.TXT'
* DOSFile = 'N:\IT\CommonRW\OI_SPC_Data_Transfer\SPC_Surf.TXT'
* DOSFile = Environment_Services('GetUserDataProductionPath') : '\CommonRW\OI_SPC_Data_Transfer\SPC_Surf.TXT'
DOSFile = Environment_Services('GetSPCDataProductionPath') : '\SPC_Surf.txt'
END
* * * * * * *
DosRead:
* * * * * * *
Set_Status(0)
OSRead DOSRecord FROM DOSFile ELSE
ErrCode = Status()
IF ErrCode = 4 THEN
DOSRecord = '' ;* File doesn't exist
END ELSE
ErrMsg('Unable to read DOS file "SPC_Data.TXT" for update. ':ErrCode:' Please try again.')
RETURN
END
END
DOSRecord := DataLine:CRLF$
OSWrite DOSRecord ON DOSFile
CurrDTM = OCONV(Date(),'D4/'):' ':OCONV(Time(),'MTS')
Set_Property(@WINDOW:'.SPC_DTM','DEFPROP',CurrDTM)
RETURN
* * * * * * *
SetGroupBackground:
* * * * * * *

View File

@ -0,0 +1,450 @@
Compile function Clean_Insp_Services(@Service, @Params)
/***********************************************************************************************************************
Name : Clean_Insp_Services
Description : Handler program for all CLEAN_INSP services.
Notes : Application errors should be logged using the Error Services module. There are a few methodological
assumptions built into way errors are managed which are important to understand in order to properly
work with Error Services:
- The term 'top' refers to the originating procedure of a call stack and the term 'bottom' refers to
the last routine (or the current routine) within a call stack. Within the OpenInsight Debugger
this will appear backwards since the originating procedure always appears at the bottom of the
list and the current routine appears at the top of the list. We are using this orientation because
it is common to refer to the process of calling other procedures as 'drilling down'.
- The reason for defining the orientation of the call stack is because Error_Services allows for
multiple error conditions to be appended to an original error. In most cases this will happen when
a procedure at the bottom of the stack generates an error condition and then returns to its
calling procedure. This higher level procedure can optionally add more information relevant to
itself. This continues as the call stack 'bubbles' its way back to the top to where the
originating procedure is waiting.
- Native OpenInsight commands that handle errors (e.g., Set_Status, Set_FSError, Set_EventStatus)
preserve their error state until explicitly cleared. This can hinder the normal execution of code
since subsequent procedures (usually SSPs) will fail if a pre-existing error condition exists.
Our philosophy is that error conditions should automatically be cleared before a new procedure
is executed to avoid this problem. However, the nature of Basic+ does not make this easy to
automate for any given stored procedure. Therefore, if a stored procedure wants to conform to our
philosophy then it should include a call into the 'Clear' service request at the top of the
program. Alternatively this can be done through a common insert (see SERVICE_SETUP for example.)
- Service modules will use the SERVICE_SETUP insert and therefore automatically clear out any
error conditions that were set before.
Parameters :
Service [in] -- Name of the service being requested
Param1-10 [in/out] -- Additional request parameter holders
Response [out] -- Response to be sent back to the Controller (MCP) or requesting procedure
Metadata :
History : (Date, Initials, Notes)
11/16/22 djs Original programmer.
04/12/23 djs Fixed WO_STEP_PROD_SPEC_ID$ equate typo within UpdateCleanInsp service.
***********************************************************************************************************************/
#pragma precomp SRP_PreCompiler
$Insert LOGICAL
$Insert SERVICE_SETUP
$Insert WO_STEP_EQUATES
$Insert CLEAN_INSP_EQUATES
$Insert PRS_STAGE_EQUATES
$Insert WO_MAT_EQUATES
Declare function Database_Services, SRP_JSON, Error_Services, obj_Clean_Insp
Declare subroutine Database_Services, SRP_JSON, Error_Services, obj_React_Run, Clean_Insp_Services, React_Run_Services
GoToService
Return Response or ""
//-----------------------------------------------------------------------------
// SERVICES
//-----------------------------------------------------------------------------
Service ConvertRecordToJSON(KeyID, Record, ItemURL)
jsonRecord = ''
If KeyID NE '' then
If Record EQ '' then Record = Database_Services('ReadDataRow', 'CLEAN_INSP', KeyID)
If Error_Services('NoError') then
@DICT = Database_Services('GetTableHandle', 'DICT.CLEAN_INSP')
@ID = KeyID
@RECORD = Record
If SRP_JSON(objJSON, 'New', 'Object') then
If SRP_JSON(objCleanInsp, 'New', 'Object') then
SRP_JSON(objCleanInsp, 'SetValue', 'keyId', @ID)
SRP_JSON(objCleanInsp, 'SetValue', 'stage', {STAGE})
// Add Cleans Object
If SRP_JSON(objCleans, 'New', 'Object') then
// Add Cleans Specs Object
If SRP_JSON(objSpecCleans, 'New', 'Object') then
SRP_JSON(objSpecCleans, 'SetValueArray', 'tools', {SPEC_CLEAN_TOOL}, @VM)
SRP_JSON(objSpecCleans, 'SetValueArray', 'recipes', {SPEC_CLEAN_RECIPE}, @VM)
SRP_JSON(objCleans, 'Set', 'specs', objSpecCleans)
SRP_JSON(objSpecCleans, 'Release')
end
// Add Cleans Operations
If SRP_JSON(objCleansOpsArray, 'New', 'Array') then
CleanTools = {CLEAN_TOOL}
If CleanTools NE '' then
BoatIds = {CLEAN_BOAT_ID}
SRDNos = {CLEAN_SRD_NO}
CleanUsers = {CLEAN_SIG}
CleanDTMs = {CLEAN_SIG_DTM}
For each CleanTool in CleanTools using @VM setting vPos
If SRP_JSON(objCleansOp, 'New', 'Object') then
SRP_JSON(objCleansOp, 'SetValue', 'cleanTool', CleanTool)
SRP_JSON(objCleansOp, 'SetValue', 'boatId', BoatIds<0, vPos>)
SRP_JSON(objCleansOp, 'SetValue', 'srdNo', SRDNos<0, vPos>)
SRP_JSON(objCleansOp, 'SetValue', 'userId', CleanUsers<0, vPos>)
SRP_JSON(objCleansOp, 'SetValue', 'cleadDtm', OConv(CleanDTMs<0, vPos>, 'DT2/^H'))
SRP_JSON(objCleansOpsArray, 'Add', objCleansOp)
SRP_JSON(objCleansOp, 'Release')
end
Next CleanTool
end
SRP_JSON(objCleans, 'Set', 'operations', objCleansOpsArray)
SRP_JSON(objCleansOpsArray, 'Release')
end
SRP_JSON(objCleanInsp, 'Set', 'cleans', objCleans)
SRP_JSON(objCleans, 'Release')
end
// Add Inspection Object
If SRP_JSON(objInsp, 'New', 'Object') then
// Add Specs Object
If SRP_JSON(objInspSpecs, 'New', 'Object') then
SRP_JSON(objInspSpecs, 'SetValue', 'microscopeReq', {SPEC_MICROSCOPE}, 'Boolean')
SRP_JSON(objInspSpecs, 'SetValue', 'brightlightReq', {SPEC_BRIGHTLIGHT}, 'Boolean')
SRP_JSON(objInspSpecs, 'SetValue', 'lpd', {SPEC_LPD})
SRP_JSON(objInspSpecs, 'SetValue', 'scratches', {SPEC_SCRATCHES})
SRP_JSON(objInspSpecs, 'SetValue', 'scratchLen', {SPEC_SCRATCH_LEN})
SRP_JSON(objInspSpecs, 'SetValue', 'pits', {SPEC_PITS})
SRP_JSON(objInspSpecs, 'SetValue', 'mounds', {SPEC_MOUNDS})
SRP_JSON(objInspSpecs, 'SetValue', 'stackFaults', {SPEC_STACK_FAULTS})
SRP_JSON(objInspSpecs, 'SetValue', 'spikes', {SPEC_SPIKES})
SRP_JSON(objInspSpecs, 'SetValue', 'spots', {SPEC_SPOTS})
SRP_JSON(objInspSpecs, 'SetValue', 'fov', {SPEC_FOV})
SRP_JSON(objInspSpecs, 'SetValue', 'blDefects', {SPEC_BL_DEFECTS})
SRP_JSON(objInspSpecs, 'SetValue', 'bsideScratches', {SPEC_BSIDE_SCRATCHES})
SRP_JSON(objInspSpecs, 'SetValue', 'bsideScratchLen', {SPEC_BSIDE_SCRATCH_LEN})
SRP_JSON(objInspSpecs, 'SetValue', 'bsideNodules', {SPEC_BSIDE_NODULES})
SRP_JSON(objInspSpecs, 'SetValue', 'bsideSpikes', {SPEC_BSIDE_SPIKES})
SRP_JSON(objInsp, 'Set', 'specs', objInspSpecs)
SRP_JSON(objInspSpecs, 'Release')
end
SRP_JSON(objCleanInsp, 'Set', 'inspection', objInsp)
SRP_JSON(objInsp, 'Release')
end
// Add Surfscan Object
If SRP_JSON(objSurfScan, 'New', 'Object') then
If SRP_JSON(objSpecSurfScanArray, 'New', 'Array') then
SurfScanRecipes = {SPEC_SURFSCAN_RECIPE}
SpecDefects = {SPEC_SURF_DEFECTS}
SpecHazes = {SPEC_SURF_HAZE}
SpecSampleQtys = {SPEC_SS_SAMP_QTY}
If SurfScanRecipes NE '' then
For each SurfScanRecipe in SurfScanRecipes using @VM setting vPos
If SRP_JSON(objSpecSurfScan, 'New', Object) then
SRP_JSON(objSpecSurfScan, 'SetValue', 'recipe', SurfScanRecipe)
SRP_JSON(objSpecSurfScan, 'SetValue', 'defect', SpecDefects<0, vPos>)
SRP_JSON(objSpecSurfScan, 'SetValue', 'haze', SpecHazes<0, vPos>)
SRP_JSON(objSpecSurfScan, 'SetValue', 'sampleQty', SpecSampleQtys<0, vPos>)
SRP_JSON(objSpecSurfScanArray, 'Add', objSpecSurfScan)
SRP_JSON(objSpecSurfScan, 'Release')
end
Next SurfScanRecipe
end
SRP_JSON(objSurfScan, 'Set', 'specs', objSpecSurfScanArray)
SRP_JSON(objSpecSurfScanArray, 'Release')
end
SRP_JSON(objCleanInsp, 'Set', 'surfScan', objSurfScan)
SRP_JSON(objSurfScan, 'Release')
end
SRP_JSON(objJSON, 'Set', 'cleanInsp', objCleanInsp)
SRP_JSON(objCleanInsp, 'Release')
end
If itemURL NE '' then
// The itemURL was passed in so add HAL+JSON properties.
// Create the _links property and then all link objects needed for this resource.
If SRP_JSON(objLinks, 'New', 'Object') then
// Create a self link.
If SRP_JSON(objLink, 'New', 'Object') then
SRP_JSON(objLink, 'SetValue', 'href', ItemURL, 'String')
SRP_JSON(objLink, 'SetValue', 'title', 'Self', 'String')
SRP_JSON(objLinks, 'Set', 'self', objLink)
SRP_JSON(objLink, 'Release')
end
SRP_JSON(objJSON, 'Set', '_links', objLinks)
SRP_JSON(objLinks, 'Release')
end
// Create the _class property for this resource.
SRP_JSON(objJSON, 'SetValue', '_class', 'resource')
end
jsonRecord = SRP_JSON(objJSON, 'Stringify', 'Styled')
SRP_JSON(objJSON, 'Release')
end else
Error_Services('Add', 'Unable to create JSON representation in the ' : Service : ' service.')
end
end
end else
Error_Services('Add', 'KeyID argument was missing in the ' : Service : ' service.')
end
Response = jsonRecord
End Service
Service ConvertJSONToRecord(JSON)
If JSON NE '' then
If SRP_JSON(objJSON, 'Parse', JSON) EQ '' then
objCleanInsp = SRP_JSON(objJSON, 'Get', 'cleanInsp')
@ID = SRP_JSON(objCleanInsp, 'GetValue', 'keyId')
If @ID NE '' then
@Record = Database_Services('ReadDataRow', 'CLEAN_INSP', @ID)
If Error_Services('NoError') then
@Dict = Database_Services('GetTableHandle', 'DICT.CLEAN_INSP')
end
end else
Error_Services('Add', 'Error in ':Service:' service. Null value for cleanInsp.keyID.')
end
SRP_JSON(objCleanInsp, 'Release')
SRP_JSON(objJSON, 'Release')
end else
Error_Services('Add', 'Error in ':Service:' service. Unable to parse JSON payload.')
end
end else
Error_Services('Add', 'Error in ':Service:' service. Null JSON passed in.')
end
Response = @Record
End Service
//----------------------------------------------------------------------------------------------------------------------
// UpdateCleanInsp
//
// CleanInspKey - [Required]
//
// Updates or deletes a CLEAN_INSP record associated with an RDS or WM_OUT record per the PSN.
// This is useful when a PSN has changed such that PRS_STAGES have been added and/or removed and/or modified.
//----------------------------------------------------------------------------------------------------------------------
Service UpdateCleanInsp(CleanInspKey)
CIRec = ''
ErrorMsg = ''
If CleanInspKey NE '' then
CIRec = Database_Services('ReadDataRow', 'CLEAN_INSP', CleanInspKey)
If CIRec NE '' then
WONo = CIRec<CLEAN_INSP_WO_NO$>
WOStep = CIRec<CLEAN_INSP_WO_STEP$>
WOStepKey = WONo:'*':WOStep
ReactType = Xlate('WO_STEP', WOStepKey, 'REACTOR_TYPE', 'X')
If ReactType NE 'GAN' then
CassNo = CIRec<CLEAN_INSP_CASS_NO$>
Stage = CIRec<CLEAN_INSP_STAGE$>
RDSNo = CIRec<CLEAN_INSP_RDS_NO$>
PSNo = XLATE('WO_STEP', WONo:'*':WOStep, WO_STEP_PROD_SPEC_ID$, 'X')
If ( (PSNo NE '') and (Stage NE '') ) then
PrsStageKey = PSNo:'*':Stage
PRSStageRec = Database_Services('ReadDataRow', 'PRS_STAGE', PrsStageKey)
IF PRSStageRec NE '' THEN
CIRec<CLEAN_INSP_SPEC_INSP_REQ$> = PRSStageRec<PRS_STAGE_INSP_SIG_REQ$>
CIRec<CLEAN_INSP_SPEC_SURFSCAN_REQ$> = PRSStageRec<PRS_STAGE_SURFSCAN_SIG_REQ$>
CIRec<CLEAN_INSP_SPEC_CLEAN_REQ$> = PRSStageRec<PRS_STAGE_CLEAN_SIG_REQ$>
CIRec<CLEAN_INSP_SPEC_BRIGHTLIGHT$> = PRSStageRec<PRS_STAGE_BRIGHTLIGHT$> ;* Visual Inspection
CIRec<CLEAN_INSP_SPEC_MICROSCOPE$> = PRSStageRec<PRS_STAGE_MICROSCOPE$> ;* Visual Inspection
CIRec<CLEAN_INSP_SPEC_EDGE$> = PRSStageRec<PRS_STAGE_EDGE$> ;* Visual Inspection
CIRec<CLEAN_INSP_SPEC_PITS$> = PRSStageRec<PRS_STAGE_PITS$> ;* Visual Inspection
CIRec<CLEAN_INSP_SPEC_MOUNDS$> = PRSStageRec<PRS_STAGE_MOUNDS$> ;* Visual Inspection
CIRec<CLEAN_INSP_SPEC_BL_DEFECTS$> = PRSStageRec<PRS_STAGE_BL_DEFECTS$> ;* Visual Inspection
CIRec<CLEAN_INSP_SPEC_SPOTS$> = PRSStageRec<PRS_STAGE_SPOTS$> ;* Visual Inspection
CIRec<CLEAN_INSP_SPEC_FOV$> = PRSStageRec<PRS_STAGE_FOV$> ;* Visual Inspection
CIRec<CLEAN_INSP_SPEC_SCRATCHES$> = PRSStageRec<PRS_STAGE_SCRATCHES$> ;* Visual Inspection
CIRec<CLEAN_INSP_SPEC_SCRATCH_LEN$> = PRSStageRec<PRS_STAGE_SCRATCH_LEN$> ;* Visual Inspection
CIRec<CLEAN_INSP_SPEC_LPD$> = PRSStageRec<PRS_STAGE_LPD$> ;* Visual Inspection
CIRec<CLEAN_INSP_SPEC_STACK_FAULTS$> = PRSStageRec<PRS_STAGE_STACK_FAULTS$> ;* Visual Inspection
CIRec<CLEAN_INSP_SPEC_SPIKES$> = PRSStageRec<PRS_STAGE_SPIKES$> ;* Visual Inspection
CIRec<CLEAN_INSP_INSP_INTERVAL$> = PRSStageRec<PRS_STAGE_INSP_INTERVAL$> ;* Visual Inspection
CIRec<CLEAN_INSP_SPEC_SURFSCAN_RECIPE$> = PRSStageRec<PRS_STAGE_SURFSCAN_RECIPE$> ;* Surface Scan
CIRec<CLEAN_INSP_SPEC_SURF_HAZE$> = PRSStageRec<PRS_STAGE_SURF_HAZE$> ;* Surface Scan
CIRec<CLEAN_INSP_SPEC_SURF_DEFECTS$> = PRSStageRec<PRS_STAGE_SURF_DEFECTS$> ;* Surface Scan
CIRec<CLEAN_INSP_SPEC_SS_SAMP_QTY$> = PRSStageRec<PRS_STAGE_SS_SAMP_QTY$> ;* Surface Scan
CIRec<CLEAN_INSP_SPEC_CLEAN_TOOL$> = PRSStageRec<PRS_STAGE_CLEAN_TOOL$> ;* Cleans
CIRec<CLEAN_INSP_SPEC_CLEAN_RECIPE$> = PRSStageRec<PRS_STAGE_CLEAN_RECIPE$> ;* Cleans
Database_Services('WriteDataRow', 'CLEAN_INSP', CleanInspKey, CIRec, True$, False$, True$)
end else
// PRS Stage no longer exists, so delete the clean & insp record
Database_Services('DeleteDataRow', 'CLEAN_INSP', CleanInspKey)
CIRec = ''
// Remove references to the CLEAN_INSP record
Begin Case
Case ReactType EQ 'EPP'
// Remove CleanInspKey from WO_MAT_EPI_CI_NO$/WO_MAT_EPO_CI_NO$
WOMatKey = WONo:'*':CassNo
WOMatRec = Database_Services('ReadDataRow', 'WO_MAT', WOMatKey)
If Error_Services('NoError') then
Begin Case
Case Stage EQ 'PRE'
WOMatRec<WO_MAT_EPI_CI_NO$> = ''
Database_Services('WriteDataRow', 'WO_MAT', WOMatKey, WOMatRec)
Case Stage EQ 'POST'
WOMatRec<WO_MAT_EPO_CI_NO$> = ''
Database_Services('WriteDataRow', 'WO_MAT', WOMatKey, WOMatRec)
Case Otherwise$
// We should never get here as EPP only supports CLEAN_INSP on the PRE and POST stages
Null
End Case
end
Case Otherwise$
// Remove CleanInspKey and stage from REACT_RUN record
React_Run_Services('RemCleanInsp', RDSNo, CleanInspKey, Stage)
End Case
end
end else
ErrorMsg = 'Error in ':Service:' service. Could not determine PRS_STAGE key for CLEAN_INSP record ':CleanInspKey:'.'
end
end else
ErrorMsg = 'Error in ':Service:' service. GaN is not supported.'
end
end else
ErrorMsg = 'Error in ':Service:' service. CLEAN_INSP record ':CleanInspKey:' does not exist.'
end
end else
ErrorMsg = 'Error in ':Service:' service. Null CleanInsp key passed into service.'
end
If ErrorMsg NE '' then
Error_Services('Add', ErrorMsg)
end else
Response = CIRec
end
end service
//----------------------------------------------------------------------------------------------------------------------
// UpdateAllCleanInsp
//
// WOMatKey - [Required]
//
// Creates/Deletes/Updates all CLEAN_INSP records associated with an RDS or WM_OUT record per the PSN.
// This is useful when a PSN has changed such that PRS_STAGES have been added and/or removed and/or modified.
//----------------------------------------------------------------------------------------------------------------------
Service UpdateAllCleanInsp(WOMatKey)
ErrorMsg = ''
If WOMatKey NE '' then
WONo = Field(WOMatKey, '*', 1)
CassNo = Field(WOMatKey, '*', 2)
PSNo = Xlate('WO_STEP', WONo:'*1', WO_STEP_PROD_SPEC_ID$, 'X')
If PSNo NE '' then
ReactType = Xlate('PROD_SPEC', PSNo, 'REACTOR_TYPE', 'X')
Begin Case
Case ReactType EQ 'EPP'
WOMatRec = Database_Services('ReadDataRow', 'WO_MAT', WOMatKey)
// Update CLEAN_INSP records associated with the WM_OUT record
// The app on supports CLEAN_INSP records on the PRE and POST stages
PreCINo = Xlate('WO_MAT', WOMatKey, WO_MAT_EPI_CI_NO$, 'X')
Begin Case
Case PreCINo NE ''
// Update/delete the CLEAN_INSP record
Clean_Insp_Services('UpdateCleanInsp', PreCINo)
Case ( (PreCINo EQ '') and (RowExists('PRS_STAGE', PSNo:'*PRE') ) )
// Create the CLEAN_INSP record
ociParms = WONo:@RM ;* WONo
ociParms := 1:@RM ;* WOStep
ociParms := CassNo:@RM ;* CassNo
ociParms := 'PRE':@RM ;* Stage ;* Pre Epi Cleaning on inbound material
ociParms := '':@RM ;* RDSNo ;* No specific RDS on Epi Pro inbound material
ociParms := PSNo:@RM ;* PSNo
ociParms := '' ;* PSRec ;* Optional
WOMatRec<WO_MAT_EPI_CI_NO$> = obj_Clean_Insp('Create',ociParms)
Database_Services('WriteDataRow', 'WO_MAT', WOMatKey, WOMatRec)
End Case
PostCINo = Xlate('WO_MAT', WOMatKey, WO_MAT_EPO_CI_NO$, 'X')
Begin Case
Case PostCINo NE ''
// Update/delete the CLEAN_INSP record
Clean_Insp_Services('UpdateCleanInsp', PostCINo)
Case ( (PostCINo EQ '') and (RowExists('PRS_STAGE', PSNo:'*POST') ) )
// Create the CLEAN_INSP record
ociParms = WONo:@RM ;* WONo
ociParms := 1:@RM ;* WOStep
ociParms := CassNo:@RM ;* CassNo
ociParms := 'POST':@RM ;* Stage ;* Pre Epi Cleaning on inbound material
ociParms := '':@RM ;* RDSNo ;* No specific RDS on Epi Pro inbound material
ociParms := PSNo:@RM ;* PSNo
ociParms := '' ;* PSRec ;* Optional
WOMatRec<WO_MAT_EPO_CI_NO$> = obj_Clean_Insp('Create',ociParms)
Database_Services('WriteDataRow', 'WO_MAT', WOMatKey, WOMatRec)
End Case
Case ReactType EQ 'GAN'
// Not supported
ErrorMsg = 'Error in ':Service:' service. GAN is not supported.'
Case Otherwise$
// Update CLEAN_INSP records associated with the RDS record
RDSNo = Xlate('WO_MAT', WOMatKey, 'RDS_NO', 'X')
Stages = 'PRE,FWI,LWI,POST'
For each Stage in Stages using ','
CICol = Stage:'_CI_NO'
StageCINo = Xlate('RDS', RDSNo, CICol, 'X')
Begin Case
Case StageCINo NE ''
// Update/delete the CLEAN_INSP record
Clean_Insp_Services('UpdateCleanInsp', StageCINo)
Case ( (StageCINo EQ '') and (RowExists('PRS_STAGE', PSNo:'*':Stage) ) )
// Create the CLEAN_INSP record
ociParms = WONo:@RM ;* WONo
ociParms := 1:@RM ;* WOStep
ociParms := CassNo:@RM ;* CassNo
ociParms := Stage:@RM ;* Stage ;* Pre Epi Cleaning on inbound material
ociParms := RDSNo:@RM ;* RDSNo
ociParms := PSNo:@RM ;* PSNo
ociParms := '' ;* PSRec ;* Optional
NewCINo = obj_Clean_Insp('Create',ociParms)
// Add the stage and key ID to the REACT_RUN record
React_Run_Services('AddCleanInsp', RDSNo, NewCINo, Stage)
End Case
Next Stage
End Case
end else
ErrorMsg = 'Error in ':Service:' service. Could not determine PS_NO for WO_MAT record ':WOMatKey:'.'
end
end else
ErrorMsg = 'Error in ':Service:' service. Null WO_MAT key passed into service.'
end
If ErrorMsg NE '' then
Error_Services('Add', ErrorMsg)
Response = False$
end else
Response = True$
end
end service
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Internal GoSubs
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -0,0 +1,72 @@
COMPILE ROUTINE CLEAN_UP_JUNK(Dummy)
ROWDEF(CHARSTR)
DECLARE SUBROUTINE obj_Schedule,Send_Dyn,Send_Infom, obj_Order, obj_WO_Log, RList, RList, ErrMsg
DECLARE SUBROUTIne obj_WO_Step, Set_Status, Send_Info, Send_Dyn
DECLARE FUNCTION Get_Status, Set_Printer, Popup
$INSERT ORDER_EQU
$INSERT WO_LOG_EQU
$INSERT WO_STEP_EQU
$INSERT SCHEDULE_EQU
$INSERT RDS_EQU
$INSERT RLIST_EQUATES
$INSERT POPUP_EQUATES
DEBUG
OPEN 'JCH_LOG' TO LogTable ELSE
DEBUG
RETURN
END
IF Get_Status(errCode) THEN DEBUG
SelectStatement = 'SELECT JCH_LOG '
errCode = ''
RList(SelectStatement, TARGET_ACTIVELIST$, '','','')
IF Get_Status(errCode) THEN
ErrMsg(errCode)
DEBUG
GOTO Bail
END
Done = 0
LOOP
READNEXT LogNo ELSE Done = 1
UNTIL Done
READ LogRec FROM LogTable,LogNo THEN
IF LogRec[1,7] = 'RDS_PRE' THEN
DELETE LogTable,LogNo THEN
Send_Dyn(LogNo:' - Deleted')
END
END ELSE
*WRITE WORec ON WOLogTable,WONo THEN
Send_Dyn(LogNo:' ':LogRec)
*END
END
END
REPEAT
* * * * * * *
Bail:
* * * * * * *
END

View File

@ -0,0 +1,63 @@
COMPILE ROUTINE CLEAN_UP_SYSLISTS(Dummy)
ROWDEF(CHARSTR)
DECLARE SUBROUTINE Send_Dyn,Send_Infom, RList, RList, ErrMsg
DECLARE SUBROUTINE Set_Status, Send_Info,
DECLARE FUNCTION Get_Status, Set_Printer, Popup
$INSERT ORDER_EQU
$INSERT WO_LOG_EQU
$INSERT WO_STEP_EQU
$INSERT SCHEDULE_EQU
$INSERT RDS_EQU
$INSERT RLIST_EQUATES
$INSERT POPUP_EQUATES
OPEN 'SYSLISTS' TO FileIn ELSE
DEBUG
RETURN
END
IF Get_Status(errCode) THEN DEBUG
SelectStatement = 'SELECT SYSLISTS'
RList(SelectStatement, TARGET_ACTIVELIST$, '','','')
IF Get_Status(errCode) THEN
ErrMsg(errCode)
DEBUG
GOTO Bail
END
DEBUG
Done = 0
RecCnt = 0
LOOP
READNEXT ID ELSE Done = 1
UNTIL Done
READ Rec FROM FileIn,ID THEN
RecCnt += 1
*DELETE FileIn,ID THEN
Send_Dyn(ID)
Send_Info(RecCnt:' ':ID)
*END
END
REPEAT
* * * * * * *
Bail:
* * * * * * *
END

11
LSL2/STPROC/COA_COC.txt Normal file
View File

@ -0,0 +1,11 @@
COMPILE Insert COA_COC
* Equates for COA_COC table
EQU COA_COC_PO_NO$ TO 1
EQU COA_COC_SHIP_DT$ TO 2
EQU COA_COC_SPEC$ TO 3
EQU COA_COC_VEND_LOT_NO$ TO 4
EQU COA_COC_VEND_LOT_QTY$ TO 5
EQU COA_COC_PATH$ TO 6
EQU COA_COC_XLFILENAME$ TO 7

94
LSL2/STPROC/COC_RPT1.txt Normal file
View File

@ -0,0 +1,94 @@
compile function COC_RPT1()
begin condition
pre:
post:
end condition
declare function msg, set_property, send_event, dialog_box, utility, get_property
declare subroutine rlist, or_view, activate_save_select, yield
$insert rlist_equates
$insert msg_equates
Params = dialog_box( 'COC_RPT1', @window, '*CENTER' )
if Params = 'CANCEL' or Params = '' then
return 0
end
open 'SYSLISTS' to SysListsTable else
MsgInfo = ''
MsgInfo<mcol$> = -2
MsgInfo<mrow$> = -2
MsgInfo<mtext$> = 'Unable to open SYSLISTS...'
Void = msg( '', MsgInfo )
return 0
end
ListsId = 'COC_RPT1*':@station
write '' on SysListsTable, ListsId else
MsgInfo = ''
MsgInfo<mcol$> = -2
MsgInfo<mrow$> = -2
MsgInfo<mtext$> = 'Unable to clear SYSLISTS ':ListsId:'...'
Void = msg( '', MsgInfo )
return 0
end
convert '*' to @fm in Params
CocFrom = Params<1>
CocThru = Params<2>
DirToPrinter = Params<3>
Stat = utility( 'CURSOR', 'H' )
Stmt = 'SELECT COC BY WO'
if CocFrom and CocThru then
Stmt := " WITH ENTRY_DATE FROM ":QUOTE(CocFrom):' TO ':QUOTE(CocThru)
end else
if CocFrom then
Stmt := " WITH ENTRY_DATE GE ":QUOTE(CocFrom)
end
if CocThru then
Stmt := " WITH ENTRY_DATE LE ":QUOTE(CocThru)
end
end
rlist( Stmt, target_savelist$, ListsId, '', '' )
activate_save_select( ListsId )
if @reccount then
Cmd = "LIST COC CUST_NAME JUSTLEN 35 WO JUSTLEN 8 PO TOTAL TOT_QTY "
Cmd:= " HEADING ":'"':" COC (Shipments) by Work Order 'T' PAGE # 'PP''L' for Selected Dates From (":CocFrom:" ) Thru (":CocThru:")":'" '
Cmd:= " ID-SUPP"
if DirToPrinter = 'Yes' then
rlist( Cmd, 0, '', '', '' )
end else
or_view( '', Cmd )
Void = set_property( 'ORPRV.PRINT', 'ENABLED', 0 )
WinId = 'ORPRV'
loop
while get_property( WinId, 'HANDLE' )
yield()
repeat
ToPrint = ''
MsgInfo = ''
MsgInfo<mtext$> = 'Do you want to print this report?'
MsgInfo<micon$> = '?'
MsgInfo<mtype$> = 'BNY'
MsgInfo<mcol$> = -2
MsgInfo<mrow$> = -2
MsgInfo<mdefbtn$> = 2 ;* default to no
ToPrint = msg( '', MsgInfo )
if ToPrint then
activate_save_select( ListsId )
rlist( Cmd, 0, '', '', '' )
end
end
end else
MsgInfo = ''
MsgInfo<mtext$> = 'NO Records meeting your date criteria!!'
MsgInfo<micon$> = '!'
MsgInfo<mcol$> = -2
MsgInfo<mrow$> = -2
Void = MSG( '', MsgInfo )
end
write '' on SysListsTable, ListsId else
MsgInfo<mtext$> = 'Unable to clear SYSLISTS ':ListsId:'...'
MsgInfo<mcol$> = -2
MsgInfo<mrow$> = -2
msg( '', MsgInfo )
return 0
end
RETURN 0

139
LSL2/STPROC/COC_SRPT1.txt Normal file
View File

@ -0,0 +1,139 @@
COMPILE FUNCTION COC_SRPT1()
declare function msg, set_property, send_event, dialog_box, utility, get_property
declare function set_printer, PrintSetup, obj_Install
declare subroutine rlist, or_view, activate_save_select, yield
declare subroutine order_srpt1
$INSERT RLIST_EQUATES
$INSERT MSG_EQUATES
$INSERT OIPRINT_EQUATES
$INSERT RPT_CFG_EQU
$INSERT PRINTSETUP_EQUATES
TimeX = OCONV(Time(),'MTS')
CrLf = Char(13):Char(10)
CurDte = OCONV(Date(),"D4/")
ReportID = "COC001_SRPTCFG"
ReportControl = "COC_SRPT1"
TableName = 'COC'
ListsId = ReportControl:'*':@station
TtlLin1 = ''
TtlLin2 = ''
TtlLin3 = ''
TtlLin4 = ''
open 'CONFIG' to ConfigTable else
Void = msg( '', 'Unable to open CONFIG...' )
return 0
end
Read SRptConfig From ConfigTable,ReportID Else
Void = msg( '', 'Unable to read ': ReportID:' From CONFIG table!' )
return 0
End
Params = dialog_box( ReportControl, @window, '*CENTER' )
if Params = 'CANCEL' or Params = '' then
return 0
end
convert '*' to @fm in Params
BegDte = Params<1>
EndDte = Params<2>
Void = utility( 'CURSOR', 'H' )
WithStmt = 'SELECT ':TableName:' '
WthSwt = 0
BEGIN CASE
CASE BegDte = EndDte AND BegDte NE '' AND EndDte NE ''
TtlLin2 = 'Ship Date:':BegDte
WithStmt := " WITH SHIP_DT = '":BegDte:"'"
WthSwt = 1
CASE BegDte and EndDte
TtlLin2 = 'Ship Dates: From ':BegDte:' To ':EndDte
WithStmt := " WITH SHIP_DT FROM '": BegDte:"' TO '":EndDte: "' "
WthSwt = 1
CASE BegDte
TtlLin2 = 'Ship Dates: From ':BegDte:' To ':CurDte
WithStmt := " WITH SHIP_DT GE '":BegDte:"' "
WthSwt = 1
CASE EndDte
TtlLin2 = 'Ship Dates: From Earliest To ':EndDte
WithStmt := " WITH SHIP_DT LE '":EndDte:"' "
WthSwt = 1
CASE 1
TtlLin2 = 'Entry Dates: ALL'
END CASE
rlist( WithStmt, target_savelist$, ListsId, '', '' )
activate_save_select( ListsId )
Script = SRptConfig<SlistScript$>
RptWdt = SRptConfig<Width$>
Title = obj_Install('Get_Prop','Company'):' ':SRptConfig<Title$>
Margin = INT((RptWdt - LEN(Title))/2)
LMargin = Margin - 10 ;* 10 equals length of the date
RMargin = Margin - 8 ;* 8 equals length of 'Page....'
Title = OCONV(Date(),'D4/'):SPACE(LMargin):Title:SPACE(RMargin):"Page'PP''L'"
SWAP '~Title~' WITH Title IN Script
TitleLine2 = TtlLin2
TitleLine3 = TtlLin3
TitleLine4 = TtlLin4
IF TitleLine2 NE '' THEN
Margin = INT((RptWdt - LEN(TitleLine2))/2)
LMargin = Margin - 7 ;* 7 equals length of time (12:15PM)
RMargin = Margin
TitleLine2 = OCONV(Time(),'MTH'):SPACE(LMargin):TitleLine2:SPACE(RMargin)
SWAP '~SecondTitleLine~' WITH TitleLine2 IN Script
END ELSE
SWAP '~SecondTitleLine~' WITH '' IN Script
END
IF TitleLine3 NE '' THEN
Margin = INT((RptWdt - LEN(TitleLine3))/2)
SWAP '~ThirdTitleLine~' WITH "'L'":TitleLine3 IN Script
END ELSE
SWAP '~ThirdTitleLine~' WITH '' IN Script
END
IF TitleLine4 NE '' THEN
Margin = INT((RptWdt - LEN(TitleLine4))/2)
SWAP '~FourthTitleLine~' WITH "'L'":TitleLine4 IN Script
END ELSE
SWAP '~FourthTitleLine~' WITH '' IN Script
END
* Added after upgrade to OI4.13a to reset default printer in OIPI32 engine.
PrintCount = PrintSetup(PRN_GET$,'',Printers,DefaultPrinter)
CONVERT ',' TO @FM IN DefaultPrinter
DefPrintPath = DefaultPrinter<1>:@FM:DefaultPrinter<3>
Void = set_printer( 'INIT', '', '', .63:@fm:.63:@fm:.25:@fm:'', 0,'',DefPrintPath )
Void = Set_Printer('TERM')
call slist( Script )
Void = utility( 'CURSOR', 'A' )
RETURN 0

View File

@ -0,0 +1,795 @@
COMPILE FUNCTION Comm_Ann_Cont(Instruction, Parm1,Parm2)
/*
Commuter module for ANN_CONT (Annual Contract) window
07/16/2004 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Send_Event, Set_Status, Center_Window, Post_Event, Set_List_Box_Data
DECLARE SUBROUTINE ErrMsg, Send_Message, Set_Property, Send_Event, Btree.Extract, obj_AppWindow,ErrMsg
DECLARE SUBROUTINE obj_Notes, Security_Err_Msg, End_Window, Forward_Event, Start_Window, Create_Note
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Utility, Center_Window, Popup, Collect.Ixvals
DECLARE FUNCTION Send_Message, Msg, Security_Check, RowExists, obj_Prod_Ord, obj_Annual_Contracts, NextKey
$INSERT POPUP_EQUATES
$INSERT LOGICAL
$INSERT MSG_EQUATES
$INSERT APPCOLORS
$INSERT QUOTE_SIGS_EQU
$INSERT LSL_USERS_EQU
$INSERT SECURITY_RIGHTS_EQU
$INSERT ANNUAL_CONTRACTS_EQU
$INSERT PROD_SPEC_EQU
$INSERT QUOTE_EQU
$INSERT NOTIFICATION_EQU
EQU CRLF$ TO \0D0A\
EQU COL$QUOTE_NO TO 1 ;* Equates for Quote Table on 1st page
EQU COL$QSTATUS TO 2
EQU COL$PART_NO TO 3
EQU COL$QUOTE_PSN TO 4
EQU COL$QUOTE_DESC TO 5
EQU COL$PRO_NO TO 1
EQU COL$ORD_DT TO 2
EQU COL$CUST_PO_NO TO 3
EQU COL$CUST_PO_LINE TO 4
EQU COL$CUST_PO_REL TO 5
EQU COL$SETUP_CHG TO 6
EQU COL$WAFER_CNT TO 7
EQU COL$WAFER_AMT TO 8
EQU COL$REL_NO TO 1
EQU COL$PO_REL TO 2
EQU COL$DATE TO 3
EQU COL$WO_LOG TO 4
EQU COL$SETUP TO 5
EQU COL$QTY TO 6
EQU COL$PRICE TO 7
EQU COL$AMOUNT TO 8
ErrTitle = 'Error in Comm_Ann_Cont'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Instruction = 'Create' ; GOSUB Create
CASE Instruction = 'Refresh' ; GOSUB Refresh
CASE Instruction = 'Read' ; GOSUB Read
CASE Instruction = 'Write' ; GOSUB Write
CASE Instruction = 'Clear' ; GOSUB Clear
CASE Instruction = 'Page' ; GOSUB Page
CASE Instruction = 'Delete' ; GOSUB Delete
CASE Instruction = 'Close' ; GOSUB Close
CASE Instruction = 'New' ; GOSUB New
CASE Instruction = 'LUDate' ; GOSUB LUDate
CASE Instruction = 'LUACNo' ; GOSUB LUACNo
CASE Instruction = 'QuoteDC' ; GOSUB QuoteDC
CASE Instruction = 'QuotePC' ; GOSUB QuotePC
CASE Instruction = 'CustChar' ; GOSUB CustChar
CASE Instruction = 'LUCustNo' ; GOSUB LUCustNo
CASE Instruction = 'ViewCust' ; GOSUB ViewCust
CASE Instruction = 'LUNameNo' ; GOSUB LUNameNo
CASE Instruction = 'ViewName' ; GOSUB ViewName
CASE Instruction = 'ProdOrdDC' ; GOSUB ProdOrdDC
CASE Instruction = 'SendMessage' ; GOSUB SendMessage
CASE 1
ErrorMsg = 'Unknown Instruction ':QUOTE(Instruction):' passed to routine.'
ErrMsg(ErrorMsg)
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
* Change the security tables to match the table names after conversion and take this note out
IF NOT(Security_Check('Annual Contracts',READ$)) THEN
Security_Err_Msg('Annual Contracts',READ$)
End_Window(@WINDOW)
RETURN
END
obj_Appwindow('Create',@WINDOW)
Set_List_Box_Data(@WINDOW)
* Provides compatibility with the existing messaging attachment system
IF Parm1 NE '' THEN
PassedKeys = FIELD(Parm1,'*',1)
obj_Appwindow('ViewRelated',@WINDOW:@RM:PassedKeys)
END
GOSUB Refresh
RETURN
* * * * * * *
Clear:
* * * * * * *
Send_Event(@WINDOW,'PAGE',1)
obj_AppWindow('ReadOnly',@RM:1) ;* Reenables data bound controls
* * * * * * *
Refresh:
* * * * * * *
IF Security_Check('Annual Contracts',EDIT$) THEN
obj_AppWindow('ReadOnly',@WINDOW:@RM:1) ;* enable all database controls
END ELSE
obj_AppWindow('ReadOnly',@WINDOW) ;* disable all database controls
END
Ctrls = @WINDOW:'.ENTRY_ID':@RM ; Props = 'TEXT':@RM
Ctrls := @WINDOW:'.ENTRY_DT':@RM ; Props := 'TEXT':@RM
Ctrls := @WINDOW:'.CLOSE_DATE' ; Props := 'TEXT'
Vals = Get_Property(Ctrls,Props)
EnterBy = Vals[1,@RM]
EnterDTM = Vals[COL2()+1,@RM]
CloseDt = Vals[COL2()+1,@RM]
IF EnterBy = '' THEN Vals = 1:@RM ELSE Vals = 0:@RM
IF EnterDTM = '' THEN Vals := 1:@RM ELSE Vals := 0:@RM
IF CloseDt = '' THEN Vals := 1 ELSE Vals := 0
Props = 'ENABLED':@RM:'ENABLED':@RM:'ENABLED'
Set_Property(Ctrls,Props,Vals)
ACNo = Get_Property(@WINDOW,'ID')
IF ACNo = '' THEN
Set_Property(@WINDOW:'.NEW_BUTTON','ENABLED',1)
END ELSE
Set_Property(@WINDOW:'.NEW_BUTTON','ENABLED',0)
END
CustNo = Get_Property(@WINDOW:'.CUST_NO','TEXT')
IF CustNo = '' THEN
Set_Property(@WINDOW:'.QUOTE_GROUP','ENABLED',0)
END ELSE
Set_Property(@WINDOW:'.QUOTE_GROUP','ENABLED',1)
END
* QBF buttons
Ctrls = @WINDOW:'.QBF_FIRST_FIX':@RM ; Props = 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_PREV_FIX':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_ABS_FIX':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_NEXT_FIX':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_LAST_FIX':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_STOP_FIX' ; Props := 'ENABLED'
IF Get_Property(@WINDOW,'QBFLIST') = '' THEN
Vals = 0:@RM:0:@RM:0:@RM:0:@RM:0:@RM:0
END ELSE
Vals = 1:@RM:1:@RM:1:@RM:1:@RM:1:@RM:1
END
Set_Property(Ctrls,Props,Vals)
* Turn edit table symbolic column backgrounds to green
ETSymbolics = Get_Property(@WINDOW,'@ET_SYMBOLICS') ;* Loaded during 'Create' in obj_Appwindow
ETCtrls = ETSymbolics<1>
ETCols = ETSymbolics<2>
FOR I = 1 TO COUNT(ETCtrls,@VM) + (ETCtrls NE '')
ETCtrl = ETCtrls<1,I>
ETList = Get_Property(ETCtrl,'LIST')
FOR Line = 1 TO COUNT(ETList,@FM) + (ETList NE '')
IF ETList<Line,1> NE '' THEN
FOR N = 1 TO COUNT(ETCols<1,I>,@SVM) + (ETCols<1,I> NE '')
stat = Send_Message(ETCtrl,'COLOR_BY_POS',ETCols<1,I,N>,Line,GREEN$)
NEXT N
END
NEXT I
NEXT I
QCtrl = @WINDOW:'.QUOTE_TABLE'
QuoteList = Get_Property(QCtrl,'LIST')
FOR I = 1 TO COUNT(QuoteList,@FM) + (QuoteList NE '')
QStatFirst = QuoteList<I,COL$QSTATUS>[1,1]
IF QStatFirst NE 'O' AND QStatFirst NE '' THEN
stat = Send_Message(QCtrl,'COLOR_BY_POS',COL$QSTATUS,I,YELLOW$)
END
NEXT I
TotalList = Get_Property(@WINDOW:'.TOTALS_TABLE','LIST') ;* One line edit table 3 columns wide
Balance = TotalList<1,3>
IF Balance NE '' THEN
IF Balance <= 0 THEN
stat = Send_Message(@WINDOW:'.TOTALS_TABLE','COLOR_BY_POS',3,1,RED$)
END ELSE
stat = Send_Message(@WINDOW:'.TOTALS_TABLE','COLOR_BY_POS',3,1,GREEN$)
END
END
RETURN
* * * * * * *
Page:
* * * * * * *
obj_Appwindow('Page')
GOSUB Refresh
RETURN
* * * * * * *
Read:
* * * * * * *
* * * This is called from the event handler as a PreRead event * * *
ProdOrdNo = Get_Property(@WINDOW:'AC_NO','TEXT')
IF NOT(RowExists('ANNUAL_CONTRACTS',ProdOrdNo)) THEN
IF NOT(Security_Check('Annual Contracts',WRITE$)) THEN
Security_Err_Msg('Annual Contracts',WRITE$)
Send_Event(@WINDOW,'CLEAR')
RETURN
END
END
Forward_Event() ;* passed security, do the read
EnterBy = Get_Property(@WINDOW:'.ENTRY_ID','TEXT')
IF EnterBy = '' THEN
CurrDate = OCONV(Date(),'D4/')
Set_Property(@WINDOW:'.ENTRY_ID','TEXT',OCONV(@USER4,'[XLATE_CONV,LSL_USERS*FIRST_LAST]'))
Set_Property(@WINDOW:'.ENTRY_DATE','TEXT',CurrDate)
Set_Property( @WINDOW:'.CUST_NO', "FOCUS",1)
END
GOSUB Refresh
RETURN
* * * * * * *
Write:
* * * * * * *
Ctrls = @WINDOW:'.TOTALS_TABLE':@RM ; Props = 'LIST':@RM
Ctrls := @WINDOW:'.MIN_BALANCE':@RM ; Props := 'TEXT':@RM
Ctrls := @WINDOW:'.STATUS':@RM ; Props := 'VALUE':@RM
Ctrls := @WINDOW:@RM ; Props := 'ID':@RM
Ctrls := @WINDOW:@RM ; Props := 'SAVEWARN':@RM
Ctrls := @WINDOW:'.CUST_NAME' ; Props := 'TEXT'
Vals = Get_Property(Ctrls,Props)
Totals = Vals[1,@RM]
MinBalance = Vals[COL2()+1,@RM]
Status = Vals[COL2()+1,@RM]
ACId = Vals[COL2()+1,@RM]
SaveWarn = Vals[COL2()+1,@RM]
CustName = Vals[COL2()+1,@RM]
Totals = OCONV(ICONV(Totals,'MD2'),'MD2') ;* Remove any commas
MinBalance = OCONV(ICONV(MinBalance,'MD2'),'MD2')
OrderTotal = Totals<1,1> ; * This is from a single row edit table -> three columns
RelTotal = Totals<1,2>
Balance = Totals<1,3>
IF MinBalance = '' THEN MinBalance = '1001.00' ;* default = $1001.00
IF Balance <= MinBalance THEN
Balance = OCONV(ICONV(Balance,'MD2'),'MD2,$')
Mesg = 'The Current Balance on Annual Contract No ':ACID
Mesg := ' for ':CustName:' is below minimum at ':Balance
Recipient = XLATE('NOTIFICATION','ANN_CONT',NOTIFICATION_USER_ID$,'X')
Create_Note(Recipient,'System','Annual Contract Balance',Mesg,'ANNUAL_CONTRACTS',ACId)
END
IF Status = 'C' AND SaveWarn THEN
MsgInfo = ''
MsgInfo<MTYPE$> = 'BNY'
MsgInfo<MTEXT$> = 'This contract is closed!':CRLF$:'Are you sure you wish to save changes?'
MsgInfo<MICON$> = '!'
SaveIt = Msg(@WINDOW,MsgInfo,'')
IF SaveIt THEN
Result = 1
END ELSE
Result = 0
END
END
Result = 1 ;* Perform the write event
RETURN
* * * * * * *
Delete:
* * * * * * *
IF Security_Check('Annual Contracts',Delete$) THEN
Result = 1 ;* Proceed with delete
END ELSE
Security_Err_Msg('Annual Contracts',Delete$)
Result = 0 ;* Stop event chain
END
RETURN
* * * * * * *
New:
* * * * * * *
ACNo = Get_Property(@WINDOW,'ID')
IF ACNo = '' THEN
NextACNo = NextKey('ANNUAL_CONTRACTS')
obj_Appwindow('LoadFormKeys',@WINDOW:@RM:NextACNo)
END
RETURN
* * * * * * *
LUDate:
* * * * * * *
ReturnCtrl = Parm1[1,@RM]
IF ReturnCtrl = '' THEN ReturnCtrl = Get_Property(@WINDOW,'FOCUS')
DateSelected = Dialog_Box('POPUP_YEAR',@WINDOW)
RetVal = OCONV(DateSelected, 'D4/')
IF RetVal NE '' THEN
obj_Appwindow('LUValReturn',RetVal:@RM:ReturnCtrl)
END
RETURN
* * * * * * *
LUACNo:
* * * * * * *
IF NOT(ASSIGNED(Parm1)) THEN FocusControl = '' ELSE FocusControl = Parm1
IF NOT(ASSIGNED(Parm2)) THEN FocusPos = '' ELSE FocusPos = Parm2
Set_Status(0)
ACKeys = obj_Annual_Contracts('Find')
IF ACKeys = '' THEN RETURN
CONVERT @FM TO @VM IN ACKeys
TypeOver = ''
TypeOver<PDISPLAY$> = AcKeys
TypeOver<PTITLE$> = 'Annual Contracts'
TypeOver<PSELECT$> = 2 ;* multiple select
Set_Status(0)
ACKeys = Popup(@WINDOW,TypeOver,'COMP_ANN_CONT')
IF Get_Status(errCode) THEN ErrMsg(errCode)
IF INDEX(ACKeys,@VM,1) THEN
Send_Event(@WINDOW,'QBFINIT')
Set_Property(@WINDOW,'QBFLIST',ACKeys)
GOSUB Refresh
Send_Event(@WINDOW,'QBFIRST')
END ELSE
obj_Appwindow('LoadFormKeys',@WINDOW:@RM:ACKeys)
END
RETURN
* * * * * * *
Close:
* * * * * * *
obj_Notes('Inbox',@USER4) ;* Checks for any new messages
RETURN
* * * * * * *
QuoteDC:
* * * * * * *
* DoubleClick event handler for the Quotes Table
CtrlEntId = @WINDOW:'.QUOTE_TABLE'
CurrPos = Get_Property(CtrlEntId,'SELPOS')
RowData = Get_Property(CtrlEntId,'ROWDATA')
ColData = Get_Property(CtrlEntId,'ARRAY')
CurrCol = CurrPos<1>
CurrRow = CurrPos<2>
CustNo = Get_Property(@WINDOW:'.CUST_NO','TEXT')
IF CurrCol = COL$QUOTE_NO THEN
IF RowData<1,CurrCol> = '' THEN
OPEN 'DICT.QUOTE' TO DictVar THEN
SearchString = 'CUST_NO':@VM:CustNo:@VM:@FM
SearchString := 'STATUS':@VM:'=O':@FM
Btree.Extract(SearchString, 'QUOTE', DictVar, QuoteKeys, '', Flag)
IF Get_Status(errCode) THEN
Msg(@window, MsgUp)
ErrMsg(errCode)
RETURN
END
IF QuoteKeys = '' THEN
ErrMsg('No Quotes on file for customer ':CustNo)
RETURN
END
IF INDEX(QuoteKeys,@VM,1) THEN
QuoteKeys := @VM
CONVERT @VM TO @RM IN QuoteKeys
CALL V119('S','','D','R',QuoteKeys,'')
IF Get_Status(errCode) THEN DEBUG
CONVERT @RM TO @VM IN QuoteKeys
QuoteKeys[-1,1] = '' ;* Strip trailing delimiter
TypeOver = ''
TypeOver<PDISPLAY$> = QuoteKeys
TypeOver<PSELECT$> = 1 ;* Single value select
TypeOver<PTITLE$> = 'Open Quotes for ':OCONV(CustNo,'[XLATE_CONV,COMPANY*CO_NAME]')
QuoteKey = Popup(@WINDOW,TypeOver,'QUOTE')
END ELSE
QuoteKey = QuoteKeys
END
IF QuoteKey NE '' THEN
obj_Appwindow('LUValReturn',QuoteKey:@RM:CtrlEntId:@RM:CurrPos)
END
END ELSE
ErrMsg('Unable to open DICT.QUOTE in COMM_ANN_CONT.')
RETURN
END
END ELSE
QuoteNo = RowData<CurrCol>
IF QuoteNo NE '' THEN
obj_AppWindow('ViewRelated','QUOTE2':@RM:QuoteNo)
END
END ;* End of check for null value in column
END ;* End of check for Quote No column
IF CurrCol = COL$QUOTE_PSN THEN
PSNNos = RowData<CurrCol>
SWAP ', ' WITH @VM IN PSNNos
IF PSNNos NE '' THEN
obj_AppWindow('ViewRelated','PROD_SPEC':@RM:PSNNos)
END
END
CustNo = Get_Property(@WINDOW:'.CUST_NO','TEXT')
IF CurrCol = COL$PART_NO AND RowData<CurrCol> = '' THEN
PSNos = RowData<COL$QUOTE_PSN>
SWAP ', ' WITH @VM IN PSNos ;* Changed 11/18/2004 JCH
PartNos = XLATE('PROD_SPEC',PSNos,PROD_SPEC_CUST_PART_NO$,'X')
PartsInTable = ColData<COL$PART_NO>
TableLineCnt = COUNT(PartsInTable,@VM) + (PartsInTable NE '')
LOOP
Test = PartsInTable[-1,1]
UNTIL Test NE @VM
PartsInTable[-1,1] = ''
REPEAT
ExistPartCnt = COUNT(PartsInTable,@VM) + (PartsInTable NE '')
FOR I = 1 TO ExistPartCnt
PartInTable = PartsInTable<1,I>
LOCATE PartInTable IN PartNos USING @VM Setting Pos THEN
PartNos = DELETE(PartNos,1,Pos,0)
END
NEXT I
IF PartNos = '' THEN
ErrMsg('No parts available on associated PSN or all parts already added.')
END
IF INDEX(PartNos,@VM,1) THEN
TypeOver = ''
TypeOver<PTITLE$> = 'Part Numbers on Product Specification ':PSNos
TypeOver<PDISPLAY$> = PartNos
PartNos = Popup(@WINDOW,TypeOver,'PART_NO')
IF PartNos = '' THEN RETURN
END
NewPartCnt = COUNT(PartNos,@VM) + (PartNos NE '')
LinesAvailable = TableLineCnt - (ExistPartCnt + NewPartCnt)
IF LinesAvailable <= 0 THEN
NewLines = ((LinesAvailable*-1) + 1)
FOR I = 1 TO NewLines
stat = Send_Message(CtrlEntID, "INSERT", -1, STR(@VM,6))
NEXT I
END
IF INDEX(PartNos,@VM,1) THEN
QuoteNo = RowData<COL$QUOTE_NO>
FOR I = 1 TO COUNT(PartNos,@VM) + (PartNos NE '')
PartNo = PartNos<1,I>
TRow = (CurrRow + I - 1)
obj_Appwindow('LUValReturn',QuoteNo:@RM:CtrlEntID:@RM:COL$QUOTE_NO:@FM:(CurrRow + I -1))
*Send_Event(CtrlEntID,'CALCULATE',COL$PSTATUS)
obj_Appwindow('LUValReturn',PartNo:@RM:CtrlEntID:@RM:COL$PART_NO:@FM:(CurrRow + I -1))
NEXT I
END ELSE
obj_Appwindow('LUValReturn',PartNos:@RM:CtrlEntID:@RM:CurrPos)
END
END
GOSUB Refresh
RETURN
* * * * * * *
QuotePC:
* * * * * * *
CtrlEntId = @WINDOW:'.QUOTE_TABLE'
Ctrls = CtrlEntId:@RM ; Props = 'SELPOS':@RM
Ctrls := CtrlEntId:@RM ; Props := 'LIST':@RM
Ctrls := CtrlEntId:@RM ; Props := 'ARRAY':@RM
Ctrls := CtrlEntId ; Props := 'PREVSELPOS'
Vals = Get_Property(Ctrls,Props)
CurrPos = Vals[1,@RM]
ListData = Vals[COL2()+1,@RM]
ColData = Vals[COL2()+1,@RM]
PrevPos = Vals[COL2()+1,@RM]
CurrCol = CurrPos<1>
CurrRow = CurrPos<2>
PrevCol = PrevPos<1>
PrevRow = PrevPos<2>
QStatus = ListData<CurrRow,COL$QSTATUS>
PSNNo = ListData<CurrRow,COL$QUOTE_PSN>
QuoteNo = ListData<PrevRow,COL$QUOTE_NO>
PSNNos = ListData<PrevRow,COL$QUOTE_PSN>
PartNo = ListData<PrevRow,COL$PART_NO>
SWAP ', ' WITH @VM IN PSNNos
IF PrevCol = COL$QUOTE_NO AND QuoteNo NE '' THEN
CustNo = Get_Property(@WINDOW:'.CUST_NO','TEXT')
QuoteRec = XLATE('QUOTE',QuoteNo,'','X')
IF QuoteRec<QUOTE_CUST_NO$> NE CustNO THEN
ErrMsg('Quote is for a different customer!')
Set_Property(CtrlEntID,'INVALUE','',PrevPos)
Send_Event(CtrlEntID,'CALCULATE',COL$QSTATUS)
Set_Property(CtrlEntID,'SELPOS',PrevPos)
END
END
IF PrevCol = COL$PART_NO AND PartNo NE '' THEN
PSNParts = XLATE('PROD_SPEC',PSNNos,PROD_SPEC_CUST_PART_NO$,'X')
LOCATE PartNo IN PSNParts USING @VM SETTING Dummy ELSE
ErrMsg('Part No is not listed on the associated PSN!')
Set_Property(CtrlEntID,'INVALUE','',PrevPos)
Set_Property(CtrlEntID,'SELPOS',PrevPos)
END
END
GOSUB Refresh
RETURN
* * * * * * *
CustChar:
* * * * * * *
CtrlName = @WINDOW:'.CUST_NO'
DataIn = Get_Property(CtrlName,'TEXT')
IF LEN(DataIn) > 2 THEN
ReturnToCtrl = CtrlName
IF NOT(NUM(DataIn)) THEN
Set_Property(CtrlName,'TEXT','') ;* Clear characters input
Start_Window('COMP_LOOKUP',@WINDOW,DataIn:@VM:'C':@FM:ReturnToCtrl,'','')
END
END
RETURN
* * * * * * *
LUCustNo:
* * * * * * *
IF NOT(ASSIGNED(Parm1)) THEN FocusControl = '' ELSE FocusControl = Parm1
IF NOT(ASSIGNED(Parm2)) THEN FocusPos = '' ELSE FocusPos = Parm2
TypeOver = ''
TypeOver<PSELECT$> = 1
CustNo = Popup(@WINDOW,TypeOver,'CUSTOMER')
IF CustNo NE '' THEN
obj_Appwindow('LUValReturn',CustNo:@RM:FocusControl:@RM:FocusPos)
END
RETURN
* * * * * * *
ViewCust:
* * * * * * *
CustNo = Get_Property(@WINDOW:'.CUST_NO','TEXT')
IF CustNo NE '' THEN
obj_Appwindow('ViewRelated','COMPANY':@RM:CustNo)
END
RETURN
* * * * * * *
LUNameNo:
* * * * * * *
IF NOT(ASSIGNED(Parm1)) THEN FocusControl = '' ELSE FocusControl = Parm1
IF NOT(ASSIGNED(Parm2)) THEN FocusPos = '' ELSE FocusPos = Parm2
CompNo = Get_Property(@WINDOW:'.CUST_NO','TEXT')
IF CompNo NE '' THEN
* This is the pushbutton - show the short name list
OPEN 'DICT.NAMES' TO DictVar THEN
SearchString = 'CO_ID':@VM:CompNo:@FM
Btree.Extract(SearchString,'NAMES',DictVar,NameNos,'',Flag)
IF Get_Status(errCode) THEN
ErrMsg(errCode)
RETURN
END
IF NameNos = '' THEN
ErrMsg('No names on file for Customer Number ':CompNo)
RETURN
END ELSE
IF INDEX(NameNos,@VM,1) THEN
TypeOver = ''
TypeOver<PDISPLAY$> = NameNos
TypeOver<PTITLE$> = 'Contact Names for ':XLATE('COMPANY',CompNo,4,'X')
NameNo = Popup(@WINDOW,TypeOver,'COMP_NAME')
END ELSE
NameNo = NameNos
END
obj_AppWindow('LUValReturn',NameNo:@RM:FocusControl:@RM:FocusPos)
END
END ELSE
ErrMsg('Unable to open DICT.NAMES in COMM_ANN_CONT routine.')
RETURN
END
END ELSE
NameNo = Popup(@WINDOW,'','NAMES')
IF NameNo NE '' THEN
obj_AppWindow('LUValReturn',NameNo:@RM:FocusControl:@RM:FocusPos)
END
END
RETURN
* * * * * * *
ViewName:
* * * * * * *
NameNo = Get_Property(@WINDOW:'.NAME_NO','TEXT')
IF NameNo NE '' THEN
obj_Appwindow('ViewRelated','NAMES':@RM:NameNo)
END
RETURN
* * * * * * *
ProdOrdDC:
* * * * * * *
ACNo = Get_Property(@WINDOW,'ID')
CtrlEntID = @WINDOW:'.PROD_ORDER'
CurrPos = Get_Property(CtrlEntID,'SELPOS')
CurrCol = CurrPos<1>
CurrRow = CurrPos<2>
OrdNo = Get_Property(CtrlEntID,'CELLPOS',COL$PRO_NO:@FM:CurrRow)
IF OrdNo NE '' THEN
obj_Appwindow('ViewRelated','ORDER2':@RM:OrdNo)
END
RETURN
* * * * * * *
SendMessage:
* * * * * * *
ACNo = Get_Property(@WINDOW,'ID')
IF ACNo = '' THEN RETURN
QBFList = Get_Property(@WINDOW,'QBFLIST')
IF QBFList = '' THEN
Send_Event(@WINDOW,'WRITE')
END
Dummy = Dialog_Box('NOTES_ATTACH',@WINDOW,'ANN_CONT*':ACNo:'*':QBFList)
IF QBFList = '' THEN
obj_Appwindow('LoadFormKeys', @WINDOW:@RM:ACNo)
END
RETURN

View File

@ -0,0 +1,188 @@
COMPILE FUNCTION Comm_Application(Event,CtrlEntId,CtrlClassId,Parm1,Parm2,Parm3)
DECLARE SUBROUTINE Set_Property
DECLARE FUNCTION Get_Property
* Application wide event handlers
* initially for support of <ALT><O> and <ALT><C> functionality
* 9/27/1999 - John C. Henry - J.C. Henry, Inc.
EQU COL$ TO 1
EQU ROW$ TO 2
IF Event = 'READ' THEN
Ctrls = CtrlEntId:@RM:CtrlEntId:@RM:CtrlEntId:@RM:CtrlEntId
Props = '@PREV_ID':@RM:'@PREV_REC':@RM:'ID':@RM:'RECORD'
Vals = Get_Property(Ctrls,Props)
PrevID = Vals[1,@RM]
PrevRec = Vals[COL2()+1,@RM]
ID = Vals[COL2()+1,@RM]
Record = Vals[COL2()+1,@RM]
IF PrevID = '' THEN Set_Property(CtrlEntId,'@PREV_ID',ID)
IF PrevRec = '' THEN Set_Property(CtrlEntId,'@PREV_REC',Record)
RETURN 1
END
IF Event = 'WRITE' THEN
Ctrls = CtrlEntId:@RM:CtrlEntId
Props = 'ID':@RM:'RECORD'
Vals = Get_Property(Ctrls,Props)
ID = Vals[1,@RM]
Record = Vals[COL2()+1,@RM]
Props = '@PREV_ID':@RM:'@PREV_REC'
Vals = ID:@RM:Record
Set_Property(Ctrls,Props,Vals) ;* Store off ID and record for defaults
RETURN 1
END
IF Event = 'PREV_REC' THEN
* <ALT><C> - Copy previous record
Ctrls = @WINDOW:@RM:@WINDOW:@RM:@WINDOW
Props = 'FOCUS':@RM:'@PREV_REC':@RM:'CTRLMAP'
Vals = Get_Property(Ctrls,Props)
CtrlName = Vals[1,@RM]
PrevRec = Vals[COL2()+1,@RM]
CtrlMap = Vals[COL2()+1,@RM]
CONVERT @FM TO @RM IN CtrlMap
PosList = Get_Property(CtrlMap,STR('POS':@RM,COUNT(CtrlMap,@RM)):'POS')
ConvList = Get_Property(CtrlMap,STR('CONV':@RM,COUNT(CtrlMap,@RM)):'CONV')
Ctrls = ''
Props = ''
Vals = ''
FOR I = 1 TO COUNT(PosList,@RM) + (PosList NE '')
Pos = FIELD(PosList,@RM,I)
IF Pos NE '' AND Pos > 0 THEN
Conv = FIELD(ConvList,@RM,I)
Ctrl = FIELD(CtrlMap,@RM,I)
IF INDEX(Pos,@SVM,1) THEN
* We're in a Multivalued control i.e. edittable
CtrlArray = ''
FOR N = 1 TO COUNT(Pos,@SVM) + (Pos NE '')
ColPos = FIELD(Pos,@SVM,N)
ColConv = FIELD(Conv,@SVM,N)
ColValues = PrevRec<ColPos>
IF ColConv NE '' THEN
ColValues = OCONV(ColValues,ColConv)
END
CtrlArray<N> = ColValues
NEXT N
Ctrls := Ctrl:@RM
Props := 'DEFPROP':@RM
Vals := CtrlArray:@RM
END ELSE
Value = PrevRec<Pos>
IF Conv NE '' THEN Value = OCONV(Value,Conv)
Ctrls := FIELD(CtrlMap,@RM,I):@RM
Props := 'DEFPROP':@RM
Vals := Value:@RM
END
END
NEXT I
Ctrls[-1,1] = ''
Props[-1,1] = ''
Vals[-1,1] = ''
Set_Property(Ctrls,Props,Vals)
RETURN ''
END
IF Event = 'PREV_VAL' THEN
* <ALT><O> - Copy previous field value, also works in the keys fields
Ctrls = @WINDOW:@RM:@WINDOW:@RM:@WINDOW
Props = 'FOCUS':@RM:'@PREV_ID':@RM:'@PREV_REC'
Vals = Get_Property(Ctrls,Props)
CtrlName = Vals[1,@RM]
PrevID = Vals[COL2()+1,@RM]
PrevRec = Vals[COL2()+1,@RM]
Ctrls = CtrlName:@RM:CtrlName:@RM:CtrlName
Props = 'POS':@RM:'PART':@RM:'CONV'
Vals = Get_Property(Ctrls,Props)
Pos = Vals[1,@RM]
Part = Vals[COL2()+1,@RM]
Conv = Vals[COL2()+1,@RM]
IF Index(Pos,@SVM,1) THEN
* Multi-Valued control i.e. We're in an edit table
SelPos = Get_Property(CtrlName,'SELPOS')
SelCol = SelPos<COL$>
SelRow = SelPos<ROW$>
ColPos = FIELD(Pos,@SVM,SelCol)
ColConv = FIELD(Conv,@SVM,SelCol)
Value = PrevRec<ColPos,SelRow>
IF Conv NE '' THEN Value = OCONV(Value,ColConv)
Set_Property(CtrlName,'DEFPROP',Value,SelPos)
Set_Property(CtrlName,'SELECTION',1,@FM:LEN(Value))
END ELSE
* Single valued control
IF Pos = 0 THEN
Value = FIELD(PrevID,'*',Part)
END ELSE
Value = PrevRec<Pos>
END
IF Conv NE '' THEN Value = OCONV(Value,Conv)
Set_Property(CtrlName,'DEFPROP',Value)
Set_Property(CtrlName,'SELECTION',1,@FM:LEN(Value))
END
RETURN ''
END
RETURN 0

View File

@ -0,0 +1,311 @@
COMPILE FUNCTION Comm_ASM_Part(Instruction, Parm1,Parm2)
/*
Commuter module for ASM Part window
08/28/2006 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, Set_Status, ErrMsg, Set_Property, obj_AppWindow, Set_List_Box_Data
DECLARE SUBROUTINE Btree.Extract, Send_Event, Security_Err_Msg, Forward_Event, End_Window, Start_Window
DECLARE SUBROUTINE Send_Message
DECLARE FUNCTION Get_Property, Get_Status, Popup, Send_Message, Msg, Security_Check, Dialog_Box, RowExists
DECLARE FUNCTION Dialog_Box, obj_WO_Log, MemberOf, obj_NCR, Send_Message, MemberOf, obj_Popup
$INSERT POPUP_EQUATES
$INSERT MSG_EQUATES
$INSERT APPCOLORS
$INSERT LSL_USERS_EQU
$INSERT SECURITY_RIGHTS_EQU
EQU CRLF$ TO \0D0A\
ErrTitle = 'Error in Comm_ASM_Part'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Instruction = 'Create' ; GOSUB Create
CASE Instruction = 'Refresh' ; GOSUB Refresh
CASE Instruction = 'Read' ; GOSUB Read
CASE Instruction = 'Write' ; GOSUB Write
CASE Instruction = 'Clear' ; GOSUB Clear
CASE Instruction = 'Delete' ; GOSUB Delete
CASE Instruction = 'Close' ; GOSUB Close
CASE Instruction = 'LU_ASMPart' ; GOSUB LU_ASMPart
CASE Instruction = 'GasesDC' ; GOSUB GasesDC
CASE 1
ErrorMsg = 'Unknown Instruction passed to routine'
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
obj_Appwindow('Create',@WINDOW)
IF NOT(Security_Check('ASM Part',READ$)) THEN
Security_Err_Msg('ASM Part',READ$)
End_Window(@WINDOW)
RETURN
END
GOSUB Refresh
RETURN
* * * * * * *
Read:
* * * * * * *
GOSUB Refresh
RETURN
* * * * * * *
Write:
* * * * * * *
RETURN
* * * * * * *
Clear:
* * * * * * *
GOSUB Refresh
RETURN
* * * * * * *
Delete:
* * * * * * *
Result = 1
RETURN
* * * * * * *
Close:
* * * * * * *
obj_Appwindow('DetailReturn')
RETURN
* * * * * * *
Refresh:
* * * * * * *
* QBF buttons
Ctrls = @WINDOW:'.QBF_FIRST_FIX':@RM ; Props = 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_PREV_FIX':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_ABS_FIX':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_NEXT_FIX':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_LAST_FIX':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_STOP_FIX' ; Props := 'ENABLED'
IF Get_Property(@WINDOW,'QBFLIST') = '' THEN
Vals = 0:@RM:0:@RM:0:@RM:0:@RM:0:@RM:0
END ELSE
Vals = 1:@RM:1:@RM:1:@RM:1:@RM:1:@RM:1
END
Set_Property(Ctrls,Props,Vals)
* Turn edit table symbolic column backgrounds to green
ETSymbolics = Get_Property(@WINDOW,'@ET_SYMBOLICS') ;* Loaded during 'Create' in obj_Appwindow
ETCtrls = ETSymbolics<1>
ETCols = ETSymbolics<2>
FOR I = 1 TO COUNT(ETCtrls,@VM) + (ETCtrls NE '')
ETCtrl = ETCtrls<1,I>
ETList = Get_Property(ETCtrl,'LIST')
FOR Line = 1 TO COUNT(ETList,@FM) + (ETList NE '')
IF ETList<Line,1> NE '' THEN
FOR N = 1 TO COUNT(ETCols<1,I>,@SVM) + (ETCols<1,I> NE '')
stat = Send_Message(ETCtrl,'COLOR_BY_POS',ETCols<1,I,N>,Line,GREEN$)
NEXT N
END
NEXT Line
NEXT I
RETURN
* * * * * * *
LU_ASMPart:
* * * * * * *
IF NOT(ASSIGNED(Parm1)) THEN FocusControl = '' ELSE FocusControl = Parm1
IF NOT(ASSIGNED(Parm2)) THEN FocusPos = '' ELSE FocusPos = Parm2
Set_Status(0)
Retval = Popup(@WINDOW,TypeOver,'ASM_MFC')
IF RetVal = '' THEN RETURN
obj_Appwindow('LoadFormKeys',@WINDOW:@RM:RetVal)
RETURN
* * * * * * *
MFC_DC:
* * * * * * *
ReactorNo = Get_Property(@WINDOW:'.REACT_NO','TEXT')
CtrlEntID = @WINDOW:'.MFC_FUNC'
CurrPos = Get_Property(CtrlEntID,'SELPOS')
CurrCol = CurrPos<1>
CurrRow = CurrPos<2>
IF CurrCol = COL$MFC_CODE THEN
CurrMfcCodes = Get_Property(CtrlEntID,'ARRAY')<COL$MFC_CODE> ;* Existing MFC codes in edit table
CurrMfcCodesTrimmed = ''
FOR I = 1 TO COUNT(CurrMfcCodes,@VM) + (CurrMfcCodes NE '')
IF CurrMfcCodes<1,I> NE '' THEN
CurrMfcCodesTrimmed<1,I> = CurrMfcCodes<1,I>
END
NEXT I
CurrMfcCodes = CurrMfcCodesTrimmed
CurrMfcCodePositions = obj_Popup('CodePosition','REACT_MFC_FUNC':@RM:CurrMfcCodes)
MfcCodes = Popup(@WINDOW,'','REACT_MFC_FUNC')
IF MfcCodes = '' THEN RETURN
NewMfcCodePositions = obj_Popup('CodePosition','REACT_MFC_FUNC':@RM:MfcCodes)
FOR I = 1 TO COUNT(NewMfcCodePositions,@VM) + (NewMfcCodePositions NE '')
NewMFcCodePosition = NewMfcCodePositions<1,I>
MfcCode = MfcCodes<1,I>
LOCATE NewMfcCodePosition IN CurrMfcCodePositions BY 'AR' USING @VM SETTING POS ELSE
CurrMfcCodePositions = INSERT(CurrMfcCodePositions,1,POS,0,NewMfcCodePosition)
Send_Message(CtrlEntID,'INSERT',POS,MfcCode:@VM:@VM)
END
NEXT I
Send_Event(@WINDOW:'.MFC_FUNC','CALCULATE',COL$MFC_FUNCTION)
GOSUB Refresh
END ;* End of MfcCode column
/*
IF CurrCol = COL$MFC_SERIAL_NO THEN
QuoteNo = Get_Property(CtrlEntID,'CELLPOS',COL$QUOTE_NO:@FM:CurrRow)
IF OrderNo NE '' AND QuoteNo NE '' THEN
IF Get_Property(@WINDOW,'QBFLIST') = '' THEN
Send_Event(@WINDOW,'WRITE')
END
DetWindow = 'QUOTE2'
DetKeys = QuoteNo
DefaultRec = ''
RetKey = OrderNo
RetPage = 1
RetCtrl = CtrlEntID
RetPos = CurrPos
oAParms = DetWindow:@RM:DetKeys:@RM:DefaultRec:@RM:RetKey:@RM:RetPage:@RM:RetCtrl:@RM:RetPos
obj_AppWindow('ViewNewDetail',oAParms)
IF Get_Status(errCode) THEN
ErrMsg(errCode)
END
END
END ;* End of QuoteNo column
*/
RETURN
* * * * * * *
GasesDC:
* * * * * * *
ReactorNo = Get_Property(@WINDOW:'.REACT_NO','TEXT')
CtrlEntID = @WINDOW:'.GASES'
CurrPos = Get_Property(CtrlEntID,'SELPOS')
CurrCol = CurrPos<1>
CurrRow = CurrPos<2>
CurrGases = Get_Property(CtrlEntID,'ARRAY') ;* Existing MFC codes in edit table
CurrGasesTrimmed = ''
FOR I = 1 TO COUNT(CurrGases,@VM) + (CurrGases NE '')
IF CurrGases<1,I> NE '' THEN
CurrGasesTrimmed<1,I> = CurrGases<1,I>
END
NEXT I
CurrGases = CurrGasesTrimmed
CurrGasesPositions = obj_Popup('CodePosition','REACTOR_GASES':@RM:CurrGases)
Gases = Popup(@WINDOW,'','REACTOR_GASES')
IF Gases = '' THEN RETURN
NewGasesPositions = obj_Popup('CodePosition','REACTOR_GASES':@RM:Gases)
FOR I = 1 TO COUNT(NewGasesPositions,@VM) + (NewGasesPositions NE '')
NewGasesPosition = NewGasesPositions<1,I>
Gas = Gases<1,I>
LOCATE NewGasesPosition IN CurrGasesPositions BY 'AR' USING @VM SETTING POS ELSE
CurrGasesPositions = INSERT(CurrGasesPositions,1,POS,0,NewGasesPosition)
Send_Message(CtrlEntID,'INSERT',POS,Gas)
END
NEXT I
*Send_Event(@WINDOW:'.MFC_FUNC','CALCULATE',COL$MFC_FUNCTION)
GOSUB Refresh
RETURN

View File

@ -0,0 +1,8 @@
COMPILE FUNCTION Comm_Clean_Insp(Instruction,Parm1,Parm2)
/*
Moved to new style commuter 'CLEAN_INSP"
*/
RETURN ''

161
LSL2/STPROC/COMM_COA.txt Normal file
View File

@ -0,0 +1,161 @@
COMPILE FUNCTION Comm_Coa(Instruction, Parm1)
/*
Commuter module for Coawindow
04/18/2004 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Send_Event, Set_Status, Center_Window,Print_Vend_CofA
DECLARE SUBROUTINE ErrMsg, Send_Message, Set_Property, Send_Event, Btree.Extract, obj_AppWindow
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Utility, Center_Window, Popup, Collect.Ixvals
DECLARE FUNCTION Send_Message
$INSERT POPUP_EQUATES
$INSERT APPCOLORS
EQU CRLF$ TO \0D0A\
ErrTitle = 'Error in Comm_Coa'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Instruction = 'Create' ; GOSUB Create
CASE Instruction = 'Refresh' ; GOSUB Refresh
CASE Instruction = 'Write' ; GOSUB Write
CASE Instruction = 'Delete' ; GOSUB Delete
CASE Instruction = 'Print' ; GOSUB Print
CASE Instruction = 'LUCompNo' ; GOSUB LUCompNo
CASE Instruction = 'LotNoGF' ; GOSUB LotNoGF
CASE 1
ErrorMsg = 'Unknown Instruction passed to routine.'
ErrMsg(ErrorMsg)
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
Center_Window(@WINDOW)
IF Parm1 NE '' THEN
obj_AppWindow('LoadFormKeys',@WINDOW:@RM:Parm1)
END
GOSUB Refresh
RETURN
* * * * * * *
Refresh:
* * * * * * *
RETURN
* * * * * * *
Write:
* * * * * * *
ErrMsg('Records may not be modified.')
Result = 0 ;* No Writes
RETURN
* * * * * * *
Delete:
* * * * * * *
ErrMsg('Records may not be modified.')
Result = 0 ;* No Deletes
RETURN
* * * * * * *
LUCompNo:
* * * * * * *
CompKeys = Collect.IXVals('COA', 'COMP_NO')
CONVERT @FM TO @VM IN CompKeys
PopOver = ''
PopOver<PDISPLAY$> = CompKeys
CompanyKey = Popup(@WINDOW,PopOver,'COMPANY_COA')
IF CompanyKey NE '' THEN
obj_AppWindow('LUValReturn',CompanyKey:@RM:@WINDOW:'.COMP_NO')
END
RETURN
* * * * * * *
LotNoGF:
* * * * * * *
CompNo = Get_Property(@WINDOW:'.COMP_NO','INVALUE')
LotNo = Get_Property(@WINDOW:'.LOT_NO','TEXT')
IF CompNo NE '' AND LotNo = '' THEN
OPEN 'DICT.COA' TO DictCOA THEN
SearchString = 'COMP_NO':@VM:CompNo:@FM
Btree.Extract(SearchString, 'COA', DictCOA, COAKeys, '', '')
IF COAKeys = '' THEN RETURN
COAKeys := @VM
CONVERT @VM TO @RM IN COAKeys
CALL V119('S','','D','R',COAKeys,'')
IF Get_Status(errCode) THEN DEBUG
CONVERT @RM TO @VM IN COAKeys
COAKeys[-1,1] = '' ;* Strip trailing delimiter
PopOver = ''
PopOver<PDISPLAY$> = COAKeys
COAKey = Popup(@WINDOW,PopOver,'COA')
IF COAKey NE '' THEN
LotNo = FIELD(COAKey,'*',2)
obj_AppWindow('LUValReturn',LotNo:@RM:@WINDOW:'.LOT_NO')
END
END
END
RETURN
* * * * * * *
Print:
* * * * * * *
CoaID = Get_Property(@WINDOW,'ID')
IF CoaID = '' THEN RETURN
Print_Vend_CofA( CoaID, PDFPath )
RETURN

View File

@ -0,0 +1,178 @@
COMPILE FUNCTION Comm_Coa_Coc(Instruction, Parm1)
/*
Commuter module for Coa_Coc window
03/03/2004 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Send_Event, Set_Status, Center_Window
DECLARE SUBROUTINE ErrMsg, Send_Message, Set_Property, Send_Event, Btree.Extract, obj_AppWindow
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Utility, Center_Window, Popup, Collect.Ixvals
DECLARE FUNCTION Send_Message
$INSERT POPUP_EQUATES
EQU CRLF$ TO \0D0A\
EQU LTGREY$ TO 229 + (229*256) + (229*65536) ;* JCH standard colors for edittable backgrounds
EQU GREY$ TO 192 + (192*256) + (192*65536)
EQU GREEN$ TO 192 + (220*256) + (192*65536)
EQU RED$ TO 255 + (128*256) + (128*65536)
EQU BLUE$ TO 128 + (255*256) + (255*65536)
EQU WHITE$ TO 255 + (255*256) + (255*65536)
EQU YELLOW$ TO 255 + (255*256) + (202*65536)
EQU LTBLUE$ TO 128 + (255*256) + (255*65536)
EQU PURPLE$ TO 225 + (181*256) + (255*65536)
ErrTitle = 'Error in Comm_Coa_Coc'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Instruction = 'Create' ; GOSUB Create
CASE Instruction = 'Refresh' ; GOSUB Refresh
CASE Instruction = 'LUCompNo' ; GOSUB LUCompNo
CASE Instruction = 'LotDC' ; GOSUB LotDC
CASE 1
ErrorMsg = 'Unknown Instruction passed to routine.'
ErrMsg(ErrorMsg)
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
Center_Window(@WINDOW)
IF Parm1 NE '' THEN
obj_AppWindow('LoadFormKeys',@WINDOW:@RM:Parm1)
END
GOSUB Refresh
RETURN
* * * * * * *
Refresh:
* * * * * * *
RETURN
* * * * * * *
LUCompNo:
* * * * * * *
CompanyKeys = Collect.IXVals('COA_COC', 'COMP_NO')
CONVERT @FM TO @VM IN CompanyKeys
OverRide = ''
OverRide<PMODE$> = 'K'
OverRide<PDISPLAY$> = CompanyKeys
CompanyKey = Popup(@WINDOW,OverRide,'COMPANY2')
IF CompanyKey = '' THEN RETURN
OPEN 'DICT.COA_COC' TO DictVar THEN
TableName = 'COA_COC'
Flag = ''
Option = ''
Search = 'COMP_NO':@VM:CompanyKey:@FM
Btree.Extract(Search, TableName, DictVar, CoaCocKeys, Option, Flag)
IF Get_Status(errCode) THEN
ErrMsg(errCode)
RETURN
END
OverRide = ''
OverRide<PMODE$> = 'K'
OverRide<PDISPLAY$> = CoaCocKeys
CoaCocKey = Popup(@WINDOW,OverRide,'COA_COC')
obj_AppWindow('LoadFormKeys',@WINDOW:@RM:CoaCocKey)
END ;* End of DICT.COA_COC open
RETURN
* * * * * *
LotDC:
* * * * * *
LotList = Get_Property(@WINDOW:'.VEND_LOT_NO','LIST')
CurrPos = Get_Property(@WINDOW:'.VEND_LOT_NO','SELPOS')
CurrCol = CurrPos<1>
CurrRow = CurrPos<2>
LotNo = LotList<CurrRow,1>
IF LotNo NE '' THEN
xlFileName = Get_Property(@WINDOW:'.XLFILENAME','TEXT')
Path = Get_Property(@WINDOW:'.PATH','TEXT')
TestWacker = xlFileName[1,'_']
IF LEN(TestWacker) = 6 AND NUM(TestWacker) THEN
WackerNo = TestWacker
END ELSE
WackerNo = ''
END
Frame = Get_Property(@WINDOW, "MDIFRAME")
Code = ''
Code<-1> = 'Set objExcel = CreateObject("excel.Application")'
Code<-1> = 'objExcel.WindowState = 3'
Code<-1> = 'objExcel.Visible = True'
Code<-1> = 'Path = ':QUOTE(Path:xlFileName)
Code<-1> = 'objExcel.Workbooks.Open Path'
Code<-1> = 'objExcel.Sheets("':WackerNo:'_L").Select'
hScript = Frame:'.SCRIPTCONTROL'
swap @tm with crlf$ in Code
swap @fm with crlf$ in Code
script = 'function main(argstring)'
script := crlf$:''
script := crlf$:'result = 0'
script := crlf$:code
script := crlf$:'main = result'
script := crlf$:''
script := crlf$:'end function'
language = 'VbScript'
strResult = Send_Message( hScript, 'Reset')
Set_Property( hScript ,'Language',language)
strResult = Send_Message( hScript, 'AddCode', script )
strResult = Send_Message( hScript, 'Run', "main","" )
END
RETURN

View File

@ -0,0 +1,82 @@
COMPILE FUNCTION Comm_Company2(Instruction, Parm1)
/*
Commuter module for COMPANY2 window
002/29/2004 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Send_Event, Set_Status, SetInitDirOptions
DECLARE SUBROUTINE ErrMsg, Send_Message, Make.List,Set_Property, Send_Event
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Utility, Center_Window, Popup, Fieldcount
DECLARE FUNCTION Collect.Ixvals
EQU CRLF$ TO \0D0A\
$INSERT APPCOLORS
$INSERT POPUP_EQUATES
ErrTitle = 'Error in Comm_Company2'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Instruction = 'Create' ; GOSUB Create
CASE Instruction = 'Refresh' ; GOSUB Refresh
CASE Instruction = 'LUComp_No' ; GOSUB LUComp_No
CASE 1
ErrorMsg = 'Unknown Instruction passed to routine.'
ErrMsg(ErrorMsg)
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
SetInitDirOptions('-R-SD')
InitDir "R:\InboundCofA\*."
SubDirectories = @FM:DirList()
Set_Property(@WINDOW:'.COA_FOLDER','LIST',SubDirectories)
GOSUB Refresh
RETURN
* * * * * * *
Refresh:
* * * * * * *
RETURN
* * * * * * *
LUComp_No:
* * * * * * *
CompKeys = Collect.IXVals('COA', 'COMP_NO')
CONVERT @FM TO @VM IN CompKeys
PopOver = ''
PopOver<PDISPLAY$> = CompKeys
CompanyKey = Popup(@WINDOW,PopOver,'COMPANY_COA')
IF CompanyKey NE '' THEN
Set_Property(@WINDOW:'.CO_NO','DEFPROP',CompanyKey)
Send_Event(@WINDOW,'READ')
END
RETURN

View File

@ -0,0 +1,77 @@
COMPILE FUNCTION Comm_Company_Fix(Instruction, Parm1)
/*
Commuter module for COMPANY_FIX window
002/29/2004 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Send_Event, Set_Status, SetInitDirOptions
DECLARE SUBROUTINE ErrMsg, Send_Message, Make.List,Set_Property, Send_Event, obj_Appwindow
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Utility, Center_Window, Popup, Fieldcount
DECLARE FUNCTION Collect.Ixvals
EQU CRLF$ TO \0D0A\
$INSERT APPCOLORS
$INSERT POPUP_EQUATES
ErrTitle = 'Error in Comm_Company_Fix'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Instruction = 'Create' ; GOSUB Create
CASE Instruction = 'Refresh' ; GOSUB Refresh
CASE Instruction = 'LUCustNo' ; GOSUB LUCustNo
CASE 1
ErrorMsg = 'Unknown Instruction passed to routine.'
ErrMsg(ErrorMsg)
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
obj_Appwindow('Create')
GOSUB Refresh
RETURN
* * * * * * *
Refresh:
* * * * * * *
RETURN
* * * * * * *
LUCustNo:
* * * * * * *
IF NOT(ASSIGNED(Parm1)) THEN FocusControl = '' ELSE FocusControl = Parm1
IF NOT(ASSIGNED(Parm2)) THEN FocusPos = '' ELSE FocusPos = Parm2
TypeOver = ''
TypeOver<PSELECT$> = 1
CustNo = Popup(@WINDOW,TypeOver,'CUSTOMER')
IF CustNo NE '' THEN
obj_Appwindow('LUValReturn',CustNo:@RM:FocusControl:@RM:FocusPos)
END
RETURN

View File

@ -0,0 +1,142 @@
COMPILE SUBROUTINE COMM_COMP_LOOKUP( Instruction, Parm1,Parm2 )
/*
Commuter module for COMP_LOOKUP window
07/12/2004 - JCH - J.C. Henry, Inc.
*/
DECLARE SUBROUTINE ErrMsg, obj_Appwindow, Set_Property, Btree.Extract, End_Window
DECLARE FUNCTION Get_Property
EQU TRUE$ TO 1
EQU FALSE TO 0
* Sub Clients Table Equates
EQU COL$CLIENT_NO TO 1
EQU COL$CLIENT_TYPE TO 2
EQU COL$CLIENT_NAME TO 3
EQU COL$CLIENT_COMPANY TO 4
EQU COL$CLIENT_DESC TO 5
ReturnVal = ''
* Dispather
BEGIN CASE
CASE Instruction = 'Create' ; GOSUB Create
CASE Instruction = 'OK' ; GOSUB OK
CASE Instruction = 'NameChar' ; GOSUB NameChar
CASE Instruction = 'TableDC' ; GOSUB TableDC
CASE 1
ErrMsg('Invalid Instruction ':QUOTE(Instruction):' passed to COMM_COMP_LOOKUP routine')
END CASE
RETURN ReturnVal
* * * * * *
Create:
* * * * * *
CharacterIn = Parm1<1,1>
CompType = Parm1<1,2>
ReturnToCtrl = Parm1<2>
ReturnToPos = FIELD(Parm1,@FM,3,2) ;* Fields 3 and 4
obj_AppWindow('Create',@WINDOW)
Set_Property(@WINDOW:".NAME","TEXT",CharacterIn)
Set_Property(@WINDOW:'.NAME','SELECTION',LEN(CharacterIn)+1:@FM:65534 )
Set_Property(@WINDOW,'@COMP_TYPE',CompType)
Set_Property(@WINDOW,'@RETURN_TO_CTRL',ReturnToCtrl)
Set_Property(@WINDOW,'@RETURN_TO_POS',ReturnToPos)
* * * * * * *
NameChar:
* * * * * * *
IF Instruction = 'NameChar' THEN
CharacterIn = Get_Property(@WINDOW:'.NAME','TEXT')
END
IF LEN(CharacterIn) < 3 OR CharacterIn[-1,1] = ' ' THEN RETURN
CONVERT ' ' TO @VM IN CharacterIn
SearchCriteria = ''
IF INDEX(CharacterIn,@VM,1) THEN
LastWord = CharacterIn[-1,'B':@VM] ;* Multiple words in name
WordCnt = COUNT(CharacterIn,@VM) + (CharacterIn NE '')
FOR I = 1 TO WordCnt
SearchCriteria := 'CO_NAME_XREF':@VM:CharacterIn<1,I>:']':@FM
NEXT I
END ELSE
SearchCriteria = 'CO_NAME_XREF':@VM:CharacterIn:']':@FM
END
CompType = Get_Property(@WINDOW,'@COMP_TYPE') ;* Can be V(endor), C(ustomer) or O(ther)
OPEN "DICT.COMPANY" To DictVar THEN
IF CompType NE '' THEN
SearchCriteria := 'CO_TYPE':@VM:CompType:@FM
END
KeyList = ''
Option = ''
Flag = ''
Btree.Extract(SearchCriteria, 'COMPANY',DictVar,KeyList,Option,Flag)
KeyCnt = COUNT(KeyList,@VM) + (KeyList NE '')
IF KeyList NE '' THEN
NameArray = ''
ClientTypes = XLATE('COMPANY',KeyList,'CO_TYPE','X')
ClientNames = XLATE('COMPANY',KeyList,'CO_NAME','X')
ClientDivisions = XLATE('COMPANY',KeyList,'DIVISION','X')
ClientCities = XLATE('COMPANY',KeyList,'CITY','X')
NameArray = KeyList:@FM:ClientTypes:@FM:ClientNames:@FM:ClientDivisions:@FM:ClientCities
END
Set_Property(@WINDOW:'.LOOKUP_TABLE','DEFPROP',NameArray)
IF KeyCnt = 1 THEN
Set_Property(@WINDOW:'.LOOKUP_TABLE','SELPOS',1:@FM:1)
Set_Property(@WINDOW:'.OK_BUTTON','FOCUS',1)
END
END ELSE
ErrMsg('Unable to open DICT.CLIENT for index lookup')
END
RETURN
* * * * * * *
TableDC:
* * * * * * *
* * * * * * *
OK:
* * * * * * *
CurrPos = Get_Property(@WINDOW:'.LOOKUP_TABLE','SELPOS')
CurrCol = CurrPos<1>
CurrRow = CurrPos<2>
LookupList = Get_Property(@WINDOW:'.LOOKUP_TABLE','LIST')
CustNo = LookupList<CurrRow,COL$CLIENT_NO>
ReturnToCtrl = Get_Property(@WINDOW,'@RETURN_TO_CTRL')
ReturnToPos = Get_Property(@WINDOW,'@RETURN_TO_POS')
End_Window(@WINDOW)
obj_AppWindow('LUValReturn',CustNo:@RM:ReturnToCtrl:@RM:ReturnToPos:@RM:1) ;* Last Param (SkipCalculate) required when called from collector
RETURN

View File

@ -0,0 +1,99 @@
COMPILE FUNCTION Comm_Customer(Instruction, Parm1)
/*
Commuter module for CUSTOMER window
06/24/2005 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Send_Event, Set_Status, SetInitDirOptions
DECLARE SUBROUTINE ErrMsg, Send_Message, Make.List,Set_Property, Send_Event, obj_Appwindow
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Utility, Center_Window, Popup, Fieldcount
DECLARE FUNCTION Collect.Ixvals
EQU CRLF$ TO \0D0A\
$INSERT APPCOLORS
$INSERT POPUP_EQUATES
ErrTitle = 'Error in Comm_Customer'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Instruction = 'Create' ; GOSUB Create
CASE Instruction = 'Clear' ; GOSUB Clear
CASE Instruction = 'Refresh' ; GOSUB Refresh
CASE Instruction = 'Page' ; GOSUB Page
CASE Instruction = 'LUCustNo' ; GOSUB LUCustNo
CASE 1
debug
ErrorMsg = 'Unknown Instruction passed to routine.'
ErrMsg(ErrorMsg)
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
obj_Appwindow('Create')
GOSUB Refresh
RETURN
* * * * * * *
Clear:
* * * * * * *
* * * * * * *
Refresh:
* * * * * * *
RETURN
* * * * * * *
Page:
* * * * * * *
obj_Appwindow('Page')
GOSUB Refresh
RETURN
* * * * * * *
LUCustNo:
* * * * * * *
RETURN
CompKeys = Collect.IXVals('COA', 'COMP_NO')
CONVERT @FM TO @VM IN CompKeys
PopOver = ''
PopOver<PDISPLAY$> = CompKeys
CompanyKey = Popup(@WINDOW,PopOver,'COMPANY_COA')
IF CompanyKey NE '' THEN
Set_Property(@WINDOW:'.CO_NO','DEFPROP',CompanyKey)
Send_Event(@WINDOW,'READ')
END
RETURN

View File

@ -0,0 +1,818 @@
COMPILE FUNCTION Comm_Customer_EPI(Instruction, Parm1,Parm2)
/*
Commuter module for Customer_Epi () window
07/08/2005 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Send_Event, Set_Status, Set_List_Box_Data, SetInitDirOptions
DECLARE SUBROUTINE ErrMsg, Send_Message, Set_Property, Send_Event, Btree.Extract, obj_AppWindow,ErrMsg
DECLARE SUBROUTINE obj_Notes, Security_Err_Msg, End_Window, Forward_Event, Start_Window, Create_Note, RList
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Utility, Popup, Collect.Ixvals
DECLARE FUNCTION Send_Message, Msg, Security_Check, RowExists, NextKey
$INSERT POPUP_EQUATES
$INSERT LOGICAL
$INSERT MSG_EQUATES
$INSERT APPCOLORS
$INSERT QUOTE_SIGS_EQU
$INSERT LSL_USERS_EQU
$INSERT SECURITY_RIGHTS_EQU
$INSERT RLIST_EQUATES
$INSERT COMPANY_EQU
EQU CRLF$ TO \0D0A\
EQU COL$CUST_NO TO 1 ;* Equates for the SHIP_TO_CUST_NO edit table control
EQU COL$SAP_NO TO 2
EQU COL$COMPANY TO 3
EQU COL$ABBREV TO 4
EQU COL$ADDRESS TO 5
EQU COL$CSZ TO 6
ErrTitle = 'Error in Comm_Customer_EPI'
ErrorMsg = ''
ErrCode = ''
Result = ''
BEGIN CASE
CASE Instruction = 'Create' ; GOSUB Create
CASE Instruction = 'Refresh' ; GOSUB Refresh
CASE Instruction = 'Read' ; GOSUB Read
CASE Instruction = 'Write' ; GOSUB Write
CASE Instruction = 'Clear' ; GOSUB Clear
CASE Instruction = 'Page' ; GOSUB Page
CASE Instruction = 'Delete' ; GOSUB Delete
CASE Instruction = 'Close' ; GOSUB Close
CASE Instruction = 'New' ; GOSUB New
CASE Instruction = 'LUDate' ; GOSUB LUDate
CASE Instruction = 'LUCompNo' ; GOSUB LUCompNo
CASE Instruction = 'CompChar' ; GOSUB CompChar
CASE Instruction = 'CompNoLF' ; GOSUB CompNoLF
CASE Instruction = 'ViewBillTo' ; GOSUB ViewBillTo
CASE Instruction = 'ShipToDC' ; GOSUB ShipToDC
CASE Instruction = 'Contacts' ; GOSUB Contacts
CASE Instruction = 'AnnConts' ; GOSUB AnnConts
CASE Instruction = 'Quotes' ; GOSUB Quotes
CASE Instruction = 'ProdSpecs' ; GOSUB ProdSpecs
CASE Instruction = 'OpenOrders' ; GOSUB OpenOrders
CASE Instruction = 'LUIncoCode' ; GOSUB LUIncoCode
CASE Instruction = 'LUShipDocDir' ; GOSUB LUShipDocDir
CASE Instruction = 'LUShipDataDir' ; GOSUB LUShipDataDir
CASE Instruction = 'LUExportName' ; GOSUB LUExportName
CASE Instruction = 'EnableCheckBoxes' ; GOSUB EnableCheckBoxes
CASE 1
ErrorMsg = 'Unknown Instruction ':QUOTE(Instruction):' passed to routine.'
ErrMsg(ErrorMsg)
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
* Change the security tables to match the table names after conversion and take this note out
obj_Appwindow('Create',@WINDOW)
IF NOT(Security_Check('Company',READ$)) THEN
Security_Err_Msg('Company',READ$)
End_Window(@WINDOW)
RETURN
END
Set_List_Box_Data(@WINDOW)
* Provides compatibility with the existing messaging attachment system
IF Parm1 NE '' THEN
PassedKeys = FIELD(Parm1,'*',1)
obj_Appwindow('ViewRelated',@WINDOW:@RM:PassedKeys)
END
GOSUB Refresh
RETURN
* * * * * * *
Clear:
* * * * * * *
Send_Event(@WINDOW,'PAGE',1)
obj_AppWindow('ReadOnly',@RM:1) ;* Reenables data bound controls
* * * * * * *
Refresh:
* * * * * * *
IF Security_Check('Company',EDIT$) THEN
obj_AppWindow('ReadOnly',@WINDOW:@RM:1) ;* enable all database controls
END ELSE
obj_AppWindow('ReadOnly',@WINDOW) ;* disable all database controls
END
Ctrls = @WINDOW:'.ENTRY_ID':@RM ; Props = 'TEXT':@RM
Ctrls := @WINDOW:'.ENTRY_DT' ; Props := 'TEXT'
Vals = Get_Property(Ctrls,Props)
EnterBy = Vals[1,@RM]
EnterDTM = Vals[COL2()+1,@RM]
IF EnterBy = '' THEN Vals = 1:@RM ELSE Vals = 0:@RM
IF EnterDTM = '' THEN Vals := 1 ELSE Vals := 0
Props = 'ENABLED':@RM:'ENABLED'
Set_Property(Ctrls,Props,Vals)
CompNo = Get_Property(@WINDOW,'ID')
IF CompNo = '' THEN
Set_Property(@WINDOW:'.NEW_BUTTON','ENABLED',1)
END ELSE
Set_Property(@WINDOW:'.NEW_BUTTON','ENABLED',0)
END
* QBF buttons
Ctrls = @WINDOW:'.QBF_FIRST_FIX':@RM ; Props = 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_PREV_FIX':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_ABS_FIX':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_NEXT_FIX':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_LAST_FIX':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_STOP_FIX' ; Props := 'ENABLED'
IF Get_Property(@WINDOW,'QBFLIST') = '' THEN
Vals = 0:@RM:0:@RM:0:@RM:0:@RM:0:@RM:0
END ELSE
Vals = 1:@RM:1:@RM:1:@RM:1:@RM:1:@RM:1
END
Set_Property(Ctrls,Props,Vals)
* Turn edit table symbolic column backgrounds to green
ETSymbolics = Get_Property(@WINDOW,'@ET_SYMBOLICS') ;* Loaded during 'Create' in obj_Appwindow
ETCtrls = ETSymbolics<1>
ETCols = ETSymbolics<2>
FOR I = 1 TO COUNT(ETCtrls,@VM) + (ETCtrls NE '')
ETCtrl = ETCtrls<1,I>
ETList = Get_Property(ETCtrl,'LIST')
FOR Line = 1 TO COUNT(ETList,@FM) + (ETList NE '')
IF ETList<Line,1> NE '' THEN
FOR N = 1 TO COUNT(ETCols<1,I>,@SVM) + (ETCols<1,I> NE '')
IF N NE COL$SAP_NO THEN
stat = Send_Message(ETCtrl,'COLOR_BY_POS',ETCols<1,I,N>,Line,GREEN$)
END
NEXT N
END
NEXT Line
NEXT I
ShipList = Get_Property(@WINDOW:'.SHIP_TO_CUST_NO','LIST')
FOR I = 1 TO COUNT(ShipList,@FM) + (ShipList NE '')
IF ShipList<I,COL$SAP_NO> NE '' THEN
stat = Send_Message(@WINDOW:'.SHIP_TO_CUST_NO','COLOR_BY_POS',COL$SAP_NO,I,SAP_READ_ONLY$)
END
NEXT I
GoSub EnableCheckBoxes
RETURN
* * * * * * *
Page:
* * * * * * *
obj_Appwindow('Page')
RETURN
* * * * * * *
Read:
* * * * * * *
* * * This is called from the event handler as a PreRead event * * *
CompNo = Get_Property(@WINDOW:'.CO_NO','TEXT')
IF NOT(RowExists('COMPANY',CompNo)) THEN
IF NOT(Security_Check('Company',WRITE$)) THEN
Security_Err_Msg('Company',WRITE$)
Send_Event(@WINDOW,'CLEAR')
RETURN
END
END
Forward_Event() ;* passed security, do the read
EnterBy = Get_Property(@WINDOW:'.ENTRY_ID','TEXT')
IF EnterBy = '' THEN
CurrDate = OCONV(Date(),'D4/')
Set_Property(@WINDOW:'.ENTRY_ID','TEXT',OCONV(@USER4,'[XLATE_CONV,LSL_USERS*FIRST_LAST]'))
Set_Property(@WINDOW:'.ENTRY_DATE','TEXT',CurrDate)
Set_Property( @WINDOW:'.VISION_CUST_NO', 'FOCUS',1)
END
GOSUB Refresh
RETURN
* * * * * * *
Write:
* * * * * * *
CompType = Get_Property(@WINDOW:'.CO_TYPE','INVALUE')
IF CompType = '' THEN Set_Property(@WINDOW:'.CO_TYPE','TEXT','C')
Result = 1
RETURN
* * * * * * *
Delete:
* * * * * * *
*IF Security_Check('Company',Delete$) THEN
* Result = 1 ;* Proceed with delete
*END ELSE
Security_Err_Msg('Company',Delete$)
Result = 0 ;* Stop event chain
*END
RETURN
* * * * * * *
New:
* * * * * * *
CompanyNo = Get_Property(@WINDOW,'ID')
IF CompanyNo = '' THEN
NextCompanyNo = NextKey('COMPANY')
obj_Appwindow('LoadFormKeys',@WINDOW:@RM:NextCompanyNo)
END
RETURN
* * * * * * *
LUDate:
* * * * * * *
ReturnCtrl = Parm1[1,@RM]
IF ReturnCtrl = '' THEN ReturnCtrl = Get_Property(@WINDOW,'FOCUS')
DateSelected = Dialog_Box('POPUP_YEAR',@WINDOW)
RetVal = OCONV(DateSelected, 'D4/')
IF RetVal NE '' THEN
obj_Appwindow('LUValReturn',RetVal:@RM:ReturnCtrl)
END
RETURN
* * * * * * *
Close:
* * * * * * *
obj_Notes('Inbox',@USER4) ;* Checks for any new messages
RETURN
* * * * * * *
CompChar:
* * * * * * *
CtrlName = @WINDOW:'.CO_NO'
IF Get_Property(@WINDOW, "QBFSTATUS") THEN RETURN ;* QBFStatus returns 1 if QBF is active
DataIn = Get_Property(CtrlName,'TEXT')
IF LEN(DataIn) > 2 THEN
ReturnToCtrl = CtrlName
IF NOT(NUM(DataIn)) THEN
Set_Property(CtrlName,'TEXT','') ;* Clear characters input
Start_Window('COMP_LOOKUP',@WINDOW,DataIn:@VM:'C':@FM:ReturnToCtrl,'','')
END
END
RETURN
* * * * * * *
LUCompNo:
* * * * * * *
IF NOT(ASSIGNED(Parm1)) THEN FocusControl = '' ELSE FocusControl = Parm1
IF NOT(ASSIGNED(Parm2)) THEN FocusPos = '' ELSE FocusPos = Parm2
TypeOver = ''
TypeOver<PSELECT$> = 1
CustNo = Popup(@WINDOW,TypeOver,'CUSTOMER')
IF CustNo NE '' THEN
obj_Appwindow('LUValReturn',CustNo:@RM:FocusControl:@RM:FocusPos)
END
RETURN
* * * * * * *
CompNoLF:
* * * * * * *
CtrlName = @WINDOW:'.CO_NO'
DataIn = Get_Property(CtrlName,'TEXT')
IF LEN(DataIn) = 6 AND NUM(DataIn) AND DataIn[1,1] = 0 THEN
* Must be a Vision Part No
OPEN 'DICT.COMPANY' TO DictCompany ELSE
ErrMsg('Unable to open "DICT.COMPANY" for lookup in COMM_CUSTOMER_EPI - CompNoLF Method.')
RETURN
END
SearchString = 'VISION_CUST_NO':@VM:DataIn:@FM
Option = ''
Flag = ''
Btree.Extract(SearchString,'COMPANY',DictCompany,CompNos,Option,Flag)
IF Get_Status(errCode) THEN
ErrMsg(errCode)
RETURN
END
IF CompNos = '' THEN
ErrMsg('No customer with Vision Customer No ':QUOTE(DataIn):' on file.')
RETURN
END
IF Index(CompNos,@VM,1) THEN
DEBUG
END ELSE
obj_Appwindow('LUValReturn',CompNos:@RM:CtrlName:@RM:'')
END
END
RETURN
* * * * * * *
LUNameNo:
* * * * * * *
IF NOT(ASSIGNED(Parm1)) THEN FocusControl = '' ELSE FocusControl = Parm1
IF NOT(ASSIGNED(Parm2)) THEN FocusPos = '' ELSE FocusPos = Parm2
CompNo = Get_Property(@WINDOW:'.CUST_NO','TEXT')
IF CompNo NE '' THEN
* This is the pushbutton - show the short name list
OPEN 'DICT.NAMES' TO DictVar THEN
SearchString = 'CO_ID':@VM:CompNo:@FM
Btree.Extract(SearchString,'NAMES',DictVar,NameNos,'',Flag)
IF Get_Status(errCode) THEN
ErrMsg(errCode)
RETURN
END
IF NameNos = '' THEN
ErrMsg('No names on file for Customer Number ':CompNo)
RETURN
END ELSE
IF INDEX(NameNos,@VM,1) THEN
TypeOver = ''
TypeOver<PDISPLAY$> = NameNos
TypeOver<PTITLE$> = 'Contact Names for ':XLATE('COMPANY',CompNo,4,'X')
NameNo = Popup(@WINDOW,TypeOver,'COMP_NAME')
END ELSE
NameNo = NameNos
END
obj_AppWindow('LUValReturn',NameNo:@RM:FocusControl:@RM:FocusPos)
END
END ELSE
ErrMsg('Unable to open DICT.NAMES in COMM_ANN_CONT routine.')
RETURN
END
END ELSE
NameNo = Popup(@WINDOW,'','NAMES')
IF NameNo NE '' THEN
obj_AppWindow('LUValReturn',NameNo:@RM:FocusControl:@RM:FocusPos)
END
END
RETURN
* * * * * * *
ViewName:
* * * * * * *
NameNo = Get_Property(@WINDOW:'.NAME_NO','TEXT')
IF NameNo NE '' THEN
obj_Appwindow('ViewRelated','NAMES':@RM:NameNo)
END
RETURN
* * * * * * *
ViewBillTo:
* * * * * * *
BillToCustNo = Get_Property(@WINDOW:'.BILL_TO_CUST_NO','TEXT')
IF BillToCustNo NE '' THEN
Send_Event(@WINDOW,'CLEAR')
Set_Property(@WINDOW:'.CO_NO','TEXT',BillToCustNo)
Send_Event(@WINDOW:'.CO_NO','LOSTFOCUS')
END
RETURN
* * * * * * *
ShipToDC:
* * * * * * *
CtrlEntId = @WINDOW:'.SHIP_TO_CUST_NO'
CurrPos = Get_Property(CtrlEntId,'SELPOS')
RowData = Get_Property(CtrlEntId,'ROWDATA')
ColData = Get_Property(CtrlEntId,'ARRAY')
CurrCol = CurrPos<1>
CurrRow = CurrPos<2>
IF RowData<1,1> = '' THEN RETURN
ShipToCustNo = RowData<1,1>
Send_Event(@WINDOW,'CLEAR')
Set_Property(@WINDOW:'.CO_NO','TEXT',ShipToCustNo)
Send_Event(@WINDOW:'.CO_NO','LOSTFOCUS')
RETURN
* * * * * * *
Contacts:
* * * * * * *
CompNo = Get_Property(@WINDOW:'.CO_NO','TEXT')
IF CompNo = '' THEN RETURN
IF Security_Check('Names',Read$) THEN
TypeOver = ''
TypeOver<PDISPLAY$> = 'WITH CO_ID "':CompNo:'" BY LAST BY FIRST'
NameNos = Popup(@WINDOW,TypeOver,'SHOW_NAMES')
IF NameNos = CHAR(27) THEN RETURN ;* Canceled
IF Get_Status(errCode) THEN
Errmsg(errCode)
RETURN
END
ParamToPass = NameNos:'*':CompNo
Start_Window( 'NAMES', @WINDOW, ParamToPass, '', '' )
END ELSE
Security_Err_Msg('Names',Read$)
END
RETURN
* * * * * * *
AnnConts:
* * * * * * *
CompNo = Get_Property(@WINDOW:'.CO_NO','TEXT')
IF CompNo = '' THEN RETURN
IF Security_Check('Annual Contracts',Read$) THEN
OPEN 'DICT.ANNUAL_CONTRACTS' TO DictVar THEN
SearchString = 'CUST_NO':@VM:CompNo:@FM
*SearchString := 'STATUS':@VM:'O':@FM
Btree.Extract(SearchString,'ANNUAL_CONTRACTS',DictVar,ACIDs,'',Flag)
IF Get_Status(errCode) THEN
ErrMsg(errCode)
RETURN
END
IF ACIDs= '' THEN
ErrMsg('No Annual Contracts on file for Customer Number ':CustNo)
RETURN
END ELSE
IF INDEX(ACIDs,@VM,1) THEN
ACIDs := @VM
CONVERT @VM TO @RM IN ACIDs
CALL V119('S','','D','R',ACIDs,'')
IF Get_Status(errCode) THEN
ErrMsg(errCode)
RETURN
END
CONVERT @RM TO @VM IN ACIDs
ACIDs[-1,1] = '' ;* Strip trailing delimiter
TypeOver = ''
TypeOver<PDISPLAY$> = ACIDs
TypeOver<PSELECT$> = 2
TypeOver<PTITLE$> = 'Annual Contracts for ':XLATE('COMPANY',CompNo,4,'X')
ACIDs = Popup(@WINDOW,TypeOver,'COMP_ANN_CONT')
IF Get_Status(errCode) THEN
Errmsg(errCode)
RETURN
END
END
obj_AppWindow('ViewRelated','ANN_CONT':@RM:ACIDs)
END
END ELSE
ErrMsg('Unable to open DICT.ANNUAL_CONTRACTS in COMM_PROD_ORD routine.')
RETURN
END
END ELSE
Security_Err_Msg('Annual Contracts',Read$)
END
RETURN
* * * * * * *
Quotes:
* * * * * * *
CompNo = Get_Property(@WINDOW:'.CO_NO','TEXT')
IF CompNo = '' THEN RETURN
IF Security_Check('Quote',Read$) THEN
TypeOver = ''
TypeOver<PDISPLAY$> = 'WITH CUST_NO "':CompNo:'" BY-DSND ENTRY_DATE'
QuoteNos = Popup(@WINDOW,TypeOver,'SHOW_QUOTES')
IF Get_Status(errCode) THEN
Errmsg(errCode)
RETURN
END
IF NameNos NE '' THEN
obj_AppWindow('ViewRelated','QUOTE2':@RM:QuoteNos)
END
END ELSE
Security_Err_Msg('Quote',Read$)
END
RETURN
* * * * * * *
ProdSpecs:
* * * * * * *
CompNo = Get_Property(@WINDOW:'.CO_NO','TEXT')
IF CompNo = '' THEN RETURN
IF Security_Check('Prod Spec',Read$) THEN
TypeOver = ''
TypeOver<PDISPLAY$> = 'WITH CUST_ID "':CompNo:'" BY-DSND REV_DATE'
PSNos = Popup(@WINDOW,TypeOver,'SHOW_PROD_SPEC')
IF Get_Status(errCode) THEN
Errmsg(errCode)
RETURN
END
IF PSNos NE '' THEN
obj_AppWindow('ViewRelated','PROD_SPEC':@RM:PSNos)
END
END ELSE
Security_Err_Msg('Prod Spec',Read$)
END
RETURN
* * * * * * *
OpenOrders:
* * * * * * *
CompNo = Get_Property(@WINDOW:'.CO_NO','TEXT')
IF CompNo = '' THEN RETURN
IF Security_Check('Order',Read$) THEN
TypeOver = ''
TypeOver<PDISPLAY$> = 'WITH CUST_NO "':CompNo:'" AND WITH CURR_STATUS NE "C" BY-DSND ENTRY_DATE'
OrderNos = Popup(@WINDOW,TypeOver,'SHOW_ORDERS')
IF Get_Status(errCode) THEN
Errmsg(errCode)
RETURN
END
IF NameNos NE '' THEN
obj_AppWindow('ViewRelated','ORDER2':@RM:OrderNos)
END
END ELSE
Security_Err_Msg('Order',Read$)
END
RETURN
* * * * * * *
LUIncoCode:
* * * * * * *
IF NOT(ASSIGNED(Parm1)) THEN FocusControl = '' ELSE FocusControl = Parm1
IF NOT(ASSIGNED(Parm2)) THEN FocusPos = '' ELSE FocusPos = Parm2
Result = Popup(@WINDOW,'','INCO_CODES')
obj_Appwindow('LUValReturn',Result:@RM:FocusControl:@RM:FocusPos)
Send_Event(@WINDOW:'.INCO_DESC','CALCULATE')
RETURN
* * * * * * *
LUShipDocDir:
* * * * * * *
Directory = "R:\Ship_eMail\" ;* Hard Coded Directory
SetInitDirOptions("D")
InitDir Directory:'*.*'
SubDirList = ''
List = DirList()
LOOP
Line = List[1,@FM]
List[1,Col2()] = ""
UNTIL Line = ''
IF Line NE '.' AND Line NE '..' THEN
SubDirList<1,-1> = Line
END
REPEAT
TypeOver = ''
TypeOver<PDISPLAY$> = SubDirList
TypeOver<PTITLE$> = Directory
SubDir = Popup(@WINDOW,TypeOver,'SINGLE_COLUMN')
IF SubDir ='' OR SubDir = CHAR(27) THEN RETURN
Set_Property(@WINDOW:'.SHIP_DOC_DIR','DEFPROP',Directory:SubDir)
RETURN
* * * * * * *
LUShipDataDir:
* * * * * * *
Directory = "R:\Ship_Data\" ;* Hard Coded Directory
SetInitDirOptions("D")
InitDir Directory:'*.*'
SubDirList = ''
List = DirList()
LOOP
Line = List[1,@FM]
List[1,Col2()] = ""
UNTIL Line = ''
IF Line NE '.' AND Line NE '..' THEN
SubDirList<1,-1> = Line
END
REPEAT
TypeOver = ''
TypeOver<PDISPLAY$> = SubDirList
TypeOver<PTITLE$> = Directory
SubDir = Popup(@WINDOW,TypeOver,'SINGLE_COLUMN')
IF SubDir ='' OR SubDir = CHAR(27) THEN RETURN
Set_Property(@WINDOW:'.SHIP_DATA_DIR','DEFPROP',Directory:SubDir)
RETURN
* * * * * * *
LUExportName:
* * * * * * *
IF NOT(ASSIGNED(Parm1)) THEN FocusControl = '' ELSE FocusControl = Parm1
IF NOT(ASSIGNED(Parm2)) THEN FocusPos = '' ELSE FocusPos = Parm2
RList('SELECT EXPORTS BY NAME WITH NAME [] "_SYSTEM_"', TARGET_ACTIVELIST$, '', '', '' )
Result = PopUp(@WINDOW,'','SHOW_EXPORTS')
IF Result NE '' THEN
obj_Appwindow('LUValReturn',Result:@RM:FocusControl:@RM:FocusPos)
END
RETURN
* * * * * * * * *
EnableCheckBoxes:
* * * * * * * * *
Set_Property(@Window:'.SHIP_DATA_FLAG', 'ENABLED', True$)
Set_Property(@Window:'.SHIP_DOC_FLAG', 'ENABLED', True$)
ShipDocFlag = Get_Property(@Window:'.SHIP_DOC_FLAG', 'DEFPROP')
If ShipDocFlag EQ True$ then
Set_Property(@Window:'.COB_AUTO_TX_DOC_FLAG', 'ENABLED', True$)
end else
Set_Property(@Window:'.COB_AUTO_TX_DOC_FLAG', 'ENABLED', False$)
end
ShipDataFlag = Get_Property(@Window:'.SHIP_DATA_FLAG', 'DEFPROP')
If ShipDataFlag EQ True$ then
Set_Property(@Window:'.STANDARD_COA', 'ENABLED', True$)
Set_Property(@Window:'.COB_AUTO_FTP_FLAG', 'ENABLED', True$)
end else
Set_Property(@Window:'.STANDARD_COA', 'ENABLED', False$)
Set_Property(@Window:'.COB_AUTO_FTP_FLAG', 'ENABLED', False$)
end
StandardCOAFlag = Get_Property(@Window:'.STANDARD_COA', 'DEFPROP')
If ShipDataFlag EQ True$ AND StandardCOAFlag = True$ then
Set_Property(@Window:'.CMB_FTP_SERVER', 'ENABLED', True$)
Set_Property(@Window:'.FTP_DIRECTORY', 'ENABLED', True$)
end else
Set_Property(@Window:'.CMB_FTP_SERVER', 'ENABLED', False$)
Set_Property(@Window:'.FTP_DIRECTORY', 'ENABLED', False$)
end
return

View File

@ -0,0 +1,337 @@
COMPILE FUNCTION Comm_Cust_TW_Part(CtrlEntID,Event,Parm1, Parm2, Parm3, Parm4, Parm5)
/*
Commuter module for CUST_TW_PART (Test Wafer Use) window
12/2/2010 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, Set_Status, ErrMsg, Set_Property, obj_AppWindow, Btree.Extract
DECLARE SUBROUTINE Send_Event, obj_TW_Use, Security_Err_Msg, Post_Event, Start_Window
DECLARE FUNCTION Get_Property, Get_Status, Popup, Send_Message, Msg
DECLARE FUNCTION obj_Quote, Security_Check
$INSERT QUOTE_SIGS_EQU
$INSERT NOTIFICATION_EQU
$INSERT SECURITY_RIGHTS_EQU
$INSERT ANNUAL_CONTRACTS_EQU
$INSERT MSG_EQUATES
$INSERT APPCOLORS
$INSERT POPUP_EQUATES
EQU CRLF$ TO \0D0A\
ErrTitle = 'Error in Comm_Cust_TW_Part'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE CtrlEntID = @WINDOW AND Event = 'CREATE' ; GOSUB Create
CASE CtrlEntID = @WINDOW AND Event = 'READ' ; GOSUB Read
CASE CtrlEntID = @WINDOW AND Event = 'DELETE' ; GOSUB Delete
CASE CtrlEntID = @WINDOW AND Event = 'CLEAR' ; GOSUB Refresh
CASE CtrlEntID = @WINDOW AND Event[1,3] = 'QBF' ; GOSUB Refresh
CASE CtrlEntID = @WINDOW:'.CUST_NO'
BEGIN CASE
CASE Event = 'CHAR' ; GOSUB CustChar
CASE Event = 'LOSTFOCUS' ; GOSUB LU_TWPartNo
END CASE
CASE CtrlEntID = @WINDOW:'.LU_CUSTOMER' AND Event = 'CLICK' ; GOSUB LUCustNo
CASE CtrlEntID = @WINDOW:'.LU_TW_PART' AND Event = 'CLICK' ; GOSUB LU_TWPartNo
CASE 1
ErrorMsg = 'Unknown Instruction passed to routine':CRLF$:CtrlEntID:' - ':Event
END CASE
IF ErrorMsg NE '' THEN
ErrMsg(ErrTitle:@SVM:ErrorMsg)
END
RETURN Result
* * * * * * *
Create:
* * * * * * *
obj_Appwindow('Create',@WINDOW)
* Provides compatibility with the existing messaging attachment system
IF Parm1 NE '' THEN
PassedKeys = FIELD(Parm1,'*',1)
obj_Appwindow('ViewRelated',@WINDOW:@RM:PassedKeys)
END
IOOptions = Get_Property(@WINDOW,'IOOPTIONS')
IOOptions<10> = 1 ;* Check for required fields on WRITE event
IOOptions<11> = 1 ;* Create READ event on QBF load
Set_Property(@WINDOW,'IOOPTIONS',IOOptions)
GOSUB Refresh
Return
* * * * * * *
Read:
* * * * * * *
OrderNo = Get_Property(@WINDOW:'.ORDER_NO','TEXT')
ItemNo = Get_Property(@WINDOW:'.ITEM_NO','TEXT')
IF RowExists('ORDER_DET',OrderNo:'*':ItemNo) THEN
IF NOT(Security_Check('Order',EDIT$)) THEN
obj_AppWindow('ReadOnly',@WINDOW) ;* disable all database controls
Set_Property(@WINDOW,'@READONLY',1)
END
END ELSE
IF NOT(Security_Check('Order',WRITE$)) THEN
Send_Event(@WINDOW,'CLEAR')
Security_Err_Msg('Order',WRITE$)
RETURN
END
END
GOSUB Refresh
Return
* * * * * * *
Write:
* * * * * * *
Post_Event(@WINDOW,'CLOSE')
Return
* * * * * * *
Clear:
* * * * * * *
obj_AppWindow('ReadOnly',@RM:1) ;* Reenables data bound controls
Set_Property(@WINDOW,'@READONLY',0) ;* Clear flag on window
GOTO Refresh
Return
* * * * * * *
Close:
* * * * * * *
RETURN
* * * * * * *
Delete:
* * * * * * *
IF NOT(Security_Check('Order',DELETE$)) THEN
Security_Err_Msg('Order',DELETE$)
RETURN
END
*Forward_Event()
obj_AppWindow('ReadOnly',@WINDOW:@RM:1) ;* Clear Read Only
Result = 0
RETURN
* * * * * * *
Refresh:
* * * * * * *
* QBF buttons
Ctrls = @WINDOW:'.QBF_FIRST_FIX':@RM ; Props = 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_PREV_FIX':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_ABS_FIX':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_NEXT_FIX':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_LAST_FIX':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_STOP_FIX' ; Props := 'ENABLED'
IF Get_Property(@WINDOW,'QBFLIST') = '' THEN
Vals = 0:@RM:0:@RM:0:@RM:0:@RM:0:@RM:0
END ELSE
Vals = 1:@RM:1:@RM:1:@RM:1:@RM:1:@RM:1
END
Set_Property(Ctrls,Props,Vals)
* Turn edit table symbolic column backgrounds to green
ETSymbolics = Get_Property(@WINDOW,'@ET_SYMBOLICS') ;* Loaded during 'Create' in obj_Appwindow
ETCtrls = ETSymbolics<1>
ETCols = ETSymbolics<2>
FOR I = 1 TO COUNT(ETCtrls,@VM) + (ETCtrls NE '')
ETCtrl = ETCtrls<1,I>
ETList = Get_Property(ETCtrl,'LIST')
FOR Line = 1 TO COUNT(ETList,@FM) + (ETList NE '')
IF ETList<Line,1> NE '' THEN
FOR N = 1 TO COUNT(ETCols<1,I>,@SVM) + (ETCols<1,I> NE '')
stat = Send_Message(ETCtrl,'COLOR_BY_POS',ETCols<1,I,N>,Line,GREEN$)
NEXT N
END
NEXT Line
NEXT I
RETURN
* * * * * * *
CustChar:
* * * * * * *
CtrlName = @WINDOW:'.CUST_NO'
DataIn = Get_Property(CtrlName,'TEXT')
IF LEN(DataIn) > 2 THEN
ReturnToCtrl = CtrlName
IF NOT(NUM(DataIn)) THEN
*Set_Property(CtrlName,'TEXT','') ;* Clear characters input
Start_Window('COMP_LOOKUP',@WINDOW,DataIn:@VM:'C':@FM:ReturnToCtrl,'','')
END
END
RETURN
* * * * * * *
LUCustNo:
* * * * * * *
IF NOT(ASSIGNED(Parm1)) THEN FocusControl = '' ELSE FocusControl = Parm1
IF NOT(ASSIGNED(Parm2)) THEN FocusPos = '' ELSE FocusPos = Parm2
TypeOver = ''
TypeOver<PSELECT$> = 1
CustNo = Popup(@WINDOW,TypeOver,'CUSTOMER')
IF CustNo NE '' THEN
obj_Appwindow('LUValReturn',CustNo:@RM:FocusControl:@RM:FocusPos)
END
RETURN
* * * * * * *
ViewCust:
* * * * * * *
CustNo = Get_Property(@WINDOW:'.CUST_NO','TEXT')
IF CustNo NE '' THEN
obj_Appwindow('ViewRelated','CUSTOMER_EPI':@RM:CustNo)
END
RETURN
* * * * * * *
LU_TWPartNo:
* * * * * * *
CustNo = Get_Property(@WINDOW:'.CUST_NO','DEFPROP')
TWPartNo = Get_Property(@WINDOW:'.TW_PART_NO','DEFPROP')
IF TWPartNo NE '' THEN RETURN
IF CustNo = '' THEN
OPEN 'CUST_TW_PART' TO FileIn THEN
SELECT FileIn
TypeOver = ''
TypeOver<PMODE$> = 'C'
TypeOver<PDISPLAY$> = '0'
CustTWPartKeys = Popup(@WINDOW,TypeOver,'CUST_TW_PART')
IF Get_Status(errCode) THEN ErrMsg(errCode)
END
END ELSE
IF NOT(NUM(CustNo)) THEN
* Doing customer lookup based on typed in name
Set_Property(CtrlName,'TEXT','') ;* Clear characters input
RETURN
END
SearchString = 'CUST_NO':@VM:CustNo:@FM
OPEN 'DICT.CUST_TW_PART' TO DictVar ELSE
ErrMsg('Unable to open DICT.CUST_TW_PART for index lookup.')
RETURN
END
Options = ''
Flag = ''
BTREE.EXTRACT(SearchString, 'CUST_TW_PART', DictVar, CustTWPartKeys, Options, flag)
IF Get_Status(errCode) THEN
ErrMsg(errCode)
RETURN
END
IF CustTWPartKeys = '' THEN
ErrMsg('No TW Part Numbers on file for Customer ':QUOTE(CustNo):'.')
RETURN
END
TypeOver = ''
TypeOver<PDISPLAY$> = CustTWPartKeys
CustTWPartKeys = Popup(@WINDOW,TypeOver,'CUST_TW_PART')
IF Get_Status(errCode) THEN ErrMsg(errCode)
END ;* End of check for null Customer numer
IF CustTWPartKeys NE '' THEN
IF INDEX(CustTWPartKeys,@VM,1) THEN
Send_Event(@WINDOW,'QBFINIT')
Set_Property(@WINDOW,'QBFLIST',CustTWPartKeys)
Send_Event(@WINDOW,'QBFFIRST')
END ELSE
obj_Appwindow('LoadFormKeys',@WINDOW:@RM:CustTWPartKeys)
END
END
RETURN

View File

@ -0,0 +1,329 @@
COMPILE FUNCTION Comm_Dialog_Carton_Pack(Instruction, Parm1)
/*
Commuter module for PACK_CARTON dialog window.
9/16/2003 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Send_Event, Set_Status
DECLARE SUBROUTINE ErrMsg, Send_Message
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Utility, Center_Window, Send_Message
DECLARE FUNCTION obj_WM_Out
EQU CRLF$ TO \0D0A\
EQU COL$ORDER_NO TO 1 ;* Order Line Item edit table column equates
EQU COL$LINE_NO TO 2
EQU COL$STEP_NO TO 3
EQU COL$CASS_NO TO 4
EQU COL$RDS_NO TO 5
EQU COL$PART_NO TO 6
EQU COL$LOT_NO TO 7
EQU COL$REJECT TO 8
EQU COL$WAFER_QTY TO 9
EQU COL$CASS1 TO 1 ;* Carton edit table column equates
EQU COL$CASS2 TO 2
EQU COL$CASS3 TO 3
EQU COL$CASS4 TO 4
EQU COL$CASS5 TO 5
EQU COL$CASS6 TO 6
EQU LTGREY$ TO 229 + (229*256) + (229*65536) ;* JCH standard colors for edittable backgrounds
EQU GREY$ TO 192 + (192*256) + (192*65536)
EQU GREEN$ TO 192 + (220*256) + (192*65536)
EQU RED$ TO 255 + (128*256) + (128*65536)
EQU BLUE$ TO 128 + (255*256) + (255*65536)
EQU WHITE$ TO 255 + (255*256) + (255*65536)
EQU YELLOW$ TO 255 + (255*256) + (202*65536)
EQU LTBLUE$ TO 128 + (255*256) + (255*65536)
EQU PURPLE$ TO 225 + (181*256) + (255*65536)
EQU DTS_MULTIROW$ TO 512
EQU DTS_LARGEDATA$ TO 4096
$INSERT COC_EQU
$INSERT WO_LOG_EQU
$INSERT RDS_EQU
$INSERT PS_EQUATES
$INSERT ORDER_EQU
ErrTitle = 'Error in Comm_Dialog_Carton_Pack'
ErrorMsg = ''
Instructions = 'Create':@FM
Instructions := 'PackCarton':@FM
Instructions := 'PackNext':@FM
Instructions := 'UnpackCarton':@FM
Instructions := 'PrintLabels':@FM ;* This functions as the 'OK' button
Instructions := 'Cancel'
RetVal = ''
LOCATE Instruction IN Instructions USING @FM SETTING Pos THEN
ON Pos GOSUB Create,PackCarton,PackNext,UnpackCarton,PrintLabels,Cancel
END
RETURN RetVal
* * * * * * *
Create:
* * * * * * *
COCId = Parm1
IF COCId = '' THEN GOTO Cancel ;* Nothing to do
* get the current style
Style = Get_Property(@WINDOW:'.CASSETTES', 'STYLE')
/* the style property can be in hex format but bitor only works with decimal integers */
IF Style [1,2] _EQC "0x" THEN
CONVERT @LOWER.CASE TO @UPPER.CASE IN STYLE
Style = ICONV(Style [3,99], "MX")
END
AddStyle = 512 ;* MultiLine Select
Style = BitOr(Style, AddStyle)
Set_Property(@WINDOW:'.CASSETTES', "STYLE", Style)
Set_Property(@WINDOW,'TEXT','Packing Cartons for Certicate of Compliance: ':COCId)
Void = Center_Window(@WINDOW)
COCRec = XLATE('COC',COCId,'','X')
WONo = COCRec<coc_wo$>
WORec = XLATE('WO_LOG',WONo,'','X')
OrderNo = WORec<WO_LOG_ORDER_NO$>
OrderRec = XLATE('ORDER',OrderNo,'','X')
RDSNos = COCRec<COC_RDS_NO$>
WOStepNos = COCRec<COC_WO_STEP$>
CassNos = COCRec<COC_CASS_NO$>
RDSList = ''
FOR I = 1 TO COUNT(WOStepNos,@VM) + (WOStepNos NE '')
WMOutKey = WONo:'*':WOStepNos<1,I>:'*':CassNos<1,I>
IF RDSNos<1,I> = '' THEN
RdsNo = ''
WfrsOut = XLATE('WM_OUT',WMOutKey,'WFRS_OUT','X')
WfrsRej = XLATE('WM_OUT',WMOutKey,'WFRS_REJ','X')
PartNo = obj_WM_Out('GetPartNoQtys',WMOutKey)<1> ; IF INDEX(PartNo,@VM,1) THEN PartNo = 'Multi'
LotNo = obj_WM_Out('GetLotNos',WMOutKey) ; IF INDEX(LotNo,@VM,1) THEN LotNo = 'Multi'
OrderItem = obj_WM_Out('GetOrderItems',WMOutKey) ; IF INDEX(OrderItem,@VM,1) THEN OrderItem = 'Multi'
END ELSE
RdsNo = RDSNos<1,I>
RDSRec = XLATE('RDS',RDSNo,'','X')
WfrsOut = XLATE('RDS',RDSNo,'WFRS_OUT','X')
WfrsRej = XLATE('RDS',RDSNo,'TOT_REJ','X')
PartNo = RDSRec<RDS_PART_NUM$>
LotNo = RDSRec<RDS_LOT_NUM$>
OrderItem = RDSRec<RDS_ORDER_ITEM$>
END
RDSList<I,COL$ORDER_NO> = OrderNo
RDSList<I,COL$LINE_NO> = OrderItem
RDSList<I,COL$STEP_NO> = WOStepNos<1,I>
RDSList<I,COL$CASS_NO> = CassNos<1,I>
RDSList<I,COL$RDS_NO> = RDSNo
RDSList<I,COL$PART_NO> = PartNo
RDSList<I,COL$LOT_NO> = LotNo
RDSList<I,COL$REJECT> = WfrsRej
RDSList<I,COL$WAFER_QTY> = WfrsOut
NEXT I
Set_Property(@WINDOW:'.CASSETTES','LIST',RDSList)
GOSUB Refresh
RETURN
* * * * * * *
Refresh:
* * * * * * *
CassList = Get_Property(@WINDOW:'.CASSETTES','LIST')
IF CassList<1,1> = '' THEN
Set_Property(@WINDOW:'.PRINT_LABEL_BUTTON','ENABLED',1)
Set_Property(@WINDOW:'.PACK_BUTTON','ENABLED',0)
END ELSE
Set_Property(@WINDOW:'.PRINT_LABEL_BUTTON','ENABLED',0)
Set_Property(@WINDOW:'.PACK_BUTTON','ENABLED',1)
END
CartonList = Get_Property(@WINDOW:'.CARTONS','LIST')
IF CartonList<1,1> = '' THEN
Set_Property(@WINDOW:'.UNPACK_BUTTON','ENABLED',0)
END ELSE
Set_Property(@WINDOW:'.UNPACK_BUTTON','ENABLED',1)
END
RETURN
* * * * * * *
PackCarton:
* * * * * * *
SelectedRows = Get_Property(@WINDOW:'.CASSETTES','SELPOS')<2> ;* Returns list of selected row numbers
CONVERT @VM TO @FM in SelectedRows
SelCnt = COUNT(SelectedRows,@FM) + (SelectedRows NE '')
IF SelCnt > 6 THEN
ErrMsg('Maximum of 6 cassettes per carton permitted.')
RETURN
END
IF SelCnt = 0 THEN RETURN
Cassettes = ''
FOR I = 1 TO SelCnt
Cassette = Get_Property(@WINDOW:'.CASSETTES','CELLPOS',0:@FM:SelectedRows<I>) ;* Retrive rows of data
Cassettes<-1> = Cassette
NEXT I
CONVERT @VM TO '|' IN Cassettes
CartonList = Get_Property(@WINDOW:'.CARTONS','LIST')
CartonCnt = COUNT(CartonList,@FM) + (CartonList NE '')
NextCartonNo = 1 ;* Find next empty carton number
LOOP
UNTIL CartonList<NextCartonNo,COL$CASS1> = ''
NextCartonNo += 1
REPEAT
IF NextCartonNo = CartonCnt THEN
Dummy = Send_Message(@WINDOW:'.CARTONS', "INSERT", -1, @VM:@VM:@VM:@VM:@VM)
END
Set_Property(@WINDOW:'.CARTONS','SELPOS',COL$CASS1:@FM:NextCartonNo)
Set_Property(@WINDOW:'.CARTONS','ROWDATA',Cassettes) ;* Fill carton with Cassette data
FOR I = SelCnt TO 1 STEP -1
Send_Message(@WINDOW:'.CASSETTES','DELETE',SelectedRows<I>) ;* Remove Cassette rows from list
NEXT I
GOSUB Refresh
RETURN
* * * * * * *
PackNext:
* * * * * * *
CartonPack = Get_Property(@WINDOW:'.CASS_PER_CARTON','TEXT')
IF CartonPack = '' THEN RETURN
SelColumns = ''
FOR I = 1 TO CartonPack
SelColumns<1,-1> = I
NEXT I
Set_Property(@WINDOW:'.CASSETTES','SELPOS',1:@FM:SelColumns)
GOTO PackCarton
RETURN
* * * * * * *
UnpackCarton:
* * * * * * *
CartonData = Get_Property(@WINDOW:'.CARTONS','ROWDATA')
CONVERT @VM TO @FM IN CartonData
CONVERT '|' TO @VM IN CartonData
CartonCnt = COUNT(CartonData,@VM) + (CartonData NE '')
CassList = Get_Property(@WINDOW:'.CASSETTES','LIST')
CassCnt = COUNT(CassList,@FM) + (CassList NE '')
CassSortArray = ''
FOR I = 1 TO CassCnt
SortKey = CassList<I,COL$ORDER_NO>:CassList<I,COL$LINE_NO>:CassList<I,COL$STEP_NO>:CassList<I,COL$CASS_NO>
UNTIL SortKey = '' ;* Found empty line
LOCATE SortKey IN CassSortArray BY 'AR' USING @VM SETTING Pos ELSE
CassSortArray = INSERT(CassSortArray,1,Pos,0,SortKey)
END
NEXT I
FOR I = 1 TO CartonCnt
SortKey = CartonData<I,COL$ORDER_NO>:CartonData<I,COL$LINE_NO>:CartonData<I,COL$STEP_NO>:CartonData<I,COL$CASS_NO>
UNTIL SortKey = ''
LOCATE SortKey IN CassSortArray BY 'AR' USING @VM SETTING Pos ELSE
CassSortArray = INSERT(CassSortArray,1,Pos,0,SortKey)
CassList = INSERT(CassList,Pos,0,0,CartonData<I>)
END
NEXT I
Set_Property(@WINDOW:'.CASSETTES','LIST',CassList) ;* Put cassettes back in the list of cassettes
CurrCartonRow = Get_Property(@WINDOW:'.CARTONS','SELPOS')<2>
Send_Message(@WINDOW:'.CARTONS','DELETE',CurrCartonRow) ;* Remove cassettes from carton
GOSUB Refresh
RETURN
* * * * * * *
PrintLabels:
* * * * * * *
CartonList = Get_Property(@WINDOW:'.CARTONS','LIST')
SWAP '|' WITH @SVM IN CartonList
* Strip out any blank columns or rows left from the edit table
CartonData = ''
CLCnt = COUNT(CartonList,@FM) + (CartonList NE '')
FOR I = 1 TO CLCnt
UNTIL CartonList<I,1> = ''
FOR N = 1 TO 6
UNTIL CartonList<I,N,1> = ''
CartonData<I,N> = CartonList<I,N>
NEXT N
NEXT I
End_Dialog(@WINDOW,CartonData)
RETURN
* * * * * * *
Cancel:
* * * * * * *
End_Dialog(@WINDOW,'Cancel')
RETURN

View File

@ -0,0 +1,699 @@
COMPILE FUNCTION Comm_Dialog_Cass_Met_Export(Method, Parm1)
/*
Commuter module for Dialog_Cass_Met_Exportwindow.
10/28/2005 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Send_Event, Set_Status, ErrMsg
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Btree.Extract, Msg, Send_Info
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Utility, Send_Message, Popup, Collect.IXVals, Msg
EQU CRLF$ TO \0D0A\
EQU COL$CUST_NO TO 1 ;* Customer edit table column equates
EQU COL$CUST_NAME TO 2
EQU LTGREY$ TO 229 + (229*256) + (229*65536) ;* JCH standard colors for edittable backgrounds
EQU GREY$ TO 192 + (192*256) + (192*65536)
EQU GREEN$ TO 192 + (220*256) + (192*65536)
EQU RED$ TO 255 + (128*256) + (128*65536)
EQU BLUE$ TO 128 + (255*256) + (255*65536)
EQU WHITE$ TO 255 + (255*256) + (255*65536)
EQU YELLOW$ TO 255 + (255*256) + (202*65536)
EQU LTBLUE$ TO 128 + (255*256) + (255*65536)
EQU PURPLE$ TO 225 + (181*256) + (255*65536)
EQU DTS_MULTIROW$ TO 512
EQU DTS_LARGEDATA$ TO 4096
$INSERT WM_OUT_EQUATES
$INSERT PS_EQUATES
$INSERT POPUP_EQUATES
$INSERT MSG_EQUATES
ErrTitle = 'Error in Comm_Dialog_Order_Find'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Method = 'Create' ; GOSUB Create
CASE Method = 'CustChar' ; GOSUB CustChar
CASE Method = 'CustPC' ; GOSUB CustPC
CASE Method = 'CustDC' ; GOSUB CustDC
CASE Method = 'CustPNDC' ; GOSUB CustPNDC
CASE Method = 'SubPNDC' ; GOSUB SubPNDC
CASE Method = 'LotNoDC' ; GOSUB LotNoDC
CASE Method = 'PSNoDC' ; GOSUB PSNoDC
CASE Method = 'WONoDC' ; GOSUB WONoDC
CASE Method = 'LUDate' ; GOSUB LUDate
CASE Method = 'Cancel' ; GOSUB Cancel
CASE Method = 'Refresh' ; GOSUB Refresh
CASE Method = 'PerformQuery' ; GOSUB PerformQuery
CASE 1
ErrMsg(ErrTitle:@SVM:'Unknown method ':QUOTE(Method):' passed to routine.')
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
obj_AppWindow('Create')
Set_Property(@WINDOW,'STATUSLINE',@WINDOW:'.STATUSLINE_FIX')
GOSUB Refresh
RETURN
* * * * * * *
Refresh:
* * * * * * *
* Turn edit table symbolic column backgrounds to green
stat = Send_Message(@WINDOW:'.CUST_INFO','COLOR_BY_POS',COL$CUST_NAME,0,GREEN$) ;* Turn names column all rows green
RETURN
* * * * * * *
CustChar:
* * * * * * *
CtrlName = @WINDOW:'.CUST_INFO'
CustArray = Get_Property(CtrlName,'ARRAY') ;* Customer Information table
CurrPos = Get_Property(CtrlName,'SELPOS')
CurrRow = CurrPos<2>
DataIn = CustArray<COL$CUST_NO,CurrRow>
IF LEN(DataIn) > 2 THEN
ReturnToCtrl = CtrlName
ReturnToPos = CurrPos
IF NOT(NUM(DataIn)) THEN
Set_Property(CtrlName,'CELLPOS','',CurrPos) ;* Clear characters input
Start_Window('COMP_LOOKUP',@WINDOW,DataIn:@VM:'C':@FM:ReturnToCtrl:@FM:ReturnToPos,'','')
END
END
RETURN
* * * * * * *
CustPC:
* * * * * * *
CtrlName = @WINDOW:'.CUST_INFO'
CustList = Get_Property(CtrlName,'LIST') ;* Customer Information table
CurrPos = Get_Property(CtrlName,'SELPOS')
CurrCol = CurrPos<1>
CurrRow = CurrPos<2>
CustNo = CustList<CurrRow,COL$CUST_NO>
IF CustNo NE '' THEN
Set_Property(CtrlName,'CELLPOS',XLATE('COMPANY',CustNo,4,'X'),COL$CUST_NAME:@FM:CurrRow)
END
RETURN
* * * * * * *
CustDC:
* * * * * * *
CtrlName = @WINDOW:'.CUST_INFO'
CustList = Get_Property(CtrlName,'LIST') ;* Customer Information table
CurrPos = Get_Property(CtrlName,'SELPOS')
CurrCol = CurrPos<1>
CurrRow = CurrPos<2>
CustNo = CustList<CurrRow,COL$CUST_NO>
LineCnt = COUNT(CustList,@FM) + (CustList NE '')
IF CustNo = '' THEN
CustNos = Popup(@WINDOW,'','CUSTOMER')
CustCnt = COUNT(CustNos,@VM) + (CustNos NE '')
IF CustCnt > LineCnt THEN
FOR I = 1 TO CustCnt
stat = Send_Message(CtrlName,'INSERT',-1,@VM:@FM) ; * Add blank lines
NEXT I
END
FOR I = CurrRow TO CurrRow + CustCnt
CustNo = CustNos<1,I>
CustName = XLATE('COMPANY',CustNo,4,'X')
Set_Property(CtrlName,'CELLPOS',CustNo,COL$CUST_NO:@FM:I)
Set_Property(CtrlName,'CELLPOS',CustName,COL$CUST_NAME:@FM:I)
Set_Property(CtrlName,'SELPOS',COL$CUST_NO:@FM:I+1)
NEXT I
END ELSE
ErrMsg('DoubleClick on the first empty Cust No field to view a popup of all Customers')
END
RETURN
* * * * * * *
SubPNDC:
* * * * * * *
CustArray = Get_Property(@WINDOW:'.CUST_INFO','ARRAY')<COL$CUST_NO>
CustNos = CustArray<COL$CUST_NO>
LOOP
LastCustNo = CustNos[-1,'B':@VM]
UNTIL LastCustNo NE '' OR CustNos = ''
CustNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF CustNos = '' THEN RETURN
* display the processing message and do the processing
Def = ""
Def<MTEXT$> = "Selecting Substrate Part Numbers..."
Def<MTYPE$> = "U"
MsgUp = Msg(@window, Def)
OPEN 'DICT.WO_LOG' TO DictVar THEN
SearchString = 'CUST_NO':@VM:CustNos:@VM:@FM
SearchString := 'SUB_PART_NO':@VM:'#':@FM
Btree.Extract(SearchString, 'WO_LOG', DictVar, WOKeys, '', Flag)
IF Get_Status(errCode) THEN
Msg(@WINDOW,MsgUp)
ErrMsg(errCode)
RETURN
END
IF WOKeys NE '' THEN
RawPartNos = XLATE('WO_LOG',WOKeys,'SUB_PART_NO','X') ;* Calculated field
IF Get_Status(errCode) THEN DEBUG
PartNos = ''
FOR I = 1 TO COUNT(RawPartNos,@VM) + (RawPartNos NE '')
RawPartNo = RawPartNos<1,I>
LOCATE RawPartNo IN PartNos BY 'AL' USING @VM SETTING Pos ELSE
PartNos = INSERT(PartNos,1,Pos,0,RawPartNo)
END
NEXT I
END ELSE
PartNos = ''
END
Msg(@WINDOW,MsgUp)
IF PartNos = '' THEN
ErrMsg('No Substrate Part Numbers on file for specified customer.')
RETURN
END
PartNos := @VM
CONVERT @VM TO @RM IN PartNos
CALL V119('S','','D','R',PartNos,'')
IF Get_Status(errCode) THEN DEBUG
CONVERT @RM TO @VM IN PartNos
PartNos[-1,1] = '' ;* Strip trailing delimiter
TypeOver = ''
TypeOver<PDISPLAY$> = PartNos
PartNos = Popup(@WINDow,TypeOver,'CUST_PO') ;****** Need a popup
IF Get_Status(errCode) THEN DEBUG
IF PartNos NE '' THEN
Set_Property(@WINDOW:'.SUB_PART_NO','DEFPROP',PartNos)
END
END ELSE
ErrMsg('Unable to open DICT.WO_LOG in COMM_DIALOG_WO_LOG_FIND.')
END
RETURN
* * * * * * *
LotNoDC:
* * * * * * *
CustNos = Get_Property(@WINDOW:'.CUST_INFO','ARRAY')<COL$CUST_NO>
LOOP
LastCustNo = CustNos[-1,'B':@VM]
UNTIL LastCustNo NE '' OR CustNos = ''
CustNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF CustNos = '' THEN RETURN
* display the processing message and do the processing
Def = ""
Def<MTEXT$> = "Selecting Lot Numbers..."
Def<MTYPE$> = "U"
MsgUp = Msg(@window, Def)
OPEN 'DICT.WO_LOG' TO DictVar THEN
SearchString = 'CUST_NO':@VM:CustNos:@VM:@FM
SearchString := 'LOT_NO':@VM:'#':@FM
Btree.Extract(SearchString, 'WO_LOG', DictVar, WOKeys, '', Flag)
IF Get_Status(errCode) THEN
Msg(@WINDOW,MsgUp)
ErrMsg(errCode)
RETURN
END
IF WOKeys NE '' THEN
RawLotNos = XLATE('WO_LOG',WOKeys,'LOT_NO','X') ;* Calculated field
IF Get_Status(errCode) THEN DEBUG
LotNos = ''
FOR I = 1 TO COUNT(RawLotNos,@VM) + (RawLotNos NE '')
RawLotNo = RawLotNos<1,I>
LOCATE RawLotNo IN LotNos BY 'AL' USING @VM SETTING Pos ELSE
LotNos = INSERT(LotNos,1,Pos,0,RawLotNo)
END
NEXT I
END ELSE
LotNos = ''
END
Msg(@WINDOW,MsgUp)
IF LotNos = '' THEN
ErrMsg('No Lot Numbers on file for specified customer.')
RETURN
END
LotNos := @VM
CONVERT @VM TO @RM IN LotNos
CALL V119('S','','D','R',LotNos,'')
IF Get_Status(errCode) THEN DEBUG
CONVERT @RM TO @VM IN LotNos
LotNos[-1,1] = '' ;* Strip trailing delimiter
TypeOver = ''
TypeOver<PDISPLAY$> = LotNos
LotNos = Popup(@WINDow,TypeOver,'CUST_PO') ;****** Need a popup
IF Get_Status(errCode) THEN DEBUG
IF LotNos NE '' THEN
Set_Property(@WINDOW:'.LOT_NO','DEFPROP',LotNos)
END
END ELSE
ErrMsg('Unable to open DICT.WO_LOG in COMM_DIALOG_WO_LOG_FIND.')
END
RETURN
* * * * * * *
PSNoDC:
* * * * * * *
CustArray = Get_Property(@WINDOW:'.CUST_INFO','ARRAY')
CustNos = CustArray<COL$CUST_NO>
LOOP
LastCustNo = CustNos[-1,'B':@VM]
UNTIL LastCustNo NE '' OR CustNos = ''
CustNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF CustNos = '' THEN RETURN
* display the processing message and do the processing
Def = ""
Def<MTEXT$> = "Selecting Product Specifications..."
Def<MTYPE$> = "U"
MsgUp = Msg(@window, Def)
OPEN 'DICT.WO_LOG' TO DictVar THEN
SearchString = 'CUST_NO':@VM:CustNos:@VM:@FM
SearchString := 'PS_NO':@VM:'#':@FM
Btree.Extract(SearchString, 'WO_LOG', DictVar, WOKeys, '', Flag)
IF Get_Status(errCode) THEN
Msg(@WINDOW,MsgUp)
ErrMsg(errCode)
RETURN
END
IF WOKeys NE '' THEN
PSNs = ''
FOR N = 1 TO COUNT(WOKeys,@VM) + (WOKeys NE '')
WOKey = WOKeys<1,N>
RawPSNs = XLATE('WO_LOG',WOKey,'PS_NO','X')
FOR I = 1 TO COUNT(RawPSNs,@VM) + (RawPSNs NE '')
RawPSN = RawPSNs<1,I>
LOCATE RawPSN IN PSNs BY 'AL' USING @VM SETTING Pos ELSE
PSNs = INSERT(PSNs,1,Pos,0,RawPSN)
END
NEXT I
NEXT N
END ELSE
PSNs = ''
END
Msg(@WINDOW,MsgUp)
IF PSNs = '' THEN
ErrMsg('No Product Specifications on file for specified customer.')
RETURN
END
PSNs := @VM
CONVERT @VM TO @RM IN PSNs
CALL V119('S','','D','R',PSNs,'')
IF Get_Status(errCode) THEN DEBUG
CONVERT @RM TO @VM IN PSNs
PSNs[-1,1] = '' ;* Strip trailing delimiter
TypeOver = ''
TypeOver<PDISPLAY$> = PSNs
PSNs = Popup(@WINDow,TypeOver,'CUST_PO')
IF Get_Status(errCode) THEN DEBUG
IF PSNs NE '' THEN
CONVERT @VM TO @FM IN PSNs
Set_Property(@WINDOW:'.PS_NO','LIST',PSNs)
END
END ELSE
ErrMsg('Unable to open DICT.WO_LOG in COMM_DIALOG_WO_LOG_FIND.')
END
RETURN
* * * * * * *
WONoDC:
* * * * * * *
WOKeys = Collect.IXVals('WM_OUT', 'WO_NO')
CONVERT @FM TO @VM IN WOKeys
IF Get_Status(errCode) THEN ErrMsg(ErrCode)
IF WOKeys NE '' THEN
TypeOver = ''
TypeOver<PDISPLAY$> = WOKeys
TypeOver<PMODE$> = 'K'
WOKeys = Popup(@WINDOW,TypeOver,'WO_LOG_QUERY')
IF Get_Status(errCode) THEN
ErrMsg(errCode)
END
IF WOKeys NE '' THEN
CONVERT @VM TO @FM IN WOKeys
Set_Property(@WINDOW:'.WO_NO','LIST',WOKeys)
END
END
RETURN
* * * * * * *
CustPNDC:
* * * * * * *
CustArray = Get_Property(@WINDOW:'.CUST_INFO','ARRAY')
CustNos = CustArray<COL$CUST_NO>
LOOP
LastCustNo = CustNos[-1,'B':@VM]
UNTIL LastCustNo NE '' OR CustNos = ''
CustNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF CustNos = '' THEN RETURN
* display the processing message and do the processing
Def = ""
Def<MTEXT$> = "Selecting Part Numbers..."
Def<MTYPE$> = "U"
MsgUp = Msg(@window, Def)
OPEN 'DICT.WO_LOG' TO DictVar THEN
SearchString = 'CUST_NO':@VM:CustNos:@VM:@FM
SearchString := 'CUST_PART_NO':@VM:'#':@FM
Btree.Extract(SearchString, 'WO_LOG', DictVar, WOKeys, '', Flag)
IF Get_Status(errCode) THEN
Msg(@WINDOW,MsgUp)
ErrMsg(errCode)
RETURN
END
IF WOKeys NE '' THEN
PartNos = ''
FOR N = 1 TO COUNT(WOKeys,@VM) + (WOKeys NE '')
WOKey = WOKeys<1,N>
RawPartNos = XLATE('WO_LOG',WOKey,'PART_NO','X')
FOR I = 1 TO COUNT(RawPartNos,@VM) + (RawPartNos NE '')
RawPartNo = RawPartNos<1,I>
LOCATE RawPartNo IN PartNos BY 'AL' USING @VM SETTING Pos ELSE
PartNos = INSERT(PartNos,1,Pos,0,RawPartNo)
END
NEXT I
NEXT N
END ELSE
PartNos = ''
END
Msg(@WINDOW,MsgUp)
IF PartNos = '' THEN
ErrMsg('No Customer Part Numbers on file for specified customer.')
RETURN
END
PartNos := @VM
CONVERT @VM TO @RM IN PartNos
CALL V119('S','','D','R',PartNos,'')
IF Get_Status(errCode) THEN DEBUG
CONVERT @RM TO @VM IN PartNos
PartNos[-1,1] = '' ;* Strip trailing delimiter
TypeOver = ''
TypeOver<PDISPLAY$> = PartNos
PartNos = Popup(@WINDow,TypeOver,'CUST_PO') ;* Needs a popup
IF Get_Status(errCode) THEN DEBUG
IF PartNos NE '' THEN
Set_Property(@WINDOW:'.CUST_PART_NO','DEFPROP',PartNos)
END
END ELSE
ErrMsg('Unable to open DICT.WO_LOG in COMM_DIALOG_WO_LOG_FIND.')
END
RETURN
* * * * * * *
LUDate:
* * * * * * *
ReturnCtrl = Parm1[1,@RM]
IF ReturnCtrl = '' THEN ReturnCtrl = Get_Property(@WINDOW,'FOCUS')
DateSelected = Dialog_Box('POPUP_YEAR',@WINDOW)
RetVal = OCONV(DateSelected, 'D4/')
IF RetVal NE '' THEN
obj_Appwindow('LUValReturn',RetVal:@RM:ReturnCtrl)
END
RETURN
* * * * * * *
Cancel:
* * * * * * *
RETURN
* * * * * * *
PerformQuery:
* * * * * * *
* Customer numbers *
SearchString = 'MAKEUP_BOX':@VM:'0':@VM:'':@FM
CustNos = Get_Property(@WINDOW:'.CUST_INFO','ARRAY')<COL$CUST_NO>
LOOP
LastVar = CustNos[-1,'B':@VM]
UNTIL LastVar NE '' OR CustNos = ''
CustNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF CustNos NE '' THEN SearchString := 'CUST_NO':@VM:CustNos:@FM
* LotNumbers *
LotNos = Get_Property(@WINDOW:'.LOT_NO','ARRAY')<1>
LOOP
LastVal = LotNos[-1,'B':@VM]
UNTIL LastVal NE '' OR LotNos = ''
LotNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF LotNos NE '' THEN SearchString := 'LOT_NO':@VM:LotNos:@FM
* Cust Part Number *
CustPNs = Get_Property(@WINDOW:'.CUST_PART_NO','ARRAY')<1>
LOOP
LastVal = CustPNs[-1,'B':@VM]
UNTIL LastVal NE '' OR CustPNs = ''
CustPNS[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF CustPNs NE '' THEN SearchString := 'CUST_PART_NO':@VM:CustPNs:@FM
* Substrate Part Numbers *
SubPartNos = Get_Property(@WINDOW:'.SUB_PART_NO','ARRAY')<1>
LOOP
LastVal = SubPartNos[-1,'B':@VM]
UNTIL LastVal NE '' OR SubPartNos = ''
SubPartNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF SubPartNos NE '' THEN SearchString := 'SUB_PART_NO':@VM:SubPartNos:@FM
* PSN Nos *
PS_NOs = Get_Property(@WINDOW:'.PS_NO','ARRAY')<1>
LOOP
LastVal = PS_NOs[-1,'B':@VM]
UNTIL LastVal NE '' OR PS_NOs = ''
PS_NOs[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF PS_NOs NE '' THEN SearchString := 'SHIP_PSN':@VM:PS_NOs:@FM
* WO Nos *
WO_NOs = Get_Property(@WINDOW:'.WO_NO','ARRAY')<1>
LOOP
LastVal = WO_NOs[-1,'B':@VM]
UNTIL LastVal NE '' OR WO_NOs = ''
WO_NOs[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF WO_NOs NE '' THEN SearchString := 'WO_NO':@VM:WO_NOs:@FM
* Entry Dates *
StartDt = ICONV(Get_Property(@WINDOW:'.START_DT','TEXT'),'D')
EndDt = ICONV(Get_Property(@WINDOW:'.END_DT','TEXT'),'D')
BEGIN CASE
CASE StartDt NE '' AND EndDt = ''
SearchString := 'RDS_FINAL_SIG_DT':@VM:'>=':OConv(StartDt, 'D4/'):@FM
CASE StartDt = '' AND EndDt NE ''
SearchString := 'RDS_FINAL_SIG_DT':@VM:'<=':OConv(EndDt, 'D4/'):@FM
CASE StartDt NE '' AND EndDt NE ''
* Fudge the dates - '~' is not inclusive of the end dates
StartDt -= 1
EndDt += 1
SearchString := 'RDS_FINAL_SIG_DT':@VM:OConv(StartDt, 'D4/'):'~':OConv(EndDt, 'D4/'):@FM
CASE 1
NULL
END CASE
OPEN 'DICT.WO_MAT' TO DictVar THEN
Def = ""
Def<MTEXT$> = "Selecting WO_MAT Recrods..."
Def<MTYPE$> = "U"
* display the processing message and do the processing
MsgUp = Msg(@window, Def)
Btree.Extract(SearchString,'WO_MAT',DictVar,WMOKeys,'',flag)
IF Get_Status(errCode) THEN ErrMsg(errCode)
Msg(@window, MsgUp)
IF Get_Status(errCode) THEN
ErrMsg(errCode)
RETURN
END
End_Dialog(@WINDOW,WMOKeys)
END ELSE
ErrMsg('Unable to open DICT.WO_MAT in routine COMM_DIALOG_CASS_MET_EXPORT')
END
RETURN

View File

@ -0,0 +1,149 @@
COMPILE FUNCTION Comm_Dialog_Cass_Qty_Change(Method, Parm1)
/*
Commuter module for Dialog_Cass_Qty_Change window.
06/06/2004 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Set_Status, ErrMsg
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Msg
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Popup
EQU CRLF$ TO \0D0A\
EQU COL$CASS_NO TO 1
EQU COL$BATCH_NO TO 2
EQU COL$LOT_NO TO 3
EQU COL$CURR_QTY TO 4
EQU COL$CUST_PART_NO TO 5
$INSERT POPUP_EQUATES
$INSERT LOGICAL
$INSERT WO_MAT_EQUATES
ErrTitle = 'Error in Comm_Dialog_Cass_Qty_Chg'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Method = 'Create' ; GOSUB Create
CASE Method = 'OK' ; GOSUB OK
CASE Method = 'Cancel' ; GOSUB Cancel
CASE Method = 'Refresh' ; GOSUB Refresh
CASE 1
ErrMsg(ErrTitle:@SVM:'Unknown method ':QUOTE(Method):' passed to routine.')
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
obj_AppWindow('Create')
WONo = Parm1[1,@FM]
CassKeys = Parm1[COL2()+1,@FM]
Title = 'Work Order: ':WONo:' - Cassette Qty Change'
Set_Property(@WINDOW,'TEXT',Title)
CassCnt = COUNT(CassKeys,@VM) + (CassKeys NE '')
CassettesList = ''
FOR I = 1 TO CassCnt
CassKey = CassKeys<1,I>
WOMatRec = XLATE('WO_MAT',CassKey,'','X')
CassettesList<I,1> = CassKey[-1,'B*']
CassettesList<I,2> = WOMatRec<WO_MAT_SAP_BATCH_NO$>
CassettesList<I,3> = WOMatRec<WO_MAT_LOT_NO$>
CassettesList<I,4> = WOMatRec<WO_MAT_WAFER_QTY$>
CassettesList<I,5> = WOMatRec<WO_MAT_CUST_PART_NO$>
NEXT I
Set_Property(@WINDOW:'.CASSETTES','LIST',CassettesList)
RETURN
* * * * * * *
Refresh:
* * * * * * *
RETURN
* * * * * * *
Close:
* * * * * * *
End_Dialog(@WINDOW,'Cancel')
RETURN
* * * * * * *
Cancel:
* * * * * * *
End_Dialog(@WINDOW,'Cancel')
RETURN
* * * * * * *
OK:
* * * * * * *
Ctrls = @WINDOW:'.CASSETTES':@RM ; Props = 'SELPOS':@RM
Ctrls := @WINDOW:'.CASSETTES':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.NEW_CASS_QTY':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.REASON' ; Props := 'DEFPROP'
Vals = Get_Property(Ctrls,Props)
SelCassette = Vals[1,@RM]
CassArray = Vals[COL2()+1,@RM]
NewCassQty = Vals[COL2()+1,@RM]
Reason = Vals[COL2()+1,@RM]
IF SelCassette = '' THEN
ErrMsg('You must select a cassette to change!')
Set_Property(@WINDOW,'FOCUS',@WINDOW:'.CASSETTES')
RETURN
END
IF NewCassQty = '' THEN
ErrMsg('New Cassette Qty is a required field and must be filled in.')
Set_Property(@WINDOW,'FOCUS',@WINDOW:'.NEW_CASS_QTY')
RETURN
END
IF Reason = '' THEN
ErrMsg('Reason is a required field and must be filled in.')
Set_Property(@WINDOW,'FOCUS',@WINDOW:'.REVISION')
RETURN
END
SelectedLine = SelCassette<2>
CassNo = CassArray<COL$CASS_NO,SelectedLine>
OrgCassQty = CassArray<COL$CURR_QTY,SelectedLine>
Result = CassNo:@FM:Reason:@FM:OrgCassQty:@FM:NewCassQty
End_Dialog(@WINDOW,Result)
RETURN

View File

@ -0,0 +1,91 @@
COMPILE FUNCTION Comm_Dialog_Change_Log(Method, Parm1)
/*
Commuter module for Dialog_Change_Log window.
07/13/2005 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Set_Status, ErrMsg
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Msg, Send_Event, Btree.Extract
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Popup
EQU CRLF$ TO \0D0A\
$INSERT POPUP_EQUATES
ErrTitle = 'Error in Comm_Dialog_Change_Log'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Method = 'Create' ; GOSUB Create
CASE Method = 'RecentChanges' ; GOSUB RecentChanges
CASE 1
ErrMsg(ErrTitle:@SVM:'Unknown method ':QUOTE(Method):' passed to routine.')
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
obj_AppWindow('Create')
Send_Event(@WINDOW:'.ORDER_CHANGES','CLICK')
RETURN
* * * * * * *
RecentChanges:
* * * * * * *
OPEN 'DICT.ORDER_CHANGE' TO DictVar ELSE
Errmsg('Unable to open "DICT.ORDER_CHANGE" for index lookup')
RETURN
END
SearchString = 'TS_DT':@VM:'>=':OCONV(Date()-90,'D4/'):@FM
option = ''
flag = ''
Btree.Extract(SearchString, 'ORDER_CHANGE', DictVar, OCKeys, option, flag)
IF Get_Status(errCode) THEN
ErrMsg(errCode)
RETURN
END
IF OCKeys = '' THEN RETURN
OCKeys := @VM
CONVERT @VM TO @RM IN OCKeys
CALL V119('S','','D','R',OCKeys,'')
IF Get_Status(errCode) THEN DEBUG
CONVERT @RM TO @VM IN OCKeys
OCKeys[-1,1] = '' ;* Strip trailing delimiter
TypeOver = ''
TypeOver<PDISPLAY$> = OCkeys
OrderNo = Popup(@WINDOW,TypeOver,'ORDER_CHANGE_LOG')
IF OrderNo NE '' THEN
obj_Appwindow('ViewRelated','ORDER2':@RM:OrderNo)
END
RETURN

View File

@ -0,0 +1,781 @@
COMPILE FUNCTION Comm_Dialog_COC_Query(Method, Parm1)
/*
Commuter module for Dialog_COC_Query window.
10/28/2005 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Set_Status, ErrMsg
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Msg, Btree.Extract, Comm_Dialog_Order_Find
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Popup, Utility, Key_Sort, Msg, Send_Message
EQU CRLF$ TO \0D0A\
EQU COL$CUST_NO TO 1 ;* Customer edit table column equates
EQU COL$CUST_NAME TO 2
EQU DTS_MULTIROW$ TO 512
EQU DTS_LARGEDATA$ TO 4096
$INSERT POPUP_EQUATES
$INSERT LOGICAL
$INSERT MSG_EQUATES
$INSERT COC_EQU
$INSERT APPCOLORS
ErrTitle = 'Error in Comm_Dialog_COC_Query'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Method = 'Create' ; GOSUB Create
CASE Method = 'CustChar' ; GOSUB CustChar
CASE Method = 'CustPC' ; GOSUB CustPC
CASE Method = 'CustDC' ; GOSUB CustDC
CASE Method = 'WONoDC' ; GOSUB WONoDC
CASE Method = 'PONoDC' ; GOSUB PONoDC
CASE Method = 'LotDC' ; GOSUB LotDC
CASE Method = 'PartDC' ; GOSUB PartDC
CASE Method = 'LUDate' ; GOSUB LUDate
CASE Method = 'PerformQuery' ; GOSUB PerformQuery
CASE Method = 'Cancel' ; GOSUB Cancel
CASE Method = 'SelectStatusCodes' ; GOSUB SelectStatusCodes
CASE 1
ErrMsg(ErrTitle:@SVM:'Unknown method ':QUOTE(Method):' passed to routine.')
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
obj_AppWindow('Create')
Set_Property(@WINDOW:'.USER_ID','INVALUE',@USER4)
* * * * * * *
Refresh:
* * * * * * *
* Turn edit table symbolic column backgrounds to green
stat = Send_Message(@WINDOW:'.CUST_INFO','COLOR_BY_POS',2,0,GREEN$) ;* Turn names column all rows green
stat = Send_Message(@WINDOW:'.CURR_STATUS','COLOR_BY_POS',2,0,GREEN$) ;* Turn names column all rows green
RETURN
* * * * * * *
CustChar:
* * * * * * *
CtrlName = @WINDOW:'.CUST_INFO'
CustArray = Get_Property(CtrlName,'ARRAY') ;* Customer Information table
CurrPos = Get_Property(CtrlName,'SELPOS')
CurrRow = CurrPos<2>
DataIn = CustArray<COL$CUST_NO,CurrRow>
IF LEN(DataIn) > 2 THEN
ReturnToCtrl = CtrlName
ReturnToPos = CurrPos
IF NOT(NUM(DataIn)) THEN
Set_Property(CtrlName,'CELLPOS','',CurrPos) ;* Clear characters input
Start_Window('COMP_LOOKUP',@WINDOW,DataIn:@VM:'C':@FM:ReturnToCtrl:@FM:ReturnToPos,'','')
END
END
RETURN
* * * * * * *
CustPC:
* * * * * * *
CtrlName = @WINDOW:'.CUST_INFO'
CustList = Get_Property(CtrlName,'LIST') ;* Customer Information table
CurrPos = Get_Property(CtrlName,'SELPOS')
CurrCol = CurrPos<1>
CurrRow = CurrPos<2>
CustNo = CustList<CurrRow,COL$CUST_NO>
IF CustNo NE '' THEN
Set_Property(CtrlName,'CELLPOS',XLATE('COMPANY',CustNo,4,'X'),COL$CUST_NAME:@FM:CurrRow)
END
RETURN
* * * * * * *
CustDC:
* * * * * * *
CtrlName = @WINDOW:'.CUST_INFO'
CustList = Get_Property(CtrlName,'LIST') ;* Customer Information table
CurrPos = Get_Property(CtrlName,'SELPOS')
CurrCol = CurrPos<1>
CurrRow = CurrPos<2>
CustNo = CustList<CurrRow,COL$CUST_NO>
LineCnt = COUNT(CustList,@FM) + (CustList NE '')
IF CustNo = '' THEN
CustNos = Popup(@WINDOW,'','CUSTOMER')
CustCnt = COUNT(CustNos,@VM) + (CustNos NE '')
IF CustCnt > LineCnt THEN
FOR I = 1 TO CustCnt
stat = Send_Message(CtrlName,'INSERT',-1,@VM:@FM) ; * Add blank lines
NEXT I
END
FOR I = CurrRow TO CurrRow + CustCnt
CustNo = CustNos<1,I>
CustName = XLATE('COMPANY',CustNo,4,'X')
Set_Property(CtrlName,'CELLPOS',CustNo,COL$CUST_NO:@FM:I)
Set_Property(CtrlName,'CELLPOS',CustName,COL$CUST_NAME:@FM:I)
Set_Property(CtrlName,'SELPOS',COL$CUST_NO:@FM:I+1)
NEXT I
END ELSE
ErrMsg('DoubleClick on the first empty Cust No field to view a popup of all Customers')
END
RETURN
* * * * * * *
PONoDC:
* * * * * * *
CustArray = Get_Property(@WINDOW:'.CUST_INFO','ARRAY')<COL$CUST_NO>
CustNos = CustArray<COL$CUST_NO>
LOOP
LastCustNo = CustNos[-1,'B':@VM]
UNTIL LastCustNo NE '' OR CustNos = ''
CustNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF CustNos = '' THEN RETURN
* display the processing message and do the processing
Def = ""
Def<MTEXT$> = "Selecting PO Numbers..."
Def<MTYPE$> = "U"
MsgUp = Msg(@window, Def)
OPEN 'DICT.ORDER' TO DictVar THEN
SearchString = 'CUST_NO':@VM:CustNos:@VM:@FM
SearchString := 'PO_NO':@VM:'#':@FM
Btree.Extract(SearchString, 'ORDER', DictVar, OrderKeys, '', Flag)
IF Get_Status(errCode) THEN
Msg(@WINDOW,MsgUp)
ErrMsg(errCode)
RETURN
END
IF OrderKeys NE '' THEN
RawPONos = XLATE('ORDER',OrderKeys,ORDER_PO_NO$,'X')
IF Get_Status(errCode) THEN DEBUG
PONos = ''
FOR I = 1 TO COUNT(RawPONos,@VM) + (RawPONos NE '')
RawPONo = RawPONos<1,I>
LOCATE RawPONo IN PONos BY 'AL' USING @VM SETTING Pos ELSE
PONos = INSERT(PONos,1,Pos,0,RawPONo)
END
NEXT I
END ELSE
PONos = ''
END
Msg(@WINDOW,MsgUp)
IF PONos = '' THEN
ErrMsg('No Purchase Orders on file for specified customer.')
RETURN
END
PONos := @VM
CONVERT @VM TO @RM IN PONos
CALL V119('S','','D','R',PONos,'')
IF Get_Status(errCode) THEN DEBUG
CONVERT @RM TO @VM IN PONos
PONos[-1,1] = '' ;* Strip trailing delimiter
TypeOver = ''
TypeOver<PDISPLAY$> = PONos
PONos = Popup(@WINDow,TypeOver,'CUST_PO')
IF Get_Status(errCode) THEN DEBUG
IF PONos NE '' THEN
PONos := @VM:@VM
Set_Property(@WINDOW:'.PO_NO','DEFPROP',PONos)
END
END ELSE
ErrMsg('Unable to open DICT.ORDER in COMM_DIALOG_ORDER_FIND.')
END
RETURN
* * * * * * *
WONoDC:
* * * * * * *
DEBUG
CustArray = Get_Property(@WINDOW:'.CUST_INFO','ARRAY')<COL$CUST_NO>
CustNos = CustArray<COL$CUST_NO>
LOOP
LastCustNo = CustNos[-1,'B':@VM]
UNTIL LastCustNo NE '' OR CustNos = ''
CustNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF CustNos = '' THEN RETURN
* display the processing message and do the processing
Def = ""
Def<MTEXT$> = "Selecting Work Order Numbers..."
Def<MTYPE$> = "U"
MsgUp = Msg(@window, Def)
OPEN 'DICT.COC' TO DictVar THEN
SearchString = 'CUST_NO':@VM:CustNos:@VM:@FM
SearchString := 'WO':@VM:'#':@FM
Btree.Extract(SearchString, 'COC', DictVar, ShipmentKeys, '', Flag)
IF Get_Status(errCode) THEN
Msg(@WINDOW,MsgUp)
ErrMsg(errCode)
RETURN
END
IF ShipmentKeys NE '' THEN
RawWONos = XLATE('COC',ShipmentKeys,COC_WO$,'X')
IF Get_Status(errCode) THEN DEBUG
WONos = ''
FOR I = 1 TO COUNT(RawWONos,@VM) + (RawWONos NE '')
RawWONo = RawWONos<1,I>
LOCATE RawWONo IN WONos BY 'AL' USING @VM SETTING Pos ELSE
WONos = INSERT(WONos,1,Pos,0,RawWONo)
END
NEXT I
END ELSE
WONos = ''
END
Msg(@WINDOW,MsgUp)
IF WONos = '' THEN
ErrMsg('No Work Orders on file for specified customer.')
RETURN
END
WONos := @VM
CONVERT @VM TO @RM IN WONos
CALL V119('S','','D','R',WONos,'')
IF Get_Status(errCode) THEN DEBUG
CONVERT @RM TO @VM IN WONos
WONos[-1,1] = '' ;* Strip trailing delimiter
TypeOver = ''
TypeOver<PDISPLAY$> = WONos
WONos = Popup(@WINDow,TypeOver,'CUST_PO')
IF Get_Status(errCode) THEN DEBUG
IF WONos NE '' THEN
WONos := @VM:@VM
Set_Property(@WINDOW:'.WO_NO','DEFPROP',WONos)
END
END ELSE
ErrMsg('Unable to open DICT.COC in COMM_DIALOG_COC_QUERY.')
END
RETURN
* * * * * * *
LotDC:
* * * * * * *
DEBUG
CustArray = Get_Property(@WINDOW:'.CUST_INFO','ARRAY')<COL$CUST_NO>
CustNos = CustArray<COL$CUST_NO>
LOOP
LastCustNo = CustNos[-1,'B':@VM]
UNTIL LastCustNo NE '' OR CustNos = ''
CustNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF CustNos = '' THEN RETURN
* display the processing message and do the processing
Def = ""
Def<MTEXT$> = "Selecting PO Numbers..."
Def<MTYPE$> = "U"
MsgUp = Msg(@window, Def)
OPEN 'DICT.ORDER' TO DictVar THEN
SearchString = 'CUST_NO':@VM:CustNos:@VM:@FM
SearchString := 'PO_NO':@VM:'#':@FM
Btree.Extract(SearchString, 'ORDER', DictVar, OrderKeys, '', Flag)
IF Get_Status(errCode) THEN
Msg(@WINDOW,MsgUp)
ErrMsg(errCode)
RETURN
END
IF OrderKeys NE '' THEN
RawPONos = XLATE('ORDER',OrderKeys,ORDER_PO_NO$,'X')
IF Get_Status(errCode) THEN DEBUG
PONos = ''
FOR I = 1 TO COUNT(RawPONos,@VM) + (RawPONos NE '')
RawPONo = RawPONos<1,I>
LOCATE RawPONo IN PONos BY 'AL' USING @VM SETTING Pos ELSE
PONos = INSERT(PONos,1,Pos,0,RawPONo)
END
NEXT I
END ELSE
PONos = ''
END
Msg(@WINDOW,MsgUp)
IF PONos = '' THEN
ErrMsg('No Purchase Orders on file for specified customer.')
RETURN
END
PONos := @VM
CONVERT @VM TO @RM IN PONos
CALL V119('S','','D','R',PONos,'')
IF Get_Status(errCode) THEN DEBUG
CONVERT @RM TO @VM IN PONos
PONos[-1,1] = '' ;* Strip trailing delimiter
TypeOver = ''
TypeOver<PDISPLAY$> = PONos
PONos = Popup(@WINDow,TypeOver,'CUST_PO')
IF Get_Status(errCode) THEN DEBUG
IF PONos NE '' THEN
PONos := @VM:@VM
Set_Property(@WINDOW:'.PO_NO','DEFPROP',PONos)
END
END ELSE
ErrMsg('Unable to open DICT.ORDER in COMM_DIALOG_ORDER_FIND.')
END
RETURN
* * * * * * *
PartDC:
* * * * * * *
DEBUG
CustArray = Get_Property(@WINDOW:'.CUST_INFO','ARRAY')
CustNos = CustArray<COL$CUST_NO>
LOOP
LastCustNo = CustNos[-1,'B':@VM]
UNTIL LastCustNo NE '' OR CustNos = ''
CustNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF CustNos = '' THEN RETURN
* display the processing message and do the processing
Def = ""
Def<MTEXT$> = "Selecting Part Numbers..."
Def<MTYPE$> = "U"
MsgUp = Msg(@window, Def)
OPEN 'DICT.WO_LOG' TO DictVar THEN
SearchString = 'CUST_NO':@VM:CustNos:@VM:@FM
SearchString := 'PART_NO':@VM:'#':@FM
Btree.Extract(SearchString, 'WO_LOG', DictVar, WOKeys, '', Flag)
IF Get_Status(errCode) THEN
Msg(@WINDOW,MsgUp)
ErrMsg(errCode)
RETURN
END
IF WOKeys NE '' THEN
PartNos = ''
OrderNos = ''
FOR N = 1 TO COUNT(WOKeys,@VM) + (WOKeys NE '')
WOKey = WOKeys<1,N>
RawPartNos = XLATE('WO_LOG',WOKey,'PART_NO','X')
OrderNo = XLATE('WO_LOG',WOKey,WO_LOG_ORDER_NO$,'X')
FOR I = 1 TO COUNT(RawPartNos,@VM) + (RawPartNos NE '')
RawPartNo = RawPartNos<1,I>
LOCATE RawPartNo IN PartNos BY 'AL' USING @VM SETTING Pos ELSE
PartNos = INSERT(PartNos,1,Pos,0,RawPartNo)
END
LOCATE OrderNo IN OrderNos<Pos> BY 'DR' USING @VM SETTING OPos ELSE
OrderNos = INSERT(OrderNos,Pos,OPos,0,OrderNo)
END
NEXT I
NEXT N
END ELSE
PartNos = ''
END
Msg(@WINDOW,MsgUp)
IF PartNos = '' THEN
ErrMsg('No Purchase Orders on file for specified customer.')
RETURN
END
PartNos := @VM
CONVERT @VM TO @RM IN PartNos
CALL V119('S','','D','R',PartNos,'')
IF Get_Status(errCode) THEN DEBUG
CONVERT @RM TO @VM IN PartNos
PartNos[-1,1] = '' ;* Strip trailing delimiter
TypeOver = ''
TypeOver<PDISPLAY$> = PartNos
PartNos = Popup(@WINDow,TypeOver,'CUST_PO')
IF Get_Status(errCode) THEN DEBUG
IF PartNos NE '' THEN
debug
END
END ELSE
ErrMsg('Unable to open DICT.WO_LOG in COMM_DIALOG_ORDER_FIND.')
END
RETURN
* * * * * * *
SelectStatusCodes:
* * * * * * *
ReturnCtrl = @WINDOW:'.CURR_STATUS'
TypeOver = ''
TypeOver<PSELECT$> = 2 ;* Multiple select
StatusCodes = Popup(@WINDOW,TypeOver,'RDS_CURR_STATUS')
IF StatusCodes NE '' THEN
ExistingArray = ''
FOR I = 1 TO COUNT(StatusCodes,@VM) + (StatusCodes NE '') + 1
ExistingArray<1,I> = StatusCodes<1,I>
ExistingArray<2,I> = OCONV(StatusCodes<1,I>,'[RDS_CURR_STATUS_CONV]')
NEXT I
Set_Property(@WINDOW:'.CURR_STATUS','DEFPROP',ExistingArray)
END
GOSUB Refresh
RETURN
* * * * * * *
LUDate:
* * * * * * *
ReturnCtrl = Parm1[1,@RM]
IF ReturnCtrl = '' THEN ReturnCtrl = Get_Property(@WINDOW,'FOCUS')
DateSelected = Dialog_Box('POPUP_YEAR',@WINDOW)
RetVal = OCONV(DateSelected, 'D4/')
IF RetVal NE '' THEN
obj_Appwindow('LUValReturn',RetVal:@RM:ReturnCtrl)
END
RETURN
* * * * * * *
Close:
* * * * * * *
* * * * * * *
Cancel:
* * * * * * *
End_Dialog(@WINDOW,'Cancel')
RETURN
* * * * * * *
PerformQuery:
* * * * * * *
open 'DICT.COC' to DictCOCTable else
Void = msg( '', 'Unable to open DICT.COC...' )
return 0
end
SearchStr = ''
CustIds = Get_Property(@WINDOW:'.CUSTOMER_INFO','ARRAY')<1>
EntryDateFrom = Get_Property(@WINDOW:'.ENTRY_DATE_FROM','TEXT')
EntryDateThru = Get_Property(@WINDOW:'.ENTRY_DATE_THRU','TEXT')
EntryIds = Get_Property(@WINDOW:'.ENTRY_IDS','ARRAY')<1>
Wo = Get_Property(@WINDOW:'.WO','ARRAY')
Po = Get_Property(@WINDOW:'.PO','ARRAY')
swap @vm:@vm with '' in Wo
if Wo[-1,1] = @vm then Wo[-1,1] = ''
swap @vm:@vm with '' in Po
if Po[-1,1] = @vm then Po[-1,1] = ''
swap @vm:@vm with '' in CustIds
if CustIds[-1,1] = @vm then CustIds[-1,1] = ''
swap @vm:@vm with '' in EntryIds
if EntryIds[-1,1] = @vm then EntryIds[-1,1] = ''
if CustIds then
SearchStr<-1> = 'WO_CUST_NO_SHIP_TO':@vm:CustIds
end
if EntryDateFrom and EntryDateThru then
SearchStr<-1> = 'ENTRY_DATE':@vm:EntryDateFrom:'...':EntryDateThru
end else
if EntryDateFrom then
SearchStr<-1> = 'ENTRY_DATE':@vm:'>=':EntryDateFrom
end
if EntryDateThru then
SearchStr<-1> = 'ENTRY_DATE':@vm:'<=':EntryDateThru
end
end
if EntryIds then
SearchStr<-1> = 'ENTRY_ID':@vm:EntryIds
end
if Wo then
SearchStr<-1> = 'WO':@vm:Wo
end
if Po then
SearchStr<-1> = 'PO':@VM:Po
end
if SearchStr then
SearchStr := @fm
Void = utility( 'CURSOR', 'H' )
* do a btree.extract
btree.extract( SearchStr, 'COC', DictCOCTable, Keys, '', Flag )
if Flag <> 0 then
Void = msg( '', 'Error while extracting COC records...' )
return 0
end
if Keys then
convert @vm to @fm in Keys
Keys = key_sort( Keys, 'COC', 'CUST_NAME_BILL_TO':@fm:'#ENTRY_DATE', 1 )
end_dialog( @window, Keys )
end else
MsgInfo = ''
MsgInfo<mtext$> = 'No records found meeting your criteria...'
MsgInfo<micon$> = '!'
Void = msg( '', MsgInfo )
end
Void = utility( 'CURSOR', 'A' )
end else
MsgInfo = ''
MsgInfo<mtext$> = 'You have not entered any search criteria...'
MsgInfo<micon$> = '!'
Void = msg( '', MsgInfo )
end
OPEN 'DICT.RDS' TO DictRDSTable ELSE
ErrMsg( 'Unable to open DICT.RDS...' )
End_Dialog( @WINDOW,'')
END
WONos = Get_Property(@WINDOW:'.WO','ARRAY')<1>
Reactors = Get_Property(@WINDOW:'.REACTORS','ARRAY')<1>
PSNs = Get_Property(@WINDOW:'.PSN_NOS','ARRAY')<1>
QuoteNos = Get_Property(@WINDOW:'.QUOTE_NOS','ARRAY')<1>
PONos = Get_Property(@WINDOW:'.PO','ARRAY')<1>
PartNos = Get_Property(@WINDOW:'.PART_NUM','ARRAY')<1>
LotNos = Get_Property(@WINDOW:'.LOT_NUM','ARRAY')<1>
CurrStatusCds = Get_Property(@WINDOW:'.CURR_STATUS','ARRAY')<1>
CustIds = Get_Property(@WINDOW:'.CUST_INFO','ARRAY')<1>
SWAP @VM:@VM WITH '' IN WONos ; IF WONos[-1,1] = @VM THEN WONos[-1,1] = ''
SWAP @VM:@VM WITH '' IN Reactors ; IF Reactors[-1,1] = @VM THEN Reactors[-1,1] = ''
SWAP @VM:@VM WITH '' IN PSNs ; IF PSNs[-1,1] = @VM THEN PSNs[-1,1] = ''
SWAP @VM:@VM WITH '' IN QuoteNos ; IF QuoteNos[-1,1] = @VM THEN QuoteNos[-1,1] = ''
SWAP @VM:@VM WITH '' IN PONos ; IF PONos[-1,1] = @VM THEN PONos[-1,1] = ''
SWAP @VM:@VM WITH '' IN PartNos ; IF PartNos[-1,1] = @VM THEN PartNos[-1,1] = ''
SWAP @VM:@VM WITH '' IN LotNos ; IF LotNos[-1,1] = @VM THEN LotNos[-1,1] = ''
SWAP @VM:@VM WITH '' IN CurrStatusCds ; IF CurrStatusCds[-1,1] = @VM THEN CurrStatusCds[-1,1] = ''
SWAP @VM:@VM WITH '' IN CustIDs ; IF CustIDs[-1,1] = @VM THEN CustIds[-1,1] = ''
DateInFrom = Get_Property(@WINDOW:'.DATE_IN_FROM','TEXT')
DateInThru = Get_Property(@WINDOW:'.DATE_IN_THRU','TEXT')
DateOutFrom = Get_Property(@WINDOW:'.DATE_OUT_FROM','TEXT')
DateOutThru = Get_Property(@WINDOW:'.DATE_OUT_THRU','TEXT')
TimeInFrom = Get_Property(@WINDOW:'.TIME_IN_FROM','TEXT')
TimeInThru = Get_Property(@WINDOW:'.TIME_IN_THRU','TEXT')
TimeOutFrom = Get_Property(@WINDOW:'.TIME_OUT_FROM','TEXT')
TimeOutThru = Get_Property(@WINDOW:'.TIME_OUT_THRU','TEXT')
SearchStr = ''
IF WONos THEN SearchStr<-1> = 'WO':@VM:WONos
IF Reactors THEN SearchStr<-1> = 'REACTOR':@VM:Reactors
IF PSNs THEN SearchStr<-1> = 'PROD_SPEC_ID':@VM:PSNs
IF QuoteNos THEN SearchStr<-1> = 'QUOTE_NO':@VM:QuoteNos
IF PONos THEN SearchStr<-1> = 'PO':@VM:PONos
IF PartNos THEN SearchStr<-1> = 'PART_NUM':@VM:PartNos
IF LotNos THEN SearchStr<-1> = 'LOT_NUM':@VM:LotNos
IF CurrStatusCds THEN SearchStr<-1> = 'CURR_STATUS':@VM:CurrStatusCds
IF CustIds THEN SearchStr<-1> = 'CUST_NO':@VM:CustIds
IF DateInFrom AND DateInThru THEN
SearchStr<-1> = 'DATE_IN':@VM:DateInFrom:'...':DateInThru
END ELSE
IF DateInFrom THEN SearchStr<-1> = 'DATE_IN':@VM:'>=':DateInFrom
IF DateInThru THEN SearchStr<-1> = 'DATE_IN':@VM:'<=':DateInThru
END
IF DateOutFrom and DateOutThru THEN
SearchStr<-1> = 'DATE_OUT':@VM:DateOutFrom:'...':DateOutThru
END ELSE
IF DateOutFrom THEN SearchStr<-1> = 'DATE_OUT':@VM:'>=':DateOutFrom
IF DateOutThru THEN SearchStr<-1> = 'DATE_OUT':@VM:'<=':DateOutThru
END
IF TimeInFrom and TimeInThru THEN
SearchStr<-1> = 'TIME_IN':@VM:TimeInFrom:'...':TimeInThru
END ELSE
IF TimeInFrom THEN SearchStr<-1> = 'TIME_IN':@VM:'>=':TimeInFrom
IF TimeInThru THEN SearchStr<-1> = 'TIME_IN':@VM:'<=':TimeInThru
END
IF TimeOutFrom and TimeOutThru THEN
SearchStr<-1> = 'TIME_OUT':@VM:TimeOutFrom:'...':TimeOutThru
END ELSE
IF TimeOutFrom THEN SearchStr<-1> = 'TIME_OUT':@VM:'>=':TimeOutFrom
IF TimeOutThru THEN SearchStr<-1> = 'TIME_OUT':@VM:'<=':TimeOutThru
END
IF SearchStr THEN
SearchStr := @FM
Void = Utility( 'CURSOR', 'H' )
* do a btree.extract
Btree.Extract( SearchStr, 'RDS', DictRDSTable, RDSNos, '', Flag )
IF Get_Status(errCode) THEN
ErrMsg(errCode)
End_Dialog( @WINDOW,'')
END
IF RDSNos THEN
CONVERT @VM TO @FM IN RDSNos
RDSNos = Key_Sort( RDSNos, 'RDS', 'CUST_NAME':@fm:'WO':@fm:'RUN_ORDER_NUM', 0 )
End_Dialog( @WINDOW, RDSNos )
END ELSE
MsgInfo = ''
MsgInfo<mtext$> = 'No records found meeting your criteria...'
MsgInfo<micon$> = '!'
Void = msg( '', MsgInfo )
END
Void = utility( 'CURSOR', 'A' )
END ELSE
MsgInfo = ''
MsgInfo<mtext$> = 'You have not entered any search criteria...'
MsgInfo<micon$> = '!'
Void = msg( '', MsgInfo )
END
RETURN

View File

@ -0,0 +1,116 @@
COMPILE FUNCTION Comm_Dialog_Cust_Info(Method, Parm1)
/*
Commuter module for Dialog_Cust_Info window.
08/06/2004 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Set_Status, ErrMsg
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Msg
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box
EQU CRLF$ TO \0D0A\
ErrTitle = 'Error in Comm_Dialog_Cust_Info'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Method = 'Create' ; GOSUB Create
CASE Method = 'OK' ; GOSUB OK
CASE Method = 'Cancel' ; GOSUB Cancel
CASE Method = 'Refresh' ; GOSUB Refresh
CASE 1
ErrMsg(ErrTitle:@SVM:'Unknown method ':QUOTE(Method):' passed to routine.')
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
obj_AppWindow('Create')
Title = Parm1[1,@FM]
Set_Property(@WINDOW,'TEXT',Title)
Vals = FIELD(Parm1,@FM,2,99)
CONVERT @FM TO @RM IN Vals
Ctrls = @WINDOW:'.COMPANY':@RM ; Props = 'DEFPROP':@RM
Ctrls := @WINDOW:'.ATTENTION':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.ADDRESS':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.CITY':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.ST':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.ZIP':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.COUNTRY' ; Props := 'DEFPROP'
Set_Property(Ctrls,Props,Vals)
RETURN
* * * * * * *
Refresh:
* * * * * * *
RETURN
* * * * * * *
Close:
* * * * * * *
* * * * * * *
Cancel:
* * * * * * *
End_Dialog(@WINDOW,'Cancel')
RETURN
* * * * * * *
OK:
* * * * * * *
Ctrls = @WINDOW:'.COMPANY':@RM ; Props = 'DEFPROP':@RM
Ctrls := @WINDOW:'.ATTENTION':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.ADDRESS':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.CITY':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.ST':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.ZIP':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.COUNTRY' ; Props := 'DEFPROP'
Vals = Get_Property(Ctrls,Props)
CONVERT @RM TO @FM IN Vals
Addr = Vals<3>
LOOP
UNTIL Addr[-1,1] NE @TM OR Addr = ''
Addr[-1,1] = ''
REPEAT
Vals<3> = Addr
CONVERT @FM TO @RM IN Vals
End_Dialog(@WINDOW,Vals)
RETURN

View File

@ -0,0 +1,99 @@
COMPILE FUNCTION Comm_Dialog_Date(Method, Parm1)
/*
Commuter module for Dialog_Date window.
09/21/2005 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Set_Status, ErrMsg
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Msg,
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Popup, Utility, Msg, Send_Message
EQU CRLF$ TO \0D0A\
$INSERT POPUP_EQUATES
$INSERT MSG_EQUATES
$INSERT RDS_EQU
$INSERT APPCOLORS
ErrTitle = 'Error in Comm_Dialog_Date'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Method = 'Create' ; GOSUB Create
CASE Method = 'OK' ; GOSUB OK
CASE Method = 'Cancel' ; GOSUB Cancel
CASE Method = 'PickDt' ; GOSUB PickDt
CASE 1
ErrMsg(ErrTitle:@SVM:'Unknown method ':QUOTE(Method):' passed to routine.')
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
Note = Parm1<1>
DateLabel = Parm1<2>
IF Note NE '' THEN
Set_Property(@WINDOW:'.NOTE_TEXT','DEFPROP',Note)
END
IF DateLabel NE '' THEN
Set_Property(@WINDOW:'.GENERIC_DT_LABEL','TEXT',DateLabel)
END
obj_AppWindow('Create')
RETURN
* * * * * * *
Cancel:
* * * * * * *
End_Dialog(@WINDOW,'Cancel')
RETURN
* * * * * * *
PickDt:
* * * * * * *
ReturnCtrl = Parm1
IF ReturnCtrl = '' THEN
ReturnCtrl = Get_Property(@WINDOW,'@FOCUS')
END ELSE
IF INDEX(ReturnCtrl,'.',1) ELSE
ReturnCtrl = @WINDOW:'.':ReturnCtrl
END
END
ReturnVal = OCONV(Dialog_Box("POPUP_MONTH",@WINDOW),'D4/')
obj_Appwindow('LUValReturn',ReturnVal:@RM:ReturnCtrl:@RM:'')
RETURN
* * * * * * *
OK:
* * * * * * *
GenericDt= Get_Property(@WINDOW:'.GENERIC_DT','TEXT')
End_Dialog( @WINDOW, GenericDt )
RETURN

View File

@ -0,0 +1,89 @@
COMPILE FUNCTION Comm_Dialog_Date_Range(Method, Parm1)
/*
Commuter module for Dialog_Date_Range window.
08/07/2005 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Set_Status, ErrMsg
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Msg,
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Popup, Utility, Msg, Send_Message
EQU CRLF$ TO \0D0A\
$INSERT POPUP_EQUATES
$INSERT MSG_EQUATES
$INSERT RDS_EQU
$INSERT APPCOLORS
ErrTitle = 'Error in Comm_Dialog_Date_Range'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Method = 'Create' ; GOSUB Create
CASE Method = 'OK' ; GOSUB OK
CASE Method = 'Cancel' ; GOSUB Cancel
CASE Method = 'PickDt' ; GOSUB PickDt
CASE 1
ErrMsg(ErrTitle:@SVM:'Unknown method ':QUOTE(Method):' passed to routine.')
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
obj_AppWindow('Create')
RETURN
* * * * * * *
Cancel:
* * * * * * *
End_Dialog(@WINDOW,'Cancel')
RETURN
* * * * * * *
PickDt:
* * * * * * *
ReturnCtrl = Parm1
IF ReturnCtrl = '' THEN
ReturnCtrl = Get_Property(@WINDOW,'@FOCUS')
END ELSE
IF INDEX(ReturnCtrl,'.',1) ELSE
ReturnCtrl = @WINDOW:'.':ReturnCtrl
END
END
ReturnVal = OCONV(Dialog_Box("POPUP_MONTH",@WINDOW),'D4/')
obj_Appwindow('LUValReturn',ReturnVal:@RM:ReturnCtrl:@RM:'')
RETURN
* * * * * * *
OK:
* * * * * * *
StartDt = Get_Property(@WINDOW:'.START_DT','TEXT')
EndDt = Get_Property(@WINDOW:'.END_DT','TEXT')
End_Dialog( @WINDOW, StartDt:@FM:EndDt )
RETURN

View File

@ -0,0 +1,699 @@
COMPILE FUNCTION Comm_Dialog_EpiPro_Export(Method, Parm1)
/*
Commuter module for Dialog_EpiPro_Exportwindow.
10/28/2005 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Send_Event, Set_Status, ErrMsg
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Btree.Extract, Msg, Send_Info
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Utility, Send_Message, Popup, Collect.IXVals, Msg
EQU CRLF$ TO \0D0A\
EQU COL$CUST_NO TO 1 ;* Customer edit table column equates
EQU COL$CUST_NAME TO 2
EQU LTGREY$ TO 229 + (229*256) + (229*65536) ;* JCH standard colors for edittable backgrounds
EQU GREY$ TO 192 + (192*256) + (192*65536)
EQU GREEN$ TO 192 + (220*256) + (192*65536)
EQU RED$ TO 255 + (128*256) + (128*65536)
EQU BLUE$ TO 128 + (255*256) + (255*65536)
EQU WHITE$ TO 255 + (255*256) + (255*65536)
EQU YELLOW$ TO 255 + (255*256) + (202*65536)
EQU LTBLUE$ TO 128 + (255*256) + (255*65536)
EQU PURPLE$ TO 225 + (181*256) + (255*65536)
EQU DTS_MULTIROW$ TO 512
EQU DTS_LARGEDATA$ TO 4096
$INSERT WM_OUT_EQUATES
$INSERT PS_EQUATES
$INSERT POPUP_EQUATES
$INSERT MSG_EQUATES
ErrTitle = 'Error in Comm_Dialog_Order_Find'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Method = 'Create' ; GOSUB Create
CASE Method = 'CustChar' ; GOSUB CustChar
CASE Method = 'CustPC' ; GOSUB CustPC
CASE Method = 'CustDC' ; GOSUB CustDC
CASE Method = 'CustPNDC' ; GOSUB CustPNDC
CASE Method = 'SubPNDC' ; GOSUB SubPNDC
CASE Method = 'LotNoDC' ; GOSUB LotNoDC
CASE Method = 'PSNoDC' ; GOSUB PSNoDC
CASE Method = 'WONoDC' ; GOSUB WONoDC
CASE Method = 'LUDate' ; GOSUB LUDate
CASE Method = 'Cancel' ; GOSUB Cancel
CASE Method = 'Refresh' ; GOSUB Refresh
CASE Method = 'PerformQuery' ; GOSUB PerformQuery
CASE 1
ErrMsg(ErrTitle:@SVM:'Unknown method ':QUOTE(Method):' passed to routine.')
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
obj_AppWindow('Create')
Set_Property(@WINDOW,'STATUSLINE',@WINDOW:'.STATUSLINE_FIX')
GOSUB Refresh
RETURN
* * * * * * *
Refresh:
* * * * * * *
* Turn edit table symbolic column backgrounds to green
stat = Send_Message(@WINDOW:'.CUST_INFO','COLOR_BY_POS',COL$CUST_NAME,0,GREEN$) ;* Turn names column all rows green
RETURN
* * * * * * *
CustChar:
* * * * * * *
CtrlName = @WINDOW:'.CUST_INFO'
CustArray = Get_Property(CtrlName,'ARRAY') ;* Customer Information table
CurrPos = Get_Property(CtrlName,'SELPOS')
CurrRow = CurrPos<2>
DataIn = CustArray<COL$CUST_NO,CurrRow>
IF LEN(DataIn) > 2 THEN
ReturnToCtrl = CtrlName
ReturnToPos = CurrPos
IF NOT(NUM(DataIn)) THEN
Set_Property(CtrlName,'CELLPOS','',CurrPos) ;* Clear characters input
Start_Window('COMP_LOOKUP',@WINDOW,DataIn:@VM:'C':@FM:ReturnToCtrl:@FM:ReturnToPos,'','')
END
END
RETURN
* * * * * * *
CustPC:
* * * * * * *
CtrlName = @WINDOW:'.CUST_INFO'
CustList = Get_Property(CtrlName,'LIST') ;* Customer Information table
CurrPos = Get_Property(CtrlName,'SELPOS')
CurrCol = CurrPos<1>
CurrRow = CurrPos<2>
CustNo = CustList<CurrRow,COL$CUST_NO>
IF CustNo NE '' THEN
Set_Property(CtrlName,'CELLPOS',XLATE('COMPANY',CustNo,4,'X'),COL$CUST_NAME:@FM:CurrRow)
END
RETURN
* * * * * * *
CustDC:
* * * * * * *
CtrlName = @WINDOW:'.CUST_INFO'
CustList = Get_Property(CtrlName,'LIST') ;* Customer Information table
CurrPos = Get_Property(CtrlName,'SELPOS')
CurrCol = CurrPos<1>
CurrRow = CurrPos<2>
CustNo = CustList<CurrRow,COL$CUST_NO>
LineCnt = COUNT(CustList,@FM) + (CustList NE '')
IF CustNo = '' THEN
CustNos = Popup(@WINDOW,'','CUSTOMER')
CustCnt = COUNT(CustNos,@VM) + (CustNos NE '')
IF CustCnt > LineCnt THEN
FOR I = 1 TO CustCnt
stat = Send_Message(CtrlName,'INSERT',-1,@VM:@FM) ; * Add blank lines
NEXT I
END
FOR I = CurrRow TO CurrRow + CustCnt
CustNo = CustNos<1,I>
CustName = XLATE('COMPANY',CustNo,4,'X')
Set_Property(CtrlName,'CELLPOS',CustNo,COL$CUST_NO:@FM:I)
Set_Property(CtrlName,'CELLPOS',CustName,COL$CUST_NAME:@FM:I)
Set_Property(CtrlName,'SELPOS',COL$CUST_NO:@FM:I+1)
NEXT I
END ELSE
ErrMsg('DoubleClick on the first empty Cust No field to view a popup of all Customers')
END
RETURN
* * * * * * *
SubPNDC:
* * * * * * *
CustArray = Get_Property(@WINDOW:'.CUST_INFO','ARRAY')<COL$CUST_NO>
CustNos = CustArray<COL$CUST_NO>
LOOP
LastCustNo = CustNos[-1,'B':@VM]
UNTIL LastCustNo NE '' OR CustNos = ''
CustNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF CustNos = '' THEN RETURN
* display the processing message and do the processing
Def = ""
Def<MTEXT$> = "Selecting Substrate Part Numbers..."
Def<MTYPE$> = "U"
MsgUp = Msg(@window, Def)
OPEN 'DICT.WO_LOG' TO DictVar THEN
SearchString = 'CUST_NO':@VM:CustNos:@VM:@FM
SearchString := 'SUB_PART_NO':@VM:'#':@FM
Btree.Extract(SearchString, 'WO_LOG', DictVar, WOKeys, '', Flag)
IF Get_Status(errCode) THEN
Msg(@WINDOW,MsgUp)
ErrMsg(errCode)
RETURN
END
IF WOKeys NE '' THEN
RawPartNos = XLATE('WO_LOG',WOKeys,'SUB_PART_NO','X') ;* Calculated field
IF Get_Status(errCode) THEN DEBUG
PartNos = ''
FOR I = 1 TO COUNT(RawPartNos,@VM) + (RawPartNos NE '')
RawPartNo = RawPartNos<1,I>
LOCATE RawPartNo IN PartNos BY 'AL' USING @VM SETTING Pos ELSE
PartNos = INSERT(PartNos,1,Pos,0,RawPartNo)
END
NEXT I
END ELSE
PartNos = ''
END
Msg(@WINDOW,MsgUp)
IF PartNos = '' THEN
ErrMsg('No Substrate Part Numbers on file for specified customer.')
RETURN
END
PartNos := @VM
CONVERT @VM TO @RM IN PartNos
CALL V119('S','','D','R',PartNos,'')
IF Get_Status(errCode) THEN DEBUG
CONVERT @RM TO @VM IN PartNos
PartNos[-1,1] = '' ;* Strip trailing delimiter
TypeOver = ''
TypeOver<PDISPLAY$> = PartNos
PartNos = Popup(@WINDow,TypeOver,'CUST_PO') ;****** Need a popup
IF Get_Status(errCode) THEN DEBUG
IF PartNos NE '' THEN
Set_Property(@WINDOW:'.SUB_PART_NO','DEFPROP',PartNos)
END
END ELSE
ErrMsg('Unable to open DICT.WO_LOG in COMM_DIALOG_WO_LOG_FIND.')
END
RETURN
* * * * * * *
LotNoDC:
* * * * * * *
CustNos = Get_Property(@WINDOW:'.CUST_INFO','ARRAY')<COL$CUST_NO>
LOOP
LastCustNo = CustNos[-1,'B':@VM]
UNTIL LastCustNo NE '' OR CustNos = ''
CustNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF CustNos = '' THEN RETURN
* display the processing message and do the processing
Def = ""
Def<MTEXT$> = "Selecting Lot Numbers..."
Def<MTYPE$> = "U"
MsgUp = Msg(@window, Def)
OPEN 'DICT.WO_LOG' TO DictVar THEN
SearchString = 'CUST_NO':@VM:CustNos:@VM:@FM
SearchString := 'LOT_NO':@VM:'#':@FM
Btree.Extract(SearchString, 'WO_LOG', DictVar, WOKeys, '', Flag)
IF Get_Status(errCode) THEN
Msg(@WINDOW,MsgUp)
ErrMsg(errCode)
RETURN
END
IF WOKeys NE '' THEN
RawLotNos = XLATE('WO_LOG',WOKeys,'LOT_NO','X') ;* Calculated field
IF Get_Status(errCode) THEN DEBUG
LotNos = ''
FOR I = 1 TO COUNT(RawLotNos,@VM) + (RawLotNos NE '')
RawLotNo = RawLotNos<1,I>
LOCATE RawLotNo IN LotNos BY 'AL' USING @VM SETTING Pos ELSE
LotNos = INSERT(LotNos,1,Pos,0,RawLotNo)
END
NEXT I
END ELSE
LotNos = ''
END
Msg(@WINDOW,MsgUp)
IF LotNos = '' THEN
ErrMsg('No Lot Numbers on file for specified customer.')
RETURN
END
LotNos := @VM
CONVERT @VM TO @RM IN LotNos
CALL V119('S','','D','R',LotNos,'')
IF Get_Status(errCode) THEN DEBUG
CONVERT @RM TO @VM IN LotNos
LotNos[-1,1] = '' ;* Strip trailing delimiter
TypeOver = ''
TypeOver<PDISPLAY$> = LotNos
LotNos = Popup(@WINDow,TypeOver,'CUST_PO') ;****** Need a popup
IF Get_Status(errCode) THEN DEBUG
IF LotNos NE '' THEN
Set_Property(@WINDOW:'.LOT_NO','DEFPROP',LotNos)
END
END ELSE
ErrMsg('Unable to open DICT.WO_LOG in COMM_DIALOG_WO_LOG_FIND.')
END
RETURN
* * * * * * *
PSNoDC:
* * * * * * *
CustArray = Get_Property(@WINDOW:'.CUST_INFO','ARRAY')
CustNos = CustArray<COL$CUST_NO>
LOOP
LastCustNo = CustNos[-1,'B':@VM]
UNTIL LastCustNo NE '' OR CustNos = ''
CustNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF CustNos = '' THEN RETURN
* display the processing message and do the processing
Def = ""
Def<MTEXT$> = "Selecting Product Specifications..."
Def<MTYPE$> = "U"
MsgUp = Msg(@window, Def)
OPEN 'DICT.WO_LOG' TO DictVar THEN
SearchString = 'CUST_NO':@VM:CustNos:@VM:@FM
SearchString := 'PS_NO':@VM:'#':@FM
Btree.Extract(SearchString, 'WO_LOG', DictVar, WOKeys, '', Flag)
IF Get_Status(errCode) THEN
Msg(@WINDOW,MsgUp)
ErrMsg(errCode)
RETURN
END
IF WOKeys NE '' THEN
PSNs = ''
FOR N = 1 TO COUNT(WOKeys,@VM) + (WOKeys NE '')
WOKey = WOKeys<1,N>
RawPSNs = XLATE('WO_LOG',WOKey,'PS_NO','X')
FOR I = 1 TO COUNT(RawPSNs,@VM) + (RawPSNs NE '')
RawPSN = RawPSNs<1,I>
LOCATE RawPSN IN PSNs BY 'AL' USING @VM SETTING Pos ELSE
PSNs = INSERT(PSNs,1,Pos,0,RawPSN)
END
NEXT I
NEXT N
END ELSE
PSNs = ''
END
Msg(@WINDOW,MsgUp)
IF PSNs = '' THEN
ErrMsg('No Product Specifications on file for specified customer.')
RETURN
END
PSNs := @VM
CONVERT @VM TO @RM IN PSNs
CALL V119('S','','D','R',PSNs,'')
IF Get_Status(errCode) THEN DEBUG
CONVERT @RM TO @VM IN PSNs
PSNs[-1,1] = '' ;* Strip trailing delimiter
TypeOver = ''
TypeOver<PDISPLAY$> = PSNs
PSNs = Popup(@WINDow,TypeOver,'CUST_PO')
IF Get_Status(errCode) THEN DEBUG
IF PSNs NE '' THEN
CONVERT @VM TO @FM IN PSNs
Set_Property(@WINDOW:'.PS_NO','LIST',PSNs)
END
END ELSE
ErrMsg('Unable to open DICT.WO_LOG in COMM_DIALOG_WO_LOG_FIND.')
END
RETURN
* * * * * * *
WONoDC:
* * * * * * *
WOKeys = Collect.IXVals('WM_OUT', 'WO_NO')
CONVERT @FM TO @VM IN WOKeys
IF Get_Status(errCode) THEN ErrMsg(ErrCode)
IF WOKeys NE '' THEN
TypeOver = ''
TypeOver<PDISPLAY$> = WOKeys
TypeOver<PMODE$> = 'K'
WOKeys = Popup(@WINDOW,TypeOver,'WO_LOG_QUERY')
IF Get_Status(errCode) THEN
ErrMsg(errCode)
END
IF WOKeys NE '' THEN
CONVERT @VM TO @FM IN WOKeys
Set_Property(@WINDOW:'.WO_NO','LIST',WOKeys)
END
END
RETURN
* * * * * * *
CustPNDC:
* * * * * * *
CustArray = Get_Property(@WINDOW:'.CUST_INFO','ARRAY')
CustNos = CustArray<COL$CUST_NO>
LOOP
LastCustNo = CustNos[-1,'B':@VM]
UNTIL LastCustNo NE '' OR CustNos = ''
CustNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF CustNos = '' THEN RETURN
* display the processing message and do the processing
Def = ""
Def<MTEXT$> = "Selecting Part Numbers..."
Def<MTYPE$> = "U"
MsgUp = Msg(@window, Def)
OPEN 'DICT.WO_LOG' TO DictVar THEN
SearchString = 'CUST_NO':@VM:CustNos:@VM:@FM
SearchString := 'CUST_PART_NO':@VM:'#':@FM
Btree.Extract(SearchString, 'WO_LOG', DictVar, WOKeys, '', Flag)
IF Get_Status(errCode) THEN
Msg(@WINDOW,MsgUp)
ErrMsg(errCode)
RETURN
END
IF WOKeys NE '' THEN
PartNos = ''
FOR N = 1 TO COUNT(WOKeys,@VM) + (WOKeys NE '')
WOKey = WOKeys<1,N>
RawPartNos = XLATE('WO_LOG',WOKey,'PART_NO','X')
FOR I = 1 TO COUNT(RawPartNos,@VM) + (RawPartNos NE '')
RawPartNo = RawPartNos<1,I>
LOCATE RawPartNo IN PartNos BY 'AL' USING @VM SETTING Pos ELSE
PartNos = INSERT(PartNos,1,Pos,0,RawPartNo)
END
NEXT I
NEXT N
END ELSE
PartNos = ''
END
Msg(@WINDOW,MsgUp)
IF PartNos = '' THEN
ErrMsg('No Customer Part Numbers on file for specified customer.')
RETURN
END
PartNos := @VM
CONVERT @VM TO @RM IN PartNos
CALL V119('S','','D','R',PartNos,'')
IF Get_Status(errCode) THEN DEBUG
CONVERT @RM TO @VM IN PartNos
PartNos[-1,1] = '' ;* Strip trailing delimiter
TypeOver = ''
TypeOver<PDISPLAY$> = PartNos
PartNos = Popup(@WINDow,TypeOver,'CUST_PO') ;* Needs a popup
IF Get_Status(errCode) THEN DEBUG
IF PartNos NE '' THEN
Set_Property(@WINDOW:'.CUST_PART_NO','DEFPROP',PartNos)
END
END ELSE
ErrMsg('Unable to open DICT.WO_LOG in COMM_DIALOG_WO_LOG_FIND.')
END
RETURN
* * * * * * *
LUDate:
* * * * * * *
ReturnCtrl = Parm1[1,@RM]
IF ReturnCtrl = '' THEN ReturnCtrl = Get_Property(@WINDOW,'FOCUS')
DateSelected = Dialog_Box('POPUP_YEAR',@WINDOW)
RetVal = OCONV(DateSelected, 'D4/')
IF RetVal NE '' THEN
obj_Appwindow('LUValReturn',RetVal:@RM:ReturnCtrl)
END
RETURN
* * * * * * *
Cancel:
* * * * * * *
RETURN
* * * * * * *
PerformQuery:
* * * * * * *
If @USER4 EQ 'DANIEL_ST' then debug
* Customer numbers *
SearchString = 'MAKEUP_BOX':@VM:'0':@FM
CustNos = Get_Property(@WINDOW:'.CUST_INFO','ARRAY')<COL$CUST_NO>
LOOP
LastVar = CustNos[-1,'B':@VM]
UNTIL LastVar NE '' OR CustNos = ''
CustNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF CustNos NE '' THEN SearchString := 'CUST_NO':@VM:CustNos:@FM
* LotNumbers *
LotNos = Get_Property(@WINDOW:'.LOT_NO','ARRAY')<1>
LOOP
LastVal = LotNos[-1,'B':@VM]
UNTIL LastVal NE '' OR LotNos = ''
LotNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF LotNos NE '' THEN SearchString := 'LOT_NO':@VM:LotNos:@FM
* Cust Part Number *
CustPNs = Get_Property(@WINDOW:'.CUST_PART_NO','ARRAY')<1>
LOOP
LastVal = CustPNs[-1,'B':@VM]
UNTIL LastVal NE '' OR CustPNs = ''
CustPNS[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF CustPNs NE '' THEN SearchString := 'CUST_PART_NO':@VM:CustPNs:@FM
* Substrate Part Numbers *
SubPartNos = Get_Property(@WINDOW:'.SUB_PART_NO','ARRAY')<1>
LOOP
LastVal = SubPartNos[-1,'B':@VM]
UNTIL LastVal NE '' OR SubPartNos = ''
SubPartNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF SubPartNos NE '' THEN SearchString := 'SUB_PART_NO':@VM:SubPartNos:@FM
* PSN Nos *
PS_NOs = Get_Property(@WINDOW:'.PS_NO','ARRAY')<1>
LOOP
LastVal = PS_NOs[-1,'B':@VM]
UNTIL LastVal NE '' OR PS_NOs = ''
PS_NOs[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF PS_NOs NE '' THEN SearchString := 'PS_NO':@VM:PS_NOs:@FM
* WO Nos *
WO_NOs = Get_Property(@WINDOW:'.WO_NO','ARRAY')<1>
LOOP
LastVal = WO_NOs[-1,'B':@VM]
UNTIL LastVal NE '' OR WO_NOs = ''
WO_NOs[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF WO_NOs NE '' THEN SearchString := 'WO_NO':@VM:WO_NOs:@FM
* Entry Dates *
StartDt = ICONV(Get_Property(@WINDOW:'.START_DT','TEXT'),'D')
EndDt = ICONV(Get_Property(@WINDOW:'.END_DT','TEXT'),'D')
BEGIN CASE
CASE StartDt NE '' AND EndDt = ''
SearchString := 'SUP_VER_SIG_DT':@VM:'>=':OConv(StartDt, 'D4/'):@FM
CASE StartDt = '' AND EndDt NE ''
SearchString := 'SUP_VER_SIG_DT':@VM:'<=':OConv(EndDt, 'D4/'):@FM
CASE StartDt NE '' AND EndDt NE ''
* Fudge the dates - '~' is not inclusive of the end dates
StartDt -= 1
EndDt += 1
SearchString := 'SUP_VER_SIG_DT':@VM:OConv(StartDt, 'D4/'):'~':OConv(EndDt, 'D4/'):@FM
CASE 1
NULL
END CASE
OPEN 'DICT.WM_OUT' TO DictVar THEN
Def = ""
Def<MTEXT$> = "Selecting WM_OUT Recrods..."
Def<MTYPE$> = "U"
* display the processing message and do the processing
MsgUp = Msg(@window, Def)
Btree.Extract(SearchString,'WM_OUT',DictVar,WMOKeys,'',flag)
IF Get_Status(errCode) THEN ErrMsg(errCode)
Msg(@window, MsgUp)
IF Get_Status(errCode) THEN
ErrMsg(errCode)
RETURN
END
End_Dialog(@WINDOW,WMOKeys)
END ELSE
ErrMsg('Unable to open DICT.WM_OUT in routine COMM_DIALOG_EPIPRO_EXPORT')
END
RETURN

View File

@ -0,0 +1,393 @@
COMPILE FUNCTION Comm_Dialog_Epi_Pro_Met(Method, Parm1, Parm2)
/*
Commuter module for Dialog_Epi_Pro_Met window.
05/17/2006 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Set_Status, ErrMsg, Send_Event, obj_RDS_Test
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Msg, End_Dialog, Send_Message, ErrMsg
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Popup, Send_Message, obj_Test_Point_Map, obj_RDS_Test
Declare function Error_Services, MemberOf, Get_EventStatus
EQU CRLF$ TO \0D0A\
$INSERT POPUP_EQUATES
$INSERT LOGICAL
$INSERT MSG_EQUATES
$INSERT RDS_EQU
$INSERT RDS_TEST_EQUATES
$INSERT RDS_LAYER_EQUATES
$INSERT REACT_RUN_EQUATES
$INSERT REACTOR_EQUATES
$INSERT RDS_EPILOAD
$INSERT NCR_EQU
$INSERT APPCOLORS
EQU ORP$THICK_READS TO 1
EQU ORP$SHEET_RHO_READS TO 2
EQU ORP$HGCV1_READS TO 3
EQU EPI_READS$READ_NO TO 1
EQU EPI_READS$THICKNESS TO 2
EQU EPI_READS$SHEET_RHO TO 3
EQU EPI_READS$HGCV1 TO 4
EQU EPI_READS$HGCV2 TO 5
ErrTitle = 'Error in Comm_Dialog_Epi_Pro_Met'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Method = 'Create' ; GOSUB Create
CASE Method = 'Done' ; GOSUB Done
CASE Method = 'Refresh' ; GOSUB Refresh
CASE Method = 'ReadingsDel' ; GOSUB ReadingsDel
CASE 1
ErrMsg(ErrTitle:@SVM:'Unknown method ':QUOTE(Method):' passed to routine.')
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
obj_AppWindow('Create')
MetNo = FIELD(Parm1,@FM,1)
IF MetNo = '' THEN
ErrMsg('Null MetNo passed to Dialog Box...')
End_Dialog(@WINDOW,'')
END
MetRec = XLATE('RDS_TEST',MetNo,'','X')
RDSNo = MetRec<RDS_TEST_RDS_NO$>
LSId = MetRec<RDS_TEST_LS_ID$>
Zone = MetRec<RDS_TEST_ZONE$>
TestPointMap = MetRec<RDS_TEST_TEST_POINT_MAP$>
IF Zone = '' THEN MetKeys = XLATE('REACT_RUN',RDSNo,'MET_KEYS','X')
IF Zone = 1 THEN MetKeys = XLATE('REACT_RUN',RDSNo,'MET_KEYS_Z1','X')
IF Zone = 2 THEN MetKeys = XLATE('REACT_RUN',RDSNo,'MET_KEYS_Z2','X')
RdsLSKeys = XLATE('RDS',RDSNo,RDS_RDS_LAYER_KEYS$,'X')
ReactorNo = XLATE('REACT_RUN',RDSNo,REACT_RUN_REACTOR$,'X')
ReactType = XLATE('REACTOR',ReactorNo,REACTOR_REACT_TYPE$,'X')
IF INDEX(RdsLSKeys,@VM,1) THEN
* Multiple layers
DepTimeTargets = ''
LSCnt = COUNT(RdsLSKeys,@VM) + (RdsLSKeys NE '')
DepTimeTargets = XLATE('RDS_LAYER',RdsLSKeys,RDS_LAYER_EPI_TIME$,'X')
DepTimeTargets = OCONV(DepTimeTargets,'MD1')
LS1DepTime = ''
LS2DepTime = ''
FOR I = 1 TO LSCnt
RdsLSKey = RdsLSKeys<1,I>
IF INDEX(RdsLSKey,'L1',1) THEN LS1DepTime = DepTimeTargets<1,I>
IF INDEX(RdsLSKey,'L2',1) THEN LS2DepTime = DepTimeTargets<1,I>
NEXT I
ErrorMsg = ''
IF LS1DepTime = '' THEN ErrorMsg = 'Deposit Time for LS1 has not been enterered yet.'
IF LS2DepTime = '' THEN ErrorMsg = 'Deposit Time for LS2 has not been enterered yet.'
IF ErrorMsg NE '' THEN
ErrMsg(ErrorMsg)
End_Dialog(@WINDOW,'')
Set_Property('RDS_TEST.MET_NO','DEFPROP',MeTNo)
Send_Event('RDS_TEST','READ')
END ELSE
TotDepTime = LS1DepTime + LS2DepTime
LS1Ratio = LS1DepTime/TotDepTime
END
MetReadings = ''
FOR I = 1 TO COUNT(MetKeys,@VM) + (MetKeys NE '')
MetKey = MetKeys<1,I>
LMetReadings = obj_RDS_Test('GetReadSet',MetKey)
IF I = 1 THEN
MetReadings<1> = LMetReadings<1> ;* Line Numbers
MetReadings<3> = LMetReadings<3> ;* SheetRho
MetReadings<4> = LMetReadings<4> ;* Hgcv
END
IF I = 2 THEN
MetReadings<5> = LMetReadings<4> ;* Hgcv
END
IF I = 3 THEN
MetReadings<2> = LMetReadings<2> ;* Thickness readings
END
NEXT I
END ELSE
LS1Ratio = 1
MetReadings = obj_RDS_Test('GetReadSet',MetNo)
END
Ctrls = @WINDOW:'.MET_NO':@RM ; Props = 'TEXT':@RM ; Vals = MetNo:@RM
Ctrls := @WINDOW:'.RDS_NO':@RM ; Props := 'TEXT':@RM ; Vals := RDSNo:@RM
Ctrls := @WINDOW:'.LS_ID':@RM ; Props := 'TEXT':@RM ; Vals := LSId:@RM
Ctrls := @WINDOW:'.ZONE':@RM ; Props := 'TEXT':@RM ; Vals := Zone:@RM
Ctrls := @WINDOW:'.TEST_POINT_MAP':@RM ; Props := 'TEXT':@RM ; Vals := TestPointMap:@RM
Ctrls := @WINDOW:'.L1_RATIO' ; Props := 'TEXT' ; Vals := LS1Ratio
IF MetReadings<1> NE '' THEN
CONVERT @FM TO @RM IN MetReadings
oTPM_Parms = TestPointMap:@RM:MetReadings
Results = obj_Test_Point_Map('PointToResult',oTPM_Parms)
ThicknessArray = FIELD(Results,@FM,2,4)
Ctrls := @RM:@WINDOW:'.THICKNESS' ; Props := @RM:'DEFPROP' ; Vals := @RM:ThicknessArray<1>
Ctrls := @RM:@WINDOW:'.SHEETRHO' ; Props := @RM:'DEFPROP' ; Vals := @RM:ThickNessArray<2>
Ctrls := @RM:@WINDOW:'.HGCV1' ; Props := @RM:'DEFPROP' ; Vals := @RM:ThicknessArray<3>
Ctrls := @RM:@WINDOW:'.HGCV2' ; Props := @RM:'DEFPROP' ; Vals := @RM:ThickNessArray<4>
END
Set_Property(Ctrls,Props,Vals)
BEGIN CASE
CASE LSId = 'L1'
Set_Property(@WINDOW:'.LS_ID','BACKCOLOR',RCV_BLUE$)
CASE LSId = 'L2'
Set_Property(@WINDOW:'.LS_ID','BACKCOLOR',PRE_BLUE$)
CASE LSId = '2'
Set_Property(@WINDOW:'.LS_ID','BACKCOLOR',INP_BLUE$)
CASE 1
Set_Property(@WINDOW:'.LS_ID','BACKCOLOR',GREEN$)
END CASE
RETURN
* * * * * * *
Done:
* * * * * * *
Ctrls = @WINDOW:'.TEST_POINT_MAP':@RM ; Props = 'DEFPROP':@RM
Ctrls := @WINDOW:'.MET_NO':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.THICKNESS':@RM ; Props := 'ARRAY':@RM
Ctrls := @WINDOW:'.SHEETRHO':@RM ; Props := 'ARRAY':@RM
Ctrls := @WINDOW:'.HGCV1':@RM ; Props := 'ARRAY':@RM
Ctrls := @WINDOW:'.HGCV2':@RM ; Props := 'ARRAY':@RM
Ctrls := @WINDOW:'.L1_RATIO' ; Props := 'DEFPROP'
Vals = Get_Property(Ctrls,Props)
TestPointMap = Vals[1,@RM]
MetNo = Vals[COL2()+1,@RM]
ThickReads = Vals[COL2()+1,@RM]
SheetRhoReads = Vals[COL2()+1,@RM]
HgCV1ResReads = Vals[COL2()+1,@RM]
HgCV2ResReads = Vals[COL2()+1,@RM]
L1Ratio = Vals[COL2()+1,@RM]
ReadingNos = ''
FOR I = 1 TO 9
ReadingNos<1,I> = I
NEXT I
oTPM_Parms = TestPointMap:@RM:ReadingNos:@RM:ThickReads:@RM:SheetRhoReads:@RM:HgCV1ResReads:@RM:HgCV2ResReads
EpiReads = obj_Test_Point_Map('ResultToPoint',oTPM_Parms)
MetRec = XLATE('RDS_TEST',MetNo,'','X')
Zone = MetRec<RDS_TEST_ZONE$>
RDSNo = MetRec<RDS_TEST_RDS_NO$>
BEGIN CASE
CASE Zone = '1' ; MetKeys = XLATE('REACT_RUN',RDSNo,'MET_KEYS_Z1','X')
CASE Zone = '2' ; MetKeys = XLATE('REACT_RUN',RDSNo,'MET_KEYS_Z2','X')
CASE 1 ; MetKeys = XLATE('REACT_RUN',RDSNo,'MET_KEYS','X')
END CASE
UpdatesAllowed = True$ ; // Flag to determine if cassette has not been signed for FQA. Assumed not signed yet.
Override = False$ ; // Assume no override for now.
IF INDEX(MetKeys,@VM,1) THEN
LOCATE MetNo IN MetKeys USING @VM SETTING Pos THEN
MetKeys = DELETE(MetKeys,1,Pos,0)
END
oRTParms_L1 = ''
oRTParms_L2 = ''
FOR J = 1 TO COUNT(EpiReads<1>,@VM) + (EpiReads<1> NE '')
oRTParms_L1<ORP$THICK_READS,J> = OCONV(ICONV(EpiReads<EPI_READS$THICKNESS,J> * L1Ratio, 'MD2'),'MD2')
oRTParms_L2<ORP$THICK_READS,J> = EpiReads<EPI_READS$THICKNESS,J> - oRTParms_L1<ORP$THICK_READS,J>
IF EpiReads<EPI_READS$SHEET_RHO,J> NE '' THEN
oRTParms_L1<ORP$SHEET_RHO_READS,J> = EpiReads<EPI_READS$SHEET_RHO,J>
oRTParms_L2<ORP$SHEET_RHO_READS,J> = ''
EpiReads<EPI_READS$SHEET_RHO,J> = ''
END ELSE
oRTParms_L1<ORP$SHEET_RHO_READS,J> = ''
oRTParms_L2<ORP$SHEET_RHO_READS,J> = ''
END
IF EpiReads<EPI_READS$HGCV1,J> NE '' THEN
oRTParms_L1<ORP$HGCV1_READS,J> = EpiReads<EPI_READS$HGCV1,J>
END
IF EpiReads<EPI_READS$HGCV2,J> NE '' THEN
oRTParms_L2<ORP$HGCV1_READS,J> = EpiReads<EPI_READS$HGCV2,J>
END
NEXT J
CONVERT @FM TO @RM IN oRTParms_L1
CONVERT @FM TO @RM IN oRTParms_L2
obj_RDS_Test('SetReadSet',MetKeys<1,1>:@RM:oRTParms_L1,Override)
If Error_Services('HasError') then
* IF Get_Status(errCode) THEN
FileError = @File.Error
ErrorNumber = FileError<1>
ErrorMessage = FileError<2>
* Message = Error_Services('GetMessage')
* ErrorNumber = Message[1, ':']
* ErrorMessage = Message[Col2() + 1, ':']
If ErrorNumber EQ '104' then
MsgStruct = ''
MsgStruct<MCOL$> = -1
MsgStruct<MROW$> = -1
// Users belonging to the SPEC_CHANGE security group will be allowed to override the block. However, these
// users must confirm that this is what they want.
If MemberOf(@User4, 'SPEC_CHANGE') then
Override = Msg(@Window, MsgStruct, 'YESNO', '', 'RDS Test' : @FM : ErrorMessage : @TM : @TM : 'Please confirm that you want to override.')
If Override EQ True$ then
obj_RDS_Test('SetReadSet',MetKeys<1,1>:@RM:oRTParms_L1,Override)
end else
UpdatesAllowed = False$
end
end else
UpdatesAllowed = False$
Msg(@Window, MsgStruct, 'OK', '', 'RDS Test' : @FM : ErrorMessage)
end
end else
ErrMsg(errCode)
end
end
If UpdatesAllowed EQ True$ then
obj_RDS_Test('SetReadSet',MetKeys<1,2>:@RM:oRTParms_L2,Override)
IF Get_Status(errCode) THEN
ErrMsg(errCode)
END
end
END
If UpdatesAllowed EQ True$ then
oRTParms = ''
oRTParms<ORP$THICK_READS> = EpiReads<EPI_READS$THICKNESS>
oRTParms<ORP$SHEET_RHO_READS> = EpiReads<EPI_READS$SHEET_RHO>
oRTParms<ORP$HGCV1_READS> = EpiReads<EPI_READS$HGCV1>
CONVERT @FM TO @RM IN oRTParms
obj_RDS_Test('SetReadSet',MetNo:@RM:oRTParms,Override)
IF Get_Status(errCode) THEN
Message = Error_Services('GetMessage')
ErrorNumber = Message[1, ':']
ErrorMessage = Message[Col2() + 1, ':']
If ErrorNumber EQ 'FS104' then
MsgStruct = ''
MsgStruct<MCOL$> = -1
MsgStruct<MROW$> = -1
// Users belonging to the SPEC_CHANGE security group will be allowed to override the block. However, these
// users must confirm that this is what they want.
If MemberOf(@User4, 'SPEC_CHANGE') then
Override = Msg(@Window, MsgStruct, 'YESNO', '', 'RDS Test' : @FM : ErrorMessage : @TM : @TM : 'Please confirm that you want to override.')
If Override EQ True$ then
obj_RDS_Test('SetReadSet',MetKeys<1,1>:@RM:oRTParms,Override)
end else
UpdatesAllowed = False$
end
end else
UpdatesAllowed = False$
Msg(@Window, MsgStruct, 'OK', '', 'RDS Test' : @FM : ErrorMessage)
end
end else
ErrMsg(errCode)
end
end
end
End_Dialog(@WINDOW,'')
Set_Property('RDS_TEST.MET_NO','DEFPROP',MetNo)
Send_Event('RDS_TEST','READ')
RETURN
* * * * * * *
Refresh:
* * * * * * *
RETURN
* * * * * * *
ReadingsDel:
* * * * * * *
DeletedRowIndex = Parm1
DeletedRowText = Parm2
CurrCtrl = Get_Property(@WINDOW,'FOCUS')
Dummy = Send_Message(CurrCtrl, "INSERT",DeletedRowIndex, DeletedRowText)
ErrMsg('Rows may not be inserted or deleted.')
RETURN

View File

@ -0,0 +1,158 @@
COMPILE FUNCTION Comm_Dialog_Hold(Method, Parm1, Parm2)
/*
Commuter module for Dialog_Hold window.
06/09/2004 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Set_Status, ErrMsg
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Msg
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Popup, Send_Message
EQU CRLF$ TO \0D0A\
$INSERT POPUP_EQUATES
$INSERT APPCOLORS
ErrTitle = 'Error in Comm_Dialog_Hold'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Method = 'Create' ; GOSUB Create
CASE Method = 'OK' ; GOSUB OK
CASE Method = 'Cancel' ; GOSUB Cancel
CASE Method = 'Close' ; GOSUB Close
CASE Method = 'Refresh' ; GOSUB Refresh
CASE Method = 'LU_UserID' ; GOSUB LU_UserID
CASE Method = 'UserIDLF' ; GOSUB UserIDLF
CASE 1
ErrMsg(ErrTitle:@SVM:'Unknown method ':QUOTE(Method):' passed to routine.')
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
obj_AppWindow('Create')
Transition = Parm1<1>
TableName = Parm1<2>
HoldType = Parm1<3>
IF HoldType = '' THEN HoldType = 'HOLD'
BEGIN CASE
CASE Transition = 'ON' AND HoldType = 'HOLD'
Set_Property(@WINDOW:'.WINDOW_LABEL_FIX','TEXT','Hold On')
WinText = 'Hold Change'
CASE Transition = 'OFF' AND HoldType = 'HOLD'
Set_Property(@WINDOW:'.WINDOW_LABEL_FIX','TEXT','Hold Off')
WinText = 'Hold Change'
CASE Transition = 'ON' AND HoldType = 'SHOLD'
Set_Property(@WINDOW:'.WINDOW_LABEL_FIX','TEXT','Ship Hold On')
WinText = 'Ship Hold Change'
CASE Transition = 'OFF' AND HoldType = 'SHOLD'
Set_Property(@WINDOW:'.WINDOW_LABEL_FIX','TEXT','Ship Hold Off')
WinText = 'Ship Hold Change'
CASE Transition = 'ESC'
Set_Property(@WINDOW:'.WINDOW_LABEL_FIX','TEXT','Start Escalation')
WinText = TableName:' Escalation Change'
CASE Transition = 'D-ESC'
Set_Property(@WINDOW:'.WINDOW_LABEL_FIX','TEXT','Stop Escalation')
WinText = TableName:' Escalation Change'
END CASE
Set_Property(@WINDOW,'TEXT',WinText) ; * Window title in top bar
UserName = OCONV(@USER4,'[XLATE_CONV,LSL_USERS*FIRST_LAST]')
Set_Property(@WINDOW:'.USER_ID','DEFPROP',@USER4)
Set_Property(@WINDOW:'.USER_NAME','DEFPROP',UserName)
Set_Property(@WINDOW:'.REASON','FOCUS',1)
RETURN
* * * * * * *
LU_UserID:
* * * * * * *
TypeOver = ''
TypeOver<PSELECT$> = 1
TypeOver<PDISPLAY$> = 'BY LAST_FIRST'
UserID = Popup(@WINDOW,TypeOver,'SHOW_USERS')
IF UserID NE '' THEN
Set_Property(@WINDOW:'.USER_ID','DEFPROP',UserID)
END ELSE
RETURN
END
* * * * * * *
UserIDLF:
* * * * * * *
UserID = Get_Property(@WINDOW:'.USER_ID','DEFPROP')
UserName = OCONV(UserID,'[XLATE_CONV,LSL_USERS*FIRST_LAST]')
Set_Property(@WINDOW:'.USER_NAME','DEFPROP',UserName)
RETURN
* * * * * * *
Refresh:
* * * * * * *
RETURN
* * * * * * *
Close:
* * * * * * *
* * * * * * *
Cancel:
* * * * * * *
End_Dialog(@WINDOW,'Cancel')
RETURN
* * * * * * *
OK:
* * * * * * *
UserID = Get_Property(@WINDOW:'.USER_ID','DEFPROP')
Reason = Get_Property(@WINDOW:'.REASON','DEFPROP')
Extended = Get_Property(@WINDOW:'.HOLD_EXTENDED','CHECK')
Result = UserID:@FM:Reason:@FM:Extended
End_Dialog(@WINDOW,Result)
RETURN

View File

@ -0,0 +1,729 @@
COMPILE FUNCTION Comm_Dialog_Load_Epi_Pro(Method, Parm1, Parm2)
#pragma precomp SRP_PreCompiler
/*
Commuter module for Dialog_Load_Epi_Pro window.
03/13/2006 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Set_Status, ErrMsg, obj_RDS2, Send_Event, RDS_React_Run, Send_Info
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Msg, End_Dialog, Send_Message, obj_WM_IN, obj_WM_Wfrs, obj_React_Status
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Popup, obj_WM_In, Send_Message, obj_NCR, obj_WM_Wfrs
DECLARE FUNCTION SRP_Array, Database_Services, Set_Property
EQU CRLF$ TO \0D0A\
$INSERT POPUP_EQUATES
$INSERT LOGICAL
$INSERT MSG_EQUATES
$INSERT RDS_EQU
$INSERT RDS_TEST_EQUATES
$INSERT EPI_SUSCEPTOR_EQUATES
$INSERT WO_LOG_EQUATES
$INSERT EPI_PART_EQUATES
$INSERT RDS_EPILOAD
$INSERT WO_STEP_EQU
$INSERT NCR_EQU
$INSERT APPCOLORS
EQU COL$WM_CASS_IN TO 1
EQU COL$WM_SLOT_IN TO 2
EQU COL$POCKET TO 1
EQU COL$USAGE TO 2
EQU COL$ZONE TO 3
EQU COL$IN_CASS TO 4
EQU COL$IN_SLOT TO 5
EQU COL$WAFER_TYPE TO 6
EQU COL$OUT_CASS TO 7
EQU COL$OUT_SLOT TO 8
EQU COL$NCR_NO TO 1
EQU COL$CASS_NO TO 2
EQU COL$SLOT_NO TO 3
EQU EDITABLE$ TO 4
EQU PROTECTED$ TO 8 ;* Protected - Edittable COLSTYLE constants
EQU MULTILINE_STYLE$ TO 512 ;* MultiLine Select
EQU LOCKED$ TO 8192
EQU DROPDOWN_STYLE$ TO 131072
ErrTitle = 'Error in Comm_Dialog_Load_Epi_Pro'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Method = 'Create' ; GOSUB Create
CASE Method = 'Cancel' ; GOSUB Cancel
CASE Method = 'Close' ; GOSUB Close
CASE Method = 'Refresh' ; GOSUB Refresh
CASE Method = 'LoadMat' ; GOSUB LoadMat
CASE Method = 'ReturnMat' ; GOSUB ReturnMat
CASE Method = 'ReactIR' ; GOSUB ReactIR
CASE Method = 'ReactDR' ; GOSUB ReactDR
CASE Method = 'TestRun' ; GOSUB TestRun
CASE Method = 'ConfigComp' ; GOSUB ConfigComp
CASE 1
ErrMsg(ErrTitle:@SVM:'Unknown method ':QUOTE(Method):' passed to routine.')
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
obj_AppWindow('Create')
* get the current style
Style = Get_Property(@WINDOW:'.WM_IN', 'STYLE')
IF Style [1,2] _EQC "0x" THEN
CONVERT @LOWER.CASE TO @UPPER.CASE IN STYLE
Style = ICONV(Style [3,99], "MX")
END
Style = BitOr(Style, MULTILINE_STYLE$)
Set_Property(@WINDOW:'.WM_IN', "STYLE", Style)
ReactorStyles = Send_Message(@WINDOW:'.REACTOR_TABLE','COLSTYLE',0,'')
ReactorStyles<COL$USAGE> = BitOr(ReactorStyles<COL$USAGE>,DROPDOWN_STYLE$)
Send_Message(@WINDOW:'.REACTOR_TABLE','COLSTYLE',0,ReactorStyles)
Send_Message(@WINDOW:'.REACTOR_TABLE','COLFORMAT',COL$USAGE,'TEST':@VM:'PROD':@VM:'DUMMY')
RDSNo = FIELD(Parm1,@FM,1)
CurrentLoad = FIELD(Parm1,@FM,2,99)
IF RDSNo = '' THEN
ErrMsg('Null RDS No passed to Dialog Box...')
End_Dialog(@WINDOW,'')
END
RDSRec = XLATE('RDS',RDSNo,'','X')
ReactorNo = RDSRec<RDS_REACTOR$>
WONo = RDSRec<RDS_WO$>
WOStep = FIELD(RDSRec<RDS_WO_STEP_KEY$>,'*',2)
Ctrls = @WINDOW:'.RDS_NO':@RM:@WINDOW:'.WO_NO':@RM:@WINDOW:'.WO_STEP':@RM:@WINDOW:'.REACTOR_NO'
Props = 'DEFPROP':@RM: 'DEFPROP':@RM: 'DEFPROP':@RM: 'DEFPROP'
Vals = RDSNo:@RM:WONo:@RM:WOStep:@RM:ReactorNo
Set_Property(Ctrls,Props,Vals)
LoadCnt = 0
OpenCnt = 0
RCtrl = @WINDOW:'.REACTOR_TABLE'
TestInCass = CurrentLoad<COL$IN_CASS> ;* 6/2/2009 JCH Better test for loaded wafers added
CONVERT @VM TO '' IN TestInCass ;* 6/2/2009 JCH
IF TestInCass = '' THEN
EpiPartNo = XLATE('WO_LOG',WONo,WO_LOG_EPI_PART_NO$,'X')
SubWaferSize = XLATE('EPI_PART',EpiPartNo,EPI_PART_SUB_WAFER_SIZE$,'X')
BEGIN CASE
CASE SubWaferSize = '150 mm 6 in'
EpiSusceptor = XLATE('EPI_SUSCEPTOR','6','','X')
CASE SubWaferSize = '125 mm 5 in'
EpiSusceptor = XLATE('EPI_SUSCEPTOR','5','','X')
CASE SubWaferSize = '200 mm 8 in'
EpiSusceptor = XLATE('EPI_SUSCEPTOR','8','','X')
CASE 1
ErrorMsg = 'Epi Part: ':QUOTE(EpiPartNo):' has a wafer size of ':SubWaferSize:'.':CRLF$:CRLF$
ErrorMsg := 'The EpiPRO reactors cannot process wafers of this size.'
ErrMsg(ErrorMsg)
End_Dialog(@WINDOW,'')
END CASE
Pockets = EpiSusceptor<EPI_SUSCEPTOR_POCKET_NO$>
Zones = EpiSusceptor<EPI_SUSCEPTOR_POCKET_ZONE$>
PTypes = EpiSusceptor<EPI_SUSCEPTOR_POCKET_TYPE$>
FOR I = 1 TO COUNT(Pockets,@VM) + (Pockets NE '')
Set_Property(RCtrl,'CELLPOS',Pockets<1,I>,COL$POCKET:@FM:I) ;* Loads Pocket Numbers - Default data from Susceptor Record
Set_Property(RCtrl,'CELLPOS',PTypes<1,I>,COL$USAGE:@FM:I) ;* Test pockets
Set_Property(RCtrl,'CELLPOS',Zones<1,I>,COL$ZONE:@FM:I) ;* Zones
OpenCnt += 1
NEXT I
END ELSE
FOR I = 1 TO COUNT(CurrentLoad<1>,@VM) + (CurrentLoad<1> NE '')
Set_Property(RCtrl,'CELLPOS',CurrentLoad<COL$POCKET,I>,COL$POCKET:@FM:I)
Set_Property(RCtrl,'CELLPOS',CurrentLoad<COL$USAGE,I>,COL$USAGE:@FM:I)
Set_Property(RCtrl,'CELLPOS',CurrentLoad<COL$ZONE,I>,COL$ZONE:@FM:I)
Set_Property(RCtrl,'CELLPOS',CurrentLoad<COL$IN_CASS,I>,COL$IN_CASS:@FM:I)
Set_Property(RCtrl,'CELLPOS',CurrentLoad<COL$IN_SLOT,I>,COL$IN_SLOT:@FM:I)
Set_Property(RCtrl,'CELLPOS',CurrentLoad<COL$WAFER_TYPE,I>,COL$WAFER_TYPE:@FM:I)
LoadCnt += 1
NEXT I
END
Set_Property(@WINDOW,'@OPEN_POCKETS',OpenCnt)
IF LoadCnt = 0 AND OpenCnt = 0 THEN
ErrMsg('LoadCnt = 0 and OpenCnt = 0, internal program error.')
End_Dialog(@WINDOW,'')
END
BEGIN CASE
CASE LoadCnt > 0
* Loaded
BriefTxt = '{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0 Arial;}}'
BriefTxt := '{\*\generator Msftedit 5.41.15.1515;}\viewkind4\uc1\pard\b\f0\fs20 Return Material to Inbound Cassette\par'
BriefTxt := '\b0\par'
BriefTxt := ' 1.) Return Material to Inbound Cassette\b\par'
BriefTxt := '\b0\par'
BriefTxt := '}'
Set_Property(@WINDOW:'.CONFIG_COMPLETE','VISIBLE',0)
Set_Property(@WINDOW:'.TEST_RUN','VISIBLE',0)
Set_Property(@WINDOW:'.LOAD_MATERIAL','VISIBLE',0)
Set_Property(@WINDOW:'.RETURN_MATERIAL','VISIBLE',1)
Set_Property(@WINDOW:'.LOAD_MATERIAL','ENABLED',0)
Set_Property(@WINDOW:'.RETURN_MATERIAL','ENABLED',1)
ReactorStyles = Send_Message(@WINDOW:'.REACTOR_TABLE','COLSTYLE',0,'')
ReactorStyles<COL$USAGE> = BitAnd(ReactorStyles<COL$USAGE>,BitNot(DROPDOWN_STYLE$))
ReactorStyles<COL$WAFER_TYPE> = BitAnd(ReactorStyles<COL$WAFER_TYPE>,BitNot(DROPDOWN_STYLE$))
ReactorStyles<COL$POCKET> = BitOr(ReactorStyles<COL$POCKET>,PROTECTED$)
ReactorStyles<COL$USAGE> = BitOr(ReactorStyles<COL$USAGE>,PROTECTED$)
ReactorStyles<COL$ZONE> = BitOr(ReactorStyles<COL$ZONE>,PROTECTED$)
ReactorStyles<COL$IN_CASS> = BitOr(ReactorStyles<COL$IN_CASS>,PROTECTED$)
ReactorStyles<COL$IN_SLOT> = BitOr(ReactorStyles<COL$IN_SLOT>,PROTECTED$)
ReactorStyles<COL$WAFER_TYPE> = BitOr(ReactorStyles<COL$WAFER_TYPE>,PROTECTED$)
Send_Message(@WINDOW:'.REACTOR_TABLE','COLFORMAT',COL$USAGE,'')
Send_Message(@WINDOW:'.REACTOR_TABLE','COLFORMAT',COL$WAFER_TYPE,'')
Send_Message(@WINDOW:'.REACTOR_TABLE','COLSTYLE',0,ReactorStyles)
CASE OpenCnt > 0
* Ready to Load
BriefTxt = '{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0 Arial;}}'
BriefTxt := '{\*\generator Msftedit 5.41.15.1515;}\viewkind4\uc1\pard\b\f0\fs20\par'
BriefTxt := ' Load Material into EPIPro Reactor\par'
BriefTxt := '\b0\par'
BriefTxt := ' 1.) Configure Pocket Utilization & Wafer Types\par'
BriefTxt := ' 2.) Check Load Configuration Complete checkbox\par'
BriefTxt := ' 3.) Verify Inbound Material\par'
BriefTxt := ' 4.) Load Material into Reactor\par'
BriefTxt := '\par'
BriefTxt := '}'
Set_Property(@WINDOW:'.CONFIG_COMPLETE','VISIBLE',1)
Set_Property(@WINDOW:'.TEST_RUN','VISIBLE',1)
Set_Property(@WINDOW:'.LOAD_MATERIAL','VISIBLE',1)
Set_Property(@WINDOW:'.RETURN_MATERIAL','VISIBLE',0)
Set_Property(@WINDOW:'.LOAD_MATERIAL','ENABLED',0)
Set_Property(@WINDOW:'.RETURN_MATERIAL','ENABLED',0)
ReactorStyles = Send_Message(@WINDOW:'.REACTOR_TABLE','COLSTYLE',0,'')
ReactorStyles<COL$USAGE> = BitOr(ReactorStyles<COL$USAGE>,DROPDOWN_STYLE$)
ReactorStyles<COL$WAFER_TYPE> = BitOr(ReactorStyles<COL$WAFER_TYPE>,DROPDOWN_STYLE$)
ReactorStyles<COL$POCKET> = BitAnd(ReactorStyles<COL$POCKET>,BitNot(PROTECTED$))
ReactorStyles<COL$ZONE> = BitAnd(ReactorStyles<COL$ZONE>,BitNot(PROTECTED$))
ReactorStyles<COL$IN_CASS> = BitAnd(ReactorStyles<COL$IN_CASS>,BitNot(PROTECTED$))
ReactorStyles<COL$IN_SLOT> = BitAnd(ReactorStyles<COL$IN_SLOT>,BitNot(PROTECTED$))
ReactorStyles<COL$WAFER_TYPE> = BitAnd(ReactorStyles<COL$WAFER_TYPE>,BitNot(PROTECTED$))
Send_Message(@WINDOW:'.REACTOR_TABLE','COLSTYLE',0,ReactorStyles)
Send_Message(@WINDOW:'.REACTOR_TABLE','COLFORMAT',COL$USAGE,'TEST':@VM:'PROD':@VM:'DUMMY')
Send_Message(@WINDOW:'.REACTOR_TABLE','COLFORMAT',COL$WAFER_TYPE,'':@VM:'TEST')
Set_Property('SYSTEM','FOCUS',@WINDOW:'.REACTOR_TABLE')
CASE 1
END CASE
Set_Property(@WINDOW:'.BRIEF_EDITBOX','RTFTEXT',BriefTxt)
WOStepKey = RDSRec<RDS_WO_STEP_KEY$>
WONo = WOStepKey[1,'*']
WOStep = WOStepKey[COL2()+1,'*']
GOSUB Refresh
RecordLocked = False$
InboundMat = Get_Property(@Window:'.WM_IN', 'ARRAY')
If InboundMat NE '' then
CassNos = InboundMat<1>
CassNos = SRP_Array('Clean', CassNos, 'TrimAndMakeUnique', @VM)
If CassNos NE '' then
For each CassNo in CassNos using @VM setting vPos
WMInKey = WONo:'*1*':CassNo
RecordLocked = Database_Services('IsKeyIDLocked', 'WM_IN', WMInKey)
If RecordLocked then
LockOwner = Xlate('WM_IN', WMInKey, 'LOCKED_BY', 'X')
If LockOwner NE '' then
DisplayName = Oconv(LockOwner,'[XLATE_CONV,LSL_USERS*FIRST_LAST]')
end else
DisplayName = 'an unknown user'
end
MsgParms = ''
MsgParms<1> = 'Record Locked'
MsgParms<2> = 'The WM_IN record for this RDS is locked by ':DisplayName:'. Only one user session at a time can edit an RDS.'
Msg(@Window, '', 'OK', '', MsgParms)
// Disable Load button
Set_Property(@Window:'.LOAD_MATERIAL', 'ENABLED', -1)
Set_Property(@Window:'.TEST_RUN', 'ENABLED', -1)
end
Until RecordLocked EQ True$
Next CassNo
end
end
RETURN
* * * * * * *
Close:
* * * * * * *
* * * * * * *
Cancel:
* * * * * * *
RDSNo = Get_Property(@WINDOW:'.RDS_NO','DEFPROP')
WMILocks = Get_Property(@WINDOW,'@LOCKED_WFRS')
IF WMILocks NE '' THEN
obj_WM_Wfrs('UnlockSet','WMI_WFRS':@RM:WMILocks) ; * Remove locks on the wafer slots
END
Set_Property(@WINDOW,'@LOCKED_WFRS','')
End_Dialog(@WINDOW,'')
IF RDSNo NE '' THEN
Set_Property('RDS.RDS_NO','DEFPROP',RDSNo)
Send_Event('RDS','READ')
END
RETURN
* * * * * * *
Refresh:
* * * * * * *
RCtrl = @WINDOW:'.REACTOR_TABLE'
WMICtrl = @WINDOW:'.WM_IN'
ReactorList = Get_Property(RCtrl,'LIST')
WMInList = Get_Property(WMICtrl,'LIST')
OpenTestCnt = 0
OpenProdCnt = 0
LineColor = ''
FOR I = 1 TO COUNT(ReactorList,@FM) + (ReactorList NE '')
IF ReactorList<I,COL$POCKET> NE '' THEN
IF ReactorList<I,COL$USAGE> = 'TEST' THEN
Send_Message(RCtrl,'COLOR_BY_POS',0,I,YELLOW$)
IF ReactorList<I,COL$WAFER_TYPE> = '' THEN OpenTestCnt += 1
END
IF ReactorList<I,COL$USAGE> = 'DUMMY' THEN
Send_Message(RCtrl,'COLOR_BY_POS',0,I,WHITE$)
END
IF ReactorList<I,COL$USAGE> = 'PROD' OR ReactorList<I,COL$USAGE> = '' THEN
Set_Property(RCtrl,'CELLPOS','',COL$USAGE:@FM:I)
Zone = ReactorList<I,COL$ZONE>
IF Zone = 1 THEN LineColor = RCV_BLUE$
IF Zone = 2 THEN LineColor = PRE_BLUE$
IF Zone = 3 THEN LineColor = INP_BLUE$
IF Zone = 4 THEN LineColor = POS_BLUE$
Send_Message(RCtrl,'COLOR_BY_POS',0,I,LineColor)
END
IF (ReactorList<I,COL$USAGE> = '' OR ReactorList<I,COL$USAGE> = 'PROD') AND ReactorList<I,COL$WAFER_TYPE> = '' THEN OpenProdCnt += 1
END
NEXT I
Set_Property(@WINDOW:'.OPEN_PROD_POCKETS','DEFPROP',OpenProdCnt)
Set_Property(@WINDOW:'.OPEN_TEST_POCKETS','DEFPROP',OpenTestCnt)
ReadyToLoad = 0
WMICnt = COUNT(WMInList,@FM) + (WMInList NE '')
FOR I = 1 TO WMICnt
IF WMInList<I,COL$WM_CASS_IN> NE '' THEN ReadyToLoad = 1
UNTIL ReadyToLoad
NEXT I
RDSNo = Get_Property(@Window:'.RDS_NO', 'TEXT')
BlockLoad = Xlate('RDS', RDSNo, 'BLOCK_LOAD', 'X')
If BlockLoad EQ True$ then ReadyToLoad = False$
IF ReadyToLoad THEN
Set_Property(@WINDOW:'.LOAD_MATERIAL','ENABLED',1)
END ELSE
Set_Property(@WINDOW:'.LOAD_MATERIAL','ENABLED',0)
END
RETURN
* * * * * * *
LoadMat:
* * * * * * *
WMInLoadList = Get_Property(@WINDOW:'.WM_IN','LIST')
ReactorList = Get_Property(@WINDOW:'.REACTOR_TABLE','LIST')
WONo = Get_Property(@WINDOW:'.WO_NO','DEFPROP')
WOStep = Get_Property(@WINDOW:'.WO_STEP','DEFPROP')
RDSNo = Get_Property(@WINDOW:'.RDS_NO','DEFPROP')
SelectedRows = ''
WMIWaferKeys = ''
FOR I = 1 TO COUNT(WMInLoadList,@FM) + (WMInLoadList NE '')
IF WMInLoadList<I,COL$WM_CASS_IN> NE '' AND WMInLoadList<I,COL$WM_SLOT_IN> NE '' THEN
WMIWaferKeys<1,-1> = WONo:'*':WOStep:'*':WMInLoadList<I,COL$WM_CASS_IN>:'*':WMInLoadList<I,COL$WM_SLOT_IN>
END
NEXT I
OrgColor = Set_Property('DIALOG_LOAD_EPI_PRO.STATUSLINE_FIX','BACKCOLOR',YELLOW$) ;* //////// Messaging
Set_Status(0)
obj_RDS2('LoadMat',RDSNo:@RM:ReactorList:@RM:WMIWaferKeys)
IF Get_Status(errCode) THEN
ErrMsg(errCode)
END
WMILocks = Get_Property(@WINDOW,'@LOCKED_WFRS')
IF WMILocks NE '' THEN
obj_WM_Wfrs('UnlockSet','WMI_WFRS':@RM:WMILocks) ; * Remove locks on the wafer slots
END
Set_Property(@WINDOW,'@LOCKED_WFRS','')
End_Dialog(@WINDOW,'')
Set_Property('RDS.RDS_NO','DEFPROP',RDSNo)
Send_Event('RDS','READ')
RETURN
GOSUB REFRESH
RETURN
* * * * * * *
ReturnMat:
* * * * * * *
RDSNo = Get_Property(@WINDOW:'.RDS_NO','DEFPROP')
IF RDSNo = '' THEN RETURN
OrgColor = Set_Property('DIALOG_LOAD_EPI_PRO.STATUSLINE_FIX','BACKCOLOR',YELLOW$) ;* //////// Messaging
Set_Status(0)
obj_RDS2('ReturnMat',RDSNo)
Send_Info(STR(' ',60)) ;** - Messaging - **
Dummy = Set_Property('DIALOG_LOAD_EPI_PRO.STATUSLINE_FIX','BACKCOLOR',OrgColor) ;** - Messaging - **
IF Get_Status(ErrCode) THEN
ErrMsg(ErrCode)
END
GOTO Close
RETURN
* * * * * * *
ReactIR:
* * * * * * *
RowIndex = Parm1
IF RowIndex = '' THEN RETURN
CtrlID = @WINDOW:'.REACTOR_TABLE'
Dummy = Send_Message(CtrlID,'DELETE',RowIndex)
GOSUB Refresh
RETURN
* * * * * * *
ReactDR:
* * * * * * *
RowIndex = Parm1
RowData = Parm2
IF RowIndex = '' THEN RETURN
CtrlID = @WINDOW:'.REACTOR_TABLE'
Dummy = Send_Message(CtrlID, "INSERT", RowIndex, RowData)
GOSUB Refresh
RETURN
* * * * * * *
TestRun:
* * * * * * *
ReactorArray = Get_Property(@WINDOW:'.REACTOR_TABLE','ARRAY')
Usage = ReactorArray<COL$USAGE>
IF INDEX(Usage,'PROD',1) = 0 THEN
LineCnt = COUNT(Usage,@VM) + (Usage NE '')
FOR I = 1 To LineCnt
IF ReactorArray<COL$POCKET,I> NE '' AND Usage<1,I> = '' THEN
ReactorArray<COL$USAGE,I> = 'DUMMY'
END
Set_Property(@WINDOW:'.REACTOR_TABLE','ARRAY',ReactorArray)
NEXT I
END
GOSUB Refresh
RETURN
* * * * * * *
ConfigComp:
* * * * * * *
GOSUB Refresh
WONo = Get_Property(@WINDOW:'.WO_NO','DEFPROP')
WOStep = Get_Property(@WINDOW:'.WO_STEP','DEFPROP')
CComp = Get_Property(@WINDOW:'.CONFIG_COMPLETE','CHECK')
IF CComp THEN
* Check for more pockets configured than avaible inbound wafers *
WONo = Get_Property(@WINDOW:'.WO_NO','DEFPROP')
WOStep = Get_Property(@WINDOW:'.WO_STEP','DEFPROP')
RemainingWafers = obj_WM_In('RemainingSlots',WONo:@RM:WoStep)
RWCnt = COUNT(RemainingWafers,@FM) + (RemainingWafers NE '')
OpenProdPockets = Get_Property(@WINDOW:'.OPEN_PROD_POCKETS','DEFPROP')
OpenTestPockets = Get_Property(@WINDOW:'.OPEN_TEST_POCKETS','DEFPROP')
OpenPockets = OpenProdPockets + OpenTestPockets
IF OpenPockets > RWCnt THEN
Title = 'EpiPRO Reactor Load Configuration'
Message = 'There are more slots configured for loading (':OpenPockets:') than WMI wafers remaining to load (':RWCnt:').':CRLF$:CRLF$
Message := 'Change ':(OpenPockets - RWCnt):' additional pockets to DUMMY load to correct.'
TypeOver = ''
TypeOver<MICON$> = '*'
Msg(@WINDOW,TypeOver,'OK','',Title:@FM:Message)
Set_Property(@WINDOW:'.CONFIG_COMPLETE','CHECK',0)
RETURN
END ;* End of check for more open slots than WMI wafers remaining to be used.
* "lock down" reactor setup fields from further changes *
ReactorStyles = Send_Message(@WINDOW:'.REACTOR_TABLE','COLSTYLE',0,'')
ReactorStyles<COL$USAGE> = BitAnd(ReactorStyles<COL$USAGE>,BitNot(DROPDOWN_STYLE$))
ReactorStyles<COL$WAFER_TYPE> = BitAnd(ReactorStyles<COL$WAFER_TYPE>,BitNot(DROPDOWN_STYLE$))
ReactorStyles<COL$POCKET> = BitOr(ReactorStyles<COL$POCKET>,PROTECTED$)
ReactorStyles<COL$USAGE> = BitOr(ReactorStyles<COL$USAGE>,PROTECTED$)
ReactorStyles<COL$ZONE> = BitOr(ReactorStyles<COL$ZONE>,PROTECTED$)
ReactorStyles<COL$IN_CASS> = BitOr(ReactorStyles<COL$IN_CASS>,PROTECTED$)
ReactorStyles<COL$IN_SLOT> = BitOr(ReactorStyles<COL$IN_SLOT>,PROTECTED$)
ReactorStyles<COL$WAFER_TYPE> = BitOr(ReactorStyles<COL$WAFER_TYPE>,PROTECTED$)
Send_Message(@WINDOW:'.REACTOR_TABLE','COLFORMAT',COL$USAGE,'')
Send_Message(@WINDOW:'.REACTOR_TABLE','COLFORMAT',COL$WAFER_TYPE,'')
Send_Message(@WINDOW:'.REACTOR_TABLE','COLSTYLE',0,ReactorStyles)
Set_Property(@WINDOW:'.TEST_RUN','VISIBLE',0)
* Build list of WMI wafers to load *
NeededProduct = FIELD(RemainingWafers,@FM,1,OpenPockets)
WMIWaferKeys = ''
WMICnt = COUNT(NeededProduct,@FM) + (NeededProduct NE '')
FOR I = 1 TO WMICnt
WMIWaferKeys<1,I> = WONo:'*':WOStep:'*':NeededProduct<I,1>:'*':NeededProduct<I,2>
NEXT I
Set_Status(0)
LockedWMIKeys = obj_WM_Wfrs('LockSet','WMI_WFRS':@RM:WMIWaferKeys)
IF Get_Status(errCode) THEN
ErrMsg(errCode)
RETURN
END ELSE
Set_Property(@WINDOW,'@LOCKED_WFRS',LockedWMIKeys)
END
FOR M = 1 TO OpenPockets
Set_Property(@WINDOW:'.WM_IN','CELLPOS',NeededProduct<M,1>,1:@FM:M)
Set_Property(@WINDOW:'.WM_IN','CELLPOS',NeededProduct<M,2>,2:@FM:M)
NEXT M
FOR M = OpenPockets + 1 TO 25
Set_Property(@WINDOW:'.WM_IN','CELLPOS','',1:@FM:M)
Set_Property(@WINDOW:'.WM_IN','CELLPOS','',2:@FM:M)
NEXT M
END ELSE
ReactorStyles = Send_Message(@WINDOW:'.REACTOR_TABLE','COLSTYLE',0,'')
ReactorStyles<COL$USAGE> = BitOr(ReactorStyles<COL$USAGE>,DROPDOWN_STYLE$)
ReactorStyles<COL$WAFER_TYPE> = BitOr(ReactorStyles<COL$WAFER_TYPE>,DROPDOWN_STYLE$)
ReactorStyles<COL$POCKET> = BitAnd(ReactorStyles<COL$POCKET>,BitNot(PROTECTED$))
ReactorStyles<COL$USAGE> = BitAnd(ReactorStyles<COL$USAGE>,BitNot(PROTECTED$))
ReactorStyles<COL$ZONE> = BitAnd(ReactorStyles<COL$ZONE>,BitNot(PROTECTED$))
ReactorStyles<COL$IN_CASS> = BitAnd(ReactorStyles<COL$IN_CASS>,BitNot(PROTECTED$))
ReactorStyles<COL$IN_SLOT> = BitAnd(ReactorStyles<COL$IN_SLOT>,BitNot(PROTECTED$))
ReactorStyles<COL$WAFER_TYPE> = BitAnd(ReactorStyles<COL$WAFER_TYPE>,BitNot(PROTECTED$))
Send_Message(@WINDOW:'.REACTOR_TABLE','COLFORMAT',COL$USAGE,'TEST':@VM:'PROD':@VM:'DUMMY')
Send_Message(@WINDOW:'.REACTOR_TABLE','COLFORMAT',COL$WAFER_TYPE,'':@VM:'TEST')
Send_Message(@WINDOW:'.REACTOR_TABLE','COLSTYLE',0,ReactorStyles)
Set_Property(@WINDOW:'.TEST_RUN','VISIBLE',1)
LockedWMIKeys = Get_Property(@WINDOW,'@LOCKED_WFRS')
Set_Status(0)
obj_WM_Wfrs('UnlockSet','WMI_WFRS':@RM:LockedWMIKeys)
IF Get_Status(errCode) THEN
ErrMsg(errCode)
RETURN
END ELSE
Set_Property(@WINDOW,'@LOCKED_WFRS','')
END
FOR M = 1 TO 25
Set_Property(@WINDOW:'.WM_IN','CELLPOS','',1:@FM:M)
Set_Property(@WINDOW:'.WM_IN','CELLPOS','',2:@FM:M)
NEXT M
END
GOSUB Refresh
RecordLocked = False$
InboundMat = Get_Property(@Window:'.WM_IN', 'ARRAY')
If InboundMat NE '' then
CassNos = InboundMat<1>
CassNos = SRP_Array('Clean', CassNos, 'TrimAndMakeUnique', @VM)
If CassNos NE '' then
For each CassNo in CassNos using @VM setting vPos
WMInKey = WONo:'*1*':CassNo
RecordLocked = Database_Services('IsKeyIDLocked', 'WM_IN', WMInKey)
If RecordLocked then
LockOwner = Xlate('WM_IN', WMInKey, 'LOCKED_BY', 'X')
If LockOwner NE '' then
DisplayName = Oconv(LockOwner,'[XLATE_CONV,LSL_USERS*FIRST_LAST]')
end else
DisplayName = 'an unknown user'
end
MsgParms = ''
MsgParms<1> = 'Record Locked'
MsgParms<2> = 'The WM_OUT record for this RDS is locked by ':DisplayName:'. Only one user session at a time can edit an RDS.'
Msg(@Window, '', 'OK', '', MsgParms)
// Disable Load button
Set_Property(@Window:'.LOAD_MATERIAL', 'ENABLED', -1)
Set_Property(@Window:'.TEST_RUN', 'ENABLED', -1)
Set_Property(@Window:'.CONFIG_COMPLETE', 'ENABLED', -1)
end
Until RecordLocked EQ True$
Next CassNo
end
end
RETURN

View File

@ -0,0 +1,406 @@
COMPILE FUNCTION Comm_Dialog_Lot_No_Change(Method, Parm1)
/*
Commuter module for Dialog_Lot_No_Change window.
05/06/2004 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Set_Status, ErrMsg
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Msg, Btree.Extract
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Popup, Send_Message
EQU CRLF$ TO \0D0A\
$INSERT APPCOLORS
$INSERT POPUP_EQUATES
$INSERT LOGICAL
$INSERT WO_MAT_EQUATES
EQU COL$WM_CASS_NO TO 1
EQU COL$WM_LOT_NO TO 2
EQU COL$WM_RDS_NO TO 3
EQU COL$LOT_NO TO 1
EQU COL$CASS_NOS TO 2
ErrTitle = 'Error in Comm_Dialog_Lot_No_Change'
ErrorMsg = ''
ErrCode = ''
Result = ''
BEGIN CASE
CASE Method = 'Create' ; GOSUB Create
CASE Method = 'OrgLotNoLF' ; GOSUB OrgLotNoLF
CASE Method = 'NewLotNoLF' ; GOSUB NewLotNoLF
CASE Method = 'CassNoLF' ; GOSUB CassNoLF
CASE Method = 'SelectCassettes' ; GOSUB SelectCassettes
CASE Method = 'SelectOriginal' ; GOSUB SelectOriginal
CASE Method = 'SelectNew' ; GOSUB SelectNew
CASE Method = 'LULotNo' ; GOSUB LULotNo
CASE Method = 'OK' ; GOSUB OK
CASE Method = 'Cancel' ; GOSUB Cancel
CASE Method = 'Refresh' ; GOSUB Refresh
CASE Method = 'LotNoPC' ; GOSUB LotNoPC
CASE 1
ErrMsg(ErrTitle:@SVM:'Unknown method ':QUOTE(Method):' passed to routine.')
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
obj_AppWindow('Create')
WONo = Parm1[1,@FM]
Title = 'Work Order: ':WONo:' - Lot No Change'
Set_Property(@WINDOW,'TEXT',Title)
OPEN 'DICT.WO_MAT' TO DictVar ELSE
ErrMsg('Unable to open "DICT.WO_MAT" for index lookup in COMM_DIALOG_LOT_NO_CHANGE routine.')
RETURN
END
SearchString = 'WO_NO':@VM:WONo:@FM
WOMatKeys = ''
Flag = ''
Btree.Extract(SearchString, 'WO_MAT', DictVar, WOMatKeys, '', Flag)
IF Get_Status(errCode) THEN
ErrMsg(errCode)
RETURN
END
IF INDEX(WOMatKeys,@VM,1) THEN
WOMatKeys := @VM
CONVERT @VM TO @RM IN WOMatKeys
CALL V119('S','','A','R',WOMatKeys,'')
IF Get_Status(errCode) THEN DEBUG
CONVERT @RM TO @VM IN WOMatKeys
WOMatKeys[-1,1] = '' ;* Strip trailing delimiter
END ELSE
NULL
END
WOMatList = ''
LotNoArray = ''
LotNos = ''
CassNos = ''
RDSNos = ''
OPEN 'WO_MAT' TO WOMatTable ELSE
ErrMsg('Unable to open "WO_MAT" for reads in COMM_DIALOG_LOT_NO_CHANGE - Create Event')
RETURN
END
kCnt = COUNT(WOMatKeys,@VM) + (WOMatKeys NE '')
FOR I = 1 TO kCnt
WOMatKey = WOMatKeys<1,I>
READ WOMatRec FROM WOMatTable,WOMatKey THEN
CassNo = FIELD(WOMatKey,'*',2)
LotNo = WOMatRec<WO_MAT_LOT_NO$>
RDSNos = WOMatRec<WO_MAT_RDS_NO$>
SWAP @VM WITH ', ' IN RDSNos
WOMatList<I> = CassNo:@VM:LotNo:@VM:RDSNos
LOCATE LotNo IN LotNos USING @FM SETTING Pos THEN
LOCATE CassNo IN CassNos<Pos> USING @VM SETTING vPos ELSE
CassNos = INSERT(CassNos,Pos,vPos,0,CassNo)
END
END ELSE
LotNos = INSERT(LotNos,Pos,0,0,LotNo)
CassNos = INSERT(CassNos,Pos,0,0,CassNo)
END
END
NEXT I
Set_Property(@WINDOW:'.WO_MAT_KEYS','LIST',WOMatList)
SWAP @VM WITH ', ' IN CassNos
CONVERT @FM TO @VM IN CassNos
CONVERT @FM TO @VM IN LotNos
LotNoArray = LotNos:@FM:CassNos
Set_Property(@WINDOW:'.LOT_NOS','DEFPROP',LotNoArray)
RETURN
* * * * * * *
LotNoPC:
* * * * * * *
CtrlEntID = @WINDOW:'.LOT_NOS'
CurrList = Get_Property(CtrlEntID,'LIST')
CurrPos = Get_Property(CtrlEntID,'SELPOS')
CurrCol = CurrPos<1>
CurrRow = CurrPos<2>
CurrLotNo = CurrList<CurrRow,COL$LOT_NO>
CurrCassNos = CurrList<CurrRow,COL$CASS_NOS>
WOMatCtrl = @WINDOW:'.WO_MAT_KEYS'
WOMatList = Get_Property(WOMatCtrl,'LIST')
LineCnt = COUNT(WOMatList,@FM) + (WOMatList NE '')
FOR Line = 1 TO LineCnt
LineLotNo = WOMatList<Line,COL$WM_LOT_NO>
IF LineLotNo = CurrLotNo THEN
stat = Send_Message(WOMatCtrl,'COLOR_BY_POS',0,Line,YELLOW$)
END ELSE
stat = Send_Message(WOMatCtrl,'COLOR_BY_POS',0,Line,GREEN$)
END
NEXT Line
RETURN
* * * * * * *
LULotNo:
* * * * * * *
* * * * * NOT USED JCH - Remove when done on 2 DEC 2016 **********************************************
ReturnCtrl = Parm1[1,@RM]
IF ReturnCtrl = '' THEN ReturnCtrl = Get_Property(@WINDOW,'FOCUS')
LotList = Get_Property(@WINDOW,'@LOT_NOS')
TypeOver = ''
TypeOver<PDISPLAY$> = LotList
RetVal = Popup(@WINDOW,TypeOver,'CUST_LOT_NO')
IF RetVal NE '' THEN
obj_Appwindow('LUValReturn',RetVal:@RM:ReturnCtrl)
END
RETURN
* * * * * * *
SelectOriginal:
* * * * * * *
CtrlEntID = @WINDOW:'.LOT_NOS'
CurrList = Get_Property(CtrlEntID,'LIST')
CurrPos = Get_Property(CtrlEntID,'SELPOS')
CurrCol = CurrPos<1>
CurrRow = CurrPos<2>
CurrLotNo = CurrList<CurrRow,COL$LOT_NO>
Set_Property(@WINDOW:'.ORG_LOT_NO','DEFPROP',CurrLotNo)
Return
* * * * * * *
OrgLotNoLF:
* * * * * * *
OrgLotNo = Get_Property(@WINDOW:'.ORG_LOT_NO','TEXT')
IF OrgLotNo = '' THEN RETURN
ValidLotNos = Get_Property(@WINDOW,'@LOT_NOS')
LOCATE OrgLotNo IN ValidLotNos USING @VM SETTING Pos ELSE
ErrMsg('Lot No:':QUOTE(OrgLotNo):' is not on this Work Order!')
Set_Property(@WINDOW,'FOCUS',@WINDOW:'.ORG_LOT_NO')
Set_Property(@WINDOW:'.ORG_LOT_NO','TEXT','')
END
Return
* * * * * * *
SelectNew:
* * * * * * *
CtrlEntID = @WINDOW:'.LOT_NOS'
CurrList = Get_Property(CtrlEntID,'LIST')
CurrPos = Get_Property(CtrlEntID,'SELPOS')
CurrCol = CurrPos<1>
CurrRow = CurrPos<2>
CurrLotNo = CurrList<CurrRow,COL$LOT_NO>
Set_Property(@WINDOW:'.NEW_LOT_NO','DEFPROP',CurrLotNo)
Return
* * * * * * *
NewLotNoLF:
* * * * * * *
Return
* * * * * * *
SelectCassettes:
* * * * * * *
WOMatCtrl = @WINDOW:'.WO_MAT_KEYS'
WOMatKeyList = Get_Property(WOMatCtrl,'LIST')
SlotSelection = Get_Property(WOMatCtrl,'SELPOS')
SelectedRows = SlotSelection<2>
CONVERT @VM TO @FM in SelectedRows
SelCnt = COUNT(SelectedRows,@FM) + (SelectedRows NE '')
IF SelCnt = 0 THEN
ErrMsg('No WO Cassettes selected.')
RETURN
End
CassNoDisp = ''
For I = 1 To SelCnt
SelectedRow = SelectedRows<I>
CassNoDisp<-1> = WOMatKeyList<SelectedRow,COL$WM_CASS_NO>
Next I
Swap @FM With ', ' In CassNoDisp
Set_Property(@WINDOW:'.CASS_NOS','DEFPROP',CassNoDisp)
RETURN
* * * * * * *
CassNoLF:
* * * * * * *
Return
* * * * * * *
Refresh:
* * * * * * *
RETURN
* * * * * * *
Close:
* * * * * * *
* * * * * * *
Cancel:
* * * * * * *
End_Dialog(@WINDOW,'Cancel')
RETURN
* * * * * * *
OK:
* * * * * * *
Ctrls = @WINDOW:'.ORG_LOT_NO':@RM ; Props = 'DEFPROP':@RM
Ctrls := @WINDOW:'.NEW_LOT_NO':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.REASON':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.CASS_NOS' ; Props := 'DEFPROP'
Vals = Get_Property(Ctrls,Props)
OrgLotNo = Vals[1,@RM]
NewLotNo = Vals[COL2()+1,@RM]
Reason = Vals[COL2()+1,@RM]
CassNos = Vals[COL2()+1,@RM]
Swap ', ' With @VM In CassNos
IF OrgLotNo = '' THEN
ErrMsg('Original Lot Number is a required field and must be filled in.')
Set_Property(@WINDOW,'FOCUS',@WINDOW:'.ORG_LOT_NO')
RETURN
END
IF NewLotNo = '' THEN
ErrMsg('New Lot Number is a required field and must be filled in.')
Set_Property(@WINDOW,'FOCUS',@WINDOW:'.NEW_LOT_NO')
RETURN
END
IF Reason = '' THEN
ErrMsg('Reason is a required field and must be filled in.')
Set_Property(@WINDOW,'FOCUS',@WINDOW:'.REVISION')
RETURN
END
IF CassNos = '' THEN
ErrMsg('CassNos is a required field and must be filled in.')
Set_Property(@WINDOW,'FOCUS',@WINDOW:'.CASS_NOS')
RETURN
END
Result = OrgLotNo
Result<2> = NewLotNo
Result<3> = Reason
Result<4> = CassNos
End_Dialog(@WINDOW,Result)
RETURN

View File

@ -0,0 +1,764 @@
COMPILE FUNCTION Comm_Dialog_Mat_Scan(Instruction, Parm1,Parm2)
#pragma precomp SRP_PreCompiler
/*
Commuter module for Dialog_Mat_Scan (Material - Barcode Scan) window
10/24/2004 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, Set_Status, ErrMsg, Set_Property, Dialog_Box, obj_WO_Mat_Log, Logging_Services
DECLARE SUBROUTINE Btree.Extract, Send_Event, Security_Err_Msg, obj_Appwindow, End_Dialog, End_Window
DECLARE SUBROUTINE Send_Message, Print_Cass_Ship_Label, Print_SAP_Cass_Ship_Label, Post_Event
DECLARE FUNCTION Get_Property, Get_Status, Popup, Send_Message, Msg, Security_Check, Dialog_Box, Logging_Services
DECLARE FUNCTION obj_Schedule, Dialog_Box, Utility, obj_WO_Mat, Database_Services, Environment_Services, Start_Window, End_Window
$INSERT RDS_EQUATES
$INSERT REACT_RUN_EQUATES
$INSERT WO_LOG_EQUATES
$INSERT POPUP_EQUATES
$INSERT LOGICAL
$INSERT MSG_EQUATES
$INSERT APPCOLORS
$INSERT LSL_USERS_EQU
$INSERT SECURITY_RIGHTS_EQU
$INSERT WO_MAT_EQUATES
Equ Tab$ to \09\
Equ CRLF$ to \0D0A\
Equ LF$ to \0A\
Equ Comma$ to ','
EQU COL$LABEL_SCAN TO 1
EQU COL$CURR_STATUS TO 2
EQU COL$CURR_LOC TO 3
EQU COL$CR_COMP TO 4
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\WoMatLog'
LogDate = Oconv(Date(), 'D4/')
LogTime = Oconv(Time(), 'MTS')
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' Material Log.csv'
Headers = 'Logging DTM' : @FM : 'User' : @FM : 'Notes'
objLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, Comma$, Headers, '', False$, False$)
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
ErrTitle = 'Error in Comm_Dialog_Mat_Scan'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Instruction = 'Create' ; GOSUB Create
CASE Instruction = 'Refresh' ; GOSUB Refresh
CASE Instruction = 'OK' ; GOSUB OK
CASE Instruction = 'Cancel' ; GOSUB Cancel
CASE Instruction = 'CassIDPC' ; GOSUB CassIDPC
CASE Instruction = 'LocLF' ; GOSUB LocLF
CASE 1
ErrorMsg = 'Unknown Instruction passed to routine'
END CASE
IF ErrorMsg NE '' THEN
ErrMsg(ErrTitle:@SVM:ErrorMsg)
END
RETURN Result
* * * * * * *
Create:
* * * * * * *
IF @User4 EQ 'DAN_CR' OR @User4 EQ 'DON_T' OR @User4 EQ 'MADELINE_S' OR @User4 EQ 'JUSTIN_H' OR @User4 EQ 'JOSEPH_F' THEN
Set_Property(@WINDOW:'.BTN_NEW','VISIBLE',True$)
END
IF NOT(Security_Check('RDS',READ$)) THEN
Security_Err_Msg('RDS',READ$)
End_Dialog(@WINDOW,'Cancel')
RETURN
END
obj_Appwindow('Create',@WINDOW)
IF Parm1<1,1> = 'Ship' THEN
WONo = Parm1<1,2>[-1,'B ']
Set_Property(@WINDOW,'@WONO',WONo)
Set_Property(@WINDOW,'@SHIPMENT',1)
Set_Property(@WINDOW,'TEXT',Parm1<1,2>)
Set_Property(@WINDOW:'.WINDOW_LABEL','TEXT','Scan WO ':WONo:' Shipment')
END ELSE
Set_Property(@WINDOW:'@SHIPMENT','')
Set_Property(@WINDOW:'@WONO','')
END
GOSUB Refresh
RETURN
* * * * * * *
Clear:
* * * * * * *
Send_Event(@WINDOW,'PAGE',1)
GOTO Refresh
RETURN
* * * * * * *
Refresh:
* * * * * * *
WindowLabel = Get_Property(@WINDOW:'.WINDOW_LABEL','TEXT')
IF INDEX(WindowLabel,' IN ',1) THEN
BackColor = GREEN$
END ELSE
BackColor = YELLOW$
END
CtrlName = @WINDOW:'.CASS_IDS'
CassArray = Get_Property(CtrlName,'DEFPROP')
CassStatuses = CassArray<COL$CURR_STATUS> ;* Second Column
CurrLocations = CassArray<COL$CURR_LOC>
CurrCRCompFlags = ICONV(CassArray<COL$CR_COMP>,'B')
Location = Get_Property(@WINDOW:'.LOCATION_CODE','DEFPROP')
SWAP '\J' WITH '*' IN Location
Beeped = 0
FOR I = 1 TO COUNT(CassStatuses,@VM) + (CassStatuses NE '')
CassStatus = CassStatuses<1,I>
CurrLocation = CurrLocations<1,I>
CurrCRCompFlag = CurrCRCompFlags<1,I>
BEGIN CASE
CASE Location[-3,3] = 'PTO' AND CurrLocation NE ''
IF CurrCRCompFlag OR CassStatus = 'Verify Qty' THEN
stat = Send_Message(CtrlName,'COLOR_BY_POS',0,I,GREEN$)
END ELSE
stat = Send_Message(CtrlName,'COLOR_BY_POS',0,I,RED$)
IF NOT(Beeped) THEN
void = Utility('BEEP')
Beeped = 1
END
END
CASE Location[-2,2] = 'SB' AND CurrLocation NE ''
IF INDEX(CassStatus,'-',1) THEN
CassStatus = FIELD(CassStatus,'-',1)
CassStatus = TRIM(CassStatus)
END
IF CassStatus[-4,4] NE 'Ship' THEN
stat = Send_Message(CtrlName,'COLOR_BY_POS',0,I,RED$)
IF NOT(Beeped) THEN
void = Utility('BEEP')
Beeped = 1
END
END ELSE
stat = Send_Message(CtrlName,'COLOR_BY_POS',0,I,GREEN$)
END
CASE 1
stat = Send_Message(CtrlName,'COLOR_BY_POS',0,I,GREEN$)
END CASE
NEXT I
IF Beeped = 1 THEN
Set_Property(@WINDOW:'.OK_BUTTON','ENABLED',0)
END ELSE
Set_Property(@WINDOW:'.OK_BUTTON','ENABLED',1)
END
LastLabel = CassArray<COL$LABEL_SCAN>[-1,'B':@VM]
IF LastLabel NE '' THEN
Send_Message(CtrlName, "INSERT", -1,'':@VM :'') ;* Insert blank row at bottom of the list
Set_Property(CtrlName,'SELPOS',1:@FM:-1) ;* Move cursor down
END
RETURN
* * * * * * *
OK:
* * * * * * *
LocCd = Get_Property(@WINDOW:'.LOCATION_CODE','DEFPROP')
IF LocCd = '' THEN
ErrMsg('Missing Location Code')
RETURN
END
SWAP '/J' WITH '*' IN LocCd
WhCd = LocCd[1,'*']
LocCd = LocCd[COL2()+1,'*']
CassIDs = Get_Property(@WINDOW:'.CASS_IDS','ARRAY')<1>
LOOP
UNTIL CassIDs[-1,1] NE @VM OR CassIDs = ''
CassIDs[-1,1] = ''
REPEAT
IF CassIDs<1,1> = '' THEN RETURN
TestCassID = CassIDs<1,1>
Convert '*' to '.' in TestCassID
Action = 'PLACE' ;* Default Action
PrintLabelWOs = ''
PLSteps = ''
PLCassNos = ''
PLRDSNos = ''
IF INDEX(TestCassID,'.',2) THEN EpiPRO = 1 ELSE EpiPRO = 0
IF INDEX(TestCassID,'.',1) THEN GaN = 1 ELSE GaN = 0
IF LocCd = 'PTO' THEN
PrintLabelWOs = Get_Property(@WINDOW,'@WONO') ;
FOR I = 1 To COUNT(CassIDs,@VM) + (CassIDs NE '')
CassID = CassIDs<1,I>
BEGIN CASE
CASE EpiPRO EQ True$
IF CassID[1,1] = 'O' THEN CassID[1,1] = ''
IF CassID[1,1] = 'I' THEN CassID[1,1] = ''
WONo = FIELD(CassID,'.',1)
StepNo = FIELD(CassID,'.',2)
CassNo = FIELD(CassID,'.',3)
RDSNo = ''
CASE GaN EQ True$
IF CassID[1,1] = 'O' THEN CassID[1,1] = ''
IF CassID[1,1] = 'I' THEN CassID[1,1] = ''
Convert '*' to '.' in CassID
WONo = FIELD(CassID,'.',1)
StepNo = 1
CassNo = FIELD(CassID,'.',2)
RDSNo = ''
CASE Otherwise$
RDSNo = CassID
ReactRunRec = XLATE('REACT_RUN',RDSNo,'','X')
WONo = ReactRunRec<REACT_RUN_WO_NO$>
StepNo = ReactRunRec<REACT_RUN_WO_STEP$>
CassNo = ReactRunRec<REACT_RUN_CASS_NO$>
END CASE
PLSteps<1,-1> = StepNo ;
PLCassNos<1,-1> = CassNo ;
PLRDSNos<1,-1> = RDSNo ;
NEXT I
WOCnt = COUNT(PrintLabelWOs,@FM) + (PrintLabelWOs NE '')
FOR I = 1 TO WOCnt
PrintLabelWO = PrintLabelWOs<I>
PrintLabelProdOrd = XLATE('WO_LOG',PrintLabelWO,WO_LOG_PROD_ORD_NO$,'X')
IF PrintLabelProdOrd NE '' THEN
Print_SAP_Cass_Ship_Label(PrintLabelWO,PLSteps<I>,PLCassNos<I>,PLRDSNos<I>)
END
NEXT I
END
IF Get_Property(@WINDOW,'@SHIPMENT') THEN
IF INDEX(TestCassID,'.',2) THEN EpiPRO = 1 ELSE EpiPRO = 0
Result = '' ;* This gets returned to COMM_SHIPMENT and placed on the shipment record
FOR I = 1 To COUNT(CassIDs,@VM) + (CassIDs NE '')
CassID = CassIDs<1,I>
IF NOT(EpiPRO) THEN
RDSNo = CassID
ReactRunRec = XLATE('REACT_RUN',RDSNo,'','X')
WONo = ReactRunRec<REACT_RUN_WO_NO$>
StepNo = ReactRunRec<REACT_RUN_WO_STEP$>
CassNo = ReactRunRec<REACT_RUN_CASS_NO$>
Result<-1> = StepNo:@VM:CassNo:@VM:RDSNo
END ELSE
IF CassID[1,1] = 'O' THEN CassID[1,1] = ''
IF CassID[1,1] = 'I' THEN CassID[1,1] = ''
Step = FIELD(CassID,'.',2)
CassNo = FIELD(CassID,'.',3)
Result<-1> = Step:@VM:CassNo
END
NEXT I
Action = 'SHIP'
END
CurrDTM = OCONV(Date(),'D2/'):' ':OCONV(Time(),'MTS')
WONos = ''
CassNos = ''
CassCnt = COUNT(CassIDs,@VM) + (CassIDs NE '')
FOR I = 1 TO CassCnt
CassID = CassIDs<1,I>
BEGIN CASE
CASE ( (EpiPro EQ True$) or (GaN EQ True$) )
IF CassID[1,1] = 'I' OR CassID[1,1] = 'O' THEN CassID[1,1] = '' ;* Skip the first character (I or O)
Convert '*' to '.' in CassID
WONos<1,I> = CassID[1,'.']
CassNos<1,I> = CassID[-1,'B.']
CASE Otherwise$
* Numeric CassID is an RDS
ReactRunRec = XLATE('REACT_RUN',CassID,'','X')
WONos<1,I> = ReactRunRec<REACT_RUN_WO_NO$>
CassNos<1,I> = ReactRunRec<REACT_RUN_CASS_NO$>
END CASE
NEXT I
UserID = @USER4
IF UserID = '' THEN UserID = @USERNAME
LogFile = 'WO_MAT' ;* Changed so all scans are logged in the WO_MAT table 12/3/2006
Set_Status(0)
// Log form contents
FormContents = Get_Property(@Window:'.CASS_IDS', 'LIST')
NumRows = DCount(FormContents, @FM)
LogContents = ''
For Row = 1 to NumRows
Cass = FormContents<Row, 1>
IF Cass NE '' THEN
LogContents<-1> = FormContents<Row>
END
Next Row
LogData = ''
LogData<1> = '*** Form Contents ***'
LogData<2, 1> = LoggingDTM
LogData<2, 2> = @User4
LogData<3> = LogContents
Logging_Services('AppendLog', objLog, LogData, @FM, @VM)
// Log Material Log parameters
LogData<1> = ' '
LogData<2> = '*** Material Log Parameters ***'
LogData<3> = 'LogFile: ':LogFile
LogData<4> = 'CurrDTM: ':CurrDTM
LogData<5> = 'Action: ':Action
LogData<6> = 'WhCd: ':WhCd
LogData<7> = 'LocCd: ':LocCd
LogData<8> = 'WONos: ':WONos
LogData<9> = 'CassNos: ':CassNos
LogData<10> = 'UserID: ':UserID
LogData<11> = 'CassIDs: ':CassIDs
LogData<12> = ' '
Logging_Services('AppendLog', objLog, LogData, @FM, @VM)
obj_WO_Mat_Log('Create',LogFile:@RM:CurrDTM:@RM:Action:@RM:WhCd:@RM:LocCd:@RM:WONos:@RM:CassNos:@RM:UserID:@RM:CassIDs)
IF Get_Status(errCode) THEN
Errmsg(errCode)
END
IF Get_Property(@WINDOW,'@SHIPMENT') THEN
End_Dialog(@WINDOW,Result) ;* Move this down and replace the CLEAR when called from the Shipment window
RETURN
END ELSE
Send_Event(@WINDOW,'CLEAR')
END
RETURN
* * * * * * * *
Cancel:
* * * * * * * *
End_Dialog(@WINDOW,'Cancel')
RETURN
* * * * * * * *
CassIDPC:
* * * * * * * *
CtrlEntID = @WINDOW:'.CASS_IDS'
Shipment = Get_Property(@WINDOW, '@SHIPMENT') ;* Shipment flag
AtWONo = Get_Property(@WINDOW, '@WONO')
Location = Get_Property(@WINDOW:'.LOCATION_CODE','DEFPROP')[-1,'B*']
PrevSelPos = Get_Property(CtrlEntId,"PREVSELPOS")
PrevCol = PrevSelPos<1>
PrevRow = PrevSelPos<2>
CurrPos = Get_Property(CtrlEntId,'SELPOS')
CurrCol = CurrPos<1>
CurrRow = CurrPos<2>
ListData = Get_Property(CtrlEntId,'LIST')
ArrayData = Get_Property(CtrlEntId,'ARRAY')
IF ListData<CurrRow,CurrCol> = '' THEN
ColPointer = CurrCol
LinePointer = CurrRow
ColCnt = 1
* Find the first non-empty cell
LOOP
Test = ListData<LinePointer,(ColPointer) >
UNTIL Test NE '' OR (LinePointer = 0 AND ColPointer = 1)
ColPointer -= 1
IF ColPointer = 0 THEN
ColPointer = ColCnt
LinePointer -= 1
END
REPEAT
* Move one past the non empty cell
BEGIN CASE
CASE LinePointer = 0
* Empty Table
LinePointer = 1
CoilPointer = 1
CASE ColPointer = ColCnt
LinePointer += 1
ColPointer = 1
CASE 1
ColPointer += 1
END CASE
Set_Property(CtrlEntId,"SELPOS",ColPointer:@FM:LinePointer)
END
IF ListData<PrevRow,PrevCol> NE '' AND PrevCol = COL$LABEL_SCAN THEN
ScanCassID = TRIM(ListData<PrevRow,PrevCol>)
IF ScanCassID[1,2] = '1T' THEN
Swap '1T' with '' in ScanCassID
Set_Property(CtrlEntId,"CELLPOS",ScanCassID,PrevSelPos)
END
CassID = ScanCassID
* Check for data already in the list (repeat scan)
TestArray = ArrayData<1> ;* First Column
TestArray<1,PrevRow> = '' ;* Remove the label just scanned
LOCATE CassID IN TestArray USING @VM SETTING Pos THEN
Set_Property(CtrlEntId,"SELPOS",PrevSelPos)
Set_Property(CtrlEntID,'INVALUE','',PrevSelPos) ;* Label Data already scanned
RETURN
END
IF INDEX(CassID,'.',2) THEN
EpiPRO = 1
GaN = 0
END ELSE IF INDEX(CassID,'.',1) THEN
GaN = 1
EpiPRO = 0
END
CONVERT '.' TO '*' IN CassID
Test = ''
CurrStatus = ''
BEGIN CASE
CASE CassID[1,1] = 'I'
* WM_IN table
TestKey = CassID[2,99]
Test = XLATE('WM_IN',TestKey,'','X')
CurrStatus = OCONV(XLATE('WM_IN',TestKey,'CURR_STATUS','X'),'[WM_IN_CURR_STATUS_CONV]')
TestWO = FIELD(TestKey,'*',1)
IF Location = 'PTO' THEN
IF AtWONo = '' THEN
Set_Property(@WINDOW,'@WONO',TestWO)
Set_Property(@WINDOW:'.WINDOW_LABEL','TEXT','Scanning WO ':TestWO)
END
END
WOMatKey = TestWO:'*':FIELD(TestKey,'*',3)
LastPTO = obj_WO_Mat('OutofPTO',WOMatKey)
IF LastPTO THEN
MsgHead = 'Cassette already scanned through the PTO'
MsgText = 'Scanned at ':LastPTO<2>:' by ':LastPTO<1>:CRLF$
MsgText := 'Are you sure you wish to rescan and reprint the shipping label?'
OK = Msg(@WINDOW,'','YESNO','',MsgHead:@FM:MsgText)
IF NOT(OK) THEN
Set_Property(CtrlEntId,"SELPOS",PrevSelPos)
Set_Property(CtrlEntID,'INVALUE','',PrevSelPos) ;* User opted out of rescan and print
RETURN
END
END
CASE CassID[1,1] = 'O'
* GaN or EPP
TestKey = CassID[2,99]
IF GaN THEN
Test = XLATE('WO_MAT',TestKey,'','X')
END ELSE
Test = XLATE('WM_OUT',TestKey,'','X')
END
CurrStatus = OCONV(XLATE('WM_OUT',TestKey,'CURR_STATUS','X'),'[WM_OUT_CURR_STATUS_CONV]')
TestWO = FIELD(TestKey,'*',1)
IF Location = 'PTO' THEN
IF AtWONo = '' THEN
Set_Property(@WINDOW,'@WONO',TestWO)
Set_Property(@WINDOW:'.WINDOW_LABEL','TEXT','Scanning WO ':TestWO)
END
END
IF (FIELD(TestKey,'*',3)) THEN
WOMatKey = TestWO:'*':FIELD(TestKey,'*',3)
END ELSE
WOMatKey = TestWO:'*':FIELD(TestKey,'*',2)
END
LastPTO = obj_WO_Mat('OutofPTO',WOMatKey)
IF LastPTO THEN
MsgHead = 'Cassette already scanned through PTO'
MsgText = 'Scanned at ':LastPTO<2>:' by ':LastPTO<1>:CRLF$
MsgText := 'Are you sure you wish to rescan and reprint the shipping label?'
OK = Msg(@WINDOW,'','YESNO','',MsgHead:@FM:MsgText)
IF NOT(OK) THEN
Set_Property(CtrlEntId,"SELPOS",PrevSelPos)
Set_Property(CtrlEntID,'INVALUE','',PrevSelPos) ;* User opted out of rescan and print
RETURN
END
END
CASE ( INDEX(CassID,'*',1) AND NOT(INDEX(CassID,'*',2)) OR INDEX(CassID,'.',1) AND NOT(INDEX(CassID,'.',2)) )
* This is a WO_MAT format label
TestKey = CassID
Test = XLATE('WO_MAT',TestKey,'','X')
CurrStatus = OCONV(XLATE('WO_MAT',TestKey,'CURR_STATUS','X'),'[WO_MAT_CURR_STATUS_CONV]')
TestWO = FIELD(TestKey,'*',1)
IF Location = 'PTO' THEN
IF AtWONo = '' THEN
Set_Property(@WINDOW,'@WONO',TestWO)
Set_Property(@WINDOW:'.WINDOW_LABEL','TEXT','Scanning WO ':TestWO)
END
END
WOMatKey = TestKey
LastPTO = obj_WO_Mat('OutofPTO',WOMatKey)
IF LastPTO THEN
MsgHead = 'Cassette already scanned through the PTO'
MsgText = 'Scanned at ':LastPTO<2>:' by ':LastPTO<1>:CRLF$
MsgText := 'Are you sure you wish to rescan and reprint the shipping label?'
OK = Msg(@WINDOW,'','YESNO','',MsgHead:@FM:MsgText)
IF NOT(OK) THEN
Set_Property(CtrlEntId,"SELPOS",PrevSelPos)
Set_Property(CtrlEntID,'INVALUE','',PrevSelPos) ;* User opted out of rescan and print
RETURN
END
END
CASE INDEX(CassID,'*',2)
* EpiPRO material indeterminate direction
TestKey = CassID
Test = XLATE('WM_IN',TestKey,'','X')
CurrStatus = OCONV(XLATE('WM_IN',TestKey,'CURR_STATUS','X'),'[WM_IN_CURR_STATUS_CONV]')
IF Test = '' THEN
Test = XLATE('WM_OUT',TestKey,'','X')
CurrStatus = OCONV(XLATE('WM_OUT',TestKey,'CURR_STATUS','X'),'[WM_OUT_CURR_STATUS_CONV]')
END
TestWO = FIELD(TestKey,'*',1)
IF Location = 'PTO' THEN
IF AtWONo = '' THEN
Set_Property(@WINDOW,'@WONO',TestWO)
Set_Property(@WINDOW:'.WINDOW_LABEL','TEXT','Scanning WO ':TestWO)
END
END
WOMatKey = FIELD(TestKey,'*',3)
LastPTO = obj_WO_Mat('OutofPTO',WOMatKey)
IF LastPTO THEN
MsgHead = 'Cassette already scanned through the PTO'
MsgText = 'Scanned at ':LastPTO<2>:' by ':LastPTO<1>:CRLF$
MsgText := 'Are you sure you wish to rescan and reprint the shipping label?'
OK = Msg(@WINDOW,'','YESNO','',MsgHead:@FM:MsgText)
IF NOT(OK) THEN
Set_Property(CtrlEntId,"SELPOS",PrevSelPos)
Set_Property(CtrlEntID,'INVALUE','',PrevSelPos) ;* User opted out of rescan and print
RETURN
END
END
CASE 1
ReactRunRec = XLATE('REACT_RUN',CassID,'','X')
IF ReactRunRec EQ '' THEN
RDSRec = XLATE('RDS',CassID,'','X')
TestWO = RDSRec<RDS_WO$>
CassNo = RDSRec<RDS_CASS_NO$>
END ELSE
TestWO = ReactRunRec<REACT_RUN_WO_NO$>
CassNo = ReactRunRec<REACT_RUN_CASS_NO$>
END
IF Location = 'PTO' THEN
IF AtWONo = '' THEN
Set_Property(@WINDOW,'@WONO',TestWO)
Set_Property(@WINDOW:'.WINDOW_LABEL','TEXT','Scanning WO ':TestWO)
END
END
WOMatKey = TestWO:'*':CassNo
Test = XLATE('WO_MAT',WOMatKey,'','X')
CurrStatus = OCONV(XLATE('WO_MAT',WOMatKey,'CURR_STATUS','X'),'[WO_MAT_CURR_STATUS_CONV]')
LastPTO = obj_WO_Mat('OutofPTO',WOMatKey)
SAPBatchNo = Test<WO_MAT_SAP_BATCH_NO$>
IF LastPTO THEN
MsgHead = 'Cassette already scanned through the PTO'
MsgText = 'Scanned at ':LastPTO<2>:' by ':LastPTO<1>:CRLF$
MsgText := 'Are you sure you wish to rescan and reprint the shipping label?'
OK = Msg(@WINDOW,'','YESNO','',MsgHead:@FM:MsgText)
IF NOT(OK) THEN
Set_Property(CtrlEntId,"SELPOS",PrevSelPos)
Set_Property(CtrlEntID,'INVALUE','',PrevSelPos) ;* User opted out of rescan and print
RETURN
END
END
END CASE
WoMatAction = Database_Services('ReadDataColumn', 'WO_MAT',WoMatKey, 8)
SAPBatchNo = Xlate('WO_MAT', WOMatKey, 'SAP_BATCH_NO', 'X')
hasPack = Index(WoMatAction, 'PACK', 1) > 0
IF ( (Location EQ 'PTO') AND (hasPack EQ False$) ) THEN
MsgHead = 'Cassette is missing Packaging scan'
MsgText = 'Unable to print SAP label without packaging scan.':CRLF$
MsgText := 'Please return cassette #':CassID:' to warehouse manager.'
OK = Msg(@WINDOW, '', 'OK', '', MsgHead:@FM:MsgText)
Set_Property(CtrlEntID, 'SELPOS', PrevSelPos);*remove entry from grid
Set_Property(CtrlEntID, 'INVALUE', '', PrevSelPos)
LogFile = 'WO_MAT'
CurrDTM = OCONV(Date(),'D2/'):' ':OCONV(Time(),'MTS')
Action = 'PLACE'
WhCd = '1K'
LocCd = 'PTI'
WONo = Field(WOMatKey, '*', 1)
CassNo = Field(WOMatKey, '*', 2)
UserID = @User4
Tag = 'Missing Packaging Scan'
obj_WO_Mat_Log('Create',LogFile:@RM:CurrDTM:@RM:Action:@RM:WhCd:@RM:LocCd:@RM:WONo:@RM:CassNo:@RM:UserID:@RM:Tag)
RETURN
END ELSE
IF ( (Location EQ 'PTO') AND (SAPBatchNo EQ '') ) THEN
MsgHead = 'Cassette does not have SAP Batch ID'
MsgText = 'Unable to print SAP label without SAP Batch ID.':CRLF$
MsgText := 'Please return cassette #':CassID:' to warehouse manager.'
OK = Msg(@WINDOW, '', 'OK', '', MsgHead:@FM:MsgText)
Set_Property(CtrlEntID, 'SELPOS', PrevSelPos);*remove entry from grid
Set_Property(CtrlEntID, 'INVALUE', '', PrevSelPos)
//write log entry, showing SAP ID missing in tag
LogFile = 'WO_MAT'
CurrDTM = OCONV(Date(),'D2/'):' ':OCONV(Time(),'MTS')
Action = 'PLACE'
WhCd = '1K'
LocCd = 'PTI'
WONo = Field(WOMatKey, '*', 1)
CassNo = Field(WOMatKey, '*', 2)
UserID = @User4
Tag = 'Missing SAP Batch ID'
obj_WO_Mat_Log('Create',LogFile:@RM:CurrDTM:@RM:Action:@RM:WhCd:@RM:LocCd:@RM:WONo:@RM:CassNo:@RM:UserID:@RM:Tag)
RETURN
END
END
CRComp = obj_WO_Mat('CRComp',WOMatKey:@RM:@RM)
CRComp = OCONV(CRComp,'B')
CurrLoc = XLATE('WO_MAT',WOmatKey,'CURR_LOCATION','X')
AtWONo = Get_Property(@WINDOW,'@WONO')
IF AtWONo NE '' THEN
IF TestWO NE AtWONo THEN
ErrMsg('':@VM:'Process Error':@SVM:'Label Scanned is NOT part of WO ':AtWoNo)
Set_Property(CtrlEntId,"SELPOS",PrevSelPos)
Set_Property(CtrlEntID,'INVALUE','',PrevSelPos) ;* Work Order scanned doesn't match 1st WO scanned or passed in from the Shipment
RETURN
END
END
IF Test = '' THEN
Set_Property(CtrlEntId,"SELPOS",PrevSelPos)
Set_Property(CtrlEntID,'INVALUE','',PrevSelPos) ;* No corresponding data record found for label scanned
RETURN
END
Set_Property(CtrlEntID,'CELLPOS',CurrStatus,2:@FM:PrevRow) ;* Load Current Status
Set_Property(CtrlEntID,'CELLPOS',CurrLoc,3:@FM:PrevRow) ;* Load Current Location
Set_Property(CtrlEntID,'CELLPOS',CRComp,4:@FM:PrevRow) ;* Load Cleanroom Complete flag
END
GOSUB Refresh
RETURN
* * * * * * *
LocLF:
* * * * * * *
DataIn = Get_Property(@WINDOW:'.LOCATION_CODE','DEFPROP')
IF DataIn = '' THEN RETURN
SWAP '/J' WITH '*' IN DataIn
IF DataIn = '1K*PTI' THEN
ErrMsg('PTI scans may not be done with this form. Use the PTI Material Scan form instead.')
Set_Property(@WINDOW:'.LOCATION_CODE','DEFPROP','')
Set_Property(@WINDOW:'.LOCATION_CODE','FOCUS',1)
END ELSE IF DataIn = '1K*PTO' THEN
ErrMsg('PTO scans may not be done with this form. Use the PTO Material Scan form instead.')
Set_Property(@WINDOW:'.LOCATION_CODE','DEFPROP','')
Set_Property(@WINDOW:'.LOCATION_CODE','FOCUS',1)
void = End_Window(@WINDOW)
void = Start_Window( 'NDW_PTO_MAT_SCAN', '', '', '', '' )
END ELSE IF RowExists('LOCATION',DataIn) THEN
Set_Property(@WINDOW:'.LOCATION_CODE','DEFPROP',DataIn)
END ELSE
ErrMsg(QUOTE(DataIn):' is not a valid location in the LOCATION table.')
Set_Property(@WINDOW:'.LOCATION_CODE','DEFPROP','')
Set_Property(@WINDOW:'.LOCATION_CODE','FOCUS',1)
END
RETURN

View File

@ -0,0 +1,277 @@
COMPILE FUNCTION Comm_Dialog_NCR_Rej_Slot(Method, Parm1, Parm2)
/*
Commuter module for Dialog_NCR_Rej_Slot window.
08/20/2008 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Set_Status, ErrMsg, Send_Event, obj_RDS_Test
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Msg, End_Dialog, Send_Message, ErrMsg
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Popup, Send_Message, obj_Test_Point_Map, obj_RDS_Test
EQU CRLF$ TO \0D0A\
$INSERT MSG_EQUATES
$INSERT WO_MAT_EQUATES
$INSERT NCR_EQU
$INSERT APPCOLORS
EQU WFR_COL$SLOT TO 1
EQU WFR_COL$WAFER_ID TO 2
EQU WFR_COL$SLOT_NCR TO 3
EQU WFR_COL$MET_NO TO 4
EQU WFR_COL$MOVED_TO_SLOT TO 5
EQU WFR_COL$REPLACED_BY TO 6
EQU NCR_COL$SLOT_NO TO 1
EQU NCR_COL$WAFER_ID TO 2
EQU NCR_COL$PREV_NCR TO 3
EQU NCR_COL$REJ_MET_NO TO 4
ErrTitle = 'Error in Comm_Dialog_NCR_Rej_Slot'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Method = 'Create' ; GOSUB Create
CASE Method = 'WOMatClick' ; GOSUB WOMatClick
CASE Method = 'RejWafers' ; GOSUB RejWafers
CASE Method = 'RepWafers' ; GOSUB RepWafers
CASE Method = 'Apply' ; GOSUB Apply
CASE MEthod = 'Cancel' ; GOSUB Cancel
CASE 1
ErrMsg(ErrTitle:@SVM:'Unknown method ':QUOTE(Method):' passed to routine.')
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
obj_AppWindow('Create')
* get the current style
EQU MULTILINE_STYLE$ TO 512 ;* MultiLine Select
* Set Material Slot edit table to multi-line select
Style = Get_Property(@WINDOW:'.WO_MAT_SLOT', 'STYLE')
IF Style [1,2] _EQC "0x" THEN
CONVERT @LOWER.CASE TO @UPPER.CASE IN STYLE
Style = ICONV(Style [3,99], "MX")
END
Style = BitOr(Style, MULTILINE_STYLE$)
Set_Property(@WINDOW:'.WO_MAT_SLOT', "STYLE", Style)
* Set NCR Reject Wafers edit table to multi-line select
Style = Get_Property(@WINDOW:'.SLOT_REJECT', 'STYLE')
IF Style [1,2] _EQC "0x" THEN
CONVERT @LOWER.CASE TO @UPPER.CASE IN STYLE
Style = ICONV(Style [3,99], "MX")
END
Style = BitOr(Style, MULTILINE_STYLE$)
Set_Property(@WINDOW:'.SLOT_REJECT', "STYLE", Style)
CONVERT '/' TO @RM IN Parm1
Ctrls = @WINDOW:'.WO_MAT_SLOT':@RM ; Props = 'LIST':@RM
Ctrls := @WINDOW:'.SLOT_REJECT':@RM ; Props := 'LIST':@RM
Ctrls := @WINDOW:'.WO_NO':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.CASS_NO':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.NCR_NO' ; Props := 'DEFPROP'
Set_Property(Ctrls,Props,Parm1)
RETURN
* * * * * * *
WOMatClick:
* * * * * * *
SlotList = Get_Property(@WINDOW:'.WO_MAT_SLOT','LIST')
SlotSelection = Get_Property(@WINDOW:'.WO_MAT_SLOT','SELPOS')
SelectedLines = SlotSelection<2>
SelCnt = COUNT(SelectedLines,@VM) + (SelectedLines NE '')
BadLines = ''
FOR I = 1 TO SelCnt
LineNo = SelectedLines<1,I>
IF SlotList<LineNo,WFR_COL$WAFER_ID> = '' THEN
BadLines<1,-1> = LineNo
END
NEXT I
IF BadLines NE '' THEN
Set_Property(@WINDOW:'.WO_MAT_SLOT','SELPOS',1:@FM:BadLines)
END
RETURN
* * * * * * *
Apply:
* * * * * * *
Ctrls = @WINDOW:'.WO_MAT_SLOT':@RM ; Props = 'ARRAY':@RM
Ctrls := @WINDOW:'.SLOT_REJECT':@RM ; Props := 'LIST':@RM
Ctrls := @WINDOW:'.WO_NO':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.CASS_NO':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.NCR_NO' ; Props := 'DEFPROP'
Vals = Get_Property(Ctrls,Props,Parm1)
WOMatSlotArray = Vals[1,@RM]
NCRRejList = Vals[COL2()+1,@RM]
WONo = Vals[COL2()+1,@RM]
CassNo = Vals[COL2()+1,@RM]
NCRNo = Vals[COL2()+1,@RM]
End_Dialog(@WINDOW,WOMatSlotArray:@RM:NCRRejList)
RETURN
* * * * * * *
Refresh:
* * * * * * *
RETURN
* * * * * * *
Cancel:
* * * * * * *
End_Dialog(@WINDOW,'')
RETURN
* * * * * * *
RejWafers:
* * * * * * *
NCRNo = Get_Property(@WINDOW:'.NCR_NO','DEFPROP')
SlotList = Get_Property(@WINDOW:'.WO_MAT_SLOT','LIST')
SlotSelection = Get_Property(@WINDOW:'.WO_MAT_SLOT','SELPOS')
SelectedSlots = SlotSelection<2>
IF SelectedSlots = '' THEN RETURN
SelCnt = COUNT(SelectedSlots,@VM) + (SelectedSlots NE '')
WaferArray = Get_Property(@WINDOW:'.SLOT_REJECT','ARRAY')
FOR I = 1 TO SelCnt
SlotLine = SelectedSlots<1,I>
SlotNo = SlotList<SlotLine,1>
WaferID = SlotList<SlotLine,2>
PrevNCR = SlotList<SlotLine,3>
RejMetNo = SlotList<SLotLine,4>
LOCATE SlotNo IN WaferArray<1> BY 'AR' USING @VM SETTING POS ELSE
WaferArray = INSERT(WaferArray,1,Pos,0,SlotNo)
WaferArray = INSERT(WaferArray,2,Pos,0,WaferID)
WaferArray = INSERT(WaferArray,3,Pos,0,PrevNCR)
WaferArray = INSERT(WaferArray,4,Pos,0,RejMetNo)
END
SlotList<SlotLine,WFR_COL$WAFER_ID> = ''
SlotList<SlotLine,WFR_COL$SLOT_NCR> = NCRNo
SlotList<SlotLine,WFR_COL$REPLACED_BY> = ''
SlotList<SlotLine,WFR_COL$MET_NO> = ''
NEXT I
Set_Property(@WINDOW:'.SLOT_REJECT','ARRAY',WaferArray)
Set_Property(@WINDOW:'.WO_MAT_SLOT','LIST',SlotList)
RETURN
* * * * * * *
RepWafers:
* * * * * * *
WaferList = Get_Property(@WINDOW:'.SLOT_REJECT','LIST')
WONo = Get_Property(@WINDOW:'.WO_NO','DEFPROP')
CassNo = Get_Property(@WINDOW:'.CASS_NO','DEFPROP')
WaferSelection = Get_Property(@WINDOW:'.SLOT_REJECT','SELPOS')
SelectedWafers = WaferSelection<2>
IF SelectedWafers = '' THEN RETURN
SelCnt = COUNT(SelectedWafers,@VM) + (SelectedWafers NE '')
WaferCnt = COUNT(WaferList,@FM) + (WaferList NE '')
IF SelCnt = WaferCnt THEN
ErrMesg = 'There must be at least one rejected wafer on the NCR. '
ErrMesg := 'If you are moving wafers from one slot to another, '
ErrMesg := 'reject wafers from the cassette and then replace '
ErrMesg := 'from the NCR.':CRLF$:CRLF$
ErrMesg := 'If you are going to delete the NCR completely, '
ErrMesg := 'you do not need to replace the wafers. The program '
ErrMesg := 'will replace them during the NCR delete process.'
ErrMsg(ErrMesg)
RETURN
END
SlotList = Get_Property(@WINDOW:'.WO_MAT_SLOT','LIST')
FOR I = SelCnt TO 1 STEP -1
SelectedWafer = SelectedWafers<1,I>
SlotNo = WaferList<SelectedWafer,NCR_COL$SLOT_NO>
WaferID = WaferList<SelectedWafer,NCR_COL$WAFER_ID>
PrevNCR = WaferList<SelectedWafer,NCR_COL$PREV_NCR>
RejMetNo = WaferList<SelectedWafer,NCR_COL$REJ_MET_NO>
WaferList = DELETE(WaferList,SelectedWafer,0,0)
SlotList<SlotNo,WFR_COL$SLOT> = SlotNo
SlotList<SlotNo,WFR_COL$WAFER_ID> = WaferID
SlotList<SlotNo,WFR_COL$SLOT_NCR> = PrevNCR
SlotList<SlotNo,WFR_COL$MET_NO> = RejMetNo
IF PrevNCR NE '' THEN
SlotList<SlotNo,WFR_COL$REPLACED_BY> = WaferID
END
NEXT I
Set_Property(@WINDOW:'.SLOT_REJECT','LIST',WaferList)
Set_Property(@WINDOW:'.WO_MAT_SLOT','LIST',SlotList)
RETURN

View File

@ -0,0 +1,333 @@
COMPILE FUNCTION Comm_Dialog_NCR_SRJ_Epi(Method, Parm1, Parm2)
/*
Commuter module for Dialog_NCR_SRJ_EPI window.
01/20/2009 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Set_Status, ErrMsg, Send_Event, obj_RDS_Test
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Msg, End_Dialog, Send_Message, ErrMsg
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Popup, Send_Message, obj_Test_Point_Map, obj_RDS_Test
EQU CRLF$ TO \0D0A\
$INSERT MSG_EQUATES
$INSERT WO_MAT_EQUATES
$INSERT NCR_EQU
$INSERT APPCOLORS
EQU WFR_COL$OUT_SLOT TO 1
EQU WFR_COL$RDS TO 2
EQU WFR_COL$POCKET TO 3
EQU WFR_COL$ZONE TO 4
EQU WFR_COL$IN_CASS TO 5
EQU WFR_COL$IN_SLOT TO 6
EQU WFR_COL$SLOT_NCR TO 7
EQU WFR_COL$MU_WO_NO TO 8
EQU WFR_COL$MU_STEP TO 9
EQU WFR_COL$MU_CASS TO 10
EQU WFR_COL$MU_SLOT TO 11
EQU WFR_COL$UM_CASS_ID TO 12
EQU WFR_COL$UM_SLOT TO 13
EQU NCR_COL$OUT_CASS TO 1 ;* EpiPRO slot information
EQU NCR_COL$OUT_SLOT TO 2
EQU NCR_COL$RDS TO 3
EQU NCR_COL$POCKET TO 4
EQU NCR_COL$ZONE TO 5
EQU NCR_COL$IN_CASS TO 6
EQU NCR_COL$IN_SLOT TO 7
EQU NCR_COL$PREV_NCR TO 8
EQU NCR_COL$MU_WO_NO TO 9
EQU NCR_COL$MU_STEP TO 10
EQU NCR_COL$MU_CASS TO 11
EQU NCR_COL$MU_SLOT TO 12
ErrTitle = 'Error in Comm_Dialog_NCR_Rej_Slot'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Method = 'Create' ; GOSUB Create
CASE Method = 'WOMatClick' ; GOSUB WOMatClick
CASE Method = 'RejWafers' ; GOSUB RejWafers
CASE Method = 'RepWafers' ; GOSUB RepWafers
CASE Method = 'Apply' ; GOSUB Apply
CASE MEthod = 'Cancel' ; GOSUB Cancel
CASE 1
ErrMsg(ErrTitle:@SVM:'Unknown method ':QUOTE(Method):' passed to routine.')
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
obj_AppWindow('Create')
* get the current style
EQU MULTILINE_STYLE$ TO 512 ;* MultiLine Select
* Set Material Slot edit table to multi-line select
Style = Get_Property(@WINDOW:'.WM_OUT_SLOT', 'STYLE')
IF Style [1,2] _EQC "0x" THEN
CONVERT @LOWER.CASE TO @UPPER.CASE IN STYLE
Style = ICONV(Style [3,99], "MX")
END
Style = BitOr(Style, MULTILINE_STYLE$)
Set_Property(@WINDOW:'.WM_OUT_SLOT', "STYLE", Style)
* Set NCR Reject Wafers edit table to multi-line select
Style = Get_Property(@WINDOW:'.SLOT_REJECT', 'STYLE')
IF Style [1,2] _EQC "0x" THEN
CONVERT @LOWER.CASE TO @UPPER.CASE IN STYLE
Style = ICONV(Style [3,99], "MX")
END
Style = BitOr(Style, MULTILINE_STYLE$)
Set_Property(@WINDOW:'.SLOT_REJECT', "STYLE", Style)
CONVERT '/' TO @RM IN Parm1
Ctrls = @WINDOW:'.WM_OUT_SLOT':@RM ; Props = 'LIST':@RM
Ctrls := @WINDOW:'.SLOT_REJECT':@RM ; Props := 'LIST':@RM
Ctrls := @WINDOW:'.WO_NO':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.WO_STEP_NO':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.CASS_NO':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.NCR_NO' ; Props := 'DEFPROP'
Set_Property(Ctrls,Props,Parm1)
RETURN
* * * * * * *
WOMatClick:
* * * * * * *
SlotList = Get_Property(@WINDOW:'.WM_OUT_SLOT','LIST')
NCRNo = Get_Property(@WINDOW:'.NCR_NO','DEFPROP')
SlotSelection = Get_Property(@WINDOW:'.WM_OUT_SLOT','SELPOS')
SelectedLines = SlotSelection<2>
SelCnt = COUNT(SelectedLines,@VM) + (SelectedLines NE '')
BadLines = ''
FOR I = 1 TO SelCnt
LineNo = SelectedLines<1,I>
a1 = SlotList<LineNo,WFR_COL$SLOT_NCR>
a1 = SlotList<LineNo,WFR_COL$UM_CASS_ID>
IF SlotList<LineNo,WFR_COL$SLOT_NCR> = NCRNo OR SlotList<LineNo,WFR_COL$UM_CASS_ID> NE '' THEN
BadLines<1,-1> = LineNo
END
NEXT I
IF BadLines NE '' THEN
Set_Property(@WINDOW:'.WM_OUT_SLOT','SELPOS',1:@FM:BadLines)
END
RETURN
* * * * * * *
Apply:
* * * * * * *
Ctrls = @WINDOW:'.WM_OUT_SLOT':@RM ; Props = 'ARRAY':@RM
Ctrls := @WINDOW:'.SLOT_REJECT':@RM ; Props := 'LIST':@RM
Ctrls := @WINDOW:'.WO_NO':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.CASS_NO':@RM ; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.NCR_NO' ; Props := 'DEFPROP'
Vals = Get_Property(Ctrls,Props,Parm1)
WOMatSlotArray = Vals[1,@RM]
NCRRejList = Vals[COL2()+1,@RM]
WONo = Vals[COL2()+1,@RM]
CassNo = Vals[COL2()+1,@RM]
NCRNo = Vals[COL2()+1,@RM]
End_Dialog(@WINDOW,WOMatSlotArray:@RM:NCRRejList)
RETURN
* * * * * * *
Refresh:
* * * * * * *
RETURN
* * * * * * *
Cancel:
* * * * * * *
End_Dialog(@WINDOW,'')
RETURN
* * * * * * *
RejWafers:
* * * * * * *
NCRNo = Get_Property(@WINDOW:'.NCR_NO','DEFPROP')
SlotList = Get_Property(@WINDOW:'.WM_OUT_SLOT','LIST')
CassNo = Get_Property(@WINDOW:'.CASS_NO','DEFPROP')
SlotSelection = Get_Property(@WINDOW:'.WM_OUT_SLOT','SELPOS')
SelectedSlots = SlotSelection<2>
IF SelectedSlots = '' THEN RETURN
SelCnt = COUNT(SelectedSlots,@VM) + (SelectedSlots NE '')
WaferArray = Get_Property(@WINDOW:'.SLOT_REJECT','ARRAY')
FOR I = 1 TO SelCnt
SlotLine = SelectedSlots<1,I>
OutSlotNo = SlotList<SlotLine,WFR_COL$OUT_SLOT>
RDSNo = SlotList<SlotLine,WFR_COL$RDS>
Pocket = SlotList<SlotLine,WFR_COL$POCKET>
Zone = SlotList<SlotLine,WFR_COL$ZONE>
InCass = SlotList<SlotLine,WFR_COL$IN_CASS>
InSlotNo = SlotList<SlotLine,WFR_COL$IN_SLOT>
PrevNCR = SlotList<SlotLine,WFR_COL$SLOT_NCR>
MUWONo = SlotList<SlotLine,WFR_COL$MU_WO_NO>
MUWOStep = SlotList<SlotLine,WFR_COL$MU_STEP>
MUCassID = SlotList<SlotLine,WFR_COL$MU_CASS>
MUSlot = SlotList<SlotLine,WFR_COL$MU_SLOT>
LOCATE OutSlotNo IN WaferArray<NCR_COL$OUT_SLOT> BY 'AR' USING @VM SETTING POS ELSE
WaferArray = INSERT(WaferArray,NCR_COL$OUT_CASS,Pos,0,CassNo)
WaferArray = INSERT(WaferArray,NCR_COL$OUT_SLOT,Pos,0,OutSlotNo)
WaferArray = INSERT(WaferArray,NCR_COL$RDS,Pos,0,RDSNo)
WaferArray = INSERT(WaferArray,NCR_COL$POCKET,Pos,0,Pocket)
WaferArray = INSERT(WaferArray,NCR_COL$ZONE,Pos,0,Zone)
WaferArray = INSERT(WaferArray,NCR_COL$IN_CASS,Pos,0,InCass)
WaferArray = INSERT(WaferArray,NCR_COL$IN_SLOT,Pos,0,InSlotNo)
WaferArray = INSERT(WaferArray,NCR_COL$PREV_NCR,Pos,0,PrevNCR)
WaferArray = INSERT(WaferArray,NCR_COL$MU_WO_NO,Pos,0,MUWONo)
WaferArray = INSERT(WaferArray,NCR_COL$MU_STEP,Pos,0,MUWOStep)
WaferArray = INSERT(WaferArray,NCR_COL$MU_CASS,Pos,0,MUCassID)
WaferArray = INSERT(WaferArray,NCR_COL$MU_SLOT,Pos,0,MUSlot)
END
SlotList<SlotLine,WFR_COL$RDS> = ''
SlotList<SlotLine,WFR_COL$POCKET> = ''
SlotList<SlotLine,WFR_COL$ZONE> = ''
SlotList<SlotLine,WFR_COL$IN_CASS> = ''
SlotList<SlotLine,WFR_COL$IN_SLOT> = ''
SlotList<SlotLine,WFR_COL$SLOT_NCR> = NCRNo
SlotList<SlotLine,WFR_COL$MU_WO_NO> = ''
SlotList<SlotLine,WFR_COL$MU_STEP> = ''
SlotList<SlotLine,WFR_COL$MU_CASS> = ''
SlotList<SlotLine,WFR_COL$MU_SLOT> = ''
NEXT I
Set_Property(@WINDOW:'.SLOT_REJECT','ARRAY',WaferArray)
Set_Property(@WINDOW:'.WM_OUT_SLOT','LIST',SlotList)
RETURN
* * * * * * *
RepWafers:
* * * * * * *
WaferList = Get_Property(@WINDOW:'.SLOT_REJECT','LIST')
WONo = Get_Property(@WINDOW:'.WO_NO','DEFPROP')
CassNo = Get_Property(@WINDOW:'.CASS_NO','DEFPROP')
WaferSelection = Get_Property(@WINDOW:'.SLOT_REJECT','SELPOS')
SelectedWafers = WaferSelection<2>
IF SelectedWafers = '' THEN RETURN
SelCnt = COUNT(SelectedWafers,@VM) + (SelectedWafers NE '')
WaferCnt = COUNT(WaferList,@FM) + (WaferList NE '')
IF SelCnt = WaferCnt THEN
ErrMesg = 'There must be at least one rejected wafer on the NCR. '
ErrMesg := 'If you are moving wafers from one slot to another, '
ErrMesg := 'reject wafers from the cassette and then replace '
ErrMesg := 'from the NCR.':CRLF$:CRLF$
ErrMesg := 'If you are going to delete the NCR completely, '
ErrMesg := 'you do not need to replace the wafers. The program '
ErrMesg := 'will replace them during the NCR delete process.'
ErrMsg(ErrMesg)
RETURN
END
SlotList = Get_Property(@WINDOW:'.WM_OUT_SLOT','LIST')
FOR I = SelCnt TO 1 STEP -1
SelectedWafer = SelectedWafers<1,I>
OutSlot = WaferList<SelectedWafer,NCR_COL$OUT_SLOT>
RDSNo = WaferList<SelectedWafer,NCR_COL$RDS>
Pocket = WaferList<SelectedWafer,NCR_COL$POCKET>
Zone = WaferList<SelectedWafer,NCR_COL$ZONE>
InCass = WaferList<SelectedWafer,NCR_COL$IN_CASS>
InSlot = WaferList<SelectedWafer,NCR_COL$IN_SLOT>
PrevNCR = WaferList<SelectedWafer,NCR_COL$PREV_NCR>
MUWONo = WaferList<SelectedWafer,NCR_COL$MU_WO_NO>
MUWOStep = WaferList<SelectedWafer,NCR_COL$MU_STEP>
MUCassID = WaferList<SelectedWafer,NCR_COL$MU_CASS>
MUSlot = WaferList<SelectedWafer,NCR_COL$MU_SLOT>
WaferList = DELETE(WaferList,SelectedWafer,0,0) ;* Removes rejected wafer from NCR list
SlotList<OutSlot,WFR_COL$OUT_SLOT> = OutSlot
SlotList<OutSlot,WFR_COL$RDS> = RDSNo
SlotList<OutSlot,WFR_COL$POCKET> = Pocket
SlotList<OutSlot,WFR_COL$ZONE> = Zone
SlotList<OutSlot,WFR_COL$IN_CASS> = InCass
SlotList<OutSlot,WFR_COL$IN_SLOT> = InSlot
SlotList<OutSlot,WFR_COL$SLOT_NCR> = PrevNCR
SlotList<OutSlot,WFR_COL$MU_WO_NO> = MUWONo
SlotList<OutSlot,WFR_COL$MU_STEP> = MUWOStep
SlotList<OutSlot,WFR_COL$MU_CASS> = MUCassID
SlotList<OutSlot,WFR_COL$MU_SLOT> = MUSlot
NEXT I
Set_Property(@WINDOW:'.SLOT_REJECT','LIST',WaferList)
Set_Property(@WINDOW:'.WM_OUT_SLOT','LIST',SlotList)
RETURN

View File

@ -0,0 +1,157 @@
COMPILE FUNCTION Comm_Dialog_Open_Quotes(Method, Parm1)
/*
Commuter module for Dialog_Open_Quotes window.
01/07/2005 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Send_Event, Set_Status, ErrMsg
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Btree.Extract, Msg, Send_Message
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Utility, Send_Message, Popup, Collect.IXVals, Msg
EQU CRLF$ TO \0D0A\
EQU COL$CUST_NO TO 1 ;* Customer edit table column equates
EQU COL$CUST_NAME TO 2
EQU LTGREY$ TO 229 + (229*256) + (229*65536) ;* JCH standard colors for edittable backgrounds
EQU GREY$ TO 192 + (192*256) + (192*65536)
EQU GREEN$ TO 192 + (220*256) + (192*65536)
EQU RED$ TO 255 + (128*256) + (128*65536)
EQU BLUE$ TO 128 + (255*256) + (255*65536)
EQU WHITE$ TO 255 + (255*256) + (255*65536)
EQU YELLOW$ TO 255 + (255*256) + (202*65536)
EQU LTBLUE$ TO 128 + (255*256) + (255*65536)
EQU PURPLE$ TO 225 + (181*256) + (255*65536)
EQU DTS_MULTIROW$ TO 512
EQU DTS_LARGEDATA$ TO 4096
$INSERT ORDER_EQU
$INSERT PS_EQUATES
$INSERT POPUP_EQUATES
$INSERT MSG_EQUATES
ErrTitle = 'Error in Comm_Dialog_Open_Quotes'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Method = 'Create' ; GOSUB Create
CASE Method = 'ItemDC' ; GOSUB ItemDC
CASE 1
ErrMsg(ErrTitle:@SVM:'Unknown method ':QUOTE(Method):' passed to routine.')
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
obj_AppWindow('Create')
CustNo = Parm1
CustNo = '6622'
IF CustNo = '' THEN RETURN
OPEN 'DICT.QUOTE' TO DictVar ELSE
ErrMsg('Unable to open DICT.QUOTE in COMM_DIALOG_OPEN_QUOTES!')
RETURN
END
SearchString = 'CUST_NO':@VM:CustNo:@FM
SearchString := 'STATUS':@VM:'O':@FM
Option = ''
Flag = ''
Set_Status(0)
Btree.Extract(SearchString, 'QUOTE' ,DictVar, OpenQuotes, Option, Flag)
IF Get_Status(errCode) THEN ErrMsg(errCode)
IF OpenQuotes = '' THEN
ErrMsg('No open quotes on file for customer ':CustNo:'.')
RETURN
END
QuoteList = ''
FOR I = 1 TO COUNT(OpenQuotes,@VM) + (OpenQuotes NE '')
QuoteDetKeys = XLATE('QUOTE',OpenQuotes<1,I>,35,'X')
QuoteList<-1> = '1-1: ':OpenQuotes<1,I>
CustPartNos = ''
FOR J = 1 TO COUNT(QuoteDetKeys,@VM) + (QuoteDetKeys NE '')
QuoteDetKey = QuoteDetKeys<1,J>
ItemNo = FIELD(QuoteDetKey,'*',2)
QuoteDetRec = XLATE('QUOTE_DET',QuoteDetKey,'','X')
CustPartNos = QuoteDetRec<12>
ProcSteps = QuoteDetRec<8>
ProcPSNs = QuoteDetRec<9>
ProcDescs = QuoteDetRec<10>
DetString = ''
FOR K = 1 TO COUNT(ProcSteps,@VM) + (ProcSteps NE '')
DetString<1,-1> = 'Step ':ProcSteps<1,K>:' PSN: ':ProcPSNs<1,K>:' ':ProcDescs<1,K>
NEXT K
SWAP @VM WITH ', ' IN DetString
QuoteList<-1> = '2-2: Item ':ItemNo:': ':DetString
NEXT J
IF CustPartNos = '' THEN
CustPartNos = XLATE('QUOTE',OpenQuotes<1,I>,'CUST_PART_NUMS','X')
END
FOR L = 1 TO COUNT(CustPartNos,@VM) + (CustPartNos NE '')
QuoteList<-1> = '3-3: Cust Part No: ':CustPartNos<1,L>
NEXT L
NEXT I
Set_Property(@WINDOW:'.OPEN_QUOTES','LIST_EX',QuoteList)
Send_Message(@WINDOW:'.OPEN_QUOTES','EXPAND',0,3)
RETURN
* * * * * * *
ItemDC:
* * * * * * *
RETURN
ReturnCtrl = Parm1[1,@RM]
IF ReturnCtrl = '' THEN ReturnCtrl = Get_Property(@WINDOW,'FOCUS')
DateSelected = Dialog_Box('POPUP_YEAR',@WINDOW)
RetVal = OCONV(DateSelected, 'D4/')
IF RetVal NE '' THEN
obj_Appwindow('LUValReturn',RetVal:@RM:ReturnCtrl)
END
RETURN
* * * * * * *
Cancel:
* * * * * * *
RETURN

View File

@ -0,0 +1,660 @@
COMPILE FUNCTION Comm_Dialog_Order_Find(Method, Parm1)
/*
Commuter module for Dialog_Order_Find window.
08/16/2004 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Send_Event, Set_Status, ErrMsg
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Btree.Extract, Msg, Send_Info
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Utility, Send_Message, Popup, Collect.IXVals, Msg
EQU CRLF$ TO \0D0A\
EQU COL$CUST_NO TO 1 ;* Customer edit table column equates
EQU COL$CUST_NAME TO 2
EQU LTGREY$ TO 229 + (229*256) + (229*65536) ;* JCH standard colors for edittable backgrounds
EQU GREY$ TO 192 + (192*256) + (192*65536)
EQU GREEN$ TO 192 + (220*256) + (192*65536)
EQU RED$ TO 255 + (128*256) + (128*65536)
EQU BLUE$ TO 128 + (255*256) + (255*65536)
EQU WHITE$ TO 255 + (255*256) + (255*65536)
EQU YELLOW$ TO 255 + (255*256) + (202*65536)
EQU LTBLUE$ TO 128 + (255*256) + (255*65536)
EQU PURPLE$ TO 225 + (181*256) + (255*65536)
EQU DTS_MULTIROW$ TO 512
EQU DTS_LARGEDATA$ TO 4096
$INSERT ORDER_EQU
$INSERT WO_LOG_EQU
$INSERT PS_EQUATES
$INSERT POPUP_EQUATES
$INSERT LOGICAL
$INSERT MSG_EQUATES
ErrTitle = 'Error in Comm_Dialog_Order_Find'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Method = 'Create' ; GOSUB Create
CASE Method = 'CustChar' ; GOSUB CustChar
CASE Method = 'CustPC' ; GOSUB CustPC
CASE Method = 'CustDC' ; GOSUB CustDC
CASE Method = 'PONoDC' ; GOSUB PONoDC
CASE Method = 'AnnContDC' ; GOSUB AnnContDC
CASE Method = 'QuoteDC' ; GOSUB QuoteDC
CASE Method = 'CustPNDC' ; GOSUB CustPNDC
CASE Method = 'LUDate' ; GOSUB LUDate
CASE Method = 'Cancel' ; GOSUB Cancel
CASE Method = 'Refresh' ; GOSUB Refresh
CASE Method = 'PerformQuery' ; GOSUB PerformQuery
CASE 1
ErrMsg(ErrTitle:@SVM:'Unknown method ':QUOTE(Method):' passed to routine.')
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
obj_AppWindow('Create')
Set_Property(@WINDOW,'STATUSLINE',@WINDOW:'.STATUSLINE_FIX')
GOSUB Refresh
RETURN
* * * * * * *
Refresh:
* * * * * * *
* Turn edit table symbolic column backgrounds to green
stat = Send_Message(@WINDOW:'.CUST_INFO','COLOR_BY_POS',COL$CUST_NAME,0,GREEN$) ;* Turn names column all rows green
RETURN
* * * * * * *
CustChar:
* * * * * * *
CtrlName = @WINDOW:'.CUST_INFO'
CustArray = Get_Property(CtrlName,'ARRAY') ;* Customer Information table
CurrPos = Get_Property(CtrlName,'SELPOS')
CurrRow = CurrPos<2>
DataIn = CustArray<COL$CUST_NO,CurrRow>
IF LEN(DataIn) > 2 THEN
ReturnToCtrl = CtrlName
ReturnToPos = CurrPos
IF NOT(NUM(DataIn)) THEN
Set_Property(CtrlName,'CELLPOS','',CurrPos) ;* Clear characters input
Start_Window('COMP_LOOKUP',@WINDOW,DataIn:@VM:'C':@FM:ReturnToCtrl:@FM:ReturnToPos,'','')
END
END
RETURN
* * * * * * *
CustPC:
* * * * * * *
CtrlName = @WINDOW:'.CUST_INFO'
CustList = Get_Property(CtrlName,'LIST') ;* Customer Information table
CurrPos = Get_Property(CtrlName,'SELPOS')
CurrCol = CurrPos<1>
CurrRow = CurrPos<2>
CustNo = CustList<CurrRow,COL$CUST_NO>
IF CustNo NE '' THEN
Set_Property(CtrlName,'CELLPOS',XLATE('COMPANY',CustNo,4,'X'),COL$CUST_NAME:@FM:CurrRow)
END
RETURN
* * * * * * *
CustDC:
* * * * * * *
CtrlName = @WINDOW:'.CUST_INFO'
CustList = Get_Property(CtrlName,'LIST') ;* Customer Information table
CurrPos = Get_Property(CtrlName,'SELPOS')
CurrCol = CurrPos<1>
CurrRow = CurrPos<2>
CustNo = CustList<CurrRow,COL$CUST_NO>
LineCnt = COUNT(CustList,@FM) + (CustList NE '')
IF CustNo = '' THEN
CustNos = Popup(@WINDOW,'','CUSTOMER')
CustCnt = COUNT(CustNos,@VM) + (CustNos NE '')
IF CustCnt > LineCnt THEN
FOR I = 1 TO CustCnt
stat = Send_Message(CtrlName,'INSERT',-1,@VM:@FM) ; * Add blank lines
NEXT I
END
FOR I = CurrRow TO CurrRow + CustCnt
CustNo = CustNos<1,I>
CustName = XLATE('COMPANY',CustNo,4,'X')
Set_Property(CtrlName,'CELLPOS',CustNo,COL$CUST_NO:@FM:I)
Set_Property(CtrlName,'CELLPOS',CustName,COL$CUST_NAME:@FM:I)
Set_Property(CtrlName,'SELPOS',COL$CUST_NO:@FM:I+1)
NEXT I
END ELSE
ErrMsg('DoubleClick on the first empty Cust No field to view a popup of all Customers')
END
RETURN
* * * * * * *
PONoDC:
* * * * * * *
CustArray = Get_Property(@WINDOW:'.CUST_INFO','ARRAY')<COL$CUST_NO>
CustNos = CustArray<COL$CUST_NO>
LOOP
LastCustNo = CustNos[-1,'B':@VM]
UNTIL LastCustNo NE '' OR CustNos = ''
CustNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF CustNos = '' THEN RETURN
* display the processing message and do the processing
Def = ""
Def<MTEXT$> = "Selecting PO Numbers..."
Def<MTYPE$> = "U"
MsgUp = Msg(@window, Def)
OPEN 'DICT.ORDER' TO DictVar THEN
SearchString = 'CUST_NO':@VM:CustNos:@VM:@FM
SearchString := 'PO_NO':@VM:'#':@FM
Btree.Extract(SearchString, 'ORDER', DictVar, OrderKeys, '', Flag)
IF Get_Status(errCode) THEN
Msg(@WINDOW,MsgUp)
ErrMsg(errCode)
RETURN
END
IF OrderKeys NE '' THEN
RawPONos = XLATE('ORDER',OrderKeys,ORDER_PO_NO$,'X')
IF Get_Status(errCode) THEN DEBUG
PONos = ''
FOR I = 1 TO COUNT(RawPONos,@VM) + (RawPONos NE '')
RawPONo = RawPONos<1,I>
LOCATE RawPONo IN PONos BY 'AL' USING @VM SETTING Pos ELSE
PONos = INSERT(PONos,1,Pos,0,RawPONo)
END
NEXT I
END ELSE
PONos = ''
END
Msg(@WINDOW,MsgUp)
IF PONos = '' THEN
ErrMsg('No Purchase Orders on file for specified customer.')
RETURN
END
PONos := @VM
CONVERT @VM TO @RM IN PONos
CALL V119('S','','D','R',PONos,'')
IF Get_Status(errCode) THEN DEBUG
CONVERT @RM TO @VM IN PONos
PONos[-1,1] = '' ;* Strip trailing delimiter
TypeOver = ''
TypeOver<PDISPLAY$> = PONos
PONos = Popup(@WINDow,TypeOver,'CUST_PO')
IF Get_Status(errCode) THEN DEBUG
IF PONos NE '' THEN
PONos := @VM:@VM
Set_Property(@WINDOW:'.PO_NO','DEFPROP',PONos)
END
END ELSE
ErrMsg('Unable to open DICT.ORDER in COMM_DIALOG_ORDER_FIND.')
END
RETURN
* * * * * * *
AnnContDC:
* * * * * * *
CustNos = Get_Property(@WINDOW:'.CUST_INFO','ARRAY')<COL$CUST_NO>
LOOP
LastCustNo = CustNos[-1,'B':@VM]
UNTIL LastCustNo NE '' OR CustNos = ''
CustNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
OPEN 'DICT.ANNUAL_CONTRACTS' TO DictVar THEN
SearchString = 'CUST_NO':@VM:CustNos:@VM:@FM
Btree.Extract(SearchString, 'ANNUAL_CONTRACTS', DictVar, ACNos, '', Flag)
IF Get_Status(errCode) THEN
ErrMsg(errCode)
RETURN
END
IF ACNos = '' THEN
ErrMsg('No Annual Contracts on file for specified customer.')
RETURN
END
ACNos := @VM
CONVERT @VM TO @RM IN ACNos
CALL V119('S','','D','R',ACNos,'')
IF Get_Status(errCode) THEN DEBUG
CONVERT @RM TO @VM IN ACNos
acNos[-1,1] = '' ;* Strip trailing delimiter
TypeOver = ''
TypeOver<PDISPLAY$> = ACNos
ACNos = Popup(@WINDow,TypeOver,'CUST_ANN_CONT')
IF ACNos NE '' THEN
ACNos := @VM:@VM
Set_Property(@WINDOW:'.ANN_CONT','DEFPROP',ACNos)
END
END ELSE
ErrMsg('Unable to open DICT.ANNUAL_CONTRACTS in COMM_DIALOG_ORDER_FIND routine.')
END
RETURN
* * * * * * *
QuoteDC:
* * * * * * *
CustArray = Get_Property(@WINDOW:'.CUST_INFO','ARRAY')
CustNos = CustArray<COL$CUST_NO>
LOOP
LastCustNo = CustNos[-1,'B':@VM]
UNTIL LastCustNo NE '' OR CustNos = ''
CustNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF CustNos = '' THEN RETURN
* display the processing message and do the processing
Def = ""
Def<MTEXT$> = "Selecting Quotes..."
Def<MTYPE$> = "U"
MsgUp = Msg(@window, Def)
OPEN 'DICT.ORDER' TO DictVar THEN
SearchString = 'CUST_NO':@VM:CustNos:@VM:@FM
SearchString := 'QUOTE_NO':@VM:'#':@FM
Btree.Extract(SearchString, 'ORDER', DictVar, OrderKeys, '', Flag)
IF Get_Status(errCode) THEN
Msg(@WINDOW,MsgUp)
ErrMsg(errCode)
RETURN
END
IF OrderKeys NE '' THEN
QuoteNos = ''
OrderNos = ''
FOR N = 1 TO COUNT(OrderKeys,@VM) + (OrderKeys NE '')
OrderKey = OrderKeys<1,N>
RawQuoteNos = XLATE('ORDER',OrderKey,'QUOTE_NO','X')
FOR I = 1 TO COUNT(RawQuoteNos,@VM) + (RawQuoteNos NE '')
RawQuoteNo = RawQuoteNos<1,I>
LOCATE RawQuoteNo IN QuoteNos BY 'AL' USING @VM SETTING Pos ELSE
QuoteNos = INSERT(QuoteNos,1,Pos,0,RawQuoteNo)
END
NEXT I
NEXT N
END ELSE
QuoteNos = ''
END
Msg(@WINDOW,MsgUp)
IF QuoteNos = '' THEN
ErrMsg('No Quotes on file for specified customer.')
RETURN
END
QuoteNos := @VM
CONVERT @VM TO @RM IN QuoteNos
CALL V119('S','','D','R',QuoteNos,'')
IF Get_Status(errCode) THEN DEBUG
CONVERT @RM TO @VM IN QuoteNos
QuoteNos[-1,1] = '' ;* Strip trailing delimiter
TypeOver = ''
TypeOver<PDISPLAY$> = QuoteNos
QuoteNos = Popup(@WINDow,TypeOver,'CUST_PO')
IF Get_Status(errCode) THEN DEBUG
IF QuoteNos NE '' THEN
CONVERT @VM TO @FM IN QuoteNos
Set_Property(@WINDOW:'.QUOTE','LIST',QuoteNos)
END
END ELSE
ErrMsg('Unable to open DICT.ORDER in COMM_DIALOG_ORDER_FIND.')
END
RETURN
* * * * * * *
CustPNDC:
* * * * * * *
CustArray = Get_Property(@WINDOW:'.CUST_INFO','ARRAY')
CustNos = CustArray<COL$CUST_NO>
LOOP
LastCustNo = CustNos[-1,'B':@VM]
UNTIL LastCustNo NE '' OR CustNos = ''
CustNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF CustNos = '' THEN RETURN
* display the processing message and do the processing
Def = ""
Def<MTEXT$> = "Selecting Part Numbers..."
Def<MTYPE$> = "U"
MsgUp = Msg(@window, Def)
OPEN 'DICT.WO_LOG' TO DictVar THEN
SearchString = 'CUST_NO':@VM:CustNos:@VM:@FM
SearchString := 'PART_NO':@VM:'#':@FM
Btree.Extract(SearchString, 'WO_LOG', DictVar, WOKeys, '', Flag)
IF Get_Status(errCode) THEN
Msg(@WINDOW,MsgUp)
ErrMsg(errCode)
RETURN
END
IF WOKeys NE '' THEN
PartNos = ''
OrderNos = ''
FOR N = 1 TO COUNT(WOKeys,@VM) + (WOKeys NE '')
WOKey = WOKeys<1,N>
RawPartNos = XLATE('WO_LOG',WOKey,'PART_NO','X')
OrderNo = XLATE('WO_LOG',WOKey,WO_LOG_ORDER_NO$,'X')
FOR I = 1 TO COUNT(RawPartNos,@VM) + (RawPartNos NE '')
RawPartNo = RawPartNos<1,I>
LOCATE RawPartNo IN PartNos BY 'AL' USING @VM SETTING Pos ELSE
PartNos = INSERT(PartNos,1,Pos,0,RawPartNo)
END
LOCATE OrderNo IN OrderNos<Pos> BY 'DR' USING @VM SETTING OPos ELSE
OrderNos = INSERT(OrderNos,Pos,OPos,0,OrderNo)
END
NEXT I
NEXT N
END ELSE
PartNos = ''
END
Msg(@WINDOW,MsgUp)
IF PartNos = '' THEN
ErrMsg('No Purchase Orders on file for specified customer.')
RETURN
END
PartNos := @VM
CONVERT @VM TO @RM IN PartNos
CALL V119('S','','D','R',PartNos,'')
IF Get_Status(errCode) THEN DEBUG
CONVERT @RM TO @VM IN PartNos
PartNos[-1,1] = '' ;* Strip trailing delimiter
TypeOver = ''
TypeOver<PDISPLAY$> = PartNos
PartNos = Popup(@WINDow,TypeOver,'CUST_PO')
IF Get_Status(errCode) THEN DEBUG
IF PartNos NE '' THEN
debug
END
END ELSE
ErrMsg('Unable to open DICT.WO_LOG in COMM_DIALOG_ORDER_FIND.')
END
RETURN
* * * * * * *
LUDate:
* * * * * * *
ReturnCtrl = Parm1[1,@RM]
IF ReturnCtrl = '' THEN ReturnCtrl = Get_Property(@WINDOW,'FOCUS')
DateSelected = Dialog_Box('POPUP_YEAR',@WINDOW)
RetVal = OCONV(DateSelected, 'D4/')
IF RetVal NE '' THEN
obj_Appwindow('LUValReturn',RetVal:@RM:ReturnCtrl)
END
RETURN
* * * * * * *
Cancel:
* * * * * * *
RETURN
* * * * * * *
PerformQuery:
* * * * * * *
* Customer numbers *
SearchString = ''
CustNos = Get_Property(@WINDOW:'.CUST_INFO','ARRAY')<COL$CUST_NO>
LOOP
LastVar = CustNos[-1,'B':@VM]
UNTIL LastVar NE '' OR CustNos = ''
CustNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
ORdCustNos = ''
FOR I = 1 TO COUNT(CustNos,@VM) + (CustNos NE '')
ORdCustNos<1,I> = ';':CustNos<1,I>
NEXT I
IF CustNos NE '' THEN SearchString := 'CUST_NO':@VM:CustNos:@FM:'CUST_BILL_TO':@VM:ORdCustNos:@FM
* Annual contracts *
ACNos = Get_Property(@WINDOW:'.ANN_CONT','ARRAY')<1>
LOOP
LastVal = ACNos[-1,'B':@VM]
UNTIL LastVal NE '' OR ACNos = ''
ACNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF ACNos NE '' THEN SearchString := 'AC_ID':@VM:ACNos:@FM
* Work Orders *
WONos = Get_Property(@WINDOW:'.WO_NO','ARRAY')<1>
LOOP
LastVal = WONos[-1,'B':@VM]
UNTIL LastVal NE '' OR WONos = ''
WONos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF WONos NE '' THEN SearchString := 'WO_KEYS':@VM:WONos:@FM
* Quotes *
QuoteNos = Get_Property(@WINDOW:'.QUOTE','ARRAY')<1>
LOOP
LastVal = QuoteNos[-1,'B':@VM]
UNTIL LastVal NE '' OR QuoteNos = ''
QuoteNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF QuoteNos NE '' THEN SearchString := 'QUOTE_NO':@VM:QuoteNos:@FM
* PONos *
PONos = Get_Property(@WINDOW:'.PO_NO','ARRAY')<1>
LOOP
LastVal = PONos[-1,'B':@VM]
UNTIL LastVal NE '' OR PONos = ''
PONos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF PONos NE '' THEN SearchString := 'PO_NO':@VM:PONos:@FM
* Start and End Dates
StartDt = ICONV(Get_Property(@WINDOW:'.START_DT','TEXT'),'D')
EndDt = ICONV(Get_Property(@WINDOW:'.END_DT','TEXT'),'D')
BEGIN CASE
CASE StartDt NE '' AND EndDt = ''
SearchString := 'ENTRY_DATE':@VM:'>=':OConv(StartDt, 'D4/'):@FM
CASE StartDt = '' AND EndDt NE ''
SearchString := 'ENTRY_DATE':@VM:'<=':OConv(EndDt, 'D4/'):@FM
CASE StartDt NE '' AND EndDt NE ''
* Fudge the dates - '~' is not inclusive of the end dates
StartDt -= 1
EndDt += 1
SearchString := 'ENTRY_DATE':@VM:OConv(StartDt, 'D4/'):'~':OConv(EndDt, 'D4/'):@FM
CASE 1
NULL
END CASE
OrdStatus = Get_Property(@WINDOW:'.STATUS','VALUE')
IF OrdStatus NE 'I' THEN
IF OrdStatus = 1 THEN
SearchString := 'CLOSE_DATE':@VM:'#':@FM
END ELSE
SearchString := 'CLOSE_DATE':@VM:'=':@FM
END
END
OPEN 'DICT.ORDER' TO DictVar THEN
Def = ""
Def<MTEXT$> = "Selecting Orders..."
Def<MTYPE$> = "U"
* display the processing message and do the processing
MsgUp = Msg(@window, Def)
Btree.Extract(SearchString,'ORDER',DictVar,OrderKeys,'',flag)
IF Get_Status(errCode) THEN ErrMsg(errCode)
Msg(@window, MsgUp)
IF Get_Status(errCode) THEN
ErrMsg(errCode)
RETURN
END
End_Dialog(@WINDOW,OrderKeys)
END ELSE
ErrMsg('Unable to open DICT.ORDER in routine COMM_DIALOG_ORDER_FIND')
END
RETURN

View File

@ -0,0 +1,138 @@
COMPILE FUNCTION Comm_Dialog_Packed_Shipments(Method, Parm1)
/*
Commuter module for Dialog_Packed_Shipments window.
03/05/2005 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Send_Event, Set_Status, ErrMsg
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Btree.Extract, Msg, Send_Message
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Utility, Send_Message, Popup, Collect.IXVals, Msg
EQU CRLF$ TO \0D0A\
EQU COL$SHIP_NO TO 1 ;* Customer edit table column equates
EQU COL$CUST_NAME TO 2
EQU COL$WO_NO TO 3
EQU COL$TRACKING_NO TO 4
$INSERT COC_EQU
$INSERT PS_EQUATES
$INSERT POPUP_EQUATES
$INSERT MSG_EQUATES
ErrTitle = 'Error in Comm_Dialog_Packed_Shipments'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Method = 'Create' ; GOSUB Create
CASE Method = 'SelectShipments' ; GOSUB SelectShipments
CASE Method = 'OK' ; GOSUB OK
CASE Method = 'Cancel' ; GOSUB Cancel
CASE 1
ErrMsg(ErrTitle:@SVM:'Unknown method ':QUOTE(Method):' passed to routine.')
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
obj_AppWindow('Create')
* * * * * * *
SelectShipments:
* * * * * * *
StartDt = Date() - 15
OPEN 'DICT.COC' TO DictVar THEN
SearchString = 'ENTRY_DATE':@VM:'>=':OConv(StartDt, 'D4/'):@FM
SearchString := 'CURR_STATUS':@VM:'PACK':@FM
Flag = ''
Btree.Extract(SearchString, 'COC', DictVar, ShipKeys, '', Flag)
IF Get_Status(errCode) THEN
Msg(@window, MsgUp)
ErrMsg(errCode)
RETURN
END
IF ShipKeys = '' THEN
ErrMsg("No Shipments (COC's) on file for last 5 days.")
RETURN
END
OpenShipKeys = ''
CurrStatuses = XLATE('COC',ShipKeys,'CURR_STATUS','X')
FOR I = 1 TO COUNT(ShipKeys,@VM) + (ShipKeys NE '')
IF CurrStatuses<1,I> NE 'COMP' THEN
OpenShipKeys<1,-1> = ShipKeys<1,I>
END
NEXT I
OpenShipKeys := @VM
CONVERT @VM TO @RM IN OpenShipKeys
CALL V119('S','','D','R',OpenShipKeys,'')
IF Get_Status(errCode) THEN DEBUG
CONVERT @RM TO @VM IN OpenShipKeys
OpenShipKeys[-1,1] = '' ;* Strip trailing delimiter
TypeOver = ''
TypeOver<PMODE$> = 'K'
TypeOver<PDISPLAY$> = OpenShipKeys
TypeOver<PSELECT$> = 2 ;* Multiple Select
TypeOver<PTYPE$> = 'E'
ShipData = Popup(@WINDOW,TypeOver,'COC_QUERY')
IF Get_Status(errCode) THEN
ErrMsg(errCode)
RETURN
END
IF ShipData = '' THEN RETURN
ArrayData = ''
FOR I = 1 TO COUNT(ShipData,@FM) + (ShipData NE '')
ArrayData<1,I> = ShipData<I,1>
ArrayData<2,I> = ShipData<I,2>
ArrayData<3,I> = ShipData<I,4>
ArrayData<4,I> = ''
NEXT I
Set_Property(@WINDOW:'.SHIPMENTS','DEFPROP',ArrayData)
DEBUG
END
RETURN
* * * * * * *
OK:
* * * * * * *
RETURN
* * * * * * *
Cancel:
* * * * * * *
RETURN

View File

@ -0,0 +1,158 @@
COMPILE FUNCTION Comm_Dialog_Passdown(Method, Parm1, Parm2)
/*
Commuter module for Dialog_React_Event window.
01/10/2007 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Send_Event, Set_Status, ErrMsg, RList, Obj_React_Event
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Btree.Extract, Msg, Send_Info
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Utility, Send_Message, Popup, Collect.IXVals, Msg
$INSERT APPCOLORS
$INSERT MSG_EQUATES
$INSERT RLIST_EQUATES
$INSERT POPUP_EQUATES
EQU CRLF$ TO \0D0A\
EQU COL$REACT_NO TO 1
EQU COL$REACT_TYPE TO 2
EQU COL$RED_PRESS TO 3
EQU COL$WAFER_SIZE TO 4
EQU COL$TOOL_LOC TO 5
EQU COL$ASSIGNMENT TO 6
EQU COL$ESC_HOURS TO 7
ErrTitle = 'Error in Comm_Dialog_Passdown'
ErrorMsg = ''
ErrCode = ''
Result = ''
BEGIN CASE
CASE Method = 'Create' ; GOSUB Create
CASE Method = 'LUReactor' ; GOSUB LUReactor
CASE Method = 'Cancel' ; GOSUB Cancel
CASE Method = 'PostEntries' ; GOSUB PostEntries
CASE Method = 'ReactNoGF' ; GOSUB ReactNoGF
CASE 1
ErrMsg(ErrTitle:@SVM:'Unknown method ':QUOTE(Method):' passed to routine.')
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
obj_AppWindow('Create')
Set_Property(@WINDOW,'STATUSLINE',@WINDOW:'.STATUSLINE_FIX')
GOSUB Refresh
RETURN
* * * * * * *
Refresh:
* * * * * * *
RETURN
* * * * * * *
ReactNoGF:
* * * * * * *
* Don't add a return here
* * * * * * *
LUReactor:
* * * * * * *
IF NOT(ASSIGNED(Parm1)) THEN FocusControl = '' ELSE FocusControl = Parm1
IF NOT(ASSIGNED(Parm2)) THEN FocusPos = '' ELSE FocusPos = Parm2
Set_Status(0)
TypeOver = ''
TypeOver<PSELECT$> = '2' ;* Multiple Select
TypeOver<PTYPE$> = 'E' ;* Return entire row
ReactData = Popup(@WINDOW,TypeOver,'REACTORS')
IF ReactData = '' THEN RETURN
Set_Property(@WINDOW:'.REACT_NO','LIST',ReactData)
LineCnt = COUNT(ReactData,@FM) + (ReactData NE '')
ColCnt = 7
FOR Line = 1 TO LineCnt
FOR Column = 2 TO ColCnt
stat = Send_Message(@WINDOW:'.REACT_NO','COLOR_BY_POS',Column,Line,GREEN$)
NEXT Column
NEXT Line
RETURN
* * * * * * *
Cancel:
* * * * * * *
End_Dialog(@WINDOW,'')
RETURN
* * * * * * *
PostEntries:
* * * * * * *
ReactNos = Get_Property(@WINDOW:'.REACT_NO','ARRAY')<COL$REACT_NO>
Comment = Get_Property(@WINDOW:'.COMMENT','DEFPROP')
LOOP
TestChar = ReactNos[-1,1]
UNTIL TestChar NE @VM OR ReactNos = ''
ReactNos[-1,1] = ''
REPEAT
EventKeys = '' ;* Keys to return to the REACT_EVENT window for a browse of the newly created records
IF ReactNos NE '' AND Comment NE '' THEN
EventDTM = OCONV(Date(),'D4/'):' ':OCONV(Time(),'MTS') ;* Same DTM for all new records
EventType = 'PD' ;* Passdown
LoggedBy = @USER4
ReactCnt = COUNT(ReactNos,@VM) + (ReactNos NE '')
FOR I = 1 TO ReactCnt
ReactNo = ReactNos<1,I>
CurrMode = XLATE('REACTOR',ReactNo,'CURR_MODE','X')
obj_React_Event('Create',ReactNo:@RM:EventDTM:@RM:EventType:@RM:LoggedBy:@RM:Comment:@RM:@RM:CurrMode)
EventKeys<I> = ReactNo:'*':ICONV(EventDTM,'DT')
NEXT I
END
End_Dialog(@WINDOW,EventKeys)
RETURN

View File

@ -0,0 +1,250 @@
COMPILE FUNCTION Comm_Dialog_Passdown_Rpt(Method, Parm1, Parm2)
#pragma precomp SRP_PreCompiler
/*
Commuter module for Dialog_Passdown_Rpt window.
09/24/2013 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Send_Event, Set_Status, ErrMsg, RList, Reduce
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Btree.Extract, Msg, Send_Info, FSMsg, PlaceDialog
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Utility, Send_Message, Popup, Collect.IXVals, Msg, SRP_Array
$INSERT MSG_EQUATES
$INSERT RLIST_EQUATES
$INSERT POPUP_EQUATES
$INSERT LOGICAL
EQU CRLF$ TO \0D0A\
Equ NEW_EXIST$ To 0 ; * Reduce Mode 0
Equ NEXT_CUR$ To 1
Equ ADD_EXIST$ to 2
ErrTitle = 'Error in Comm_Dialog_Passdown_Rpt'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Method = 'Create' ; GOSUB Create
CASE Method = 'LUReactor' ; GOSUB LUReactor
CASE Method = 'LUDate' ; GOSUB LUDate
CASE Method = 'Cancel' ; GOSUB Cancel
CASE Method = 'Refresh' ; GOSUB Refresh
CASE Method = 'PerformQuery' ; GOSUB PerformQuery
CASE 1
ErrMsg(ErrTitle:@SVM:'Unknown method ':QUOTE(Method):' passed to routine.')
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
// -2 Centers the dialog in the screen and makes it visible.
PlaceDialog(-2, -2)
RETURN
* * * * * * *
Refresh:
* * * * * * *
* Turn edit table symbolic column backgrounds to green
*stat = Send_Message(@WINDOW:'.CUST_INFO','COLOR_BY_POS',COL$CUST_NAME,0,GREEN$) ;* Turn names column all rows green
RETURN
* * * * * * *
LUReactor:
* * * * * * *
CtrlEntID = @WINDOW:'.REACT_NO'
CurrReactNos = Get_Property(CtrlEntID,'ARRAY')<1> ;* Existing React_Nos
CurrReactNosTrimmed = ''
FOR I = 1 TO COUNT(CurrReactNos,@VM) + (CurrReactNos NE '')
IF CurrReactNos<1,I> NE '' THEN
CurrReactNosTrimmed<1,I> = CurrReactNos<1,I>
END
NEXT I
CurrReactNos = CurrReactNosTrimmed
TypeOver = ''
TypeOver<PSELECT$> = 2 ;* Multiple Selections
NewReactNos = Popup(@WINDOW,TypeOver,'REACTORS')
IF NewReactNos = '' OR NewReactNos = CHAR(27) THEN RETURN
FOR I = 1 TO COUNT(NewReactNos,@VM) + (NewReactNos NE '')
NewReactNo = NewReactNos<1,I>
LOCATE NewReactNo IN CurrReactNos BY 'AL' USING @VM SETTING POS ELSE
CurrReactNos = INSERT(CurrReactNos,1,POS,0,NewReactNo)
END
NEXT I
Set_Property(CtrlEntID,'DEFPROP',CurrReactNos)
*Send_Event(CtrlEntID,'CALCULATE',2)
GOSUB Refresh
RETURN
* * * * * * *
LUDate:
* * * * * * *
ReturnCtrl = Parm1[1,@RM]
IF ReturnCtrl = '' THEN ReturnCtrl = Get_Property(@WINDOW,'FOCUS')
DateSelected = Dialog_Box('POPUP_YEAR',@WINDOW)
RetVal = OCONV(DateSelected, 'D4/')
IF RetVal NE '' THEN
obj_Appwindow('LUValReturn',RetVal:@RM:ReturnCtrl)
END
RETURN
* * * * * * *
Cancel:
* * * * * * *
End_Dialog(@WINDOW,'CANCEL')
RETURN
* * * * * * *
PerformQuery:
* * * * * * *
SearchString = ''
* ReactorNo *
ReactNos = Get_Property(@WINDOW:'.REACT_NO','DEFPROP')
LOOP
TestChar = ReactNos[-1,1]
UNTIL TestChar NE @VM OR ReactNos = ''
ReactNos[-1,1] = ''
REPEAT
* Start and End Dates
StartDt = OCONV(ICONV(Get_Property(@WINDOW:'.START_DT','TEXT'),'D'),'D4/')
EndDt = OCONV(ICONV(Get_Property(@WINDOW:'.END_DT','TEXT'),'D'),'D4/')
RetReactNos = ReactNos ;* Save ReactNos for use in the report heading
Flag = ""
Done = False$
CursorVar = ""
* Clears all cursors
For counter = 0 To 8
ClearSelect counter
Next counter
ReduceStartDt = OCONV(ICONV(Get_Property(@WINDOW:'.START_DT','TEXT'),'D') - 1,'D4/')
ReduceEndDt = OCONV(ICONV(Get_Property(@WINDOW:'.END_DT','TEXT'),'D') + 1,'D4/')
SortList = ''
Mode = NEXT_CUR$
BEGIN CASE
CASE StartDt NE '' AND EndDt = ''
ReduceScript = 'WITH {EVENT_DT} GT ':QUOTE(ReduceStartDt):' AND WITH {EVENT_TYPE} EQ "PD"'
CASE StartDt = '' AND EndDt NE ''
ReduceScript = 'WITH {EVENT_DT} LT ':QUOTE(ReduceEndDt):' AND WITH {EVENT_TYPE} EQ "PD"'
CASE StartDt NE '' AND EndDt NE ''
ReduceScript = 'WITH {EVENT_DT} BETWEEN ':QUOTE(ReduceStartDt):' AND ':QUOTE(ReduceEndDt):' AND WITH {EVENT_TYPE} EQ "PD"'
CASE 1
ReduceScript = 'WITH {EVENT_TYPE} EQ "PD"'
END CASE
Def = ""
Def<MTEXT$> = "Selecting Reactor Events..."
Def<MTYPE$> = "U"
MsgUp = Msg(@window, Def)
EventKeys = ''
TableName = "REACT_EVENT"
ErrorMsg = ''
Reduce(ReduceScript, SortList, Mode, TableName, Cursorvar, Flag)
If Flag then
Select TableName By SortList Using Cursorvar then
Open TableName To FileVar then
Loop
ReadNext Key Using Cursorvar By AT Else Done = True$
Until Done
EventKeys<0, -1> = Key
Repeat
IF ReactNos NE '' THEN
Open 'DICT.':TableName to DictVar then
Flag = ''
Option = ''
RxEvents = ''
SearchString = 'REACT_NO'
For each ReactNo in ReactNos using @VM setting vPos
SearchString := @VM : ReactNo
Next ReactNo
SearchString := @FM
Btree.Extract(SearchString, TableName, DictVar, RxEvents, '', Flag)
If Flag NE 0 then
ErrorMsg = 'Process Error':@FM:'Error calling Btree.Extract. Please contact FI for assistance.'
end
EventKeys = SRP_Array('Join', EventKeys, RxEvents, 'AND', @VM)
END
end
End Else
ErrorMsg = 'Process Error':@FM:'Error opening REACT_EVENT table. Please contact FI for assistance.'
End
End Else
ErrorMsg = 'Process Error':@FM:'Error selecting REACT_EVENT table. Please contact FI for assistance.'
end
End Else
ErrorMsg = 'Process Error':@FM:'Error calling Reduce subroutine. Please contact FI for assistance.'
End
Msg(@window, MsgUp)
If ErrorMsg NE '' then ErrMsg(ErrorMsg)
EventKeys = SRP_Array('SortRows', EventKeys, 'AR1':@FM:'DN2', 'LIST', @VM, '*')
End_Dialog(@WINDOW,EventKeys:@FM:RetReactNos:@FM:StartDt:@FM:EndDt)
RETURN

View File

@ -0,0 +1,423 @@
COMPILE FUNCTION Comm_Dialog_PO_No_Change(Method, Parm1)
#pragma precomp SRP_PreCompiler
/*
Commuter module for Dialog_PO_No_Change window.
02/20/2017 - David Klotz & Francois Rivard
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Set_Status, ErrMsg
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Msg, Btree.Extract
DECLARE SUBROUTINE RList, obj_Tables
DECLARE SUBROUTINE Print_WO_Mat_In_Labels, Print_WMI_Labels, Print_WMO_Labels, Print_Cass_Labels
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Popup, Send_Message, MemberOf
DECLARE FUNCTION obj_Tables
DECLARE FUNCTION Msg, Obj_WO_Step
EQU CRLF$ TO \0D0A\
$INSERT APPCOLORS
$INSERT COMPANY_EQUATES
$INSERT CUST_EPI_PART_EQUATES
$INSERT EPI_PART_EQUATES
$INSERT LSL_USERS_EQU
$INSERT MSG_EQUATES
$INSERT NOTIFICATION_EQU
$INSERT POPUP_EQUATES
$INSERT LOGICAL
$INSERT PROD_SPEC_EQU
$INSERT PROD_VER_EQUATES
$INSERT QUOTE_EQU
$INSERT QUOTE_DET_EQU
$INSERT QUOTE_SIGS_EQU
$INSERT RDS_EQUATES
$INSERT REACT_RUN_EQUATES
$INSERT SECURITY_RIGHTS_EQU
$INSERT WM_IN_EQUATES
$INSERT WM_OUT_EQUATES
$INSERT WO_LOG_EQUATES
$INSERT WO_STEP_EQU
$INSERT WO_MAT_EQUATES
$INSERT ORDER_EQU
$INSERT ORDER_DET_EQU
EQU COL$CASSETTES TO 1
EQU TARGET_ACTIVELIST$ TO 5
EQU COL$WO_PARAM_CASSETTE TO 1
EQU COL$WO_PARAM_RDS TO 2
EQU COL$WO_PARAM_LOT TO 3
EQU COL$WO_PARAM_PO TO 4
* EQU COL$WO_PARAM_HOT_LOT TO 5
ErrTitle = 'Error in Comm_Dialog_PO_No_Change'
ErrorMsg = ''
ErrCode = ''
Result = ''
BEGIN CASE
CASE Method = 'Create' ; GOSUB Create
CASE Method = 'NewPONoLF' ; GOSUB NewPONoLF
CASE Method = 'SelectAll' ; GOSUB SelectAll
CASE Method = 'ClearAll' ; GOSUB ClearAll
CASE Method = 'PrintLabels' ; GOSUB PrintLabels
CASE Method = 'Update' ; GOSUB Update
CASE Method = 'Exit' ; GOSUB Exit
CASE Method = 'Close' ; GOSUB Close
CASE 1
ErrMsg(ErrTitle:@SVM:'Unknown method ':QUOTE(Method):' passed to routine.')
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
obj_AppWindow('Create')
WONo = Parm1[1,@FM]
/* Initialize the window's header with the Work Order number */
Title = 'Work Order: ':WONo:' - Change PO Number'
Set_Property(@WINDOW,'TEXT',Title)
Set_Property(@WINDOW:'.WO_NO','TEXT',WONo)
GOSUB RefreshCassettesList
RETURN
**********
NewPONoLF:
**********
RETURN
************
PrintLabels:
************
RDSListCtrl = @WINDOW:'.WO_NO'
WONo = Get_Property(RDSListCtrl, 'TEXT')
IF (WONo NE '') THEN
WOSteps = XLATE('WO_LOG',WONo,WO_LOG_WO_STEP_KEY$,'X')
IF INDEX(WOSteps,@VM,1) THEN
Buttons = ''
FOR I = 1 TO COUNT(WOSteps,@VM) + (WOSteps NE '')
Buttons<I> = 'Step ':I
NEXT I
SWAP @FM WITH ',' IN Buttons
Buttons = 'B':Buttons
TypeOver = ''
TypeOver<MTEXT$> = 'Which Work Order step do you wish to print labels for?'
TypeOver<MTYPE$> = Buttons
TypeOver<MICON$> = '?'
TypeOver<MCAPTION$> = 'MultiStep WorkOrder Selection'
WOStep = Msg(@window, TypeOver)
MultiStepFlag = WOStep
END ELSE
WOStep = 1
MultiStepFlag = 0
END
IF (WOStep = 1) THEN
PSNo = XLATE('WO_STEP',WONo:'*1',WO_STEP_PROD_SPEC_ID$,'X')
ReactorType = XLATE('PROD_SPEC',PSNo,PROD_SPEC_REACTOR_TYPE$,'X')
BEGIN CASE
CASE ReactorType = 'GAN'
Print_WO_Mat_In_Labels(WONo,'')
CASE ReactorType = 'EPP' OR ReactorType = 'P'
Print_WMI_Labels(WONo,1)
Print_WMO_Labels(WONo,1)
CASE 1
RDSNos = XLATE('WO_STEP',WOSteps<1,1>,WO_STEP_RDS_KEY$,'X')
IF INDEX(RDSNos,@VM,1) THEN
TypeOver = ''
TypeOver<PDISPLAY$> = RDSNos
TypeOver<PFIELD$> = 2
TypeOver<PTYPE$> = 'K'
RDSKeys = Popup(@WINDOW,TypeOver,'WO_LOG_RTS')
END ELSE
RDSKeys = RDSNos
END
IF RDSKeys = '' THEN
ErrMsg('No RDS Numbers Selected or Work Order Not Yet Released to Production.')
END ELSE
CONVERT @VM TO @FM IN RDSKeys
Print_Cass_Labels(RDSKeys,MultiStepFlag) ;* Updated labels with Akrion Bar Codes
END
END CASE
END ELSE
Def = ""
Def<MTEXT$> = "Adjusting Step ":WOStep:" Scheduled Quantities..."
Def<MTYPE$> = "U"
MsgUp = Msg(@window, Def)
RDSNos = obj_WO_Step('AdjStepRDSQtys', WOStep:@RM:WOSteps)
IF Get_Status(errCode) THEN
ErrMsg(errCode) ;* Display error from the update
Msg(@WINDOW,MsgUp) ;* Take down the processing message
obj_AppWindow('LoadFormKeys',@WINDOW:@RM:WONo) ;* Reload the data in the form
RETURN
END
Msg(@WINDOW,MsgUp)
IF INDEX(RDSNos,@VM,1) THEN
TypeOver = ''
TypeOver<PDISPLAY$> = RDSNos
TypeOver<PFIELD$> = 2
TypeOver<PTYPE$> = 'K'
RDSKeys = Popup(@WINDOW,TypeOver,'WO_LOG_RTS')
END ELSE
RDSKeys = RDSNos
END
IF RDSKeys = '' THEN
ErrMsg('No RDS Numbers Selected or Work Order Not Yet Released to Production.')
END ELSE
CONVERT @VM TO @FM IN RDSKeys
Print_Cass_Labels(RDSKeys,MultiStepFlag) ;* Updated labels with Akrion Bar Codes
END
END
END ELSE
ErrMsg('WARNING: WO number is missing.')
END
RETURN
* * * * * * *
SelectAll:
* * * * * * *
RDSListCtrl = @WINDOW:'.RDSNOS'
SelectedItems = Get_Property(RDSListCtrl, 'SELPOS')
RDSKeyList = Get_Property(RDSListCtrl, 'LIST')
RDSListCount = COUNT(RDSKeyList,@FM) + (RDSKeyList NE '')
FOR RDSListIndex = 1 TO RDSListCount
IF NOT(Inlist(SelectedItems<2>, RDSListIndex, @VM)) THEN
Set_Property(RDSListCtrl, 'SELPOS', '1':@FM:RDSListindex)
END
NEXT RDSListIndex
RETURN
*********
ClearAll:
*********
RDSListCtrl = @WINDOW:'.RDSNOS'
SelectedItems = Get_Property(RDSListCtrl, 'SELPOS')
RDSKeyList = Get_Property(RDSListCtrl, 'LIST')
RDSListCount = COUNT(RDSKeyList,@FM) + (RDSKeyList NE '')
FOR RDSListIndex = 1 TO RDSListCount
IF Inlist(SelectedItems<2>, RDSListIndex, @VM) THEN
Set_Property(RDSListCtrl, 'SELPOS', '1':@FM:RDSListindex)
END
NEXT RDSListIndex
RETURN
*********************
RefreshCassettesList:
*********************
OPEN 'DICT.RDS' TO DictVar THEN
RDSNos = ''
Flag = ''
SearchString = 'WO':@VM:WONo:@FM
Btree.Extract(SearchString, 'RDS', DictVar, RDSNos, '', Flag)
IF Get_Status(errCode) THEN
ErrMsg(errCode)
RETURN
END
END ELSE
ErrMsg('Unable to open "DICT.RDS" for index lookup in COMM_DIALOG_PO_NO_CHANGE routine.')
RETURN
END
IF INDEX(RDSNos,@VM,1) THEN /* Sort only if two or more records are found */
RDSNos := @VM /* Need a trailer delimiter */
CONVERT @VM TO @RM IN RDSNos
CALL V119('S','','A','R',RDSNos,'') /* Sort the RDS numbers in ascending order */
CONVERT @RM TO @VM IN RDSNos
RDSNos[-1,1] = '' /* Strip previous added trailing delimiter */
END ELSE
NULL
END
OPEN 'RDS' TO RDS_Table ELSE
ErrMsg('Unable to open "RDS" for reads in COMM_DIALOG_PO_NO_CHANGE - Create Event')
RETURN
END
RDS_List = ''
RDSListCount = 0
kCnt = COUNT(RDSNos,@VM) + (RDSNos NE '')
FOR I = 1 TO kCnt
RDSNo = RDSNos<1,I>
READ RDS_Rec FROM RDS_Table,RDSNo THEN
PONo = RDS_Rec<RDS_PO$>
CassNo = RDS_Rec<RDS_CASS_NO$>
LotNo = RDS_Rec<RDS_LOT_NUM$>
OPEN 'DICT.WO_MAT' TO DictVar THEN
SearchString = 'WO_NO':@VM:WONo:@FM
WO_MAT_Keys = ''
Flag = ''
Btree.Extract(SearchString, 'WO_MAT', DictVar, WO_MAT_Keys, '', Flag)
IF Get_Status(errCode) THEN
ErrMsg(errCode)
RETURN
END
END ELSE
ErrMsg('Unable to open "DICT.WO_MAT" for index lookup in COMM_DIALOG_PO_NO_CHANGE routine.')
RETURN
END
OPEN 'WO_MAT' TO WO_MAT_Table ELSE
ErrMsg('Unable to open "WO_MAT" for reads in COMM_DIALOG_PO_NO_CHANGE - Create Event')
RETURN
END
CassetteFound = 0
CassettesCount = COUNT(WO_MAT_Keys,@VM) + (WO_MAT_Keys NE '')
FOR CassettesLoopIndex = 1 TO CassettesCount
WO_MAT_Key = WO_MAT_Keys<1, CassettesLoopIndex>
WO_MAT_Key_Cass = FIELD(WO_MAT_Key,'*',2)
IF (WO_MAT_Key_Cass = CassNo) THEN
READ WO_MAT_Rec FROM WO_MAT_Table,WO_MAT_Key THEN
IF (WO_MAT_Rec<WO_MAT_SHIP_NO$> = '') THEN
RDSListCount = RDSListCount + 1
IF (WO_MAT_Rec<WO_MAT_HOT_LOT$> = 1) THEN
HotLot = 'Hot'
END ELSE
HotLot = ''
END
RDS_List<RDSListCount> = CassNo:@VM:RDSNo:@VM:LotNo:@VM:PONo:@VM:HotLot
END
END
CassetteFound = 1
END
UNTIL CassetteFound = 1
NEXT CassettesLoopIndex
END
NEXT I
Set_Property(@WINDOW:'.RDSNOS','LIST',RDS_List)
RETURN
******
Close:
******
End_Dialog(@WINDOW,'Exit')
RETURN
*****
Exit:
*****
End_Dialog(@WINDOW,'Exit')
RETURN
*******
Update:
*******
RDSListCtrl = @WINDOW:'.WO_NO'
WONo = Get_Property(RDSListCtrl, 'TEXT')
IF (WONo NE '') THEN
NewPONumberCtrl = @WINDOW:'.NEW_PO_NO'
NewPONumber = TRIM(Get_Property(NewPONumberCtrl, 'DEFPROP'))
RDSListCtrl = @WINDOW:'.RDSNOS'
SelectedItems = Get_Property(RDSListCtrl, 'SELPOS')
RDSKeyList = Get_Property(RDSListCtrl, 'LIST')
RDSListCount = COUNT(RDSKeyList,@FM) + (RDSKeyList NE '')
SelectedItemsCount = COUNT(SelectedItems<2>,@VM) + (SelectedItems<2> NE '')
IF (SelectedItemsCount > 0) THEN
Cassettes = ''
FOR RDSListIndex = 1 TO RDSListCount
IF (Inlist(SelectedItems<2>, RDSListIndex, @VM)) THEN
Cassettes := RDSKeyList<RDSListIndex, COL$CASSETTES>:@VM
END
NEXT RDSListIndex
Cassettes[-1,1] = ''
***********************************************
* Update the RDS table with the new PO number *
***********************************************
IF (NewPONumber NE '') THEN
OPEN 'RDS' TO RDSTable ELSE
ErrMsg("ERROR! OBJ_WO_LOG :ChangePONo : Unable to open the RDS Table!")
RETURN
END
RLIST('SELECT REACT_RUN WITH WO_NO = ':QUOTE(WONo):' ',TARGET_ACTIVELIST$,'','','')
Done = 0
LOOP
READNEXT RDSNo ELSE Done = 1
UNTIL Done
READ RDSRec FROM RDSTable,RDSNo THEN
PONo = RDSRec<RDS_PO$>
RONo = XLATE('RDS', RDSNo, 'RUN_ORDER_NUM', 'X')
LOCATE RONo IN Cassettes USING @VM SETTING Pos THEN
RDSRec<RDS_PO$> = NewPONumber
WRITE RDSRec ON RDSTable,RDSNo THEN
Null
END
obj_Tables('WriteRec','RDS':@RM:RDSNo:@RM:@RM:RDSRec)
Result = 'PO Number Changed'
END
END
REPEAT
/* After making the update, refresh the LIST of cassettes */
GOSUB RefreshCassettesList
END
END ELSE
ErrMsg('INFO: A new PO number value is required.')
Set_Property(@WINDOW,'FOCUS',@WINDOW:'.NEW_PO_NO')
END
END ELSE
ErrMsg('WARNING: WO number is missing.')
END
RETURN

View File

@ -0,0 +1,211 @@
COMPILE FUNCTION Comm_Dialog_RDS_Query(Method, Parm1)
/*
Commuter module for Dialog_RDS_Query window.
03/24/2005 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Set_Status, ErrMsg
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Msg, Btree.Extract, Comm_Dialog_Order_Find
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Popup, Utility, Key_Sort, Msg, Send_Message
EQU CRLF$ TO \0D0A\
$INSERT POPUP_EQUATES
$INSERT MSG_EQUATES
$INSERT RDS_EQU
$INSERT APPCOLORS
ErrTitle = 'Error in Comm_Dialog_RDS_Query'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Method = 'Create' ; GOSUB Create
CASE Method = 'PerformQuery' ; GOSUB PerformQuery
CASE Method = 'Cancel' ; GOSUB Cancel
CASE Method = 'SelectStatusCodes' ; GOSUB SelectStatusCodes
CASE 1
ErrMsg(ErrTitle:@SVM:'Unknown method ':QUOTE(Method):' passed to routine.')
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
obj_AppWindow('Create')
Set_Property(@WINDOW:'.USER_ID','INVALUE',@USER4)
* * * * * * *
Refresh:
* * * * * * *
* Turn edit table symbolic column backgrounds to green
stat = Send_Message(@WINDOW:'.CUST_INFO','COLOR_BY_POS',2,0,GREEN$) ;* Turn names column all rows green
stat = Send_Message(@WINDOW:'.CURR_STATUS','COLOR_BY_POS',2,0,GREEN$) ;* Turn names column all rows green
RETURN
* * * * * * *
SelectStatusCodes:
* * * * * * *
ReturnCtrl = @WINDOW:'.CURR_STATUS'
TypeOver = ''
TypeOver<PSELECT$> = 2 ;* Multiple select
StatusCodes = Popup(@WINDOW,TypeOver,'RDS_CURR_STATUS')
IF StatusCodes NE '' THEN
ExistingArray = ''
FOR I = 1 TO COUNT(StatusCodes,@VM) + (StatusCodes NE '') + 1
ExistingArray<1,I> = StatusCodes<1,I>
ExistingArray<2,I> = OCONV(StatusCodes<1,I>,'[RDS_CURR_STATUS_CONV]')
NEXT I
Set_Property(@WINDOW:'.CURR_STATUS','DEFPROP',ExistingArray)
END
GOSUB Refresh
RETURN
* * * * * * *
Close:
* * * * * * *
* * * * * * *
Cancel:
* * * * * * *
End_Dialog(@WINDOW,'Cancel')
RETURN
* * * * * * *
PerformQuery:
* * * * * * *
OPEN 'DICT.RDS' TO DictRDSTable ELSE
ErrMsg( 'Unable to open DICT.RDS...' )
End_Dialog( @WINDOW,'')
END
WONos = Get_Property(@WINDOW:'.WO','ARRAY')<1>
Reactors = Get_Property(@WINDOW:'.REACTORS','ARRAY')<1>
PSNs = Get_Property(@WINDOW:'.PSN_NOS','ARRAY')<1>
QuoteNos = Get_Property(@WINDOW:'.QUOTE_NOS','ARRAY')<1>
PONos = Get_Property(@WINDOW:'.PO','ARRAY')<1>
PartNos = Get_Property(@WINDOW:'.PART_NUM','ARRAY')<1>
LotNos = Get_Property(@WINDOW:'.LOT_NUM','ARRAY')<1>
CurrStatusCds = Get_Property(@WINDOW:'.CURR_STATUS','ARRAY')<1>
CustIds = Get_Property(@WINDOW:'.CUST_INFO','ARRAY')<1>
SWAP @VM:@VM WITH '' IN WONos ; IF WONos[-1,1] = @VM THEN WONos[-1,1] = ''
SWAP @VM:@VM WITH '' IN Reactors ; IF Reactors[-1,1] = @VM THEN Reactors[-1,1] = ''
SWAP @VM:@VM WITH '' IN PSNs ; IF PSNs[-1,1] = @VM THEN PSNs[-1,1] = ''
SWAP @VM:@VM WITH '' IN QuoteNos ; IF QuoteNos[-1,1] = @VM THEN QuoteNos[-1,1] = ''
SWAP @VM:@VM WITH '' IN PONos ; IF PONos[-1,1] = @VM THEN PONos[-1,1] = ''
SWAP @VM:@VM WITH '' IN PartNos ; IF PartNos[-1,1] = @VM THEN PartNos[-1,1] = ''
SWAP @VM:@VM WITH '' IN LotNos ; IF LotNos[-1,1] = @VM THEN LotNos[-1,1] = ''
SWAP @VM:@VM WITH '' IN CurrStatusCds ; IF CurrStatusCds[-1,1] = @VM THEN CurrStatusCds[-1,1] = ''
SWAP @VM:@VM WITH '' IN CustIDs ; IF CustIDs[-1,1] = @VM THEN CustIds[-1,1] = ''
DateInFrom = Get_Property(@WINDOW:'.DATE_IN_FROM','TEXT')
DateInThru = Get_Property(@WINDOW:'.DATE_IN_THRU','TEXT')
DateOutFrom = Get_Property(@WINDOW:'.DATE_OUT_FROM','TEXT')
DateOutThru = Get_Property(@WINDOW:'.DATE_OUT_THRU','TEXT')
TimeInFrom = Get_Property(@WINDOW:'.TIME_IN_FROM','TEXT')
TimeInThru = Get_Property(@WINDOW:'.TIME_IN_THRU','TEXT')
TimeOutFrom = Get_Property(@WINDOW:'.TIME_OUT_FROM','TEXT')
TimeOutThru = Get_Property(@WINDOW:'.TIME_OUT_THRU','TEXT')
SearchStr = ''
IF WONos THEN SearchStr<-1> = 'WO':@VM:WONos
IF Reactors THEN SearchStr<-1> = 'REACTOR':@VM:Reactors
IF PSNs THEN SearchStr<-1> = 'PROD_SPEC_ID':@VM:PSNs
IF QuoteNos THEN SearchStr<-1> = 'QUOTE_NO':@VM:QuoteNos
IF PONos THEN SearchStr<-1> = 'PO':@VM:PONos
IF PartNos THEN SearchStr<-1> = 'PART_NUM':@VM:PartNos
IF LotNos THEN SearchStr<-1> = 'LOT_NUM':@VM:LotNos
IF CurrStatusCds THEN SearchStr<-1> = 'CURR_STATUS':@VM:CurrStatusCds
IF CustIds THEN SearchStr<-1> = 'CUST_NO':@VM:CustIds
IF DateInFrom AND DateInThru THEN
SearchStr<-1> = 'DATE_IN':@VM:DateInFrom:'...':DateInThru
END ELSE
IF DateInFrom THEN SearchStr<-1> = 'DATE_IN':@VM:'>=':DateInFrom
IF DateInThru THEN SearchStr<-1> = 'DATE_IN':@VM:'<=':DateInThru
END
IF DateOutFrom and DateOutThru THEN
SearchStr<-1> = 'DATE_OUT':@VM:DateOutFrom:'...':DateOutThru
END ELSE
IF DateOutFrom THEN SearchStr<-1> = 'DATE_OUT':@VM:'>=':DateOutFrom
IF DateOutThru THEN SearchStr<-1> = 'DATE_OUT':@VM:'<=':DateOutThru
END
IF TimeInFrom and TimeInThru THEN
SearchStr<-1> = 'TIME_IN':@VM:TimeInFrom:'...':TimeInThru
END ELSE
IF TimeInFrom THEN SearchStr<-1> = 'TIME_IN':@VM:'>=':TimeInFrom
IF TimeInThru THEN SearchStr<-1> = 'TIME_IN':@VM:'<=':TimeInThru
END
IF TimeOutFrom and TimeOutThru THEN
SearchStr<-1> = 'TIME_OUT':@VM:TimeOutFrom:'...':TimeOutThru
END ELSE
IF TimeOutFrom THEN SearchStr<-1> = 'TIME_OUT':@VM:'>=':TimeOutFrom
IF TimeOutThru THEN SearchStr<-1> = 'TIME_OUT':@VM:'<=':TimeOutThru
END
IF SearchStr THEN
SearchStr := @FM
Void = Utility( 'CURSOR', 'H' )
* do a btree.extract
Btree.Extract( SearchStr, 'RDS', DictRDSTable, RDSNos, '', Flag )
IF Get_Status(errCode) THEN
ErrMsg(errCode)
End_Dialog( @WINDOW,'')
END
IF RDSNos THEN
CONVERT @VM TO @FM IN RDSNos
RDSNos = Key_Sort( RDSNos, 'RDS', 'CUST_NAME':@fm:'WO':@fm:'RUN_ORDER_NUM', 0 )
End_Dialog( @WINDOW, RDSNos )
END ELSE
MsgInfo = ''
MsgInfo<mtext$> = 'No records found meeting your criteria...'
MsgInfo<micon$> = '!'
Void = msg( '', MsgInfo )
END
Void = utility( 'CURSOR', 'A' )
END ELSE
MsgInfo = ''
MsgInfo<mtext$> = 'You have not entered any search criteria...'
MsgInfo<micon$> = '!'
Void = msg( '', MsgInfo )
END
RETURN

View File

@ -0,0 +1,197 @@
COMPILE FUNCTION Comm_Dialog_RDS_Val_Change(Method, Parm1, Parm2)
/*
Commuter module for Dialog_RDS_Val_Change window.
06/06/2004 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Set_Status, ErrMsg
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Msg
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Popup, Send_Message
EQU CRLF$ TO \0D0A\
$INSERT POPUP_EQUATES
$INSERT APPCOLORS
ErrTitle = 'Error in Comm_Dialog_RDS_Val_Chg'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Method = 'Create' ; GOSUB Create
CASE Method = 'OK' ; GOSUB OK
CASE Method = 'Cancel' ; GOSUB Cancel
CASE Method = 'Refresh' ; GOSUB Refresh
CASE Method = 'InsertRow' ; GOSUB InsertRow
CASE Method = 'DeleteRow' ; GOSUB DeleteRow
CASE Method = 'SetCommitDt' ; GOSUB SetCommitDt
CASE 1
ErrMsg(ErrTitle:@SVM:'Unknown method ':QUOTE(Method):' passed to routine.')
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
obj_AppWindow('Create')
Style = Get_Property(@WINDOW:'.CASSETTES', 'STYLE')
IF Style [1,2] _EQC "0x" THEN
CONVERT @LOWER.CASE TO @UPPER.CASE IN STYLE
Style = ICONV(Style [3,99], "MX")
END
AddStyle = 512 ;* MultiLine Select
MultiStyle = BitOr(Style, AddStyle)
Set_Property(@WINDOW:'.CASSETTES', 'STYLE', MultiStyle)
CassetteList = Parm1
Set_Property(@WINDOW:'.CASSETTES','LIST',CassetteList)
Set_Property(@WINDOW,'@ORG_CASS_LIST',CassetteList)
RETURN
* * * * * * *
Refresh:
* * * * * * *
CtrlName = @WINDOW:'.CASSETTES'
ActiveList = Get_Property(CtrlName,'LIST')
OrgList = Get_Property(@WINDOW,'@ORG_CASS_LIST')
FOR I = 1 TO COUNT(ActiveList,@FM) + (ActiveList NE '')
ActiveLine = ActiveList<I>
FOR K = 1 TO COUNT(ActiveLine,@VM) + (ActiveLine NE '')
IF ActiveList<I,K> NE OrgList<I,K> THEN
stat = Send_Message(CtrlName,'COLOR_BY_POS',K,I,YELLOW$)
END ELSE
stat = Send_Message(CtrlName,'COLOR_BY_POS',K,I,GREEN$)
END
NEXT K
NEXT I
RETURN
* * * * * * *
InsertRow:
* * * * * * *
CtrlName = @WINDOW:'.CASSETTES'
RowIndex = Parm1
DeletedItem = Send_Message(CtrlName, "DELETE", RowIndex)
ErrMsg('Rows may not be inserted in this table.')
RETURN
* * * * * * *
DeleteRow:
* * * * * * *
CtrlName = @WINDOW:'.CASSETTES'
RowIndex = Parm1
RowData = Parm2
InsertedPosition = Send_Message(CtrlName, "INSERT", RowIndex, RowData)
ErrMsg('Rows may not be deleted from this table.')
RETURN
* * * * * * *
SetCommitDt:
* * * * * * *
SelectedLines = Get_Property(@WINDOW:'.CASSETTES','SELPOS')<2>
IF SelectedLines = '' THEN
ErrMsg('You must have at least one line selected in order to change a commit date.')
RETURN
END
CommitDt = Get_Property(@WINDOW:'.COMMIT_DT','TEXT')
IF CommitDt = '' THEN
ErrMsg('Please enter the new commit date you wish to use.')
Set_Property(@WINDOW,'FOCUS',@WINDOW:'.COMMIT_DT')
RETURN
END
FOR I = 1 TO COUNT(SelectedLines,@VM) + (SelectedLines NE '')
SelectedLine = SelectedLines<1,I>
Set_Property(@WINDOW:'.CASSETTES','CELLPOS',CommitDt,4:@FM:SelectedLine) ;* Column 4 is the commit date
NEXT I
GOSUB Refresh
RETURN
* * * * * * *
Close:
* * * * * * *
* * * * * * *
Cancel:
* * * * * * *
End_Dialog(@WINDOW,'Cancel')
RETURN
* * * * * * *
OK:
* * * * * * *
CtrlName = @WINDOW:'.CASSETTES'
ActiveList = Get_Property(CtrlName,'LIST')
OrgList = Get_Property(@WINDOW,'@ORG_CASS_LIST')
RDSNos = ''
CommitDts = ''
HotLots = ''
MUBoxes = ''
CassNos = ''
ResultCnt = 1
FOR I = 1 TO COUNT(ActiveList,@FM) + (ActiveList NE '')
ActiveLine = ActiveList<I>
OrgLine = OrgList<I>
IF ActiveLine NE OrgLine THEN
CassNos<1,ResultCnt> = ActiveLine<1,1>
RDSNos<1,ResultCnt> = ActiveLine<1,2>
CommitDts<1,ResultCnt> = ActiveLine<1,4>
HotLots<1,ResultCnt> = ActiveLine<1,3>
MUBoxes<1,ResultCnt> = ActiveLine<1,6>
ResultCnt += 1
END
NEXT I
Result = RDSNos:@FM:CommitDts:@FM:HotLots:@FM:MUBoxes:@FM:CassNos
End_Dialog(@WINDOW,Result)
RETURN

View File

@ -0,0 +1,248 @@
COMPILE FUNCTION Comm_Dialog_React_Comp_LU(EntID,Event,Parm1,Parm2,Parm3,Parm4,Parm5)
/*
Commuter module for Dialog_React_Comp_LU window.
10/24/2013 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Send_Event, Set_Status, ErrMsg, RList, Send_Message
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Btree.Extract, Msg, Send_Info
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Utility, Send_Message, Popup, Collect.IXVals, Msg
$INSERT APPCOLORS
$INSERT MSG_EQUATES
$INSERT RLIST_EQUATES
$INSERT POPUP_EQUATES
$INSERT REACT_SERVS_EQUATES
$INSERT REACT_COMP_EQUATES
EQU CRLF$ TO \0D0A\
EQU TAB$ TO \09\
ErrTitle = 'Error in Comm_Dialog_React_Comp_LU'
ErrorMsg = ''
ErrCode = ''
Result = ''
BEGIN CASE
CASE EntID = @WINDOW
BEGIN CASE
CASE Event = 'CREATE' ; GOSUB Create
END CASE
CASE EntID = @WINDOW:'.NAVIGATOR'
BEGIN CASE
CASE Event = 'DBLCK' ; GOSUB NavigatorDC
END CASE
CASE 1
ErrorMsg = 'Unknown Parameters ':EntID:' - ':Event:' passed to commuter'
ErrMsg(ErrorMsg)
END CASE
IF ErrorMsg NE '' THEN
ErrMsg(ErrTitle:@SVM:ErrorMsg)
END
RETURN Result
* * * * * * *
Create:
* * * * * * *
obj_AppWindow('Create')
Set_Property(@WINDOW,'STATUSLINE',@WINDOW:'.STATUSLINE_FIX')
SelectSent = "SELECT REACT_COMP WITH CLASS = 'Group' BY DESC"
RList(SelectSent,TARGET_ACTIVELIST$,'','','')
IF Get_Status(errCode) THEN ErrMsg(errCode)
OPEN 'REACT_COMP' TO ReactCompTable ELSE
ErrMsg('Unable to Open "REACT_COMP" table for read')
RETURN
END
Done = 0
PrevSystem = ''
PrevItem = ''
PrevAction = ''
DispLine = 1
DispList = ''
IndentLvl = 1
IndentLvlKeys = ''
LOOP
READNEXT ReactCompID ELSE Done = 1
UNTIL Done
IndentLvlKeys<IndentLvl,-1> = ReactCompID
REPEAT
DispList = ''
LOOP
IndentLvlKey = IndentLvlKeys<IndentLvl,1>
IndentLvlKeys = DELETE(IndentLvlKeys,IndentLvl,1,0)
READ ReactCompRec FROM ReactCompTable,IndentLvlKey THEN
Class = ReactCompRec<REACT_COMP_CLASS$>
Desc = ReactCompRec<REACT_COMP_DESC$>
DispList := IndentLvl:'-':IndentLvl:':':Class:' - ':Desc:@FM
IF ReactCompRec<REACT_COMP_SUB_COMP$> NE '' THEN
IndentLvl += 1
IndentLvlKeys<IndentLvl> = ReactCompRec<REACT_COMP_SUB_COMP$>
END
END ;* End of ReactComprec read.
IF IndentLvlKeys<IndentLvl> = '' THEN
IndentLvl -= 1
IF IndentLvlKeys[-1,1] = @FM THEN
IndentLvlKeys[-1,1] = ''
END
END
UNTIL IndentLvlKeys = ''
REPEAT
Set_Property(@WINDOW:'.NAVIGATOR', 'LIST', DispList)
*Send_Message(@WINDOW:'.NAVIGATOR', 'EXPAND', 0, 1)
RETURN
* * * * * * *
NavigatorDC:
* * * * * * *
RETURN
* * * * * * *
Refresh:
* * * * * * *
RETURN
* * * * * * *
LUReactor:
* * * * * * *
IF NOT(ASSIGNED(Parm1)) THEN FocusControl = '' ELSE FocusControl = Parm1
IF NOT(ASSIGNED(Parm2)) THEN FocusPos = '' ELSE FocusPos = Parm2
Set_Status(0)
TypeOver = ''
TypeOver<PSELECT$> = '2' ;* Multiple Select
TypeOver<PTYPE$> = 'E' ;* Return entire row
ReactData = Popup(@WINDOW,TypeOver,'REACTORS')
IF ReactData = '' THEN RETURN
Set_Property(@WINDOW:'.REACT_NO','LIST',ReactData)
LineCnt = COUNT(ReactData,@FM) + (ReactData NE '')
ColCnt = 7
FOR Line = 1 TO LineCnt
FOR Column = 2 TO ColCnt
stat = Send_Message(@WINDOW:'.REACT_NO','COLOR_BY_POS',Column,Line,GREEN$)
NEXT Column
NEXT Line
RETURN
* * * * * * *
LUEventTYpe:
* * * * * * *
IF NOT(ASSIGNED(Parm1)) THEN FocusControl = '' ELSE FocusControl = Parm1
IF NOT(ASSIGNED(Parm2)) THEN FocusPos = '' ELSE FocusPos = Parm2
Set_Status(0)
TypeOver = ''
TypeOver<PSELECT$> = '2' ;* Multiple Select
TypeOver<PTYPE$> = 'E' ;* Return entire row
EventTypes = Popup(@WINDOW,TypeOver,'REACT_EVENT_TYPE')
IF EventTypes = '' THEN RETURN
Set_Property(@WINDOW:'.EVENT_TYPE','LIST',EventTypes)
LineCnt = COUNT(EventTypes,@FM) + (EventTypes NE '')
ColCnt = 2
FOR Line = 1 TO LineCnt
FOR Column = 2 TO ColCnt
stat = Send_Message(@WINDOW:'.EVENT_TYPE','COLOR_BY_POS',Column,Line,GREEN$)
NEXT Column
NEXT Line
RETURN
* * * * * * *
Cancel:
* * * * * * *
RETURN
* * * * * * *
PerformQuery:
* * * * * * *
SearchString = ''
End_Dialog(@WINDOW,EventKeys)
RETURN

View File

@ -0,0 +1,290 @@
COMPILE FUNCTION Comm_Dialog_React_Event_Query(Method, Parm1, Parm2)
/*
Commuter module for Dialog_React_Event window.
01/10/2007 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Send_Event, Set_Status, ErrMsg, RList
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Btree.Extract, Msg, Send_Info
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Utility, Send_Message, Popup, Collect.IXVals, Msg
$INSERT APPCOLORS
$INSERT MSG_EQUATES
$INSERT RLIST_EQUATES
$INSERT POPUP_EQUATES
EQU CRLF$ TO \0D0A\
EQU COL$REACT_NO TO 1
EQU COL$REACT_TYPE TO 2
EQU COL$RED_PRESS TO 3
EQU COL$WAFER_SIZE TO 4
EQU COL$TOOL_LOC TO 5
EQU COL$ASSIGNMENT TO 6
EQU COL$ESC_HOURS TO 7
EQU COL$EVENT_CD TO 1
EQU COL$EVENT_TYPE TO 2
ErrTitle = 'Error in Comm_Dialog_Order_Find'
ErrorMsg = ''
ErrCode = ''
Result = ''
BEGIN CASE
CASE Method = 'Create' ; GOSUB Create
CASE Method = 'LUReactor' ; GOSUB LUReactor
CASE Method = 'LUEventType' ; GOSUB LUEventType
CASE Method = 'LUDate' ; GOSUB LUDate
CASE Method = 'StartDtGF' ; GOSUB StartDtGF
CASE Method = 'Cancel' ; GOSUB Cancel
CASE Method = 'Refresh' ; GOSUB Refresh
CASE Method = 'PerformQuery' ; GOSUB PerformQuery
CASE 1
ErrMsg(ErrTitle:@SVM:'Unknown method ':QUOTE(Method):' passed to routine.')
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
obj_AppWindow('Create')
Set_Property(@WINDOW,'STATUSLINE',@WINDOW:'.STATUSLINE_FIX')
GOSUB Refresh
RETURN
* * * * * * *
Refresh:
* * * * * * *
RETURN
* * * * * * *
LUReactor:
* * * * * * *
IF NOT(ASSIGNED(Parm1)) THEN FocusControl = '' ELSE FocusControl = Parm1
IF NOT(ASSIGNED(Parm2)) THEN FocusPos = '' ELSE FocusPos = Parm2
Set_Status(0)
TypeOver = ''
TypeOver<PSELECT$> = '2' ;* Multiple Select
TypeOver<PTYPE$> = 'E' ;* Return entire row
ReactData = Popup(@WINDOW,TypeOver,'REACTORS')
IF ReactData = '' THEN RETURN
Set_Property(@WINDOW:'.REACT_NO','LIST',ReactData)
LineCnt = COUNT(ReactData,@FM) + (ReactData NE '')
ColCnt = 7
FOR Line = 1 TO LineCnt
FOR Column = 2 TO ColCnt
stat = Send_Message(@WINDOW:'.REACT_NO','COLOR_BY_POS',Column,Line,GREEN$)
NEXT Column
NEXT Line
RETURN
* * * * * * *
LUEventTYpe:
* * * * * * *
IF NOT(ASSIGNED(Parm1)) THEN FocusControl = '' ELSE FocusControl = Parm1
IF NOT(ASSIGNED(Parm2)) THEN FocusPos = '' ELSE FocusPos = Parm2
Set_Status(0)
TypeOver = ''
TypeOver<PSELECT$> = '2' ;* Multiple Select
TypeOver<PTYPE$> = 'E' ;* Return entire row
EventTypes = Popup(@WINDOW,TypeOver,'REACT_EVENT_TYPE')
IF EventTypes = '' THEN RETURN
Set_Property(@WINDOW:'.EVENT_TYPE','LIST',EventTypes)
LineCnt = COUNT(EventTypes,@FM) + (EventTypes NE '')
ColCnt = 2
FOR Line = 1 TO LineCnt
FOR Column = 2 TO ColCnt
stat = Send_Message(@WINDOW:'.EVENT_TYPE','COLOR_BY_POS',Column,Line,GREEN$)
NEXT Column
NEXT Line
RETURN
* * * * * * *
LUDate:
* * * * * * *
ReturnCtrl = Parm1[1,@RM]
IF ReturnCtrl = '' THEN ReturnCtrl = Get_Property(@WINDOW,'FOCUS')
DateSelected = Dialog_Box('POPUP_YEAR',@WINDOW)
RetVal = OCONV(DateSelected, 'D4/')
IF RetVal NE '' THEN
obj_Appwindow('LUValReturn',RetVal:@RM:ReturnCtrl)
END
RETURN
* * * * * * *
StartDtGF:
* * * * * * *
StartDt = Get_Property(@WINDOW:'.START_DT','DEFPROP')
IF StartDt = '' THEN
Set_Property(@WINDOW:'.START_DT','DEFPROP',OCONV(Date(),'D4/'))
Set_Property(@WINDOW:'.START_DT','SELECTION',1:@FM:99)
END
RETURN
* * * * * * *
Cancel:
* * * * * * *
RETURN
* * * * * * *
PerformQuery:
* * * * * * *
SearchString = ''
* ReactorNo *
ReactNos = Get_Property(@WINDOW:'.REACT_NO','ARRAY')<COL$REACT_NO>
LOOP
TestChar = ReactNos[-1,1]
UNTIL TestChar NE @VM OR ReactNos = ''
ReactNos[-1,1] = ''
REPEAT
* Event Types *
EventTypes = Get_Property(@WINDOW:'.EVENT_TYPE','DEFPROP')<COL$EVENT_CD>
LOOP
TestChar = EventTypes[-1,1]
UNTIL TestChar NE @VM OR EventTypes = ''
EventTypes[-1,1] = ''
REPEAT
* Start and End Dates
StartDt = OCONV(ICONV(Get_Property(@WINDOW:'.START_DT','TEXT'),'D'),'D4')
EndDt = OCONV(ICONV(Get_Property(@WINDOW:'.END_DT','TEXT'),'D'),'D4')
SelectSent = 'SELECT REACT_EVENT '
BEGIN CASE
CASE StartDt NE '' AND EndDt = ''
SelectSent := 'WITH EVENT_DT GE ':QUOTE(StartDt)
CASE StartDt = '' AND EndDt NE ''
SelectSent := 'WITH EVENT_DT LE ':QUOTE(EndDt)
CASE StartDt NE '' AND EndDt NE ''
SelectSent := 'WITH EVENT_DT GE ':QUOTE(StartDt):' AND WITH EVENT_DT LE ':QUOTE(EndDt)
CASE 1
NULL
END CASE
IF ReactNos NE '' THEN
SWAP @VM WITH '" "' in ReactNos
SelectSent := ' AND WITH REACT_NO ':QUOTE(ReactNos)
END
IF EventTypes NE '' THEN
SWAP @VM WITH '" "' IN EventTypes
SelectSent := ' AND WITH EVENT_TYPE ':QUOTE(EventTypes)
END
IF ReactNos = '' THEN
SelectSent := ' BY REACT_NO'
END
SelectSent := ' BY-DSND EVENT_DTM'
Def = ""
Def<MTEXT$> = "Selecting Reactor Events..."
Def<MTYPE$> = "U"
* display the processing message and do the processing
MsgUp = Msg(@window, Def)
RList(SelectSent,TARGET_ACTIVELIST$,'','','')
IF Get_Status(errCode) THEN
Msg(@window, MsgUp)
ErrMsg(errCode)
RETURN
END ELSE
Msg(@window, MsgUp)
END
EventKeys = ''
Done = ''
LOOP
READNEXT EventKey ELSE Done = 1
UNTIL Done
EventKeys := EventKey:@VM
REPEAT
EventKeys [-1,1] = ''
End_Dialog(@WINDOW,EventKeys)
RETURN

View File

@ -0,0 +1,240 @@
COMPILE FUNCTION Comm_Dialog_React_Serv_LU(EntID,Event,Parm1,Parm2,Parm3,Parm4,Parm5)
/*
Commuter module for Dialog_React_Serv_LU window.
10/24/2013 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Send_Event, Set_Status, ErrMsg, RList, Send_Message
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Btree.Extract, Msg, Send_Info
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Utility, Send_Message, Popup, Collect.IXVals, Msg
$INSERT APPCOLORS
$INSERT MSG_EQUATES
$INSERT RLIST_EQUATES
$INSERT POPUP_EQUATES
$INSERT REACT_SERVS_EQUATES
EQU CRLF$ TO \0D0A\
EQU TAB$ TO \09\
ErrTitle = 'Error in Comm_Dialog_React_Serv_LU'
ErrorMsg = ''
ErrCode = ''
Result = ''
BEGIN CASE
CASE EntID = @WINDOW
BEGIN CASE
CASE Event = 'CREATE' ; GOSUB Create
END CASE
CASE EntID = @WINDOW:'.NAVIGATOR'
BEGIN CASE
CASE Event = 'DBLCK' ; GOSUB NavigatorDC
END CASE
CASE 1
ErrorMsg = 'Unknown Parameters ':EntID:' - ':Event:' passed to commuter'
ErrMsg(ErrorMsg)
END CASE
IF ErrorMsg NE '' THEN
ErrMsg(ErrTitle:@SVM:ErrorMsg)
END
RETURN Result
* * * * * * *
Create:
* * * * * * *
obj_AppWindow('Create')
Set_Property(@WINDOW,'STATUSLINE',@WINDOW:'.STATUSLINE_FIX')
SelectSent = 'SELECT REACT_SERVS BY REACT_SYSTEM BY REACT_ITEM BY ACTION BY SVC_DESC'
RList(SelectSent,TARGET_ACTIVELIST$,'','','')
IF Get_Status(errCode) THEN ErrMsg(errCode)
OPEN 'REACT_SERVS' TO ReactServTable ELSE
ErrMsg('Unable to Open "REACT_SERVS" table for read')
RETURN
END
Done = 0
PrevSystem = ''
PrevItem = ''
PrevAction = ''
DispLine = 1
DispList = ''
LOOP
READNEXT ReactServID ELSE Done = 1
UNTIL Done
READ ReactServRec FROM ReactServTable,ReactServID THEN
System = ReactServRec<REACT_SERVS_REACT_SYSTEM$>
Item = ReactServRec<REACT_SERVS_REACT_ITEM$>
Action = ReactServRec<REACT_SERVS_ACTION$>
SvcDesc = ReactServRec<REACT_SERVS_SVC_DESC$>
IF System = '' THEN System = 'N/A'
IF System NE PrevSystem THEN
DispList := '1-1:':'System - ':System:@FM
PrevSystem = System
END
IF Item NE PrevItem THEN
DispList := '2-2:':Item:@FM
PrevItem = Item
END
IF Action NE PrevAction THEN
DispList := '3-3:':Action:@FM
PrevAction = Action
END
IF SvcDesc NE '' THEN
DispList := '4-4:':SvcDesc:@FM
END
END ;* End of ReactServRec read.
REPEAT
Set_Property(@WINDOW:'.NAVIGATOR', 'LIST', DispList)
*Send_Message(@WINDOW:'.NAVIGATOR', 'EXPAND', 0, 1)
RETURN
* * * * * * *
NavigatorDC:
* * * * * * *
RETURN
* * * * * * *
Refresh:
* * * * * * *
RETURN
* * * * * * *
LUReactor:
* * * * * * *
IF NOT(ASSIGNED(Parm1)) THEN FocusControl = '' ELSE FocusControl = Parm1
IF NOT(ASSIGNED(Parm2)) THEN FocusPos = '' ELSE FocusPos = Parm2
Set_Status(0)
TypeOver = ''
TypeOver<PSELECT$> = '2' ;* Multiple Select
TypeOver<PTYPE$> = 'E' ;* Return entire row
ReactData = Popup(@WINDOW,TypeOver,'REACTORS')
IF ReactData = '' THEN RETURN
Set_Property(@WINDOW:'.REACT_NO','LIST',ReactData)
LineCnt = COUNT(ReactData,@FM) + (ReactData NE '')
ColCnt = 7
FOR Line = 1 TO LineCnt
FOR Column = 2 TO ColCnt
stat = Send_Message(@WINDOW:'.REACT_NO','COLOR_BY_POS',Column,Line,GREEN$)
NEXT Column
NEXT Line
RETURN
* * * * * * *
LUEventTYpe:
* * * * * * *
IF NOT(ASSIGNED(Parm1)) THEN FocusControl = '' ELSE FocusControl = Parm1
IF NOT(ASSIGNED(Parm2)) THEN FocusPos = '' ELSE FocusPos = Parm2
Set_Status(0)
TypeOver = ''
TypeOver<PSELECT$> = '2' ;* Multiple Select
TypeOver<PTYPE$> = 'E' ;* Return entire row
EventTypes = Popup(@WINDOW,TypeOver,'REACT_EVENT_TYPE')
IF EventTypes = '' THEN RETURN
Set_Property(@WINDOW:'.EVENT_TYPE','LIST',EventTypes)
LineCnt = COUNT(EventTypes,@FM) + (EventTypes NE '')
ColCnt = 2
FOR Line = 1 TO LineCnt
FOR Column = 2 TO ColCnt
stat = Send_Message(@WINDOW:'.EVENT_TYPE','COLOR_BY_POS',Column,Line,GREEN$)
NEXT Column
NEXT Line
RETURN
* * * * * * *
Cancel:
* * * * * * *
RETURN
* * * * * * *
PerformQuery:
* * * * * * *
SearchString = ''
End_Dialog(@WINDOW,EventKeys)
RETURN

View File

@ -0,0 +1,249 @@
COMPILE FUNCTION Comm_Dialog_SAP_Comm( Instruction, Parm1 )
/*
Commuter Module for SAP Communications Window
J.C. Henry, Inc. - John C. Henry
*/
DECLARE SUBROUTINE Center_Window,StatusLine,Set_Property,End_Dialog, Send_Event, Set_Status, Adios, obj_SAP, obj_Notes, obj_Post_Log, RList, SAP_Services
DECLARE SUBROUTINE ErrMsg, Send_Message, obj_Tables, Post_Event, Send_INfo, ShowWindow, obj_Appwindow, Send_Dyn,ErrLog, obj_WO_Mat_Log, Sleepery, Yield, SRP_Stopwatch, SRP_TCPClient
DECLARE FUNCTION Get_Property, Get_Status,Dialog_Box, FindWindow, Utility, SAP_Services, Database_Services, SRP_TCPClient
$INSERT QUOTE_SIGS_EQU
$INSERT NOTIFICATION_EQU
$INSERT APPCOLORS
$INSERT LOGICAL
EQU CRLF$ TO \0D0A\
EQU InBoundLimit$ TO 20
EQU OutBoundLimit$ TO 10
EQU DEFAULT_INTERVAL$ TO 10 /* Seconds */
$INSERT ENVIRON_CONSTANTS
ErrTitle = 'Error in Comm_Dialog_SAP_Comm routine'
ErrorMsg = ''
Instructions = 'Create'
Instructions := @FM:'Timer'
Instructions := @FM:'StartStop'
Instructions := @FM:'CommStartStop'
Instructions := @FM:'Close'
RetVal = ''
BEGIN CASE
CASE Instruction = 'Create' ; GOSUB Create
CASE Instruction = 'Timer' ; GOSUB Timer
CASE Instruction EQ @Window : '.LOG_ON' AND Parm1 EQ 'CLICK' ; GoSub LOG_ON.CLICK
CASE Instruction EQ @Window : '.TRANS_QTY' AND Parm1 EQ 'LOSTFOCUS' ; GoSub TRANS_QTY.LOSTFOCUS
CASE Instruction EQ @Window : '.SAP_HOLD_START_DTM' AND Parm1 EQ 'LOSTFOCUS' ; GoSub SAP_HOLD_START_DTM.LOSTFOCUS
CASE Instruction EQ @Window : '.SAP_HOLD_STOP_DTM' AND Parm1 EQ 'LOSTFOCUS' ; GoSub SAP_HOLD_STOP_DTM.LOSTFOCUS
CASE Instruction = 'Close' ; GOSUB Close
CASE 1
ErrorMsg = 'Unknown Instruction ':QUOTE(Instruction):' passed to routine'
END CASE
IF ErrorMsg NE '' THEN
ErrMsg(ErrTitle:@SVM:ErrorMsg)
END
RETURN RetVal
* * * * * * *
Create:
* * * * * * *
obj_Appwindow('Create',@WINDOW)
otParms = 'SYSOBJ':@RM:'SAP_COMM'
obj_Tables('LockRec',otParms) ;* Places lock on fictional record
IF Get_Status(errCode) THEN
ErrorMsg = ErrTitle:@SVM:'Another SAP Communications Server is already running.'
ErrMsg(ErrorMsg)
Post_Event(@WINDOW,'CLOSE')
RETURN
END
Set_Property(@WINDOW,'@LOCKED',1) ;* Set ad-hoc property '@LOCKED' to true
Set_Property(@WINDOW,'TIMER','0':@FM:'1000') ;* Set timer event to start in 1000 msecs (1 second). Do not set for auto-repeat. Let the TIMER event handle this.
Set_Property(@WINDOW:'.TRANS_QTY', 'INVALUE', SAP_Services('GetSAPTransactionLimit'))
Set_Property(@WINDOW:'.SAP_HOLD_START_DTM', 'INVALUE', SAP_Services('GetSAPHoldStartDateTime'))
Set_Property(@WINDOW:'.SAP_HOLD_STOP_DTM', 'INVALUE', SAP_Services('GetSAPHoldStopDateTime'))
RETURN
LOG_ON.CLICK:
LoggingFlag = Get_Property(@Window : '.LOG_ON', 'CHECK')
SAP_Services('SetTransactionLoggingFlag', LoggingFlag)
return
TRANS_QTY.LOSTFOCUS:
TransactionLimit = Get_Property(@Window : '.TRANS_QTY', 'TEXT')
SAP_Services('SetSAPTransactionLimit', TransactionLimit)
return
SAP_HOLD_START_DTM.LOSTFOCUS:
HoldStartDTM = Get_Property(@Window : '.SAP_HOLD_START_DTM', 'INVALUE')
SAP_Services('SetSAPHoldStartDateTime', HoldStartDTM)
return
SAP_HOLD_STOP_DTM.LOSTFOCUS:
HoldStopDTM = Get_Property(@Window : '.SAP_HOLD_STOP_DTM', 'INVALUE')
SAP_Services('SetSAPHoldStopDateTime', HoldStopDTM)
return
* * * * * * *
Close:
* * * * * * *
UNLOCK ALL
NumWindows = Utility('WINCOUNT')
If NumWindows EQ 1 then Set_Property('SYSTEM','IDLEPROC','ADIOS')
RETURN
* * * * * * *
Timer:
* * * * * * *
Set_Status(0)
Set_Property(@WINDOW:'.CURR_TIME','TEXT',OCONV( Time(), 'MTHS' )) ;* Clock on window
LastTime = Get_Property(@WINDOW,'@LAST_TIME')
* * * Added 1/29/2015 JCH/DKK * * *
*** Used to temporarily stop the SAP interface during specified time periods, like SAP-PI outage, EOM procesing, VM backups.
SAPOutage = SAP_Services('GetSAPOutageFlag')
IF SAPOutage THEN
Set_Property(@WINDOW:'.BACKUP_HOLD','VISIBLE',1)
END ELSE
Set_Property(@WINDOW:'.BACKUP_HOLD','VISIBLE',0)
END
IF LastTime > Time() THEN
Set_Property(@WINDOW,'@LAST_TIME', Time()) ;* Midnight -> clock resets to 0
LastTime = Time()
// Call the SRPEngineService and pass it the command
Command = 'RUN SAP_SERVICES "SendReconcile"'
TCPServerSettings@ = Database_Services('ReadDataRow', 'APP_INFO', 'SQL_TCPIP_SETTINGS')
TcpClientHandle = 0
If SRP_TcpClient(TcpClientHandle, 'CONNECT', TCPServerSettings@<1>, TCPServerSettings@<2>) then
SRP_TcpClient(TcpClientHandle, 'SEND_SES', Command)
SRP_TcpClient(TcpClientHandle, 'CLOSE_SES')
end
* obj_SAP('SendReconcile') ;* WIP Recom data sent to SAP once each day at midnight
END
CommOn = Get_Property(@WINDOW,'@COMM_ACTIVE')
CommOnTime = Get_Property(@WINDOW,'@COMM_ACTIVE_TIME')
IF CommOn THEN
Send_Info('Comm Active...')
IF Time() - CommOnTime > 22 THEN
Set_Property(@WINDOW,'@COMM_ACTIVE',0) ;* FTP window timeout takes about 21 seconds
Set_Property(@WINDOW,'@COMM_ACTIVE_TIME','') ;* Hold off retrying until
END
END ELSE
Interval = DEFAULT_INTERVAL$
IF Time() >= (LastTime + Interval) Then ;* SAP_Comm cycle time setting = 10 sec - changed to 8 sec -dkk 1/14/15
Set_Property(@WINDOW,'@LAST_TIME', Time())
END ;* End of comm interval time check
END ;* End of check for @COMM_ON flag
*********************************************
* Refresh the SAP Buffer Outbound Qty Count *
*********************************************
OutboundQty = SAP_Services('GetOutboundPending')
Set_Property(@WINDOW:'.OUTBOUND_QTY','TEXT', OutboundQty)
If (OutboundQty >= OutBoundLimit$) Then
OutBoundMsgSent = Get_Property(@Window,'@OutBoundMsgSent')
If (OutBoundMsgSent NE True$) Then
Recipients = XLATE('NOTIFICATION', 'FI_SUPPORT', 'USER_ID', 'X')
SentFrom = 'OI Admin'
Subject = 'SAP Comm OUTBOUND Pending Buffer'
Message = 'SAP Comm OUTBOUND Pending Buffer is filling up with ':OutboundQty:' records not sent. Check SAP interface.'
AttachWindow = ''
AttachKey = ''
SendToGroup = ''
Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup
obj_Notes('Create',Parms)
Set_Property(@WINDOW,'@OutBoundMsgSent', True$)
end
end else
Set_Property(@WINDOW,'@OutBoundMsgSent', False$)
end
************************************************
* Refresh the SAP Buffer Inbound Pending Count *
************************************************
Set_Status(0)
InboundPending = SAP_Services('GetInboundPending')
If InboundPending < 0 then InboundPending = 0
Set_Property(@WINDOW:'.INBOUND_PENDING','TEXT', InboundPending)
If (InboundPending >= InBoundLimit$) Then
InBoundMsgSent = Get_Property(@Window,'@InBoundMsgSent')
If (InBoundMsgSent NE True$) Then
Recipients = XLATE('NOTIFICATION', 'FI_SUPPORT', 'USER_ID', 'X')
SentFrom = 'OI Admin'
Subject = 'SAP Comm INBOUND Pending Buffer'
Message = 'SAP Comm INBOUND Pending Buffer is filling up with ':InBoundPending:' records not received. Check SAP interface.'
AttachWindow = ''
AttachKey = ''
SendToGroup = ''
Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup
obj_Notes('Create',Parms)
Set_Property(@WINDOW,'@InBoundMsgSent', True$)
end
end else
Set_Property(@WINDOW,'@InBoundMsgSent', False$)
end
Yield(); Yield(); Yield(); Yield(); Yield(); Yield(); Yield(); Yield(); Yield(); Yield()
Sleepery(500)
Set_Property(@WINDOW,'TIMER','0':@FM:'1000') ;* Set the next timer event to start in 1000 msecs (1 second).
RETURN

View File

@ -0,0 +1,81 @@
COMPILE FUNCTION Comm_Dialog_Text(Method, Parm1, Parm2)
/*
Commuter module for Dialog_Text window.
06/09/2004 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Set_Status, ErrMsg
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Msg
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Popup, Send_Message
EQU CRLF$ TO \0D0A\
$INSERT POPUP_EQUATES
$INSERT APPCOLORS
ErrTitle = 'Error in Comm_Dialog_Text'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Method = 'Create' ; GOSUB Create
CASE Method = 'OK' ; GOSUB OK
CASE Method = 'Cancel' ; GOSUB Cancel
CASE Method = 'Close' ; GOSUB Close
CASE 1
ErrMsg(ErrTitle:@SVM:'Unknown method ':QUOTE(Method):' passed to routine.')
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
obj_AppWindow('Create')
WindowTitle = Parm1<1>
TextIn = Parm1<2>
Set_Property(@WINDOW,'TEXT',WindowTitle)
Set_Property(@WINDOW:'.TEXT_BOX','DEFPROP',TextIn)
RETURN
* * * * * * *
Close:
* * * * * * *
* * * * * * *
Cancel:
* * * * * * *
End_Dialog(@WINDOW,'Cancel')
RETURN
* * * * * * *
OK:
* * * * * * *
Text = Get_Property(@WINDOW:'.TEXT_BOX','DEFPROP')
Result = Text
End_Dialog(@WINDOW,Result)
RETURN

View File

@ -0,0 +1,241 @@
COMPILE FUNCTION Comm_Dialog_Tool_Mode(Method, Parm1, Parm2, Parm3)
/*
Commuter module for Dialog_Tool_Mode window.
10/23/2007 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Set_Status, ErrMsg
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Msg, obj_Tool_Log
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Popup, Send_Message, SRP_Array
EQU CRLF$ TO \0D0A\
$INSERT POPUP_EQUATES
$INSERT LOGICAL
$INSERT APPCOLORS
$insert IR_INSERTS
$INSERT TOOL_EQUATES
ErrCode = ''
ErrorMsg = ''
ErrTitle = 'Error in Comm_Dialog_Tool_Mode'
Result = ''
Begin Case
CASE Method = 'Create' ; GOSUB Create
CASE Method = 'OK' ; GOSUB OK
CASE Method = 'Cancel' ; GOSUB Cancel
CASE Method = 'Close' ; GOSUB Close
CASE Method = 'Refresh' ; GOSUB Refresh
CASE Method = 'LU_UserID' ; GOSUB LU_UserID
CASE Method = 'UserIDLF' ; GOSUB UserIDLF
CASE Method = 'LU_ChgToMode' ; GOSUB LU_ChgToMode
Case Method = 'EnableOK' ; GOSUB EnableOK
CASE 1
ErrMsg(ErrTitle:@SVM:'Unknown method ':QUOTE(Method):' passed to routine.')
End Case
Return Result
* * * * * * *
Create:
* * * * * * *
obj_AppWindow('Create')
ToolID = Parm1
ToolRec = XLATE('TOOL', ToolID, '', 'X')
ToolDesc = ToolRec<TOOL_TOOL_DESC$>
ToolProc = ToolRec<TOOL_TOOL_PROC$>
CurrMode = XLATE('TOOL', ToolID, 'CURR_MODE', 'X')<1,1>
IF CurrMode EQ "" THEN
obj_Tool_Log('InitialLog', ToolID)
IF Get_Status(errCode) THEN
ErrMsg(errCode)
RETURN
END
CurrMode = 'OUT'
END
* Window title in top bar
WinText = 'Tool Mode Change - ':ToolDesc
Set_Property(@WINDOW, 'TEXT', WinText)
UserName = Oconv(@USER4, '[XLATE_CONV,LSL_USERS*FIRST_LAST]')
Set_Property(@WINDOW:'.USER_ID', 'DEFPROP', @USER4)
Set_Property(@WINDOW:'.USER_NAME', 'DEFPROP', UserName)
Set_Property(@WINDOW:'.REASON', 'FOCUS', 1)
Set_Property(@WINDOW:'.TOOL_ID', 'DEFPROP', ToolID)
Set_Property(@WINDOW:'.CURR_MODE', 'DEFPROP', CurrMode)
ModeData = XLATE('SYSREPOSPOPUPS', 'LSL2**TOOL_MODE', '8', 'X')
Ctrls = @WINDOW:'.NEW_MODE':@RM ; Props = 'VISIBLE':@RM
Ctrls := @WINDOW:'.NEW_MODE_GROUP':@RM ; Props := 'VISIBLE':@RM
Ctrls := @WINDOW:'.CHG_TO_MODE':@RM ; Props := 'VISIBLE':@RM
Ctrls := @WINDOW:'.LU_CHG_TO_MODE':@RM ; Props := 'VISIBLE':@RM
Ctrls := @WINDOW:'.CHG_TO_MODE_LABEL' ; Props := 'VISIBLE'
*IF ToolProc = 'G' THEN
* GaN process
Vals = '0':@RM:'0':@RM:'1':@RM:'1':@RM:'1'
Set_Property(Ctrls,Props,Vals)
*END ELSE
/*
* Si Process
Vals = '1':@RM:'1':@RM:'0':@RM:'0':@RM:'0'
Set_Property(Ctrls,Props,Vals)
TextVals = ''
ValueVals = ''
FOR I = 1 TO COUNT(ModeData,@VM) + (ModeData NE '')
ModeID = ModeData<1,I,1>
ModeDesc = ModeData<1,I,2>
IF ModeID NE CurrMode THEN
TextVals := ModeDesc:@RM
ValueVals := ModeID:@RM
END
NEXT I
*TextVals[-1,1] = '' ;* Leave the hanging @RM -> These are concatenated a few lines down
ValueVals[-1,1] = ''
Ctrls = @WINDOW:'.NEW_MODE.LABELFORMODE1':@RM:@WINDOW:'.NEW_MODE.LABELFORMODE2':@RM:@WINDOW:'.NEW_MODE.LABELFORMODE3':@RM
Ctrls := @WINDOW:'.NEW_MODE.LABELFORMODE1':@RM:@WINDOW:'.NEW_MODE.LABELFORMODE2':@RM:@WINDOW:'.NEW_MODE.LABELFORMODE3'
Props = 'TEXT':@RM:'TEXT':@RM:'TEXT':@RM:'VALUE':@RM:'VALUE':@RM:'VALUE'
Vals = TextVals:ValueVals
Set_Property(Ctrls,Props,Vals)
DefVal = ValueVals[1,@RM]
Set_Property(@WINDOW:'.NEW_MODE', 'VALUE', DefVal)
*/
*END ;* End of check for Process flag
RETURN
* * * * * * *
LU_UserID:
* * * * * * *
TypeOver = ''
TypeOver<PSELECT$> = 1
TypeOver<PDISPLAY$> = 'BY LAST_FIRST'
UserID = Popup(@WINDOW,TypeOver,'SHOW_USERS')
IF UserID NE '' THEN
Set_Property(@WINDOW:'.USER_ID','DEFPROP',UserID)
END ELSE
RETURN
END
* * * * * * *
UserIDLF:
* * * * * * *
UserID = Get_Property(@WINDOW:'.USER_ID','DEFPROP')
UserName = OCONV(UserID,'[XLATE_CONV,LSL_USERS*FIRST_LAST]')
Set_Property(@WINDOW:'.USER_NAME','DEFPROP',UserName)
RETURN
* * * * * * *
LU_ChgToMode:
* * * * * * *
ReturnCtrl = @WINDOW:'.':Parm1
NewMode = Popup(@WINDOW,'','TOOL_MODE')
IF NewMode = '' THEN RETURN
obj_AppWindow('LUValReturn',NewMode:@RM:ReturnCtrl)
RETURN
* * * * * * *
Refresh:
* * * * * * *
RETURN
* * * * * * *
Close:
* * * * * * *
* * * * * * *
Cancel:
* * * * * * *
End_Dialog(@WINDOW,'Cancel')
RETURN
* * * * * *
OK:
* * * * * *
UserID = Get_Property(@WINDOW:'.USER_ID', 'DEFPROP')
Reason = Get_Property(@WINDOW:'.REASON', 'DEFPROP')
ChgToMode = Get_Property(@WINDOW:'.CHG_TO_MODE','DEFPROP')
Result = UserID:@FM:Reason:@FM:ChgToMode
End_Dialog(@WINDOW,Result)
RETURN
* * * * * * *
EnableOK:
* * * * * * *
ChgToMode = Get_Property(@WINDOW:'.CHG_TO_MODE','DEFPROP')
ValidModes = Xlate('SYSREPOSPOPUPS', 'LSL2**TOOL_MODE', 'DISPLAY', 'X')
ValidModes = SRP_Array('Rotate', ValidModes, @VM, @SVM)
ValidModes = ValidModes<0, 1>
Locate ChgToMode in ValidModes using @SVM setting vsPos then
Enabled = True$
end else
Enabled = False$
end
Set_Property(@Window:'.OK_BUTTON', 'ENABLED', Enabled)
return

View File

@ -0,0 +1,370 @@
COMPILE FUNCTION Comm_Dialog_Tool_Status(Method, Parm1)
/*
Commuter module for Tool_Status window.
10/18/2007 - John C. Henry, J.C. Henry & Co., Inc.
*/
#pragma precomp SRP_PreCompiler
DECLARE SUBROUTINE Set_Property, End_Dialog, Send_Event, Set_Status, ErrMsg, Tool_Services, Error_Services
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Btree.Extract, Msg, obj_Tool_Log
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Utility, Send_Message, Popup, Collect.IXVals, Msg
DECLARE FUNCTION obj_Tool, SRP_Array, Error_Services
EQU CRLF$ TO \0D0A\
EQU FONTBLUE$ TO 16711680 ;* \FF0000\
EQU FONTRED$ TO 255 ;* \0000FF\
EQU APPYELLOW$ TO 255 + (255*256) + (202*65536)
$INSERT PS_EQUATES
$INSERT POPUP_EQUATES
$INSERT MSG_EQUATES
$INSERT TOOL_EQUATES
$INSERT APPCOLORS
ErrTitle = 'Error in Comm_Dialog_Tool_Status'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Method = 'Create' ; GOSUB Create
CASE Method = 'TBClick' ; GOSUB TBClick
CASE Method = 'Timer' ; GOSUB Refresh
CASE 1
ErrMsg(ErrTitle:@SVM:'Unknown method ':QUOTE(Method):' passed to routine.')
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
ScreenSize = Get_Property('SYSTEM','SIZE')
DialogSize = Get_Property(@WINDOW,'SIZE')
wScreen = ScreenSize<3>
hScreen = ScreenSize<4>
xDialog = DialogSize<1>
yDialog = DialogSize<2>
wDialog = DialogSize<3>
hDialog = DialogSize<4>
DialogSize<1> = (wScreen - wDialog)/2
DialogSize<2> = 580; //496 ;* 50 pixels @ top + 444 pixel dialog above + 2 pixel space
Set_Property(@WINDOW,'SIZE',DialogSize:@FM:-1)
CurSize = Get_Property(@Window, "SIZE")
MinW = CurSize<3>
MinH = CurSize<4>
MaxW = CurSize<3>
MaxH = CurSize<4>
Set_Property(@Window,"TRACKINGSIZE",MinW:@FM:MinH:@FM:MaxW:@FM:MaxH)
GOSUB Refresh
Set_Property(@WINDOW,'TIMER',60000:@FM:40000)
Set_Property(@WINDOW,'VISIBLE',1)
RETURN
* * * * * * *
Refresh:
* * * * * * *
ToolIDs = obj_Tool('KeysByType') ;* All tool IDs sorted by TOOL_TYPE
CleansTools = ''
MetrologyTools = ''
InspectionTools = ''
TransferTools = ''
QuartzTools = ''
OtherTools = ''
CTCnt = 0
MTCnt = 0
ITCnt = 0
TRCnt = 0
QZCnt = 0
OtherCnt = 0
DispTools = ''
For Each ToolID in ToolIDs using @VM
ToolRec = XLATE('TOOL',ToolID,'','X')
ToolType = ToolRec<TOOL_TOOL_TYPE$>
ToolDesc = ToolRec<TOOL_TOOL_DESC$>
ToolMode = XLATE('TOOL', ToolID, 'CURR_MODE', 'X')<1,1>
ToolHrs = OCONV(XLATE('TOOL', ToolID, 'CURR_MODE_HRS', 'X'), 'MD2')
PMStatus = XLATE('TOOL', ToolID, 'PM_STATUS', 'X')
IF ToolRec<TOOL_ACTIVE_ESCALATION$> = '' THEN
ToolEsc = 0
END ELSE
ToolEsc = 1
ToolHrs = XLATE('TOOL_ESC',ToolRec<TOOL_ACTIVE_ESCALATION$>,'ELAPSED_HRS','X')
ToolHrs = OCONV(ToolHrs,'MD2')
END
BEGIN CASE
CASE INDEX(ToolType,'Cleans',1)
SortPriority = 1
* CTCnt += 1
* CleansTools<CTCnt,1> = ToolID
* CleansTools<CTCnt,2> = ToolDesc
* CleansTools<CTCnt,3> = ToolMode
* CleansTools<CTCnt,4> = ToolHrs
* CleansTools<CTCnt,5> = ToolEsc
*
CASE ToolType = 'Metrology'
SortPriority = 2
* MTCnt += 1
* MetrologyTools<MTCnt,1> = ToolID
* MetrologyTools<MTCnt,2> = ToolDesc
* MetrologyTools<MTCnt,3> = ToolMode
* MetrologyTools<MTCnt,4> = ToolHrs
* MetrologyTools<MTCnt,5> = ToolEsc
*
CASE ToolType = 'Inspection'
SortPriority = 3
* ITCnt += 1
* InspectionTools<ITCnt,1> = ToolID
* InspectionTools<ITCnt,2> = ToolDesc
* InspectionTools<ITCnt,3> = ToolMode
* InspectionTools<ITCnt,4> = ToolHrs
* InspectionTools<ITCnt,5> = ToolEsc
*
CASE ToolType = 'Transfer'
SortPriority = 4
* TRCnt += 1
* TransferTools<TRCnt,1> = ToolID
* TransferTools<TRCnt,2> = ToolDesc
* TransferTools<TRCnt,3> = ToolMode
* TransferTools<TRCnt,4> = ToolHrs
* TransferTools<TRCnt,5> = ToolEsc
*
CASE ToolType = 'Quartz'
SortPriority = 5
* QZCnt += 1
* QuartzTools<QZCnt,1> = ToolID
* QuartzTools<QZCnt,2> = ToolDesc
* QuartzTools<QZCnt,3> = ToolMode
* QuartzTools<QZCnt,4> = ToolHrs
* QuartzTools<QZCnt,5> = ToolEsc
*
CASE 1
SortPriority = 6
* OtherCnt += 1
* OtherTools<OtherCnt,1> = ToolID
* OtherTools<OtherCnt,2> = ToolDesc
* OtherTools<OtherCnt,3> = ''
* OtherTools<OtherCnt,4> = ToolHrs
* OtherTools<OtherCnt,5> = ToolEsc
*
END CASE
DispTools := ToolID : @VM : ToolDesc : @VM : ToolMode : @VM : ToolHrs : @VM : ToolEsc : @VM : SortPriority : @VM: PMStatus : @FM
Next ToolID
DispTools[-1, 1] = ''
DispTools = SRP_Array('SortRows', DispTools, 'AR6' : @FM : 'AL1', 'LIST', @FM, @VM)
* CTColCnt = INT(CTCnt/6)
* IF MOD(CTCnt,6) > 0 THEN CTColCnt += 1
* CTPnlCnt = CTColCnt * 6
* CleansTools := STR(@FM:@VM,CTPnlCnt - CTCnt)
*
* MTColCnt = INT(MTCnt/6)
* IF MOD(MTCnt,6) > 0 THEN MTColCnt += 1
* MTPnlCnt = MTColCnt * 6
* MetrologyTools := STR(@FM:@VM,MTPnlCnt - MTCnt)
*
* ITColCnt = INT(ITCnt/6)
* IF MOD(ITCnt,6) > 0 THEN ITColCnt += 1
* ITPnlCnt = ITColCnt * 6
* InspectionTools := STR(@FM:@VM,ITPnlCnt - ITCnt)
*
* TRColCnt = INT(TRCnt/6)
* IF MOD(TRCnt,6) > 0 THEN TRColCnt += 1
* TRPnlCnt = TRColCnt * 6
* TransferTools := STR(@FM:@VM,TRPnlCnt - TRCnt)
*
* QZColCnt = INT(QZCnt/6)
* IF MOD(TRCnt,6) > 0 THEN QZColCnt += 1
* QZPnlCnt = QZColCnt * 6
* QuartzTools := STR(@FM:@VM,QZPnlCnt - QZCnt)
*
* OtherColCnt = INT(OtherCnt/6)
* IF MOD(OtherCnt,6) > 0 THEN OtherColCnt += 1
* OtherPnlCnt = OtherColCnt * 6
* OtherTools := STR(@FM:@VM,OtherPnlCnt - OtherCnt)
* DispTools = ''
* IF CleansTools NE '' THEN DispTools := CleansTools
* IF MetrologyTools NE '' THEN DispTools := @FM:MetrologyTools
* IF InspectionTools NE '' THEN DispTools := @FM:InspectionTools
* IF TransferTools NE '' THEN DispTools := @FM:TransferTools
* IF QuartzTools NE '' THEN DispTools := @FM:QuartzTools
* IF OtherTools NE '' THEN DispTools := @FM:OtherTools
GreenButton = '.\BMPS\GreenButton.png'
RedButton = '.\BMPS\RedButton.png'
YellowButton = '.\BMPS\YellowButton.png'
GrayButton = '.\BMPS\GrayButton.png'
QuestionButton = '.\BMPS\help_32.bmp'
DefaultBackColor = Get_Property(@WINDOW,'BACKCOLOR')
NumTools = DCount(DispTools, @FM)
FOR I = 1 TO NumTools
ToolID = DispTools<I,1>
ToolDesc = DispTools<I,2>
ToolStatus = DispTools<I,3>
ToolHrs = DispTools<I,4>
ToolEsc = DispTools<I,5>
PMStatus = DispTools<I,7>
IF ToolID NE '' THEN
* If ( (ToolID EQ 'BIORAD2') or (ToolID EQ 'BIORAD3') or (ToolID EQ 'BIORAD4') or (ToolID EQ 'BIORAD5') ) then
Begin Case
Case PMStatus EQ 'OVERDUE'
BackColor = RED$
Case PMStatus EQ 'CURRENTLY_DUE'
BackColor = ORANGE$
Case PMStatus EQ 'DUE_SOON'
BackColor = YELLOW$
Case PMStatus EQ 'NOT_SCHEDULED'
BackColor = DefaultBackColor
Case PMStatus EQ 'NOT_DUE'
BackColor = GREEN$
Case PMStatus EQ 'ERROR'
BackColor = BRED$
End Case
* end else
* BackColor = DefaultBackColor
* end
Set_Property(@WINDOW:'.TP':I,'TEXT',ToolDesc)
Set_Property(@WINDOW:'.TP':I,'@TOOLID',ToolID)
Set_Property(@WINDOW:'.TT':I,'TEXT',ToolHrs)
Set_Property(@WINDOW:'.TT':I,'FORECOLOR',FONTBLUE$)
Set_Property(@WINDOW:'.TB':I,'ENABLED',1)
Set_Property(@WINDOW:'.TP':I, 'BACKCOLOR', BackColor)
Set_Property(@WINDOW:'.TB':I, 'BACKCOLOR', BackColor)
BEGIN CASE
CASE ToolStatus = 'PROD'
Set_Property(@WINDOW:'.TB':I,'BITMAP',GreenButton)
CASE ToolStatus[-3,3] = 'MTC' or ToolStatus = 'QUAL_OVERDUE' or ToolStatus EQ 'VER_FAILED'
Set_Property(@WINDOW:'.TB':I,'BITMAP',RedButton)
CASE ToolStatus = 'LIM' OR ToolStatus = 'QUAL' OR ToolStatus = 'EWORK' or ToolStatus EQ 'VER'
Set_Property(@WINDOW:'.TB':I,'BITMAP',YellowButton)
CASE ToolStatus = 'OUT' OR ToolStatus = 'FACILITIES (UnSched)'
Set_Property(@WINDOW:'.TB':I,'BITMAP',GrayButton)
CASE 1
Set_Property(@WINDOW:'.TB':I,'BITMAP',QuestionButton)
END CASE
END ELSE
Set_Property(@WINDOW:'.TP':I,'TEXT','')
Set_Property(@WINDOW:'.TT':I,'TEXT','')
Set_Property(@WINDOW:'.TB':I,'ENABLED',0)
Set_Property(@WINDOW:'.TB':I,'BITMAP','')
END
NEXT I
* Set_Property(@WINDOW, 'VISIBLE', 1)
RETURN
* * * * * * *
TBClick:
* * * * * * *
CtrlEntID = Get_Property(@WINDOW,'FOCUS')
CtrlName = FIELD(CtrlEntID,'.',2)
CONVERT 'B' TO 'P' In CtrlEntID ;* Buttons are named 'TB':n
ToolID = Get_Property(CtrlEntID,'@TOOLID') ;* Properties are on panels named 'TP':n
* Check and lock
Open "TOOL" to hTable then
DialogWin = "DIALOG_TOOL_MODE"
DialogKey = DialogWin:"*":ToolID
Lock hTable, DialogKey then
ModeChangeParms = Dialog_Box("DIALOG_TOOL_MODE", @WINDOW, ToolID)
Unlock hTable, DialogKey
end else
Mtext = "Another user is currently updating this tool's status."
Msg(@Window, "", "ERROR", "", "Update Tool Status" :@FM: Mtext)
ModeChangeParms = "Cancel"
end
end
* Cancel returned from dialog box
IF ModeChangeParms = 'Cancel' THEN RETURN
UserID = ModeChangeParms[1,@FM]
Reason = ModeChangeParms[COL2()+1,@FM]
NewMode = ModeChangeParms[COL2()+1,@FM]
* Two users trying to update at same time leaves more than one current mode. Take the first one.
CurrModeDTM = XLATE('TOOL', ToolID, TOOL_CURR_MODE_KEY$, 'X')<1,1>
CurrModeDTM = FIELD(CurrModeDTM,'*',2)
CurrModeDTM = OCONV(CurrModeDTM,'DT4/^S')
Parms = ToolID:@RM
Parms := CurrModeDTM:@RM
Parms := NewMode:@RM
Parms := Reason
//obj_Tool_Log('SetMode', Parms)
Tool_Services('ChangeToolMode', ToolID, NewMode, Reason, @User4, 0)
* IF Get_Status(errCode) THEN
* Errmsg(errCode)
* RETURN
* END
If Error_Services('HasError') then
Error_Services('DisplayError')
end
GoSub Refresh
RETURN

View File

@ -0,0 +1,647 @@
COMPILE FUNCTION Comm_Dialog_Unload_Epi_Pro(Method, Parm1, Parm2)
#pragma precomp SRP_PreCompiler
/*
Commuter module for Dialog_Unload_Epi_Pro window.
05/01/2006 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Set_Status, ErrMsg, obj_RDS2, Send_Event, RDS_React_Run, Post_Event, obj_Tables
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Msg, End_Dialog, Send_Message, obj_WM_Out, obj_WM_Wfrs, obj_React_Status, Send_Info
DECLARE SUBROUTINE Database_Services
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Popup, obj_WM_Out, Send_Message, obj_NCR, ETMethod, obj_WM_Wfrs, obj_Tables
DECLARE FUNCTION Set_Property, SRP_Array, Database_Services
EQU CRLF$ TO \0D0A\
$INSERT POPUP_EQUATES
$INSERT LOGICAL
$INSERT MSG_EQUATES
$INSERT RDS_EQU
$INSERT RDS_TEST_EQUATES
$INSERT REACTOR_EQUATES
$INSERT RDS_EPILOAD
$INSERT NCR_EQU
$INSERT EPI_SUSCEPTOR_EQUATES
$INSERT PROD_SPEC_EQUATES
$INSERT PRS_STAGE_EQUATES
$INSERT EPI_PART_EQUATES
$INSERT QUOTE_SPEC_EQU
$INSERT WO_LOG_EQUATES
$INSERT WM_OUT_EQUATES
$INSERT APPCOLORS
EQU COL$WM_OUT_CASS TO 1
EQU COL$WM_OUT_SLOT TO 2
EQU COL$POCKET TO 1
EQU COL$USAGE TO 2
EQU COL$ZONE TO 3
EQU COL$IN_CASS TO 4
EQU COL$IN_SLOT TO 5
EQU COL$WAFER_TYPE TO 6
EQU COL$OUT_CASS TO 7
EQU COL$OUT_SLOT TO 8
EQU COL$OUT_NCR TO 9
EQU COL$NCR_NO TO 1
EQU COL$NCR_POCKET TO 2
ErrTitle = 'Error in Comm_Dialog_Load_Epi_Pro'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Method = 'Create' ; GOSUB Create
CASE Method = 'Close' ; GOSUB Close
CASE Method = 'Cancel' ; GOSUB Cancel
CASE Method = 'Refresh' ; GOSUB Refresh
CASE Method = 'ReloadProduct' ; GOSUB ReloadProduct
CASE Method = 'UnloadProduct' ; GOSUB UnloadProduct
CASE Method = 'ReactIR' ; GOSUB ReactIR
CASE Method = 'ReactDR' ; GOSUB ReactDR
CASE Method = 'SlotOverview' ; GOSUB SlotOverview
CASE 1
ErrMsg(ErrTitle:@SVM:'Unknown method ':QUOTE(Method):' passed to routine.')
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
obj_AppWindow('Create')
* get the current style
EQU MULTILINE_STYLE$ TO 512 ;* MultiLine Select
EQU DROPDOWN_STYLE$ TO 131072
Style = Get_Property(@WINDOW:'.REACTOR_TABLE', 'STYLE')
IF Style [1,2] _EQC "0x" THEN
CONVERT @LOWER.CASE TO @UPPER.CASE IN STYLE
Style = ICONV(Style [3,99], "MX")
END
Style = BitOr(Style, MULTILINE_STYLE$)
Set_Property(@WINDOW:'.REACTOR_TABLE', "STYLE", Style)
RDSNo = FIELD(Parm1,@FM,1)
CurrentLoad = FIELD(Parm1,@FM,2,99)
IF RDSNo = '' THEN
ErrMsg('Null RDS No passed to Dialog Box...')
End_Dialog(@WINDOW,'')
END
Set_Status(0)
otParmsRDS = 'RDS':@RM:RDSNo
RDSRec = obj_Tables('ReadRec',otParmsRDS)
IF Get_Status(errCode) THEN
ErrMsg(errCode)
RETURN
END
* BlockUnload = Xlate('RDS', RDSNo, 'BLOCK_UNLOAD', 'X')
*
* If BlockUnload EQ True$ then
* Set_Property(@Window:'.UNLOAD_PRODUCT', 'ENABLED', False$)
* end
Set_Property(@WINDOW,'@LOCKED_RDS',otParmsRDS)
ReactorNo = RDSRec<RDS_REACTOR$>
WONo = RDSRec<RDS_WO$>
WOStepKey = RDSRec<RDS_WO_STEP_KEY$>
WOStep = FIELD(WOStepKey,'*',2)
otParms = 'WO_LOG':@RM:WONo:'*Unload' ;* Added 7/8/2009 JCH * * * * * * *
obj_Tables('LockRec',otParms) ;* Places lock on fictional record
IF Get_Status(errCode) THEN
ErrorMsg = 'Another workstation is currently Unloading a Reactor Run for this Work Order.'
ErrMsg(ErrorMsg)
obj_Tables('UnlockRec',otParmsRDS)
End_Dialog(@WINDOW,'')
RETURN
END
Set_Property(@WINDOW,'@LOCKED',otParms)
PSNo = XLATE('WO_STEP',WOStepKey,1,'X')
*ReactorType = XLATE('PROD_SPEC',PSNo,PROD_SPEC_REACTOR_TYPE$,'X') ;* Variable not used progrqam 8/27/2014 JCH
PSType = XLATE('PROD_SPEC',PSNo,'SPEC_TYPE','X') ;* New reference 8/22/2012 JCH
EpiPN = XLATE('WO_LOG',WONo,WO_LOG_EPI_PART_NO$,'X')
*SubstrateSpec = XLATE('PROD_SPEC',PSNo,PROD_SPEC_SPEC_SUBSTRATE$,'X')
SubPostClean = XLATE('PRS_STAGE',PSNo:'*POST',PRS_STAGE_CLEAN_TOOL$,'X') ;* SubstrateSpec<1,QSSubPostClean$>
WaferSize = XLATE('EPI_PART',EpiPN,EPI_PART_SUB_WAFER_SIZE$,'X') ;* SubstrateSpec<1,QSSubWaferSize$>
BEGIN CASE
CASE WaferSize = '125 mm 5 in' ; EpiSusceptorKey = '5'
CASE WaferSize = '150 mm 6 in' ; EpiSusceptorKey = '6'
CASE WaferSize = '200 mm 8 in' ; EpiSusceptorKey = '8'
CASE 1
ErrMsg('Unknown Wafer Size ':QUOTE(WaferSize):' in PSN ':PSNo)
End_Dialog(@WINDOW,'')
END CASE
EpiSusceptorRec = XLATE('EPI_SUSCEPTOR',EpiSusceptorKey,'','X')
Pockets = EpiSusceptorRec<EPI_SUSCEPTOR_POCKET_NO$>
Zones = EpiSusceptorRec<EPI_SUSCEPTOR_POCKET_ZONE$>
PTypes = EpiSusceptorRec<EPI_SUSCEPTOR_POCKET_TYPE$>
Ctrls = @WINDOW:'.RDS_NO':@RM:@WINDOW:'.WO_NO':@RM:@WINDOW:'.WO_STEP':@RM:@WINDOW:'.REACTOR_NO'
Props = 'DEFPROP':@RM: 'DEFPROP':@RM: 'DEFPROP':@RM: 'DEFPROP'
Vals = RDSNo:@RM:WONo:@RM:WOStep:@RM:ReactorNo
Set_Property(Ctrls,Props,Vals)
ProdLoadCnt = 0
ProdUnloadCnt = 0
RCtrl = @WINDOW:'.REACTOR_TABLE'
IF CurrentLoad<1,1> = '' THEN
PocketCnt = COUNT(Pockets,@VM) + (Pockets NE '')
FOR I = 1 TO PocketCnt
Set_Property(RCtrl,'CELLPOS',Pockets<1,I>,COL$POCKET:@FM:I)
Set_Property(RCtrl,'CELLPOS',PTypes<1,I>,COL$USAGE:@FM:I)
Set_Property(RCtrl,'CELLPOS',Zones<1,I>,COL$ZONE:@FM:I)
NEXT I
Set_Property(@WINDOW,'@LAST_POCKET',I-1)
END ELSE
* Use load data previously saved on the RDS
FOR I = 1 TO COUNT(CurrentLoad<1>,@VM) + (CurrentLoad<1> NE '')
Usage = CurrentLoad<COL$USAGE,I>
WfrType = CurrentLoad<COL$WAFER_TYPE,I>
OutCass = CurrentLoad<COL$OUT_CASS,I>
OutSlot = CurrentLoad<COL$OUT_SLOT,I>
IF WfrType = 'PROD' AND Usage = '' AND OutCass = '' THEN
ProdLoadCnt += 1 ;* Product wafers to be unloaded
END
IF OutCass NE '' THEN
ProdUnloadCnt += 1
END
Set_Property(RCtrl,'CELLPOS',CurrentLoad<COL$POCKET,I>,COL$POCKET:@FM:I)
Set_Property(RCtrl,'CELLPOS',Usage,COL$USAGE:@FM:I)
Set_Property(RCtrl,'CELLPOS',CurrentLoad<COL$ZONE,I>,COL$ZONE:@FM:I)
Set_Property(RCtrl,'CELLPOS',CurrentLoad<COL$IN_CASS,I>,COL$IN_CASS:@FM:I)
Set_Property(RCtrl,'CELLPOS',CurrentLoad<COL$IN_SLOT,I>,COL$IN_SLOT:@FM:I)
Set_Property(RCtrl,'CELLPOS',WfrType,COL$WAFER_TYPE:@FM:I)
Set_Property(RCtrl,'CELLPOS',OutCass,COL$OUT_CASS:@FM:I)
Set_Property(RCtrl,'CELLPOS',CurrentLoad<COL$OUT_SLOT,I>,COL$OUT_SLOT:@FM:I)
Set_Property(RCtrl,'CELLPOS',CurrentLoad<COL$OUT_NCR,I>,COL$OUT_NCR:@FM:I)
NEXT I
END
BEGIN CASE
CASE ProdLoadCnt > 0 AND ProdUnloadCnt = 0
BriefTxt = '{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0 Arial;}}'
BriefTxt := '{\*\generator Msftedit 5.41.15.1515;}\viewkind4\uc1\pard\ri200\b\f0\fs20\par Unload Product from EpiPro Reactor\par'
BriefTxt := '\b0\par'
BriefTxt := ' 1.) Verify Outbound Cassette and Slots\par'
BriefTxt := ' 2.) Unload Product into Outbound Cassette\par}'
Title = 'Unload Product from EpiPro Reactor'
Set_Property(@WINDOW:'.UNLOAD_PRODUCT','VISIBLE',1)
Set_Property(@WINDOW:'.RELOAD_PRODUCT','VISIBLE',0)
CASE ProdLoadCnt = 0 AND ProdUnloadCnt > 0
BriefTxt = '{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0 Arial;}}'
BriefTxt := '{\*\generator Msftedit 5.41.15.1515;}\viewkind4\uc1\pard\ri200\b\f0\fs20\par Return Product to EpiPro Reactor\par'
BriefTxt := '\b0\par'
BriefTxt := ' 1.) Return Product to Reactor\par'
BriefTxt := '\par}'
Title = 'Return Product to EpiPro Reactor'
Set_Property(@WINDOW:'.UNLOAD_PRODUCT','VISIBLE',0)
Set_Property(@WINDOW:'.RELOAD_PRODUCT','VISIBLE',1)
CASE 1
ErrMsg('No wafers loaded in Reactor.') ;* Not yet loaded
END CASE
Set_Property(@WINDOW:'.BRIEF_EDITBOX','RTFTEXT',BriefTxt)
Set_Property(@WINDOW:'.WM_OUT_TABLE','LIST',STR(@VM:@FM,25)) ;* Put empty lines in WM_OUT_TABLE
IF ProdLoadCnt > 0 THEN
AllOpenSlotIDs = obj_WM_Out('NextOpenSlots',WONo:@RM:WoStep) ;* Get a list of all open WMO slots on this work order
OpenSlotIDs = FIELD(AllOpenSlotIDs,@FM,1,ProdLoadCnt) ;* Take the number needed to unload the reactor load
IF OpenSlotIDs = '' THEN
ErrMsg('No open WM_OUT slots available to unload into.')
obj_Tables('UnlockRec',Get_Property(@WINDOW,'@LOCKED'))
obj_Tables('UnlockRec',Get_Property(@WINDOW,'@LOCKED_RDS'))
GOTO Cancel
END
Set_Property(@WINDOW:'.WM_OUT_TABLE','LIST',STR(@VM:@FM,25))
WMOWaferKeys = ''
FOR M = 1 TO ProdLoadCnt
OpenSlotID = OpenSlotIDs<M>
OpenCass = OpenSlotID<1,1>
OpenSlot = OpenSlotID<1,2>
Set_Property(@WINDOW:'.WM_OUT_TABLE','CELLPOS',OpenCass,COL$WM_OUT_CASS:@FM:M) ;* Load Available WMO slots into WM_OUT array
Set_Property(@WINDOW:'.WM_OUT_TABLE','CELLPOS',OpenSlot,COL$WM_OUT_SLOT:@FM:M)
WMOWaferKey = WONo:'*':WOStep:'*':OpenCass:'*':OpenSlot
WMOWaferKeys<1,-1> = WMOWaferKey
NEXT M
FOR M = ProdLoadCnt + 1 TO 25
Set_Property(@WINDOW:'.WM_OUT_TABLE','CELLPOS','',COL$WM_OUT_CASS:@FM:M) ;* Put blank lines from last Slot to bottom of display
Set_Property(@WINDOW:'.WM_OUT_TABLE','CELLPOS','',COL$WM_OUT_SLOT:@FM:M)
NEXT M
Set_Status(0)
LockedWMOKeys = obj_WM_Wfrs('LockSet','WMO_WFRS':@RM:WMOWaferKeys) ;* This locks the cass/slots available to unload into
IF Get_Status(errCode) THEN
ErrMsg(errCode)
obj_Tables('UnlockRec',Get_Property(@WINDOW,'@LOCKED'))
obj_Tables('UnlockRec',Get_Property(@WINDOW,'@LOCKED_RDS'))
GOTO Cancel
END ELSE
Set_Property(@WINDOW,'@LOCKED_WFRS',LockedWMOKeys)
END
END
RecordLocked = False$
OutboundMat = Get_Property(@Window:'.WM_OUT_TABLE', 'ARRAY')
If OutboundMat NE '' then
CassNos = OutboundMat<1>
CassNos = SRP_Array('Clean', CassNos, 'TrimAndMakeUnique', @VM)
If CassNos NE '' then
For each CassNo in CassNos using @VM setting vPos
WMOutKey = WONo:'*1*':CassNo
RecordLocked = Database_Services('IsKeyIDLocked', 'WM_OUT', WMOutKey)
If RecordLocked then
LockOwner = Xlate('WM_OUT', WMOutKey, 'LOCKED_BY', 'X')
If LockOwner NE '' then
DisplayName = Oconv(LockOwner,'[XLATE_CONV,LSL_USERS*FIRST_LAST]')
end else
DisplayName = 'an unknown user'
end
MsgParms = ''
MsgParms<1> = 'Record Locked'
MsgParms<2> = 'The WM_OUT record for this RDS is locked by ':DisplayName:'. Only one user session at a time can edit an RDS.'
Msg(@Window, '', 'OK', '', MsgParms)
// Disable Unload button
Set_Property(@Window:'.UNLOAD_PRODUCT', 'ENABLED', -1)
Set_Property(@Window:'.RELOAD_PRODUCT', 'ENABLED', -1)
Set_Property(@Window:'.SLOT_STATUS', 'ENABLED', -1)
// Clear JCH semaphore locks and close the form
GOSUB ClearLocks
End_Dialog(@WINDOW,'')
end
Until RecordLocked EQ True$
Next CassNo
end
end
RETURN
* * * * * * *
Close:
* * * * * * *
* * * * * * *
Cancel:
* * * * * * *
RDSNo = Get_Property(@WINDOW:'.RDS_NO','DEFPROP')
GOSUB ClearLocks ;* Added 3/2/2010 JCH
End_Dialog(@WINDOW,'')
Set_Property('RDS_UNLOAD.RDS_NO','DEFPROP',RDSNo)
Post_Event('RDS_UNLOAD','READ')
RETURN
* * * * * * *
Refresh:
* * * * * * *
RCtrl = @WINDOW:'.REACTOR_TABLE'
ReactorList = Get_Property(RCtrl,'LIST')
LastPocket = Get_Property(@WINDOW,'@LAST_POCKET')
OpenTestCnt = 0
OpenProdCnt = 0
LineColor = ''
FOR I = 1 TO COUNT(ReactorList,@FM) + (ReactorList NE '')
IF ReactorList<I,COL$POCKET> NE '' THEN
IF ReactorList<I,COL$USAGE> = 'PROD' THEN
Set_Property(RCtrl,'CELLPOS','',COL$USAGE:@FM:I)
END
BEGIN CASE
CASE ReactorList<I,COL$OUT_NCR> NE ''
Send_Message(RCtrl,'COLOR_BY_POS',0,I,RED$)
CASE ReactorList<I,COL$USAGE> = 'TEST'
Send_Message(RCtrl,'COLOR_BY_POS',0,I,YELLOW$)
CASE ReactorList<I,COL$USAGE> = 'DUMMY'
Send_Message(RCtrl,'COLOR_BY_POS',0,I,WHITE$)
CASE ReactorList<I,COL$USAGE> = 'PROD' OR ReactorList<I,COL$USAGE> = ''
Zone = ReactorList<I,COL$ZONE>
IF Zone = 1 THEN LineColor = RCV_BLUE$
IF Zone = 2 THEN LineColor = PRE_BLUE$
IF Zone = 3 THEN LineColor = INP_BLUE$
IF Zone = 4 THEN LineColor = POS_BLUE$
Send_Message(RCtrl,'COLOR_BY_POS',0,I,LineColor)
END CASE
END
SelectedRows = Get_Property(RCtrl,'SELPOS')
Set_Property(RCtrl,'SELPOS',SelectedRows) ;* This is a toggle - turns OFF any turned ON ************************
NEXT I
RETURN
* * * * * * *
ReloadProduct:
* * * * * * *
RDSNo = Get_Property(@WINDOW:'.RDS_NO','DEFPROP')
WONo = Get_Property(@WINDOW:'.WO_NO','DEFPROP')
WOStep = Get_Property(@WINDOW:'.WO_STEP','DEFPROP')
ReactorList = Get_Property(@WINDOW:'.REACTOR_TABLE','LIST') ;* Updated Reactor load data
WafersPulled = ''
NCRPresent = ''
FOR RP = 1 TO COUNT(ReactorList,@FM) + (ReactorList NE '')
IF ReactorList<RP,COL$OUT_CASS> NE '' AND ReactorList<RP,COL$WAFER_TYPE> = 'PROD' AND ReactorList<RP,COL$USAGE> = '' THEN
CassNo = ReactorList<RP,COL$OUT_CASS>
SlotNo = ReactorList<RP,COL$OUT_SLOT>
Pocket = ReactorList<RP,COL$POCKET>
WMOutRec = XLATE('WM_OUT',WONo:'*':WOStep:'*':CassNo,'','X')
LOCATE SlotNo IN WMOutRec<WM_OUT_SLOT_NO$> USING @VM SETTING Pos THEN
IF WMOutRec<WM_OUT_RDS$,Pos> = '' THEN WafersPulled = 1
IF WMOutRec<WM_OUT_SLOT_NCR$,Pos> NE '' THEN NCRPresent = 1
END
IF WafersPulled THEN ErrorMsg = 'Wafers pulled from WM_OUT ':SlotNo:' cannot reload reactor.'
IF NCRPresent THEN ErrorMsg = 'NCR issued for Slot No ':SlotNo:' in WM_OUT. Cannot reload reactor.'
IF ErrorMsg NE '' THEN
ErrMsg(ErrorMsg)
GOTO Close
END
END
NEXT RP
OrgColor = Set_Property('DIALOG_UNLOAD_EPI_PRO.STATUSLINE_FIX','BACKCOLOR',YELLOW$) ;* //////// Messaging
GOSUB ClearLocks ;* Added 3/2/2010 JCH
Set_Status(0)
obj_RDS2('ReloadEpi',RDSNo)
Send_Info(STR(' ',60)) ;** - Messaging - **
Dummy = Set_Property('DIALOG_UNLOAD_EPI_PRO.STATUSLINE_FIX','BACKCOLOR',OrgColor) ;** - Messaging - **
IF Get_Status(ErrCode) THEN
ErrMsg(ErrCode)
END
GOTO Close
RETURN
* * * * * * *
UnloadProduct:
* * * * * * *
ReactCtrl = @WINDOW:'.REACTOR_TABLE'
WMOutCtrl = @WINDOW:'.WM_OUT_TABLE'
* Get PROD wafers in the reactor
WONo = Get_Property(@WINDOW:'.WO_NO','DEFPROP')
WOStep = Get_Property(@WINDOW:'.WO_STEP','DEFPROP')
RDSNo = Get_Property(@WINDOW:'.RDS_NO','DEFPROP')
ReactorList = Get_Property(ReactCtrl,'LIST') ;* Updated Reactor load data
AvailSlotKeys = Get_Property(@WINDOW,'@LOCKED_WFRS') ;* Available & locked outbound slots
OrgColor = Set_Property('DIALOG_UNLOAD_EPI_PRO.STATUSLINE_FIX','BACKCOLOR',YELLOW$) ;* //////// Messaging
orParms = RDSNo:@RM:ReactorList:@RM:AvailSlotKeys
GOSUB ClearLocks ;* Added 3/2/2010 JCH
Abort = False$
// Lock outbound cassette records BEFORE modifying any records!
CassNos = AvailSlotKeys
Swap @VM with @FM in CassNos
Swap '*' with @VM in CassNos
CassNos = SRP_Array('Rotate', CassNos, @FM, @VM)
CassNos = CassNos<3>
CassNos = SRP_Array('Clean', CassNos, 'TrimAndMakeUnique', @VM)
For each CassNo in CassNos using @VM
WMOKey = WONo:'*':WOStep:'*':CassNo
HaveLock = Database_Services('GetKeyIDLock', 'WM_OUT', WMOKey)
If HaveLock EQ False$ then
Abort = True$
ErrMsg('Error unloading RDS. Outbound cassette ':WMOKey:' is locked!')
end
Until Abort
Next CassNo
If Abort EQ False$ then
Set_Status(0)
obj_RDS2('UnloadEpi',orParms)
// Successfully unloaded RDS. Unlock necessary WM_OUT records.
For each CassNo in CassNos using @VM
WMOKey = WONo:'*':WOStep:'*':CassNo
HaveLock = Database_Services('IsKeyIDLocked', 'WM_OUT', WMOKey)
If HaveLock then
Database_Services('ReleaseKeyIDLock', 'WM_OUT', WMOKey)
end
Next CassNo
Send_Info(STR(' ',60)) ;** - Messaging - **
Dummy = Set_Property('DIALOG_UNLOAD_EPI_PRO.STATUSLINE_FIX','BACKCOLOR',OrgColor) ;** - Messaging - **
IF Get_Status(ErrCode) THEN
ErrMsg(ErrCode)
END
GOTO Close
end else
// Failed to lock necessary WM_OUT records. Unlock those set by this user.
For each CassNo in CassNos using @VM
WMOKey = WONo:'*':WOStep:'*':CassNo
HaveLock = Database_Services('IsKeyIDSelfLocked', 'WM_OUT', WMOKey)
If HaveLock then
Database_Services('ReleaseKeyIDLock', 'WM_OUT', WMOKey)
end
Next CassNo
end
RETURN
* * * * * * *
ReactIR:
* * * * * * *
RowIndex = Parm1
IF RowIndex = '' THEN RETURN
CtrlID = @WINDOW:'.REACTOR_TABLE'
Dummy = Send_Message(CtrlID,'DELETE',RowIndex)
GOSUB Refresh
RETURN
* * * * * * *
ReactDR:
* * * * * * *
RowIndex = Parm1
RowData = Parm2
IF RowIndex = '' THEN RETURN
CtrlID = @WINDOW:'.REACTOR_TABLE'
Dummy = Send_Message(CtrlID, "INSERT", RowIndex, RowData)
GOSUB Refresh
RETURN
* * * * * * *
ClearLocks:
* * * * * * *
WMOLocks = Get_Property(@WINDOW,'@LOCKED_WFRS') ;* Lock on Wafer Slots
RDSLocks = Get_Property(@WINDOW,'@LOCKED_RDS')
WinLock = Get_Property(@WINDOW,'@LOCKED')
Set_Status(0)
IF WMOLocks NE '' THEN obj_WM_Wfrs('UnlockSet','WMO_WFRS':@RM:WMOLocks) ;* Remove locks on the wafer slots
IF Get_Status(errCode) THEN ErrMsg(errCode)
Set_Status(0)
IF RDSLocks NE '' THEN obj_Tables('UnlockRec',RDSLocks) ;* Unlocks the RDS Record
IF Get_Status(errCode) THEN ErrMsg(errCode)
Set_Status(0)
IF WinLock NE '' THEN obj_Tables('UnlockRec',WinLock) ;* Removes WO unload window lock
IF Get_Status(errCode) THEN ErrMsg(errCode)
RETURN
* * * * * * *
SlotOverview:
* * * * * * *
WONo = Get_Property(@WINDOW:'.WO_NO','DEFPROP')
WOStep = Get_Property(@WINDOW:'.WO_STEP','DEFPROP')
DisplayList = obj_WM_Out('SlotStatus',WONo:@RM:WOStep)
CONVERT @VM TO @SVM IN DisplayList
CONVERT @FM TO @VM IN DisplayList
TypeOver = ''
TypeOver<PDISPLAY$> = DisplayList
void = Popup(@WINDOW,TypeOver,'WM_OUT_SLOT_STATUS')
RETURN

View File

@ -0,0 +1,161 @@
COMPILE FUNCTION Comm_Dialog_WO_Cass_Qty(Method, Parm1, Parm2)
/*
Commuter module for Dialog_WO_Cass_Qty window.
08/20/2004 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Set_Status, ErrMsg
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Msg
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Send_Message
EQU CRLF$ TO \0D0A\
$INSERT APPCOLORS
ErrTitle = 'Error in Comm_Dialog_WO_Cass_Qty'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Method = 'Create' ; GOSUB Create
CASE Method = 'OK' ; GOSUB OK
CASE Method = 'Cancel' ; GOSUB Cancel
CASE Method = 'Refresh' ; GOSUB Refresh
CASE Method = 'Close' ; GOSUB Close
CASE Method = 'InsertRow' ; GOSUB InsertRow
CASE Method = 'DeleteRow' ; GOSUB DeleteRow
CASE 1
ErrMsg(ErrTitle:@SVM:'Unknown method ':QUOTE(Method):' passed to routine.')
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
obj_AppWindow('Create')
Title = Parm1[1,@FM]
LotQty = Parm1[COL2()+1,@FM]
CassCnt = Parm1[COL2()+1,@FM]
CassQty = Parm1[COL2()+1,@FM]
Set_Property(@WINDOW,'TEXT',Title)
Set_Property(@WINDOW:'.LOT_QTY','TEXT',LotQty)
IF CassQty = '' THEN
Set_Property(@WINDOW:'.CASS_QTYS','ARRAY',STR(@VM,CassCnt-1))
END ELSE
CONVERT @SVM TO @VM IN CassQty
Set_Property(@WINDOW:'.CASS_QTYS','ARRAY',CassQty)
END
GOSUB Refresh
RETURN
* * * * * * *
Refresh:
* * * * * * *
LotQty = Get_Property(@WINDOW:'.LOT_QTY','TEXT',LotQty)
CassQtys = Get_Property(@WINDOW:'.CASS_QTYS','ARRAY')
LotQty = ICONV(LotQty,'MD0')
CassQtyTot = SUM(CassQtys)
Remainder = LotQty - CassQtyTot
Set_Property(@WINDOW:'.REMAINDER','TEXT',Remainder)
BEGIN CASE
CASE Remainder > 0
Set_Property(@WINDOW:'.REMAINDER','BACKCOLOR',YELLOW$)
Set_Property(@WINDOW:'.OK_BUTTON','ENABLED',0)
CASE Remainder = 0
Set_Property(@WINDOW:'.REMAINDER','BACKCOLOR',GREEN$)
Set_Property(@WINDOW:'.OK_BUTTON','ENABLED',1)
CASE Remainder < 0
Set_Property(@WINDOW:'.REMAINDER','BACKCOLOR',RED$)
Set_Property(@WINDOW:'.OK_BUTTON','ENABLED',0)
END CASE
RETURN
* * * * * * *
Close:
* * * * * * *
* * * * * * *
Cancel:
* * * * * * *
End_Dialog(@WINDOW,'Cancel')
RETURN
* * * * * * *
InsertRow:
* * * * * * *
CtrlEntID = @WINDOW:'.CASS_QTYS'
RowIndex = Parm1
Dummy = Send_Message(CtrlEntID, "DELETE", RowIndex)
ErrMsg('Close this window and change the quantity in the Cass Cnt field to increase the number of cassettes.')
RETURN
* * * * * * *
DeleteRow:
* * * * * * *
CtrlEntID = @WINDOW:'.CASS_QTYS'
RowIndex = Parm1
DeletedRow = Parm2
Dummy = Send_Message(CtrlEntID, "INSERT", RowIndex, DeletedRow)
ErrMsg('Close this window and change the quantity in the Cass Cnt field to decrease the number of cassettes.')
RETURN
* * * * * * *
OK:
* * * * * * *
CassQtys = Get_Property(@WINDOW:'.CASS_QTYS','ARRAY',CassQty)
LOOP
UNTIL CassQtys[-1,1] NE @VM OR CassQtys = ''
CassQtys[-1,1] = ''
REPEAT
CONVERT @VM TO @SVM IN CassQtys
End_Dialog(@WINDOW,CassQtys)
RETURN

View File

@ -0,0 +1,496 @@
COMPILE FUNCTION Comm_Dialog_WO_Due_In(Method, Parm1)
/*
Commuter module for Dialog_WO_Due_In window.
05/18/2005 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Send_Event, Set_Status, ErrMsg
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Btree.Extract, Msg, Send_Info
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Utility, Send_Message, Popup, Collect.IXVals, Msg
EQU CRLF$ TO \0D0A\
EQU COL$CUST_NO TO 1 ;* Customer edit table column equates
EQU COL$CUST_NAME TO 2
EQU LTGREY$ TO 229 + (229*256) + (229*65536) ;* JCH standard colors for edittable backgrounds
EQU GREY$ TO 192 + (192*256) + (192*65536)
EQU GREEN$ TO 192 + (220*256) + (192*65536)
EQU RED$ TO 255 + (128*256) + (128*65536)
EQU BLUE$ TO 128 + (255*256) + (255*65536)
EQU WHITE$ TO 255 + (255*256) + (255*65536)
EQU YELLOW$ TO 255 + (255*256) + (202*65536)
EQU LTBLUE$ TO 128 + (255*256) + (255*65536)
EQU PURPLE$ TO 225 + (181*256) + (255*65536)
EQU DTS_MULTIROW$ TO 512
EQU DTS_LARGEDATA$ TO 4096
$INSERT WO_LOG_EQU
$INSERT ORDER_DET_EQU
$INSERT PS_EQUATES
$INSERT POPUP_EQUATES
$INSERT LOGICAL
$INSERT MSG_EQUATES
ErrTitle = 'Error in Comm_Dialog_Order_Find'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Method = 'Create' ; GOSUB Create
CASE Method = 'CustChar' ; GOSUB CustChar
CASE Method = 'CustPC' ; GOSUB CustPC
CASE Method = 'CustDC' ; GOSUB CustDC
CASE Method = 'CustPNDC' ; GOSUB CustPNDC
CASE Method = 'LotNoDC' ; GOSUB LotNoDC
CASE Method = 'Cancel' ; GOSUB Cancel
CASE Method = 'Refresh' ; GOSUB Refresh
CASE Method = 'PerformQuery' ; GOSUB PerformQuery
CASE 1
ErrMsg(ErrTitle:@SVM:'Unknown method ':QUOTE(Method):' passed to routine.')
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
obj_AppWindow('Create')
Set_Property(@WINDOW,'STATUSLINE',@WINDOW:'.STATUSLINE_FIX')
GOSUB Refresh
RETURN
* * * * * * *
Refresh:
* * * * * * *
* Turn edit table symbolic column backgrounds to green
stat = Send_Message(@WINDOW:'.CUST_INFO','COLOR_BY_POS',COL$CUST_NAME,0,GREEN$) ;* Turn names column all rows green
RETURN
* * * * * * *
CustChar:
* * * * * * *
CtrlName = @WINDOW:'.CUST_INFO'
CustArray = Get_Property(CtrlName,'ARRAY') ;* Customer Information table
CurrPos = Get_Property(CtrlName,'SELPOS')
CurrRow = CurrPos<2>
DataIn = CustArray<COL$CUST_NO,CurrRow>
IF LEN(DataIn) > 2 THEN
ReturnToCtrl = CtrlName
ReturnToPos = CurrPos
IF NOT(NUM(DataIn)) THEN
Set_Property(CtrlName,'CELLPOS','',CurrPos) ;* Clear characters input
Start_Window('COMP_LOOKUP',@WINDOW,DataIn:@VM:'C':@FM:ReturnToCtrl:@FM:ReturnToPos,'','')
END
END
RETURN
* * * * * * *
CustPC:
* * * * * * *
CtrlName = @WINDOW:'.CUST_INFO'
CustList = Get_Property(CtrlName,'LIST') ;* Customer Information table
CurrPos = Get_Property(CtrlName,'SELPOS')
CurrCol = CurrPos<1>
CurrRow = CurrPos<2>
CustNo = CustList<CurrRow,COL$CUST_NO>
IF CustNo NE '' THEN
Set_Property(CtrlName,'CELLPOS',XLATE('COMPANY',CustNo,4,'X'),COL$CUST_NAME:@FM:CurrRow)
END
RETURN
* * * * * * *
CustDC:
* * * * * * *
CtrlName = @WINDOW:'.CUST_INFO'
CustList = Get_Property(CtrlName,'LIST') ;* Customer Information table
CurrPos = Get_Property(CtrlName,'SELPOS')
CurrCol = CurrPos<1>
CurrRow = CurrPos<2>
CustNo = CustList<CurrRow,COL$CUST_NO>
LineCnt = COUNT(CustList,@FM) + (CustList NE '')
IF CustNo = '' THEN
CustNos = Popup(@WINDOW,'','CUSTOMER')
CustCnt = COUNT(CustNos,@VM) + (CustNos NE '')
IF CustCnt > LineCnt THEN
FOR I = 1 TO CustCnt
stat = Send_Message(CtrlName,'INSERT',-1,@VM:@FM) ; * Add blank lines
NEXT I
END
FOR I = CurrRow TO CurrRow + CustCnt
CustNo = CustNos<1,I>
CustName = XLATE('COMPANY',CustNo,4,'X')
Set_Property(CtrlName,'CELLPOS',CustNo,COL$CUST_NO:@FM:I)
Set_Property(CtrlName,'CELLPOS',CustName,COL$CUST_NAME:@FM:I)
Set_Property(CtrlName,'SELPOS',COL$CUST_NO:@FM:I+1)
NEXT I
END ELSE
ErrMsg('DoubleClick on the first empty Cust No field to view a popup of all Customers')
END
RETURN
* * * * * * *
LotNoDC:
* * * * * * *
CustNos = Get_Property(@WINDOW:'.CUST_INFO','ARRAY')<COL$CUST_NO>
LOOP
LastCustNo = CustNos[-1,'B':@VM]
UNTIL LastCustNo NE '' OR CustNos = ''
CustNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF CustNos = '' THEN RETURN
* display the processing message and do the processing
Def = ""
Def<MTEXT$> = "Selecting Lot Numbers..."
Def<MTYPE$> = "U"
MsgUp = Msg(@window, Def)
OPEN 'DICT.ORDER_DET' TO DictVar THEN
SearchString = 'CUST_NO':@VM:CustNos:@VM:@FM
SearchString := 'CUST_LOT_NO':@VM:'#':@FM
Btree.Extract(SearchString, 'ORDER_DET', DictVar, OrdDetKeys, '', Flag)
IF Get_Status(errCode) THEN
Msg(@WINDOW,MsgUp)
ErrMsg(errCode)
RETURN
END
RETURN
IF OrdDetKeys NE '' THEN
RawLotNos = XLATE('WO_LOG',WOKeys,'LOT_NO','X') ;* Calculated field
IF Get_Status(errCode) THEN DEBUG
LotNos = ''
FOR I = 1 TO COUNT(RawLotNos,@VM) + (RawLotNos NE '')
RawLotNo = RawLotNos<1,I>
LOCATE RawLotNo IN LotNos BY 'AL' USING @VM SETTING Pos ELSE
LotNos = INSERT(LotNos,1,Pos,0,RawLotNo)
END
NEXT I
END ELSE
LotNos = ''
END
Msg(@WINDOW,MsgUp)
IF LotNos = '' THEN
ErrMsg('No Lot Numbers on file for specified customer.')
RETURN
END
LotNos := @VM
CONVERT @VM TO @RM IN LotNos
CALL V119('S','','D','R',LotNos,'')
IF Get_Status(errCode) THEN DEBUG
CONVERT @RM TO @VM IN LotNos
LotNos[-1,1] = '' ;* Strip trailing delimiter
TypeOver = ''
TypeOver<PDISPLAY$> = LotNos
LotNos = Popup(@WINDow,TypeOver,'CUST_PO') ;****** Need a popup
IF Get_Status(errCode) THEN DEBUG
IF LotNos NE '' THEN
Set_Property(@WINDOW:'.LOT_NO','DEFPROP',LotNos)
END
END ELSE
ErrMsg('Unable to open DICT.WO_LOG in COMM_DIALOG_WO_LOG_FIND.')
END
RETURN
* * * * * * *
CustPNDC:
* * * * * * *
CustArray = Get_Property(@WINDOW:'.CUST_INFO','ARRAY')
CustNos = CustArray<COL$CUST_NO>
LOOP
LastCustNo = CustNos[-1,'B':@VM]
UNTIL LastCustNo NE '' OR CustNos = ''
CustNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF CustNos = '' THEN RETURN
* display the processing message and do the processing
Def = ""
Def<MTEXT$> = "Selecting Part Numbers..."
Def<MTYPE$> = "U"
MsgUp = Msg(@window, Def)
OPEN 'DICT.WO_LOG' TO DictVar THEN
SearchString = 'CUST_NO':@VM:CustNos:@VM:@FM
SearchString := 'CUST_PART_NO':@VM:'#':@FM
Btree.Extract(SearchString, 'WO_LOG', DictVar, WOKeys, '', Flag)
IF Get_Status(errCode) THEN
Msg(@WINDOW,MsgUp)
ErrMsg(errCode)
RETURN
END
IF WOKeys NE '' THEN
PartNos = ''
FOR N = 1 TO COUNT(WOKeys,@VM) + (WOKeys NE '')
WOKey = WOKeys<1,N>
RawPartNos = XLATE('WO_LOG',WOKey,'PART_NO','X')
FOR I = 1 TO COUNT(RawPartNos,@VM) + (RawPartNos NE '')
RawPartNo = RawPartNos<1,I>
LOCATE RawPartNo IN PartNos BY 'AL' USING @VM SETTING Pos ELSE
PartNos = INSERT(PartNos,1,Pos,0,RawPartNo)
END
NEXT I
NEXT N
END ELSE
PartNos = ''
END
Msg(@WINDOW,MsgUp)
IF PartNos = '' THEN
ErrMsg('No Customer Part Numbers on file for specified customer.')
RETURN
END
PartNos := @VM
CONVERT @VM TO @RM IN PartNos
CALL V119('S','','D','R',PartNos,'')
IF Get_Status(errCode) THEN DEBUG
CONVERT @RM TO @VM IN PartNos
PartNos[-1,1] = '' ;* Strip trailing delimiter
TypeOver = ''
TypeOver<PDISPLAY$> = PartNos
PartNos = Popup(@WINDow,TypeOver,'CUST_PO') ;* Needs a popup
IF Get_Status(errCode) THEN DEBUG
IF PartNos NE '' THEN
Set_Property(@WINDOW:'.CUST_PART_NO','DEFPROP',PartNos)
END
END ELSE
ErrMsg('Unable to open DICT.WO_LOG in COMM_DIALOG_WO_LOG_FIND.')
END
RETURN
* * * * * * *
Cancel:
* * * * * * *
RETURN
* * * * * * *
PerformQuery:
* * * * * * *
* Customer numbers *
SearchString = ''
CustNos = Get_Property(@WINDOW:'.CUST_INFO','ARRAY')<COL$CUST_NO>
LOOP
LastVar = CustNos[-1,'B':@VM]
UNTIL LastVar NE '' OR CustNos = ''
CustNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF CustNos NE '' THEN SearchString := 'CUST_NO':@VM:CustNos:@FM
* LotNumbers *
LotNos = Get_Property(@WINDOW:'.LOT_NO','ARRAY')<1>
LOOP
LastVal = LotNos[-1,'B':@VM]
UNTIL LastVal NE '' OR LotNos = ''
LotNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF LotNos NE '' THEN SearchString := 'CUST_LOT_NO':@VM:LotNos:@FM
* Cust Part Number *
CustPNs = Get_Property(@WINDOW:'.CUST_PART_NO','ARRAY')<1>
LOOP
LastVal = CustPNs[-1,'B':@VM]
UNTIL LastVal NE '' OR CustPNs = ''
CustPNS[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF CustPNs NE '' THEN SearchString := 'CUST_PN':@VM:CustPNs:@FM
* Substrate Part Numbers *
SubPartNos = Get_Property(@WINDOW:'.SUB_PART_NO','ARRAY')<1>
LOOP
LastVal = SubPartNos[-1,'B':@VM]
UNTIL LastVal NE '' OR SubPartNos = ''
SubPartNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF SubPartNos NE '' THEN SearchString := 'SUB_PART_NO':@VM:SubPartNos:@FM
OPEN 'DICT.ORDER_DET' TO DictVar THEN
Def = ""
Def<MTEXT$> = "Selecting Orders..."
Def<MTYPE$> = "U"
* display the processing message and do the processing
MsgUp = Msg(@window, Def)
Btree.Extract(SearchString,'ORDER_DET',DictVar,OrderDetKeys,'',flag)
IF Get_Status(errCode) THEN ErrMsg(errCode)
Msg(@window, MsgUp)
IF Get_Status(errCode) THEN
ErrMsg(errCode)
RETURN
END
IF OrderDetKeys NE '' THEN
IF INDEX(OrderDetKeys,@VM,1) THEN
TypeOver = ''
TypeOver<PDISPLAY$> = OrderDetKeys
TypeOver<PMODE$> = 'K'
TypeOver<PSELECT$> = 2 ;* Multiple selection allowed
TypeOver<PTYPE$> = 'K'
OrderDetKeys = Popup(@WINDOW,TypeOver,'ORDER_DETAIL')
IF Get_Status(errCode) THEN ErrMsg(errCode)
DisplayList = ''
LineCnt = 1
FOR I = 1 TO COUNT(OrderDetKeys,@VM) + (OrderDetKeys NE '')
OrderDetKey = OrderDetKeys<1,I>
OrderDetRec = XLATE('ORDER_DET',OrderDetKey,'','X')
OrderNo = OrderDetKey[1,'*'] ;* Order No
OrderItem = FIELD(OrderDetKey,'*',2)
OrderItemDesc = OrderDetRec<ORDER_DET_ITEM_DESC$>
CustPartNo = OrderDetRec<ORDER_DET_CUST_PN$>
WONo = OrderDetRec<ORDER_DET_WO_NO$>
CustLotNos = OrderDetRec<ORDER_DET_CUST_LOT_NO$>
FOR N = 1 TO COUNT(CustLotNos,@VM) + (CustLotNos NE '')
DisplayList<LineCnt,1> = WONo
DisplayList<LineCnt,2> = CustLotNos<1,N>
DisplayList<LineCnt,3> = CustPartNo
DisplayList<LineCnt,4> = OrderNo
DisplayList<LineCnt,5> = OrderItem
DisplayList<LineCnt,6> = OrderItemDesc
LineCnt += 1
NEXT N
NEXT I
IF DisplayList = '' THEN
ErrMsg('Selected Order Items are missing Customer Lot information.')
End_Dialog(@WINDOW,'')
END
CONVERT @VM:@FM TO @SVM:@VM IN DisplayList
TypeOver = ''
TypeOver<PDISPLAY$> = DisplayList
WONo = PopUp(@WINDOW,TypeOver,'WO_LOTS_DUE_IN')
IF Get_Status(errCode) THEN
ErrMsg(errCode)
END
END ELSE
WONo = XLATE('ORDER_DET',OrderDetKeys,ORDER_DET_WO_NO$,'X')
END
END ELSE
ErrMsg('No Work Orders with Material Due In found for specified Orders')
WONo = ''
END
End_Dialog(@WINDOW,WONo)
END ELSE
ErrMsg('Unable to open DICT.ORDER_DET in routine COMM_DIALOG_WO_LOG_FIND')
End_Dialog(@WINDOW,'')
END
RETURN

View File

@ -0,0 +1,754 @@
COMPILE FUNCTION Comm_Dialog_WO_Find(Method, Parm1)
/*
Commuter module for Dialog_WO_Find window.
01/14/2005 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Send_Event, Set_Status, ErrMsg
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Btree.Extract, Msg, Send_Info
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Utility, Send_Message, Popup, Collect.IXVals, Msg
EQU CRLF$ TO \0D0A\
EQU COL$CUST_NO TO 1 ;* Customer edit table column equates
EQU COL$CUST_NAME TO 2
EQU COL$REACT_TYPE TO 1
EQU LTGREY$ TO 229 + (229*256) + (229*65536) ;* JCH standard colors for edittable backgrounds
EQU GREY$ TO 192 + (192*256) + (192*65536)
EQU GREEN$ TO 192 + (220*256) + (192*65536)
EQU RED$ TO 255 + (128*256) + (128*65536)
EQU BLUE$ TO 128 + (255*256) + (255*65536)
EQU WHITE$ TO 255 + (255*256) + (255*65536)
EQU YELLOW$ TO 255 + (255*256) + (202*65536)
EQU LTBLUE$ TO 128 + (255*256) + (255*65536)
EQU PURPLE$ TO 225 + (181*256) + (255*65536)
EQU DTS_MULTIROW$ TO 512
EQU DTS_LARGEDATA$ TO 4096
$INSERT WO_LOG_EQU
$INSERT PS_EQUATES
$INSERT POPUP_EQUATES
$INSERT MSG_EQUATES
ErrTitle = 'Error in Comm_Dialog_Order_Find'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Method = 'Create' ; GOSUB Create
CASE Method = 'CustChar' ; GOSUB CustChar
CASE Method = 'CustPC' ; GOSUB CustPC
CASE Method = 'CustDC' ; GOSUB CustDC
CASE Method = 'CustPNDC' ; GOSUB CustPNDC
CASE Method = 'SubPNDC' ; GOSUB SubPNDC
CASE Method = 'LotNoDC' ; GOSUB LotNoDC
CASE Method = 'PSNoDC' ; GOSUB PSNoDC
CASE Method = 'ReactTypeDC' ; GOSUB ReactTypeDC
CASE Method = 'LUDate' ; GOSUB LUDate
CASE Method = 'Cancel' ; GOSUB Cancel
CASE Method = 'Refresh' ; GOSUB Refresh
CASE Method = 'PerformQuery' ; GOSUB PerformQuery
CASE 1
ErrMsg(ErrTitle:@SVM:'Unknown method ':QUOTE(Method):' passed to routine.')
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
obj_AppWindow('Create')
Set_Property(@WINDOW,'STATUSLINE',@WINDOW:'.STATUSLINE_FIX')
GOSUB Refresh
RETURN
* * * * * * *
Refresh:
* * * * * * *
* Turn edit table symbolic column backgrounds to green
stat = Send_Message(@WINDOW:'.CUST_INFO','COLOR_BY_POS',COL$CUST_NAME,0,GREEN$) ;* Turn names column all rows green
RETURN
* * * * * * *
CustChar:
* * * * * * *
CtrlName = @WINDOW:'.CUST_INFO'
CustArray = Get_Property(CtrlName,'ARRAY') ;* Customer Information table
CurrPos = Get_Property(CtrlName,'SELPOS')
CurrRow = CurrPos<2>
DataIn = CustArray<COL$CUST_NO,CurrRow>
IF LEN(DataIn) > 2 THEN
ReturnToCtrl = CtrlName
ReturnToPos = CurrPos
IF NOT(NUM(DataIn)) THEN
Set_Property(CtrlName,'CELLPOS','',CurrPos) ;* Clear characters input
Start_Window('COMP_LOOKUP',@WINDOW,DataIn:@VM:'C':@FM:ReturnToCtrl:@FM:ReturnToPos,'','')
END
END
RETURN
* * * * * * *
CustPC:
* * * * * * *
CtrlName = @WINDOW:'.CUST_INFO'
CustList = Get_Property(CtrlName,'LIST') ;* Customer Information table
CurrPos = Get_Property(CtrlName,'SELPOS')
CurrCol = CurrPos<1>
CurrRow = CurrPos<2>
CustNo = CustList<CurrRow,COL$CUST_NO>
IF CustNo NE '' THEN
Set_Property(CtrlName,'CELLPOS',XLATE('COMPANY',CustNo,4,'X'),COL$CUST_NAME:@FM:CurrRow)
END
RETURN
* * * * * * *
CustDC:
* * * * * * *
CtrlName = @WINDOW:'.CUST_INFO'
CustList = Get_Property(CtrlName,'LIST') ;* Customer Information table
CurrPos = Get_Property(CtrlName,'SELPOS')
CurrCol = CurrPos<1>
CurrRow = CurrPos<2>
CustNo = CustList<CurrRow,COL$CUST_NO>
LineCnt = COUNT(CustList,@FM) + (CustList NE '')
IF CustNo = '' THEN
CustNos = Popup(@WINDOW,'','CUSTOMER')
CustCnt = COUNT(CustNos,@VM) + (CustNos NE '')
IF CustCnt > LineCnt THEN
FOR I = 1 TO CustCnt
stat = Send_Message(CtrlName,'INSERT',-1,@VM:@FM) ; * Add blank lines
NEXT I
END
FOR I = CurrRow TO CurrRow + CustCnt
CustNo = CustNos<1,I>
CustName = XLATE('COMPANY',CustNo,4,'X')
Set_Property(CtrlName,'CELLPOS',CustNo,COL$CUST_NO:@FM:I)
Set_Property(CtrlName,'CELLPOS',CustName,COL$CUST_NAME:@FM:I)
Set_Property(CtrlName,'SELPOS',COL$CUST_NO:@FM:I+1)
NEXT I
END ELSE
ErrMsg('DoubleClick on the first empty Cust No field to view a popup of all Customers')
END
RETURN
* * * * * * *
SubPNDC:
* * * * * * *
CustArray = Get_Property(@WINDOW:'.CUST_INFO','ARRAY')<COL$CUST_NO>
CustNos = CustArray<COL$CUST_NO>
LOOP
LastCustNo = CustNos[-1,'B':@VM]
UNTIL LastCustNo NE '' OR CustNos = ''
CustNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF CustNos = '' THEN RETURN
* display the processing message and do the processing
Def = ""
Def<MTEXT$> = "Selecting Substrate Part Numbers..."
Def<MTYPE$> = "U"
MsgUp = Msg(@window, Def)
OPEN 'DICT.WO_LOG' TO DictVar THEN
SearchString = 'CUST_NO':@VM:CustNos:@VM:@FM
SearchString := 'SUB_PART_NO':@VM:'#':@FM
Btree.Extract(SearchString, 'WO_LOG', DictVar, WOKeys, '', Flag)
IF Get_Status(errCode) THEN
Msg(@WINDOW,MsgUp)
ErrMsg(errCode)
RETURN
END
IF WOKeys NE '' THEN
RawPartNos = XLATE('WO_LOG',WOKeys,'SUB_PART_NO','X') ;* Calculated field
IF Get_Status(errCode) THEN DEBUG
PartNos = ''
FOR I = 1 TO COUNT(RawPartNos,@VM) + (RawPartNos NE '')
RawPartNo = RawPartNos<1,I>
LOCATE RawPartNo IN PartNos BY 'AL' USING @VM SETTING Pos ELSE
PartNos = INSERT(PartNos,1,Pos,0,RawPartNo)
END
NEXT I
END ELSE
PartNos = ''
END
Msg(@WINDOW,MsgUp)
IF PartNos = '' THEN
ErrMsg('No Substrate Part Numbers on file for specified customer.')
RETURN
END
PartNos := @VM
CONVERT @VM TO @RM IN PartNos
CALL V119('S','','D','R',PartNos,'')
IF Get_Status(errCode) THEN DEBUG
CONVERT @RM TO @VM IN PartNos
PartNos[-1,1] = '' ;* Strip trailing delimiter
TypeOver = ''
TypeOver<PDISPLAY$> = PartNos
PartNos = Popup(@WINDow,TypeOver,'CUST_PO') ;****** Need a popup
IF Get_Status(errCode) THEN DEBUG
IF PartNos NE '' THEN
Set_Property(@WINDOW:'.SUB_PART_NO','DEFPROP',PartNos)
END
END ELSE
ErrMsg('Unable to open DICT.WO_LOG in COMM_DIALOG_WO_LOG_FIND.')
END
RETURN
* * * * * * *
LotNoDC:
* * * * * * *
CustNos = Get_Property(@WINDOW:'.CUST_INFO','ARRAY')<COL$CUST_NO>
LOOP
LastCustNo = CustNos[-1,'B':@VM]
UNTIL LastCustNo NE '' OR CustNos = ''
CustNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF CustNos = '' THEN RETURN
* display the processing message and do the processing
Def = ""
Def<MTEXT$> = "Selecting Lot Numbers..."
Def<MTYPE$> = "U"
MsgUp = Msg(@window, Def)
OPEN 'DICT.WO_LOG' TO DictVar THEN
SearchString = 'CUST_NO':@VM:CustNos:@VM:@FM
SearchString := 'LOT_NO':@VM:'#':@FM
Btree.Extract(SearchString, 'WO_LOG', DictVar, WOKeys, '', Flag)
IF Get_Status(errCode) THEN
Msg(@WINDOW,MsgUp)
ErrMsg(errCode)
RETURN
END
IF WOKeys NE '' THEN
RawLotNos = XLATE('WO_LOG',WOKeys,'LOT_NO','X') ;* Calculated field
IF Get_Status(errCode) THEN DEBUG
LotNos = ''
FOR I = 1 TO COUNT(RawLotNos,@VM) + (RawLotNos NE '')
RawLotNo = RawLotNos<1,I>
LOCATE RawLotNo IN LotNos BY 'AL' USING @VM SETTING Pos ELSE
LotNos = INSERT(LotNos,1,Pos,0,RawLotNo)
END
NEXT I
END ELSE
LotNos = ''
END
Msg(@WINDOW,MsgUp)
IF LotNos = '' THEN
ErrMsg('No Lot Numbers on file for specified customer.')
RETURN
END
LotNos := @VM
CONVERT @VM TO @RM IN LotNos
CALL V119('S','','D','R',LotNos,'')
IF Get_Status(errCode) THEN DEBUG
CONVERT @RM TO @VM IN LotNos
LotNos[-1,1] = '' ;* Strip trailing delimiter
TypeOver = ''
TypeOver<PDISPLAY$> = LotNos
LotNos = Popup(@WINDow,TypeOver,'CUST_PO') ;****** Need a popup
IF Get_Status(errCode) THEN DEBUG
IF LotNos NE '' THEN
Set_Property(@WINDOW:'.LOT_NO','DEFPROP',LotNos)
END
END ELSE
ErrMsg('Unable to open DICT.WO_LOG in COMM_DIALOG_WO_LOG_FIND.')
END
RETURN
* * * * * * *
PSNoDC:
* * * * * * *
CustArray = Get_Property(@WINDOW:'.CUST_INFO','ARRAY')
CustNos = CustArray<COL$CUST_NO>
LOOP
LastCustNo = CustNos[-1,'B':@VM]
UNTIL LastCustNo NE '' OR CustNos = ''
CustNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF CustNos = '' THEN RETURN
* display the processing message and do the processing
Def = ""
Def<MTEXT$> = "Selecting Product Specifications..."
Def<MTYPE$> = "U"
MsgUp = Msg(@window, Def)
OPEN 'DICT.WO_LOG' TO DictVar THEN
SearchString = 'CUST_NO':@VM:CustNos:@VM:@FM
SearchString := 'PS_NO':@VM:'#':@FM
Btree.Extract(SearchString, 'WO_LOG', DictVar, WOKeys, '', Flag)
IF Get_Status(errCode) THEN
Msg(@WINDOW,MsgUp)
ErrMsg(errCode)
RETURN
END
IF WOKeys NE '' THEN
PSNs = ''
FOR N = 1 TO COUNT(WOKeys,@VM) + (WOKeys NE '')
WOKey = WOKeys<1,N>
RawPSNs = XLATE('WO_LOG',WOKey,'PS_NO','X')
FOR I = 1 TO COUNT(RawPSNs,@VM) + (RawPSNs NE '')
RawPSN = RawPSNs<1,I>
LOCATE RawPSN IN PSNs BY 'AL' USING @VM SETTING Pos ELSE
PSNs = INSERT(PSNs,1,Pos,0,RawPSN)
END
NEXT I
NEXT N
END ELSE
PSNs = ''
END
Msg(@WINDOW,MsgUp)
IF PSNs = '' THEN
ErrMsg('No Product Specifications on file for specified customer.')
RETURN
END
PSNs := @VM
CONVERT @VM TO @RM IN PSNs
CALL V119('S','','D','R',PSNs,'')
IF Get_Status(errCode) THEN DEBUG
CONVERT @RM TO @VM IN PSNs
PSNs[-1,1] = '' ;* Strip trailing delimiter
TypeOver = ''
TypeOver<PDISPLAY$> = PSNs
PSNs = Popup(@WINDow,TypeOver,'CUST_PO')
IF Get_Status(errCode) THEN DEBUG
IF PSNs NE '' THEN
CONVERT @VM TO @FM IN PSNs
Set_Property(@WINDOW:'.PS_NO','LIST',PSNs)
END
END ELSE
ErrMsg('Unable to open DICT.WO_LOG in COMM_DIALOG_WO_LOG_FIND.')
END
RETURN
* * * * * * *
ReactTypeDC:
* * * * * * *
CtrlName = @WINDOW:'.REACT_TYPE'
RTypeList = Get_Property(CtrlName,'LIST') ;* Customer Information table
CurrPos = Get_Property(CtrlName,'SELPOS')
CurrCol = CurrPos<1>
CurrRow = CurrPos<2>
RType = RTypeList<CurrRow,COL$REACT_TYPE>
LineCnt = COUNT(RTypeList,@FM) + (RTypeList NE '')
IF RType = '' THEN
RTypes = Popup(@WINDOW,'','REACTOR_TYPE')
rCnt = COUNT(RTypes,@VM) + (RTypes NE '')
IF rCnt > LineCnt THEN
FOR I = 1 TO rCnt
stat = Send_Message(CtrlName,'INSERT',-1,@VM:@FM) ; * Add blank lines
NEXT I
END
FOR I = CurrRow TO CurrRow + rCnt
RType = RTypes<1,I>
*CustName = XLATE('COMPANY',CustNo,4,'X')
Set_Property(CtrlName,'CELLPOS',RType,COL$REACT_TYPE:@FM:I)
*Set_Property(CtrlName,'CELLPOS',CustName,COL$CUST_NAME:@FM:I)
*Set_Property(CtrlName,'SELPOS',COL$CUST_NO:@FM:I+1)
NEXT I
END ELSE
ErrMsg('DoubleClick on the first empty Cust No field to view a popup of all Customers')
END
RETURN
* * * * * * *
CustPNDC:
* * * * * * *
CustArray = Get_Property(@WINDOW:'.CUST_INFO','ARRAY')
CustNos = CustArray<COL$CUST_NO>
LOOP
LastCustNo = CustNos[-1,'B':@VM]
UNTIL LastCustNo NE '' OR CustNos = ''
CustNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF CustNos = '' THEN RETURN
* display the processing message and do the processing
Def = ""
Def<MTEXT$> = "Selecting Part Numbers..."
Def<MTYPE$> = "U"
MsgUp = Msg(@window, Def)
OPEN 'DICT.WO_LOG' TO DictVar THEN
SearchString = 'CUST_NO':@VM:CustNos:@VM:@FM
SearchString := 'CUST_PART_NO':@VM:'#':@FM
Btree.Extract(SearchString, 'WO_LOG', DictVar, WOKeys, '', Flag)
IF Get_Status(errCode) THEN
Msg(@WINDOW,MsgUp)
ErrMsg(errCode)
RETURN
END
IF WOKeys NE '' THEN
PartNos = ''
FOR N = 1 TO COUNT(WOKeys,@VM) + (WOKeys NE '')
WOKey = WOKeys<1,N>
RawPartNos = XLATE('WO_LOG',WOKey,'PART_NO','X')
FOR I = 1 TO COUNT(RawPartNos,@VM) + (RawPartNos NE '')
RawPartNo = RawPartNos<1,I>
LOCATE RawPartNo IN PartNos BY 'AL' USING @VM SETTING Pos ELSE
PartNos = INSERT(PartNos,1,Pos,0,RawPartNo)
END
NEXT I
NEXT N
END ELSE
PartNos = ''
END
Msg(@WINDOW,MsgUp)
IF PartNos = '' THEN
ErrMsg('No Customer Part Numbers on file for specified customer.')
RETURN
END
PartNos := @VM
CONVERT @VM TO @RM IN PartNos
CALL V119('S','','D','R',PartNos,'')
IF Get_Status(errCode) THEN DEBUG
CONVERT @RM TO @VM IN PartNos
PartNos[-1,1] = '' ;* Strip trailing delimiter
TypeOver = ''
TypeOver<PDISPLAY$> = PartNos
PartNos = Popup(@WINDow,TypeOver,'CUST_PO') ;* Needs a popup
IF Get_Status(errCode) THEN DEBUG
IF PartNos NE '' THEN
Set_Property(@WINDOW:'.CUST_PART_NO','DEFPROP',PartNos)
END
END ELSE
ErrMsg('Unable to open DICT.WO_LOG in COMM_DIALOG_WO_LOG_FIND.')
END
RETURN
* * * * * * *
LUDate:
* * * * * * *
ReturnCtrl = Parm1[1,@RM]
IF ReturnCtrl = '' THEN ReturnCtrl = Get_Property(@WINDOW,'FOCUS')
DateSelected = Dialog_Box('POPUP_YEAR',@WINDOW)
RetVal = OCONV(DateSelected, 'D4/')
obj_Appwindow('LUValReturn',RetVal:@RM:ReturnCtrl)
RETURN
* * * * * * *
Cancel:
* * * * * * *
RETURN
* * * * * * *
PerformQuery:
* * * * * * *
* Customer numbers *
SearchString = ''
CustNos = Get_Property(@WINDOW:'.CUST_INFO','ARRAY')<COL$CUST_NO>
LOOP
LastVar = CustNos[-1,'B':@VM]
UNTIL LastVar NE '' OR CustNos = ''
CustNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF CustNos NE '' THEN SearchString := 'CUST_NO':@VM:CustNos:@FM
* LotNumbers *
LotNos = Get_Property(@WINDOW:'.LOT_NO','ARRAY')<1>
LOOP
LastVal = LotNos[-1,'B':@VM]
UNTIL LastVal NE '' OR LotNos = ''
LotNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF LotNos NE '' THEN SearchString := 'LOT_NO':@VM:LotNos:@FM
* Cust Part Number *
CustPNs = Get_Property(@WINDOW:'.CUST_PART_NO','ARRAY')<1>
LOOP
LastVal = CustPNs[-1,'B':@VM]
UNTIL LastVal NE '' OR CustPNs = ''
CustPNS[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF CustPNs NE '' THEN SearchString := 'CUST_PART_NO':@VM:CustPNs:@FM
* Substrate Part Numbers *
SubPartNos = Get_Property(@WINDOW:'.SUB_PART_NO','ARRAY')<1>
LOOP
LastVal = SubPartNos[-1,'B':@VM]
UNTIL LastVal NE '' OR SubPartNos = ''
SubPartNos[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF SubPartNos NE '' THEN SearchString := 'SUB_PART_NO':@VM:SubPartNos:@FM
* * * * * Reactor Type * * * * *
ReactTypes = Get_Property(@WINDOW:'.REACT_TYPE','ARRAY')<COL$REACT_TYPE>
LOOP
LastVal = ReactTypes[-1,'B':@VM]
UNTIL LastVal NE '' OR ReactTypes = ''
ReactTypes[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF ReactTypes NE '' THEN SearchString := 'REACT_TYPE':@VM:ReactTypes:@FM
* PSN Nos *
PS_NOs = Get_Property(@WINDOW:'.PS_NO','ARRAY')<1>
LOOP
LastVal = PS_NOs[-1,'B':@VM]
UNTIL LastVal NE '' OR PS_NOs = ''
PS_NOs[COL1(),99] = '' ;* Trim trailing blanks
REPEAT
IF PS_NOs NE '' THEN SearchString := 'PS_NO':@VM:PS_NOs:@FM
* Entry Dates *
StartDt = ICONV(Get_Property(@WINDOW:'.START_DT','TEXT'),'D')
EndDt = ICONV(Get_Property(@WINDOW:'.END_DT','TEXT'),'D')
BEGIN CASE
CASE StartDt NE '' AND EndDt = ''
SearchString := 'ENTRY_DATE':@VM:'>=':StartDt:@FM
CASE StartDt = '' AND EndDt NE ''
SearchString := 'ENTRY_DATE':@VM:'<=':EndDt:@FM
CASE StartDt NE '' AND EndDt NE ''
* Fudge the dates - '~' is not inclusive of the end dates
StartDt -= 1
EndDt += 1
SearchString := 'ENTRY_DATE':@VM:StartDt:'~':EndDt:@FM
CASE 1
NULL
END CASE
* RX Dates *
StartDt = ICONV(Get_Property(@WINDOW:'.MTL_RX_START_DT','TEXT'),'D')
EndDt = ICONV(Get_Property(@WINDOW:'.MTL_RX_END_DT','TEXT'),'D')
BEGIN CASE
CASE StartDt NE '' AND EndDt = ''
SearchString := 'RX_DT':@VM:'>=':OConv(StartDt, 'D4/'):@FM
CASE StartDt = '' AND EndDt NE ''
SearchString := 'RX_DT':@VM:'<=':OConv(EndDt, 'D4/'):@FM
CASE StartDt NE '' AND EndDt NE ''
* Fudge the dates - '~' is not inclusive of the end dates
StartDt -= 1
EndDt += 1
SearchString := 'RX_DT':@VM:OConv(StartDt, 'D4/'):'~':OConv(EndDt, 'D4/'):@FM
CASE 1
NULL
END CASE
OrdStatus = Get_Property(@WINDOW:'.STATUS','VALUE')
IF OrdStatus NE 'I' THEN
IF OrdStatus = 1 THEN
SearchString := 'CLOSE_DATE':@VM:'#':@FM
END ELSE
SearchString := 'CLOSE_DATE':@VM:'=':@FM
END
END
OPEN 'DICT.WO_LOG' TO DictVar THEN
Def = ""
Def<MTEXT$> = "Selecting Orders..."
Def<MTYPE$> = "U"
* display the processing message and do the processing
MsgUp = Msg(@window, Def)
Btree.Extract(SearchString,'WO_LOG',DictVar,WOKeys,'',flag)
IF Get_Status(errCode) THEN ErrMsg(errCode)
Msg(@window, MsgUp)
IF Get_Status(errCode) THEN
ErrMsg(errCode)
RETURN
END
End_Dialog(@WINDOW,WOKeys)
END ELSE
ErrMsg('Unable to open DICT.WO_LOG in routine COMM_DIALOG_WO_LOG_FIND')
END
RETURN

View File

@ -0,0 +1,573 @@
COMPILE FUNCTION Comm_Dialog_WO_Scan(Method, Parm1)
#pragma precomp SRP_PreCompiler
/*
Commuter module for Dialog_WO_Scan window.
08/12/2004 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Set_Status, ErrMsg, Extract_SI_Keys, Logging_Services
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Msg, Btree.Extract, Error_Services
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Send_Message, Set_FSError, Environment_Services
DECLARE FUNCTION obj_Vendor_Code, Msg, Error_Services, Logging_Services
$INSERT LOGICAL
$INSERT MSG_EQUATES
$INSERT APPCOLORS
EQU CRLF$ TO \0D0A\
EQU COL$LQP_LOT TO 1 ;* Equates for Lot_Qty... edit table controls used to scan in label data
EQU COL$LQP_QTY TO 2
EQU COL$LQP_PART TO 3 ;* This is either Cust Part No OR Substrate Part Number depending on which control is visible
EQU COL$LQP_VENDOR TO 4 ;* Vendor code on the Substrate screen 7/14/2011 JCH for SAP
EQU CA$ITEM_NO TO 1 ;* Equates for Checking Array passed to Scan routine
EQU CA$LOT_NO TO 2
EQU CA$LOT_QTY TO 3
EQU CA$CUST_PART_NO TO 4
EQU CA$SUB_PART_NO TO 5
EQU CA$SCANNED_LOT_QTY TO 6
EQU CA$VERIFY_PART_NO TO 7
EQU CA$SUB_SUPP_BY TO 8
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\Receiving'
LogDate = Oconv(Date(), 'D4/')
LogTime = Oconv(Time(), 'MTS')
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' Receiving Log.csv'
Headers = 'Logging DTM' : @FM : 'User' : @FM : 'Scan Data'
objLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, Comma$, Headers, '', False$, False$)
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
ErrTitle = 'Error in Comm_Dialog_WO_Scan'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Method = 'Create' ; GOSUB Create
CASE Method = 'OK' ; GOSUB OK
CASE Method = 'Cancel' ; GOSUB Cancel
CASE Method = 'FieldClick' ; GOSUB FieldClick
CASE Method = 'LQP' ; GOSUB LQP
CASE 1
ErrMsg(ErrTitle:@SVM:'Unknown method ':QUOTE(Method):' passed to routine.')
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
VendorDef = Parm1[1,@FM]
CheckArray = FIELD(Parm1,@FM,2,999)
Set_Property(@WINDOW,'@VENDOR_DEF',VendorDef)
OpenQty = CheckArray<CA$LOT_QTY>
Set_Property(@WINDOW:'.OPEN_QTY','TEXT',OCONV(OpenQty,'MD0,')) ;* 12/6/2011 JCH
Set_Property(@WINDOW,'@CHECK_ARRAY',CheckArray)
obj_AppWindow('Create')
TimeStamp = OCONV(Date(),'D4/'):' ':OCONV(Time(),'MTS')
Set_Property(@WINDOW:'.RX_DTM','DEFPROP',TimeStamp)
Set_Property(@WINDOW,'FOCUS',@WINDOW:'.RX_DTM')
Set_Property(@WINDOW:'.RX_DTM','SELECTION',1:@FM:65534)
GOSUB Refresh
* * * * * * *
FieldClick:
* * * * * * *
CtrlEntID = @WINDOW:'.FIELD_RADIO'
ControlSelection = Get_Property(CtrlEntID,'VALUE')
Ctrls = @WINDOW:'.LOT_QTY':@RM ; Props = 'VISIBLE':@RM
Ctrls := @WINDOW:'.LOT_QTY_PART':@RM ; Props := 'VISIBLE':@RM
Ctrls := @WINDOW:'.LOT_QTY_SUB_PART':@RM ; Props := 'VISIBLE':@RM
Ctrls := @WINDOW:'.WINDOW_LABEL_FIX' ; Props := 'TEXT'
BEGIN CASE
CASE ControlSelection = 'LQ' ; Vals = '1':@RM:'0':@RM:'0':@RM:'Customer Wafers'
CASE ControlSelection = 'LQP' ; Vals = '0':@RM:'1':@RM:'0':@RM:'Customer Wafers'
CASE ControlSelection = 'LQSP' ; Vals = '0':@RM:'0':@RM:'1':@RM:'Substrates'
END CASE
Set_Property(Ctrls,Props,Vals)
RETURN
* * * * * * *
Close:
* * * * * * *
* * * * * * *
Cancel:
* * * * * * *
End_Dialog(@WINDOW,'Cancel')
RETURN
* * * * * * *
Refresh:
* * * * * * *
ListArray = Get_Property(CtrlEntId,'ARRAY')
CheckArray = Get_Property(@WINDOW,'@CHECK_ARRAY')
TotalScannedQty = SUM(ListArray<COL$LQP_QTY>)
OpenQty = CheckArray<CA$LOT_QTY>
Set_Property(@WINDOW:'.SCANNED_QTY','TEXT',OCONV(TotalScannedQty,'MD0,'))
IF TotalScannedQty < OpenQty THEN
Set_Property(@WINDOW:'.SCANNED_QTY','BACKCOLOR',GREEN$)
END ELSE
Set_Property(@WINDOW:'.SCANNED_QTY','BACKCOLOR',RED$)
END
RETURN
* * * * * * *
LQP:
* * * * * * *
CtrlEntID = Get_Property(@WINDOW,'FOCUS')
StripANSI = Get_Property(@WINDOW:'.STRIP_ANSI','CHECK')
SkipSubANSI = Get_Property(@WINDOW:'.SKIP_SUBSTRATE_ANSI','CHECK')
CheckArray = Get_Property(@WINDOW,'@CHECK_ARRAY')
BEGIN CASE
CASE CtrlEntID = @WINDOW:'.LOT_QTY' ; ColCnt = 2
CASE CtrlEntID = @WINDOW:'.LOT_QTY_PART' ; ColCnt = 3
CASE CtrlEntID = @WINDOW:'.LOT_QTY_SUB_PART' ; ColCnt = 4
END CASE
PrevSelPos = Get_Property(CtrlEntId,"PREVSELPOS")
PrevCol = PrevSelPos<1>
PrevRow = PrevSelPos<2>
CurrPos = Get_Property(CtrlEntId,'SELPOS')
CurrCol = CurrPos<1>
CurrRow = CurrPos<2>
ListData = Get_Property(CtrlEntId,'LIST')
IF ListData<CurrRow,CurrCol> = '' THEN
ColPointer = CurrCol
LinePointer = CurrRow
* Find the first non-empty cell
LOOP
Test = ListData<LinePointer,(ColPointer) >
UNTIL Test NE '' OR (LinePointer = 0 AND ColPointer = 1)
ColPointer -= 1
IF ColPointer = 0 THEN
ColPointer = ColCnt
LinePointer -= 1
END
REPEAT
* Move one past the non empty cell
BEGIN CASE
CASE LinePointer = 0
* Empty Table
LinePointer = 1
CoilPointer = 1
CASE ColPointer = ColCnt
LinePointer += 1
ColPointer = 1
CASE 1
ColPointer += 1
END CASE
Set_Property(CtrlEntId,"SELPOS",ColPointer:@FM:LinePointer)
END
// Global scan validation check. Only alpha-numeric, dashes, spaces, and periods permitted.
ValidationScan = Trim(ListData<PrevRow,PrevCol>)
Convert @Lower_Case to @Upper_Case in ValidationScan
Convert 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789- ./' to '' in ValidationScan
//DPC 2/18/20 - changed validation to allow foward slash per supplier lot naming (Global Wafer)
//FYI - conversion would only work when separated from above line
Convert '/' to '' in ValidationScan
If ValidationScan NE '' then
Error_Services('Set', 'Scanned code ' : Quote(Trim(ListData<PrevRow,PrevCol>)) : ' contains an invalid character. Please re-scan.')
end
If Error_Services('NoError') then
IF ListData<PrevRow,PrevCol> NE '' THEN
BEGIN CASE
CASE PrevCol = COL$LQP_LOT
IF StripANSI THEN
RawLot = TRIM(ListData<PrevRow,PrevCol>)
IF RawLot[1,2] = '1T' OR RawLot[1,2] = '2T' THEN
LotNo = RawLot[3,99]
END ELSE
TypeOver = ''
TypeOver<MTYPE$> = 'B&Rescan'
TypeOver<MTEXT$> = 'Scanned Code ':QUOTE(RawLot):' is not an ANSI Lot No.'
Msg(@WINDOW,TypeOver,'LABEL_DATA_ERROR')
Set_Property(CtrlEntId,"SELPOS",PrevSelPos)
Set_Property(CtrlEntID,'INVALUE','',PrevSelPos)
RETURN
END
END ELSE
LotNo = TRIM(ListData<PrevRow,PrevCol>)
END
IF CtrlEntID NE @WINDOW:'.LOT_QTY_SUB_PART' THEN
* Don't check Customer Lot Numbers if scanning substrates
LOCATE LotNo IN CheckArray<CA$LOT_NO> USING @VM SETTING Pos ELSE
* Accept or Rescan message
TypeOver = ''
TypeOver<MTYPE$> = 'B&Rescan'
TypeOver<MTEXT$> = 'Lot No ':QUOTE(LotNo):' not found in':@TM:'Order Item Lot Numbers!'
Resp = Msg(@WINDOW,TypeOver,'LABEL_DATA_ERROR')
LotNo = '' ;* Clear entered field for a rescan
Set_Property(CtrlEntId,"SELPOS",PrevSelPos) ;* Cursor to Lot No for a rescan
END
END
Set_Property(CtrlEntID,'INVALUE',LotNo,PrevSelPos)
CASE PrevCol = COL$LQP_QTY
IF StripANSI THEN
RawLotQty = ListData<PrevRow,PrevCol>
IF RawLotQty[1,1] = 'Q' THEN
LotQty = RawLotQty[2,99]
END ELSE
TypeOver = ''
TypeOver<MTYPE$> = 'B&Rescan'
TypeOver<MTEXT$> = 'Scanned Code ':QUOTE(RawLotQty):' is not an ANSI Quantity'
Msg(@WINDOW,TypeOver,'LABEL_DATA_ERROR')
Set_Property(CtrlEntId,"SELPOS",PrevSelPos)
Set_Property(CtrlEntID,'INVALUE','',PrevSelPos)
RETURN
END
END ELSE
LotQty = ListData<PrevRow,PrevCol>
END
IF NOT(NUM(LotQty)) THEN
* Accept or Rescan message
TypeOver = ''
TypeOver<MTYPE$> = 'B&Rescan'
TypeOver<MTEXT$> = 'Lot Qty ':QUOTE(LotQty):' is not a number!'
Resp = Msg(@WINDOW,TypeOver,'LABEL_DATA_ERROR')
LotNo = '' ;* Clear entered field for a rescan
Set_Property(CtrlEntId,"SELPOS",PrevSelPos) ;* Cursor to Lot No for a rescan
END
Set_Property(CtrlEntID,'INVALUE',LotQty,PrevSelPos)
CASE PrevCol = COL$LQP_PART
// Check scanned part number for 5 segments. If there are 5 segments then use segments 3 and 4
// to make the actual part number.
ScannedPartNo = Trim(ListData<PrevRow, PrevCol>)
If DCount(ScannedPartNo, '-') EQ 5 then
RawPartNo = ''
If ScannedPartNo[1, 1] _EQC 'P' then RawPartNo := 'P'
If ScannedPartNo[1, 1] _EQC 'S' then RawPartNo := 'S'
RawPartNo := Field(ScannedPartNo, '-', 3, 2)
ListData<PrevRow, PrevCol> = RawPartNo
end
RawPartNo = TRIM(ListData<PrevRow,PrevCol>)
IF StripANSI AND NOT(SkipSubAnsi) THEN ;***************************************
RawPartNo = TRIM(ListData<PrevRow,PrevCol>)
IF RawPartNo[1,1] _EQC 'P' OR RawPartNo[1,1] _EQC 'S' THEN
PartNo = RawPartNo[2,99]
END ELSE
TypeOver = ''
TypeOver<MTYPE$> = 'B&Rescan'
TypeOver<MTEXT$> = 'Scanned Code ':QUOTE(RawPartNo):' is not an ANSI Part No'
Msg(@WINDOW,TypeOver,'LABEL_DATA_ERROR')
Set_Property(CtrlEntId,"SELPOS",PrevSelPos)
Set_Property(CtrlEntID,'INVALUE','',PrevSelPos)
RETURN
END
END ELSE
PartNo = ListData<PrevRow,PrevCol>
END
IF CtrlEntID = @WINDOW:'.LOT_QTY_PART' THEN
* Check Customer Part Numbers
LOCATE PartNo IN CheckArray<CA$VERIFY_PART_NO> USING @VM SETTING Pos THEN
PartNo = CheckArray<CA$CUST_PART_NO,Pos>
END ELSE
* Accept or Rescan message
TypeOver = ''
TypeOver<MTYPE$> = 'B&Rescan'
TypeOver<MTEXT$> = 'Part No ':QUOTE(PartNo):' not found in':@TM:'Order Customer Part Numbers!'
Resp = Msg(@WINDOW,TypeOver,'LABEL_DATA_ERROR')
PartNo = '' ;* Clear entered field for a rescan
Set_Property(CtrlEntId,"SELPOS",PrevSelPos) ;* Cursor to Lot No for a rescan
END
END ELSE
* Check Substrate Part Numbers
LOCATE PartNo IN CheckArray<CA$SUB_PART_NO> USING @VM SETTING Pos ELSE
* Accept or Rescan message
TypeOver = ''
TypeOver<MTYPE$> = 'B&Rescan'
TypeOver<MTEXT$> = 'Part No ':QUOTE(PartNo):' not found in':@TM:'Order Substrate Part Numbers!'
Resp = Msg(@WINDOW,TypeOver,'LABEL_DATA_ERROR')
PartNo = '' ;* Clear entered field for a rescan
Set_Property(CtrlEntId,"SELPOS",PrevSelPos) ;* Cursor to Lot No for a rescan
END
END ;* End of check for Customer supplied or Inventory substrate part number
Set_Property(CtrlEntID,'INVALUE',PartNo,PrevSelPos)
CASE PrevCol = COL$LQP_VENDOR
SubSuppBy = CheckArray<CA$SUB_SUPP_BY>
IF StripANSI AND NOT(SkipSubAnsi) THEN
RawVendCode = TRIM(ListData<PrevRow,PrevCol>)
IF RawVendCode[1,2] = '1V' THEN
VendCode = RawVendCode[3,99]
END ELSE
TypeOver = ''
TypeOver<MTYPE$> = 'B&Rescan'
TypeOver<MTEXT$> = 'Scanned Code ':QUOTE(RawVendCode):' is not an ANSI Vendor Code'
Msg(@WINDOW,TypeOver,'LABEL_DATA_ERROR')
Set_Property(CtrlEntId,"SELPOS",PrevSelPos)
Set_Property(CtrlEntID,'INVALUE','',PrevSelPos)
RETURN
END
END ELSE
VendCode = ListData<PrevRow,PrevCol>
END
IF RowExists('SEMI_VEND_CODE', VendCode) OR SubSuppBy = 'C' ELSE
* Accept or Rescan message
TypeOver = ''
TypeOver<MTYPE$> = 'B&Rescan'
TypeOver<MTEXT$> = 'Vendor Code ':QUOTE(VendCode):' not found in':@TM:'Vendor Codes on file!'
Resp = Msg(@WINDOW,TypeOver,'LABEL_DATA_ERROR')
VendCode = '' ;* Clear entered field for a rescan
Set_Property(CtrlEntId,"SELPOS",PrevSelPos) ;* Cursor to Lot No for a rescan
RETURN
END
Set_Property(CtrlEntID,'INVALUE',VendCode,PrevSelPos)
*IF VendCode NE 'NA' THEN
ExpectedCode = Get_Property(@WINDOW,'@VENDOR_DEF')
IF VendCode NE ExpectedCode AND ExpectedCode NE '' THEN
void = Msg(@WINDOW,'','EXPECTED_VENDOR_CODE','',ExpectedCode:@FM:VendCode)
END
*END ELSE
* void = Msg(@WINDOW,'','NA_CODE_USED')
*END
ListArray = Get_Property(CtrlEntId,'ARRAY')
CheckArray = Get_Property(@WINDOW,'@CHECK_ARRAY')
TotalScannedQty = SUM(ListArray<COL$LQP_QTY>)
OpenQty = CheckArray<CA$LOT_QTY>
IF TotalScannedQty >= OpenQty THEN
Resp = Msg(@WINDOW,'','WO_REC_COMPLETE')
GOTO OK
END
END CASE
END
end
If Error_Services('HasError') then
TypeOver = ''
TypeOver<MTYPE$> = 'B&Rescan'
Message = Error_Services('GetMessage')
TypeOver<MTEXT$> = Message
Msg(@Window, TypeOver, 'LABEL_DATA_ERROR')
Set_Property(CtrlEntId, 'SELPOS', PrevSelPos)
Set_Property(CtrlEntID, 'INVALUE', '', PrevSelPos)
Error_Services('Clear')
end else
GOSUB Refresh
end
RETURN
* * * * * * *
OK:
* * * * * * *
CtrlEntID = @WINDOW:'.FIELD_RADIO'
CheckArray = Get_Property(@WINDOW,'@CHECK_ARRAY')
ControlSelection = Get_Property(CtrlEntID,'VALUE')
Ctrls = @WINDOW:'.LOT_QTY':@RM ; Props = 'VISIBLE':@RM
Ctrls := @WINDOW:'.LOT_QTY_PART':@RM ; Props := 'VISIBLE':@RM
Ctrls := @WINDOW:'.LOT_QTY_SUB_PART' ; Props := 'VISIBLE'
BEGIN CASE
CASE ControlSelection = 'LQ' ; Ctrl = @WINDOW:'.LOT_QTY'
CASE ControlSelection = 'LQP' ; Ctrl = @WINDOW:'.LOT_QTY_PART'
CASE ControlSelection = 'LQSP' ; Ctrl = @WINDOW:'.LOT_QTY_SUB_PART'
END CASE
ListData = Get_Property(Ctrl,'LIST')
TimeStamp = Get_Property(@WINDOW:'.RX_DTM','TEXT')
TimeStamp = ICONV(TimeStamp,'DT')
IF TimeStamp = '' THEN
ErrMsg('Invalid Received DateTime data entered. "mm/dd/yy hh:mm:ss" is the basic format.')
RETURN
END
CheckArray<CA$SCANNED_LOT_QTY> = '' ;* Clear scanned lot quantities column
LineCnt = 1
LOOP
TestVal = ListData<LineCnt,1>
UNTIL TestVal = ''
LotNo = TRIM(ListData<LineCnt,1>)
Qty = TRIM(ListData<LineCnt,2>)
IF ControlSelection = 'LQ' THEN
LOCATE LotNo IN CheckArray<CA$LOT_NO> USING @VM SETTING Pos THEN
OrderItemNo = CheckArray<CA$ITEM_NO,Pos>
CustPartNo = CheckArray<CA$CUST_PART_NO,Pos>
SubPartNo = CheckArray<CA$SUB_PART_NO,Pos>
CheckArray<CA$SCANNED_LOT_QTY,Pos> = CheckArray<CA$SCANNED_LOT_QTY,Pos> + Qty
END ELSE
* Accept or Rescan message
TypeOver = ''
TypeOver<MTYPE$> = 'B&Rescan'
TypeOver<MTEXT$> = 'Lot No ':QUOTE(LotNo):' not found in':@TM:'Order Item Lot Numbers!'
Resp = Msg(@WINDOW,TypeOver,'LABEL_DATA_ERROR')
LotNo = '' ;* Clear entered field for a rescan
Set_Property(CtrlEntId,"SELPOS",CA$LOT_NO:@FM:LineCnt) ;* Cursor to Lot No for a rescan
RETURN
END
END
IF ControlSelection = 'LQP' THEN
CustPartNo = TRIM(ListData<LineCnt,3>)
LOCATE LotNo IN CheckArray<CA$LOT_NO> USING @VM SETTING Pos THEN
OrderItemNo = CheckArray<CA$ITEM_NO,Pos>
SubPartNo = CheckArray<CA$SUB_PART_NO,Pos>
CheckArray<CA$SCANNED_LOT_QTY,Pos> = CheckArray<CA$SCANNED_LOT_QTY,Pos> + Qty
END ELSE
* Accept or Rescan message
TypeOver = ''
TypeOver<MTYPE$> = 'B&Rescan'
TypeOver<MTEXT$> = 'Lot No ':QUOTE(LotNo):' not found in':@TM:'Order Item Lot Numbers!'
Resp = Msg(@WINDOW,TypeOver,'LABEL_DATA_ERROR')
LotNo = '' ;* Clear entered field for a rescan
Set_Property(CtrlEntId,"SELPOS",CA$LOT_NO:@FM:LineCnt) ;* Cursor to Lot No for a rescan
RETURN
END
END
IF ControlSelection = 'LQSP' THEN
SubPartNo = TRIM(ListData<LineCnt,3>)
Vendor = TRIM(ListData<LineCnt,4>) ;* Added 7/14/2011 JCH for SAP
OrderItemNo = CheckArray<CA$ITEM_NO,1> ;* Changed 2/8/2010 from ' = 1 ' JCH
CustPartNo = CheckArray<CA$CUST_PART_NO,1>
END ELSE
Vendor = ''
END
Result<1,LineCnt> = LineCnt
Result<2,LineCnt> = LotNo ;* Lot No
Result<3,LineCnt> = Qty
Result<4,LineCnt> = CustPartNo ;* PartNo
Result<5,LineCnt> = SubPartNo ;* Substrate Part No
Result<6,LineCnt> = Vendor ;* Substrate Vendor Code
Result<7,LineCnt> = OCONV(TimeStamp,'DT')
Result<8,LineCnt> = @USER4
Result<9,LineCnt> = OrderItemNo
LineCnt += 1
REPEAT
IF ControlSelection NE 'LQSP' THEN
* Orders with Epi supplied substrates don't have any lot quantities to check against.
ProblemQtyLots = ''
FOR I = 1 TO COUNT(CheckArray<CA$LOT_NO>,@VM) + (CheckArray<CA$LOT_NO> NE '')
IF (CheckArray<CA$SCANNED_LOT_QTY,I> NE '') AND (CheckArray<CA$LOT_QTY,I> NE CheckArray<CA$SCANNED_LOT_QTY,I>) THEN
* Lot quantity mismatch
ProblemQtyLots<-1> = CheckArray<CA$LOT_NO,I>
END
NEXT I
IF ProblemQtyLots NE '' THEN
LineCnt = 1
LOOP
TestVal = ListData<LineCnt,1>
UNTIL TestVal = ''
LotNo = TRIM(ListData<LineCnt,1>)
LOCATE LotNo IN ProblemQtyLots USING @FM SETTING Pos THEN
stat = Send_Message(Ctrl,'COLOR_BY_POS',0,LineCnt,RED$) ;* Flag all the lines with lot numbers having qty problems
END
LineCnt += 1
REPEAT
ErrMsg('Lot Quantity(s) Scanned do not match Order Item Lot Quantity(s)!||Review and rescan highlighted items.')
RETURN
END
END ELSE
*
END
NumRows = DCount(Result, @FM)
NullFound = False$
For LineIndex = 1 to NumRows
Row = Result<LineIndex>
NumVals = DCount(Row, @VM)
For ValIndex = 1 to NumVals
Val = Row<0, ValIndex>
If Val EQ '' then NullFound = True$
Next ValIndex
Until NullFound
Next LineIndex
If NullFound EQ True$ then
ErrMsg('Missing value found in scanned data! Verify your labels and restart your scan operation.')
Result = 'Cancel'
end
ScanResult = Result
Swap @VM with ' | ' in ScanResult
LogData = ''
LogData<1> = LoggingDTM
LogData<2> = @User4
LogData<3> = ScanResult
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
End_Dialog(@WINDOW,Result)
RETURN

View File

@ -0,0 +1,438 @@
COMPILE FUNCTION Comm_Dialog_WO_Scan_Substrates(Method, Parm1)
#pragma precomp SRP_PreCompiler
/*
Commuter module for Dialog_WO_Scan window.
08/12/2004 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Set_Status, ErrMsg, Extract_SI_Keys
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Msg
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Send_Message
$INSERT MSG_EQUATES
$INSERT APPCOLORS
EQU CRLF$ TO \0D0A\
EQU COL$LQP_LOT TO 1 ;* Equates for Lot_Qty... edit table controls used to scan in label data
EQU COL$LQP_QTY TO 2
EQU COL$LQP_PART TO 3 ;* This is either Cust Part No OR Substrate Part Number depending on which control is visible
EQU CA$ITEM_NO TO 1 ;* Equates for Checking Array passed to Scan routine
EQU CA$LOT_NO TO 2
EQU CA$LOT_QTY TO 3
EQU CA$CUST_PART_NO TO 4
EQU CA$SUB_PART_NO TO 5
EQU CA$SCANNED_LOT_QTY TO 6
EQU CA$VERIFY_PART_NO TO 7
ErrTitle = 'Error in Comm_Dialog_WO_Scan'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Method = 'Create' ; GOSUB Create
CASE Method = 'OK' ; GOSUB OK
CASE Method = 'Cancel' ; GOSUB Cancel
CASE Method = 'LQP' ; GOSUB LQP
CASE 1
ErrMsg(ErrTitle:@SVM:'Unknown method ':QUOTE(Method):' passed to routine.')
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
OrderNo = Parm1[1,@FM]
CheckArray = FIELD(Parm1,@FM,2,999)
Set_Property(@WINDOW:'@ORDER_NO',OrderNo)
Set_Property(@WINDOW,'@CHECK_ARRAY',CheckArray)
obj_AppWindow('Create')
TimeStamp = OCONV(Date(),'D4/'):' ':OCONV(Time(),'MTS')
Set_Property(@WINDOW:'.RX_DTM','DEFPROP',TimeStamp)
Set_Property(@WINDOW,'FOCUS',@WINDOW:'.RX_DTM')
Set_Property(@WINDOW:'.RX_DTM','SELECTION',1:@FM:65534)
GOSUB Refresh
* * * * * * *
Close:
* * * * * * *
* * * * * * *
Cancel:
* * * * * * *
End_Dialog(@WINDOW,'Cancel')
RETURN
* * * * * * *
Refresh:
* * * * * * *
ListArray = Get_Property(CtrlEntId,'ARRAY')
CheckArray = Get_Property(@WINDOW,'@CHECK_ARRAY')
TotalScannedQty = SUM(ListArray<COL$LQP_QTY>)
TotalOrderQty = SUM(CheckArray<CA$LOT_QTY>)
Set_Property(@WINDOW:'.ORDER_QTY','TEXT',OCONV(TotalOrderQty,'MD0,'))
Set_Property(@WINDOW:'.SCANNED_QTY','TEXT',OCONV(TotalScannedQty,'MD0,'))
IF TotalScannedQty = TotalOrderQty THEN
Set_Property(@WINDOW:'.SCANNED_QTY','BACKCOLOR',GREEN$)
END ELSE
Set_Property(@WINDOW:'.SCANNED_QTY','BACKCOLOR',RED$)
END
RETURN
* * * * * * *
LQP:
* * * * * * *
CtrlEntID = Get_Property(@WINDOW,'FOCUS')
StripANSI = Get_Property(@WINDOW:'.STRIP_ANSI','CHECK')
SkipSubANSI = Get_Property(@WINDOW:'.SKIP_SUBSTRATE_ANSI','CHECK')
CheckArray = Get_Property(@WINDOW,'@CHECK_ARRAY')
IF CtrlEntID = @WINDOW:'.LOT_QTY' THEN ColCnt = 2 ELSE ColCnt = 3
PrevSelPos = Get_Property(CtrlEntId,"PREVSELPOS")
PrevCol = PrevSelPos<1>
PrevRow = PrevSelPos<2>
CurrPos = Get_Property(CtrlEntId,'SELPOS')
CurrCol = CurrPos<1>
CurrRow = CurrPos<2>
ListData = Get_Property(CtrlEntId,'LIST')
IF ListData<CurrRow,CurrCol> = '' THEN
ColPointer = CurrCol
LinePointer = CurrRow
* Find the first non-empty cell
LOOP
Test = ListData<LinePointer,(ColPointer) >
UNTIL Test NE '' OR (LinePointer = 0 AND ColPointer = 1)
ColPointer -= 1
IF ColPointer = 0 THEN
ColPointer = ColCnt
LinePointer -= 1
END
REPEAT
* Move one past the non empty cell
BEGIN CASE
CASE LinePointer = 0
* Empty Table
LinePointer = 1
CoilPointer = 1
CASE ColPointer = ColCnt
LinePointer += 1
ColPointer = 1
CASE 1
ColPointer += 1
END CASE
Set_Property(CtrlEntId,"SELPOS",ColPointer:@FM:LinePointer)
END
IF ListData<PrevRow,PrevCol> NE '' THEN
BEGIN CASE
CASE PrevCol = COL$LQP_LOT
IF StripANSI THEN
RawLot = TRIM(ListData<PrevRow,PrevCol>)
IF RawLot[1,2] = '1T' THEN
LotNo = RawLot[3,99]
END ELSE
TypeOver = ''
TypeOver<MTYPE$> = 'B&Rescan'
TypeOver<MTEXT$> = 'Scanned Code ':QUOTE(RawLot):' is not an ANSI Lot No.'
Msg(@WINDOW,TypeOver,'LABEL_DATA_ERROR')
Set_Property(CtrlEntId,"SELPOS",PrevSelPos)
Set_Property(CtrlEntID,'INVALUE','',PrevSelPos)
RETURN
END
END ELSE
LotNo = TRIM(ListData<PrevRow,PrevCol>)
END
IF CtrlEntID NE @WINDOW:'.LOT_QTY_SUB_PART' THEN
* Don't check Customer Lot Numbers if scanning substrates
LOCATE LotNo IN CheckArray<CA$LOT_NO> USING @VM SETTING Pos ELSE
* Accept or Rescan message
TypeOver = ''
TypeOver<MTYPE$> = 'B&Rescan'
TypeOver<MTEXT$> = 'Lot No ':QUOTE(LotNo):' not found in':@TM:'Order Item Lot Numbers!'
Resp = Msg(@WINDOW,TypeOver,'LABEL_DATA_ERROR')
LotNo = '' ;* Clear entered field for a rescan
Set_Property(CtrlEntId,"SELPOS",PrevSelPos) ;* Cursor to Lot No for a rescan
END
END
Set_Property(CtrlEntID,'INVALUE',LotNo,PrevSelPos)
CASE PrevCol = COL$LQP_QTY
IF StripANSI THEN
RawLotQty = ListData<PrevRow,PrevCol>
IF RawLotQty[1,1] = 'Q' THEN
LotQty = RawLotQty[2,99]
END ELSE
TypeOver = ''
TypeOver<MTYPE$> = 'B&Rescan'
TypeOver<MTEXT$> = 'Scanned Code ':QUOTE(RawLotQty):' is not an ANSI Quantity'
Msg(@WINDOW,TypeOver,'LABEL_DATA_ERROR')
Set_Property(CtrlEntId,"SELPOS",PrevSelPos)
Set_Property(CtrlEntID,'INVALUE','',PrevSelPos)
RETURN
END
END ELSE
LotQty = ListData<PrevRow,PrevCol>
END
IF NOT(NUM(LotQty)) THEN
* Accept or Rescan message
TypeOver = ''
TypeOver<MTYPE$> = 'B&Rescan'
TypeOver<MTEXT$> = 'Lot Qty ':QUOTE(LotQty):' is not a number!'
Resp = Msg(@WINDOW,TypeOver,'LABEL_DATA_ERROR')
LotNo = '' ;* Clear entered field for a rescan
Set_Property(CtrlEntId,"SELPOS",PrevSelPos) ;* Cursor to Lot No for a rescan
END
Set_Property(CtrlEntID,'INVALUE',LotQty,PrevSelPos)
CASE PrevCol = COL$LQP_PART
IF StripANSI AND NOT(SkipSubAnsi) THEN ;***************************************
RawPartNo = TRIM(ListData<PrevRow,PrevCol>)
IF RawPartNo[1,1] = 'P' OR RawPartNo[1,1] = 'S' THEN
PartNo = RawPartNo[2,99]
END ELSE
TypeOver = ''
TypeOver<MTYPE$> = 'B&Rescan'
TypeOver<MTEXT$> = 'Scanned Code ':QUOTE(RawPartNo):' is not an ANSI Part No'
Msg(@WINDOW,TypeOver,'LABEL_DATA_ERROR')
Set_Property(CtrlEntId,"SELPOS",PrevSelPos)
Set_Property(CtrlEntID,'INVALUE','',PrevSelPos)
RETURN
END
END ELSE
PartNo = ListData<PrevRow,PrevCol>
END
IF CtrlEntID = @WINDOW:'.LOT_QTY_PART' THEN
* Check Customer Part Numbers
LOCATE PartNo IN CheckArray<CA$VERIFY_PART_NO> USING @VM SETTING Pos THEN
PartNo = CheckArray<CA$CUST_PART_NO,Pos>
END ELSE
* Accept or Rescan message
TypeOver = ''
TypeOver<MTYPE$> = 'B&Rescan'
TypeOver<MTEXT$> = 'Part No ':QUOTE(PartNo):' not found in':@TM:'Order Customer Part Numbers!'
Resp = Msg(@WINDOW,TypeOver,'LABEL_DATA_ERROR')
PartNo = '' ;* Clear entered field for a rescan
Set_Property(CtrlEntId,"SELPOS",PrevSelPos) ;* Cursor to Lot No for a rescan
END
END ELSE
* Check Substrate Part Numbers
LOCATE PartNo IN CheckArray<CA$SUB_PART_NO> USING @VM SETTING Pos ELSE
* Accept or Rescan message
TypeOver = ''
TypeOver<MTYPE$> = 'B&Rescan'
TypeOver<MTEXT$> = 'Part No ':QUOTE(PartNo):' not found in':@TM:'Order Substrate Part Numbers!'
Resp = Msg(@WINDOW,TypeOver,'LABEL_DATA_ERROR')
PartNo = '' ;* Clear entered field for a rescan
Set_Property(CtrlEntId,"SELPOS",PrevSelPos) ;* Cursor to Lot No for a rescan
END
END ;* End of check for Customer supplied or Inventory substrate part number
Set_Property(CtrlEntID,'INVALUE',PartNo,PrevSelPos)
END CASE
END
GOSUB Refresh
RETURN
* * * * * * *
OK:
* * * * * * *
CtrlEntID = @WINDOW:'.FIELD_RADIO'
CheckArray = Get_Property(@WINDOW,'@CHECK_ARRAY')
ControlSelection = Get_Property(CtrlEntID,'VALUE')
Ctrls = @WINDOW:'.LOT_QTY':@RM ; Props = 'VISIBLE':@RM
Ctrls := @WINDOW:'.LOT_QTY_PART':@RM ; Props := 'VISIBLE':@RM
Ctrls := @WINDOW:'.LOT_QTY_SUB_PART' ; Props := 'VISIBLE'
BEGIN CASE
CASE ControlSelection = 'LQ' ; Ctrl = @WINDOW:'.LOT_QTY'
CASE ControlSelection = 'LQP' ; Ctrl = @WINDOW:'.LOT_QTY_PART'
CASE ControlSelection = 'LQSP' ; Ctrl = @WINDOW:'.LOT_QTY_SUB_PART'
END CASE
ListData = Get_Property(Ctrl,'LIST')
TimeStamp = Get_Property(@WINDOW:'.RX_DTM','TEXT')
TimeStamp = ICONV(TimeStamp,'DT')
IF TimeStamp = '' THEN
ErrMsg('Invalid Received DateTime data entered. "mm/dd/yy hh:mm:ss" is the basic format.')
RETURN
END
* TimeStamp = ICONV(OCONV(Date(),'D4/'):' ':OCONV(Time(),'MTS'),'DT')
CheckArray<CA$SCANNED_LOT_QTY> = '' ;* Clear scanned lot quantities column
LineCnt = 1
LOOP
TestVal = ListData<LineCnt,1>
UNTIL TestVal = ''
LotNo = TRIM(ListData<LineCnt,1>)
Qty = TRIM(ListData<LineCnt,2>)
IF ControlSelection = 'LQ' THEN
LOCATE LotNo IN CheckArray<CA$LOT_NO> USING @VM SETTING Pos THEN
OrderItemNo = CheckArray<CA$ITEM_NO,Pos>
CustPartNo = CheckArray<CA$CUST_PART_NO,Pos>
SubPartNo = CheckArray<CA$SUB_PART_NO,Pos>
CheckArray<CA$SCANNED_LOT_QTY,Pos> = CheckArray<CA$SCANNED_LOT_QTY,Pos> + Qty
END ELSE
* Accept or Rescan message
TypeOver = ''
TypeOver<MTYPE$> = 'B&Rescan'
TypeOver<MTEXT$> = 'Lot No ':QUOTE(LotNo):' not found in':@TM:'Order Item Lot Numbers!'
Resp = Msg(@WINDOW,TypeOver,'LABEL_DATA_ERROR')
LotNo = '' ;* Clear entered field for a rescan
Set_Property(CtrlEntId,"SELPOS",COL$LOT_NO:@FM:LineCnt) ;* Cursor to Lot No for a rescan
RETURN
END
END
IF ControlSelection = 'LQP' THEN
CustPartNo = TRIM(ListData<LineCnt,3>)
LOCATE LotNo IN CheckArray<CA$LOT_NO> USING @VM SETTING Pos THEN
OrderItemNo = CheckArray<CA$ITEM_NO,Pos>
SubPartNo = CheckArray<CA$SUB_PART_NO,Pos>
CheckArray<CA$SCANNED_LOT_QTY,Pos> = CheckArray<CA$SCANNED_LOT_QTY,Pos> + Qty
END ELSE
* Accept or Rescan message
TypeOver = ''
TypeOver<MTYPE$> = 'B&Rescan'
TypeOver<MTEXT$> = 'Lot No ':QUOTE(LotNo):' not found in':@TM:'Order Item Lot Numbers!'
Resp = Msg(@WINDOW,TypeOver,'LABEL_DATA_ERROR')
LotNo = '' ;* Clear entered field for a rescan
Set_Property(CtrlEntId,"SELPOS",COL$LOT_NO:@FM:LineCnt) ;* Cursor to Lot No for a rescan
RETURN
END
END
IF ControlSelection = 'LQSP' THEN
SubPartNo = TRIM(ListData<LineCnt,3>)
OrderItemNo = CheckArray<CA$ITEM_NO,1> ;* Changed 2/8/2010 from ' = 1 ' JCH
CustPartNo = CheckArray<CA$CUST_PART_NO,1>
END
Result<1,LineCnt> = LineCnt
Result<2,LineCnt> = LotNo ;* Lot No
Result<3,LineCnt> = Qty
Result<4,LineCnt> = CustPartNo ;* PartNo
Result<5,LineCnt> = SubPartNo ;* Substrate Part No
Result<6,LineCnt> = OCONV(TimeStamp,'DT')
Result<7,LineCnt> = @USER4
Result<8,LineCnt> = OrderItemNo
LineCnt += 1
REPEAT
IF ControlSelection NE 'LQSP' THEN
* Orders with Epi supplied substrates don't have any lot quantities to check against.
ProblemQtyLots = ''
FOR I = 1 TO COUNT(CheckArray<CA$LOT_NO>,@VM) + (CheckArray<CA$LOT_NO> NE '')
IF (CheckArray<CA$SCANNED_LOT_QTY,I> NE '') AND (CheckArray<CA$LOT_QTY,I> NE CheckArray<CA$SCANNED_LOT_QTY,I>) THEN
* Lot quantity mismatch
ProblemQtyLots<-1> = CheckArray<CA$LOT_NO,I>
END
NEXT I
IF ProblemQtyLots NE '' THEN
LineCnt = 1
LOOP
TestVal = ListData<LineCnt,1>
UNTIL TestVal = ''
LotNo = TRIM(ListData<LineCnt,1>)
LOCATE LotNo IN ProblemQtyLots USING @FM SETTING Pos THEN
stat = Send_Message(Ctrl,'COLOR_BY_POS',0,LineCnt,RED$) ;* Flag all the lines with lot numbers having qty problems
END
LineCnt += 1
REPEAT
ErrMsg('Lot Quantity(s) Scanned do not match Order Item Lot Quantity(s)!||Review and rescan highlighted items.')
RETURN
END
END ELSE
*
END
End_Dialog(@WINDOW,Result)
RETURN

View File

@ -0,0 +1,181 @@
COMPILE FUNCTION Comm_Epi_Susceptor(Instruction, Parm1)
/*
Commuter module for Epi_Susceptor Window
10/31/2005 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Send_Event, Set_Status, Center_Window,Print_Vend_CofA
DECLARE SUBROUTINE ErrMsg, Send_Message, Set_Property, Send_Event, Btree.Extract, obj_AppWindow
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Utility, Center_Window, Popup, Collect.Ixvals
DECLARE FUNCTION Send_Message
$INSERT POPUP_EQUATES
$INSERT APPCOLORS
EQU CRLF$ TO \0D0A\
EQU COL$POCKET TO 1
EQU COL$ZONE TO 2
EQU COL$USAGE TO 3
ErrTitle = 'Error in Comm_Epi_Susceptor'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Instruction = 'Create' ; GOSUB Create
CASE Instruction = 'Refresh' ; GOSUB Refresh
CASE Instruction = 'Clear' ; GOSUB Clear
CASE Instruction = 'Read' ; GOSUB Read
CASE Instruction = 'Write' ; GOSUB Write
CASE Instruction = 'Delete' ; GOSUB Delete
CASE Instruction = 'LUConfigID' ; GOSUB LUConfigID
CASE 1
ErrorMsg = 'Unknown Instruction passed to routine.'
ErrMsg(ErrorMsg)
END CASE
RETURN Result
* * * * * * *
Create:
* * * * * * *
Center_Window(@WINDOW)
EQU DROPDOWN_STYLE$ TO 131072
ReactorStyles = Send_Message(@WINDOW:'.POCKET_NO','COLSTYLE',0,'')
ReactorStyles<COL$USAGE> = BitOr(ReactorStyles<COL$USAGE>,DROPDOWN_STYLE$)
Send_Message(@WINDOW:'.POCKET_NO','COLSTYLE',0,ReactorStyles)
Send_Message(@WINDOW:'.POCKET_NO','COLFORMAT',COL$USAGE,'':@VM:'TEST')
IF Parm1 NE '' THEN
obj_AppWindow('LoadFormKeys',@WINDOW:@RM:Parm1)
END
GOSUB Refresh
RETURN
* * * * * * *
Read:
* * * * * * *
GOSUB Refresh
RETURN
* * * * * * *
Clear:
* * * * * * *
* * * * * * *
Refresh:
* * * * * * *
* QBF buttons
Ctrls = @WINDOW:'.QBF_FIRST_FIX':@RM ; Props = 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_PREV_FIX':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_ABS_FIX':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_NEXT_FIX':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_LAST_FIX':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_STOP_FIX' ; Props := 'ENABLED'
IF Get_Property(@WINDOW,'QBFLIST') = '' THEN
Vals = 0:@RM:0:@RM:0:@RM:0:@RM:0:@RM:0
END ELSE
Vals = 1:@RM:1:@RM:1:@RM:1:@RM:1:@RM:1
END
Set_Property(Ctrls,Props,Vals)
* Turn edit table symbolic column backgrounds to green
ETSymbolics = Get_Property(@WINDOW,'@ET_SYMBOLICS') ;* Loaded during 'Create' in obj_Appwindow
ETCtrls = ETSymbolics<1>
ETCols = ETSymbolics<2>
FOR I = 1 TO COUNT(ETCtrls,@VM) + (ETCtrls NE '')
ETCtrl = ETCtrls<1,I>
ETList = Get_Property(ETCtrl,'LIST')
FOR Line = 1 TO COUNT(ETList,@FM) + (ETList NE '')
IF ETList<Line,1> NE '' THEN
FOR N = 1 TO COUNT(ETCols<1,I>,@SVM) + (ETCols<1,I> NE '')
stat = Send_Message(ETCtrl,'COLOR_BY_POS',ETCols<1,I,N>,Line,GREEN$)
NEXT N
END
NEXT I
NEXT I
RETURN
RETURN
* * * * * * *
Write:
* * * * * * *
Result = 1 ;* Security hook
RETURN
* * * * * * *
Delete:
* * * * * * *
ErrMsg('Records may not be modified.')
Result = 0 ;* Security hook
RETURN
* * * * * * *
LUConfigID:
* * * * * * *
EpiSusID = Popup(@WINDOW,'','EPI_SUSCEPTOR')
IF Get_Status(errCode) THEN
ErrMsg(errCode)
END
IF EpiSusID NE '' THEN obj_Appwindow('LUValReturn',EpiSusID:@RM:@WINDOW:'.CONFIG_ID') ;* Loads form key
RETURN

Some files were not shown because too many files have changed in this diff Show More