203 lines
5.3 KiB
Plaintext
203 lines
5.3 KiB
Plaintext
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
|