# ######################################################### # takestock-7.rul rule file for TakeStock application # # Requires, at least, UnForm version 7.0.09 # ######################################################### # This rule file is provided "AS IS", without warranty. # # Under no circumstances will the publisher be liable # # for consequential damages resulting from the use or # # inability to use the contents. # ######################################################### # # NOTE: SDSI has attempted to create # rule sets that are generic enough # that they cover as many options as # possible.If you find situations that # the rule set is not handling properly, # do not hesitate to contact us and # provide us with a sample text file # showing the problem. We will be # happy to provide the "correction" # in a timely manner. # The above assumes that no modifications # have been made to the application. # # # Modification history # # Last modified 02/05/2007 - BCJ # # 02/05/2007 -- bcj # added document title handling in rule sets, # eg. invoice/credit memo # rewrote statement rule set # # # completed & approved rule sets # AP - checks # AR - statements # IC - transfer BOL, transfer ticket # PO - purchase order # PR - production # SO - order acknowledgement,pick ticket # SO - counter invoice, invoice w/backorders # SO - quote, invoice without backorders # # Global constants ####################################### # Adjust the following constants to correct files and info # if you use the subst file then replace each constant # with subst info in rule sets below global COMP_NAME="Company Name: Edit rule file" global COMP_ADDR1="Address 1" global COMP_ADDR2="Address 2" global COMP_ADDR3="Address 3" global COMP_PHONES="###-###-#### Fax: ###-###-####" global COMP_EMAIL="E-Mail: xxxx@xxxxxxxxxxxxxxx.com" global COMP_WEBSITE="Website: www.xxxxxxxxxxxxxxx.com" # Merge rule file that contains all "extra" # features, eg. archiving, emailing, etc. global MERGE_FILE="takestock-7m.rul" # Base engine for document handling, eg. emailing # use full path if not in UnForm directory global DOC_ENGINE="eDocEngine.rul" # A/P check constants global AP_BANK_NAME="One Major Bank" global AP_BANK_ADDR1="1 Major Blvd" global AP_BANK_ADDR2="Major City CA 90123" global AP_ROUTING="12-345/6789" global AP_MICR_ACCOUNTNO=":123456789:9999-1234<34>" global AP_MICR="micr" # remove # to turn on global AP_NO_STUBS=2 # 1=vendor stub only # 2=vendor stub and payor stub # check signature on AP/PR checks, global SIGNATURE_IMAGE="#image" # remove # to turn on global SIGNATURE="" # insert signature file name # Logos global LOGO_IMAGE="image" global COMP_LOGO="sdsilogo.pcl" # watermarks global WATERMARK_SHADE=10 # adjust to desired darkness global WATERMARK="text" # remove # to turn on # Turn to "#gs on" for old style pcl shading global GSON="gs on" # date mask for detects - 10/17/01 global DATEMASK="[0-1][0-9]/[0-3][0-9]/[0-9][0-9][0-9][0-9]" # US dt #global DATEMASK="[0-3][0-9]/[0-1][0-9]/[0-9][0-9]" # Can dt # main heading constants global HFONT= univers,11,fit global HLFONT= HFONT,left global HCFONT= HFONT,center global HRFONT= HFONT,right global HSHADE= 30 # bold global HBFONT= HFONT,bold global HBLFONT=HBFONT,left global HBCFONT=HBFONT,center global HBRFONT=HBFONT,right # internal heading font constants (ribbons, detail headers) global IFONT= univers,8,italic,fit global ILFONT= IFONT,left global ICFONT= IFONT,center global IRFONT= IFONT,right global ISHADE= 20 # bold global IBFONT= IFONT,bold global IBLFONT=IBFONT,left global IBCFONT=IBFONT,center global IBRFONT=IBFONT,right # detail data font constants global DFONT= cgtimes,9 global DLFONT= DFONT,left global DCFONT= DFONT,center global DRFONT= DFONT,right global DSHADE= 10 # bold global DBFONT= DFONT,bold global DBLFONT=DBFONT,left global DBCFONT=DBFONT,center global DBRFONT=DBFONT,right # default major section box size global MBOXSIZE=5 # global constant for get trim to make it easier to understand # eg. get(1,10,20,"UFTRIM") global UFTRIM="Y" # global constant for save line feed in mget and mcut global UFSAVELF="Y" [AR Statement] dsn_sample "/u0/unform_test/takestock/txt/ar_stmtC1011P.txt" detect 88,8,"~ DATEMASK" detect 98,6,"~[0-9]" detect 2,10,"To:" # set up document constants local MAXCOLS=101 # max cols to output local MAXRCOLS=100 # MAXCOLS-1 local LEFTCOL=1 # left vertical line local RIGHTCOL=101 # right vertical line local MAXROWS=66 # max rows to output cols MAXCOLS # max output columns rows MAXROWS # max output rows local CUSTOMER_COPY=1 local REMITTANCE_COPY=2 local SCANNING_COPY=3 local OFFICE_COPY=4 local MAX_COPIES=4 pcopies MAX_COPIES portrait dpi 600 # see global constant above GSON # graphical shading title "Statement" # view in pdf properties prejob { dim copy_title$[MAX_COPIES] if MAX_COPIES>=1 then copy_title$[CUSTOMER_COPY]="Customer Copy" if MAX_COPIES>=2 then copy_title$[REMITTANCE_COPY]="Remittance Copy" if MAX_COPIES>=3 then copy_title$[SIGNING_COPY]="" if MAX_COPIES>=4 then copy_title$[OFFICE_COPY]="Office Copy" doc_title$="STATEMENT" } prepage { xrow=14;xcols=45 merge "zMrg get zip" xziplen=len(xzip$) if xziplen=5 or xziplen=9 or xziplen=11 then : x$="barcode 11,14.25,"+$22$+xzip$+$22$+",900,12.0,2" exec(x$) endif # get company info xcol=3,xrow=3,xcols=35,xrows=4 merge "zMrg get company info" # check for continued xcol=88,xrow=58 merge "zMrg check continued" if left(cont$,4)<>"Cont" then : x$="text 82,56,"+$22$+"Balance"+$22$+",IBRFONT,11,cols=18 exec(x$) x$="cbox LEFTCOL,55,RIGHTCOL,59,MBOXSIZE,crows=57::HSHADE,ccols=17 33 49 65 81" exec(x$) detrow=54 msg$=mcut(1,51,MAXCOLS,5,"","UFSAVELF","UFTRIM") else x$=mset(LEFTCOL,56,RIGHTCOL,59,"") exec(x$) detrow=66 endif } # header section cerase 1,1,130,18 cerase 102,1,250,MAXROWS merge "zMrg form header" # right header text 86,11,"Page",IFONT,10 text 86,13,"Date",IFONT,10 text 94,11,{get(95,6,6,"UFTRIM")},DBFONT,10 text 94,13,{get(89,8,10,"UFTRIM")},DBFONT,10 # to section text 2,11,"To",ICFONT,10,cols=8 text 2,12,{get(12,10,8,"UFTRIM")},DBCFONT,10,cols=8 text 11,11,{mget(12,11,40,5,"UFSAVELF","UFTRIM")},DBFONT,10 # detail cbox LEFTCOL,16,RIGHTCOL,{detrow},MBOXSIZE,crows=18::DSHADE,ccols=12 19 35 46 60 text 2,17,"Invoice Date",ICFONT,cols=10 text 13,17,"Invoice #",IFONT text 20,17,"Customer PO#",ICFONT,cols=15 text 36,17,"Due Date",ICFONT,cols=10 text 47,17,"Amount",IRFONT,cols=13 text 61,17,"Balance",IRFONT,cols=40 cfont 2,19,11,50,DBCFONT cfont 13,19,18,50,DBLFONT cfont 20,19,34,50,DCFONT cfont 36,19,45,50,DCFONT cfont 47,19,59,50,DBRFONT cfont 61,19,MAXRCOLS,50,DBRFONT # watermark - large font with light shading WATERMARK 1,{detrow-1},{doc_title$},cgtimes,120,shade=WATERMARK_SHADE,center,cols=MAXCOLS, fit,spacing=1 # memo section text 2,60,{msg$},IFONT # footer # 17 33 49 65 81 cfont 2,56,16,56,IRFONT,10 cfont 18,56,32,56,IRFONT,10 cfont 34,56,48,59,IRFONT,10 cfont 50,56,64,56,IRFONT,10 cfont 66,56,80,56,IRFONT,10 cfont 2,58,16,58,DBRFONT,10 cfont 18,58,32,58,DBRFONT,10 cfont 34,58,48,58,DBRFONT,10 cfont 50,58,64,58,DBRFONT,10 cfont 66,58,80,58,DBRFONT,10 cfont 82,58,MAXRCOLS,58,DBRFONT,11 text 1,{MAXROWS+.5},{cont$},HBRFONT,cols=MAXRCOLS text 1,{MAXROWS+.5},{copy_title$[copy]},HBCFONT,cols=MAXRCOLS merge "AR Statement","MERGE_FILE" [IC Transfer Ticket] dsn_sample "/u0/unform_test/takestock/txt/ic_trans_multi.txt" #dsn_sample "/u0/unform_test/takestock/txt/ic_trans.txt" detect 94,5,"^ Transfer" detect 116,9,"~ DATEMASK" detect 126,7,"~[0-9]" # set up document constants local MAXCOLS=132 # max cols to output local MAXRCOLS=131 # MAXCOLS-1 local LEFTCOL=1 # left vertical line local RIGHTCOL=132 # right vertical line local MAXROWS=63 # max rows to output cols MAXCOLS # max output columns rows MAXROWS # max output rows local WAREHOUSE_COPY=1 local SCANNING_COPY=2 local OFFICE_COPY=3 local MAX_COPIES=3 pcopies MAX_COPIES portrait dpi 600 # see global constant above GSON # graphical shading title "Transfer Ticket" # view in pdf properties prejob { dim copy_title$[MAX_COPIES] if MAX_COPIES>=1 then copy_title$[WAREHOUSE_COPY]="Warehouse Copy" if MAX_COPIES>=2 then copy_title$[SIGNING_COPY]="" if MAX_COPIES>=3 then copy_title$[OFFICE_COPY]="Office Copy" doc_title$="TRANSFER TICKET" } prepage { xrow=14;xcols=40 merge "zMrg get zip" xziplen=len(xzip$) if xziplen=5 or xziplen=9 or xziplen=11 then : x$="barcode 11,15.25,"+$22$+xzip$+$22$+",900,12.0,2" exec(x$) endif # get company info xcol=3,xrow=5,xcols=35,xrows=4 merge "zMrg get company info" # check for continued xcol=105,xrow=61 merge "zMrg check continued" if left(cont$,4)="Cont" then x$=mset(90,61,30,2,"") } # erase vertical lines cerase 1,1,1,MAXROWS # ribbon 1 cerase 23,17,23,21 cerase 39,17,39,21 cerase 55,17,55,21 cerase 66,17,66,21 cerase 87,17,87,21 cerase 95,17,95,21 cerase 110,17,110,21 # detail - not all columns have | so use # conditional erase erase "|@22,21,22,60",0,0,1,1 erase "|@65,21,65,60",0,0,1,1 erase "|@76,21,76,60",0,0,1,1 erase "|@86,21,86,60",0,0,1,1 erase "|@99,21,99,60",0,0,1,1 erase "|@103,21,103,60",0,0,1,1 erase "|@115,21,115,60",0,0,1,1 erase "|@120,21,120,60",0,0,1,1 # footer cerase 103,61,103,61 cerase 115,61,115,61 cerase MAXCOLS,1,MAXCOLS,MAXROWS # erase horizontal lines cerase 1,2,MAXCOLS,2 cerase 1,17,MAXCOLS,17 cerase 1,19,MAXCOLS,19 cerase 1,21,MAXCOLS,21 cerase 1,23,MAXCOLS,23 cerase 1,25,MAXCOLS,25 cerase 1,60,MAXCOLS,60 cerase 103,62,MAXCOLS,62 # header section cerase 1,1,MAXCOLS,17 cbox LEFTCOL,1,RIGHTCOL,{MAXROWS-.5},MBOXSIZE merge "zMrg form header" text 1,4,{get(56,3,8,"UFTRIM")},HRFONT,12,cols=MAXRCOLS text 1,5,{get(77,3,7,"UFTRIM")},HRFONT,cols=MAXRCOLS # right header cbox 103,5,RIGHTCOL,11,MBOXSIZE,crows=7 9,ccols=113::ISHADE text 104,6,"Order",IFONT,10 text 104,8,"Page",IFONT,10 text 104,10,"Date",IFONT,10 text 114,6,{get(119,5,10,"UFTRIM")},DBFONT,10 text 114,8,{get(120,7,8,"UFTRIM")},DBFONT,10 text 114,10,{get(117,9,10,"UFTRIM")},DBFONT,10 # ship to section cbox LEFTCOL,11,RIGHTCOL,17,MBOXSIZE,ccols=10::ISHADE 61 70::ISHADE text 2,12,"Ship\nTo",ICFONT,10,cols=8 text 2,14,{get(20,11,8,"UFTRIM")},DBCFONT,10,cols=8 text 11,12,{mget(12,12,35,5,"UFSAVELF","UFTRIM")},DBFONT,10 # ship to section text 62,12,"Ship\nFrom",ICFONT,10,cols=8 text 62,14,{get(105,11,8,"UFTRIM")},DBCFONT,10,cols=8 text 71,12,{mget(94,12,35,5,"UFSAVELF","UFTRIM")},DBFONT,10,fit,cols=34 # ribbon #1 cbox LEFTCOL,17,RIGHTCOL,21,MBOXSIZE,crows=19::ISHADE,ccols=23 39 55 66 87 95 110 cfont 2,18,22,18,ICFONT cfont 24,18,38,18,ICFONT cfont 40,18,54,18,ICFONT cfont 56,18,65,18,ICFONT cfont 67,18,86,18,ICFONT cfont 88,18,94,18,ICFONT cfont 96,18,109,18,ICFONT cfont 111,18,MAXRCOLS,19,ICFONT cfont 2,20,22,20,DBCFONT cfont 24,20,38,20,DBCFONT cfont 40,20,54,20,DBCFONT cfont 56,20,65,20,DBCFONT cfont 67,20,86,20,DBCFONT cfont 88,20,94,20,DBCFONT cfont 96,20,109,20,DBCFONT cfont 111,20,MAXRCOLS,20,DBCFONT # detail cbox LEFTCOL,21,RIGHTCOL,60,MBOXSIZE,crows=23::DSHADE,ccols=22 65 76 86 99 103 115 120 cfont 2,22,21,22,ILFONT cfont 23,22,64,22,IFONT cfont 66,22,75,22,IRFONT cfont 77,22,85,22,IRFONT cfont 87,22,98,22,IRFONT cfont 100,22,102,22,IRFONT cfont 104,22,114,22,IRFONT cfont 116,22,119,22,ICFONT cfont 121,22,MAXRCOLS,22,ILFONT cfont 2,24,21,59,DBLFONT cfont 23,24,64,59,DFONT cfont 66,24,75,59,DBRFONT cfont 77,24,85,59,DBRFONT cfont 87,24,98,59,DBRFONT cfont 100,24,102,59,DCFONT cfont 104,24,114,59,DBRFONT cfont 116,24,119,59,DCFONT cfont 121,24,MAXRCOLS,59,DLFONT # handle memo lines font "~ [A-Za-z0-9]@2,24,4,59",0,0,MAXCOLS,1,DLFONT # watermark - large font with light shading WATERMARK 1,59,{doc_title$},cgtimes,120,shade=WATERMARK_SHADE,center,cols=MAXCOLS, fit,spacing=1 # footer cfont 2,61,93,62,IFONT cfont 95,61,101,62,IFONT cfont 103,61,112,62,DBFONT cfont 114,61,117,62,ILFONT text 1,{MAXROWS+.5},{cont$},HBRFONT,cols=MAXRCOLS text 1,{MAXROWS+.5},{copy_title$[copy]},HBCFONT,cols=MAXRCOLS merge "IC Transfer Ticket","MERGE_FILE" [IC Transfer BOL] dsn_sample "/u0/unform_test/takestock/txt/ic_trans_bol.txt" detect 62,4,"^ Bill of Lading" detect 82,8,"~ DATEMASK" detect 0,6,"~[0-9] of [0-9]" # set up document constants local MAXCOLS=95 # max cols to output local MAXRCOLS=94 # MAXCOLS-1 local LEFTCOL=1 # left vertical line local RIGHTCOL=95 # right vertical line local MAXROWS=66 # max rows to output cols MAXCOLS # max output columns rows MAXROWS # max output rows local CUSTOMER_COPY=1 local SCANNING_COPY=2 local OFFICE_COPY=3 local MAX_COPIES=3 pcopies MAX_COPIES portrait dpi 600 # see global constant above GSON # graphical shading title "Transfer BOL" # view in pdf properties prejob { dim copy_title$[MAX_COPIES] if MAX_COPIES>=1 then copy_title$[CUSTOMER_COPY]="Customer Copy" if MAX_COPIES>=2 then copy_title$[SIGNING_COPY]="" if MAX_COPIES>=3 then copy_title$[OFFICE_COPY]="Office Copy" doc_title$=upper(get(63,4,14,"UFTRIM")) } prepage { xrow=13;xcols=40 merge "zMrg get zip" xziplen=len(xzip$) if xziplen=5 or xziplen=9 or xziplen=11 then : x$="barcode 11,15.25,"+$22$+xzip$+$22$+",900,12.0,2" exec(x$) endif # get company info xcol=4,xrow=4,xcols=35,xrows=4 merge "zMrg get company info" # check for continued cont$="" pages$=get(81,6,10,"UFTRIM") x=pos("of"=pages$) page=1,pages=1 if x then page=cnum(pages$(1,x-1)),pages=cnum(pages$(x+2)) if page=1 then copy_title$[VENDOR_COPY]="Vendor Copy" if MAX_COPIES>=2 then copy_title$[SIGNING_COPY]="" if MAX_COPIES>=3 then copy_title$[OFFICE_COPY]="Office Copy" doc_title$=upper(get(58,4,14,"UFTRIM")) } prepage { # get company info xcol=3,xrow=4,xcols=35,xrows=4 merge "zMrg get company info" # find additional charges and taxes lines addrow=58 for row=29 to 57 if addrow=58 and pos("Additional Charges:"=text$[row]) then addrow=row;break next row # check for continued xcol=80,xrow=61 merge "zMrg check continued" if left(cont$,4)="Cont" then : x$=mset(34,59,MAXCOLS,4,"") else x$="cbox 34,58,RIGHTCOL,{MAXROWS-.5},MBOXSIZE,crows=60::HSHADE,ccols=49 64 79" exec(x$) endif } # erase vertical lines cerase 1,1,1,MAXROWS # ribbon 1 cerase 32,18,32,22 cerase 48,18,48,22 cerase 77,18,77,22 # ribbon 2 cerase 13,22,13,26 cerase 30,22,30,26 cerase 47,22,47,26 cerase 78,22,78,26 # detail - not all columns have | so use # conditional erase erase "|@22,26,22,58",0,0,1,1 erase "|@50,26,50,58",0,0,1,1 erase "|@60,26,60,58",0,0,1,1 erase "|@63,26,63,58",0,0,1,1 erase "|@75,26,75,58",0,0,1,1 erase "|@79,26,79,58",0,0,1,1 # totals cerase 34,58,34,62 cerase 49,58,49,62 cerase 64,58,64,62 cerase 79,58,79,62 cerase MAXCOLS,1,MAXCOLS,MAXROWS # erase horizontal lines cerase 1,1,MAXCOLS,1 cerase 1,18,MAXCOLS,18 cerase 1,20,MAXCOLS,20 cerase 1,22,MAXCOLS,22 cerase 1,24,MAXCOLS,24 cerase 1,26,MAXCOLS,26 cerase 1,28,MAXCOLS,28 cerase 1,58,MAXCOLS,58 cerase 34,60,MAXCOLS,60 cerase 1,62,MAXCOLS,62 # header section cerase 1,1,MAXCOLS,17 cbox LEFTCOL,1,RIGHTCOL,{MAXROWS-.5},MBOXSIZE merge "zMrg form header" # right header cbox 75,5,RIGHTCOL,11,MBOXSIZE,crows=7 9,ccols=83::ISHADE text 76,6,"Order",IFONT,10 text 76,8,"Page",IFONT,10 text 76,10,"Date",IFONT,10 text 84,6,{get(77,4,10,"UFTRIM")},DBFONT,10 text 84,8,{get(80,6,8,"UFTRIM")},DBFONT,10 text 84,10,{get(75,8,10,"UFTRIM")},DBFONT,10 # bill to section cbox LEFTCOL,11,RIGHTCOL,18,MBOXSIZE,ccols=10::ISHADE 41 50::ISHADE text 2,12,"Vendor",ICFONT,10,cols=8 text 2,13,{get(10,11,8,"UFTRIM")},DBCFONT,10,cols=8 text 11,12,{mget(10,12,35,6,"UFSAVELF","UFTRIM")},DBFONT,10 # ship to section text 42,12,"Ship\nTo",ICFONT,10,cols=8 text 42,14,{get(57,11,8,"UFTRIM")},DBCFONT,10,cols=8 text 51,12,{mget(57,12,35,5,"UFSAVELF","UFTRIM")},DBFONT,10,fit,cols=34 # ribbon #1 cbox LEFTCOL,18,RIGHTCOL,22,MBOXSIZE,crows=20::ISHADE,ccols=32 48 77 cfont 2,19,31,19,ICFONT,10 cfont 33,19,47,19,ICFONT,10 cfont 49,19,76,19,ICFONT,10 cfont 78,19,MAXRCOLS,19,ICFONT,10 cfont 2,21,31,21,DBCFONT,10,fit cfont 33,21,47,21,DBCFONT,10 cfont 49,21,76,21,DBCFONT,10 cfont 78,21,MAXRCOLS,21,DBCFONT,10 # ribbon #2 cbox LEFTCOL,22,RIGHTCOL,26,MBOXSIZE,crows=24::ISHADE,ccols=13 30 47 78 cfont 2,23,12,23,ICFONT,10 cfont 14,23,29,23,ICFONT,10 cfont 31,23,46,23,ICFONT,10 cfont 48,23,77,23,ICFONT,10 cfont 79,23,MAXRCOLS,23,ICFONT,10 cfont 2,25,12,25,DBCFONT,10 cfont 14,25,29,25,ICFONT,10 cfont 31,25,46,25,DBCFONT,10 cfont 48,25,77,25,DBCFONT,10 cfont 79,25,MAXRCOLS,25,DBCFONT,10 # detail cbox LEFTCOL,26,RIGHTCOL,58,MBOXSIZE,crows=28::DSHADE,ccols=22 50 60 63 75 79 cfont 2,27,21,27,IFONT,10 cfont 23,27,49,27,IFONT,10 cfont 51,27,59,27,IRFONT,10 cfont 61,27,62,27,ICFONT,10 cfont 64,27,74,27,IRFONT,10 cfont 76,27,78,27,ICFONT,10 cfont 80,27,MAXRCOLS,27,IRFONT,10 cfont 2,29,21,57,DBFONT,10 cfont 23,29,49,57,DLFONT,10 cfont 51,29,59,57,DBRFONT,10 cfont 61,29,62,57,DCFONT,10 cfont 64,29,74,57,DBRFONT,10 cfont 76,29,78,57,DCFONT,10 cfont 80,29,MAXRCOLS,57,DBRFONT,10 # handle note lines font "Note:@16,29,20,57",0,0,6,1,DRFONT,10 # Handle special lines cfont 2,{addrow},21,{addrow},DBLFONT cfont 6,{addrow+1},40,57,DBLFONT # watermark - large font with light shading WATERMARK 1,57,{doc_title$},cgtimes,120,shade=WATERMARK_SHADE,center,cols=MAXCOLS, fit,spacing=1 # footer cfont 2,59,33,{MAXROWS-1},IFONT,10 cfont 35,59,48,59,IRFONT,10,proper cfont 50,59,63,59,IRFONT,10,proper cfont 65,59,78,59,IRFONT,10,proper cfont 80,59,MAXRCOLS,59,IRFONT,11,proper cfont 35,61,48,61,DBRFONT,10 cfont 50,61,63,61,DBRFONT,10 cfont 65,61,78,61,DBRFONT,10 cfont 80,61,MAXRCOLS,61,DBRFONT,11 text 1,{MAXROWS+.5},{cont$},HBRFONT,cols=MAXRCOLS text 1,{MAXROWS+.5},{copy_title$[copy]},HBCFONT,cols=MAXRCOLS merge "PO Purchase Order","MERGE_FILE" [SO Acknowledgement] dsn_sample "/u0/unform_test/takestock/txt/so_ack.txt" #dsn_sample "/u0/unform_test/takestock/txt/so_ack1.txt" detect 56,5,"^ ACKNOWLEDGEMENT" detect 67,9,"~ DATE DATEMASK" detect 84,7,"~[0-9]" # set up document constants local MAXCOLS=93 # max cols to output local MAXRCOLS=92 # MAXCOLS-1 local LEFTCOL=1 # left vertical line local RIGHTCOL=93 # right vertical line local MAXROWS=62 # max rows to output cols MAXCOLS # max output columns rows MAXROWS # max output rows local CUSTOMER_COPY=1 local SCANNING_COPY=2 local OFFICE_COPY=3 local MAX_COPIES=3 pcopies MAX_COPIES portrait dpi 600 # see global constant above GSON # graphical shading title "ACKNOWLEDGEMENT" # view in pdf properties prejob { dim copy_title$[MAX_COPIES] if MAX_COPIES>=1 then copy_title$[CUSTOMER_COPY]="Customer Copy" if MAX_COPIES>=2 then copy_title$[SIGNING_COPY]="" if MAX_COPIES>=3 then copy_title$[OFFICE_COPY]="Office Copy" doc_title$=upper(get(57,5,15,"UFTRIM")) } prepage { xrow=15;xcols=40 merge "zMrg get zip" xziplen=len(xzip$) if xziplen=5 or xziplen=9 or xziplen=11 then : x$="barcode 11,16.25,"+$22$+xzip$+$22$+",900,12.0,2" exec(x$) endif # get company info xcol=3,xrow=5,xcols=35,xrows=4 merge "zMrg get company info" # find additional charges and taxes lines addrow=58,taxrow=58 for row=29 to 57 if addrow=58 and pos("Additional Charges:"=text$[row]) then addrow=row if taxrow=58 and pos("Taxes:"=text$[row]) then taxrow=row next row # make sure taxes states don't mix with memos row=taxrow+1 while row < 58 if get(23,row,20,"UFTRIM")="" then break x$=trim(cut(23,row,30,"")) x$=sub(x$,"|","") x$=set(6,row,30,x$) row=row+1 wend # check for continued xcol=82,xrow=61 merge "zMrg check continued" if left(cont$,4)="Cont" then : x$=mset(34,59,MAXCOLS,4,"") else x$="cbox 34,58,RIGHTCOL,{MAXROWS-.5},MBOXSIZE,crows=60::HSHADE,ccols=49 64 79" exec(x$) endif } # erase vertical lines cerase 1,1,1,MAXROWS # ribbon 1 cerase 18,18,18,22 cerase 30,18,30,22 cerase 61,18,61,22 cerase 77,18,77,22 # ribbon 2 cerase 17,22,17,26 cerase 49,22,49,26 cerase 62,22,62,26 # detail - not all columns have | so use # conditional erase erase "|@22,26,22,58",0,0,1,1 erase "|@51,26,51,58",0,0,1,1 erase "|@60,26,60,58",0,0,1,1 erase "|@63,26,63,58",0,0,1,1 erase "|@75,26,75,58",0,0,1,1 erase "|@79,26,79,58",0,0,1,1 # totals cerase 34,58,34,62 cerase 49,58,49,62 cerase 64,58,64,62 cerase 79,58,79,62 cerase MAXCOLS,1,MAXCOLS,MAXROWS # erase horizontal lines cerase 1,2,MAXCOLS,2 cerase 1,18,MAXCOLS,18 cerase 1,20,MAXCOLS,20 cerase 1,22,MAXCOLS,22 cerase 1,24,MAXCOLS,24 cerase 1,26,MAXCOLS,26 cerase 1,28,MAXCOLS,28 cerase 1,58,MAXCOLS,58 cerase 34,60,MAXCOLS,60 cerase 1,62,MAXCOLS,62 # header section cerase 1,1,MAXCOLS,17 cbox LEFTCOL,1,RIGHTCOL,{MAXROWS-.5},MBOXSIZE merge "zMrg form header" # right header cbox 75,6,RIGHTCOL,12,MBOXSIZE,crows=8 10,ccols=83::ISHADE text 76,7,"Order",IFONT,10 text 76,9,"Page",IFONT,10 text 76,11,"Date",IFONT,10 text 84,7,{get(77,5,10,"UFTRIM")},DBFONT,10 text 84,9,{get(80,7,8,"UFTRIM")},DBFONT,10 text 84,11,{get(75,9,10,"UFTRIM")},DBFONT,10 # bill to section cbox LEFTCOL,12,RIGHTCOL,18,MBOXSIZE,ccols=10::ISHADE 41 50::ISHADE text 2,13,"Bill\nTo",ICFONT,10,cols=8 text 2,15,{get(10,12,8,"UFTRIM")},DBCFONT,10,cols=8 text 11,13,{mget(6,13,40,5,"UFSAVELF","UFTRIM")},DBFONT,10 # ship to section text 42,13,"Ship\nTo",ICFONT,10,cols=8 text 42,15,{get(59,12,8,"UFTRIM")},DBCFONT,10,cols=8 text 51,13,{mget(50,13,40,5,"UFSAVELF","UFTRIM")},DBFONT,10,fit,cols=34 # ribbon #1 cbox LEFTCOL,18,RIGHTCOL,22,MBOXSIZE,crows=20::ISHADE,ccols=18 30 61 77 cfont 2,19,17,19,ICFONT,10 cfont 19,19,29,19,ICFONT,10 cfont 31,19,60,19,ICFONT,10 cfont 62,19,76,19,ICFONT,10 cfont 78,19,MAXRCOLS,19,ICFONT,10 cfont 2,21,17,21,DBCFONT,10,fit cfont 19,21,29,21,DBCFONT,10 cfont 31,21,60,21,DBCFONT,10 cfont 62,21,76,21,DBCFONT,10 cfont 78,21,MAXRCOLS,21,DBCFONT,10 # ribbon #2 cbox LEFTCOL,22,RIGHTCOL,26,MBOXSIZE,crows=24::ISHADE,ccols=17 49 62 cfont 2,23,16,23,ICFONT,10 cfont 18,23,48,23,ICFONT,10 cfont 50,23,61,23,ICFONT,10 cfont 63,23,MAXRCOLS,23,ICFONT,10 cfont 2,25,16,25,DBCFONT,10 cfont 18,25,48,25,DBCFONT,10 cfont 50,25,61,25,DBCFONT,10 cfont 63,25,MAXRCOLS,25,DBCFONT,10 # detail cbox LEFTCOL,26,RIGHTCOL,58,MBOXSIZE,crows=28::DSHADE,ccols=22 51 60 63 75 79 cfont 2,27,21,27,IFONT,10 cfont 23,27,50,27,IFONT,10 cfont 52,27,59,27,IRFONT,10 cfont 61,27,62,27,ICFONT,10 cfont 64,27,74,27,IRFONT,10 cfont 76,27,78,27,ICFONT,10 cfont 80,27,MAXRCOLS,27,IRFONT,10 cfont 2,29,21,57,DBFONT,10 cfont 23,29,50,57,DLFONT,10 cfont 52,29,59,57,DBRFONT,10 cfont 61,29,62,57,DCFONT,10 cfont 64,29,74,57,DBRFONT,10 cfont 76,29,78,57,DCFONT,10 cfont 80,29,MAXRCOLS,57,DBRFONT,10 # Handle special lines cfont 2,{addrow},21,{addrow},DBLFONT cfont 6,{addrow+1},40,{taxrow-1},DBLFONT cfont 2,{taxrow},21,{taxrow},DBLFONT cfont 6,{taxrow+1},40,57,DBLFONT # watermark - large font with light shading WATERMARK 1,57,{doc_title$},cgtimes,120,shade=WATERMARK_SHADE,center,cols=MAXCOLS, fit,spacing=1 # footer cfont 2,59,33,{MAXROWS-1},IFONT,10 cfont 35,59,48,59,IRFONT,10,proper cfont 50,59,63,59,IRFONT,10,proper cfont 65,59,78,59,IRFONT,10,proper cfont 80,59,MAXRCOLS,59,IRFONT,11,proper cfont 35,61,48,61,DBRFONT,10 cfont 50,61,63,61,DBRFONT,10 cfont 65,61,78,61,DBRFONT,10 cfont 80,61,MAXRCOLS,61,DBRFONT,11 text 1,{MAXROWS+.5},{cont$},HBRFONT,cols=MAXRCOLS text 1,{MAXROWS+.5},{copy_title$[copy]},HBCFONT,cols=MAXRCOLS merge "SO Acknowledgement","MERGE_FILE" [SO Counter Ticket] #dsn_sample "/u0/unform_test/takestock/txt/so_counter_multi.txt" #dsn_sample "/u0/unform_test/takestock/txt/so_counter.txt" dsn_sample "/u0/unform_test/takestock/txt/so_counter1.txt" detect 64,5,"^ Counter" detect 67,9,"~ Date DATEMASK" detect 84,7,"~[0-9]" # set up document constants local MAXCOLS=93 # max cols to output local MAXRCOLS=92 # MAXCOLS-1 local LEFTCOL=1 # left vertical line local RIGHTCOL=93 # right vertical line local MAXROWS=62 # max rows to output cols MAXCOLS # max output columns rows MAXROWS # max output rows local CUSTOMER_COPY=1 local SCANNING_COPY=2 local OFFICE_COPY=3 local MAX_COPIES=3 pcopies MAX_COPIES portrait dpi 600 # see global constant above GSON # graphical shading title "Counter Invoice" # view in pdf properties prejob { dim copy_title$[MAX_COPIES] if MAX_COPIES>=1 then copy_title$[CUSTOMER_COPY]="Customer Copy" if MAX_COPIES>=2 then copy_title$[SIGNING_COPY]="" if MAX_COPIES>=3 then copy_title$[OFFICE_COPY]="Office Copy" doc_title$="COUNTER INVOICE" } prepage { xrow=15;xcols=40 merge "zMrg get zip" xziplen=len(xzip$) if xziplen=5 or xziplen=9 or xziplen=11 then : x$="barcode 11,16.25,"+$22$+xzip$+$22$+",900,12.0,2" exec(x$) endif # get company info xcol=3,xrow=5,xcols=35,xrows=4 merge "zMrg get company info" # find additional charges and taxes lines addrow=58,taxrow=58 for row=29 to 57 if addrow=58 and pos("Additional Charges:"=text$[row]) then addrow=row if taxrow=58 and pos("Taxes:"=text$[row]) then taxrow=row next row # make sure taxes states don't mix with memos row=taxrow+1 while row < 58 if get(23,row,20,"UFTRIM")="" then break x$=trim(cut(23,row,30,"")) x$=sub(x$,"|","") x$=set(6,row,30,x$) row=row+1 wend # check for continued xcol=82,xrow=61 merge "zMrg check continued" if left(cont$,4)="Cont" then : x$=mset(34,59,MAXCOLS,4,"") else x$="cbox 34,58,RIGHTCOL,{MAXROWS-.5},MBOXSIZE,crows=60::HSHADE,ccols=49 64 79" exec(x$) endif } # erase vertical lines cerase 1,1,1,MAXROWS # ribbon 1 cerase 18,18,18,22 cerase 30,18,30,22 cerase 61,18,61,22 cerase 77,18,77,22 # ribbon 2 cerase 17,22,17,26 cerase 49,22,49,26 cerase 62,22,62,26 # detail - not all columns have | so use # conditional erase erase "|@22,26,22,58",0,0,1,1 erase "|@51,26,51,58",0,0,1,1 erase "|@60,26,60,58",0,0,1,1 erase "|@63,26,63,58",0,0,1,1 erase "|@75,26,75,58",0,0,1,1 erase "|@79,26,79,58",0,0,1,1 # totals cerase 34,58,34,62 cerase 49,58,49,62 cerase 64,58,64,62 cerase 79,58,79,62 cerase MAXCOLS,1,MAXCOLS,MAXROWS # erase horizontal lines cerase 1,2,MAXCOLS,2 cerase 1,18,MAXCOLS,18 cerase 1,20,MAXCOLS,20 cerase 1,22,MAXCOLS,22 cerase 1,24,MAXCOLS,24 cerase 1,26,MAXCOLS,26 cerase 1,28,MAXCOLS,28 cerase 1,58,MAXCOLS,58 cerase 34,60,MAXCOLS,60 cerase 1,62,MAXCOLS,62 # header section cerase 1,1,MAXCOLS,17 cbox LEFTCOL,1,RIGHTCOL,{MAXROWS-.5},MBOXSIZE merge "zMrg form header" text 1,4,{get(56,3,8,"UFTRIM")},HRFONT,12,cols=MAXRCOLS text 1,5,{get(77,3,7,"UFTRIM")},HRFONT,cols=MAXRCOLS # right header cbox 75,6,RIGHTCOL,12,MBOXSIZE,crows=8 10,ccols=83::ISHADE text 76,7,"Order",IFONT,10 text 76,9,"Page",IFONT,10 text 76,11,"Date",IFONT,10 text 84,7,{get(77,5,10,"UFTRIM")},DBFONT,10 text 84,9,{get(80,7,8,"UFTRIM")},DBFONT,10 text 84,11,{get(75,9,10,"UFTRIM")},DBFONT,10 # bill to section cbox LEFTCOL,12,RIGHTCOL,18,MBOXSIZE,ccols=10::ISHADE 41 50::ISHADE text 2,13,"Bill\nTo",ICFONT,10,cols=8 text 2,15,{get(10,12,8,"UFTRIM")},DBCFONT,10,cols=8 text 11,13,{mget(6,13,40,5,"UFSAVELF","UFTRIM")},DBFONT,10 # ship to section text 42,13,"Ship\nTo",ICFONT,10,cols=8 text 42,15,{get(59,12,8,"UFTRIM")},DBCFONT,10,cols=8 text 51,13,{mget(50,13,40,5,"UFSAVELF","UFTRIM")},DBFONT,10,fit,cols=34 # ribbon #1 cbox LEFTCOL,18,RIGHTCOL,22,MBOXSIZE,crows=20::ISHADE,ccols=18 30 61 77 cfont 2,19,17,19,ICFONT,10 cfont 19,19,29,19,ICFONT,10 cfont 31,19,60,19,ICFONT,10 cfont 62,19,76,19,ICFONT,10 cfont 78,19,MAXRCOLS,19,ICFONT,10 cfont 2,21,17,21,DBCFONT,10,fit cfont 19,21,29,21,DBCFONT,10 cfont 31,21,60,21,DBCFONT,10 cfont 62,21,76,21,DBCFONT,10 cfont 78,21,MAXRCOLS,21,DBCFONT,10 # ribbon #2 cbox LEFTCOL,22,RIGHTCOL,26,MBOXSIZE,crows=24::ISHADE,ccols=17 49 62 cfont 2,23,16,23,ICFONT,10 cfont 18,23,48,23,ICFONT,10 cfont 50,23,61,23,ICFONT,10 cfont 63,23,MAXRCOLS,23,ICFONT,10 cfont 2,25,16,25,DBCFONT,10 cfont 18,25,48,25,DBCFONT,10 cfont 50,25,61,25,DBCFONT,10 cfont 63,25,MAXRCOLS,25,DBCFONT,10 # detail cbox LEFTCOL,26,RIGHTCOL,58,MBOXSIZE,crows=28::DSHADE,ccols=22 51 60 63 75 79 cfont 2,27,21,27,IFONT,10 cfont 23,27,50,27,IFONT,10 cfont 52,27,59,27,IRFONT,10 cfont 61,27,62,27,ICFONT,10 cfont 64,27,74,27,IRFONT,10 cfont 76,27,78,27,ICFONT,10 cfont 80,27,MAXRCOLS,27,IRFONT,10 cfont 2,29,21,57,DBFONT,10 cfont 23,29,50,57,DLFONT,10 cfont 52,29,59,57,DBRFONT,10 cfont 61,29,62,57,DCFONT,10 cfont 64,29,74,57,DBRFONT,10 cfont 76,29,78,57,DCFONT,10 cfont 80,29,MAXRCOLS,57,DBRFONT,10 # handle memo lines font "~ [A-Za-z0-9]@2,29,4,57",2,0,MAXCOLS,1,DFONT # Handle special lines cfont 2,{addrow},21,{addrow},DBLFONT cfont 6,{addrow+1},40,{taxrow-1},DBLFONT cfont 2,{taxrow},21,{taxrow},DBLFONT cfont 6,{taxrow+1},40,57,DBLFONT font "Deposit Applied:",0,0,17,1,DBRFONT # watermark - large font with light shading WATERMARK 1,57,{doc_title$},cgtimes,120,shade=WATERMARK_SHADE,center,cols=MAXCOLS, fit,spacing=1 # footer cfont 2,59,33,{MAXROWS-1},IFONT,10 cfont 35,59,48,59,IRFONT,10,proper cfont 50,59,63,59,IRFONT,10,proper cfont 65,59,78,59,IRFONT,10,proper cfont 80,59,MAXRCOLS,59,IRFONT,11,proper cfont 35,61,48,61,DBRFONT,10 cfont 50,61,63,61,DBRFONT,10 cfont 65,61,78,61,DBRFONT,10 cfont 80,61,MAXRCOLS,61,DBRFONT,11 text 1,{MAXROWS+.5},{cont$},HBRFONT,cols=MAXRCOLS text 1,{MAXROWS+.5},{copy_title$[copy]},HBCFONT,cols=MAXRCOLS merge "SO Counter Ticket","MERGE_FILE" [SO Pick Ticket] dsn_sample "/u0/unform_test/takestock/txt/so_PICK TICKET PRINT MULTI PAGE.TXT" #dsn_sample "/u0/unform_test/takestock/txt/so_pick.txt" detect 61,5,"^ Pick Ticket" detect 80,9,"~ DATEMASK" detect 90,7,"~[0-9]" # set up document constants local MAXCOLS=93 # max cols to output local MAXRCOLS=92 # MAXCOLS-1 local LEFTCOL=1 # left vertical line local RIGHTCOL=93 # right vertical line local MAXROWS=63 # max rows to output cols MAXCOLS # max output columns rows MAXROWS # max output rows local CUSTOMER_COPY=1 local SCANNING_COPY=2 local OFFICE_COPY=3 local MAX_COPIES=3 pcopies MAX_COPIES portrait dpi 600 # see global constant above GSON # graphical shading title "Pick Ticket" # view in pdf properties prejob { dim copy_title$[MAX_COPIES] if MAX_COPIES>=1 then copy_title$[CUSTOMER_COPY]="Customer Copy" if MAX_COPIES>=2 then copy_title$[SIGNING_COPY]="" if MAX_COPIES>=3 then copy_title$[OFFICE_COPY]="Office Copy" doc_title$=upper(get(57,5,15,"UFTRIM")) } prepage { # get company info xcol=3,xrow=5,xcols=35,xrows=4 merge "zMrg get company info" # check for multiple addresses ship to mult$="",shipto$="" x$=get(12,12,20,"UFTRIM") if left(x$,1)="*" then : mult$=x$ else shipto$=x$ endif # check for continued xcol=81,xrow=61 merge "zMrg check continued" wt_hdr$="",wt$="" if left(cont$,4)<>"Cont" then : wt_hdr$="Total Weight:" wt$=get(69,61,14,"UFTRIM") endif wt$=sub(wt$,"|"," ") } # erase vertical lines cerase 1,1,1,MAXROWS # ribbon 1 cerase 17,18,17,22 cerase 28,18,28,22 cerase 39,18,39,22 cerase 45,18,45,22 cerase 61,18,61,22 cerase 65,18,65,22 cerase 77,18,77,22 # detail - not all columns have | so use # conditional erase erase "|@32,22,32,60",0,0,1,1 erase "|@43,22,43,60",0,0,1,1 erase "|@54,22,54,60",0,0,1,1 erase "|@65,22,60,60",0,0,1,1 erase "|@68,22,68,62",0,0,1,1 erase "|@80,22,80,62",0,0,1,1 erase "|@83,22,83,60",0,0,1,1 cerase MAXCOLS,1,MAXCOLS,MAXROWS # erase horizontal lines cerase 1,2,MAXCOLS,2 cerase 1,18,MAXCOLS,18 cerase 1,20,MAXCOLS,20 cerase 1,22,MAXCOLS,22 cerase 1,24,MAXCOLS,24 cerase 1,60,MAXCOLS,60 cerase 68,62,80,62 # header section cerase 1,1,MAXCOLS,17 cbox LEFTCOL,1,RIGHTCOL,{MAXROWS-.5},MBOXSIZE merge "zMrg form header" text 1,4,{get(82,3,7,"UFTRIM")},HRFONT,cols=MAXRCOLS # right header cbox 70,6,RIGHTCOL,12,MBOXSIZE,crows=8 10,ccols=77::ISHADE text 71,7,"Order",IFONT,10 text 71,9,"Page",IFONT,10 text 71,11,"Date",IFONT,10 text 78,7,{get(75,5,18,"UFTRIM")},DBFONT,10 text 78,9,{get(83,7,8,"UFTRIM")},DBFONT,10 text 78,11,{get(81,9,10,"UFTRIM")},DBFONT,10 # ship to section cbox LEFTCOL,12,RIGHTCOL,18,MBOXSIZE,ccols=10::ISHADE 41 50::ISHADE text 2,13,"Ship\nTo",ICFONT,10,cols=8 text 2,15,{shipto$},DBCFONT,10,cols=8 text 11,13,{mget(12,12,34,6,"UFSAVELF","UFTRIM")},DBFONT,10 # bill to section text 42,13,"Bill\nTo",ICFONT,10,cols=8 text 42,15,{get(55,12,8,"UFTRIM")},DBCFONT,10,cols=8 text 51,13,{mget(55,13,35,5,"UFSAVELF","UFTRIM")},DBFONT,10,fit,cols=34 # ribbon #1 cbox LEFTCOL,18,RIGHTCOL,22,MBOXSIZE,crows=20::ISHADE,ccols=17 28 39 45 61 65 77 cfont 2,19,16,19,ICFONT,10 cfont 18,19,27,19,ICFONT,10 cfont 29,19,38,19,ICFONT,10 cfont 40,19,44,19,ICFONT,10 cfont 46,19,60,19,ICFONT,10 cfont 62,19,64,19,ICFONT,10 cfont 66,19,76,19,ICFONT,10 cfont 78,19,MAXRCOLS,19,ICFONT,10 cfont 2,21,16,21,DBCFONT,10,fit cfont 18,21,27,21,DBCFONT,10 cfont 29,21,38,21,DBCFONT,10 cfont 40,21,44,21,DBCFONT,10 cfont 46,21,60,21,DBCFONT,10 cfont 62,21,64,21,DBCFONT,10 cfont 66,21,76,21,DBCFONT,10 cfont 78,21,MAXRCOLS,21,DBCFONT,10 # detail cbox LEFTCOL,22,RIGHTCOL,60,MBOXSIZE,crows=24::DSHADE,ccols=32 43 54 65 68 80 83 cfont 2,23,31,23,IFONT,10 cfont 33,23,42,23,IRFONT,10 cfont 44,23,53,23,IRFONT,10 cfont 55,23,64,23,IRFONT,10 cfont 66,23,67,23,ICFONT,10 cfont 69,23,79,23,IRFONT,10 cfont 81,23,82,23,ICFONT,10 cfont 84,23,MAXRCOLS,23,ICFONT,10 cfont 2,25,31,59,DBLFONT,10 cfont 33,25,42,59,DBRFONT,10 cfont 44,25,53,59,DBRFONT,10 cfont 55,25,64,59,DBRFONT,10 cfont 66,25,67,59,DCFONT,10 cfont 69,25,79,59,DRFONT,10 cfont 81,25,82,59,DCFONT,10 cfont 84,25,MAXRCOLS,59,DBCFONT,10 # handle ship to lines font "Ship To Detail:",0,0,15,1,IFONT,10 font "Ship To:",0,0,8,1,IFONT,10 font "Ship To:",9,0,30,3,DBFONT,10,black font "Ship Via:",0,0,9,1,IFONT,10 font "Ship Via:",10,0,30,1,DBFONT,10,black font "Salesperson:",0,0,12,1,IFONT,10 font "Salesperson:",13,0,30,1,DBFONT,10,black # watermark - large font with light shading WATERMARK 1,59,{doc_title$},cgtimes,120,shade=WATERMARK_SHADE,center,cols=MAXCOLS, fit,spacing=1 # footer cfont 2,61,60,61,IBFONT,10 cfont 2,62,12,62,IFONT,10 cfont 14,62,23,62,DBLFONT,10 cfont 25,62,31,62,IRFONT,10 cfont 33,62,60,62,DBLFONT,10 cfont 61,61,66,62,IRFONT,10 cfont 68,61,79,62,DBLFONT,10 cerase 61,61,MAXCOLS,62 text 61,61,{wt_hdr$},IFONT,10 text 71,61,{wt$},DBLFONT,10 text 1,{MAXROWS+.5},{cont$},HBRFONT,cols=MAXRCOLS text 1,{MAXROWS+.5},{copy_title$[copy]},HBCFONT,cols=MAXRCOLS merge "SO Pick Ticket","MERGE_FILE" [PR Production] #dsn_sample "/u0/unform_test/takestock/txt/pr_production_multi.txt" dsn_sample "/u0/unform_test/takestock/txt/pr_production.txt" detect 97,4,"^ Production Tk" detect 112,8,"~ DATEMASK" detect 122,6,"~[0-9]" # set up document constants local MAXCOLS=132 # max cols to output local MAXRCOLS=131 # MAXCOLS-1 local LEFTCOL=1 # left vertical line local RIGHTCOL=132 # right vertical line local MAXROWS=59 # max rows to output cols MAXCOLS # max output columns rows MAXROWS # max output rows local PRODUCTION_COPY=1 local SCANNING_COPY=2 local OFFICE_COPY=3 local MAX_COPIES=3 pcopies MAX_COPIES landscape dpi 600 # see global constant above GSON # graphical shading title "Production Ticket" # view in pdf properties prejob { dim copy_title$[MAX_COPIES] if MAX_COPIES>=1 then copy_title$[PRODUCTION_COPY]="Production Copy" if MAX_COPIES>=2 then copy_title$[SIGNING_COPY]="" if MAX_COPIES>=3 then copy_title$[OFFICE_COPY]="Office Copy" doc_title$="PRODUCTION TICKET" } prepage { # get company info xcol=3,xrow=4,xcols=35,xrows=4 merge "zMrg get company info" # check for continued xcol=2,xrow=57 merge "zMrg check continued" if left(cont$,4)="Cont" then : x$=mset(1,57,MAXCOLS,2,"") endif } # erase vertical lines cerase 1,1,1,MAXROWS # ribbon 1 cerase 7,12,7,16 cerase 21,12,21,16 cerase 33,12,33,16 cerase 46,12,46,16 cerase 53,12,53,16 cerase 67,12,67,16 # detail - not all columns have | so use # conditional erase erase "|@3,16,22,55",0,0,1,1 erase "|@24,16,24,55",0,0,1,1 erase "|@56,16,56,55",0,0,1,1 erase "|@67,16,67,55",0,0,1,1 erase "|@77,16,77,55",0,0,1,1 erase "|@87,16,87,55",0,0,1,1 erase "|@96,16,96,55",0,0,1,1 erase "|@106,16,106,55",0,0,1,1 erase "|@110,16,110,55",0,0,1,1 cerase MAXCOLS,1,MAXCOLS,MAXROWS # erase horizontal lines cerase 1,2,MAXCOLS,2 cerase 1,12,MAXCOLS,12 cerase 1,14,MAXCOLS,14 cerase 1,16,MAXCOLS,16 cerase 1,18,MAXCOLS,18 cerase 1,55,MAXCOLS,55 # header section cerase 1,1,MAXCOLS,11 cbox LEFTCOL,1,RIGHTCOL,{MAXROWS-.5},MBOXSIZE merge "zMrg lform header" text 1,3.5,{get(109,3,7,"UFTRIM")},HRFONT,cols=MAXRCOLS # right header cbox 103,4,RIGHTCOL,10,MBOXSIZE,crows=6 8,ccols=113::ISHADE text 104,5,"Order",IFONT text 104,7,"Page",IFONT text 104,9,"Date",IFONT text 114,5,{get(115,4,10,"UFTRIM")},DBFONT text 114,7,{get(120,6,8,"UFTRIM")},DBFONT text 114,9,{get(113,8,10,"UFTRIM")},DBFONT # parent section cbox LEFTCOL,10,RIGHTCOL,12,MBOXSIZE,ccols=10::ISHADE 61 78::ISHADE text 2,11,"Parent",IFONT,10,cols=8 text 11,11,{sub(get(20,10,53,"UFTRIM")," "," ")},DBLFONT,10,cols=8 # qty section text 62,11,{get(75,10,19,"UFTRIM")},IFONT,10 text 79,11,{get(96,10,30,"UFTRIM")},DBLFONT,10 # ribbon #1 cbox LEFTCOL,12,RIGHTCOL,16,MBOXSIZE,crows=14::ISHADE,ccols=7 21 33 46 53 67 cfont 2,13,6,13,ICFONT cfont 8,13,20,13,ICFONT cfont 22,13,32,13,ICFONT cfont 34,13,45,13,ICFONT cfont 47,13,52,13,ICFONT cfont 54,13,66,13,ICFONT cfont 68,13,MAXRCOLS,13,ICFONT cfont 2,15,6,15,DBCFONT cfont 8,15,20,15,DBCFONT cfont 22,15,32,15,DBCFONT cfont 34,15,45,15,DBCFONT cfont 47,15,52,15,DBCFONT cfont 54,15,66,15,DBCFONT cfont 68,15,MAXRCOLS,15,DBCFONT # detail cbox LEFTCOL,16,RIGHTCOL,55,MBOXSIZE,crows=18::DSHADE,ccols=3 24 56 67 77 87 96 106 110 cfont 2,17,2,17,ICFONT cfont 4,17,23,17,IFONT cfont 25,17,55,17,IFONT cfont 57,17,66,17,IRFONT cfont 68,17,76,17,IRFONT cfont 78,17,86,17,IRFONT cfont 88,17,95,17,IRFONT cfont 97,17,105,17,IRFONT cfont 107,17,109,17,ICFONT cfont 111,17,MAXRCOLS,17,IFONT cfont 2,19,2,54,DCFONT cfont 4,19,23,54,DBFONT cfont 25,19,55,54,DFONT cfont 57,19,66,54,DBRFONT cfont 68,19,76,54,DBRFONT cfont 78,19,86,54,DBRFONT cfont 88,19,95,54,DBRFONT cfont 97,19,105,54,DBRFONT cfont 107,19,109,54,DCFONT cfont 111,19,MAXRCOLS,54,DFONT # watermark - large font with light shading WATERMARK 1,54,{doc_title$},cgtimes,120,shade=WATERMARK_SHADE,center,cols=MAXCOLS, fit,spacing=1 # footer cfont 2,56,MAXCOLS,57,ILFONT cfont 2,58,16,58,IRFONT cfont 47,58,55,58,IRFONT text 1,{MAXROWS+.5},{cont$},HBRFONT,cols=MAXRCOLS text 1,{MAXROWS+.5},{copy_title$[copy]},HBCFONT,cols=MAXRCOLS merge "PR Production","MERGE_FILE" [SO Quote] #dsn_sample "/u0/unform_test/takestock/txt/so_quote.txt" dsn_sample "/u0/unform_test/takestock/txt/so_QUOTE 12CPI LAZER MULTI PAGE.TXT" detect 66,5,"^ Quote" detect 67,9,"~ DATE DATEMASK" detect 84,7,"~[0-9]" # set up document constants local MAXCOLS=93 # max cols to output local MAXRCOLS=92 # MAXCOLS-1 local LEFTCOL=1 # left vertical line local RIGHTCOL=93 # right vertical line local MAXROWS=62 # max rows to output cols MAXCOLS # max output columns rows MAXROWS # max output rows local CUSTOMER_COPY=1 local SCANNING_COPY=2 local OFFICE_COPY=3 local MAX_COPIES=3 pcopies MAX_COPIES portrait dpi 600 # see global constant above GSON # graphical shading title "Quote" # view in pdf properties prejob { dim copy_title$[MAX_COPIES] if MAX_COPIES>=1 then copy_title$[CUSTOMER_COPY]="Customer Copy" if MAX_COPIES>=2 then copy_title$[SIGNING_COPY]="" if MAX_COPIES>=3 then copy_title$[OFFICE_COPY]="Office Copy" doc_title$=upper(get(57,5,15,"UFTRIM")) } prepage { xrow=15;xcols=40 merge "zMrg get zip" xziplen=len(xzip$) if xziplen=5 or xziplen=9 or xziplen=11 then : x$="barcode 11,16.25,"+$22$+xzip$+$22$+",900,12.0,2" exec(x$) endif # get company info xcol=3,xrow=5,xcols=35,xrows=4 merge "zMrg get company info" # find additional charges and taxes lines addrow=58,taxrow=58 for row=29 to 57 if addrow=58 and pos("Additional Charges:"=text$[row]) then addrow=row if taxrow=58 and pos("Taxes:"=text$[row]) then taxrow=row next row # make sure taxes states don't mix with memos row=taxrow+1 while row < 58 if get(2,row,20,"UFTRIM")="" then break x$=trim(cut(2,row,30,"")) x$=sub(x$,"|","") x$=set(6,row,30,x$) row=row+1 wend # check for continued xcol=82,xrow=61 merge "zMrg check continued" if left(cont$,4)="Cont" then : x$=mset(34,59,MAXCOLS,4,"") else x$="cbox 34,58,RIGHTCOL,{MAXROWS-.5},MBOXSIZE,crows=60::HSHADE,ccols=49 64 79" exec(x$) endif } # erase vertical lines cerase 1,1,1,MAXROWS # ribbon 1 cerase 18,18,18,22 cerase 30,18,30,22 cerase 61,18,61,22 cerase 77,18,77,22 # ribbon 2 cerase 17,22,17,26 cerase 49,22,49,26 cerase 62,22,62,26 # detail - not all columns have | so use # conditional erase erase "|@22,26,22,58",0,0,1,1 erase "|@51,26,51,58",0,0,1,1 erase "|@60,26,60,58",0,0,1,1 erase "|@63,26,63,58",0,0,1,1 erase "|@75,26,75,58",0,0,1,1 erase "|@79,26,79,58",0,0,1,1 # totals cerase 34,58,34,62 cerase 49,58,49,62 cerase 64,58,64,62 cerase 79,58,79,62 cerase MAXCOLS,1,MAXCOLS,MAXROWS # erase horizontal lines cerase 1,2,MAXCOLS,2 cerase 1,18,MAXCOLS,18 cerase 1,20,MAXCOLS,20 cerase 1,22,MAXCOLS,22 cerase 1,24,MAXCOLS,24 cerase 1,26,MAXCOLS,26 cerase 1,28,MAXCOLS,28 cerase 1,58,MAXCOLS,58 cerase 34,60,MAXCOLS,60 cerase 1,62,MAXCOLS,62 # header section cerase 1,1,MAXCOLS,17 cbox LEFTCOL,1,RIGHTCOL,{MAXROWS-.5},MBOXSIZE merge "zMrg form header" # right header cbox 75,6,RIGHTCOL,12,MBOXSIZE,crows=8 10,ccols=83::ISHADE text 76,7,"Order",IFONT,10 text 76,9,"Page",IFONT,10 text 76,11,"Date",IFONT,10 text 84,7,{get(77,5,10,"UFTRIM")},DBFONT,10 text 84,9,{get(80,7,8,"UFTRIM")},DBFONT,10 text 84,11,{get(75,9,10,"UFTRIM")},DBFONT,10 # bill to section cbox LEFTCOL,12,RIGHTCOL,18,MBOXSIZE,ccols=10::ISHADE 41 50::ISHADE text 2,13,"Bill\nTo",ICFONT,10,cols=8 text 2,15,{get(10,12,8,"UFTRIM")},DBCFONT,10,cols=8 text 11,13,{mget(6,13,40,5,"UFSAVELF","UFTRIM")},DBFONT,10 # ship to section text 42,13,"Ship\nTo",ICFONT,10,cols=8 text 42,15,{get(59,12,8,"UFTRIM")},DBCFONT,10,cols=8 text 51,13,{mget(50,13,40,5,"UFSAVELF","UFTRIM")},DBFONT,10,fit,cols=34 # ribbon #1 cbox LEFTCOL,18,RIGHTCOL,22,MBOXSIZE,crows=20::ISHADE,ccols=18 30 61 77 cfont 2,19,17,19,ICFONT,10 cfont 19,19,29,19,ICFONT,10 cfont 31,19,60,19,ICFONT,10 cfont 62,19,76,19,ICFONT,10 cfont 78,19,MAXRCOLS,19,ICFONT,10 cfont 2,21,17,21,DBCFONT,10,fit cfont 19,21,29,21,DBCFONT,10 cfont 31,21,60,21,DBCFONT,10 cfont 62,21,76,21,DBCFONT,10 cfont 78,21,MAXRCOLS,21,DBCFONT,10 # ribbon #2 cbox LEFTCOL,22,RIGHTCOL,26,MBOXSIZE,crows=24::ISHADE,ccols=17 49 62 cfont 2,23,16,23,ICFONT,10 cfont 18,23,48,23,ICFONT,10 cfont 50,23,61,23,ICFONT,10 cfont 63,23,MAXRCOLS,23,ICFONT,10 cfont 2,25,16,25,DBCFONT,10 cfont 18,25,48,25,DBCFONT,10 cfont 50,25,61,25,DBCFONT,10 cfont 63,25,MAXRCOLS,25,DBCFONT,10 # detail cbox LEFTCOL,26,RIGHTCOL,58,MBOXSIZE,crows=28::DSHADE,ccols=22 51 60 63 75 79 cfont 2,27,21,27,IFONT,10 cfont 23,27,50,27,IFONT,10 cfont 52,27,59,27,IRFONT,10 cfont 61,27,62,27,ICFONT,10 cfont 64,27,74,27,IRFONT,10 cfont 76,27,78,27,ICFONT,10 cfont 80,27,MAXRCOLS,27,IRFONT,10 cfont 2,29,21,57,DBFONT,10 cfont 23,29,50,57,DLFONT,10 cfont 52,29,59,57,DBRFONT,10 cfont 61,29,62,57,DCFONT,10 cfont 64,29,74,57,DBRFONT,10 cfont 76,29,78,57,DCFONT,10 cfont 80,29,MAXRCOLS,57,DBRFONT,10 # Handle special lines cfont 2,{addrow},21,{addrow},DBLFONT cfont 6,{addrow+1},40,{taxrow-1},DBLFONT cfont 2,{taxrow},21,{taxrow},DBLFONT cfont 6,{taxrow+1},40,57,DBLFONT font "QUOTED BY:",-10,0,30,1,DBLFONT,10 font "EXPIRES:",-12,0,30,1,DBLFONT,10 # watermark - large font with light shading WATERMARK 1,57,{doc_title$},cgtimes,120,shade=WATERMARK_SHADE,center,cols=MAXCOLS, fit,spacing=1 # footer cfont 2,59,33,{MAXROWS-1},IFONT,10 cfont 35,59,48,59,IRFONT,10,proper cfont 50,59,63,59,IRFONT,10,proper cfont 65,59,78,59,IRFONT,10,proper cfont 80,59,MAXRCOLS,59,IRFONT,11,proper cfont 35,61,48,61,DBRFONT,10 cfont 50,61,63,61,DBRFONT,10 cfont 65,61,78,61,DBRFONT,10 cfont 80,61,MAXRCOLS,61,DBRFONT,11 text 1,{MAXROWS+.5},{cont$},HBRFONT,cols=MAXRCOLS text 1,{MAXROWS+.5},{copy_title$[copy]},HBCFONT,cols=MAXRCOLS merge "SO Quote","MERGE_FILE" [SO Invoice with Backorders] #dsn_sample "/u0/unform_test/takestock/txt/so_invoice_multi_back.txt" dsn_sample "/u0/unform_test/takestock/txt/so_inv_wotear_back.txt" detect 64,5,"^ Invoice" detect 67,9,"~ Date DATEMASK" detect 84,7,"~[0-9]" detect 0,27,"BackOrder" # set up document constants local MAXCOLS=93 # max cols to output local MAXRCOLS=92 # MAXCOLS-1 local LEFTCOL=1 # left vertical line local RIGHTCOL=93 # right vertical line local MAXROWS=62 # max rows to output cols MAXCOLS # max output columns rows MAXROWS # max output rows local CUSTOMER_COPY=1 local SCANNING_COPY=2 local OFFICE_COPY=3 local MAX_COPIES=3 pcopies MAX_COPIES portrait dpi 600 # see global constant above GSON # graphical shading title "Invoice" # view in pdf properties prejob { dim copy_title$[MAX_COPIES] if MAX_COPIES>=1 then copy_title$[CUSTOMER_COPY]="Customer Copy" if MAX_COPIES>=2 then copy_title$[SIGNING_COPY]="" if MAX_COPIES>=3 then copy_title$[OFFICE_COPY]="Office Copy" doc_title$=upper(get(57,5,15,"UFTRIM")) } prepage { xrow=15;xcols=40 merge "zMrg get zip" xziplen=len(xzip$) if xziplen=5 or xziplen=9 or xziplen=11 then : x$="barcode 11,16.25,"+$22$+xzip$+$22$+",900,12.0,2" exec(x$) endif # get company info xcol=3,xrow=5,xcols=35,xrows=4 merge "zMrg get company info" # find additional charges and taxes lines addrow=58,taxrow=58 for row=29 to 57 if addrow=58 and pos("Additional Charges:"=text$[row]) then addrow=row if taxrow=58 and pos("Taxes:"=text$[row]) then taxrow=row next row # make sure taxes states don't mix with memos row=taxrow+1 while row < 58 if get(2,row,20,"UFTRIM")="" then break x$=trim(cut(2,row,30,"")) x$=sub(x$,"|","") x$=set(6,row,30,x$) row=row+1 wend # check for continued xcol=82,xrow=61 merge "zMrg check continued" if left(cont$,4)="Cont" then : x$=mset(34,59,MAXCOLS,4,"") else x$="cbox 34,58,RIGHTCOL,{MAXROWS-.5},MBOXSIZE,crows=60::HSHADE,ccols=49 64 79" exec(x$) endif } # erase vertical lines cerase 1,1,1,MAXROWS # ribbon 1 cerase 18,18,18,22 cerase 30,18,30,22 cerase 61,18,61,22 cerase 77,18,77,22 # ribbon 2 cerase 17,22,17,26 cerase 49,22,49,26 cerase 62,22,62,26 # detail - not all columns have | so use # conditional erase erase "|@32,26,32,58",0,0,1,1 erase "|@41,26,41,58",0,0,1,1 erase "|@50,26,50,58",0,0,1,1 erase "|@60,26,60,58",0,0,1,1 erase "|@63,26,63,58",0,0,1,1 erase "|@75,26,75,58",0,0,1,1 erase "|@79,26,79,58",0,0,1,1 # totals cerase 34,58,34,62 cerase 49,58,49,62 cerase 64,58,64,62 cerase 79,58,79,62 cerase MAXCOLS,1,MAXCOLS,MAXROWS # erase horizontal lines cerase 1,2,MAXCOLS,2 cerase 1,18,MAXCOLS,18 cerase 1,20,MAXCOLS,20 cerase 1,22,MAXCOLS,22 cerase 1,24,MAXCOLS,24 cerase 1,26,MAXCOLS,26 cerase 1,28,MAXCOLS,28 cerase 1,58,MAXCOLS,58 cerase 34,60,MAXCOLS,60 cerase 1,62,MAXCOLS,62 # header section cerase 1,1,MAXCOLS,17 cbox LEFTCOL,1,RIGHTCOL,{MAXROWS-.5},MBOXSIZE merge "zMrg form header" text 1,4,{get(56,3,8,"UFTRIM")},HRFONT,12,cols=MAXRCOLS text 1,5,{get(77,3,7,"UFTRIM")},HRFONT,cols=MAXRCOLS # right header cbox 75,6,RIGHTCOL,12,MBOXSIZE,crows=8 10,ccols=83::ISHADE text 76,7,"Order",IFONT,10 text 76,9,"Page",IFONT,10 text 76,11,"Date",IFONT,10 text 84,7,{get(77,5,10,"UFTRIM")},DBFONT,10 text 84,9,{get(80,7,8,"UFTRIM")},DBFONT,10 text 84,11,{get(75,9,10,"UFTRIM")},DBFONT,10 # bill to section cbox LEFTCOL,12,RIGHTCOL,18,MBOXSIZE,ccols=10::ISHADE 41 50::ISHADE text 2,13,"Bill\nTo",ICFONT,10,cols=8 text 2,15,{get(10,12,8,"UFTRIM")},DBCFONT,10,cols=8 text 11,13,{mget(6,13,40,5,"UFSAVELF","UFTRIM")},DBFONT,10 # ship to section text 42,13,"Ship\nTo",ICFONT,10,cols=8 text 42,15,{get(59,12,8,"UFTRIM")},DBCFONT,10,cols=8 text 51,13,{mget(50,13,40,5,"UFSAVELF","UFTRIM")},DBFONT,10,fit,cols=34 # ribbon #1 cbox LEFTCOL,18,RIGHTCOL,22,MBOXSIZE,crows=20::ISHADE,ccols=18 30 61 77 cfont 2,19,17,19,ICFONT,10 cfont 19,19,29,19,ICFONT,10 cfont 31,19,60,19,ICFONT,10 cfont 62,19,76,19,ICFONT,10 cfont 78,19,MAXRCOLS,19,ICFONT,10 cfont 2,21,17,21,DBCFONT,10,fit cfont 19,21,29,21,DBCFONT,10 cfont 31,21,60,21,DBCFONT,10 cfont 62,21,76,21,DBCFONT,10 cfont 78,21,MAXRCOLS,21,DBCFONT,10 # ribbon #2 cbox LEFTCOL,22,RIGHTCOL,26,MBOXSIZE,crows=24::ISHADE,ccols=17 49 62 cfont 2,23,16,23,ICFONT,10 cfont 18,23,48,23,ICFONT,10 cfont 50,23,61,23,ICFONT,10 cfont 63,23,MAXRCOLS,23,ICFONT,10 cfont 2,25,16,25,DBCFONT,10 cfont 18,25,48,25,DBCFONT,10 cfont 50,25,61,25,DBCFONT,10 cfont 63,25,MAXRCOLS,25,DBCFONT,10 # detail cbox LEFTCOL,26,RIGHTCOL,58,MBOXSIZE,crows=28::DSHADE,ccols=32 41 50 60 63 75 79 cfont 2,27,31,27,IFONT,10 cfont 33,27,40,27,IRFONT,10 cfont 42,27,49,27,IRFONT,10 cfont 51,27,59,27,IRFONT,10 cfont 61,27,62,27,ICFONT,10 cfont 64,27,74,27,IRFONT,10 cfont 76,27,78,27,ICFONT,10 cfont 80,27,MAXRCOLS,27,IRFONT,10 cfont 2,29,31,57,DLFONT,10 cfont 33,29,40,57,DBRFONT,10 cfont 42,29,49,57,DBRFONT,10 cfont 51,29,59,57,DBRFONT,10 cfont 61,29,62,57,DCFONT,10 cfont 64,29,74,57,DBRFONT,10 cfont 76,29,78,57,DCFONT,10 cfont 80,29,MAXRCOLS,57,DBRFONT,10 # make item line bold font "~\.[0-9][0-9]@72,29,74,57",-70,0,30,1,DBLFONT # handle memo lines font "Serial Numbers:",0,0,15,1,DLFONT font "~ [A-Za-z0-9]@2,29,4,57",0,0,MAXCOLS,1,DLFONT # handle ship to lines font "SHIP TO:",0,0,8,1,IFONT,10 font "SHIP TO:",9,0,30,4,DBFONT,10,black font "Ship Via:",0,0,9,1,IRFONT,10 font "Ship Via:",10,0,30,1,DBFONT,10,black # Handle special lines cfont 2,{addrow},21,{addrow},DBLFONT cfont 6,{addrow+1},40,{taxrow-1},DBLFONT cfont 2,{taxrow},21,{taxrow},DBLFONT cfont 6,{taxrow+1},40,57,DBLFONT font "Deposit Applied:",0,0,17,1,DBRFONT # watermark - large font with light shading WATERMARK 1,57,{doc_title$},cgtimes,120,shade=WATERMARK_SHADE,center,cols=MAXCOLS, fit,spacing=1 # footer cfont 2,59,33,{MAXROWS-1},IFONT,10 cfont 35,59,48,59,IRFONT,10,proper cfont 50,59,63,59,IRFONT,10,proper cfont 65,59,78,59,IRFONT,10,proper cfont 80,59,MAXRCOLS,59,IRFONT,11,proper cfont 35,61,48,61,DBRFONT,10 cfont 50,61,63,61,DBRFONT,10 cfont 65,61,78,61,DBRFONT,10 cfont 80,61,MAXRCOLS,61,DBRFONT,11 text 1,{MAXROWS+.5},{cont$},HBRFONT,cols=MAXRCOLS text 1,{MAXROWS+.5},{copy_title$[copy]},HBCFONT,cols=MAXRCOLS merge "SO Invoice with Backorders","MERGE_FILE" [SO Invoice without Backorders] #dsn_sample "/u0/unform_test/takestock/txt/so_inv_noback_multi.txt" dsn_sample "/u0/unform_test/takestock/txt/so_inv_wotear_noback.txt" detect 64,5-6,"^ Invoice" detect 67,9-10,"~ Date DATEMASK" detect 84,7-8,"~[0-9]" # set up document constants local MAXCOLS=93 # max cols to output local MAXRCOLS=92 # MAXCOLS-1 local LEFTCOL=1 # left vertical line local RIGHTCOL=93 # right vertical line local MAXROWS=62 # max rows to output cols MAXCOLS # max output columns rows MAXROWS # max output rows local CUSTOMER_COPY=1 local SCANNING_COPY=2 local OFFICE_COPY=3 local MAX_COPIES=3 pcopies MAX_COPIES portrait dpi 600 # see global constant above GSON # graphical shading title "Invoice" # view in pdf properties prejob { dim copy_title$[MAX_COPIES] if MAX_COPIES>=1 then copy_title$[CUSTOMER_COPY]="Customer Copy" if MAX_COPIES>=2 then copy_title$[SIGNING_COPY]="" if MAX_COPIES>=3 then copy_title$[OFFICE_COPY]="Office Copy" doc_title$=upper(get(57,5,15,"UFTRIM")) } prepage { xrow=15;xcols=40 merge "zMrg get zip" xziplen=len(xzip$) if xziplen=5 or xziplen=9 or xziplen=11 then : x$="barcode 11,16.25,"+$22$+xzip$+$22$+",900,12.0,2" exec(x$) endif # get company info xcol=3,xrow=5,xcols=35,xrows=4 merge "zMrg get company info" # find additional charges and taxes lines addrow=58,taxrow=58 for row=29 to 57 if addrow=58 and pos("Additional Charges:"=text$[row]) then addrow=row if taxrow=58 and pos("Taxes:"=text$[row]) then taxrow=row next row # make sure taxes states don't mix with memos row=taxrow+1 while row < 58 if get(23,row,20,"UFTRIM")="" then break x$=trim(cut(23,row,30,"")) x$=sub(x$,"|","") x$=set(6,row,30,x$) row=row+1 wend # check for continued xcol=82,xrow=61 merge "zMrg check continued" if left(cont$,4)="Cont" then : x$=mset(34,59,MAXCOLS,4,"") else x$="cbox 34,58,RIGHTCOL,{MAXROWS-.5},MBOXSIZE,crows=60::HSHADE,ccols=49 64 79" exec(x$) endif } # erase vertical lines cerase 1,1,1,MAXROWS # ribbon 1 cerase 18,18,18,22 cerase 30,18,30,22 cerase 61,18,61,22 cerase 77,18,77,22 # ribbon 2 cerase 17,22,17,26 cerase 49,22,49,26 cerase 62,22,62,26 # detail - not all columns have | so use # conditional erase erase "|@22,26,22,58",0,0,1,1 erase "|@51,26,51,58",0,0,1,1 erase "|@60,26,60,58",0,0,1,1 erase "|@63,26,63,58",0,0,1,1 erase "|@75,26,75,58",0,0,1,1 erase "|@79,26,79,58",0,0,1,1 # totals cerase 34,58,34,62 cerase 49,58,49,62 cerase 64,58,64,62 cerase 79,58,79,62 cerase MAXCOLS,1,MAXCOLS,MAXROWS # erase horizontal lines cerase 1,2,MAXCOLS,2 cerase 1,18,MAXCOLS,18 cerase 1,20,MAXCOLS,20 cerase 1,22,MAXCOLS,22 cerase 1,24,MAXCOLS,24 cerase 1,26,MAXCOLS,26 cerase 1,28,MAXCOLS,28 cerase 1,58,MAXCOLS,58 cerase 34,60,MAXCOLS,60 cerase 1,62,MAXCOLS,62 # header section cerase 1,1,MAXCOLS,17 cbox LEFTCOL,1,RIGHTCOL,{MAXROWS-.5},MBOXSIZE merge "zMrg form header" text 1,4,{get(56,3,8,"UFTRIM")},HRFONT,12,cols=MAXRCOLS text 1,5,{get(77,3,7,"UFTRIM")},HRFONT,cols=MAXRCOLS # right header cbox 75,6,RIGHTCOL,12,MBOXSIZE,crows=8 10,ccols=83::ISHADE text 76,7,"Order",IFONT,10 text 76,9,"Page",IFONT,10 text 76,11,"Date",IFONT,10 text 84,7,{get(77,5,10,"UFTRIM")},DBFONT,10 text 84,9,{get(80,7,8,"UFTRIM")},DBFONT,10 text 84,11,{get(75,9,10,"UFTRIM")},DBFONT,10 # bill to section cbox LEFTCOL,12,RIGHTCOL,18,MBOXSIZE,ccols=10::ISHADE 41 50::ISHADE text 2,13,"Bill\nTo",ICFONT,10,cols=8 text 2,15,{get(10,12,8,"UFTRIM")},DBCFONT,10,cols=8 text 11,13,{mget(6,13,40,5,"UFSAVELF","UFTRIM")},DBFONT,10 # ship to section text 42,13,"Ship\nTo",ICFONT,10,cols=8 text 42,15,{get(59,12,8,"UFTRIM")},DBCFONT,10,cols=8 text 51,13,{mget(50,13,40,5,"UFSAVELF","UFTRIM")},DBFONT,10,fit,cols=34 # ribbon #1 cbox LEFTCOL,18,RIGHTCOL,22,MBOXSIZE,crows=20::ISHADE,ccols=18 30 61 77 cfont 2,19,17,19,ICFONT,10 cfont 19,19,29,19,ICFONT,10 cfont 31,19,60,19,ICFONT,10 cfont 62,19,76,19,ICFONT,10 cfont 78,19,MAXRCOLS,19,ICFONT,10 cfont 2,21,17,21,DBCFONT,10,fit cfont 19,21,29,21,DBCFONT,10 cfont 31,21,60,21,DBCFONT,10 cfont 62,21,76,21,DBCFONT,10 cfont 78,21,MAXRCOLS,21,DBCFONT,10 # ribbon #2 cbox LEFTCOL,22,RIGHTCOL,26,MBOXSIZE,crows=24::ISHADE,ccols=17 49 62 cfont 2,23,16,23,ICFONT,10 cfont 18,23,48,23,ICFONT,10 cfont 50,23,61,23,ICFONT,10 cfont 63,23,MAXRCOLS,23,ICFONT,10 cfont 2,25,16,25,DBCFONT,10 cfont 18,25,48,25,DBCFONT,10 cfont 50,25,61,25,DBCFONT,10 cfont 63,25,MAXRCOLS,25,DBCFONT,10 # detail cbox LEFTCOL,26,RIGHTCOL,58,MBOXSIZE,crows=28::DSHADE,ccols=22 51 60 63 75 79 cfont 2,27,21,27,IFONT,10 cfont 23,27,50,27,IFONT,10 cfont 52,27,59,27,IRFONT,10 cfont 61,27,62,27,ICFONT,10 cfont 64,27,74,27,IRFONT,10 cfont 76,27,78,27,ICFONT,10 cfont 80,27,MAXRCOLS,27,IRFONT,10 cfont 2,29,21,57,DBFONT,10 cfont 23,29,50,57,DLFONT,10 cfont 52,29,59,57,DBRFONT,10 cfont 61,29,62,57,DCFONT,10 cfont 64,29,74,57,DBRFONT,10 cfont 76,29,78,57,DCFONT,10 cfont 80,29,MAXRCOLS,57,DBRFONT,10 # handle memo lines font "~ [A-Za-z0-9]@2,29,4,57",0,0,MAXCOLS,1,DLFONT # Handle special lines cfont 2,{addrow},21,{addrow},DBLFONT cfont 6,{addrow+1},40,{taxrow-1},DBLFONT cfont 2,{taxrow},21,{taxrow},DBLFONT cfont 6,{taxrow+1},40,57,DBLFONT font "Deposit Applied:",0,0,17,1,DBRFONT # watermark - large font with light shading WATERMARK 1,57,{doc_title$},cgtimes,120,shade=WATERMARK_SHADE,center,cols=MAXCOLS, fit,spacing=1 # footer cfont 2,59,33,{MAXROWS-1},IFONT,10 cfont 35,59,48,59,IRFONT,10,proper cfont 50,59,63,59,IRFONT,10,proper cfont 65,59,78,59,IRFONT,10,proper cfont 80,59,MAXRCOLS,59,IRFONT,11,proper cfont 35,61,48,61,DBRFONT,10 cfont 50,61,63,61,DBRFONT,10 cfont 65,61,78,61,DBRFONT,10 cfont 80,61,MAXRCOLS,61,DBRFONT,11 text 1,{MAXROWS+.5},{cont$},HBRFONT,cols=MAXRCOLS text 1,{MAXROWS+.5},{copy_title$[copy]},HBCFONT,cols=MAXRCOLS merge "SO Invoice without Backorders","MERGE_FILE" [AP Check] dsn_sample "/u0/unform_test/takestock/txt/AP CHECKS MULTI PAGES.TXT" detect 61,5,"~ [0-1][0-9]/[0-3][0-9]/[0-9][0-9]" detect 70,29,"~ [0-1][0-9]/[0-3][0-9]/[0-9][0-9]" # set up document constants local MAXCOLS=80 # max cols to output local MAXRCOLS=79 # MAXCOLS-1 local LEFTCOL=1 # left vertical line local RIGHTCOL=80 # right vertical line local MAXROWS=66 # max rows to output cols MAXCOLS # max output columns rows MAXROWS # max output rows local ONE_STUB_COPY=1 local TWO_STUB_COPY=2 local MAX_COPIES=2 pcopies MAX_COPIES portrait dpi 600 # see global constant above GSON # graphical shading title "A/P Check" # view in pdf properties prepage { chkno$=get(50,5,8,"UFTRIM"),x$=set(50,5,8,"") chkdate$=get(62,5,8,"UFTRIM"),x$=set(62,5,8,"") chk_amt$=get(65,33,15,"UFTRIM"),x$=set(65,33,15,"") chk_amt_words$=get(1,32,60,"UFTRIM")+" "+get(1,33,60,"UFTRIM") x$=set(1,32,60,""),x$=set(1,33,60,"") vendor$=mget(9,37,35,4,"UFSAVELF","UFTRIM"),x$=mset(9,37,35,4,"") vendorname$=get(39,4,30,"UFTRIM") pgno$=get(77,5,2,"UFTRIM"),x$=set(77,5,2,"") ourcustno$=get(34,5,10,"UFTRIM"),x$=set(34,5,10,"") # check for continued cont$="" if pos("Continued..."=text$[21])=44 then x$=set(44,21,12,"");cont$="Continued on next check" # the following moves will leave a space between # the top two stubs # move check to bottom for i=23 to 44 text$[i+22]=text$[i] text$[i]="" # clear line next i # move stub up 1 row for i=1 to 21 text$[i]=text$[i+1] text$[i+1]="" next i # copy stub from top to middle for i=1 to 22 text$[i+22]=text$[i] next i # get comp info from constants? addr3$="COMP_ADDR3" save_addr3$=addr3$ phone$="Phone: COMP_PHONES" if trim(phone$)="Phone:" then phone$="" if addr3$="" then addr3$=phone$,phone$="" } precopy { if copy=ONE_STUB_COPY and copy<>AP_NO_STUBS then skip=1 if copy=ONE_STUB_COPY then x$=mset(1,1,MAXCOLS,21,"") if copy=TWO_STUB_COPY and copy<>AP_NO_STUBS then skip=1 } ########## Payor Stub (top) if copy TWO_STUB_COPY # top section text 2,1,"COMP_NAME",HBFONT text 2,1.9,"COMP_ADDR1",HFONT text 2,2.8,"COMP_ADDR2",HFONT text 2,3.7,{addr3$},HFONT text 2,4.6,{phone$},HFONT cbox 40,.5,RIGHTCOL,2.5,1,crows=1.5::ISHADE,ccols=53 text 41,1,"Vendor #",ICFONT,cols=12 text 41,2,{get(29,3,10,"UFTRIM")},DBCFONT,cols=12 text 54,1,"Vendor Name",ICFONT,cols=29 text 54,2,{vendorname$},DBCFONT,cols=29 cerase 29,3,MAXCOLS,3 cbox 40,2.5,RIGHTCOL,4.5,1,crows=3.5::ISHADE,ccols=53 63 73 text 41,3,"Our Cust #",ICFONT,cols=12 text 41,4,{ourcustno$},DBCFONT,cols=12 text 54,3,"Check Date",ICFONT,cols=9 text 54,4,{chkdate$},DBCFONT,cols=9 text 64,3,"Check #",ICFONT,cols=9 text 64,4,{chkno$},DBCFONT,cols=9 text 74,3,"Page #",ICFONT,cols=6 text 74,4,{pgno$},DBCFONT,cols=6 # detail cbox LEFTCOL,5.5,RIGHTCOL,19.5,1,crows=6.5::DSHADE,ccols=11 20 32 43 55 text 1,6,"Invoice #",ICFONT,cols=10 text 12,6,"Invoice Date",ICFONT,cols=8 text 21,6,"Amount",IRFONT,cols=11 text 33,6,"Discount",IRFONT,cols=10 text 44,6,"Amount Paid",IRFONT,cols=11 text 56,6,"Memo",IFONT,cols=20 cfont 1,7,10,19,DBCFONT # inv dt cfont 12,7,19,19,DBCFONT # inv # cfont 21,7,31,19,DBRFONT # inv amt cfont 33,7,42,19,DBRFONT # discount cfont 44,7,54,19,DBRFONT # paid amt cfont 56,7,MAXCOLS,19,IFONT # memo # footer cbox 11,19.5,55,20.5,1,ccols=20::100 20 32 43 text 12,20,"Totals",IBFONT,shade 0 cfont 21,20,31,20,DBRFONT # inv amt cfont 33,21,42,20,DBRFONT # discount cfont 44,20,54,21,DBRFONT # paid amt text 1,20.5,"Payor's Copy",IBRFONT,cols=MAXRCOLS text 1,21,{cont$},ICFONT,cols=MAXRCOLS cbox LEFTCOL,22,RIGHTCOL,22 endif ########### Vendor Stub # top section text 2,23,"COMP_NAME",HBFONT text 2,23.9,"COMP_ADDR1",HFONT text 2,24.8,"COMP_ADDR2",HFONT text 2,25.7,{addr3$},HFONT text 2,26.6,{phone$},HFONT cbox 40,22.5,RIGHTCOL,24.5,1,crows=23.5::ISHADE,ccols=53 text 41,23,"Vendor #",ICFONT,cols=12 text 41,24,{get(29,25,10,"UFTRIM")},DBCFONT,cols=12 text 54,23,"Vendor Name",ICFONT,cols=29 text 54,24,{get(39,25,30,"UFTRIM")},DBCFONT,cols=29 cerase 29,25,MAXCOLS,25 cbox 40,24.5,RIGHTCOL,26.5,1,crows=25.5::ISHADE,ccols=53 63 73 text 41,25,"Our Cust #",ICFONT,cols=12 text 41,26,{ourcustno$},DBCFONT,cols=12 text 54,25,"Check Date",ICFONT,cols=9 text 54,26,{chkdate$},DBCFONT,cols=9 text 64,25,"Check #",ICFONT,cols=9 text 64,26,{chkno$},DBCFONT,cols=9 text 74,25,"Page #",ICFONT,cols=6 text 74,26,{pgno$},DBCFONT,cols=6 # detail cbox LEFTCOL,27.5,RIGHTCOL,41.5,1,crows=28.5::DSHADE,ccols=11 20 32 43 55 text 1,28,"Invoice #",ICFONT,cols=10 text 12,28,"Invoice Date",ICFONT,cols=8 text 21,28,"Amount",IRFONT,cols=11 text 33,28,"Discount",IRFONT,cols=10 text 44,28,"Amount Paid",IRFONT,cols=11 text 56,28,"Memo",IFONT,cols=20 cfont 1,29,10,41,DBCFONT # inv dt cfont 12,29,19,41,DBCFONT # inv # cfont 21,29,31,41,DBRFONT # inv amt cfont 33,29,42,41,DBRFONT # discount cfont 44,29,54,41,DBRFONT # paid amt cfont 56,29,MAXCOLS,41,IFONT # memo # footer cbox 11,41.5,55,42.5,1,ccols=20::100 20 32 43 text 12,42,"Totals",IBFONT,shade 0 cfont 21,42,31,42,DBRFONT # inv amt cfont 33,42,42,42,DBRFONT # discount cfont 44,42,54,42,DBRFONT # paid amt text 1,42.5,"Vendor's Copy",IBRFONT,cols=MAXRCOLS text 1,43,{cont$},ICFONT,cols=MAXRCOLS cbox LEFTCOL,44,RIGHTCOL,44 ########### Check cbox LEFTCOL,47,RIGHTCOL,64.5,MBOXSIZE LOGO_IMAGE 1,47,10,5,"COMP_LOGO" text 15,48.25,"COMP_NAME",HBFONT,14 text 15,49.35,"COMP_ADDR1",HFONT,12 text 15,50.35,"COMP_ADDR2",HFONT,12 text 15,51.35,"COMP_ADDR3",HFONT,12 text 49,48.25,"AP_BANK_NAME",DBFONT text 49,49.05,"AP_BANK_ADDR1",DFONT text 49,49.85,"AP_BANK_ADDR2",DFONT text 70,49.35,"AP_ROUTING",DBFONT cerase 61,53,MAXCOLS,57 cbox 48,50.5,MAXCOLS,52.5,1,crows=51.5::100,ccols=57 67 text 49,51,"Check #",ICFONT,shade 0,cols=8 text 49,52,{chkno$},DBCFONT,cols=8 text 58,51,"Date",ICFONT,shade 0,cols=9 text 58,52,{chkdate$},DBCFONT,cols=9 text 68,51,"Amount",IRFONT,shade 0,cols=11 text 68,52,{chk_amt$},DBRFONT,cols=11 text 2,56,"Pay",IFONT,14 text 6.5,56,{chk_amt_words$},IBFONT,10,fit,cols=70 text 2,60,"Pay",IFONT text 2,61,"to the",IFONT text 2,62,"Order",IFONT text 2,63,"of",IFONT text 6.5,60,{vendor$},DBFONT text 50,59.50,"Check Void After 180 Days",ICFONT,cols=30 SIGNATURE_IMAGE 50,61,0,0,"SIGNATURE" box 50,62.0,30,1,3 text 50,62.75,"Authorized Signature",ICFONT,cols=30 AP_MICR 15,65.50,"AP_MICR_ACCOUNTNO",{chkno$} merge "AP Check","MERGE_FILE" [zMrg check continued] cont$="" if upper(get(xcol,xrow,9,"UFTRIM"))="CONTINUED" then : cont$="Continued on next page ... " x$=set(xcol,xrow,9,"") else cont$="... Last page " endif [zMrg form header] LOGO_IMAGE 1,1,12,6,"COMP_LOGO" text 1,2,{doc_title$},HBRFONT,16,cols=MAXRCOLS text 1,2,{compname$},HBCFONT,14,cols=MAXRCOLS text 1,3.2,{addr1$},HCFONT,12,cols=MAXRCOLS text 1,4.3,{addr2$},HCFONT,12,cols=MAXRCOLS text 1,5.4,{phone$},HCFONT,12,cols=MAXRCOLS text 1,6.5,"COMP_EMAIL",HCFONT,cols=MAXRCOLS text 1,7.5,"COMP_WEBSITE",HCFONT,cols=MAXRCOLS [zMrg get company info] # get comp info from page or constants? compname$=get(xcol,xrow,xcols,"UFTRIM") switch compname$ case "" compname$="COMP_NAME" addr1$="COMP_ADDR1" addr2$="COMP_ADDR2" break default addr1$=get(xcol,xrow+1,xcols,"UFTRIM") addr2$=get(xcol,xrow+2,xcols,"UFTRIM") end switch phone$="Phone: COMP_PHONES" [zMrg get zip] xzip$="" # Retrieve the zip code from either xrow or xrow-1 x=mask(left(text$[xrow],xcols),"[0-9][0-9][0-9][0-9][0-9]") if x>0 then xzip$=trim(get(x,xrow,10)) if x=0 then x=mask(trim(left(text$[xrow-1],xcols)),"[0-9][0-9][0-9][0-9][0-9]") if xzip$="" then if x>0 then xzip$=trim(get(x,xrow-1,10)) # has country? x=pos(" "=xzip$);if x then xzip$=xzip$(1,x-1) # strip - xzip$=sub(xzip$,"-","") # strip = (bad data) xzip$=sub(xzip$,"=","") [zMrg lform header] LOGO_IMAGE 1,1,14,6,"COMP_LOGO" text 1,2.5,{doc_title$},HBRFONT,16,cols=MAXRCOLS text 1,2,{compname$},HBCFONT,14,cols=MAXRCOLS text 1,3.2,{addr1$},HCFONT,12,cols=MAXRCOLS text 1,4.3,{addr2$},HCFONT,12,cols=MAXRCOLS text 1,5.4,{phone$},HCFONT,12,cols=MAXRCOLS text 1,6.5,"COMP_EMAIL",HCFONT,cols=MAXRCOLS text 1,7.5,"COMP_WEBSITE",HCFONT,cols=MAXRCOLS