added LSL2 stored procedures
This commit is contained in:
64
LSL2/STPROC/WO_DAILY_VALID.txt
Normal file
64
LSL2/STPROC/WO_DAILY_VALID.txt
Normal file
@ -0,0 +1,64 @@
|
||||
compile subroutine wo_daily_valid(ConvType, DataIo, Branch, ReturnedValue)
|
||||
|
||||
|
||||
$insert logical
|
||||
$insert quote_equ
|
||||
$insert msg_equates
|
||||
$insert wo_log_equ
|
||||
declare function msg, get_property, set_property, fieldcount
|
||||
declare subroutine extract_si_keys
|
||||
|
||||
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)
|
||||
|
||||
ReturnedValue = DataIo
|
||||
status() = Valid$
|
||||
*
|
||||
|
||||
BEGIN CASE
|
||||
CASE ConvType = 'ICONV'
|
||||
|
||||
* Keep this comment from Bryce, the code is gone but the comment is to good to toss...
|
||||
* check number of seperate layers - god this fucking layering keeps haunting me.
|
||||
|
||||
Bad = false$
|
||||
CONVERT '.' TO '' IN DataIo
|
||||
IF NUM( DataIo ) THEN
|
||||
IF LEN(DataIo) = 7 THEN
|
||||
WONo = DataIo[1,6]:'.':DataIo[7,1]
|
||||
WOStepKey = DataIo[1,6]:'*':DataIo[7,1]
|
||||
END ELSE
|
||||
WONo = DataIo
|
||||
WOStepKey = DataIo:'*1'
|
||||
END
|
||||
IF RowExists('WO_STEP',WOStepKey) THEN
|
||||
WOCustNo = XLATE('WO_LOG',WONo[1,6],WO_LOG_CUST_NO$,'X')
|
||||
ReturnedValue = WONo:' ':XLATE( 'COMPANY', WOCustNo, 'ABBREV_OR_CO_NAME', 'X' )
|
||||
END ELSE
|
||||
Bad = true$
|
||||
END
|
||||
END ELSE
|
||||
Bad = true$
|
||||
END
|
||||
|
||||
IF Bad THEN
|
||||
MsgInfo = ''
|
||||
MsgInfo<mtext$> = WONo:' is not a valid Work Order...'
|
||||
MsgInfo<micon$> = '!'
|
||||
* let it be valid just warn
|
||||
Void = msg( '', MsgInfo )
|
||||
status() = invalid_nomsg$
|
||||
END
|
||||
|
||||
CASE ConvType = 'OCONV'
|
||||
ReturnedValue = DataIo
|
||||
|
||||
CASE otherwise$
|
||||
ReturnedValue = ''
|
||||
status() = invalid_conv$
|
||||
|
||||
END CASE
|
||||
RETURN
|
Reference in New Issue
Block a user