# Copyright 2010, 2011 by Synergetic Data Systems Inc. All rights reserved. # Permission granted to users of Infor SX.e to use this file with a # trial or licensed UnForm 8.0 installation. ######################################################### # sxe-6.1.040-v80.rul rule file for NxTrend appl # # modified for international addresses # # will not work for versions below 6.1.040 # # works for form #1 & #3 # # works with portrait or landscape, see global settings # # Tested with UnForm version 8.0 # ######################################################### # 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 corrections # in a timely manner. # # The above assumes that no modifications # have been made to the application. # # Modification history # Last modified (saved) 01/03/2013 - BCJ # (6.1.x) Last modified 09/15/2011 - MJE # (See modification history details at bottom of this rule-set) # # rule sets included with this rule file # all work with form #1 & #3 # A/P: checks (short & long), overflow # A/R: statements # G/L: balance sheet, income statement # I/C: transfer packing lists # P/O: purchase orders, return merchandise forms # S/O: invoices, credit memos, pick slips # S/O: order acknowledgements, quotes, Bill of Lading # S/R: service repair order # also special reports with archiving and emailing # mje 072110 # re 'sds' and 'osx' rule-set versions # the following rule-sets have 2 rule-set versions: # acknowledgment , pick ticket, invoice, purchase order, # statement, and warehouse transfer # sds version uses sdsi look and feel for forms 1 and 3 # and includes a global toggle for portrait/landscape # osx version more closely matches sxe and is portrait only # To configure new 8.0 features added see below rule-set merge "8.0 zMrg Configurator" # 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="Phone: ###-###-#### Fax: ###-###-####" global COMP_EMAIL="E-Mail: xxx@yyy.com" global COMP_WEB="Website: www.xyz.com" # check info; often different than standard form address global COMPCK_NAME="COMP_NAME" global COMPCK_ADDR1="COMP_ADDR1" global COMPCK_ADDR2="COMP_ADDR2" global COMPCK_ADDR3="COMP_ADDR3" global COMPCK_PHONES="COMP_PHONES" # Portrait/Landscape constants global PORT_LAND_ACK ="portrait" global PORT_LAND_INV ="portrait" global PORT_LAND_PICK="portrait" global PORT_LAND_PO ="portrait" global PORT_LAND_XFER="portrait" # special replacements global ACK_SUGG_RTL=0 # on ack/qte replace disc with sugg rtl # Logos global LOGO_IMAGE="image" global COMP_LOGO="sdsilogo.pcl" # change to your logo file name # A/P check constants global AP_BANK_NAME="Bank Name" global AP_BANK_ADDR1="1 Bank Address" global AP_BANK_ADDR2="City CA 12345" global AP_ROUTING="12-345/6789" global AP_MICR_ACCOUNTNO=":123456789:9999-1234<34>" # the following globals will make it easy to turn off preprinting # on check portion of check determined by the # level of the preprinted. # just insert a # in front of all the globals that apply to # areas that are preprinted global AP_BNME="text" # bank info global AP_BRTR="text" # bank routing global AP_CBOX="cbox" # box/shading global AP_CNME="text" # company info global AP_IMGE="image" # logo global AP_MICR="micr" # micr global AP_PYTX="text" # pay / pay to the order global AP_RBBX="cbox" # ribbon box global AP_RBTX="text" # ribbon hdrs global AP_SNBX="box" # signature line global AP_SNTX="text" # signature text # check signature on AP/PR checks, global SIGNATURE_IMAGE="#image" # remove # to turn on global SIGNATURE="" # insert signature file name # check # format global CKMSK="00000000" # leading 0's #global CKMSK="########" # leading blanks # watermarks global WTRMRK_SHD=5 # adjust to desired darkness global WTRMRK="text" # remove # to turn on # change #gs on to gs on to turn on graphical shading # change gs on to #gs on to turn off graphical shading global GSON="#gs on" # standard merge rule set constants global LPCFONT=univers,10,bold,right global LPCLPMSG="...Last Page" global LPCONTMSG="Continued on next page..." global DCTFONT=univers,10,bold,center global XOFYS_FONT="univers,10,bold,right" global XOFYM_FONT="univers,10,bold,right" ## full page box thickness, 0=none global RPTFULLTBOX="5" # box line thickness global RPTHDR1FONT="univers,11" # default rpt hdr font # fonts to apply to the left column of headers global RPTL1FONT="RPTHDR1FONT,left" # row 1 global RPTL2FONT="RPTL1FONT,10" # row 2 global RPTL3FONT="RPTL1FONT,9" # row 3 and rest # fonts to apply to the center column of headers global RPTC1FONT="RPTHDR1FONT,12,bold,center"# row 1 global RPTC2FONT="RPTC1FONT,11" # row 2 global RPTC3FONT="RPTC1FONT,10" # row 3 and rest # fonts to apply to right column of headers global RPTR1FONT="RPTHDR1FONT,right" # row 1 global RPTR2FONT="RPTR1FONT,10" # row 2 global RPTR3FONT="RPTR1FONT,9" # row 3 and rest # rpt hdr delimiter global RPTHDRDLM=" " # hdr dlm # change "text" to "#text" to turn off # change "#text" to "text" to turn on global WTRMRK_CMD="text" # change to "#text" to turn off global WTRMRK_FONT="univers,144,center,shade=10" # 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 DPFONT= DFONT,decimal global DRFONT= DFONT,right global DSHADE= 10 # bold global DBFONT= DFONT,bold global DBLFONT=DBFONT,left global DBCFONT=DBFONT,center global DBPFONT=DBFONT,decimal global DBRFONT=DBFONT,right # default major section box size global MBOXSIZE=5 # # Modification history # # Last modified 05/15/2012 - BCJ @ SDSI # Last modified 12/07/2011 - MJE # # 08/04/08 - BCJ # modified a/p check to work for preprinted or semi preprinted checks # 09/25/08 - BCJ # added BOL rule set # 12/19/2008 -- BCJ # added balance sheet rule set # added income statement rule set # 03/16/2009 -- BCJ # added ability to swap discount column with sugg rtl # 07/30/2010 -- MJE # converted to 8.0 deliver and archiving standards # 08/12/2010 -- MJE # added archive entity ID's to zMrgArcpProps # 08/30/2010 -- MJE # took "Cst" and "Vnd" prefix off archive entity ID's in zMrgArcpProps # 09/21/2010 -- MJE # added if edel$="y" wrappers in various merge deliver logic rulesets # since OFF flag was not being honored # 10/28/2010 -- MJE # changed address method default in zMrg Configurator to trailer page # instead of address book, and reinstated zMrg ArcProps in internal # sdsi copy, and changed WH Transfer EDEL default to N in zMrg Configurator # 11/17/2010 -- MJE # - added missing ",entid {earca_entid$}" parameter to all archive commands # - created Osx version of zMrgFormHeader re comp web and email positions # not working, they're rem'd out and osx rulesets use it where appl. # 02/28/2011 -- MJE # updated 8.0 EDM5 TRAILPAGE ruleset with new routine that fixes # a problem when fax or email tag words are contained in the text stream # but are not part of the eDeliver trailer page # 05/26/2011 -- MJE # Changed default EDEL_* globals to =Y in Configurator # per request from Jeremiah Curtis of Infor # 06/15/2011 -- MJE # Changed zMrgArcprops to make archive library path a variable, # moved library name handling out of each case statement down # to the bottom of zMrgArcProps # 09/15/2011 -- BCJ # Corrected total header issue in Ack/Quote rule set # 12/07/2011 -- MJE # Added pagenum=1 wrapper in zMrgArcprops routine to prevent # library variable from being added to every page # 03/23/2012 -- BCJ @ SDSI # updated all forms to handle international addresses # updated/corrected all fields for location and length # 05/15/2012 -- BCJ @ SDSI # adjusted SR order for multi-page documents # 01/03/2013 -- BCJ @ SDSI # added special report rule set for archiving and emailing [--- Forms ---] #v8.0 # suggest starting all rule set names in this section # with "Frm" for easier organization # suggest keeping ALL "Frm" rules sets # grouped together [Acknowledgement/Quote osx] # applies to form format #3 # Version 8.0 IMPORTANT NOTE!! # THIS 'OSX' RULESET IS FOR FORM 3 'MINIMAL FORMATTING ONLY'. # IT IS NOT IN USE UNLESS BELOW DETECT IS UNREMARKED. # SEE THE SDS VERSION FOR DEFAULT FORM 1 AND FORM 3 HANDLING. #detect 0,2-3,"^Order Acknowledgement" # set up document constants local MAXCOLS=132 # max cols to output local MAXRCOLS=131 # MAXCOLS-1 local LEFTCOL=1 # left vertical line local RIGHTCOL=MAXCOLS # right vertical line local MAXROWS=60 # max rows to output cols MAXCOLS # max output columns rows MAXROWS # max output rows local CUSTOMER_COPY=1 local SCANNING_COPY=2 local FILE_COPY=3 local MAX_COPIES=3 copies MAX_COPIES portrait dpi 600 # see global constant above GSON # graphical shading title "Order Acknowledgement" # view in pdf properties # shift right 1 cmove LEFTCOL,1,RIGHTCOL,MAXROWS,2,1 # erase excess chars outside of form cerase 132,1,200,MAXROWS # header section merge "zMrg form header" cerase 1,1,150,18 # ship to text 2,8,"Ship\nTo:",ICFONT,10,cols=8 text 12,8,{ship$},DBFONT,10,fit,cols=45 # bill to text 2,14,"Bill\nTo:",ICFONT,10,cols=8 text 2,16,{get(11,4,13,1)},DBCFONT,cols=8 text 12,14,{bill$},DBFONT,10,fit,cols=49 # correspondence to text 55,8,"Correspondence\nTo:",ICFONT,10,cols=16 text 73,8,{comp_info$},DBFONT,10,fit,cols=49 # rt hdr cbox 96,3,RIGHTCOL,5,ccols=110 120,crows=4::ISHADE text 97,3.5,"UPC Vndr",ICFONT,cols=13 text 111,3.5,"Ack Date",ICFONT,cols=9 text 121,3.5,"Order #",ICFONT,cols=11 text 97,4.5,{get(93,3,10,1)},DBCFONT,cols=13 text 111,4.5,{docdate$},DBCFONT,cols=9 text 121,4.5,{docid$},DBCFONT,cols=11 cbox 96,5,RIGHTCOL,7,ccols=120,crows=6::ISHADE text 97,5.5,"PO #",ICFONT,cols=23 text 121,5.5,"Page #",ICFONT,cols=11 text 97,6.5,{custpo$},DBCFONT,cols=23 text 121,6.5,{get(129,5,4,1)},DBCFONT,cols=11 # instructions cbox 73,15.5,RIGHTCOL,17.5,crows=16.5::ISHADE,ccols=107 text 74,16,"Instructions",ICFONT,cols=32 text 105,16,"Terms",ICFONT,cols=28 text 74,17,{get(50,14,30,1)},DBCFONT,cols=32 text 105,17,{get(117,16,12,1)},DBCFONT,cols=28 cbox 73,17.5,RIGHTCOL,19.5,1,crows=18.5::ISHADE,ccols=107 120 text 74,18,"Ship Point",ICFONT,cols=32 text 108,18,"Via",ICFONT,cols=12 text 121,18,"Ship Date",ICFONT,cols=11 text 74,19,{get(50,16,30,1)},DBCFONT,cols=32 text 108,19,{get(82,16,12,1)},DBCFONT,cols=12,fit text 121,19,{get(104,16,8,1)},DBCFONT,cols=11 # detail section cbox LEFTCOL,20.5,RIGHTCOL,MAXROWS,MBOXSIZE text 2,21,"Ln\n#",ICFONT,cols=3 text 6,21.5,"Product and Description",IFONT text 39,21,"Quantity\nOrdered",IRFONT,cols=12 text 52,21,"Quantity\nBO",IRFONT,cols=11 text 65,21,"Quantity\nShipped",IRFONT,cols=11 text 77,21,"Qty\nU/M",ICFONT,cols=4 text 83,21,"Unit\nPrice",IRFONT,cols=13 text 97,21,"Price\nU/M",ICFONT,cols=4 text 103,21,"Discount\nPercent",IRFONT,cols=14 text 118,21,"Net\nAmount",IRFONT,cols=13 # remove upc five-digit numbers on item lines #erase " @4,22,4,MAXROWS",23,-1,10,1 # moved to prepage cfont 2,{dtlbgn},4,{dtlbtm},DCFONT cfont 6,{dtlbgn},37,{dtlbtm},DLFONT cfont 39,{dtlbgn},50,{dtlbtm},DBRFONT cfont 52,{dtlbgn},63,{dtlbtm},DRFONT cfont 65,{dtlbgn},75,{dtlbtm},DBRFONT cfont 77,{dtlbgn},80,{dtlbtm},DCFONT cfont 82,{dtlbgn},95,{dtlbtm},DBRFONT cfont 97,{dtlbgn},100,{dtlbtm},DCFONT cfont 103,{dtlbgn},116,{dtlbtm},DRFONT cfont 118,{dtlbgn},130,MAXROWS,DBRFONT cfont MAXRCOLS,{dtlbgn},MAXRCOLS,{dtlbtm},DBLFONT # memo/description lines font " @1,24,4,dtlbtm",5,0,90,1,DLFONT # group sub-totals box "=============",0,0,16,1 font "=============",-24,1,21,1,IBRFONT font "=============",0,1,16,1,DBRFONT,10 erase "=============",0,0,13,1 # footer font "Lines Total@5,22,17,57",-5,0,5,1,IBCFONT,cols=5 font "Lines Total@5,22,17,57",0,0,11,1,IBFONT font "Qty Shipped Total@44,22,61,57",0,0,19,1,IBRFONT font "Qty Shipped Total@44,22,61,57",20,0,8,1,DBRFONT cfont 98,{dtlbtm+1},116,{MAXROWS},IBRFONT,9,black,proper erase "Continued@1,50,10,MAXROWS",0,0,MAXCOLS,1 erase "Last Page@1,50,10,MAXROWS",0,0,MAXCOLS,1 merge "zMrg bottom row" # # the below 2 lines is to correct possible page 1 extra row 1 # for printer device designation # local RULESET="Order Acknowledgement" merge "zMrgAdjustPage1Issue" # --- 8.0 FEATURES ------------------------------------------------------ merge "Acknowledgement/Quote 8.0 Merge" # --- ORIGINAL CODE-BLOCK SECTION --------------------------------------- prejob { dim copy_title$[MAX_COPIES] if MAX_COPIES>=1 then : copy_title$[CUSTOMER_COPY]="Customer Copy" endif if MAX_COPIES>=2 then : copy_title$[SCANNING_COPY]="Scanning Copy" endif if MAX_COPIES>=3 then : copy_title$[FILE_COPY]="Office Copy" endif #used for total overflow tot_found=0 } # new stuff prepage { # new stuff email$ =get(1,21,60,1) x$ =set(1,21,MAXCOLS,"") doc_title$="ACKNOWLEDGEMENT" if pos("Quote Order"=text$[2]) then : doc_title$="QUOTE" endif docid$=get(121,3,12,1) docdate$=get(106,3,12,1) if docdate$="" then docdate$=get(94,5,8) custpo$=get(104,5,22,1) x$=set(1,21,MAXCOLS,"") xrow1=22,xrow2=MAXROWS merge "zMrg check continued" # 6.1.040 all address and postnet info zMrg # company/corresp, bill-to, ship-to xruleset$ ="ack-osx" merge "zMrg load addr info" # special line ribbon$ =get(1,18,500,1) x$ =set(1,18,500,"") # find dtlbtm dtlbgn=24,dtlbtm=MAXROWS for row=dtlbgn to dtlbtm if pos("Lines Total"=text$[row])=0 then continue dtlbtm=row-1 tot_found=1 break next row # totals rollover from prev page if tot_found=1 and dtlbtm=MAXROWS then : dtlbtm=dtlbgn endif # draw detail box dbox$="cbox LEFTCOL,20.5,RIGHTCOL," if dtlbtm=MAXROWS then : dbox$+="MAXROWS" else dbox$+=str(dtlbtm+0.5) endif dbox$+=",MBOXSIZE,crows=22.5::DSHADE,ccols=5 51 64 76 81 96 102 117" exec(dbox$) # watermark if dtlbtm<30 then : wmark_pos=MAXROWS-0.5 else wmark_pos=dtlbtm endif zbrow=wmark_pos,ztext$=doc_title$ merge "zMrg watermark" # shade item lines for easier reading shade_row=dtlbtm shd$="shade "+$22$+"~ ..[0-9A-Za-z]@1,22,4,"+STR(shade_row)+\ $22$+",0.5,0,MAXRCOLS,1,DSHADE" exec(shd$) # remove unwanted fields for row=dtlbgn to dtlbtm # first find item line if left(text$[row],4)=" " then continue # must be item line as no line # x$=set(30,row,5," ") next row } postpage { nextpgno$=get(129,5,4,1,pagenum+1) if nextpgno$="1" or nextpgno$="" then : tot_found=0 endif } [Acknowledgement/Quote sds] # applies to form format #1 & #3 detect 0,2-3,"^Order Acknowledgement" # set up document constants local MAXCOLS=134 # max cols to output local MAXRCOLS=133 # MAXCOLS-1 local LEFTCOL=1 # left vertical line local RIGHTCOL=MAXCOLS # right vertical line local MAXROWS=60 # max rows to output cols MAXCOLS # max output columns rows MAXROWS # max output rows local CUSTOMER_COPY=1 local SCANNING_COPY=2 local FILE_COPY=3 local MAX_COPIES=3 copies MAX_COPIES PORT_LAND_ACK dpi 600 # see global constant above GSON # graphical shading title "Order Acknowledgement" # view in pdf properties # shift right 1 cmove LEFTCOL,1,RIGHTCOL,MAXROWS,2,1 # erase excess chars outside of form cerase 132,1,200,MAXROWS # header section cerase 1,1,MAXCOLS,18 merge "zMrg form header" # bill to text 2,9,"Bill To:",IFONT,10 text 10,9,{get(12,4,12,1)},DBFONT,10 text 2,10,{bill$},DBFONT,10,fit,cols=45 # ship to text 55,9,"Ship To",ICFONT,10,cols=7 text 55,10,{ship$},DBFONT,10,fit,cols=40 # rt hdr cbox 97,3.5,RIGHTCOL,9.5,1,ccols=107::ISHADE,crows=4.5 5.5 6.5 7.5 8.5 9.5 cbox 99,9.5,RIGHTCOL,15.5,1,ccols=107::ISHADE,crows=10.5 11.5 12.5 13.5 14.5 cbox 97,9.5,99,15.5,1 text 98,4,"Order #",IFONT text 98,5,"Page #",IFONT text 98,6,"UPC Vndr",IFONT text 98,7,"Ship Point",IFONT text 98,8,"Via",IFONT text 98,9,"Terms",IFONT text 97.3,10.5,"D\nA\nT\nE\nS",IBCFONT,cols=2 text 100,10,"Entered",IFONT text 100,11,"P/O",IFONT text 100,12,"Picked",IFONT text 100,13,"Shipped",IFONT text 100,14,"Invoiced",IFONT text 100,15,"Printed",IFONT text 108,4,{docid$},DBFONT text 108,5,{get(129,5,4,1)},DBFONT text 108,6,{get(95,3,6,1)},DBFONT text 108,7,{get(50,16,30,1)},DBFONT,fit,cols=25 text 108,8,{get(82,16,12,1)},DBFONT text 108,9,{get(117,16,12,1)},DBFONT text 108,10,{entereddate$},DBFONT #text 108,11,"",DBFONT # no P/O date text 108,12,{pickeddate$},DBFONT text 108,13,{get(104,16,8,1)},DBFONT text 108,14,{docdate$},DBFONT text 108,15,{printed$},DBFONT # instructions cbox 97,16,RIGHTCOL,18,1,crows=17::ISHADE text 98,16.5,"Instructions",ICFONT,cols=35 text 98,17.5,{get(50,14,30,1)},DBCFONT,fit,cols=35 # detail section cbox LEFTCOL,19.5,RIGHTCOL,MAXROWS,MBOXSIZE cfont 2,20,4,21,IRFONT cfont 6,20,29,21,IFONT cfont 31,20,37,21,IRFONT cfont 39,20,50,21,IRFONT cfont 52,20,63,21,IRFONT cfont 65,20,75,21,IRFONT cfont 77,20,80,21,ICFONT cfont 82,20,95,21,IRFONT cfont 97,20,101,21,ICFONT cfont 103,20,116,21,IRFONT cfont 118,20,{MAXRCOLS-1},21,IRFONT cfont 2,21,4,57,DRFONT cfont 6,22,29,57,DBLFONT cfont 31,22,37,57,DRFONT cfont 39,22,50,57,DBRFONT cfont 52,22,63,57,DBRFONT cfont 65,22,75,57,DBRFONT cfont 77,22,80,57,DCFONT cfont 82,22,95,57,DBRFONT cfont 97,22,101,57,DCFONT cfont 103,22,116,57,DBRFONT,black cfont 118,22,{MAXRCOLS-1},57,DBRFONT cfont MAXRCOLS,22,MAXRCOLS,57,DBLFONT # sign # mje 062011 cfont 83,{dtlbtm+1},115,{MAXROWS-1},IBRFONT,black,proper # memo/description lines font " @1,21,4,trow",5,0,90,1,DLFONT # handle serial # lines font "SERIAL #:",0,0,9,1,IFONT,proper,10 font "SERIAL #:",9,0,MAXCOLS,1,DBFONT,10 # group sub-totals box "=============",0,0,16,1 font "=============",-24,1,21,1,IBRFONT font "=============",0,1,16,1,DBRFONT,10 erase "=============",0,0,13,1 # footer erase "Continued@1,50,10,MAXROWS",0,0,9,1 erase "Last Page@1,50,10,MAXROWS",0,0,9,1 font "Lines Total@5,22,17,57",0,0,11,1,IBFONT font "Qty Shipped Total@44,22,61,57",0,0,19,1,IBRFONT cfont 98,{dtlbtm+1},115,{MAXROWS},IBRFONT,black,proper merge "zMrg bottom row" # # the below 2 lines is to correct possible page 1 extra row 1 # for printer device designation # local RULESET="Order Acknowledgement" merge "zMrgAdjustPage1Issue" # --- 8.0 FEATURES ------------------------------------------------------ merge "Acknowledgement/Quote 8.0 Merge" # --- ORIGINAL CODE-BLOCK SECTION --------------------------------------- prejob { dim copy_title$[MAX_COPIES] if MAX_COPIES>=1 then : copy_title$[CUSTOMER_COPY]="Customer Copy" endif if MAX_COPIES>=2 then : copy_title$[SCANNING_COPY]="Scanning Copy" endif if MAX_COPIES>=3 then : copy_title$[FILE_COPY]="Office Copy" endif #used for total overflow tot_found=0 } # new stuff prepage { # new stuff email$ =get(1,21,60,1) x$ =set(1,21,MAXCOLS,"") } prepage { # check for format # form3=0 if trim(text$[18])<>"" then form3=1 # was row 16 if form3 then : dtlhdr$=rtrim(cut(1,12,300,"")) # was row 11 ribbon$=trim(cut(1,18,300,"")) # was row 16 endif # set detail headers if form3 then : text$[20]=" Product UPC Quantity Quantity Quantity Qty. Unit Price Discount Amount" text$[21]="Ln# And Description Item# Ordered B.O. Shipped UM Price UM Multiplier (Net)" endif doc_title$="ACKNOWLEDGEMENT" if pos("Quote Order"=text$[2]) then : doc_title$="QUOTE" endif # set ribbon if form3 then : # load rx ribbon data printed$=trim(left(ribbon$,14)) pickeddate$=trim(mid(ribbon$,94,8)) entereddate$=trim(mid(ribbon$,86,8)) custpo$=trim(mid(ribbon$,38,24)) shipdate$=trim(mid(ribbon$,102,8)) takenby$=trim(mid(ribbon$,16,4)) slsrepin$=trim(mid(ribbon$,20,4)) slsrepout$=trim(mid(ribbon$,24,4)) placedby$=trim(mid(ribbon$,28,10)) # load for new ribbon x$ ="cbox LEFTCOL,17,95,18,MBOXSIZE,ccols=9::ISHADE 15 23::ISHADE 29 37::ISHADE 43 51::ISHADE 62 73::ISHADE" x$+=$0a$+"text 2,17.5,"+$22$+"Taken By"+$22$+",IFONT,cols=7" x$+=$0a$+"text 10,17.5,"+$22$+takenby$+$22$+",DBFONT,fit,cols=5" x$+=$0a$+"text 16,17.5,"+$22$+"Sales in"+$22$+",IFONT,cols=7" x$+=$0a$+"text 24,17.5,"+$22$+slsrepin$+$22$+",DBFONT,fit,cols=5" x$+=$0a$+"text 30,17.5,"+$22$+"Sales out"+$22$+",IFONT,cols=7" x$+=$0a$+"text 38,17.5,"+$22$+slsrepout$+$22$+",DBFONT,fit,cols=5" x$+=$0a$+"text 44,17.5,"+$22$+"Placed by"+$22$+",IFONT,cols=7" x$+=$0a$+"text 52,17.5,"+$22$+placedby$+$22$+",DBFONT,fit,cols=10" x$+=$0a$+"text 63,17.5,"+$22$+"Customer P/O"+$22$+",IFONT,cols=10" x$+=$0a$+"text 74,17.5,"+$22$+custpo$+$22$+",DBFONT,fit,cols=22" exec(x$) else if custpo$="" then : custpo$=get(104,5,22,1) endif if shipdate$="" then : shipdate$=get(104,16,8,1) endif x$ ="cbox LEFTCOL,17,95,18,MBOXSIZE,ccols=12::ISHADE" x$+=$0a$+"text 2,17.5,"+$22$+"Customer P/O"+$22$+",IFONT,cols=10" x$+=$0a$+"text 13,17.5,"+$22$+custpo$+$22$+",DBFONT,fit,cols=22" exec(x$) endif docid$=get(122,3,11,1) docdate$=get(108,3,8,1) if docdate$="" then docdate$=get(94,5,8,1) if docdate$="" then docdate$=get(1,18,8,1) custpo$=get(104,5,22,1) xrow1=22,xrow2=MAXROWS merge "zMrg check continued" # 6.1.040 all address and postnet info zMrg # company/corresp, bill-to, ship-to xruleset$ ="ack-sds" merge "zMrg load addr info" # find dtlbtm dtlbgn=22,dtlbtm=MAXROWS for row=dtlbgn to dtlbtm if pos("Lines Total"=text$[row])=0 then continue dtlbtm=row-1 tot_found=1 break next row # totals rollover from prev page if tot_found=1 and dtlbtm=MAXROWS then : dtlbtm=24 endif # remove unwanted detail & move wanted detail for row=dtlbgn to dtlbtm if trim(left(text$[row],3))="" then continue # must be a detail line to strip or move # do strips first then moves if ACK_SUGG_RTL then : x$=set(101,row,12,"") x$=get(144,row,12) x$=set(101,row,12,x$) text$[19]=sub(text$[19]," Discount","Suggested") text$[20]=sub(text$[20],"Multiplier"," Retail") endif next row # detail box dbox$="cbox LEFTCOL,19.5,RIGHTCOL," if dtlbtm=MAXROWS then : dbox$+="MAXROWS" else dbox$+=str(dtlbtm+0.5) endif dbox$+=",MBOXSIZE,crows=21.5::DSHADE,ccols=5 30 38 51 64 76 81 96 102 117" exec(dbox$) # watermark if dtlbtm<30 then : wmark_pos=MAXROWS-0.5 else wmark_pos=dtlbtm-.5 endif zbrow=wmark_pos,ztext$=doc_title$ merge "zMrg watermark" # shade item lines for easier reading shade_row=dtlbtm shd$="shade "+$22$+"~ ..[0-9A-Za-z]@1,22,4,"+STR(shade_row)+\ $22$+",0.5,0,MAXRCOLS,1,DSHADE" exec(shd$) } postpage { nextpgno$=get(129,5,4,1,pagenum+1) if nextpgno$="1" or nextpgno$="" then : tot_found=0 endif } [Acknowledgement/Quote 8.0 Merge] # --- 8.0 ARCHIVING ---------------------------------------------------- const ARCRULE="order ack quote" prepage { noarchive=1 earc_archive$="EARC_ORDACKQUO",doing_recat=0 if lower(earc_archive$)="y": noarchive=0 if not(uf.subjob): gosub process_arcProps # see the 8.0 zMrg ArcProps ruleset endif endif } merge "8.0 zMrg ArcProps" if uf.arcenabled ARCHIVE {earca_library$},{earca_doctype$},{earca_docid$},subid {earca_subid$},title {earca_title$},notes {earca_notes$},keywords {earca_keywords$},categories {earca_cats$},links {earca_links$},args {earca_args$},dtm {earca_dtm$},subtitle {earca_subtitle$},subdtm {earca_subdtm$}, entid {earca_entid$} endif # --- SCANNING BARCODE -------------------------------------------------- prepage { bcod_docid$=get(122,3,11,1) } precopy { # Add barcodes for scanning interface. bcod$="BCOD_ORDACKQUO" # Y/N Switch from global section bcod_Copies$="2" # which copy(s) get barcode if lower(bcod$)="y" then: if pos(str(copy)=bcod_Copies$): bcod_docty$="ACK" if earca_doctype$="Quote" bcod_docty$="QUO" rows$=str(MAXROWS+7) cmd$="text 2,"+str(MAXROWS+1.5)+","+$22$+"Do not write below this line"+$22$+",cgtimes,10,italic" cmd$+=$0a$+"cbox LEFTCOL,"+str(MAXROWS+2)+",RIGHTCOL,"+str(MAXROWS+2) # use of 'text' in below barcode commands requires # UnForm Windows Support Server cmd$+=$0a$+"barcode "+str(inchtocols(.5))+","+str(MAXROWS+4)+","+$22$+bcod_docty$+$22$+",BCSYMB,18.0,6,text" cmd$+=$0a$+"barcode "+str(inchtocols(3.5))+","+str(MAXROWS+4)+","+$22$+bcod_DocID$+$22$+",BCSYMB,18.0,6,text" exec(cmd$) end if end if } # --- PAGE X of Y FEATURE ----------------------------------------------- # change XOFYM_COPIES to "0" to turn off local XOFYM_COPIES="ALL" # or copy #'s to display local XOFYM_DROW =MAXROWS+.5 # row to display title # location of unique doc id local XOFYM_COL =122 # adjust as needed local XOFYM_ROW =3 # adjust as needed local XOFYM_NCOLS =11 # adjust as needed global XOFYM_FONT="univers,10,bold,left" merge "zMrgMultiPageXofY" # # --- 8.0 DELIVER ------------------------------------------------------ # deliver email command - no change needed, ref tags in deliver.ini deliver {eaddr$},{einvno$},args {eArg$},from {efrom$},cc {ecccc$},bcc {ebbcc$},subject {esubj$},note {ebody$},login {elogn$},password {epswd$},attach {etach$},otherhead {eohdr$},bodymime {emime$},combine {eCombine$} # deliver fax command - no change needed, ref tags in deliver.ini deliver {faddr$},{finvno$},args {fArg$},fromname {ffrom$},subject {fsubj$},note {fbody$},coverpage {fcovr$},attach {ftach$},toname {ftnam$},tocompany {ftoco$},fromcompany {ffrco$},combine {fCombine$} prepage { # form-based data locations edel$="EDEL_ORDACKQUO" if lower(edel$)="y": eDocid$=get(122,3,11) # Required ALL methods eForm$="Order-Ack" eAddrEnt$=get(12,4,12) endif } # ADDRESS RETRIVAL METHODS merge "EDEL_METHOD" # EMAIL defaults or overrides, remove conditional for override prepage { if lower(edel$)="y": if not(uf.subjob): if eAddr$<>"": # email, ref tags in deliver.ini if ecopy$="" ecopy$="1" if efrom$="" efrom$="" if esubj$="" esubj$=eForm$+" "+eDocid$ if ebody$="" ebody$="" if etach$="" etach$="" if ecccc$="" ecccc$="" if ebbcc$="" ebbcc$="" if eohdr$="" eohdr$="" if elogn$="" elogn$="" if epswd$="" epswd$="" if emime$="" emime$="text/html" if pcopy$="" pcopy$="" eArg$="-ce "+ecopy$ eCombine$="no" endif endif endif } # FAX defaults or overrides, remove conditional for override prepage { if lower(edel$)="y": if not(uf.subjob): if fAddr$<>"": # fax, ref tags in deliver.ini if fcopy$="" fcopy$="1" if ffrom$="" ffrom$="" if fsubj$="" fsubj$=eForm$+" "+eDocid$ if fbody$="" fbody$="" if ftach$="" ftach$="" if fcovr$="" fcovr$="" # Fax Pkg cover page if ftnam$="" ftnam$="" if ftoco$="" ftoco$="" if ffrco$="" ffrco$="" if pcopy$="" pcopy$="" fArg$="-ce "+fcopy$ fCombine$="no" endif endif endif } # Include an unForm-generated cover page # merge "8.0 Cover Page" # remark this to ALWAYS print ALL copies of a delivered document merge "8.0 ED Selective Copy Printing" [Invoice/Credit Memo osx] # applies to form format #3 # Version 8.0 IMPORTANT NOTE!! # THIS 'OSX' RULESET IS FOR FORM 3 'MINIMAL FORMATTING ONLY'. # IT IS NOT IN USE UNLESS BELOW DETECT IS UNREMARKED. # SEE THE SDS VERSION FOR DEFAULT FORM 1 AND FORM 3 HANDLING. #detect 12,2-3,"^Invoice" # set up document constants local MAXCOLS=122 # 114 max cols to output local MAXRCOLS=121 # 113 MAXCOLS-1 local LEFTCOL=1 # left vertical line local RIGHTCOL=MAXCOLS # right vertical line local MAXROWS=61 # max rows to output cols MAXCOLS # max output columns rows MAXROWS # max output rows local CUSTOMER_COPY=1 local SCANNING_COPY=2 local FILE_COPY=3 local MAX_COPIES=3 copies MAX_COPIES portrait dpi 600 # see global constant above # GSON # graphical shading title "Invoice" # view in pdf properties # shift over 1 and down 4 cmove 1,1,MAXCOLS,MAXROWS,2,2 cerase {MAXCOLS+1},1,300,MAXROWS # header section cerase 1,1,MAXCOLS,23 merge "zMrg form header" # rt ribbon 1 cbox 90,3.5,RIGHTCOL,5.5,1,crows=4.5::ISHADE,ccols=100 110 text 91,4,"Inv Date",ICFONT,cols=9 text 91,5,{invdate$},DBCFONT,cols=9 text 101,4,"UPC Vendor",ICFONT,cols=8 text 101,5,{upc_vndr$},DBCFONT,cols=8 text 111,4,"Order #",ICFONT,cols=11 text 111,5,{ordno$},DBCFONT,cols=11 cbox 90,5.5,RIGHTCOL,7.5,1,crows=6.5::ISHADE,ccols=114 text 91,6,"PO #",ICFONT,cols=23 text 91,7,{pono$},DBCFONT,cols=23,fit text 115,6,"Page #",ICFONT,cols=7 text 115,7,{pgno$},DBCFONT,cols=7 # ship to text 2,9,"Ship\nTo:",ICFONT,9,cols=11 text 12,9,{ship$},DBFONT,10 # bill to text 2,16,"Bill\nTo:",ICFONT,9,cols=11 text 2,18,{custno$},DBCFONT,10,cols=11 text 12,16,{bill$},DBFONT,10 # correspondance to text 55,9,"Correspondence\nTo:",ICFONT,9,cols=15 text 71,9,{comp_info$},DBFONT,10 # rt ribbon 2 cbox 70,16.5,RIGHTCOL,18.5,1,crows=17.5::ISHADE,ccols=101 text 71,17,"Instructions",ICFONT,cols=30 text 71,18,{inst$},DBCFONT,cols=30,fit text 102,17,"Terms",ICFONT,cols=20 text 102,18,{terms$},DBCFONT,cols=20,fit cbox 70,18.5,RIGHTCOL,20.5,1,crows=19.5::ISHADE,ccols=101 113 text 71,19,"Ship Point",ICFONT,cols=30 text 71,20,{ship_point$},DBCFONT,cols=30,fit text 102,19,"Ship Via",ICFONT,cols=11 text 102,20,{via$},DBCFONT,cols=11,fit text 114,19,"Shipped",ICFONT,cols=8 text 114,20,{shipdate$},DBCFONT,cols=8 # detail text 2,{dtlbgn-1},"Ln#",ICFONT,cols=3 text 6,{dtlbgn-2},"Product\nAnd Description",ILFONT text 37,{dtlbgn-2},"Quantity\nOrdered",IRFONT,cols=9 text 47,{dtlbgn-2},"Quantity\nB/O",IRFONT,cols=13 text 61,{dtlbgn-2},"Quantity\nShipped",IRFONT,cols=12 text 74,{dtlbgn-2},"Qty\nU/M",ICFONT,cols=8 text 83,{dtlbgn-2},"Unit\nPrice",IRFONT,cols=11 text 97,{dtlbgn-2},"Price\nUnit",ICFONT,cols=7 text 105,{dtlbgn-2},"Amount\n(Net)",IRFONT,cols=17 cfont 2,{dtlbgn},4,{dtlbtm},DCFONT cfont 6,{dtlbgn},35,{dtlbtm},DLFONT cfont 37,{dtlbgn},45,{dtlbtm},DBRFONT cfont 47,{dtlbgn},59,{dtlbtm},DBRFONT cfont 61,{dtlbgn},72,{dtlbtm},DBRFONT cfont 74,{dtlbgn},81,{dtlbtm},DCFONT cfont 83,{dtlbgn},93,{dtlbtm},DBRFONT cfont 97,{dtlbgn},100,MAXROWS,DRFONT cfont 105,{dtlbgn},MAXRCOLS,MAXROWS,DBRFONT,10 # lot lines box "Lot #:@9,1,16,66",-3.5,-.3,45,.65,1,icols=8::DSHADE 31 36::DSHADE font "Lot #:@9,1,16,66",-3,0,9,1,ILFONT font "Lot #:@9,1,16,66",7,0,21,1,DBLFONT font "Lot #:@9,1,16,66",29,0,4,1,IFONT font "Lot #:@9,1,16,66",35,0,30,1,DBFONT,black # footer cfont 2,{dtlbtm+1},4,{dtlbtm+1},DBRFONT,10 cfont 6,{dtlbtm+1},16,{dtlbtm+1},IBLFONT,10 cfont 34,{dtlbtm+1},51,{dtlbtm+1},IBFONT,10 cfont 53,{dtlbtm+1},61,{dtlbtm+1},DBLFONT,10 cfont 81,{dtlbtm+1},100,MAXROWS,IBRFONT,10 erase "CREDIT - DO NOT PAY",0,1,30,1 # place signature image 1,{MAXROWS-1},20,5,{sigfile$} erase "Continued@1,50,10,MAXROWS",0,0,MAXCOLS,1 erase "Last Page@1,50,10,MAXROWS",0,0,MAXCOLS,1 merge "zMrg bottom row" # # the below 2 lines is to correct possible page 1 extra row 1 # for printer device designation # local RULESET="Invoice" merge "zMrgAdjustPage1Issue" # --- 8.0 FEATURES ------------------------------------------------------ merge "Invoice/Credit Memo 8.0 Merge" # --- ORIGINAL CODE-BLOCK SECTION --------------------------------------- prejob { dim copy_title$[MAX_COPIES] if MAX_COPIES>=1 then : copy_title$[CUSTOMER_COPY]="Customer Copy" endif if MAX_COPIES>=2 then : copy_title$[SCANNING_COPY]="Scanning Copy" endif if MAX_COPIES>=3 then : copy_title$[FILE_COPY]="Office Copy" endif } prepage { # new stuff faxno$ =get(1,23,15,1) termspct$ =get(16,23,5,1) email$ =get(21,23,60,1) x$ =set(1,23,MAXCOLS,"") # get doc title doc_title$="INVOICE" if pos("Return Merchandise"=text$[2]) then : doc_title$="Credit Memo" endif # load detail header dtlhdr$=rtrim(cut(1,12,300,"")) # rx extra info for possible use. ribbon$=trim(cut(1,20,300,"")) xrow=2 merge "zMrg check reprint" # 6.1.040 all address and postnet info zMrg # company/corresp, bill-to, ship-to xruleset$ ="inv-osx" merge "zMrg load addr info" # get cash discount cash_disc$=trim(cut(30,60,300,"")) xrow1=56,xrow2=MAXROWS merge "zMrg check continued" if left(cont$,4)<>"Last" then cash_disc$="" # load hdr text custno$=get(12,4,12,1) # load rt ribbon 1 upc_vndr$=get(93,3,6,1) invdate$=get(106,3,8,1) ordno$=get(121,3,10,1) entdate$=get(94,5,8,1) pono$=get(104,5,22,1) pgno$=get(129,5,4,1) # check for signature sigfile$="SIGDIR"+ordno$+".bmp" test=unt open(test,err=*next)sigfile$ if err=12 then sigfile$="" if sigfile$<>"" then : rows$=str(MAXROWS+2) endif # load rt ribbon 2 inst$=get(50,15,30,1) ship_point$=get(50,18,30,1) via$=get(81,18,12,1) shipdate$=get(105,18,8,1) terms$=get(117,18,12,1) # find dtlbtm dtlbgn=27,dtlbtm=MAXROWS for row=dtlbgn to dtlbtm if pos("Lines Total"=text$[row])=0 then continue dtlbtm=row break next row # mje 010708 wrapper re archive # if not(uf.subjob) then : # remove unwanted detail & move wanted detail for row=dtlbgn to dtlbtm-1 if trim(left(text$[row],3))="" then continue # must be a detail line to strip or move # do strips first x$=set(30,row,5," ") x$=set(96,row,4," ") x$=set(102,row,10,"") # now process moves x$=cut(113,row,18,"") # ***************** x$=set(96,row,18,x$) next row # now shift totals for row=dtlbtm to MAXROWS x$=trim(cut(44,row,28,"")) # ***************** x$=set(34,row,28,x$) x$=trim(cut(97,row,33,"")) # ***************** x$=set(80,row,33,x$) next row # endif # draw detail box x$="cbox LEFTCOL,"+str(dtlbgn-3)+",RIGHTCOL,"+\ str(dtlbtm)+",MBOXSIZE,crows="+str(dtlbgn-.5)+\ "::DSHADE,ccols=5 60 73 82 94 104" exec(x$) # draw bottom box x$="cbox LEFTCOL,"+str(dtlbtm)+",RIGHTCOL,MAXROWS,MBOXSIZE" if dtlbtm<>MAXROWS then exec(x$) # shade item lines for easier reading xshd$="" for row=dtlbgn to dtlbtm-1 xx$=get(1,row,4,1) if xx$<"0" or xx$>"999" then continue xshd$+="shade 1.5,"+str(row+1.25)+",MAXRCOLS,.5,DSHADE"+$0a$ next row if xshd$<>"" then exec(xshd$) # memo lines for row=dtlbgn to dtlbtm x$=trim(left(text$[row],3)) if x$<>"" then continue x$="cfont 6,"+str(row+1)+",100,"+str(row+1)+",DLFONT" exec(x$) next row # watermark zbrow=dtlbtm-.5,ztext$=doc_title$ if dtlbtm-dtlbgn<10 then zbrow=MAXROWS-.5 merge "zMrg watermark" } [Invoice/Credit Memo sds] # applies to form format #1 & #3 detect 12,2-3,"^Invoice" # set up document constants local MAXCOLS=134 # max cols to output local MAXRCOLS=133 # MAXCOLS-1 local LEFTCOL=1 # left vertical line local RIGHTCOL=MAXCOLS # right vertical line local MAXROWS=61 # max rows to output cols MAXCOLS # max output columns rows MAXROWS # max output rows local CUSTOMER_COPY=1 local SCANNING_COPY=2 local FILE_COPY=3 local MAX_COPIES=3 copies MAX_COPIES PORT_LAND_INV dpi 600 # see global constant above GSON # graphical shading title "Invoice" # view in pdf properties # shift right 1 cmove LEFTCOL,1,RIGHTCOL,MAXROWS,2,1 # header section cerase 1,1,MAXCOLS,19 merge "zMrg form header" # bill to text 2,9,"Bill To:",IFONT,10 text 11,9,{get(12,4,12,1)},DBFONT,10 text 2,10,{bill$},DBFONT,10,fit,cols=50 # ship to text 55,9,"Ship To",IFONT,10 text 55,10,{ship$},DBFONT,10,fit,cols=40 # rt hdr cbox 97,3.5,RIGHTCOL,9.5,1,ccols=107::ISHADE,crows=4.5 5.5 6.5 7.5 8.5 9.5 cbox 99,9.5,RIGHTCOL,15.5,1,ccols=107::ISHADE,crows=10.5 11.5 12.5 13.5 14.5 cbox 97,9.5,99,15.5,1 text 98,4,"Order #",IFONT text 98,5,"Page #",IFONT text 98,6,"UPC Vndr",IFONT text 98,7,"Ship Point",IFONT text 98,8,"Via",IFONT text 98,9,"Terms",IFONT text 97.3,10.5,"D\nA\nT\nE\nS",IBCFONT,cols=2 text 100,10,"Entered",IFONT text 100,11,"P/O",IFONT text 100,12,"Picked",IFONT text 100,13,"Shipped",IFONT text 100,14,"Invoiced",IFONT text 100,15,"Printed",IFONT text 108,4,{docid$},DBFONT text 108,5,{pgno$},DBFONT text 108,6,{upc_vndr$},DBFONT text 108,7,{ship_point$},DBFONT,fit,cols=26 text 108,8,{via$},DBFONT,fit,cols=23 text 108,9,{terms$},DBFONT,fit,cols=23 text 108,10,{entdate$},DBFONT,fit,cols=23 text 108,11,"",DBFONT # no p/o date text 108,12,{pickeddate$},DBFONT text 108,13,{shipdate$},DBFONT text 108,14,{docdate$},DBFONT text 108,15,{printed$},DBFONT # instructions cbox 97,16,RIGHTCOL,18,1,crows=17::ISHADE text 98,16.5,"Instructions",ICFONT,cols=35 text 98,17.5,{inst$},DBCFONT,fit,cols=35 # detail section cbox LEFTCOL,19.5,RIGHTCOL,MAXROWS,MBOXSIZE,crows=21.5::DSHADE cbox LEFTCOL,19.5,RIGHTCOL,{dtlbtm-.5},MBOXSIZE,\ ccols=5 51 64 76 83 96 103 116 cfont 2,20,4,21,IRFONT cfont 6,20,29,21,IFONT cfont 31,20,37,21,IRFONT cfont 39,20,50,21,IRFONT cfont 52,20,63,21,IRFONT cfont 65,20,75,21,IRFONT cfont 77,20,82,21,ICFONT cfont 84,10,95,21,IRFONT cfont 97,10,102,21,ICFONT cfont 104,20,115,21,IRFONT cfont 117,20,MAXRCOLS,21,IRFONT cfont 2,{dtlbgn},4,MAXROWS,DRFONT cfont 6,{dtlbgn},29,{dtlbtm},DLFONT cfont 31,{dtlbgn},37,{dtlbtm},DRFONT cfont 39,{dtlbgn},50,{dtlbtm},DBRFONT cfont 52,{dtlbgn},63,{dtlbtm},DBRFONT cfont 65,{dtlbgn},75,MAXROWS,DBRFONT cfont 77,{dtlbgn},82,{dtlbtm},DCFONT cfont 84,{dtlbgn},95,{dtlbtm},DBRFONT cfont 97,{dtlbgn},102,{dtlbtm},DCFONT cfont 104,{dtlbgn},115,{dtlbtm},DBRFONT cfont 117,{dtlbgn},MAXRCOLS,MAXROWS,DBRFONT,10 # memo lines font "mL@1,22,3,MAXROWS",4,0,MAXCOLS,1,DLFONT erase "mL@1,22,3,MAXROWS",0,0,2,1 # restock amt memo lines font "rL@1,22,3,MAXROWS",4,0,90,1,DLFONT erase "rL@1,22,3,MAXROWS",0,0,2,1 # handle serial # lines font "SERIAL #:",0,0,9,1,IFONT,proper,10 font "SERIAL #:",9,0,MAXCOLS,1,DBFONT,10 # handle order/shipped/po lines font "Order #@8,23,15,59",0,0,7,1,IRFONT font "Order #@8,23,15,59",8,0,11,1,DBLFONT font "Shipped Date@30,23,42,59",0,0,12,1,IRFONT font "Shipped Date@30,23,42,59",13,0,8,1,DBLFONT font "PO #@54,23,58,59",0,0,4,1,IRFONT font "PO #@54,23,58,59",5,0,30,1,DBLFONT # consol list line font "lCt@1,21,4,MAXROWS",4,0,MAXCOLS,1,IBLFONT,9 font "lCl@1,21,4,MAXROWS",9,0,9,1,DBFONT font "lCl@1,21,4,MAXROWS",19,0,11,1,DBRFONT font "lCl@1,21,4,MAXROWS",31,0,8,1,IRFONT font "lCl@1,21,4,MAXROWS",41,0,8,1,DBLFONT font "lCl@1,21,4,MAXROWS",50,0,3,1,IRFONT font "lCl@1,21,4,MAXROWS",54,0,MAXCOLS,1,DBLFONT font "lCb@1,21,4,MAXROWS",4,0,14,1,ILFONT,9 font "lCb@1,21,4,MAXROWS",19,0,11,1,DBRFONT erase "lCt@1,21,4,MAXROWS",0,0,3,1 erase "lCl@1,21,4,MAXROWS",0,0,3,1 erase "lCb@1,21,4,MAXROWS",0,0,3,1 # credit line font "CREDIT - DO NOT PAY",0,0,29,1,IBCFONT,10 erase "CREDIT - DO NOT PAY",0,1,19,1 # total lines font "Lines Total@5,22,17,56",0,0,11,1,IBFONT,10 font "Qty Shipped Total@44,22,61,56",0,0,19,1,IBRFONT,10 font "tL@90,21,92,MAXROWS",7,0,17,1,IBRFONT,10 erase "tL@90,21,92,MAXROWS",0,0,2,1 # footer erase "Continued@1,50,10,MAXROWS",0,0,9,1 erase "Last Page@1,50,10,MAXROWS",0,0,9,1 merge "zMrg bottom row" # # the below 2 lines is to correct possible page 1 extra row 1 # for printer device designation # local RULESET="Invoice" merge "zMrgAdjustPage1Issue" # --- 8.0 FEATURES ------------------------------------------------------ merge "Invoice/Credit Memo 8.0 Merge" # --- ORIGINAL CODE-BLOCK SECTION --------------------------------------- prejob { dim copy_title$[MAX_COPIES] if MAX_COPIES>=1 then : copy_title$[CUSTOMER_COPY]="Customer Copy" endif if MAX_COPIES>=2 then : copy_title$[SCANNING_COPY]="Signature Copy" endif if MAX_COPIES>=3 then : copy_title$[FILE_COPY]="Office Copy" endif #used for total overflow tot_found=0 } prepage { # new stuff faxno$ =get(1,23,15,1) termspct$ =get(16,23,5,1) email$ =get(21,23,60,1) x$ =set(1,23,MAXCOLS,"") # load rt ribbon upc_vndr$=get(93,3,6,1) invdate$=get(106,3,8,1) ordno$=get(121,3,10,1) entdate$=get(94,5,8,1) pono$=get(104,5,22,1) inst$=get(50,15,30,1) ship_point$=get(50,18,30,1) via$=get(81,18,12,1) shipdate$=get(105,18,8,1) terms$=get(117,18,12,1) # get pgno for use below pgno$=get(129,5,4,1) if pgno$="1" then lconsord=0,tot_found=0 # check for format # form3=0 if trim(text$[20])<>"" then form3=1 # was 16 if form3 then : dtlhdr$=rtrim(cut(1,13,300,"")) # was 11 ribbon$=trim(cut(1,20,300,"")) # was 16 endif # set detail headers if form3 then : text$[20]=" Product UPC Quantity Quantity Quantity Qty. Unit Price Discount Amount" text$[21]="Ln# And Description Item# Ordered B.O. Shipped UM Price UM Multiplier (Net)" endif # set ribbon if form3 then : # load rx ribbon data # unknown refdate$=trim(mid(ribbon$,78,8)) # load for right ribbon printed$=trim(left(ribbon$,14)) pickeddate$=trim(mid(ribbon$,94,8)) entereddate$=trim(mid(ribbon$,86,8)) # already in rt ribbon custpo$=trim(mid(ribbon$,38,22)) shipdate$=trim(mid(ribbon$,102,8)) # load for new ribbon takenby$=trim(mid(ribbon$,16,4)) slsrepin$=trim(mid(ribbon$,20,4)) slsrepout$=trim(mid(ribbon$,24,4)) placedby$=trim(mid(ribbon$,28,10)) x$ ="cbox LEFTCOL,17,95,18,MBOXSIZE,ccols=9::ISHADE 15 23::ISHADE 29 37::ISHADE 43 51::ISHADE 62 73::ISHADE" x$+=$0a$+"text 2,17.5,"+$22$+"Taken By"+$22$+",IFONT,cols=7" x$+=$0a$+"text 10,17.5,"+$22$+takenby$+$22$+",DBFONT,fit,cols=5" x$+=$0a$+"text 16,17.5,"+$22$+"Sales in"+$22$+",IFONT,cols=7" x$+=$0a$+"text 24,17.5,"+$22$+slsrepin$+$22$+",DBFONT,fit,cols=5" x$+=$0a$+"text 30,17.5,"+$22$+"Sales out"+$22$+",IFONT,cols=7" x$+=$0a$+"text 38,17.5,"+$22$+slsrepout$+$22$+",DBFONT,fit,cols=5" x$+=$0a$+"text 44,17.5,"+$22$+"Placed by"+$22$+",IFONT,cols=7" x$+=$0a$+"text 52,17.5,"+$22$+placedby$+$22$+",DBFONT,fit,cols=10" x$+=$0a$+"text 63,17.5,"+$22$+"Customer P/O"+$22$+",IFONT,cols=10" x$+=$0a$+"text 74,17.5,"+$22$+custpo$+$22$+",DBFONT,fit,cols=22" exec(x$) else if custpo$="" then : custpo$=get(104,5,22,1) endif if shipdate$="" then : shipdate$=get(105,15,8,1) endif x$ ="cbox LEFTCOL,17,95,18,MBOXSIZE,ccols=12::ISHADE" x$+=$0a$+"text 2,17.5,"+$22$+"Customer P/O"+$22$+",IFONT,cols=10" x$+=$0a$+"text 13,17.5,"+$22$+custpo$+$22$+",DBFONT,fit,cols=22" exec(x$) endif doc_title$="INVOICE" if pos("Correction"=text$[2]) then : doc_title$="CREDIT MEMO" endif docid$=get(121,3,12,1) docdate$=get(106,3,8,1) if docdate$="" then docdate$=get(94,5,8) xrow1=22,xrow2=MAXROWS merge "zMrg check continued" cash_disc$="" for xrow=xrow1 to xrow2 x=pos("Cash Discount"=text$[xrow]) if x then : cash_disc$=get(x,xrow,60,1) x$=set(x,xrow,60,"") endif next xrow # 6.1.040 all address and postnet info zMrg # company/corresp, bill-to, ship-to xruleset$ ="inv-sds" merge "zMrg load addr info" duplicate$="" if get(53,2,25)="*** D U P L I C A T E ***" then : duplicate$="DUPLICATE" endif # find dtlbtm dtlbgn=26,dtlbtm=MAXROWS for row=dtlbgn to dtlbtm if pos("Lines Total"=text$[row])=0 then continue dtlbtm=row-1 tot_found=1 break next row # totals rollover from prev page if tot_found=1 and dtlbtm=MAXROWS then : dtlbtm=26 endif # find list of consolidated orders lctop=MAXROWS,lcrow=0,lctop=0 for row=26 to MAXROWS if pos("SUMMARY TOTALS FOR ALL CONSOLIDATED ORDERS"=text$[row]) then : x$=set(1,row,3,"lCt") lconsord=1 lctop=row continue endif if pos("List of Consolidated Orders:"=text$[row]) then : x$=set(1,row,3,"lCt") lconsord=1 lcrow=row break endif next row # tag lco detail lines and total line if lconsord and lcrow=0 then lcrow=26,lctop=26 if lcrow then : for row=lcrow+1 to MAXROWS if pos("Tot Inv Amt"=text$[row]) then : x$=set(1,row,3,"lCb") break endif x$=set(1,row,3,"lCl") next row endif # reset dtlbtm if lc if lconsord then dtlbtm=lctop-1 # tag memo/total lines for row=26 to MAXROWS if trim(text$[row])="" then continue if pos("CREDIT - DO NOT PAY"=text$[row]) then break if pos("RESTOCK AMT"=text$[row]) then : # must be restock line, so tag at column 1 x$=set(1,row,2,"rL") continue endif if pos("Lines Total"=text$[row]) then : # must be totals line, so tag at column 78 x$=set(90,row,2,"tL") continue endif if trim(left(text$[row],90))="" then : # must be totals line, so tag at column 90 x$=set(90,row,2,"tL") continue endif if trim(left(text$[row],4))<>"" then continue # must be memo line x$=set(1,row,2,"mL") next row #adjust "dtlbtm<40" if watermark crowds detail area. if dtlbtm<40 then : wmark_pos=MAXROWS-.5 else wmark_pos=dtlbtm-1 endif # watermark zbrow=wmark_pos,ztext$=doc_title$ merge "zMrg watermark" # shade item lines for easier reading shade_row=dtlbtm if shade_row<22 then shade_row=22 shd$="shade "+$22$+"~ ..[0-9A-Za-z]@1,22,4,"+STR(shade_row)+\ $22$+",0.5,0,MAXRCOLS,1,DSHADE" exec(shd$) # handle detail negative sign for amt for row=dtlbgn to dtlbtm if mid(text$[row],129,2)=" -" then x$=set(129,row,2,"- ") next row } postpage { nextpgno$=get(129,5,4,1,pagenum+1) if nextpgno$="1" or nextpgno$="" then : tot_found=0 endif } [Invoice/Credit Memo 8.0 Merge] # --- 8.0 ARCHIVING ---------------------------------------------------- const ARCRULE="invoice credit memo" prepage { noarchive=1 earc_archive$="EARC_INVOICE",doing_recat=0 if lower(earc_archive$)="y": noarchive=0 if not(uf.subjob): gosub process_arcProps # see the zMrgArcProps ruleset endif endif } merge "8.0 zMrg ArcProps" if uf.arcenabled ARCHIVE {earca_library$},{earca_doctype$},{earca_docid$},subid {earca_subid$},title {earca_title$},notes {earca_notes$},keywords {earca_keywords$},categories {earca_cats$},links {earca_links$},args {earca_args$},dtm {earca_dtm$},subtitle {earca_subtitle$},subdtm {earca_subdtm$},entid {earca_entid$} endif # --- SCANNING BARCODE -------------------------------------------------- prepage { bcod_docid$=get(122,3,11,1) } precopy { # Add barcodes for scanning interface. bcod$="BCOD_INVOICE" # Y/N Switch from global section bcod_Copies$="2" # which copy(s) get barcode if lower(bcod$)="y" then: if pos(str(copy)=bcod_Copies$): bcod_docty$="INV" rows$=str(MAXROWS+7) cmd$="text 2,"+str(MAXROWS+1.5)+","+$22$+"Do not write below this line"+$22$+",cgtimes,10,italic" cmd$+=$0a$+"cbox LEFTCOL,"+str(MAXROWS+2)+",RIGHTCOL,"+str(MAXROWS+2) # use of 'text' in below barcode commands requires # UnForm Windows Support Server cmd$+=$0a$+"barcode "+str(inchtocols(.5))+","+str(MAXROWS+4)+","+$22$+bcod_docty$+$22$+",BCSYMB,18.0,6,text" cmd$+=$0a$+"barcode "+str(inchtocols(3.5))+","+str(MAXROWS+4)+","+$22$+bcod_DocID$+$22$+",BCSYMB,18.0,6,text" exec(cmd$) end if end if } # --- 8.0 DELIVER ------------------------------------------------------ # deliver email command - no change needed, ref tags in deliver.ini deliver {eaddr$},{einvno$},args {eArg$},from {efrom$},cc {ecccc$},bcc {ebbcc$},subject {esubj$},note {ebody$},login {elogn$},password {epswd$},attach {etach$},otherhead {eohdr$},bodymime {emime$},combine {eCombine$} # deliver fax command - no change needed, ref tags in deliver.ini deliver {faddr$},{finvno$},args {fArg$},fromname {ffrom$},subject {fsubj$},note {fbody$},coverpage {fcovr$},attach {ftach$},toname {ftnam$},tocompany {ftoco$},fromcompany {ffrco$},combine {fCombine$},from {ffrom$} prepage { edel$="EDEL_INVOICE" if lower(edel$)="y": # form-based data locations eDocid$=get(122,3,11) # Required ALL methods eForm$="Invoice" eAddrEnt$=get(12,4,12) endif } # ADDRESS RETRIVAL METHODS merge "EDEL_METHOD" # EMAIL defaults or overrides, remove conditional for override prepage { if lower(edel$)="y": if not(uf.subjob): if eAddr$<>"": # email, ref tags in deliver.ini if ecopy$="" ecopy$="1" if efrom$="" efrom$="" if esubj$="" esubj$=eForm$+" "+eDocid$ if ebody$="" ebody$="" if etach$="" etach$="" if ecccc$="" ecccc$="" if ebbcc$="" ebbcc$="" if eohdr$="" eohdr$="" if elogn$="" elogn$="" if epswd$="" epswd$="" if emime$="" emime$="text/html" if pcopy$="" pcopy$="" eArg$="-ce "+ecopy$ eCombine$="no" endif endif endif } # FAX defaults or overrides, remove conditional for override prepage { if lower(edel$)="y": if not(uf.subjob): if fAddr$<>"": # fax, ref tags in deliver.ini if fcopy$="" fcopy$="1" if ffrom$="" ffrom$="" if fsubj$="" fsubj$=eForm$+" "+eDocid$ if fbody$="" fbody$="" if ftach$="" ftach$="" if fcovr$="" fcovr$="generic" # Fax Pkg cover page if ftnam$="" ftnam$="" if ftoco$="" ftoco$="" if ffrco$="" ffrco$="" if pcopy$="" pcopy$="" fArg$="-ce "+fcopy$ fCombine$="no" endif endif endif } # Include an unForm-generated cover page # merge "8.0 Cover Page" # remark this to ALWAYS print ALL copies of a delivered document merge "8.0 ED Selective Copy Printing" # --- PAGE X of Y FEATURE ----------------------------------------------- local XOFYM_COPIES="ALL" # or copy #'s to display # if not using justification, set XOFYM_DCOL to start col local XOFYM_DCOL =90 local XOFYM_DROW =MAXROWS+.5 # row to display title # location of unique doc id local XOFYM_COL =122 # adjust as needed local XOFYM_ROW =3 # adjust as needed local XOFYM_NCOLS =11 # adjust as needed merge "zMrgMultiPageXofY" [Pick Ticket osx] # applies to form format #3 # Version 8.0 IMPORTANT NOTE!! # THIS 'OSX' RULESET IS FOR FORM 3 'MINIMAL FORMATTING ONLY'. # IT IS NOT IN USE UNLESS BELOW DETECT IS UNREMARKED. # SEE THE SDS VERSION FOR DEFAULT FORM 1 AND FORM 3 HANDLING. #detect 0,2-3,"^Pick Ticket/Packing List" # set up document constants local MAXCOLS=134 # max cols to output local MAXRCOLS=133 # MAXCOLS-1 local LEFTCOL=1 # left vertical line local RIGHTCOL=MAXCOLS # 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 FILE_COPY=3 local MAX_COPIES=3 copies MAX_COPIES portrait dpi 600 # see global constant above GSON # graphical shading title "Pick Ticket" # view in pdf properties # shift over 1 cmove 1,1,MAXCOLS,MAXROWS,2,1 cerase {MAXCOLS+1},1,300,MAXROWS # header section cerase 1,1,MAXCOLS,19 merge "zMrg form header" # rt ribbon 1 cbox 98,3,RIGHTCOL,7,1,crows=4::ISHADE 5 6::ISHADE,ccols=113 124 text 99,3.5,"Order No",ICFONT,cols=14 text 99,4.5,{orderno$},DBCFONT,cols=14 text 114,3.5,"Placed By",ICFONT,cols=10 text 114,4.5,{placedby$},DBCFONT,cols=10 text 125,3.5,"Order Date",ICFONT,cols=9 text 125,4.5,{orderdate$},DBCFONT,cols=9 text 99,5.5,"Printed",ICFONT,cols=14 text 99,6.5,{printed$},DBCFONT,cols=14 text 114,5.5,"Slsp in/out",ICFONT,cols=10 text 114,6.5,{slsrepin$+"/"+slsrepout$},DBCFONT,cols=10,fit text 125,5.5,"Taken By",ICFONT,cols=9 text 125,6.5,{takenby$},DBCFONT,cols=9 cbox 98,7,RIGHTCOL,9,1,crows=8::ISHADE,ccols=124 text 99,7.5,"Purchase Order #",ICFONT,cols=25 text 99,8.5,{pono$},DBCFONT,cols=25 text 125,7.5,"Page #",ICFONT,cols=9 text 125,8.5,{pgno$},DBCFONT,cols=9 # bill to text 2,10,"Bill\nTo:",ICFONT,10,cols=10 text 2,12,{custno$},DBCFONT,10,fit,cols=10 text 12,10,{bill$},DBFONT,10,fit,cols=50 # ship to text 2,16.5,"Ship\nTo:",ICFONT,10,cols=10 text 12,16.5,{ship$},DBFONT,10,fit,cols=50 # correspondence to text 71,10,"Correspondence\nTo:",ICFONT,10,cols=15 text 87,10,{comp_info$},DBFONT,10,fit,cols=45 # rt ribbon 2 cbox 81,16.5,RIGHTCOL,18.5,1,crows=17.5::ISHADE,ccols=111 125 text 82,17,"Instructions",ICFONT,cols=29 text 82,18,{inst$},DBCFONT,cols=29,fit text 112,17,"Ship Via",ICFONT,cols=13 text 112,18,{via$},DBCFONT,cols=13,fit text 126,17,"Requested",ICFONT,cols=8 text 126,18,{request$},DBCFONT,cols=8,fit cbox 81,18.5,RIGHTCOL,20.5,1,crows=19.5::ISHADE,ccols=111 125 text 82,19,"Ship Point",ICFONT,cols=29 text 82,20,{ship_point$},DBCFONT,cols=29,fit text 112,19,"Terms",ICFONT,cols=13 text 112,20,{terms$},DBCFONT,cols=13,fit text 126,19,"Shipped",ICFONT,cols=8 text 126,20,{shipdate$},DBCFONT,cols=8,fit # detail text 2,{dtlbgn-2},"Ln#",ICFONT,cols=5 text 8,{dtlbgn-2.5},"Product\nAnd Description",ILFONT text 40,{dtlbgn-2},"Bin Location",ICFONT,cols=13 text 52,{dtlbgn-2.5},"Quantity\nOrdered",IRFONT,cols=12 text 65,{dtlbgn-2.5},"Quantity\nBO",IRFONT,cols=12 text 78,{dtlbgn-2.5},"Qty\nShipped",IRFONT,cols=12 text 91,{dtlbgn-2.5},"Qty\nU/M",ICFONT,cols=5 text 97,{dtlbgn-2},"Unit Price",IRFONT,cols=19 text 117,{dtlbgn-2.5},"Amount\n(Net)",IRFONT,cols=15 cfont 2,{dtlbgn},6,{dtlbtm},DCFONT cfont 8,{dtlbgn},35,{dtlbtm},DLFONT cfont 40,{dtlbgn},52,{dtlbtm},DCFONT cfont 54,{dtlbgn},63,{dtlbtm},DBRFONT cfont 65,{dtlbgn},76,{dtlbtm},DBRFONT cfont 78,{dtlbgn},89,{dtlbtm},DBRFONT cfont 91,{dtlbgn},95,{dtlbtm},DCFONT cfont 97,{dtlbgn},115,{dtlbtm},DRFONT cfont 117,{dtlbgn},MAXRCOLS,{dtlbtm},DBRFONT # totals cfont 1,{dtlbtm+3},MAXCOLS,{dtlbtm+3},IBRFONT cfont 1,{dtlbtm+4},MAXRCOLS,{dtlbtm+4},IBRFONT cfont 1,{dtlbtm+5},MAXRCOLS,{dtlbtm+5},IBRFONT # footer erase "Continued@1,50,10,MAXROWS",0,0,9,1 erase "Last Page@1,50,10,MAXROWS",0,0,9,1 cmove 1,{MAXROWS-5},MAXCOLS,{MAXROWS-5},1,{MAXROWS-4} cfont 2,{MAXROWS-4},4,{MAXROWS-4},DBRFONT cfont 6,{MAXROWS-4},16,{MAXROWS-4},IFONT cfont 22,{MAXROWS-4},46,{MAXROWS-4},IRFONT cfont 48,{MAXROWS-4},50,{MAXROWS-4},DBFONT cfont 60,{MAXROWS-4},76,{MAXROWS-4},IRFONT cfont 78,{MAXROWS-4},89,{MAXROWS-4},DBFONT cfont 92,{MAXROWS-4},MAXRCOLS,{MAXROWS-4},IBRFONT cfont 2,{MAXROWS-3},14,{MAXROWS-3},ICFONT cfont 16,{MAXROWS-3},28,{MAXROWS-3},ICFONT cfont 30,{MAXROWS-3},42,{MAXROWS-3},ICFONT cfont 48,{MAXROWS-3},57,{MAXROWS-3},IRFONT cfont 64,{MAXROWS-3},74,{MAXROWS-3},IRFONT cfont 77,{MAXROWS-3},92,{MAXROWS-3},IRFONT cfont 94,{MAXROWS-3},102,{MAXROWS-3},ICFONT cfont 104,{MAXROWS-3},112,{MAXROWS-3},ICFONT cfont 114,{MAXROWS-3},122,{MAXROWS-3},ICFONT cfont 124,{MAXROWS-3},MAXRCOLS,{MAXROWS-3},ICFONT cfont 2,{MAXROWS-2},11,{MAXROWS-2},DBCFONT cfont 16,{MAXROWS-2},25,{MAXROWS-2},DBCFONT cfont 31,{MAXROWS-2},41,{MAXROWS-2},DBCFONT cfont 48,{MAXROWS-2},57,{MAXROWS-2},DBRFONT cfont 64,{MAXROWS-2},74,{MAXROWS-2},DBRFONT cfont 77,{MAXROWS-2},92,{MAXROWS-2},DBRFONT cfont 94,{MAXROWS-2},102,{MAXROWS-2},DBCFONT cfont 104,{MAXROWS-2},112,{MAXROWS-2},DBCFONT cfont 114,{MAXROWS-2},122,{MAXROWS-2},DBCFONT cfont 124,{MAXROWS-2},MAXRCOLS,{MAXROWS-2},DBCFONT erase "Continued@1,50,10,MAXROWS",0,5,MAXCOLS,1 erase "Last Page@1,50,10,MAXROWS",0,5,MAXCOLS,1 erase "Received By:@1,50,MAXCOLS,MAXROWS",0,0,MAXCOLS,1 merge "zMrg bottom row" # # the below 2 lines is to correct possible page 1 extra row 1 # for printer device designation # local RULESET="Pick Ticket/Packing List" merge "zMrgAdjustPage1Issue" # --- 8.0 FEATURES ------------------------------------------------------ merge "Pick Ticket 8.0 Merge" # --- ORIGINAL CODE-BLOCK SECTION --------------------------------------- prejob { dim copy_title$[MAX_COPIES] if MAX_COPIES>=1 then : copy_title$[CUSTOMER_COPY]="Customer Copy" endif if MAX_COPIES>=2 then : copy_title$[SCANNING_COPY]="Scanning Copy" endif if MAX_COPIES>=3 then : copy_title$[FILE_COPY]="Office Copy" endif } prepage { # new stuff email$ =get(1,19,60,1) x$ =set(1,19,MAXCOLS,"") # get doc title doc_title$="Pick Ticket" if pos("Return Merchandise"=text$[2]) then : doc_title$="Credit Memo" endif # load detail header dtlhdr$=rtrim(cut(1,12,300,"")) # rx extra info for possible use ribbon$=trim(cut(1,18,300,"")) xrow=2 merge "zMrg check reprint" # 6.1.040 all address and postnet info zMrg # company/corresp, bill-to, ship-to xruleset$ ="pck-osx" merge "zMrg load addr info" xrow1=56,xrow2=MAXROWS merge "zMrg check continued" # load hdr text custno$=get(12,4,12,1) # load rx ribbon data refdate$=trim(mid(ribbon$,62,22)) printed$=trim(left(ribbon$,14)) pickeddate$=trim(mid(ribbon$,94,8)) entereddate$=trim(mid(ribbon$,86,8)) custpo$=trim(mid(ribbon$,38,24)) shipdate$=trim(mid(ribbon$,102,8)) takenby$=trim(mid(ribbon$,16,4)) slsrepin$=trim(mid(ribbon$,20,4)) slsrepout$=trim(mid(ribbon$,24,4)) placedby$=trim(mid(ribbon$,28,10)) # load rt ribbon 1 orderno$=get(106,3,11,1) orderdate$=get(94,5,8,1) pono$=get(104,5,22,1) if pono$="" then pono$=custpo$ pgno$=get(129,5,4,1) # load rt ribbon 2 inst$=get(50,14,30,1) ship_point$=get(50,16,30,1) via$=get(81,16,12,1) request$=get(100,16,8,1) shipdate$=get(110,16,8,1) terms$=get(120,16,12,1) # find dtlbtm dtlbgn=20,dtlbtm=MAXROWS,total=0 for row=dtlbgn to dtlbtm if pos("Total"=text$[row])=0 then continue dtlbtm=row-1 total=1 break next row # remove unwanted detail & move wanted detail for row=dtlbgn to dtlbtm if trim(left(text$[row],3))="" then continue # must be a detail line to strip or move # do strips first x$=set(33,row,5,"") x$=set(96,row,19,"") # now process moves x$=set(96,row,12,trim(cut(129,row,11,""))) next row # move text for shift value shift=4 for row=MAXROWS to dtlbgn+shift step -1 text$[row]=text$[row-shift] text$[row-shift]="" next row dtlbgn=dtlbgn+shift dtlbtm=dtlbtm+shift if dtlbtm>=57 then dtlbtm=MAXROWS-5 # draw detail box x$="cbox LEFTCOL,"+str(dtlbgn-3)+",RIGHTCOL,MAXROWS,MBOXSIZE" exec(x$) x$="cbox LEFTCOL,"+str(dtlbgn-3)+",RIGHTCOL,"+str(dtlbtm)+",MBOXSIZE,crows="+str(dtlbgn-1)+"::DSHADE,ccols=7 51 64 77 90 96 116" exec(x$) # draw totals box if total then : x$="cbox LEFTCOL,"+str(MAXROWS-5)+",RIGHTCOL,"+str(MAXROWS)+",MBOXSIZE" exec(x$) endif # memo lines for row=dtlbgn to dtlbtm x$=trim(left(text$[row],3)) if x$<>"" then continue x$="cfont 8,"+str(row)+",100,"+str(row)+",DLFONT,black" exec(x$) next row # shade item lines for easier reading xdtlbtm=dtlbtm if left(cont$,4)="Cont" then xdtlbtm=dtlbtm-6 for row=dtlbgn to xdtlbtm xx$=get(1,row,4,1) if xx$<"0" or xx$>"999" then continue x$="shade 1.5,"+str(row+.25)+",MAXRCOLS,.5,DSHADE" exec(x$) next row # watermark zbrow=xdtlbtm-.5,ztext$=doc_title$ if dtlbtm-dtlbgn<10 then zbrow=MAXROWS-5.5 merge "zMrg watermark" # move totals over as needed if dtlbtm<56 then : for row=dtlbtm+1 to MAXROWS-7 xx$=trim(cut(1,row,255,"")) if xx$>"" then : x$=set(97,row,14,xx$) x$=set(121,row,18,right(xx$,12)) xcmd$="cfont 97,"+str(row)+",115,"+str(row)+",IBRFONT,10" xcmd$+=$0a$+"cfont 121,"+str(row)+",MAXRCOLS,"+str(row)+",DBRFONT,10" exec(xcmd$) endif next row endif # setup footer boxes if left(cont$,4)<>"Cont" then : x$="cbox LEFTCOL,"+str(MAXROWS-3.5)+",43,"+str(MAXROWS-.5)+",1,ccols=15 29,crows="+str(MAXROWS-2.5)+"::DSHADE" exec(x$) x$="cbox 93,"+str(MAXROWS-3.5)+",RIGHTCOL,"+str(MAXROWS-.5)+",1,ccols=103 113 123,crows="+str(MAXROWS-2.5)+"::DSHADE" exec(x$) x$=set(94,MAXROWS-3,7,"Pallets") x$=set(104,MAXROWS-3,7,"Cartons") x$=set(114,MAXROWS-3,7,"Bundles") x$=set(124,MAXROWS-3,5,"Reels") endif } [Pick ticket sds] # applies to form format #1 & #3 detect 0,2-3,"^Pick Ticket" # set up document constants local MAXCOLS=134 # max cols to output local MAXRCOLS=133 # MAXCOLS-1 local LEFTCOL=1 # left vertical line local RIGHTCOL=MAXCOLS # 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 FILE_COPY=3 local MAX_COPIES=3 copies MAX_COPIES PORT_LAND_PICK dpi 600 # see global constant above GSON # graphical shading title "Pick Ticket" # view in pdf properties # shift right 1 cmove LEFTCOL,1,RIGHTCOL,MAXROWS,2,1 # erase overflow cerase {MAXCOLS+1},1,255,MAXROWS # header section cerase 1,1,MAXCOLS,16 merge "zMrg form header" text 1,7.5,{msg1$+"\n"+msg2$},HCFONT,cols=93,spacing=1 # bill to text 2,10,"Bill To:",IFONT,10 text 11,10,{get(11,4,13,1)},DBFONT,10 text 2,11,{bill$},DBFONT,10,fit,cols=50 # ship to text 55,10,"Ship To",IFONT,10 text 55,11,{ship$},DBFONT,10,fit,cols=40 # rt hdr cbox 97,3.5,RIGHTCOL,9.5,1,ccols=107::ISHADE,crows=4.5 5.5 6.5 7.5 8.5 9.5 cbox 99,9.5,RIGHTCOL,15.5,1,ccols=107::ISHADE,crows=10.5 11.5 12.5 13.5 14.5 cbox 97,9.5,99,15.5,1 text 98,4,"Order #",IFONT text 98,5,"Page #",IFONT text 98,6,"UPC Vndr",IFONT text 98,7,"Ship Point",IFONT text 98,8,"Via",IFONT text 98,9,"Terms",IFONT text 97.3,10.5,"D\nA\nT\nE\nS",IBCFONT,cols=2 text 100,10,"Entered",IFONT text 100,11,"P/O",IFONT text 100,12,"Picked",IFONT text 100,13,"Shipped",IFONT text 100,14,"Request",IFONT,cols=7 text 100,15,"Printed",IFONT text 108,4,{ordno$},DBFONT text 108,5,{pgno$},DBFONT text 108,6,{get(93,3,10,1)},DBFONT text 108,7,{ship_point$},DBFONT,fit,cols=27 text 108,8,{via$},DBFONT,fit,cols=23 text 108,9,{terms$},DBFONT,fit,cols=23 text 108,10,{entereddate$},DBFONT,fit,cols=23 text 108,11,"",DBFONT # no po date text 108,12,{pickeddate$},DBFONT text 108,13,{shipdate$},DBFONT text 108,14,{reqdate$},DBFONT text 108,15,{printed$},DBFONT # instructions cbox 97,16,RIGHTCOL,18,1,ccols=107::ISHADE,crows=17 text 98,16.5,"Instructions",IFONT,fit,cols=9 text 108,16.5,{get(50,14,30,1)},DBFONT,fit,cols=26 text 98,17.5,"Staging",IFONT text 108,17.5,{get(81,14,13,1)},DBFONT # detail section cbox LEFTCOL,{dtlbgn-3.5},RIGHTCOL,MAXROWS,MBOXSIZE cfont 2,{dtlbgn-3},7,{dtlbgn-2},ICFONT cfont 9,{dtlbgn-3},32,{dtlbgn2-2},ILFONT cfont 34,{dtlbgn-3},38,{dtlbgn-2},IRFONT cfont 40,{dtlbgn-3},52,{dtlbgn-2},ICFONT cfont 54,{dtlbgn-3},65,{dtlbgn-2},IRFONT cfont 67,{dtlbgn-3},78,{dtlbgn-2},IRFONT cfont 80,{dtlbgn-3},91,{dtlbgn-2},IRFONT cfont 93,{dtlbgn-3},96,{dtlbgn-2},ICFONT #cfont 98,{dtlbgn-3},109,{dtlbgn-2},IRFONT # handled in prepage cfont 111,{dtlbgn-3},117,{dtlbgn-2},ICFONT cfont 119,{dtlbgn-3},MAXRCOLS,{dtlbgn-2},IRFONT cfont 2,{dtlbgn},7,{dtlbtm},DCFONT cfont 9,{dtlbgn},32,{dtlbtm},DBLFONT cfont 34,{dtlbgn},38,{dtlbtm},DRFONT,fit cfont 40,{dtlbgn},52,{dtlbtm},DCFONT cfont 54,{dtlbgn},65,{dtlbtm},DBRFONT cfont 67,{dtlbgn},78,{dtlbtm},DBRFONT cfont 80,{dtlbgn},91,{dtlbtm},DBRFONT cfont 93,{dtlbgn},96,{dtlbtm},DCFONT #cfont 98,{dtlbgn},109,{dtlbtm},DBRFONT # handled in prepage cfont 111,{dtlbgn},117,{dtlbtm},DCFONT,black cfont 119,{dtlbgn},MAXRCOLS,{dtlbtm},DBRFONT # handle serial # lines font "SERIAL #:",0,0,9,1,IFONT,proper,10 font "SERIAL #:",9,0,MAXCOLS,1,DBFONT,10 # lot lines box "Lot #:@9,1,16,66",-1.5,-.3,45,.65,1,icols=6::DSHADE 29 34::DSHADE font "Lot #:@9,1,16,66",-1,0,7,1,ILFONT font "Lot #:@9,1,16,66",8,0,21,1,DBLFONT font "Lot #:@9,1,16,66",29,0,4,1,IFONT font "Lot #:@9,1,16,66",35,0,30,1,DBFONT,black # footer erase "Continued@1,50,10,MAXROWS",0,0,9,1 erase "Last Page@1,50,10,MAXROWS",0,0,9,1 cfont 2,{MAXROWS-4},4,{MAXROWS-4},DBRFONT cfont 6,{MAXROWS-4},16,{MAXROWS-4},IFONT cfont 22,{MAXROWS-4},46,{MAXROWS-4},IRFONT cfont 48,{MAXROWS-4},50,{MAXROWS-4},DBFONT cfont 60,{MAXROWS-4},76,{MAXROWS-4},IRFONT cfont 78,{MAXROWS-4},89,{MAXROWS-4},DBFONT cfont 92,{MAXROWS-4},MAXRCOLS,{MAXROWS-4},IBRFONT cfont 2,{MAXROWS-3},14,{MAXROWS-3},ICFONT cfont 16,{MAXROWS-3},28,{MAXROWS-3},ICFONT cfont 30,{MAXROWS-3},42,{MAXROWS-3},ICFONT cfont 48,{MAXROWS-3},57,{MAXROWS-3},IRFONT cfont 64,{MAXROWS-3},74,{MAXROWS-3},IRFONT cfont 77,{MAXROWS-3},92,{MAXROWS-3},IRFONT cfont 94,{MAXROWS-3},102,{MAXROWS-3},ICFONT cfont 104,{MAXROWS-3},112,{MAXROWS-3},ICFONT cfont 114,{MAXROWS-3},122,{MAXROWS-3},ICFONT cfont 124,{MAXROWS-3},MAXRCOLS,{MAXROWS-3},ICFONT cfont 2,{MAXROWS-2},11,{MAXROWS-2},DBCFONT cfont 16,{MAXROWS-2},25,{MAXROWS-2},DBCFONT cfont 31,{MAXROWS-2},41,{MAXROWS-2},DBCFONT cfont 48,{MAXROWS-2},57,{MAXROWS-2},DBRFONT cfont 64,{MAXROWS-2},74,{MAXROWS-2},DBRFONT cfont 77,{MAXROWS-2},92,{MAXROWS-2},DBRFONT cfont 94,{MAXROWS-2},102,{MAXROWS-2},DBCFONT cfont 104,{MAXROWS-2},112,{MAXROWS-2},DBCFONT cfont 114,{MAXROWS-2},122,{MAXROWS-2},DBCFONT cfont 124,{MAXROWS-2},MAXRCOLS,{MAXROWS-2},DBCFONT merge "zMrg bottom row" # # the below 2 lines is to correct possible page 1 extra row 1 # for printer device designation # local RULESET="Pick Ticket/Packing List" merge "zMrgAdjustPage1Issue" # --- 8.0 FEATURES ------------------------------------------------------ merge "Pick Ticket 8.0 Merge" # --- ORIGINAL CODE-BLOCK SECTION --------------------------------------- prejob { dim copy_title$[MAX_COPIES] if MAX_COPIES>=1 then : copy_title$[CUSTOMER_COPY]="Customer Copy" endif if MAX_COPIES>=2 then : copy_title$[SCANNING_COPY]="Scanning Copy" endif if MAX_COPIES>=3 then : copy_title$[FILE_COPY]="Office Copy" endif doc_title$="PICK TICKET" } prepage { # new stuff email$ =get(1,19,60,1) x$ =set(1,19,MAXCOLS,"") # load rt ribbon entereddate$=get(94,5,8,1) pono$=get(104,5,22,1) pgno$=get(129,5,4,1) inst$=get(50,14,30,1) ship_point$=get(50,16,30,1) via$=get(81,16,12,1) shipdate$=get(110,16,8,1) terms$=get(120,16,12,1) # check for format # form3=0 if trim(text$[16])<>"" then form3=1 if form3 then : dtlhdr$=rtrim(cut(1,12,300,"")) ribbon$=trim(cut(1,18,300,"")) endif # set ribbon if form3 then : # load rx ribbon data refdate$=trim(mid(ribbon$,78,8)) printed$=trim(left(ribbon$,14)) # load for right ribbon pickeddate$=trim(mid(ribbon$,94,8)) if entereddate$="" then entereddate$=trim(mid(ribbon$,86,8)) # already in rt ribbon custpo$=trim(mid(ribbon$,38,22)) if pono$="" then pono$=custpo$ if custpo$="" then custpo$=pono$ xshipdate$=trim(mid(ribbon$,102,8)) # load for new ribbon takenby$=trim(mid(ribbon$,16,4)) slsrepin$=trim(mid(ribbon$,20,4)) slsrepout$=trim(mid(ribbon$,24,4)) placedby$=trim(mid(ribbon$,28,10)) x$ ="cbox LEFTCOL,17,95,18,MBOXSIZE,ccols=9::ISHADE 15 23::ISHADE 29 37::ISHADE 43 51::ISHADE 62 73::ISHADE" x$+=$0a$+"text 2,17.5,"+$22$+"Taken By"+$22$+",IFONT,cols=7" x$+=$0a$+"text 10,17.5,"+$22$+takenby$+$22$+",DBFONT,fit,cols=5" x$+=$0a$+"text 16,17.5,"+$22$+"Sales in"+$22$+",IFONT,cols=7" x$+=$0a$+"text 24,17.5,"+$22$+slsrepin$+$22$+",DBFONT,fit,cols=5" x$+=$0a$+"text 30,17.5,"+$22$+"Sales out"+$22$+",IFONT,cols=7" x$+=$0a$+"text 38,17.5,"+$22$+slsrepout$+$22$+",DBFONT,fit,cols=5" x$+=$0a$+"text 44,17.5,"+$22$+"Placed by"+$22$+",IFONT,cols=7" x$+=$0a$+"text 52,17.5,"+$22$+placedby$+$22$+",DBFONT,fit,cols=10" x$+=$0a$+"text 63,17.5,"+$22$+"Customer P/O"+$22$+",IFONT,cols=10" x$+=$0a$+"text 74,17.5,"+$22$+custpo$+$22$+",DBFONT,fit,cols=22" exec(x$) else if custpo$="" then : custpo$=pono$ endif if xshipdate$="" then : xshipdate$=shipdate$ endif x$ ="cbox LEFTCOL,17,95,18,MBOXSIZE,ccols=12::ISHADE" x$+=$0a$+"text 2,17.5,"+$22$+"Customer P/O"+$22$+",IFONT,cols=10" x$+=$0a$+"text 13,17.5,"+$22$+custpo$+$22$+",DBFONT,fit,cols=22" exec(x$) endif reqdate$=get(100,16,8,1) ordno$=get(106,3,11,1) xrow=2 merge "zMrg check reprint" # check for message msg1$=trim(get(30,3,60)) msg2$=trim(get(30,4,60)) # 6.1.040 all address and postnet info zMrg # company/corresp, bill-to, ship-to xruleset$ ="pck-sds" merge "zMrg load addr info" # set detail headers - moved from above down due to conflict if form3 then : text$[17]="Line Product UPC Bin Quantity Quantity Quantity Qty # Amount" text$[18]=" # And Description Item# Location Ordered B.O. Shipped UM Received Cartons (Net)" endif xrow1=20,xrow2=MAXROWS dtlbgn=20,dtlbtm=MAXROWS,last=0 merge "zMrg check continued" if left(cont$,4)="Cont" then : else last=1 endif # find totals to reset dtlbtm total=0 for row=dtlbgn to dtlbtm x=pos("Total"=text$[row]) if not(x) or x<>54 then continue dtlbtm=row-1;total=row;break next row rcvd_by$="" x=pos("Received By"=text$[60]) if x then : rcvd_by$=get(x,60,50,1) x$=set(x,60,50,"") endif if rcvd_by$<>"" then : rcvd_by$=rcvd_by$(1,13)+dim(30)+rcvd_by$(14) endif if not(last) then rcvd_by$="" # shift lot # lines over for row=dtlbgn to dtlbtm if left(text$[row],6)="Lot #:" then : x$=cut(1,row,MAXCOLS,"") x$=set(9,row,MAXCOLS,x$) endif next row # remove ** from # of lines x$=set(21,53,2,"") # move detail down 2 to make room shift=2 for row=MAXROWS to dtlbgn+shift-3 step -1 text$[row]=text$[row-shift] text$[row-shift]="" next row dtlbgn=dtlbgn+shift dtlbtm=dtlbtm+shift if dtlbtm>MAXROWS then dtlbtm=MAXROWS if last and dtlbtm>MAXROWS-5 then dtlbtm=MAXROWS-5 # draw detail box x$="cbox LEFTCOL,"+str(dtlbgn-3.5)+",RIGHTCOL,"+str(dtlbtm)+\ ",MBOXSIZE,crows="+str(dtlbgn-1)+"::DSHADE,\ ccols=8 53 66 79 92 97 110 117" exec(x$) # draw totals box if left(cont$,4)<>"Cont" then : x$="cbox LEFTCOL,"+str(MAXROWS-5)+",RIGHTCOL,"+str(MAXROWS)+",MBOXSIZE" exec(x$) endif # shade item lines for easier reading xdtlbtm=dtlbtm if left(cont$,4)="Cont" then xdtlbtm=dtlbtm-6 for row=dtlbgn to xdtlbtm xx$=get(1,row,4,1) if xx$="" then continue x$="shade 1.5,"+str(row+.25)+",MAXRCOLS,.5,DSHADE" exec(x$) next row # watermark zbrow=dtlbtm-.5,ztext$=doc_title$ if dtlbtm-dtlbgn<11 then zbrow=MAXROWS-5.5 merge "zMrg watermark" # memo lines for row=dtlbgn to dtlbtm x$=trim(left(text$[row],3)) if xx$<"0" or xx$>"999" then continue x$="cfont 9,"+str(row)+",100,"+str(row)+",DLFONT,black" exec(x$) next row # move totals over as needed if total then : for row=total to MAXROWS-6 xx$=trim(cut(1,row,255,"")) if xx$>"" then : x$=set( 97,row,14,xx$) x$=set(121,row,18,right(xx$,12)) x$="cfont 97,"+str(row)+",116,"+str(row)+",IBRFONT,10" x$+=$0a$+"cfont 118,"+str(row)+",MAXRCOLS,"+str(row)+",DBRFONT,10" exec(x$) endif next row endif # setup footer boxes if left(cont$,4)<>"Cont" then : x$="cbox LEFTCOL,"+str(MAXROWS-3.5)+",43,"+str(MAXROWS-.5)+",1,ccols=15 29,crows="+str(MAXROWS-2.5)+"::DSHADE" exec(x$) x$="cbox 93,"+str(MAXROWS-3.5)+",RIGHTCOL,"+str(MAXROWS-.5)+",1,ccols=103 113 123,crows="+str(MAXROWS-2.5)+"::DSHADE" exec(x$) x$=set(94,MAXROWS-3,7,"Pallets") x$=set(104,MAXROWS-3,7,"Cartons") x$=set(114,MAXROWS-3,7,"Bundles") x$=set(124,MAXROWS-3,5,"Reels") endif # if unit price then move to replace received up=0 for row=dtlbgn to dtlbtm x$=get(130,row,20,1) if x$<>"" then up=1;break next row if up then : # clear received column for row=dtlbgn-2 to dtlbtm x$=set(97,row,12,"") next row # set unit price hdr x$=set(98,dtlbgn-3,4,"Unit") x$=set(98,dtlbgn-2,5,"Price") # move unit price to received column for row=dtlbgn to dtlbtm if get(1,row,3,1)="" then continue unit$=cut(129,row,11,"") x$=set(98,row,11,unit$) next row x$ ="cfont 98,"+str(dtlbgn-3)+",109,"+str(dtlbgn-2)+",IRFONT" x$+=$0a$+"cfont 98,"+str(dtlbgn)+",109,"+str(dtlbtm)+",DBRFONT" exec(x$) else x$ ="cfont 98,"+str(dtlbgn-3)+",109,"+str(dtlbgn-2)+",ICFONT" x$+=$0a$+"cfont 98,"+str(dtlbgn)+",109,"+str(dtlbtm)+",DBRFONT" exec(x$) endif # find total lines for possible erasure if left(cont$,4)="Cont" then : for row=1 to MAXROWS if pos("Lines Total"=text$[row])=5 then : x$=set(1,row,MAXCOLS,"") endif if pos("Picked By"=text$[row])=1 then : x$=set(1,row,MAXCOLS,"") break endif next row endif } [Pick Ticket 8.0 Merge] # --- 8.0 ARCHIVING ---------------------------------------------------- const ARCRULE="pick ticket" prepage { noarchive=1 earc_archive$="EARC_PICKTICKET",doing_recat=0 if lower(earc_archive$)="y": noarchive=0 if not(uf.subjob): gosub process_arcProps # see the zMrgArcProps ruleset endif endif } merge "8.0 zMrg ArcProps" if uf.arcenabled ARCHIVE {earca_library$},{earca_doctype$},{earca_docid$},subid {earca_subid$},title {earca_title$},notes {earca_notes$},keywords {earca_keywords$},categories {earca_cats$},links {earca_links$},args {earca_args$},dtm {earca_dtm$},subtitle {earca_subtitle$},subdtm {earca_subdtm$},entid {earca_entid$} endif # --- SCANNING BARCODE -------------------------------------------------- prepage { bcod_docid$=get(106,3,11,1) } precopy { # Add barcodes for scanning interface. bcod$="BCOD_PICKTICKET" # Y/N Switch from global section bcod_Copies$="2" # which copy(s) get barcode if lower(bcod$)="y" then: if pos(str(copy)=bcod_Copies$): bcod_docty$="PT" rows$=str(MAXROWS+7) cmd$="text 2,"+str(MAXROWS+1.5)+","+$22$+"Do not write below this line"+$22$+",cgtimes,10,italic" cmd$+=$0a$+"cbox LEFTCOL,"+str(MAXROWS+2)+",RIGHTCOL,"+str(MAXROWS+2) # use of 'text' in below barcode commands requires # UnForm Windows Support Server cmd$+=$0a$+"barcode "+str(inchtocols(.5))+","+str(MAXROWS+4)+","+$22$+bcod_docty$+$22$+",BCSYMB,18.0,6,text" cmd$+=$0a$+"barcode "+str(inchtocols(3.5))+","+str(MAXROWS+4)+","+$22$+bcod_DocID$+$22$+",BCSYMB,18.0,6,text" exec(cmd$) end if end if } # --- 8.0 DELIVER ------------------------------------------------------ # deliver email command - no change needed, ref tags in deliver.ini deliver {eaddr$},{einvno$},args {eArg$},from {efrom$},cc {ecccc$},bcc {ebbcc$},subject {esubj$},note {ebody$},login {elogn$},password {epswd$},attach {etach$},otherhead {eohdr$},bodymime {emime$},combine {eCombine$} # deliver fax command - no change needed, ref tags in deliver.ini deliver {faddr$},{finvno$},args {fArg$},fromname {ffrom$},subject {fsubj$},note {fbody$},coverpage {fcovr$},attach {ftach$},toname {ftnam$},tocompany {ftoco$},fromcompany {ffrco$},combine {fCombine$} prepage { edel$="EDEL_PICKTICKET" if lower(edel$)="y": # form-based data locations eDocid$=get(106,3,11) # Required ALL methods eForm$="Pick Ticket" eAddrEnt$=get(12,4,12) endif } # ADDRESS RETRIVAL METHODS merge "EDEL_METHOD" # EMAIL defaults or overrides, remove conditional for override prepage { if lower(edel$)="y": if not(uf.subjob): if eAddr$<>"": # email, ref tags in deliver.ini if ecopy$="" ecopy$="1" if efrom$="" efrom$="" if esubj$="" esubj$=eForm$+" "+eDocid$ if ebody$="" ebody$="" if etach$="" etach$="" if ecccc$="" ecccc$="" if ebbcc$="" ebbcc$="" if eohdr$="" eohdr$="" if elogn$="" elogn$="" if epswd$="" epswd$="" if emime$="" emime$="text/html" if pcopy$="" pcopy$="" eArg$="-ce "+ecopy$ eCombine$="no" endif endif endif } # FAX defaults or overrides, remove conditional for override prepage { if lower(edel$)="y": if not(uf.subjob): if fAddr$<>"": # fax, ref tags in deliver.ini if fcopy$="" fcopy$="1" if ffrom$="" ffrom$="" if fsubj$="" fsubj$=eForm$+" "+eDocid$ if fbody$="" fbody$="" if ftach$="" ftach$="" if fcovr$="" fcovr$="" # Fax Pkg cover page if ftnam$="" ftnam$="" if ftoco$="" ftoco$="" if ffrco$="" ffrco$="" if pcopy$="" pcopy$="" fArg$="-ce "+fcopy$ fCombine$="no" endif endif endif } # Include an unForm-generated cover page # merge "8.0 Cover Page" # remark this to ALWAYS print ALL copies of a delivered document merge "8.0 ED Selective Copy Printing" # --- PAGE X of Y FEATURE ----------------------------------------------- # change XOFYM_COPIES to "0" to turn off local XOFYM_COPIES="ALL" # or copy #'s to display local XOFYM_FONT ="univers,10,bold,right" # if not using justification, set XOFYM_DCOL to start col local XOFYM_DCOL =0 local XOFYM_DROW =MAXROWS+.5 # row to display title # location of unique doc id local XOFYM_COL =106 # adjust as needed local XOFYM_ROW =3 # adjust as needed local XOFYM_NCOLS =11 # adjust as needed merge "zMrgMultiPageXofY" [Purchase order/Returns osx] # applies to form format #3 # Version 8.0 IMPORTANT NOTE!! # THIS 'OSX' RULESET IS FOR FORM 3 'MINIMAL FORMATTING ONLY'. # IT IS NOT IN USE UNLESS BELOW DETECT IS UNREMARKED. # SEE THE SDS VERSION FOR DEFAULT FORM 1 AND FORM 3 HANDLING. #detect 0,1-2,"^~(Purchase Order)|(RETURN MERCHANDISE)" # set up document constants local MAXCOLS=132 # max cols to output local MAXRCOLS=131 # MAXCOLS-1 local LEFTCOL=1 # left vertical line local RIGHTCOL=MAXCOLS # right vertical line local MAXROWS=68 # max rows to output cols MAXCOLS # max output columns rows MAXROWS # max output rows local VENDOR_COPY=1 local SCANNING_COPY=2 local FILE_COPY=3 local MAX_COPIES=3 copies MAX_COPIES portrait dpi 600 # see global constant above GSON # graphical shading title "Purchase Order" # view in pdf properties # shift right 1 cmove LEFTCOL,1,RIGHTCOL,MAXROWS,2,{1+shift} # header section cerase 1,1,150,22 merge "zMrg form header" # vendor/seller text 3,7.75,"Vendor",ICFONT,10,cols=7 text 12,7.75,{vend$},DBFONT,10 text 2,8.75,{get(11,3,12,1)},DBCFONT,cols=9 # invoice to text 79,7.75,"Invoice\nto",ICFONT,10,cols=7 text 88,7.75,{bill$},DBFONT,10,fit,cols=43 # ship to text 3,15.75,"Ship\nTo",ICFONT,10,cols=7 text 12,15.75,{ship$},DBFONT,10,fit,cols=45 # rt hdr cbox 102,3.5,RIGHTCOL,5.5,1,ccols=112 122,crows=4.5::ISHADE text 103,4,"PO Date",ICFONT,cols=9 text 113,4,"PO #",ICFONT,cols=9 text 123,4,"Page No",ICFONT,cols=9 text 103,5,{docdate$},DBCFONT,cols=9 text 113,5,{docid$},DBCFONT,cols=9 text 123,5,{get(129,2,4,1)},DBCFONT,cols=9 # instructions cbox 57,15.5,RIGHTCOL,17.5,1,crows=16.5::ISHADE,ccols=97 cbox 57,17.5,RIGHTCOL,19.5,1,crows=18.5::ISHADE,ccols=77 97 text 57,16,"Instructions",ICFONT,cols=40 text 58,17,{get(47,13,30,1)},DBCFONT,cols=40 text 98,16,"Reference",ICFONT,cols=34 text 98,17,{get(103,13,24,1)},DBCFONT,cols=34 text 58,18,"Via",ICFONT,cols=20 text 58,19,{get(47,15,12,1)},DBCFONT,cols=20 text 78,18,"Freight",ICFONT,cols=19 text 78,19,{get(81,15,19,1)},DBCFONT,cols=19 text 98,18,"Payment Terms",ICFONT,cols=34 text 98,19,{get(102,15,12,1)},DBCFONT,cols=34 # detail section cbox LEFTCOL,22,RIGHTCOL,{dtlbtm},MBOXSIZE,\ crows=25::DSHADE,ccols=5 55 64 76 82 96 103 119 text 2,23,"Line\n#",ICFONT,cols=3 text 6,23.5,"Product and Description",ILFONT text 56,23,"UPC\nItem#",ICFONT,cols=8 text 65,23,"Quantity\nOrdered",IRFONT,cols=11 text 77,23,"Qty\nUnit",ICFONT,cols=5 text 83,23,"Unit\nPrice",IRFONT,cols=13 text 97,23,"Price\nU/M",ICFONT,cols=7 text 104,23,"Amount\n(Net)",IRFONT,cols=13 text 120,23,"Due\nDate",ICFONT,cols=11 cfont 1,25,4,{dtlbtm},DCFONT cfont 6,25,54,{dtlbtm},DBLFONT cfont 56,25,63,{dtlbtm},DCFONT cfont 65,25,75,{dtlbtm},DBRFONT cfont 77,25,81,{dtlbtm},DCFONT cfont 83,25,95,{dtlbtm},DBRFONT cfont 97,25,102,{dtlbtm},DCFONT cfont 104,25,117,{dtlbtm},DBRFONT cfont 118,25,118,{dtlbtm},DBLFONT cfont 120,25,MAXRCOLS,{dtlbtm},DCFONT # notes font " @1,23,4,64",5,0,60,1,DLFONT # totals cfont 2,{dtlbtm+1},4,{dtlbtm+1},DBRFONT,10 cfont 6,{dtlbtm+1},16,{dtlbtm+1},ILFONT,10 cfont 43,{dtlbtm+1},60,{dtlbtm+1},IFONT,10 cfont 62,{dtlbtm+1},71,{dtlbtm+1},DBLFONT,10 cfont 77,{dtlbtm+1},91,MAXROWS,IRFONT,10 cfont 104,{dtlbtm+1},117,MAXROWS,DBRFONT,10,black cfont 118,{dtlbtm+1},118,MAXROWS,DBLFONT,10 # footer cbox 82,63,MAXCOLS,MAXROWS,MBOXSIZE,ccols=93::ISHADE,crows=64.75 66.5 text 83,63.75,"Confirmed",IFONT text 83,65.5,"Buyer",IFONT text 83,67.25,"Signature",IFONT text 94.5,63.75,{sign$},DBFONT,spacing=2.25 text 2,64,"Payment for this purchase order will be made according to above pricing.\nIf pricing is incorrect please reject PO & advise buyer",IFONT,9 erase "Continued@1,50,10,MAXROWS",0,0,MAXCOLS,1 erase "Last Page@1,50,10,MAXROWS",0,0,MAXCOLS,1 cerase LEFTCOL,{cont_row+6},MAXCOLS,{MAXROWS+6} merge "zMrg bottom row" # # the below 4 lines is to correct possible page 1 extra row 1 # for printer device designation # local RULESET="Purchase Order" merge "zMrgAdjustPage1Issue" local RULESET="RETURN MERCHANDISE" merge "zMrgAdjustPage1Issue" # --- 8.0 FEATURES ------------------------------------------------------ merge "Purchase order/Returns 8.0 Merge" # --- ORIGINAL CODE-BLOCK SECTION --------------------------------------- prejob { dim copy_title$[MAX_COPIES] if MAX_COPIES>=1 then : copy_title$[VENDOR_COPY]="Vendor Copy" endif if MAX_COPIES>=2 then : copy_title$[SCANNING_COPY]="Scanning Copy" endif if MAX_COPIES>=3 then : copy_title$[FILE_COPY]="Office Copy" endif #used for total overflow tot_found=0 } prepage { # new stuff lang$ =get(1,18,2,1) cono$ =get(3,18,4,1) fano$ =get(7,18,15,1) email$ =get(22,18,60,1) x$ =set(1,18,MAXCOLS,"") doc_title$ =upper(get(11,1,14,1)) docid$ =get(116,2,11,1) docdate$ =get(105,2,8,1) note$ =get(55,19,5,1) # not used??? sign$ =mget(100,58,20,3,"Y","Y") x$ =mset(100,58,20,3,"") xrow1=18,xrow2=MAXROWS merge "zMrg check continued" xrow=2 merge "zMrg check reprint" # 6.1.040 all address and postnet info zMrg # company/corresp, bill-to, ship-to xruleset$ ="por-osx" merge "zMrg load addr info" # find dtlbtm dtlbgn=21,dtlbtm=MAXROWS for row=dtlbgn to dtlbtm if pos("Lines Total"=text$[row])=0 then continue dtlbtm=row-1 break next row # watermark zbrow=dtlbtm-.5,ztext$=doc_title$ if dtlbtm-dtlbgn<10 then zbrow=62.5 merge "zMrg watermark" # set shift value shift=5 dtlbgn=dtlbgn+shift dtlbtm=dtlbtm+shift # shade item lines for easier reading for row=dtlbgn-shift to dtlbtm-shift xx$=get(1,row,4,1) if xx$<"0" or xx$>"999" then continue x$="shade 1.5,"+str(row+shift+.25)+",MAXRCOLS,.5,DSHADE" exec(x$) next row if dtlbtm<63 then : x$="cbox LEFTCOL,22,RIGHTCOL,MAXROWS,MBOXSIZE,crows=63" exec(x$) endif } [Purchase order/Returns sds] # applies to form format #1 & #3 detect 0,1-2,"^~(Purchase Order)|(Return Merchandise)" # set up document constants local MAXCOLS=134 # max cols to output local MAXRCOLS=133 # MAXCOLS-1 local LEFTCOL=1 # left vertical line local RIGHTCOL=MAXCOLS # right vertical line local MAXROWS=68 # max rows to output cols MAXCOLS # max output columns rows MAXROWS # max output rows local VENDOR_COPY=1 local SCANNING_COPY=2 local FILE_COPY=3 local MAX_COPIES=3 copies MAX_COPIES PORT_LAND_PO dpi 600 # see global constant above GSON # graphical shading title "Purchase Order" # view in pdf properties # shift right 1 cmove LEFTCOL,1,RIGHTCOL,MAXROWS,2,7 # header section cerase 1,1,MAXCOLS,22 merge "zMrg form header" # vendor/seller text 2,7,"Vendor:",IFONT,10 text 12,7,{get(11,3,12,1)},DBFONT,10 text 2,8,{vend$},DBFONT,10,fit,cols=48 # ship to text 2,15,"Ship To",IFONT,10 text 2,16,{ship$},DBFONT,10,fit,cols=48 # sold to text 51,8,"Sold\nTo",ICFONT,10,cols=7 text 58,8,{sold$},DBFONT,10,fit,cols=38 # invoice to text 58,15,"Invoice to",IFONT,10 text 58,16,{bill$},DBFONT,10,fit,cols=38 # rt hdr cbox 96,7.5,RIGHTCOL,18.5,1,ccols=110::ISHADE,\ crows=8.5 9.5 10.5 11.5 12.5 13.5 14.5 15.5 16.5 17.5 text 97,8,"PO #",IFONT text 97,9,"PO Date",IFONT text 97,10,"Page",IFONT text 97,11,"UPC Vendor",IFONT text 97,12,"Via",IFONT text 97,13,"Due Date",IFONT text 97,14,"Freight",IFONT text 97,15,"Terms",IFONT text 97,16,"Schedule",IFONT text 97,17,"Resale #",IFONT text 97,18,"Reference",IFONT text 111,8,{docid$},DBFONT text 111,9,{docdate$},DBFONT text 111,10,{get(129,2,4,1)},DBFONT text 111,11,{get(95,2,6,1)},DBFONT text 111,12,{get(47,15,12,1)},DBFONT text 111,13,{get(65,15,8,1)},DBFONT text 111,14,{get(81,15,19,1)},DBFONT,cols=21 text 111,15,{get(102,15,12,1)},DBFONT,fit,cols=21 text 111,16,{get(118,15,14,1)},DBFONT,fit,cols=21 text 111,17,{get(79,13,18,1)},DBFONT,fit,cols=21 text 111,18,{get(103,13,24,1)},DBFONT,fit,cols=21 # instructions cbox 96,19,RIGHTCOL,21,1,crows=20::ISHADE text 97,19.5,"Instructions",ICFONT,cols=37 text 97,20.5,{get(47,13,30,1)},DBCFONT,cols=37,fit # detail section cfont 1,23,5,24,ICFONT,black cfont 6,23,54,24,ILFONT cfont 56,23,60,24,IRFONT cfont 62,23,71,24,IRFONT cfont 73,23,80,24,ICFONT cfont 82,23,92,24,IRFONT cfont 94,23,101,24,ICFONT cfont 103,23,115,24,IRFONT cfont 116,23,MAXRCOLS,24,ICFONT cfont 2,25,4,{dtlbtm+4},DCFONT cfont 6,25,54,{dtlbtm+4},DBLFONT cfont 56,25,60,{dtlbtm+4},DRFONT cfont 62,25,71,{dtlbtm+4},DBRFONT cfont 73,25,80,{dtlbtm+4},DBCFONT cfont 82,25,92,{dtlbtm+4},DBRFONT cfont 94,25,101,{dtlbtm+4},DCFONT cfont 103,25,115,{dtlbtm+4},DBRFONT cfont 116,25,MAXRCOLS,{dtlbtm+4},DBCFONT # handle bin loc font "Bin Loc:@56,24,63,57",0,0,8,1,ILFONT font "Bin Loc:@56,24,63,57",8,0,15,1,DBLFONT # footer erase "Continued@1,50,10,MAXROWS",0,0,9,1 erase "Last Page@1,50,10,MAXROWS",0,0,9,1 cfont 2,{dtlbtm+5},4,MAXROWS,DBRFONT cfont 6,{dtlbtm+5},16,MAXROWS,IBLFONT cfont 43,{dtlbtm+5},60,MAXROWS,IBRFONT cfont 62,{dtlbtm+5},74,MAXROWS,DBLFONT cfont 76,{dtlbtm+5},101,MAXROWS,IBRFONT cfont 103,{dtlbtm+5},115,MAXROWS,DBRFONT cfont 116,{dtlbtm+5},125,MAXROWS,DBLFONT cbox 82,63,MAXCOLS,MAXROWS,MBOXSIZE,ccols=93::ISHADE,crows=64.75 66.5 text 83,63.75,"Confirmed",IFONT text 83,65.5,"Buyer",IFONT text 83,67.25,"Signature",IFONT text 94.5,63.75,{sign$},DBFONT,spacing=2.25 text 2,64,"Payment for this purchase order will be made according to above pricing.\nIf pricing is incorrect please reject PO & advise buyer",IFONT,9 cerase LEFTCOL,{cont_row+6},MAXCOLS,{MAXROWS+6} merge "zMrg bottom row" # # the below 4 lines is to correct possible page 1 extra row 1 # for printer device designation # local RULESET="Purchase Order" merge "zMrgAdjustPage1Issue" local RULESET="RETURN MERCHANDISE" merge "zMrgAdjustPage1Issue" # --- 8.0 FEATURES ------------------------------------------------------ merge "Purchase order/Returns 8.0 Merge" # --- ORIGINAL CODE-BLOCK SECTION --------------------------------------- prejob { dim copy_title$[MAX_COPIES] if MAX_COPIES>=1 then : copy_title$[VENDOR_COPY]="Vendor Copy" endif if MAX_COPIES>=2 then : copy_title$[SCANNING_COPY]="Scanning Copy" endif if MAX_COPIES>=3 then : copy_title$[FILE_COPY]="Office Copy" endif #used for total overflow tot_found=0 } prepage { # new stuff lang$ =get(1,18,2,1) cono$ =get(3,18,4,1) fano$ =get(7,18,15,1) email$ =get(22,18,60,1) x$ =set(1,18,MAXCOLS,"") # handle format #3 # No special line, just dtl hdr moved if trim(text$[17])="" then : text$[17]="Line Product UPC Quantity Qty Unit Price Amount Due" text$[18]=" # And Description Item# Ordered U/M Price U/M (Net) Date" endif doc_title$=upper(get(11,1,30,1)) docid$=get(115,2,12,1) docdate$=get(105,2,8,1) xrow1=18,xrow2=MAXROWS merge "zMrg check continued" last=0 if left(cont$,4)<>"Cont" then last=1 # get "signature" and clear if not last page sign$="" if last then : sign$=mget(80,cont_row,40,3,"Y","Y") endif x$=mset(1,cont_row,MAXROWS,10,"") # 6.1.040 all address and postnet info zMrg # company/corresp, bill-to, ship-to xruleset$ ="por-sds" merge "zMrg load addr info" # find totals area dtlbgn=20,dtlbtm=58 if tot_found=1 then : dtlbtm=dtlbgn else for row=dtlbgn to dtlbtm if pos("Lines Total"=text$[row]) then : dtlbtm=row-1+2 tot_found=1 break endif next row endif # draw boxes xrow=min(dtlbtm+4,MAXROWS) x$ ="cbox LEFTCOL,"+str(dtlbgn+2)+",RIGHTCOL,"+STR(xrow)+\ ",MBOXSIZE,crows="+str(dtlbgn+5)+\ "::DSHADE,ccols=5 61 72 81 93 102 116" if dtlbtm"" then continue x$="cfont 6,"+str(row+6)+",100,"+str(row+6)+",DLFONT,black" exec(x$) next row } postpage { nextpgno$=get(129,2,4,1,pagenum+1) if nextpgno$="1" or nextpgno$="" then : tot_found=0 endif } [Purchase order/Returns 8.0 Merge] # --- 8.0 ARCHIVING ---------------------------------------------------- const ARCRULE="purchase order" prepage { noarchive=1 earc_archive$="EARC_PURCHASEORDER",doing_recat=0 if lower(earc_archive$)="y": noarchive=0 if not(uf.subjob): gosub process_arcProps # see the zMrgArcProps ruleset endif endif } merge "8.0 zMrg ArcProps" if uf.arcenabled ARCHIVE {earca_library$},{earca_doctype$},{earca_docid$},subid {earca_subid$},title {earca_title$},notes {earca_notes$},keywords {earca_keywords$},categories {earca_cats$},links {earca_links$},args {earca_args$},dtm {earca_dtm$},subtitle {earca_subtitle$},subdtm {earca_subdtm$},entid {earca_entid$} endif # --- SCANNING BARCODE -------------------------------------------------- prepage { bcod_docid$=get(116,2,11,1) } precopy { # Add barcodes for scanning interface. bcod$="BCOD_PURCHASEORDER" # Y/N Switch from global section bcod_Copies$="2" # which copy(s) get barcode if lower(bcod$)="y" then: if pos(str(copy)=bcod_Copies$): bcod_docty$="PORD" rows$=str(MAXROWS+7) cmd$="text 2,"+str(MAXROWS+1.5)+","+$22$+"Do not write below this line"+$22$+",cgtimes,10,italic" cmd$+=$0a$+"cbox LEFTCOL,"+str(MAXROWS+2)+",RIGHTCOL,"+str(MAXROWS+2) # use of 'text' in below barcode commands requires # UnForm Windows Support Server cmd$+=$0a$+"barcode "+str(inchtocols(.5))+","+str(MAXROWS+4)+","+$22$+bcod_docty$+$22$+",BCSYMB,18.0,6,text" cmd$+=$0a$+"barcode "+str(inchtocols(3.5))+","+str(MAXROWS+4)+","+$22$+bcod_DocID$+$22$+",BCSYMB,18.0,6,text" exec(cmd$) end if end if } # --- 8.0 DELIVER ------------------------------------------------------ # deliver email command - no change needed, ref tags in deliver.ini deliver {eaddr$},{einvno$},args {eArg$},from {efrom$},cc {ecccc$},bcc {ebbcc$},subject {esubj$},note {ebody$},login {elogn$},password {epswd$},attach {etach$},otherhead {eohdr$},bodymime {emime$},combine {eCombine$} # deliver fax command - no change needed, ref tags in deliver.ini deliver {faddr$},{finvno$},args {fArg$},fromname {ffrom$},subject {fsubj$},note {fbody$},coverpage {fcovr$},attach {ftach$},toname {ftnam$},tocompany {ftoco$},fromcompany {ffrco$},combine {fCombine$} prepage { edel$="EDEL_PURCHASEORDER" if lower(edel$)="y": # form-based data locations eDocid$=get(116,2,11) # Required ALL methods eForm$="Purchase Order" eAddrEnt$=get(11,3,12) endif } # ADDRESS RETRIVAL METHODS merge "EDEL_METHOD" # EMAIL defaults or overrides, remove conditional for override prepage { if lower(edel$)="y": if not(uf.subjob): if eAddr$<>"": # email, ref tags in deliver.ini if ecopy$="" ecopy$="1" if efrom$="" efrom$="" if esubj$="" esubj$=eForm$+" "+eDocid$ if ebody$="" ebody$="" if etach$="" etach$="" if ecccc$="" ecccc$="" if ebbcc$="" ebbcc$="" if eohdr$="" eohdr$="" if elogn$="" elogn$="" if epswd$="" epswd$="" if emime$="" emime$="text/html" if pcopy$="" pcopy$="" eArg$="-ce "+ecopy$ eCombine$="no" endif endif endif } # FAX defaults or overrides, remove conditional for override prepage { if lower(edel$)="y": if not(uf.subjob): if fAddr$<>"": # fax, ref tags in deliver.ini if fcopy$="" fcopy$="1" if ffrom$="" ffrom$="" if fsubj$="" fsubj$=eForm$+" "+eDocid$ if fbody$="" fbody$="" if ftach$="" ftach$="" if fcovr$="" fcovr$="" # Fax Pkg cover page if ftnam$="" ftnam$="" if ftoco$="" ftoco$="" if ffrco$="" ffrco$="" if pcopy$="" pcopy$="" fArg$="-ce "+fcopy$ fCombine$="no" endif endif endif } # Include an unForm-generated cover page # merge "8.0 Cover Page" # remark this to ALWAYS print ALL copies of a delivered document merge "8.0 ED Selective Copy Printing" # --- PAGE X of Y FEATURE ----------------------------------------------- # change XOFYM_COPIES to "0" to turn off local XOFYM_COPIES="ALL" # or copy #'s to display local XOFYM_DROW =MAXROWS+.5 # row to display title # location of unique doc id local XOFYM_COL =116 # adjust as needed local XOFYM_ROW =2 # adjust as needed local XOFYM_NCOLS =11 # adjust as needed merge "zMrgMultiPageXofY" [Statement osx] # applies to form format #3 # Version 8.0 IMPORTANT NOTE!! # THIS 'OSX' RULESET IS FOR FORM 3 'MINIMAL FORMATTING ONLY'. # IT IS NOT IN USE UNLESS BELOW DETECT IS UNREMARKED. # SEE THE SDS VERSION FOR DEFAULT FORM 1 AND FORM 3 HANDLING. #detect 0,2-3,"~Statement *$" # set up document constants local MAXCOLS=96 # max cols to output local MAXRCOLS=95 # MAXCOLS-1 local LEFTCOL=1 # left vertical line local RIGHTCOL=MAXCOLS # 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 REMITTANCE_COPY=2 local FILE_COPY=3 local MAX_COPIES=3 copies MAX_COPIES portrait dpi 600 # see global constant above GSON # graphical shading title "Statement" # view in pdf properties # shift right 1 cmove LEFTCOL,1,RIGHTCOL,MAXROWS,2,1 # header section cerase 1,1,MAXCOLS,20 merge "zMrg form header" # remit to section text 2,7.5,"Remit\nTo:",ICFONT,10,cols=8 text 11,7.5,{remit$},DBFONT,10 # bill to text 2,14,"Customer",ICFONT,10,cols=8 text 2,15,{get(71,5,10,1)},DBCFONT,10,fit,cols=8 text 11,14,{bill$},DBFONT,10 # right header cbox 83,5,RIGHTCOL,11,1,crows= 6::DSHADE 7 8::DSHADE 9 10::DSHADE text 84,5.5,"Customer No.",ICFONT,cols=12 text 84,7.5,"Date",ICFONT,cols=12 text 84,9.5,"Total Due",ICFONT,cols=12 text 84,6.5,{get(72,5,10,1)},DBCFONT,cols=12 text 84,8.5,{get(69,7,8,1)},DBCFONT,cols=12 text 84,10.5,{get(68,10,13,1)},DBCFONT,cols=12 text 84,12.5,"Amount Paid",HBFONT text 83,14.5,"$ ________________",HBFONT # dotted line cerase 55,20,MAXCOLS,21 line LEFTCOL,20,RIGHTCOL,20 text 84,19,"Please return this portion\nwith your remittance",\ ICFONT,cols=12,spacing=1 # ribbon section cerase 1,21,15,26 cerase 19,21,30,26 cbox LEFTCOL,20.5,30,22.5,MBOXSIZE,crows=21.5::DSHADE,\ ccols=16 text 2,21,"Statement Date",ICFONT,cols=14 text 17,21,"Customer No.",ICFONT,cols=13 text 2,22,{get(4,25,8,1)},DBCFONT,cols=14 text 17,22,{get(16,25,12,1)},DBCFONT,cols=13 # move details over cmove 56,26,81,51,69,26 # detail cbox 1,23,RIGHTCOL,MAXROWS,MBOXSIZE cbox LEFTCOL,23,RIGHTCOL,{detrow},MBOXSIZE,crows=25::DSHADE,\ ccols=10 19 24 31 46 69 82 cerase 1,25,RIGHTCOL,25 text 2,24,"Invoice Date",ICFONT,cols=8 text 11,24,"Due Date",ICFONT,cols=8 text 20,24,"Type",ICFONT,cols=4 text 25,24,"Status",ICFONT,cols=6 text 32,24,"Invoice No.",ICFONT,cols=14 text 47,24,"PO Number",ICFONT,cols=22 text 70,24,"Charge",IRFONT,cols=12 text 83,24,"Credit",IRFONT,cols=12 cfont 2,26,9,{detrow},DBCFONT cfont 11,26,18,{detrow},DBCFONT cfont 20,26,23,{detrow},DCFONT cfont 25,26,30,{detrow},DCFONT cfont 32,26,45,{detrow},DCFONT text 47,26,{custpo$},DCFONT,cols=22 cfont 70,26,81,{detrow},DBRFONT cfont 83,26,{MAXRCOLS-1},{detrow},DBRFONT cfont MAXRCOLS,26,MAXRCOLS,{detrow},DBLFONT # check summary cfont 2,{cksum_top},9,{cksum_btm},DCFONT cfont 32,{cksum_top},50,{cksum_btm},DLFONT cfont 68,{cksum_top},MAXRCOLS,{cksum_btm},DBRFONT # special ship to lines font "** Ship To:@1,27,12,49",0,0,11,1,IFONT,10,black font "** Ship To:@1,27,12,49",12,0,33,1,DBLFONT,10 font "** Ship To:@1,27,12,49",46,0,20,1,IRFONT,10 # balance due font "Balance Due:",0,0,13,1,DBRFONT,11 # totals data cfont 2,56,16,56,DBRFONT,10 cfont 18,56,31,56,DBRFONT,10 cfont 33,56,46,56,DBRFONT,10 cfont 48,56,61,56,DBRFONT,10 cfont 63,56,80,56,DBRFONT,10 cfont 2,59,16,59,DBRFONT,10 cfont 18,59,31,59,DBRFONT,10 cfont 33,59,46,59,DBRFONT,10 cfont 48,59,61,59,DBRFONT,10 cfont 63,59,80,59,DBRFONT,10 # erase "continued on next page" erase "Continued On Next Page",0,0,RIGHTCOL,MAXROWS merge "zMrg bottom row" # footer #text 1,{MAXROWS+.5},{cont$},DBRFONT,10,cols=MAXRCOLS #text 1,{MAXROWS+.5},{copy_title$[copy]},DBCFONT,10,cols=MAXCOLS # # the below 2 lines is to correct possible page 1 extra row 1 # for printer device designation # local RULESET="Statement" merge "zMrgAdjustPage1Issue" prepage { # for use by create annotations function pdf_endcol=45 } # --- 8.0 FEATURES ------------------------------------------------------ merge "Statement 8.0 Merge" # --- ORIGINAL CODE-BLOCK SECTION --------------------------------------- prejob { dim copy_title$[MAX_COPIES] if MAX_COPIES>=1 then : copy_title$[CUSTOMER_COPY]="Customer Copy" endif if MAX_COPIES>=2 then : copy_title$[REMITTANCE_COPY]="Remittance Copy" endif if MAX_COPIES>=3 then : copy_title$[FILE_COPY]="Office Copy" endif doc_title$="STATEMENT" cksum_top=0,cksum_btm=0 } prepage { # pick up new info for use? later lang$=get(1,26,2,1) cono$=get(3,26,4,1) faxphoneno$=get(7,26,15,1) email$=get(22,26,60,1) x$=set(1,26,MAXCOLS,"") # 6.1.040 all address and postnet info zMrg # company/corresp, bill-to, ship-to xruleset$ ="stm-osx" merge "zMrg load addr info" xrow1=27,xrow2=66,last_page=0 merge "zMrg check continued" if left(cont$,4)="Cont" then : x$=mset(1,cont_row,MAXCOLS,MAXROWS,"") detrow=MAXROWS else y$="cbox 2,54,81,60,MBOXSIZE,crows=55.5::DSHADE 57 58.5::DSHADE,ccols=17 32 47 62" exec(y$) y$="text 2,54.75,"+$22$+"Current"+$22$+",IRFONT,10,cols=15" exec(y$) y$="text 18,54.75,"+$22$+"Period 2"+$22$+",IRFONT,10,cols=14" exec(y$) y$="text 33,54.75,"+$22$+"Period 3"+$22$+",IRFONT,10,cols=14" exec(y$) y$="text 48,54.75,"+$22$+"Period 4"+$22$+",IRFONT,10,cols=14" exec(y$) y$="text 63,54.75,"+$22$+"Period 5"+$22$+",IRFONT,10,cols=18" exec(y$) y$="text 2,57.75,"+$22$+"Service Charge"+$22$+",IRFONT,10,cols=15" exec(y$) y$="text 18,57.75,"+$22$+"Miscellaneous Credits"+$22$+",IRFONT,10,cols=14" exec(y$) y$="text 33,57.75,"+$22$+"Future Due"+$22$+",IRFONT,10,cols=14" exec(y$) y$="text 48,57.75,"+$22$+"On Order"+$22$+",IRFONT,10,cols=14" exec(y$) y$="text 63,57.75,"+$22$+"Service Charge Ytd"+$22$+",IRFONT,10,cols=18" exec(y$) detrow=53.5 last_page=1 endif # load cust po's custpo$="" for row=30 to 54 custpo$+=get(226,row,23,1)+$0a$ next row # find check summary if cksum_top>0 then : cksum_top=27 endif if cksum_top=0 then : for row=30 to 54 if pos("check summary "=lower(text$[row])) then : # enhance check sum line x$="cfont 2,"+str(row)+",MAXCOLS,"+str(row)+",IFONT,10" exec(x$) x$="cfont 2,"+str(row+1)+",9,"+str(row+1)+",ICFONT" exec(x$) x$="cfont 32,"+str(row+1)+",50,"+str(row+1)+",ILFONT" exec(x$) x$="cfont 68,"+str(row+1)+",MAXRCOLS,"+str(row+1)+",IRFONT" exec(x$) cksum_top=row+2 detrow=row-1 break endif next row endif if cksum_top>0 then cksum_btm=58 # watermark ztext$=doc_title$ if last_page then : zbrow=53 else zbrow=detrow-.5 endif merge "zMrg watermark" } postpage { if last_page then : cksum_top=0 cksum_btm=0 endif } # move detail text up # cmove 1,27,MAXCOLS,49,1,26 # mje 121609 change the move to code-block due to PDF links prepage { for row=29 to 54 text$[row-3]=text$[row] text$[row]="" next row # move totals up 1 line for row=55 to 66 text$[row-1]=text$[row] text$[row]="" next row } [Statement sds] # applies to form format #1 & #3 detect 12,2-3,"~Statement *$" # set up document constants local MAXCOLS=82 # max cols to output local MAXRCOLS=81 # MAXCOLS-1 local LEFTCOL=1 # left vertical line local RIGHTCOL=MAXCOLS # 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 REMIT_COPY=2 local FILE_COPY=3 local MAX_COPIES=3 copies MAX_COPIES portrait dpi 600 # see global constant above GSON # graphical shading title "Statement" # view in pdf properties # shift right 1 cmove LEFTCOL,1,RIGHTCOL,MAXROWS,2,1 # erase columns ! vline "!!",erase # erase rows - or = hline "==",erase hline "--",erase hline "^^" # header section cerase 1,1,MAXCOLS,20 merge "zMrg form header" # remit to section text 2,8.5,"Remit\nTo",ICFONT,10,cols=8 text 10,8.5,{remit$},DBFONT,10 # bill to text 2,15,"Customer",ICFONT,10,cols=7 text 10,15,{bill$},DBFONT,10 text 65.5,14.5,"Amount Paid",HBFONT text 63.4,16.5,"$ ________________",HBFONT # right header cbox 65,6,RIGHTCOL,9,1,ccols=74::DSHADE,crows=7 8 text 66,6.5,"Customer No.",IFONT text 66,7.5,"Date",IFONT text 66,8.5,"Total Due",IFONT text 75,6.5,{get(72,5,10,1)},DBFONT text 75,7.5,{get(69,7,8,1)},DBFONT text 75,8.5,{get(68,10,13,1)},DBFONT # ribbon section cerase 1,21,15,23 cerase 19,21,30,23 cbox 55,20.5,RIGHTCOL,22.5,MBOXSIZE,crows=21.5::DSHADE,ccols=69 text 56,21,"Statement Date",ICFONT,cols=14 text 70,21,"Customer No.",ICFONT,cols=12 text 56,22,{get(4,25,8,1)},DBCFONT,cols=14 text 70,22,{get(16,25,12,1)},DBCFONT,cols=12 # detail cbox 1,23,RIGHTCOL,MAXROWS,MBOXSIZE cbox LEFTCOL,23,RIGHTCOL,{detrow},MBOXSIZE,crows=25::DSHADE,\ ccols=10 19 24 31 54 69 cerase 1,25,RIGHTCOL,25 text 2,24,"Invoice Date",ICFONT,10,cols=8 text 11,24,"Due Date",ICFONT,10,cols=8 text 20,24,"Type",ICFONT,10,cols=4 text 25,24,"Status",ICFONT,10,cols=6 text 32,24,"Invoice No.",ICFONT,10,cols=23 text 55,24,"Charge",IRFONT,10,cols=12 text 70,24,"Credit",IRFONT,10,cols=11 cfont 2,26,9,{detrow},DBCFONT,10 cfont 11,26,18,{detrow},DBCFONT,10 cfont 20,26,23,{detrow},DCFONT,10 cfont 25,26,30,{detrow},DCFONT,10 cfont 32,26,53,{detrow},DCFONT,10 cfont 55,26,67,{detrow},DBRFONT,10 cfont 70,26,{MAXRCOLS-1},{detrow},DBRFONT,10 cfont MAXRCOLS,26,MAXRCOLS,{detrow},DBLFONT,10 # balance due font "Balance Due:",0,0,13,1,DBRFONT,11 # check summary cfont 2,{cksum_top},9,{cksum_btm},DCFONT cfont 32,{cksum_top},50,{cksum_btm},DLFONT cfont 68,{cksum_top},MAXRCOLS,{cksum_btm},DBRFONT # special ship to lines font "** Ship To:@1,27,12,49",0,0,11,1,IFONT,10,black font "** Ship To:@1,27,12,49",12,0,33,1,DBLFONT,10 font "** Ship To:@1,27,12,49",46,0,20,1,IRFONT,10 #Totals data cfont 2,56,16,56,DBRFONT,10 cfont 18,56,31,56,DBRFONT,10 cfont 33,56,46,56,DBRFONT,10 cfont 48,56,61,56,DBRFONT,10 cfont 63,56,80,56,DBRFONT,10 cfont 2,59,16,59,DBRFONT,10 cfont 18,59,31,59,DBRFONT,10 cfont 33,59,46,59,DBRFONT,10 cfont 48,59,61,59,DBRFONT,10 cfont 63,59,80,59,DBRFONT,10 # Totals labels cfont 2,52,16,52,IRFONT,10 cfont 18,52,31,52,IRFONT,10 cfont 33,52,46,52,IRFONT,10 cfont 48,52,61,52,IRFONT,10 cfont 63,52,80,52,IRFONT,10 cfont 2,55,16,55,IRFONT,10 cfont 18,55,31,55,IRFONT,10 cfont 33,55,46,55,IRFONT,10 cfont 48,55,61,55,IRFONT,10 cfont 63,55,80,55,IRFONT,10 # erase "continued on next page" erase "Continued On Next Page",0,0,RIGHTCOL,MAXROWS merge "zMrg bottom row" # # the below 2 lines is to correct possible page 1 extra row 1 # for printer device designation # local RULESET="Statement" merge "zMrgAdjustPage1Issue" prepage { # for use by create annotations function pdf_endcol=53 } # --- 8.0 FEATURES ------------------------------------------------------ merge "Statement 8.0 Merge" # --- ORIGINAL CODE-BLOCK SECTION --------------------------------------- prejob { dim copy_title$[MAX_COPIES] if MAX_COPIES>=1 then : copy_title$[CUSTOMER_COPY]="Customer Copy" endif if MAX_COPIES>=2 then : copy_title$[REMIT_COPY]="Remittance Copy" endif if MAX_COPIES>=3 then : copy_title$[FILE_COPY]="Office Copy" endif doc_title$="STATEMENT" cksum_top=0,cksum_btm=0 } prepage { # pick up new info for use? later lang$=get(1,26,2,1) cono$=get(3,26,4,1) faxphoneno$=get(7,26,15,1) email$=get(22,26,60,1) x$=set(1,26,MAXCOLS,"") # 6.1.040 all address and postnet info zMrg # company/corresp, bill-to, ship-to xruleset$ ="stm-sds" merge "zMrg load addr info" xrow1=27,xrow2=66,last_page=0 merge "zMrg check continued" if left(cont$,4)="Cont" then : x$=mset(1,cont_row,MAXCOLS,MAXROWS,"") detrow=MAXROWS else y$="cbox 1,54,81,60,MBOXSIZE,crows=55.5::DSHADE 57 58.5::DSHADE,ccols=17 32 47 62" exec(y$) y$="text 2,54.75,"+$22$+"Current"+$22$+",IRFONT,cols=15" exec(y$) y$="text 18,54.75,"+$22$+"Period 2"+$22$+",IRFONT,cols=14" exec(y$) y$="text 33,54.75,"+$22$+"Period 3"+$22$+",IRFONT,cols=14" exec(y$) y$="text 48,54.75,"+$22$+"Period 4"+$22$+",IRFONT,cols=14" exec(y$) y$="text 63,54.75,"+$22$+"Period 5"+$22$+",IRFONT,cols=18" exec(y$) y$="text 2,57.75,"+$22$+"Service Charge"+$22$+",IRFONT,cols=15" exec(y$) y$="text 18,57.75,"+$22$+"Miscellaneous Credits"+$22$+",IRFONT,cols=14" exec(y$) y$="text 33,57.75,"+$22$+"Future Due"+$22$+",IRFONT,cols=14" exec(y$) y$="text 48,57.75,"+$22$+"On Order"+$22$+",IRFONT,cols=14" exec(y$) y$="text 63,57.75,"+$22$+"Service Charge Ytd"+$22$+",IRFONT,cols=18" exec(y$) detrow=52 last_page=1 endif # find check summary if cksum_top>0 then : cksum_top=27 endif if cksum_top=0 then : for row=27 to MAXROWS if pos("check summary "=lower(text$[row])) then : # enhance check sum line x$="cfont 2,"+str(row)+",MAXCOLS,"+str(row)+",IFONT,10" exec(x$) x$="cfont 2,"+str(row+1)+",9,"+str(row+1)+",ICFONT" exec(x$) x$="cfont 32,"+str(row+1)+",50,"+str(row+1)+",ILFONT" exec(x$) x$="cfont 68,"+str(row+1)+",MAXRCOLS,"+str(row+1)+",IRFONT" exec(x$) cksum_top=row+2 detrow=row-1 break endif next row endif if cksum_top>0 then cksum_btm=57 # watermark ztext$=doc_title$ if last_page then : zbrow=detrow-0.5 else zbrow=MAXROWS-0.5 endif merge "zMrg watermark" for row=29 to 54 text$[row-3]=text$[row] text$[row]="" next row # move totals up 1 line for row=55 to 66 text$[row-1]=text$[row] text$[row]="" next row } postpage { if last_page then : cksum_top=0 cksum_btm=0 endif } [Statement 8.0 Merge] # --- 8.0 ARCHIVING ---------------------------------------------------- const ARCRULE="statement" prepage { noarchive=1 earc_archive$="EARC_STATEMENT",doing_recat=0 if lower(earc_archive$)="y": noarchive=0 if not(uf.subjob): gosub process_arcProps # see the zMrgArcProps ruleset endif endif } merge "8.0 zMrg ArcProps" if uf.arcenabled ARCHIVE {earca_library$},{earca_doctype$},{earca_docid$},subid {earca_subid$},title {earca_title$},notes {earca_notes$},keywords {earca_keywords$},categories {earca_cats$},links {earca_links$},args {earca_args$},dtm {earca_dtm$},subtitle {earca_subtitle$},subdtm {earca_subdtm$},entid {earca_entid$} endif # --- PDF HYPERLINK FOR ARCHIVING -------------------------------------- merge "8.0 zMrg PDFLinks v2" prepage { exec(fnCreateAnnotations$("~.....[0-9][0-9]-[0-9][0-9] ",32,26,pdf_endcol,53,0,-3,"","","DCFONT,10","EARC_STMLINKLIB","EARC_STMLINKDOCTY")) } # --- 8.0 DELIVER ------------------------------------------------------ # deliver email command - no change needed, ref tags in deliver.ini deliver {eaddr$},{einvno$},args {eArg$},from {efrom$},cc {ecccc$},bcc {ebbcc$},subject {esubj$},note {ebody$},login {elogn$},password {epswd$},attach {etach$},otherhead {eohdr$},bodymime {emime$},combine {eCombine$} # deliver fax command - no change needed, ref tags in deliver.ini deliver {faddr$},{finvno$},args {fArg$},fromname {ffrom$},subject {fsubj$},note {fbody$},coverpage {fcovr$},attach {ftach$},toname {ftnam$},tocompany {ftoco$},fromcompany {ffrco$},combine {fCombine$} prepage { edel$="EDEL_STATEMENT" if lower(edel$)="y": # form-based data locations eDocid$=get(68,5,12) # Required ALL methods eForm$="Statement" eAddrEnt$=eDocid$ endif } # ADDRESS RETREIVAL METHODS merge "EDEL_METHOD" # EMAIL defaults or overrides, remove conditional for override prepage { if lower(edel$)="y": if not(uf.subjob): if eAddr$<>"": # email, ref tags in deliver.ini if ecopy$="" ecopy$="1" if efrom$="" efrom$="" if esubj$="" esubj$=eForm$+" "+eDocid$ if ebody$="" ebody$="" if etach$="" etach$="" if ecccc$="" ecccc$="" if ebbcc$="" ebbcc$="" if eohdr$="" eohdr$="" if elogn$="" elogn$="" if epswd$="" epswd$="" if emime$="" emime$="text/html" if pcopy$="" pcopy$="" eArg$="-ce "+ecopy$ eCombine$="no" endif endif endif } # FAX defaults or overrides, remove conditional for override prepage { if lower(edel$)="y": if not(uf.subjob): if fAddr$<>"": # fax, ref tags in deliver.ini if fcopy$="" fcopy$="1" if ffrom$="" ffrom$="" if fsubj$="" fsubj$=eForm$+" "+eDocid$ if fbody$="" fbody$="" if ftach$="" ftach$="" if fcovr$="" fcovr$="" # Fax Pkg cover page if ftnam$="" ftnam$="" if ftoco$="" ftoco$="" if ffrco$="" ffrco$="" if pcopy$="" pcopy$="" fArg$="-ce "+fcopy$ fCombine$="no" endif endif endif } # Include an unForm-generated cover page # merge "8.0 Cover Page" # remark this to ALWAYS print ALL copies of a delivered document merge "8.0 ED Selective Copy Printing" # --- PAGE X of Y FEATURE ----------------------------------------------- ## change XOFYM_COPIES to "0" to turn off local XOFYM_COPIES="ALL" # or copy #'s to display local XOFYM_DROW =MAXROWS+.5 # row to display title # location of unique doc id local XOFYM_COL =68 # adjust as needed local XOFYM_ROW =5 # adjust as needed local XOFYM_NCOLS =12 # adjust as needed merge "zMrgMultiPageXofY" # --- ATTACH SCANNED IMAGES --------------------------------------------- prepage { do_attch$="STM_ATTCH_SCAN" if lower(do_attch$)="y" then: if not(uf.arcjob) then: begrow=26,endrow=50 tktcount=0,tktno$="" amask$=" ......[0-9]-[0-9][0-9] " for row=begrow to endrow pp=msk(text$[row],amask$,err=*next) if not(pp) continue tktno$+=trim(mid(text$[row],pp+1,10))+"," tktcount+=1 next row continued=(xofym_pageno<>xofym_maxpgs) # above, other erp was pos("Continued On Next Page"=text$[50]) # dotypes$ has valid 1st char prefixes to filter sub-id's, if applicable dotypes$="Scan" tktlib$="MySxe_Sales" tktdocty$="Invoice" if tktcount then: for ii=1 to tktcount tktdocid$=parse(tktno$,ii,",") have_arc1=docidexists(tktlib$,tktdocty$,tktdocid$) if have_arc1 then: subidlist$=getsubids(tktlib$,tktdocty$,tktdocid$) subid_count=count(subidlist$,";") for x=1 to subid_count tktsubid$=parse(subidlist$,x,";") if tktsubid$<>"" then: if dotypes$="" or pos(left(tktsubid$,4)=dotypes$)=1 then: filename$="" getarc(tktlib$,tktdocty$,tktdocid$,tktsubid$,filename$,tkterrmsg$) imglist$+=filename$+";" endif endif next x endif next ii if not(continued) then images$=imglist$,imglist$="" end if endif endif } if copy 1 images {images$},across 2, down 2 end if [Warehouse transfer osx] # applies to form format #3 # Version 8.0 IMPORTANT NOTE!! # THIS 'OSX' RULESET IS FOR FORM 3 'MINIMAL FORMATTING ONLY'. # IT IS NOT IN USE UNLESS BELOW DETECT IS UNREMARKED. # SEE THE SDS VERSION FOR DEFAULT FORM 1 AND FORM 3 HANDLING. #detect 0,2-3,"^Transfer/Packing List" # set up document constants local MAXCOLS=132 # max cols to output local MAXRCOLS=131 # MAXCOLS-1 local LEFTCOL=1 # left vertical line local RIGHTCOL=MAXCOLS # 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 FILE_COPY=3 local MAX_COPIES=3 copies MAX_COPIES portrait dpi 600 # see global constant above GSON # graphical shading title "Warehouse Transfer" # view in pdf properties # shift over 1 cmove 1,1,MAXCOLS,MAXROWS,2,1 cerase {MAXCOLS+1},1,300,MAXROWS # header section cerase 1,1,MAXCOLS,19 merge "zMrg form header" # rt ribbon 1 cbox 100,4,RIGHTCOL,6,1,crows=5::ISHADE,ccols=112 124 text 101,4.5,"UPC Vendor",ICFONT,cols=11 text 101,5.5,{upc_vndr$},DBCFONT,cols=11 text 113,4.5,"Transfer No",ICFONT,cols=11 text 113,5.5,{transfer$},DBCFONT,cols=11 text 125,4.5,"Page #",ICFONT,cols=6 text 125,5.5,{pgno$},DBCFONT,cols=6 cbox 100,6,RIGHTCOL,8,1,crows=7::ISHADE,ccols=114 text 101,6.5,"Order Date",ICFONT,cols=13 text 101,7.5,{orddate$},DBCFONT,cols=13 text 115,6.5,"Customer PO #",ICFONT,cols=18 text 115,7.5,{custpo$},DBCFONT,cols=18,fit # bill to text 2,9,"Bill\nTo:",ICFONT,10,cols=8 text 12,9,{bill$},DBFONT,10,fit,cols=40 # ship to text 2,16,"Ship\nTo:",ICFONT,10,cols=8 text 12,16,{ship$},DBFONT,10,fit,cols=40 # correspondence to text 66,9,"Correspondence\nTo:",ICFONT,9,cols=15 text 82,9,{comp_info$},DBFONT,10,fit,cols=40 # rt ribbon 2 cbox 67,16.5,RIGHTCOL,18.5,1,crows=17.5::ISHADE,ccols=80 text 68,17,"Ship Via",ICFONT,cols=12 text 68,18,{via$},DBCFONT,cols=12,fit text 81,17,"Instructions",ICFONT,cols=50 text 81,18,{inst$},DBCFONT,cols=50,fit cbox 67,18.5,RIGHTCOL,20.5,1,crows=19.5::ISHADE,ccols=78 89 102 text 68,19,"Requested",ICFONT,cols=10 text 68,20,{request$},DBCFONT,cols=10,fit text 79,19,"Shipped",ICFONT,cols=10 text 79,20,{shipdate$},DBCFONT,cols=10 text 90,19,"Terms",ICFONT,cols=12 text 90,20,{terms$},DBCFONT,cols=12,fit text 103,19,"Ship Point",ICFONT,cols=29 text 103,20,{ship_point$},DBCFONT,cols=29,fit # detail text 2,{dtlbgn-2},"Line\n#",ICFONT,cols=6 text 9,{dtlbgn-2},"Product\nAnd Description",ILFONT text 40,{dtlbgn-1.5},"Bin Location",ICFONT,cols=13 text 54,{dtlbgn-2},"Quantity\nOrdered",IRFONT,cols=11 text 67,{dtlbgn-2},"Quantity\nBO",IRFONT,cols=10 text 80,{dtlbgn-2},"Qty\nShipped",IRFONT,cols=11 text 93,{dtlbgn-2},"Qty\nU/M",ICFONT,cols=4 text 98,{dtlbgn-1.5},"Received",ICFONT,cols=13 text 111,{dtlbgn-2},"No.\nCartons",ICFONT,cols=6 text 118,{dtlbgn-2},"Amount\n(Net)",IRFONT,cols=14 cfont 2,{dtlbgn},7,{dtlbtm},DCFONT cfont 9,{dtlbgn},32,{dtlbtm},DLFONT cfont 34,{dtlbgn},38,{dtlbtm},DCFONT cfont 40,{dtlbgn},52,{dtlbtm},DCFONT cfont 54,{dtlbgn},65,{dtlbtm},DBRFONT cfont 67,{dtlbgn},78,{dtlbtm},DBRFONT cfont 80,{dtlbgn},91,{dtlbtm},DBRFONT cfont 93,{dtlbgn},96,{dtlbtm},DCFONT cfont 117,{dtlbgn},MAXRCOLS,{dtlbtm},DBRFONT # lot lines box "Lot #:@9,1,16,66",-3.5,-.3,45,.65,1,icols=8::DSHADE 31 36::DSHADE font "Lot #:@9,1,16,66",-3,0,9,1,ILFONT font "Lot #:@9,1,16,66",7,0,21,1,DBLFONT font "Lot #:@9,1,16,66",29,0,4,1,IFONT font "Lot #:@9,1,16,66",35,0,30,1,DBFONT,black # footer cerase 18,58,23,58 #erase asterisks cfont 2,{maxrows-4},4,{maxrows-4},DBRFONT cfont 6,{maxrows-4},16,{maxrows-4},IFONT cfont 22,{maxrows-4},46,{maxrows-4},IRFONT cfont 48,{maxrows-4},50,{maxrows-4},DBFONT cfont 60,{maxrows-4},76,{maxrows-4},IRFONT cfont 78,{maxrows-4},89,{maxrows-4},DBFONT cfont 92,{maxrows-4},MAXRCOLS,{maxrows-4},IBRFONT cfont 2,{maxrows-3},14,{maxrows-3},ICFONT cfont 16,{maxrows-3},28,{maxrows-3},ICFONT cfont 30,{maxrows-3},42,{maxrows-3},ICFONT cfont 44,{maxrows-3},57,{maxrows-3},IRFONT cfont 59,{maxrows-3},74,{maxrows-3},IRFONT cfont 76,{maxrows-3},92,{maxrows-3},IRFONT cfont 94,{maxrows-3},102,{maxrows-3},ICFONT cfont 104,{maxrows-3},112,{maxrows-3},ICFONT cfont 114,{maxrows-3},122,{maxrows-3},ICFONT cfont 124,{maxrows-3},MAXRCOLS,{maxrows-3},ICFONT cfont 2,{maxrows-2},14,{maxrows-2},DBCFONT cfont 16,{maxrows-2},28,{maxrows-2},DBCFONT cfont 30,{maxrows-2},42,{maxrows-2},DBCFONT cfont 44,{maxrows-2},57,{maxrows-2},DBRFONT cfont 59,{maxrows-2},74,{maxrows-2},DBRFONT cfont 76,{maxrows-2},92,{maxrows-2},DBRFONT cfont 94,{maxrows-2},102,{maxrows-2},DBCFONT cfont 104,{maxrows-2},112,{maxrows-2},DBCFONT cfont 114,{maxrows-2},122,{maxrows-2},DBCFONT cfont 124,{maxrows-2},MAXRCOLS,{maxrows-2},DBCFONT erase "Continued@1,50,10,MAXROWS",0,0,9,1 erase "Last Page@1,50,10,MAXROWS",0,0,9,1 merge "zMrg bottom row" # # the below 2 lines is to correct possible page 1 extra row 1 # for printer device designation # local RULESET="Transfer/Packing List" merge "zMrgAdjustPage1Issue" # --- 8.0 FEATURES ------------------------------------------------------ merge "Warehouse transfer 8.0 Merge" # --- ORIGINAL CODE-BLOCK SECTION --------------------------------------- prejob { dim copy_title$[MAX_COPIES] if MAX_COPIES>=1 then : copy_title$[CUSTOMER_COPY]="Customer Copy" endif if MAX_COPIES>=2 then : copy_title$[SCANNING_COPY]="Scanning Copy" endif if MAX_COPIES>=3 then : copy_title$[FILE_COPY]="Office Copy" endif } prepage { # set rcvd by for use by bottom row merge rcvd_by$="",last=1 if pos("Continued"=text$[56]) then last=0 x=pos("Received By"=text$[56]) if x then : rcvd_by$=get(x,56,60,1) x$=set(x,56,60,"") endif if rcvd_by$<>"" then : rcvd_by$=rcvd_by$(1,13)+dim(30)+rcvd_by$(14) endif if not(last) then rcvd_by$="" # get doc title doc_title$="Warehouse Transfer" # load detail header dtlhdr$=rtrim(cut(1,12,300,"")) # rx extra info for possible use. ribbon$=trim(cut(1,18,300,"")) xrow=2 merge "zMrg check reprint" # 6.1.040 all address and postnet info zMrg # company/corresp, bill-to, ship-to xruleset$ ="whs-osx" merge "zMrg load addr info" xrow1=56,xrow2=MAXROWS merge "zMrg check continued" # draw bottom box if left(cont$,4)="Cont" then : x$=mset(1,53,MAXCOLS,2,"") endif # load rt ribbon 1 upc_vndr$=get(95,3,6,1) transfer$=get(106,3,11,1) orddate$=get(94,5,8,1) custpo$=get(105,5,18,1) pgno$=get(129,5,4,1) # load rt ribbon 2 inst$=get(50,14,50,1) ship_point$=get(50,16,30,1) via$=get(81,16,12,1) request$=get(100,16,8,1) shipdate$=get(110,16,8,1) terms$=get(120,16,12,1) # find dtlbtm dtlbgn=20,dtlbtm=52 for row=dtlbgn to dtlbtm if pos("Lines Total"=text$[row])=0 then continue dtlbtm=row-1 break next row # remove unwanted detail for row=dtlbgn to dtlbtm if trim(left(text$[row],3))="" then continue # must be a detail line to strip x$=set(33,row,5," ") next row # move detail down 4 to make room shift=5 for row=MAXROWS to dtlbgn+shift step -1 text$[row]=text$[row-shift] text$[row-shift]="" next row dtlbgn=dtlbgn+shift,dtlbtm=dtlbtm+shift if dtlbtm>MAXROWS then dtlbtm=MAXROWS # draw detail box x$="cbox LEFTCOL,"+str(dtlbgn-3)+",RIGHTCOL,"+str(dtlbtm)+\ ",MBOXSIZE,crows="+str(dtlbgn-.5)+"::DSHADE,\ ccols=8 39 53 66 79 92 97 110 117" exec(x$) # draw bottom box if left(cont$,4)<>"Cont" then : x$="cbox LEFTCOL,"+str(dtlbtm)+",RIGHTCOL,MAXROWS,MBOXSIZE" exec(x$) endif # shade item lines for easier reading for row=dtlbgn to dtlbtm xx$=get(1,row,4,1) if xx$<"0" or xx$>"999" then continue x$="shade 1.5,"+str(row+.25)+",MAXRCOLS,.5,DSHADE" exec(x$) next row # watermark zbrow=dtlbtm-.5,ztext$=doc_title$ if dtlbtm-dtlbgn<10 then zbrow=MAXROWS-.5 merge "zMrg watermark" # setup footer boxes maxrows=MAXROWS if left(cont$,4)<>"Cont" then : x$="cbox LEFTCOL,"+str(maxrows-3.5)+",43,"+\ str(maxrows-.5)+",1,ccols=15 29,crows="+\ str(maxrows-2.5)+"::DSHADE" exec(x$) x$="cbox 93,"+str(maxrows-3.5)+",RIGHTCOL,"+\ str(maxrows-.5)+",1,ccols=103 113 123,crows="+\ str(maxrows-2.5)+"::DSHADE" exec(x$) x$=set(94,maxrows-3,7,"Pallets") x$=set(104,maxrows-3,7,"Cartons") x$=set(114,maxrows-3,7,"Bundles") x$=set(124,maxrows-3,5,"Reels") endif # find total lines for possible erasure if left(cont$,4)="Cont" then : for row=1 to MAXROWS if pos("Lines Total"=text$[row])=5 then : x$=set(1,row,MAXCOLS,"") endif if pos("Picked By"=text$[row])=1 then : x$=set(1,row,MAXCOLS,"") break endif next row endif } [Warehouse transfer sds] # applies to form format #1 & #3 detect 0,2-3,"^Transfer/Packing List" # set up document constants local MAXCOLS=134 # max cols to output local MAXRCOLS=133 # MAXCOLS-1 local LEFTCOL=1 # left vertical line local RIGHTCOL=MAXCOLS # right vertical line local MAXROWS=57 # max rows to output cols MAXCOLS # max output columns rows MAXROWS # max output rows local WAREHOUSE_COPY=1 local SCANNING_COPY=2 local FILE_COPY=3 local MAX_COPIES=3 copies MAX_COPIES PORT_LAND_XFER dpi 600 # see global constant above GSON # graphical shading title "Warehouse Transfer List" # view in pdf properties # shift right 1 cmove LEFTCOL,1,RIGHTCOL,MAXROWS,2,1 hline "__",erase # header section cerase 1,1,MAXCOLS,16 merge "zMrg form header" # instructions cbox LEFTCOL,15,95,16,MBOXSIZE,ccols=15::ISHADE text 2,15.5,"Instructions",IFONT,9 text 16,15.5,{inst$},DBFONT,10 # bill to text 2,8,"Bill To",IFONT,10 text 10,8,{get(11,4,20,1)},DBCFONT,10,cols=7 text 2,9,{bill$},DBFONT,10,fit,cols=45 # ship to text 53,8,"Ship To",IFONT,10 text 53,9,{ship$},DBFONT,10,fit,cols=40 # rt hdr cbox 97,4,RIGHTCOL,11,1,ccols=109::ISHADE,crows=5 6 7 8 9 10 cbox 99,11,RIGHTCOL,16,1,ccols=109::ISHADE,crows=11 12 13 14 15 cbox 97,11,99,16,1 text 98,4.5,"Transfer #",IFONT text 98,5.5,"Page #",IFONT text 98,6.5,"UPC Vendor",IFONT text 98,7.5,"Ship Point",IFONT text 98,8.5,"Via",IFONT text 98,9.5,"Staging Area",IFONT text 98,10.5,"Terms",IFONT text 97.3,11.5,"D\nA\nT\nE\nS",IBCFONT,cols=2 text 100,11.5,"Ordered",IFONT text 100,12.5,"Entered",IFONT text 100,13.5,"Requested",IFONT text 100,14.5,"Shipped",IFONT text 100,15.5,"Printed",IFONT text 110,4.5,{transfer$},DBFONT text 110,5.5,{pgno$},DBFONT text 110,6.5,{upc_vndr$},DBFONT text 110,7.5,{ship_point$},DBFONT,fit,cols=24 text 110,8.5,{via$},DBFONT text 110,10.5,{terms$},DBFONT text 110,11.5,{orddate$},DBFONT text 110,13.5,{request$},DBFONT text 110,14.5,{shipdate$},DBFONT text 110,15.5,{left(rx$,14)},DBFONT # detail section cerase 1,19,MAXCOLS,19 cbox LEFTCOL,16.5,RIGHTCOL,MAXROWS,MBOXSIZE cbox LEFTCOL,16.5,RIGHTCOL,{dtlbtm},MBOXSIZE,crows=18.5::DSHADE,ccols=8 55 68 81 92 98 110 cfont 2,17,7,19,ICFONT cfont 9,17,32,19,ILFONT cfont 34,17,38,19,ICFONT cfont 40,17,54,19,ICFONT cfont 56,17,67,19,IRFONT cfont 69,17,80,19,IRFONT cfont 82,17,91,19,IRFONT cfont 93,17,96,19,ICFONT cfont 98,17,109,19,ICFONT,black cfont 110,17,MAXRCOLS,19,ICFONT cfont 2,20,7,{dtlbtm},DCFONT cfont 9,20,32,{dtlbtm},DBLFONT cfont 34,20,38,{dtlbtm},DCFONT cfont 40,20,54,{dtlbtm},DCFONT cfont 56,20,67,{dtlbtm},DBRFONT cfont 69,20,80,{dtlbtm},DBRFONT cfont 82,20,91,{dtlbtm},DBRFONT cfont 93,20,96,{dtlbtm},DCFONT cfont 98,20,109,{dtlbtm},DCFONT,black cfont 110,20,MAXRCOLS,{dtlbtm},DCFONT # memo/description lines #font " @1,20,4,50",8,0,100,1,DLFONT # footer cfont 2,{maxrows-4},4,{maxrows-4},DBRFONT cfont 6,{maxrows-4},16,{maxrows-4},IFONT cfont 22,{maxrows-4},46,{maxrows-4},IRFONT cfont 48,{maxrows-4},50,{maxrows-4},DBFONT cfont 60,{maxrows-4},76,{maxrows-4},IRFONT cfont 78,{maxrows-4},89,{maxrows-4},DBFONT cfont 92,{maxrows-4},MAXRCOLS,{maxrows-4},IBRFONT cfont 2,{maxrows-3},14,{maxrows-3},ICFONT cfont 16,{maxrows-3},28,{maxrows-3},ICFONT cfont 30,{maxrows-3},42,{maxrows-3},ICFONT cfont 44,{maxrows-3},57,{maxrows-3},IRFONT cfont 59,{maxrows-3},74,{maxrows-3},IRFONT cfont 76,{maxrows-3},92,{maxrows-3},IRFONT cfont 94,{maxrows-3},102,{maxrows-3},ICFONT cfont 104,{maxrows-3},112,{maxrows-3},ICFONT cfont 114,{maxrows-3},122,{maxrows-3},ICFONT cfont 124,{maxrows-3},MAXRCOLS,{maxrows-3},ICFONT cfont 2,{maxrows-2},14,{maxrows-2},DBCFONT cfont 16,{maxrows-2},28,{maxrows-2},DBCFONT cfont 30,{maxrows-2},42,{maxrows-2},DBCFONT cfont 44,{maxrows-2},57,{maxrows-2},DBRFONT cfont 59,{maxrows-2},74,{maxrows-2},DBRFONT cfont 76,{maxrows-2},92,{maxrows-2},DBRFONT cfont 94,{maxrows-2},102,{maxrows-2},DBCFONT cfont 104,{maxrows-2},112,{maxrows-2},DBCFONT cfont 114,{maxrows-2},122,{maxrows-2},DBCFONT cfont 124,{maxrows-2},MAXRCOLS,{maxrows-2},DBCFONT erase "Continued@1,50,10,MAXROWS",0,0,9,1 erase "Last Page@1,50,10,MAXROWS",0,0,9,1 merge "zMrg bottom row" # # the below 2 lines is to correct possible page 1 extra row 1 # for printer device designation # local RULESET="Transfer/Packing List" merge "zMrgAdjustPage1Issue" # --- 8.0 FEATURES ------------------------------------------------------ merge "Warehouse transfer 8.0 Merge" # --- ORIGINAL CODE-BLOCK SECTION --------------------------------------- prejob { dim copy_title$[MAX_COPIES] if MAX_COPIES>=1 then : copy_title$[WAREHOUSE_COPY]="Warehouse Copy" endif if MAX_COPIES>=2 then : copy_title$[SCANNING_COPY]="Scanning Copy" endif if MAX_COPIES>=3 then : copy_title$[FILE_COPY]="Office Copy" endif doc_title$="Warehouse Transfer" } prepage { # set rcvd by for use by bottom row merge rcvd_by$="",last=1 if pos("Continued"=text$[56]) then last=0 x=pos("Received By"=text$[56]) if x then : rcvd_by$=get(x,56,60,1) x$=set(x,56,60,"") endif if rcvd_by$<>"" then : rcvd_by$=rcvd_by$(1,13)+dim(30)+rcvd_by$(14) endif if not(last) then rcvd_by$="" # load rt ribbon upc_vndr$=get(95,3,6,1) transfer$=get(106,3,7,1) orddate$=get(94,5,8,1) custpo$=get(105,5,18,1) pgno$=get(129,5,4,1) inst$=get(50,14,50,1) ship_point$=get(50,16,30,1) via$=get(81,16,12,1) request$=get(100,16,8,1) shipdate$=get(110,16,8,1) terms$=get(120,16,12,1) # load rx line rx$=trim(cut(1,18,300,"")) if rx$<>"" then : entereddatehdr$="Entered" text$[17]="Line Product UPC Bin Quantity Quantity Quantity Qty #" text$[18]=" # And Description Item# Location Ordered B.O. Shipped UM Received Cartons" endif # load detail header dtlhdr$=rtrim(cut(1,12,300,"")) xrow=2 merge "zMrg check reprint" xrow1=20,xrow2=MAXROWS,dtlbgn=20 merge "zMrg check continued" if left(cont$,4)="Cont" then : x$=mset(1,56,MAXCOLS,3,"") x$=set(11,59,MAXCOLS,"") dtlbtm=MAXROWS else dtlbtm=MAXROWS-5 endif # 6.1.040 all address and postnet info zMrg # company/corresp, bill-to, ship-to xruleset$ ="whs-sds" merge "zMrg load addr info" text$[54]=sub(text$[54],":"," ") # watermark zbrow=dtlbtm-.5,ztext$=doc_title$ merge "zMrg watermark" # shade item lines for easier reading for row=dtlbgn to dtlbtm xx$=get(1,row,4,1) if xx$<"0" or xx$>"999" then continue x$="shade 1.5,"+str(row+.25)+",MAXRCOLS,.5,DSHADE" exec(x$) next row # setup footer boxes maxrows=MAXROWS if left(cont$,4)<>"Cont" then : x$="cbox LEFTCOL,"+str(maxrows-3.5)+",43,"+str(maxrows-.5)+",1,ccols=15 29,crows="+str(maxrows-2.5)+"::DSHADE" exec(x$) x$="cbox 93,"+str(maxrows-3.5)+",RIGHTCOL,"+str(maxrows-.5)+",1,ccols=103 113 123,crows="+str(maxrows-2.5)+"::DSHADE" exec(x$) x$=set(94,maxrows-3,7,"Pallets") x$=set(104,maxrows-3,7,"Cartons") x$=set(114,maxrows-3,7,"Bundles") x$=set(124,maxrows-3,5,"Reels") endif # find total lines for possible erasure if left(cont$,4)="Cont" then : for row=1 to MAXROWS if pos("Lines Total"=text$[row])=5 then : x$=set(1,row,MAXCOLS,"") endif if pos("Picked By"=text$[row])=1 then : x$=set(1,row,MAXCOLS,"") break endif next row endif } [Warehouse transfer 8.0 Merge] # --- 8.0 ARCHIVING ---------------------------------------------------- const ARCRULE="transfer" prepage { noarchive=1 earc_archive$="EARC_WHTRANSFER",doing_recat=0 if lower(earc_archive$)="y": noarchive=0 if not(uf.subjob): gosub process_arcProps # see the zMrgArcProps ruleset endif endif } merge "8.0 zMrg ArcProps" if uf.arcenabled ARCHIVE {earca_library$},{earca_doctype$},{earca_docid$},subid {earca_subid$},title {earca_title$},notes {earca_notes$},keywords {earca_keywords$},categories {earca_cats$},links {earca_links$},args {earca_args$},dtm {earca_dtm$},subtitle {earca_subtitle$},subdtm {earca_subdtm$},entid {earca_entid$} endif # --- SCANNING BARCODE -------------------------------------------------- prepage { bcod_docid$=get(106,3,11,1) } precopy { # Add barcodes for scanning interface. bcod$="BCOD_WHTRANSFER" # Y/N Switch from global section bcod_Copies$="2" # which copy(s) get barcode if lower(bcod$)="y" then: if pos(str(copy)=bcod_Copies$): bcod_docty$="XFR" rows$=str(MAXROWS+7) cmd$="text 2,"+str(MAXROWS+1.5)+","+$22$+"Do not write below this line"+$22$+",cgtimes,10,italic" cmd$+=$0a$+"cbox LEFTCOL,"+str(MAXROWS+2)+",RIGHTCOL,"+str(MAXROWS+2) # use of 'text' in below barcode commands requires # UnForm Windows Support Server cmd$+=$0a$+"barcode "+str(inchtocols(.5))+","+str(MAXROWS+4)+","+$22$+bcod_docty$+$22$+",BCSYMB,18.0,6,text" cmd$+=$0a$+"barcode "+str(inchtocols(3.5))+","+str(MAXROWS+4)+","+$22$+bcod_DocID$+$22$+",BCSYMB,18.0,6,text" exec(cmd$) end if end if } # --- 8.0 DELIVER ------------------------------------------------------ # deliver email command - no change needed, ref tags in deliver.ini deliver {eaddr$},{einvno$},args {eArg$},from {efrom$},cc {ecccc$},bcc {ebbcc$},subject {esubj$},note {ebody$},login {elogn$},password {epswd$},attach {etach$},otherhead {eohdr$},bodymime {emime$},combine {eCombine$} # deliver fax command - no change needed, ref tags in deliver.ini deliver {faddr$},{finvno$},args {fArg$},fromname {ffrom$},subject {fsubj$},note {fbody$},coverpage {fcovr$},attach {ftach$},toname {ftnam$},tocompany {ftoco$},fromcompany {ffrco$},combine {fCombine$} prepage { edel$="EDEL_WHTRANSFER" if lower(edel$)="y": # form-based data locations eDocid$=get(106,3,11) # Required ALL methods eForm$="Purchase Order" eAddrEnt$="warehouse" # get(x,y,z) endif } # ADDRESS RETRIVAL METHODS merge "EDEL_METHOD" # EMAIL defaults or overrides, remove conditional for override prepage { if lower(edel$)="y": if not(uf.subjob): if eAddr$<>"": # email, ref tags in deliver.ini if ecopy$="" ecopy$="1" if efrom$="" efrom$="" if esubj$="" esubj$=eForm$+" "+eDocid$ if ebody$="" ebody$="" if etach$="" etach$="" if ecccc$="" ecccc$="" if ebbcc$="" ebbcc$="" if eohdr$="" eohdr$="" if elogn$="" elogn$="" if epswd$="" epswd$="" if emime$="" emime$="text/html" if pcopy$="" pcopy$="" eArg$="-ce "+ecopy$ eCombine$="no" endif endif endif } # FAX defaults or overrides, remove conditional for override prepage { if lower(edel$)="y": if not(uf.subjob): if fAddr$<>"": # fax, ref tags in deliver.ini if fcopy$="" fcopy$="1" if ffrom$="" ffrom$="" if fsubj$="" fsubj$=eForm$+" "+eDocid$ if fbody$="" fbody$="" if ftach$="" ftach$="" if fcovr$="" fcovr$="" # Fax Pkg cover page if ftnam$="" ftnam$="" if ftoco$="" ftoco$="" if ffrco$="" ffrco$="" if pcopy$="" pcopy$="" fArg$="-ce "+fcopy$ fCombine$="no" endif endif endif } # Include an unForm-generated cover page # merge "8.0 Cover Page" # remark this to ALWAYS print ALL copies of a delivered document merge "8.0 ED Selective Copy Printing" # --- PAGE X of Y FEATURE ----------------------------------------------- # change XOFYM_COPIES to "0" to turn off local XOFYM_COPIES="ALL" # or copy #'s to display local XOFYM_DROW =MAXROWS+.5 # row to display title # location of unique doc id local XOFYM_COL =106 # adjust as needed local XOFYM_ROW =3 # adjust as needed local XOFYM_NCOLS =11 # adjust as needed merge "zMrgMultiPageXofY" [--- Other Forms/Reports ---] #v8.0 [Bill of Lading] # applies to form format #1 & #3 detect 12,2-3,"^Bill of Lading" # set up document constants local MAXCOLS=110 # max cols to output local MAXRCOLS=109 # MAXCOLS-1 local LEFTCOL=1 # left vertical line local RIGHTCOL=MAXCOLS # 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 FILE_COPY=3 local MAX_COPIES=3 copies MAX_COPIES portrait dpi 600 # see global constant above GSON # graphical shading title "Bill of Lading" # view in pdf properties # shift right 1 cmove LEFTCOL,1,RIGHTCOL,MAXROWS,2,6 cerase {MAXCOLS+1},1,500,MAXROWS # header section cerase 1,1,MAXCOLS,17 merge "zMrg form header" # consigned to text 2,9,"Consigned to",ICFONT,10,cols=13 text 16,9,{get(15,6,30)},DBFONT,10 # destination text 2,11,"Destination",ICFONT,10,cols=13 text 16,11,{dest$},DBFONT,10 # rt hdr cbox 86,8,RIGHTCOL,15,1,ccols=98::ISHADE,crows=9 10 11 12 13 14 text 87,8.5,"Customer #",IFONT,10 text 99,8.5,{custno$},DBFONT,10 text 87,9.5,"Shipper #",IFONT,10 text 99,9.5,{shipno$},DBFONT,10 text 87,10.5,"Invoice Date",IFONT,10 text 99,10.5,{invdate$},DBFONT,10 text 87,11.5,"Page #",IFONT,10 text 99,11.5,{pgno$},DBFONT,10 text 87,12.5,"PO #",IFONT,10 text 99,12.5,{pono$},DBFONT,10 text 87,13.5,"PO Date",IFONT,10 text 99,13.5,{podate$},DBFONT,10 text 87,14.5,"UPC Vendor",IFONT,10 text 99,14.5,{upc_vndr$},DBFONT,10 # ribbons cbox LEFTCOL,18,RIGHTCOL,19.75,MBOXSIZE,ccols=11::ISHADE 22 36::ISHADE 68 80::ISHADE cfont 2,19,10,19,ICFONT,10 cfont 12,19,21,19,DBFONT,10,fit cfont 23,19,35,19,ICFONT,10 cfont 37,19,67,19,DBFONT,10,fit cfont 69,19,79,19,ICFONT,10 cfont 81,19,MAXRCOLS,19,DBFONT,10,fit cbox LEFTCOL,19.75,RIGHTCOL,21.5,MBOXSIZE,ccols=11::ISHADE 61 80::ISHADE cfont 2,21,10,21,ICFONT,10 cfont 12,21,60,21,DBFONT,10,fit cfont 62,21,79,21,ICFONT,10 cfont 81,21,MAXRCOLS,21,DBFONT,10,fit # detail section cbox LEFTCOL,22.5,RIGHTCOL,MAXROWS,MBOXSIZE cbox LEFTCOL,22.5,RIGHTCOL,{dtlbtm},MBOXSIZE,crows=24::DSHADE,ccols=5 18 24 50 77 89 102 cfont 2,23,4,24,IRFONT cfont 6,23,17,24,IRFONT cfont 19,23,23,24,ICFONT cfont 25,23,49,24,IFONT cfont 51,23,76,24,IFONT cfont 78,23,88,24,ICFONT cfont 90,23,101,24,IRFONT cfont 103,23,MAXRCOLS,24,IRFONT cfont 2,25,4,{dtlbtm},DRFONT cfont 6,25,17,{dtlbtm},DBRFONT cfont 19,25,23,{dtlbtm},DCFONT cfont 25,25,49,{dtlbtm},DBFONT cfont 51,25,76,{dtlbtm},DFONT cfont 78,25,88,{dtlbtm},DBPFONT cfont 90,25,101,{dtlbtm},DRFONT cfont 103,25,MAXRCOLS,{dtlbtm},DRFONT # footer cfont 2,{dtlbtm+1},17,{dtlbtm+1},DBRFONT,10 cfont 18,{dtlbtm+1},34,{dtlbtm+1},ICFONT,10,black cfont 36,{dtlbtm+1},55,{dtlbtm+1},ICFONT,10 cfont 61,{dtlbtm+1},76,{dtlbtm+1},ICFONT,10 cfont 78,{dtlbtm+1},88,{dtlbtm+1},DBRFONT,10 cfont 2,{dtlbtm+3},12,{dtlbtm+3},ICFONT,10 cfont 14,{dtlbtm+3},34,{dtlbtm+3},DBLFONT,10 cfont 36,{dtlbtm+3},55,{dtlbtm+3},ICFONT,10 cfont 2,{MAXROWS-1},12,{MAXROWS-1},IFONT,10 cfont {MAXCOLS-20},{MAXROWS-1},{MAXCOLS-15},{MAXROWS-1},IFONT,10 merge "zMrg bottom row" # # the below 2 lines is to correct possible page 1 extra row 1 # for printer device designation # local RULESET="Bill Of Lading" merge "zMrgAdjustPage1Issue" # --- 8.0 ARCHIVING ---------------------------------------------------- const ARCRULE="bill of lading" prepage { noarchive=1 earc_archive$="EARC_BILLOFLADING",doing_recat=0 if lower(earc_archive$)="y": noarchive=0 if not(uf.subjob): gosub process_arcProps # see the zMrgArcProps ruleset endif endif } merge "8.0 zMrg ArcProps" if uf.arcenabled ARCHIVE {earca_library$},{earca_doctype$},{earca_docid$},subid {earca_subid$},title {earca_title$},notes {earca_notes$},keywords {earca_keywords$},categories {earca_cats$},links {earca_links$},args {earca_args$},dtm {earca_dtm$},subtitle {earca_subtitle$},subdtm {earca_subdtm$},entid {earca_entid$} endif # --- 8.0 DELIVER ------------------------------------------------------ # deliver email command - no change needed, ref tags in deliver.ini deliver {eaddr$},{einvno$},args {eArg$},from {efrom$},cc {ecccc$},bcc {ebbcc$},subject {esubj$},note {ebody$},login {elogn$},password {epswd$},attach {etach$},otherhead {eohdr$},bodymime {emime$},combine {eCombine$} # deliver fax command - no change needed, ref tags in deliver.ini deliver {faddr$},{finvno$},args {fArg$},fromname {ffrom$},subject {fsubj$},note {fbody$},coverpage {fcovr$},attach {ftach$},toname {ftnam$},tocompany {ftoco$},fromcompany {ffrco$},combine {fCombine$} prepage { edel$="EDEL_BILLOFLADING" if lower(edel$)="y": # form-based data locations eDocid$=get(121,3,12) # Required ALL methods eForm$="Bill of Lading" eAddrEnt$=get(12,4,12) endif } # ADDRESS RETRIVAL METHODS merge "EDEL_METHOD" # EMAIL defaults or overrides, remove conditional for override prepage { if lower(edel$)="y": if not(uf.subjob): if eAddr$<>"": # email, ref tags in deliver.ini if ecopy$="" ecopy$="1" if efrom$="" efrom$="" if esubj$="" esubj$=eForm$+" "+eDocid$ if ebody$="" ebody$="" if etach$="" etach$="" if ecccc$="" ecccc$="" if ebbcc$="" ebbcc$="" if eohdr$="" eohdr$="" if elogn$="" elogn$="" if epswd$="" epswd$="" if emime$="" emime$="text/html" if pcopy$="" pcopy$="" eArg$="-ce "+ecopy$ eCombine$="no" endif endif endif } # FAX defaults or overrides, remove conditional for override prepage { if lower(edel$)="y": if not(uf.subjob): if fAddr$<>"": # fax, ref tags in deliver.ini if fcopy$="" fcopy$="1" if ffrom$="" ffrom$="" if fsubj$="" fsubj$=eForm$+" "+eDocid$ if fbody$="" fbody$="" if ftach$="" ftach$="" if fcovr$="" fcovr$="" # Fax Pkg cover page if ftnam$="" ftnam$="" if ftoco$="" ftoco$="" if ffrco$="" ffrco$="" if pcopy$="" pcopy$="" fArg$="-ce "+fcopy$ fCombine$="no" endif endif endif } # Include an unForm-generated cover page # merge "8.0 Cover Page" # remark this to ALWAYS print ALL copies of a delivered document merge "8.0 ED Selective Copy Printing" # --- SCANNING BARCODE -------------------------------------------------- prepage { bcod_docid$=get(121,3,12,1) } precopy { # Add barcodes for scanning interface. bcod$="BCOD_BILLOFLADING" # Y/N Switch from global section bcod_Copies$="2" # which copy(s) get barcode if lower(bcod$)="y" then: if pos(str(copy)=bcod_Copies$): bcod_docty$="BOL" rows$=str(MAXROWS+7) cmd$="text 2,"+str(MAXROWS+1.5)+","+$22$+"Do not write below this line"+$22$+",cgtimes,10,italic" cmd$+=$0a$+"cbox LEFTCOL,"+str(MAXROWS+2)+",RIGHTCOL,"+str(MAXROWS+2) cmd$+=$0a$+"barcode "+str(inchtocols(.5))+","+str(MAXROWS+4)+","+$22$+bcod_docty$+$22$+",BCSYMB,18.0,6,text" cmd$+=$0a$+"barcode "+str(inchtocols(3.5))+","+str(MAXROWS+4)+","+$22$+bcod_DocID$+$22$+",BCSYMB,18.0,6,text" exec(cmd$) end if end if } # --- PAGE X of Y FEATURE ----------------------------------------------- # change XOFYM_COPIES to "0" to turn off local XOFYM_COPIES="ALL" # or copy #'s to display local XOFYM_DROW =MAXROWS+.5 # row to display title # location of unique doc id local XOFYM_COL =121 # adjust as needed local XOFYM_ROW =3 # adjust as needed local XOFYM_NCOLS =12 # adjust as needed merge "zMrgMultiPageXofY" # --- ORIGINAL CODE-BLOCK SECTION --------------------------------------- prejob { dim copy_title$[MAX_COPIES] if MAX_COPIES>=1 then : copy_title$[CUSTOMER_COPY]="Customer Copy" endif if MAX_COPIES>=2 then : copy_title$[SCANNING_COPY]="Scanning Copy" endif if MAX_COPIES>=3 then : copy_title$[FILE_COPY]="Office Copy" endif # setup bol messages bol_msg1$ ="THIS IS TO CERTIFY THAT THE ABOVE NAMED MATERIALS " bol_msg1$+="ARE PROPERLY CLASSIFIED, DESCRIBED, PACKAGED, MARKED " bol_msg1$+="AND LABELED, AND ARE IN PROPER CONDITION FOR " bol_msg1$+="TRANSPORTATION ACCORDING TO THE APPLICABLE REGULATIONS " bol_msg1$+="OF THE DEPARTMENT OF TRANSPORTION." bol_msg2$ ="RECEIVED, subject to the classifications and lawfully " bol_msg2$+="filed tariffs in effect on the date of issue of this " bol_msg2$+="Bill of Lading, the property described above, in " bol_msg2$+="apparent good order, except as noted, which said carrier " bol_msg2$+="agrees to carry to its usual place of delivery at " bol_msg2$+="said destination. The shipper hereby accepts all of " bol_msg2$+="the terms and conditions of this Bill of Lading." } prepage { doc_title$=upper(get(12,2,30,1)) custno$=get(12,4,12,1) upc_vndr$=get(95,3,6,1) invdate$=get(108,3,8,1) shipno$=get(121,3,12,1) podate$=get(94,5,8,1) pono$=get(104,5,22,1) pgno$=get(129,5,4,1) # clean up colons text$[14]=sub(text$[14],":"," ") text$[16]=sub(text$[16],":"," ") # check for continued xrow1=21,xrow2=MAXROWS merge "zMrg CheckContinued" if last_page then : dtlbtm=53 x$ ="cbox LEFTCOL,"+str(dtlbtm)+",RIGHTCOL," x$+=str(dtlbtm+2)+",MBOXSIZE,ccols=18 35::HSHADE 60 77::HSHADE 89" exec(x$) x$ ="cbox LEFTCOL,"+str(dtlbtm+2)+",RIGHTCOL," x$+=str(dtlbtm+4)+",MBOXSIZE,ccols=13::HSHADE 35" exec(x$) x$=set(1,dtlbtm-1,10,"C.O.D. $") x$=mset(1,54,MAXCOLS,MAXROWS,"") x$="text 10,58,"+$22$+bol_msg1$+$22$+",ICFONT,6,wrap,cols=90,spacing=1" exec(x$) x$="text 10,60.25,"+$22$+bol_msg2$+$22$+",ICFONT,6,wrap,cols=90,spacing=1" exec(x$) x$ ="cbox LEFTCOL,"+str(MAXROWS-4.5)+",RIGHTCOL," x$+=str(MAXROWS-4.5)+",MBOXSIZE" exec(x$) x$ ="cbox LEFTCOL,"+str(MAXROWS-2)+",RIGHTCOL," x$+=str(MAXROWS)+",MBOXSIZE,ccols=12::HSHADE 89 96::HSHADE" exec(x$) x$=set(1,MAXROWS-5,10,"Signature") x$=set(MAXCOLS-20,MAXROWS-5,4,"Date") else dtlbtm=MAXROWS x$=mset(1,49,MAXCOLS,MAXROWS,"") endif # 6.1.040 all address and postnet info zMrg # company/corresp, bill-to, ship-to xruleset$ ="bol-sds" merge "zMrg load addr info" # shade item lines for easier reading for row=22 to 48 step 2 xx$=get(1,row,4,1) if xx$="" then continue x$="shade 1.5,"+str(row+4)+",MAXRCOLS,1,DSHADE" exec(x$) next row } [ServiceRepairOrder] # applies to form format #1 & #3 detect 0,1,"^S E R V I C E R E P A I R O R D E R" # set up document constants local MAXCOLS=94 # max cols to output local MAXRCOLS=93 # MAXCOLS-1 local LEFTCOL=1 # left vertical line local RIGHTCOL=MAXCOLS # right vertical line local MAXROWS=67 # max rows to output cols MAXCOLS # max output columns rows MAXROWS # max output rows local CUSTOMER_COPY=1 local FILE_COPY=2 local SERV_COPY=3 local MAX_COPIES=3 copies MAX_COPIES portrait dpi 600 # see global constant above GSON # graphical shading title "Service Repair Order" # view in pdf properties # shift right 1 cmove LEFTCOL,1,RIGHTCOL,MAXROWS,2,{1+form_shift} # header section cerase 1,1,MAXCOLS,3 cbox 1,1,MAXCOLS,MAXROWS,MBOXSIZE image 1,1,10,6,"COMP_LOGO" text 1,2,"COMP_NAME",HBCFONT,14,cols=MAXCOLS text 1,3,{comp_hdr$},HBCFONT,cols=MAXCOLS text 1,2,{rdoc_title$},HBRFONT,16,cols=MAXRCOLS,spacing=1 # ribbon section cbox 1,{2+form_shift},MAXCOLS,{dtlbgn-4.25},MBOXSIZE,ccols=19::ISHADE 52 68::ISHADE cfont 2,{3+form_shift},18,{dtlbgn-5},IRFONT,10 cfont 20,{3+form_shift},48,{dtlbgn-5},DBLFONT,10 text 20,{11+form_shift},{addr$},DBLFONT,10,fit,cols=31 cfont 50,{3+form_shift},67,{dtlbgn-5},IRFONT,10 cfont 69,{3+form_shift},MAXRCOLS,{dtlbgn-5},DBLFONT,10 # detail section cerase 1,{dtlbgn-1},MAXCOLS,{dtlbgn-1} cfont 2,{dtlbgn-3},4,{dtlbgn-2},ICFONT,10 cfont 6,{dtlbgn-3},12,{dtlbgn-2},ILFONT,10 cfont 31,{dtlbgn-3},43,{dtlbgn-2},IRFONT,10 cfont 45,{dtlbgn-3},52,{dtlbgn-2},IRFONT,10 cfont 54,{dtlbgn-3},65,{dtlbgn-2},ILFONT,10 cfont 76,{dtlbgn-3},83,{dtlbgn-2},ICFONT,10 cfont 86,{dtlbgn-3},93,{dtlbgn-2},ICFONT,10 cfont 2,{dtlbgn},4,MAXROWS,DBCFONT font "~..[0-9]@1,1,4,MAXROWS",4,0,25,1,DBFONT,10 font "~..[0-9]@1,1,4,MAXROWS",30,0,12,1,DBRFONT,10 font "~..[0-9]@1,1,4,MAXROWS",44,0,7,1,DBRFONT,10 font "~..[0-9]@1,1,4,MAXROWS",52,0,17,1,DBLFONT,10 font "~..[0-9]@1,1,4,MAXROWS",74,0,8,1,DBCFONT,10 font "~..[0-9]@1,1,4,MAXROWS",84,0,8,1,DBCFONT,10 # footer text 1,{MAXROWS+.5},{copy_title$[copy]},HBCFONT,cols=MAXRCOLS # --- 8.0 ARCHIVING ---------------------------------------------------- const ARCRULE="service repair" prepage { noarchive=1 earc_archive$="EARC_SERVICEREPAIR",doing_recat=0 if lower(earc_archive$)="y": noarchive=0 if not(uf.subjob): gosub process_arcProps # see the zMrgArcProps ruleset endif endif } merge "8.0 zMrg ArcProps" if uf.arcenabled ARCHIVE {earca_library$},{earca_doctype$},{earca_docid$},subid {earca_subid$},title {earca_title$},notes {earca_notes$},keywords {earca_keywords$},categories {earca_cats$},links {earca_links$},args {earca_args$},dtm {earca_dtm$},subtitle {earca_subtitle$},subdtm {earca_subdtm$},entid {earca_entid$} endif # --- 8.0 DELIVER ------------------------------------------------------ # deliver email command - no change needed, ref tags in deliver.ini deliver {eaddr$},{einvno$},args {eArg$},from {efrom$},cc {ecccc$},bcc {ebbcc$},subject {esubj$},note {ebody$},login {elogn$},password {epswd$},attach {etach$},otherhead {eohdr$},bodymime {emime$},combine {eCombine$} # deliver fax command - no change needed, ref tags in deliver.ini deliver {faddr$},{finvno$},args {fArg$},fromname {ffrom$},subject {fsubj$},note {fbody$},coverpage {fcovr$},attach {ftach$},toname {ftnam$},tocompany {ftoco$},fromcompany {ffrco$},combine {fCombine$} prepage { edel$="EDEL_SERVICEREPAIR" if lower(edel$)="y": # form-based data locations eDocid$=get(19,3,20) # Required ALL methods eForm$="Bill of Lading" eAddrEnt$=get(20,9,20) endif } # ADDRESS RETRIVAL METHODS merge "EDEL_METHOD" # EMAIL defaults or overrides, remove conditional for override prepage { if lower(edel$)="y": if not(uf.subjob): if eAddr$<>"": # email, ref tags in deliver.ini if ecopy$="" ecopy$="1" if efrom$="" efrom$="" if esubj$="" esubj$=eForm$+" "+eDocid$ if ebody$="" ebody$="" if etach$="" etach$="" if ecccc$="" ecccc$="" if ebbcc$="" ebbcc$="" if eohdr$="" eohdr$="" if elogn$="" elogn$="" if epswd$="" epswd$="" if emime$="" emime$="text/html" if pcopy$="" pcopy$="" eArg$="-ce "+ecopy$ eCombine$="no" endif endif endif } # FAX defaults or overrides, remove conditional for override prepage { if lower(edel$)="y": if not(uf.subjob): if fAddr$<>"": # fax, ref tags in deliver.ini if fcopy$="" fcopy$="1" if ffrom$="" ffrom$="" if fsubj$="" fsubj$=eForm$+" "+eDocid$ if fbody$="" fbody$="" if ftach$="" ftach$="" if fcovr$="" fcovr$="" # Fax Pkg cover page if ftnam$="" ftnam$="" if ftoco$="" ftoco$="" if ffrco$="" ffrco$="" if pcopy$="" pcopy$="" fArg$="-ce "+fcopy$ fCombine$="no" endif endif endif } # Include an unForm-generated cover page # merge "8.0 Cover Page" # remark this to ALWAYS print ALL copies of a delivered document merge "8.0 ED Selective Copy Printing" # --- SCANNING BARCODE -------------------------------------------------- prepage { bcod_docid$=get(19,3,20,1) } precopy { # Add barcodes for scanning interface. bcod$="BCOD_SERVICEREPAIR" # Y/N Switch from global section bcod_Copies$="3" # which copy(s) get barcode if lower(bcod$)="y" then: if pos(str(copy)=bcod_Copies$): bcod_docty$="SVC" rows$=str(MAXROWS+7) cmd$="text 2,"+str(MAXROWS+1.5)+","+$22$+"Do not write below this line"+$22$+",cgtimes,10,italic" cmd$+=$0a$+"cbox LEFTCOL,"+str(MAXROWS+2)+",RIGHTCOL,"+str(MAXROWS+2) cmd$+=$0a$+"barcode "+str(inchtocols(.5))+","+str(MAXROWS+4)+","+$22$+bcod_docty$+$22$+",BCSYMB,18.0,6,text" cmd$+=$0a$+"barcode "+str(inchtocols(3.5))+","+str(MAXROWS+4)+","+$22$+bcod_DocID$+$22$+",BCSYMB,18.0,6,text" exec(cmd$) end if end if } # --- PAGE X of Y FEATURE ----------------------------------------------- # change XOFYM_COPIES to "0" to turn off local XOFYM_COPIES="ALL" # or copy #'s to display local XOFYM_DROW =MAXROWS+.5 # row to display title # location of unique doc id local XOFYM_COL =19 # adjust as needed local XOFYM_ROW =3 # adjust as needed local XOFYM_NCOLS =20 # adjust as needed merge "zMrgMultiPageXofY" # --- ORIGINAL CODE-BLOCK SECTION --------------------------------------- prejob { dim copy_title$[MAX_COPIES] if MAX_COPIES>=1 then : copy_title$[CUSTOMER_COPY]="Customer Copy" endif if MAX_COPIES>=2 then : copy_title$[FILE_COPY]="Office Copy" endif if MAX_COPIES>=3 then : copy_title$[SERV_COPY]="Service Copy" endif } prepage { doc_title$="SERVICE REPAIR ORDER" x$=set(1,1,MAXCOLS,"") rdoc_title$="SERVICE\nREPAIR ORDER" # load pertinent fields pgno$=get(68,3,5,1) rono$=get(19,3,20,1) comp_hdr$="COMP_ADDR1"+$0a$+"COMP_ADDR2"+$0a$+"COMP_ADDR3"+$0a$ comp_hdr$+="COMP_PHONES"+$0a$+"COMP_EMAIL COMP_WEB" comp_hdr$=striplines(comp_hdr$) # load and 'compress' address bcj - 05/15/2012 addr$="" if pgno$="1" then : addr$=mget(20,11,29,4,"Y","Y") x$=mset(20,11,29,4,"") zip$=get(20,15,34,1) x$=set(20,15,34,"") addr$=addr$+$0a$+zip$ addr$=striplines(addr$) endif # find detail begin form_shift=6 for row=1 to MAXROWS if get(1,row,3)="Ln#" then : dtlbgn=row+2 # to top of detail rows break endif next row # allow for shift dtlbgn+=form_shift # remove colons in ribbon area for row=1 to dtlbgn-4 if get(17,row,1,1)=":" then x$=set(17,row,1," ") if get(66,row,1,1)=":" then x$=set(66,row,1," ") next row # draw detail boxes due to variability cmd$="" cmd$+="cbox 1,"+str(dtlbgn-3.75)+",MAXCOLS,MAXROWS,MBOXSIZE,\ crows="+str(dtlbgn-1)+"::DSHADE,ccols=5" # shade detail line for row=dtlbgn-form_shift to MAXROWS if get(1,row,3,1)<>"" then : cmd$+=$0a$+"shade 1.5,"+str(row+form_shift)+",MAXRCOLS,0.75,DSHADE" endif next row exec(cmd$) # watermark zbrow=MAXROWS-0.5,ztext$=doc_title$ merge "zMrg watermark" } [Check a/p long stub] # applies to form format #1 & #3? detect 20,1-2,"~APCHK *$" # set up document constants local MAXCOLS=82 # max cols to output local MAXRCOLS=81 # MAXCOLS-1 local LEFTCOL=1 # left vertical line local RIGHTCOL=MAXCOLS # right vertical line local MAXROWS=66 # max rows to output cols MAXCOLS # max output columns rows MAXROWS # max output rows page MAXROWS # max input rows copies 1 portrait dpi 600 # see global constant above GSON # graphical shading title "A/P Check" # view in pdf properties # shift for better placement cmove 1,1,MAXCOLS,MAXROWS,2,5 cmove 1,45,MAXCOLS,MAXROWS,1,44 hline "---",erase # Stub # top section cerase 2,1,RIGHTCOL,8 cbox 45,1.5,RIGHTCOL,5.5,1,crows=2.5::ISHADE 3.5 4.5::ISHADE,ccols=58 cbox 71,3.5,71,5.5 LOGO_IMAGE 1,1,10,5,"COMP_LOGO" text 13,2,"COMP_NAME",HBFONT,14 text 13,2.9,"COMP_ADDR1",HFONT,12 text 13,3.9,"COMP_ADDR2",HFONT,12 text 13,4.9,"COMP_ADDR3",HFONT,12 text 46,2,"Vendor #",ICFONT,cols=12 text 59,2,"Vendor Name",ICFONT,cols=23 text 46,3,{get(13,2,12,1)},DBCFONT,cols=12 text 59,3,{get(11,56,36,1)},DBCFONT,cols=23 text 46,4,"Check Date",ICFONT,cols=12 text 59,4,"Check #",ICFONT,cols=12 text 72,4,"Our Customer #",ICFONT,cols=10 text 46,5,{checkdate$},DBCFONT,cols=12 text 59,5,{chkno$},DBCFONT,cols=12 text 72,5,{get(43,2,20,1)},DBCFONT,cols=10 # detail cbox LEFTCOL,7.5,RIGHTCOL,43.5,1,crows=9::DSHADE,\ ccols=10 13 29 39 53 68 text 2,8.25,"Date",ICFONT,cols=8 text 11,8.25,"Tp",ICFONT,cols=2 text 14,8.25,"Invoice No.",IFONT,cols=15 text 30,8.25,"Reference",IFONT,cols=9 text 40,8.25,"Gross",IRFONT,cols=13 text 54,8.25,"Discount",IRFONT,cols=13 text 69,8.25,"Net",IRFONT,cols=13 cfont 2,10,9,43,DBCFONT # inv dt cfont 11,10,12,43,DBCFONT,black # inv ty cfont 14,10,29,43,DBFONT # inv num cfont 30,10,39,43,DBFONT,black # ref cfont 40,10,52,43,DBRFONT # gross cfont 54,10,66,43,DBRFONT,black # disc cfont 69,10,MAXRCOLS,43,DBRFONT # net # footer cbox 29,43.5,RIGHTCOL,44.5,1,ccols=39::100 53 67 text 30,44,"Totals",IBFONT,shade 0 text 40,44,{gtot$},DBRFONT,cols=13 # inv amt text 54,44,{dtot$},DBRFONT,cols=13 # discount text 68,44,{ntot$},DBRFONT,cols=14 # paid amt # Check AP_CBOX LEFTCOL,47,RIGHTCOL,64.5,MBOXSIZE AP_IMGE 1,47,10,5,"COMP_LOGO" AP_CNME 13,48.25,"COMPCK_NAME",HBFONT,14 AP_CNME 13,49.35,"COMPCK_ADDR1",HFONT,12 AP_CNME 13,50.35,"COMPCK_ADDR2",HFONT,12 AP_CNME 13,51.35,"COMPCK_ADDR3",HFONT,12 AP_BNME 49,48.25,"AP_BANK_NAME",DBFONT AP_BNME 49,49.05,"AP_BANK_ADDR1",DFONT AP_BNME 49,49.85,"AP_BANK_ADDR2",DFONT AP_BRTR 1,49.85,"AP_ROUTING",DBRFONT,cols=MAXRCOLS text 1,48,{chkno$},HBRFONT,14,cols=MAXRCOLS AP_RBBX 57,50.5,MAXRCOLS,52.5,1,crows=51.5::100,ccols=69 AP_RBTX 58,51,"Date",ICFONT,shade 0,cols=11 text 58,52,{checkdate$},DBCFONT,cols=11 AP_RBTX 70,51,"Amount",IRFONT,shade 0,cols=11 text 70,52,{get(59,51,15,1)},DBRFONT,cols=11 cerase 1,54,MAXCOLS,54 AP_PYTX 2,56,"Pay",IFONT,14 text 6.5,56,{get(9,53,65,1)+get(9,54,65,"")},\ IBFONT,10,cols=75 cerase 1,56,MAXCOLS,57 AP_PYTX 2,58.5,"Pay\nto the\nOrder\nof",IFONT,9,spacing=1 text 6.5,58.5,{striplines(mget(11,56,36,5,"Y","Y"))},DBFONT,10 cerase 1,59,MAXCOLS,63 AP_SNTX 50,59.50,"Check Void After 180 Days",ICFONT,cols=30 SIGNATURE_IMAGE 50,61,0,0,"SIGNATURE" AP_SNBX 50,62.0,30,1,3 AP_SNTX 50,62.75,"Authorized Signature",ICFONT,cols=30 AP_MICR 18,65.50,"AP_MICR_ACCOUNTNO",{chkno$} # # the below 2 lines is to correct possible page 1 extra row 1 # for printer device designation # local RULESET="APCHK" merge "zMrgAdjustPage1Issue" # --- 8.0 ARCHIVING ---------------------------------------------------- const ARCRULE="ap check long" prepage { noarchive=1 earc_archive$="EARC_CHECKAPLONG",doing_recat=0 if lower(earc_archive$)="y": noarchive=0 if not(uf.subjob): gosub process_arcProps # see the zMrgArcProps ruleset endif endif } merge "8.0 zMrg ArcProps" if uf.arcenabled ARCHIVE {earca_library$},{earca_doctype$},{earca_docid$},subid {earca_subid$},title {earca_title$},notes {earca_notes$},keywords {earca_keywords$},categories {earca_cats$},links {earca_links$},args {earca_args$},dtm {earca_dtm$},subtitle {earca_subtitle$},subdtm {earca_subdtm$},entid {earca_entid$} endif # --- ORIGINAL CODE-BLOCK SECTION --------------------------------------- prepage { # get detail totals gtot$="",dtot$="",ntot$="" for row=4 to 26 if pos("Totals:"=text$[row]) then : gtot$=mid(text$[row],39,13) dtot$=mid(text$[row],53,13) ntot$=mid(text$[row],68,13) text$[row]="" break endif next row checkdate$=get(27,51,8,1) chkno$=get(73,2,8,1) chkno$=str(cnum(chkno$):"CKMSK") } [Check a/p short stub] # applies to form format #1 & #3? # # not sure if this version is even used anymore - BCJ # detects turned off for now # #detect 0,1,"Vendor:" #detect 0,1,"Check #:" # Check # # set up document constants const MAXCOLS=82 # max cols to output const MAXRCOLS=81 # MAXCOLS-1 const LEFTCOL=1 # left vertical line const RIGHTCOL=MAXCOLS # right vertical line const MAXROWS=66 # max rows to output cols MAXCOLS # max output columns rows MAXROWS # max output rows page 42 # max input rows copies 1 portrait dpi 600 # see global constant above GSON # graphical shading title "A/P Check" # view in pdf properties # make room on left and top cmove 1,1,MAXCOLS,MAXROWS,2,2 ########## top stub # top section cbox LEFTCOL,1,RIGHTCOL,3,1,ccols=6::ISHADE 34 43::ISHADE 65 72::ISHADE const BROW=2 const EROW=2 cfont 2,BROW,12,EROW,ILFONT #cfont 14,BROW,26,EROW,DBLFONT cerase 14,BROW,26,EROW text 7,BROW,{trim(get(13,1,12))+" : "+trim(get(1,55,MAXCOLS))},DBLFONT,fit,cols=27 cfont 28,BROW,42,EROW,IRFONT cfont 44,BROW,63,EROW,DBLFONT #cfont 61,BROW,72,EROW,ILFONT cerase 64,BROW,72,EROW text 64,{BROW-.5},"Check #\nCheck Date",IRFONT,cols=8 #cfont 74,BROW,MAXRCOLS,EROW,DBLFONT cerase 74,BROW,MAXRCOLS,EROW text 73,{BROW-.5},{chkno$+"\n"+chk_date$},DBLFONT cbox LEFTCOL,3,RIGHTCOL,18,1,crows=5::ISHADE,ccols=10 13 29 40 52 67 cerase 1,5,MAXCOLS,5 const BROW=4 const EROW=4 cfont 2,BROW,9,EROW,ICFONT cfont 11,BROW,12,EROW,ICFONT cfont 14,BROW,28,EROW,ILFONT cfont 30,BROW,39,EROW,ILFONT cfont 41,BROW,51,EROW,IRFONT cfont 53,BROW,66,EROW,IRFONT cfont 68,BROW,MAXRCOLS,EROW,IRFONT const BROW=6 const EROW=17 cfont 2,BROW,9,EROW,DBCFONT cfont 11,BROW,12,EROW,DCFONT cfont 14,BROW,28,EROW,DBLFONT cfont 30,BROW,39,EROW,DLFONT cfont 41,BROW,51,EROW,DBRFONT cfont 53,BROW,66,EROW,DBRFONT cfont 68,BROW,MAXRCOLS,EROW,DBRFONT # remittance advice text 14,6,{advice$},IFONT # clear -- line above totals erase "Totals:@17,BROW,24,EROW",0,-1,MAXCOLS,1 cbox 29,18,RIGHTCOL,20,1,ccols=40::ISHADE 52 67 text 2,19,"Payor Stub",DBFONT const BROW=19 const EROW=19 cfont 1,BROW,39,EROW,DRFONT cfont 41,BROW,51,EROW,DBRFONT cfont 53,BROW,66,EROW,DBRFONT cfont 68,BROW,MAXRCOLS,EROW,DBRFONT ########### middle stub # top section cbox LEFTCOL,23,RIGHTCOL,25,1,ccols=6::ISHADE 34 43::ISHADE 65 72::ISHADE const BROW=24 const EROW=24 cfont 2,BROW,12,EROW,ILFONT #cfont 14,BROW,26,EROW,DBLFONT cerase 14,BROW,26,EROW text 7,BROW,{trim(get(13,1,12))+" : "+trim(get(1,55,MAXCOLS))},DBLFONT,fit,cols=26 cfont 28,BROW,42,EROW,IRFONT cfont 44,BROW,63,EROW,DBLFONT #cfont 61,BROW,72,EROW,ILFONT cerase 64,BROW,72,EROW text 64,{BROW-.5},"Check #\nCheck Date",IRFONT,cols=8 #cfont 74,BROW,MAXRCOLS,EROW,DBLFONT cerase 74,BROW,MAXRCOLS,EROW text 73,{BROW-.5},{chkno$+"\n"+chk_date$},DBLFONT cbox LEFTCOL,25,RIGHTCOL,40,1,crows=27::ISHADE,ccols=10 13 29 40 52 67 cerase 1,27,MAXCOLS,27 const BROW=26 const EROW=26 cfont 2,BROW,9,EROW,ICFONT cfont 11,BROW,12,EROW,ICFONT cfont 14,BROW,28,EROW,ILFONT cfont 30,BROW,39,EROW,ILFONT cfont 41,BROW,51,EROW,IRFONT cfont 53,BROW,66,EROW,IRFONT cfont 68,BROW,MAXRCOLS,EROW,IRFONT const BROW=28 const EROW=39 cfont 2,BROW,9,EROW,DBCFONT cfont 11,BROW,12,EROW,DCFONT cfont 14,BROW,28,EROW,DBLFONT cfont 30,BROW,39,EROW,DLFONT cfont 41,BROW,51,EROW,DBRFONT cfont 53,BROW,66,EROW,DBRFONT cfont 68,BROW,MAXRCOLS,EROW,DBRFONT # remittance advice text 14,28,{advice$},IFONT # clear -- line above totals erase "Totals:@17,BROW,24,EROW",0,-1,MAXCOLS,1 cbox 29,40,RIGHTCOL,42,1,ccols=40::ISHADE 52 67 cerase 1,40,RIGHTCOL,40 text 2,41,"Payee Stub",DBFONT const BROW=41 const EROW=41 cfont 1,BROW,39,EROW,DRFONT cfont 41,BROW,51,EROW,DBRFONT cfont 53,BROW,66,EROW,DBRFONT cfont 68,BROW,MAXRCOLS,EROW,DBRFONT ########### check cerase 1,47,MAXCOLS,MAXROWS AP_CBOX LEFTCOL,47,RIGHTCOL,64.5,MBOXSIZE AP_IMGE 1,47,10,5,"COMP_LOGO" AP_CNME 15,48.25,"COMPCK_NAME",HBFONT,14 AP_CNME 15,49.35,"COMPCK_ADDR1",HFONT,12 AP_CNME 15,50.35,"COMPCK_ADDR2",HFONT,12 AP_CNME 15,51.35,"COMPCK_ADDR3",HFONT,12 AP_BNME 49,48.25,"AP_BANK_NAME",DBFONT AP_BNME 49,49.05,"AP_BANK_ADDR1",DFONT AP_BNME 49,49.85,"AP_BANK_ADDR2",DFONT AP_BRTR 70,49.35,"AP_ROUTING",DBFONT # rtg # AP_RBBX 48,50.5,81,52.5,1,crows=51.5::100,ccols=57 69 cerase 1,51,MAXCOLS,51 AP_RBTX 49,51,"Check #",ICFONT,shade 0,cols=8 text 49,52,{chkno$},DBCFONT,cols=7 AP_RBTX 58,51,"Date",ICFONT,shade 0,cols=11 text 58,52,{chk_date$},DBCFONT,cols=11 AP_RBTX 70,51,"Amount",IRFONT,shade 0,cols=11 text 70,52,{chk_amt$},DBRFONT,cols=11 AP_PYTX 2,56,"Pay",IFONT,14 text 6.5,56,{chk_amt_words$},IBFONT,10,fit,cols=70 AP_PYTX 2,60,"Pay\nto the\nOrder\nof",IFONT text 6.5,60,{vend$},DBFONT AP_SNTX 50,59.50,"Check Void After 180 Days",ICFONT,cols=30 SIGNATURE_IMAGE 50,61,0,0,"SIGNATURE" AP_SNBX 50,62.0,30,1,3 AP_SNTX 50,62.75,"Authorized Signature",ICFONT,cols=30 AP_MICR 15,65.50,"AP_MICR_ACCOUNTNO",{chkno$} # # the below 2 lines is to correct possible page 1 extra row 1 # for printer device designation # local RULESET="APCHK" merge "zMrgAdjustPage1Issue" # --- 8.0 ARCHIVING ---------------------------------------------------- const ARCRULE="ap check short" prepage { noarchive=1 earc_archive$="EARC_CHECKAPSHORT",doing_recat=0 if lower(earc_archive$)="y": noarchive=0 if not(uf.subjob): gosub process_arcProps # see the zMrgArcProps ruleset endif endif } merge "8.0 zMrg ArcProps" if uf.arcenabled ARCHIVE {earca_library$},{earca_doctype$},{earca_docid$},subid {earca_subid$},title {earca_title$},notes {earca_notes$},keywords {earca_keywords$},categories {earca_cats$},links {earca_links$},args {earca_args$},dtm {earca_dtm$},subtitle {earca_subtitle$},subdtm {earca_subdtm$},entid {earca_entid$} endif # --- ORIGINAL CODE-BLOCK SECTION --------------------------------------- prepage { chkno$=trim(get(72,1,9)) chkno$=str(cnum(chkno$):"CKMSK") chk_amt_words$=trim(get(1,30,80)) chk_amt$=trim(get(59,28,20)) chk_date$=trim(get(27,28,8)) vend$=mget(11,33,40,4,"Y","Y") # find stub total row totrow=0 for row=1 to 22 if pos("Totals:"=text$[row])=0 then continue totrow=row x$=set(1,row-1,MAXCOLS,"") # remove dashes break next row # if total row, move to bottom of stub if totrow then : text$[18]=text$[totrow] text$[totrow]="" endif # look for remittance advice if trim(text$[3])="Remittance Advice Enclosed" then : x$="text 14,6,"+$22$+"Remittance Advice Enclosed"+$22$+",IBFONT" exec(x$) x$="text 14,29,"+$22$+"Remittance Advice Enclosed"+$22$+",IBFONT" exec(x$) text$[3]="" endif # 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 # copy stub from top to middle for i=1 to 22 text$[i+22]=text$[i] next i # remittance advice enclosed advice$=get(15,3,30,1) if left(advice$,5)<>"Remit" then : advice$="" else x$=set(15,3,30,"") x$=set(15,25,30,"") endif } [Check a/p overflow] # applies to form format #1 & #3? detect 20,1-2,"~APCHKREM *$" # set up document constants local MAXCOLS=82 # max cols to output local MAXRCOLS=81 # MAXCOLS-1 local LEFTCOL=1 # left vertical line local RIGHTCOL=MAXCOLS # right vertical line local MAXROWS=66 # max rows to output cols MAXCOLS # max output columns rows MAXROWS # max output rows page MAXROWS # max input rows copies 1 portrait dpi 600 # see global constant above GSON # graphical shading title "A/P Check" # view in pdf properties # # the below 2 lines is to correct possible page 1 extra row 1 # for printer device designation # local RULESET="APCHKREM" merge "zMrgAdjustPage1Issue" prepage { # get detail totals gtot$="",dtot$="",ntot$="",thdr$="" for row=6 to 60 if pos("Totals:"=text$[row]) then : thdr$="Totals" gtot$=mid(text$[row],39,13) dtot$=mid(text$[row],53,13) ntot$=mid(text$[row],68,13) text$[row]="" x$="cbox 29,63.5,RIGHTCOL,64.5,1,ccols=39::100 53 67" exec(x$) break endif next row chkno$=get(73,2,8,1) chkno$=str(cnum(chkno$):"CKMSK") } # shift for better placement cmove 1,1,MAXCOLS,MAXROWS,2,5 cmove 1,45,MAXCOLS,MAXROWS,1,44 hline "---",erase # top section cerase 2,1,RIGHTCOL,8 cbox 45,1.5,RIGHTCOL,3.5,1,crows=2.5::ISHADE,ccols=58 67 LOGO_IMAGE 1,1,10,5,"COMP_LOGO" text 13,2,"COMPCK_NAME",HBFONT,14 text 13,2.9,"COMPCK_ADDR1",HFONT,12 text 13,3.9,"COMPCK_ADDR2",HFONT,12 text 13,4.9,"COMPCK_ADDR3",HFONT,12 text 46,2,"Vendor #",ICFONT,cols=12 text 59,2,"Check #",ICFONT,cols=8 text 68,2,"Our Customer #",ICFONT,cols=14 text 46,3,{get(13,2,12,1)},DBCFONT,cols=12 text 59,3,{chkno$},DBCFONT,cols=8 text 68,3,{get(43,2,20,1)},DBCFONT,cols=14 # detail cbox LEFTCOL,7.5,RIGHTCOL,63.5,1,crows=9::DSHADE,ccols=10 13 29 39 53 67 text 2,8.25,"Date",ICFONT,cols=8 text 11,8.25,"Tp",ICFONT,cols=2 text 14,8.25,"Invoice No.",IFONT,cols=15 text 30,8.25,"Reference",IFONT,cols=9 text 40,8.25,"Gross",IRFONT,cols=13 text 54,8.25,"Discount",IRFONT,cols=13 text 68,8.25,"Net",IRFONT,cols=14 cfont 2,9,9,63,DBCFONT # inv dt cfont 11,9,12,63,DBCFONT,black # inv ty cfont 14,9,29,63,DBFONT # inv num cfont 30,9,39,63,DBFONT,black # ref cfont 40,9,52,63,DBRFONT # gross cfont 54,9,66,63,DBRFONT,black # disc cfont 69,9,MAXRCOLS,63,DBRFONT # net # footer text 30,64,{thdr$},IBFONT,shade 0 text 40,64,{gtot$},DBRFONT,cols=13 # inv amt text 54,64,{dtot$},DBRFONT,cols=13 # discount text 68,64,{ntot$},DBRFONT,cols=14 # paid amt # --- 8.0 ARCHIVING ---------------------------------------------------- # 8.0 Archiving BEGIN # Remark this section to disable archiving for this report or form const ARCRULE="ap check overflow" prepage { noarchive=1 earc_archive$="EARC_CHECKAPOVERFLOW",doing_recat=0 if lower(earc_archive$)="y": noarchive=0 if not(uf.subjob): # see the zMrgArcProps ruleset gosub process_arcProps endif endif } merge "8.0 zMrg ArcProps" # merge "zMrg2ArcProp2" # placeholder for alternate rule-set if uf.arcenabled ARCHIVE {earca_library$},{earca_doctype$},{earca_docid$},subid {earca_subid$},title {earca_title$},notes {earca_notes$},keywords {earca_keywords$},categories {earca_cats$},links {earca_links$},args {earca_args$},dtm {earca_dtm$},subtitle {earca_subtitle$},subdtm {earca_subdtm$},entid {earca_entid$} endif # 8.0 Archiving END [BalanceSheet] # # Warning: This rule set is based upon sample report # layout and demo data. # # Any changes to the sample report layout will force # changes to the below rule set # detect 0,3,"^Balance Sheet" # set up document constants local MAXCOLS=80 # max cols to output local MAXRCOLS=79 # MAXCOLS-1 local LEFTCOL=1 # left vertical line local RIGHTCOL=MAXCOLS # right vertical line local MAXROWS=66 # max rows to output cols MAXCOLS # max output columns rows MAXROWS # max output rows page MAXROWS local MAX_COPIES=1 copies MAX_COPIES portrait #landscape dpi 600 gs on title "G/L Balance Sheet" # view in pdf properties # margin left,right,top,bottom margin 150,0,0,0 # enhancements as needed # no detail box for this rpt # no detail hdrs for this rpt # detail data cfont 2,8,12,MAXROWS,DBFONT,10 cfont 14,8,39,MAXROWS,DFONT cfont 41,8,54,MAXROWS,DBRFONT,10 cfont 55,8,55,MAXROWS,DBLFONT,10,black cfont 57,8,73,MAXROWS,DBRFONT,10 cfont 74,8,74,MAXROWS,DBLFONT,10,black # handle special lines font "~ [A-Z]@1,8,6,MAXROWS",0,0,30,1,DBFONT,11 # handle totals hline "----",erase hline "====",erase font "----@40,8,45,MAXROWS",-27,1,31,1,DBLFONT,10 shade "----@40,8,45,65",-39.5,1,MAXRCOLS,1.01,DSHADE font "----@58,8,63,MAXROWS",-45,1,31,1,DBLFONT,11 shade "----@58,8,63,65",-57.5,1,MAXRCOLS,1.01,ISHADE font "====@58,8,63,MAXROWS",-45,-1,31,1,DBLFONT,12 shade "====@58,8,63,65",-57.5,-1,MAXRCOLS,1.01,HSHADE # --- 8.0 ARCHIVING ---------------------------------------------------- const ARCRULE="balance sheet" prepage { noarchive=1 earc_archive$="EARC_BALSHEET",doing_recat=0 if lower(earc_archive$)="y": noarchive=0 if not(uf.subjob): gosub process_arcProps # see the zMrgArcProps ruleset endif endif } merge "8.0 zMrg ArcProps" if uf.arcenabled ARCHIVE {earca_library$},{earca_doctype$},{earca_docid$},subid {earca_subid$},title {earca_title$},notes {earca_notes$},keywords {earca_keywords$},categories {earca_cats$},links {earca_links$},args {earca_args$},dtm {earca_dtm$},subtitle {earca_subtitle$},subdtm {earca_subdtm$},entid {earca_entid$} endif # --- ORIGINAL CODE-BLOCK SECTION --------------------------------------- ### local start for zMrgDispCpyTitle local DCTROW=MAXROWS+.5 # row to display title local DCTCOL=0 # force start col of msg local DCTFONT="univers,8,center" # use global or ??? prejob { dim copy_title$[MAX_COPIES] copy_title$[1]="Accounting Copy" } merge "zMrgDispCpyTitle" # Page X of Y feature # change XOFYS_COPIES to "0" to turn off local XOFYS_COPIES="ALL" # or copy #'s to display local XOFYS_DROW =MAXROWS+.75 # row to display title merge "zMrgSinglePageXofY" ### local start for zMrgReportHdr local RPTHDR_ROWS=5 # max # of hdr rows local RPTC1FONT="RPTC1FONT,14" # global or ??? local RPTC3FONT="RPTC3FONT,12" # global or ??? # move text, upto 5 rows JUSTROW TO ??? "JUSTROW" # setup all hdrs to be moved # below are some samples local RPTC3TO="C3" local RPTC4TO="C1" merge "zMrgReportHdr" # --- ORIGINAL CODE-BLOCK SECTION --------------------------------------- # codeblocks as needed prepage { # strange row alignment under hdr blnkrows=0 if trim(text$[6])="" then : blnkrows++ endif if trim(text$[7])="" then : blnkrows++ endif if blnkrows<2 then : exec("cmove 1,6,MAXCOLS,MAXROWS,1,8") endif } [IncomeStmtSimple] # # Warning: This rule set is based upon sample report # layout and demo data. # # Any changes to the sample report layout will force # changes to the below rule set # # this simple example has 2 columns: MTD & YTD # detect 0,3,"^Income Statement" detect 0,6,"^MTD YTD" # set up document constants local MAXCOLS=80 # max cols to output local MAXRCOLS=79 # MAXCOLS-1 local LEFTCOL=1 # left vertical line local RIGHTCOL=MAXCOLS # right vertical line local MAXROWS=66 # max rows to output cols MAXCOLS # max output columns rows MAXROWS # max output rows page 66 local MAX_COPIES=1 copies MAX_COPIES portrait #landscape dpi 600 gs on title "G/L Income Statement" # view in pdf properties # margin left,right,top,bottom margin 150,0,0,0 # enhancements as needed # no detail box for this rpt # detail hdrs cfont 13,8,38,8,ILFONT,proper cfont 40,8,54,8,IRFONT,proper cfont 58,8,72,8,IRFONT,proper # detail data cfont 2,9,11,MAXROWS,DBLFONT cfont 13,9,38,MAXROWS,DFONT cerase 40,9,40,MAXROWS # $ cfont 41,9,54,MAXROWS,DBRFONT,black cfont 55,9,55,MAXROWS,DBLFONT # neg cerase 58,9,58,MAXROWS # $ cfont 59,9,72,MAXROWS,DBRFONT,black cfont 73,9,73,MAXROWS,DBLFONT # neg # handle special lines font " **@2,9,5,MAXROWS",0,0,30,1,DBLFONT # handle totals hline "----",erase hline "====",erase font "----@40,9,44,MAXROWS",-25,1,20,1,DBLFONT,10,proper shade "----@40,9,44,MAXROWS",-39.5,1,MAXRCOLS,.99,DSHADE font "NET SALES@15,9,27,MAXROWS",0,0,20,DBLFONT,10,proper shade "NET SALES@15,9,27,MAXROWS",-14.5,0,MAXRCOLS,.99,ISHADE font "GROSS MARGIN@15,9,27,MAXROWS",0,0,20,DBLFONT,10,proper shade "GROSS MARGIN@15,9,27,MAXROWS",-14.5,0,MAXRCOLS,.99,ISHADE font "NET INCOME@15,9,27,MAXROWS",0,0,20,DBLFONT,10,proper shade "NET INCOME@15,9,27,MAXROWS",-14.5,0,MAXRCOLS,.99,HSHADE # --- ORIGINAL CODE-BLOCK SECTION --------------------------------------- # codeblocks as needed prepage { # find hdr bottom, "Balances as of" for row=1 to 10 if pos("Balances as of "=text$[row]) then : hdrbtm=row break endif next row } # --- 8.0 ARCHIVING ---------------------------------------------------- const ARCRULE="income statement simple" prepage { noarchive=1 earc_archive$="EARC_INCOMESIMPLE",doing_recat=0 if lower(earc_archive$)="y": noarchive=0 if not(uf.subjob): gosub process_arcProps # see the zMrgArcProps ruleset endif endif } merge "8.0 zMrg ArcProps" if uf.arcenabled ARCHIVE {earca_library$},{earca_doctype$},{earca_docid$},subid {earca_subid$},title {earca_title$},notes {earca_notes$},keywords {earca_keywords$},categories {earca_cats$},links {earca_links$},args {earca_args$},dtm {earca_dtm$},subtitle {earca_subtitle$},subdtm {earca_subdtm$},entid {earca_entid$} endif # --- ORIGINAL CODE-BLOCK SECTION --------------------------------------- ### local start for zMrgDispCpyTitle local DCTROW=MAXROWS+.5 # row to display title local DCTCOL=0 # force start col of msg local DCTFONT="univers,8,center" # use global or ??? prejob { dim copy_title$[MAX_COPIES] copy_title$[1]="Accounting Copy" # copy_title$[2]="Office Copy" } merge "zMrgDispCpyTitle" # Page X of Y feature # change XOFYS_COPIES to "0" to turn off local XOFYS_COPIES="ALL" # or copy #'s to display local XOFYS_DROW =MAXROWS+.75 # row to display title merge "zMrgSinglePageXofY" ### local start for zMrgReportHdr local RPTHDR_ROWS=6 # max # of hdr rows local RPTC2FONT="RPTC2FONT,14" # global or ??? local RPTC3FONT="RPTC3FONT,11" # global or ??? local RPTC3TO="C2" local RPTC4TO="C6" local RPTC2TO="C4" merge "zMrgReportHdr" prepage { if hdrbtm"" then : col1free=0 # increment rows for empty col on left and right cols=cols+2 break endif next row # row 1 free? row1free=1 if trim(text$[1])<>"" then : row1free=0 # increment rows for empty row on top and bottom rows=rows+2 endif # set cols and rows cols$=str(cols) rows$=str(rows) # shift down/right as needed cmd$="" if not(col1free) or not(row1free) then : newcol=1,newrow=1 if not(col1free) then newcol++ if not(row1free) then newrow++ # shift down 1 and/or right 1 cmd$+=$0a$+"cmove 1,1,"+str(cols)+","+str(rows)+","+\ str(newcol)+","+str(newrow) endif # load hdr rows hdr1$=text$[1];text$[1]="" hdr2$=text$[2];text$[2]="" # get hdr fields row 1 co=pos("Co:"=hdr1$) dttm$=trim(left(hdr1$,co-1)) hdr1$=trim(hdr1$(co)) coend=pos(" "=hdr1$,1,2) co$=trim(left(hdr1$,coend-1)) hdr1$=trim(hdr1$(coend)) pg=pos("Page:"=hdr1$) pg$=trim(hdr1$(pg)) hdr1$=trim(hdr1$(1,pg-1)) op=pos("Oper:"=hdr1$) op$=trim(hdr1$(op)) hdr1$=trim(hdr1$(1,op-1)) rc=pos(" "=hdr1$,-1) rc$=trim(hdr1$(rc)) hdr1$=trim(hdr1$(1,rc-1)) conm$=trim(hdr1$) hdr1$="" # get hdr fields row 2 rpt_title$=trim(hdr2$) hdr2$="" # enhance rpt hdr # draw box around rpt hdr cmd$="cbox 1,1.25,"+str(cols)+","+str(3.5)+\ ",MBOXSIZE,HSHADE" # date/time cmd$+=$0a$+"text 2,2,"+quo+dttm$+quo+",HFONT,9" # company name cmd$+=$0a$+"text 1,2,"+quo+conm$+quo+",HBCFONT,10,\ cols="+str(cols) # page cmd$+=$0a$+"text 1,2,"+quo+pg$+quo+",HRFONT,9,\ cols="+str(cols-1) # company # cmd$+=$0a$+"text 2,3,"+quo+co$+quo+",HFONT,9" # rpt title cmd$+=$0a$+"text 1,3,"+quo+rpt_title$+quo+",3,HBCFONT,10,\ cols="+str(cols) # rpt code + operator cmd$+=$0a$+"text 1,3,"+quo+rc$+" "+op$+quo+",HRFONT,9,\ cols="+str(cols-1) if cmd$<>"" then exec(cmd$) } # archiving preparation prepage { if upper(pg$)="PAGE: 1" then : # library pgmnm$=upper(left(rc$,2)) cmpno$=trim(co$(4)) rpt_lib$=upper(pgmnm$)+"_Reports_"+cmpno$ # docid - no docid means a 10-digit seq # will be used rpt_docid$="" # rpt_doctype - rpt_doctype must be 20 chars or less switch rc$ case "aprt" rpt_doctype$="APTrialBalance" break case "aprp" rpt_doctype$="APAgingReport" break case "arrp" rpt_doctype$="ARAgingReport" break case "arrt" rpt_doctype$="ARTrialBalance" break case "glrbm" rpt_doctype$="APUnmatchedReport" break case "glrbo" rpt_doctype$="UninvoicedDeposits" break case "glrbp" rpt_doctype$="UninvoicedReceipts" break case "glrbt" rpt_doctype$="InventoryInTransit" break case "icrtd" rpt_doctype$="DirectInvTrialBal" break case "icrtn" rpt_doctype$="NonStockInvTrialBal" break case "icrtt" rpt_doctype$="StockInvTrialBal" break end switch # setup for categories # load store # x$=text$[4] x=pos("Store As:"=x$) x$=trim(x$(x+9)) x=pos("Group:"=x$) x$=trim(left(x$,x-1)) # now get store # x=pos("-"=x$) if x=3 then : store$=left(x$,2) else store$="N/A" endif # adjust operator oper$=trim(op$(6)) # prepare date 1st rptdt$=dttm$(1,8) yyyy$=dte(rptdt$:"%Ys") mmm$=dte(rptdt$:momask$) dd$=dte(rptdt$:"%Dz") yyyymmmdd$=yyyy$+"|"+yyyy$+" "+mmm$+"|"+yyyy$+" "+mmm$+" "+dd$ yyyymmm$=yyyy$+"|"+yyyy$+" "+mmm$ rpt_cats$="" rpt_cats$+="Operator|"+oper$+"|"+yyyymmm$+"|"+";" rpt_cats$+="Store|"+store$+"|"+yyyymmm$+"|"+";" rpt_cats$+="by Month|"+yyyymmm$+";" rpt_cats$+="by Year|"+yyyy$+";" rpt_cats$+="by Type/Period|"+rpt_doctype$+"|"+yyyymmm$+";" rpt_cats$+="by Period/Type|"+yyyymmm$+"|"+rpt_doctype$+";" # set miscellaneous arc_dtm$=arc_yyyy$+arc_mm$+arc_dd$ arc_entityid$="" arc_keywords$="*;" arc_links$="" arc_notes$="" arc_subdtm$="" arc_subid$="" arc_subtitle$="" # set arguments arc_args$="-ce 1" endif } # --- 8.0 ARCHIVING ---------------------------------------------------- # see global EARC_REPORTS=Y or N in 8.0 zMrg Configurator rule set prepage { noarchive=1 earc_archive$="EARC_SPCLREPORTS" # y/n archive on/off flag if lower(earc_archive$)="y": noarchive=0 endif } if uf.arcenabled archive {rpt_lib$},{rpt_doctype$},{rpt_docid$},\ title {rpt_title$},cats {rpt_cats$},subid {arc_subid$},\ notes {arc_notes$},keywords {arc_keywords$},\ links {arc_links$},args {arc_args$},dtm {arc_dtm$},\ subtitle {arc_subtitle$},subdtm {arc_subdtm$},\ entid {arc_entityid$} endif # # --- 8.0 DELIVER ------------------------------------------------------ # deliver email command - no change needed, ref tags in deliver.ini deliver {eaddr$},{einvno$},args {eArg$},from {efrom$},cc {ecccc$},bcc {ebbcc$},subject {esubj$},note {ebody$},login {elogn$},password {epswd$},attach {etach$},otherhead {eohdr$},bodymime {emime$},combine {eCombine$} # deliver fax command - no change needed, ref tags in deliver.ini deliver {faddr$},{finvno$},args {fArg$},fromname {ffrom$},subject {fsubj$},note {fbody$},coverpage {fcovr$},attach {ftach$},toname {ftnam$},tocompany {ftoco$},fromcompany {ffrco$},combine {fCombine$} prepage { # form-based data locations edel$="EDEL_SPCLREPORTS" if lower(edel$)="y": eDocid$=upper(rc$)+"-"+oper$ eForm$=upper(rc$)+" Report - "+dttm$+" "+co$+" "+op$ eAddrEnt$="" endif } # ADDRESS RETRIVAL METHODS merge "EDEL_METHOD" # EMAIL defaults or overrides, remove conditional for override prepage { if lower(edel$)="y": if not(uf.subjob): if eAddr$<>"": einvno$=edocid$ # email, ref tags in deliver.ini if ecopy$="" ecopy$="1" if efrom$="" efrom$="" if esubj$="" esubj$=eForm$ if ebody$="" ebody$="" if etach$="" etach$="" if ecccc$="" ecccc$="" if ebbcc$="" ebbcc$="" if eohdr$="" eohdr$="" if elogn$="" elogn$="" if epswd$="" epswd$="" if emime$="" emime$="text/html" if pcopy$="" pcopy$="" eArg$="-ce "+ecopy$ eCombine$="no" endif endif endif } # FAX defaults or overrides, remove conditional for override prepage { if lower(edel$)="y": if not(uf.subjob): if fAddr$<>"": # fax, ref tags in deliver.ini if fcopy$="" fcopy$="1" if ffrom$="" ffrom$="" if fsubj$="" fsubj$=eForm$+" "+eDocid$ if fbody$="" fbody$="" if ftach$="" ftach$="" if fcovr$="" fcovr$="" # Fax Pkg cover page if ftnam$="" ftnam$="" if ftoco$="" ftoco$="" if ffrco$="" ffrco$="" if pcopy$="" pcopy$="" fArg$="-ce "+fcopy$ fCombine$="no" endif endif endif } # Include an unForm-generated cover page # merge "8.0 Cover Page" [Generic] # # must be last non-merge rule set in rule file # detect 0,0,"~." cols 132 rows 66 portrait copies 1 [~--- Merge Rule sets ---] #v8.0 - standard merge rule sets # suggest starting all merge rule set names in this section # with "~Mrg" for easier organization # each "~Mrg" rule set handles application-specific # enhancements that are used in multiple rule sets # suggest keeping ALL "~Mrg" merge rules sets # grouped together [8.0 README] # To view this readme section inside the design tool without # color and syntax error red-mark lines, TURN OFF syntax # highlighting by pressing the color palette on the ribbon # menu above!! UnForm 8.0 Rule-file and supporting demo files for Sxe Including these integrated features: (as of 07/30/2010) - Archiving preconfigured with standard properties - Scanning barcodes on forms - Statement with attached scanned proof of delivery copies out of archive - PDF hyperlinks to invoices in archived statement - Electronic form delivery by email or fax - Page X of Y counters on forms and reports ------ 1 ------ "sxe-v80.zip" File Extract or place the contents into the main unform server folder. Contents: - sxe-v80.rul file - sxe-demo-80.sh for Linux/Unix, build archive demo data - sxe-demo-80.vbs for Windows, build archive demo data - sxe-txt-form1/ folder containing sample text files - sxe-txt-form3/ folder containing sample text files - sxe-txt-form3-trailpage/ folder containing sample text files - sxe-txt-other/ folder containing non-form1,form3 sample text files - sxe-scan/ folder containing sample scans and the SXE_DOCS image manager job definition. - sxe-scripts/ folder containing unform launch scripts for integration with SXE if using the trailer page method where SXE outputs the email delivery info ------ 2 ------ New "utility" rulesets in the sxe-v80.rul file which support the new features: [8.0 zMrg Configurator] [8.0 zMrg ArcProps] [8.0 zMrg PDFLinks v2] [8.0 EDM6 BOOK] [8.0 EDM5 TRAILPAGE] [8.0 ED TAG PARSER] [8.0 ED TAG PARSER SXE-TRAILPAGE] [8.0 ED Selective Copy Printing] [zMrgMultiPageXofY] [zMrgSinglePageXofY] ------ 3 ------ TURNING FEATURES OFF AND ON: Top global section of the rule file has: merge "8.0 zMrg Configurator" to include the global constants that turn the new features ON/OFF by feature and ruleset. See the constants in "8.0 zMrg Configurator" for which forms are archive-enabled, deliver-enabled, or scanning barcode-enabled, and to turn them on/off. ------ 4 ------ For each SXE "enhancement" rule-set: Original code blocks were moved to the bottom of the rule-set so that timing of text movement would be performed AFTER get() functions needed for archiving and deliver properties. For NON-FORM1 or NON-FORM3 rule-sets: Where applicable, the following code sections were inserted with processing code at the BOTTOM of existing rule-sets, but BEFORE the original code block section. # --- 8.0 ARCHIVING ------------------ # --- PDF HYPERLINK FOR ARCHIVING ---- # --- 8.0 DELIVER -------------------- # --- PAGE X of Y FEATURE ------------ # --- ATTACH SCANNED IMAGES ---------- # --- SCANNING BARCODE --------------- FOR FORM1 and FORM3 (OSX and SDS) rule-sets: The above-referenced code-sections were added to a merge rule-set appearing immediately following each enhancement rule-set, WHICH IS SHARED BY THE OSX AND SDS VERSIONS OF THE RULE_SET SINCE THE ARCHIVING PROPERTY TEXT LOCATIONS WERE IDENTICAL FOR EACH. Instead of the code sections appearing at the bottom of each rule-set, a "merge" command is used to include the related "8.0 Merge" rule-set. Here's a cross-reference between the new rule-set sections and the new utility rule-sets that are merged: # --- 8.0 ARCHIVING ------------------ merge "8.0 zMrg Arcprops" # --- PDF HYPERLINK FOR ARCHIVING ---- merge "8.0 zMrg PDFLinks v2 # --- 8.0 DELIVER -------------------- merge "8.0 EDM6 BOOK" (or) merge "8.0 EDM5 TRAILPAGE" (which in turn does: merge "8.0 ED TAG PARSER") (or) merge "8.0 ED TAG PARSER SXE-TRAILPAGE" merge "8.0 Selective Copy Printing" # --- PAGE X of Y FEATURE ------------ Forms: merge "zMrgMultiPageXofY" Reports: merge "zMrgSinglePageXofY" # --- ATTACH SCANNED IMAGES ---------- (No merges) (Statement forms only) # --- SCANNING BARCODE --------------- (No merges) ------ 5 ------ ARCHIVING notes: Archiving properties for each form and report are maintained centrally in the "8.0 zMrg ArcProps" rule-set. This model is used to facilitate mass re-indexing processes. By centralizing archive properties by form or report type in a single rule-set, a mass re-indexing rule-set will be able to access property assignments for multiple doc types in the same place that the new property assignments are coded for print jobs. "8.0 zMrgArcProps" rule-set Maintenance: To change the library names created on your system: Change the following local constant to zero: local EARC_LIBCOABRSUB=1 And/or change or make null ("") this library company abgreviation prefix: local EARC_COABREVSUJ="MySxe" See the individual form "case" statements for each ruleset to modify the earca_library$ variable to change the library name from "Sales", "Accounting", etc. ------ 6 ------ DELIVER notes: 8.0 uses the new DELIVER command. Address retrieval methods can be chosen. The EDEL_METHOD constant: Choose either the address book method or the trailer page method by removing the #-sign from one of these lines in the "8.0 zMrg Configurator" rule-set: global EDEL_METHOD="8.0 EDM6 BOOK" global EDEL_METHOD="8.0 EDM5 TRAILPAGE" If you want to use a different method contact SDSI support for assistance and/or see the samples/eDeliver80.rul for more examples. Address Book Method: Addresses are retrieved from an address book named "sxe" using an address entity ID somewhere on the form, e.g. customer number, vendor number, etc. Trailer page method: Raw text forms printed have a trailer page appended with address and tag data coming out of SXE. If the address retrieved contains an @-sign an EMAIL will be submitted. If the address retrieved does NOT contain @-sign, a FAX will be initiated. You can customize tags for each form individually within each rule-set, in the routine underneath the merge for the address book. You must configure/maintain the deliver.ini file for email tag and fax settings. You must configure/maintain the prog/mailcall.ini file for email smtp server settings. More information is available on *.ini configuration in unform80.pdf. The "sxe" address book can be defined in the UnForm browser interface. You can import addresses from an appropriately mapped CSV file to populate the address book. See the "8.0 EDM6 BOOK" merged rule-set to see a hierarchy for looking up address info that demonstrates how to look up addresses with or without document types, suffixes or prefixes. The routines here are for demonstration purposes -- you can modify the address lookup logic to suit your needs, and/or contact SDSI for assistance. If you want to use a method other than the address book method, contact SDSI about tailoring one of the pre-developed merge rule-sets for other methods that are contained in the samples/eDeliver8.0.rul file. Contact SDSI for possible updates to these templates. ------ 7 ------ SCANNING BARCODE notes: See the "BCOD_" series of contants in "8.0 zMrg Configurator" to turn scanning barcodes ON or OFF by form. This line in the scanning barcode section opens up 7 rows at the bottom of the form for placement of barcodes, and causes the rest of the form to resize with a maintenance of its aspect ratio: rows$=str(MAXROWS+7) This line allows you to specify which copy of a form gets a barcode: bcod_Copies$="2" # which copy(s) get barcode To include the barcode on multiple copies, add the copy numbers to the string, e.g. bcod_Copies$="123". Note that this syntax maxes out at 9 copies, so the pos() function would need to be modified if copy numbers above 9 need to be referenced. The bcod_docty$ variable places an abbreviated doctype code on the form that is mapped to the full archive document type in the image manager job definition that automates property index assignment on scanned documents. IF YOU CHANGE A DOCUMENT TYPE IN THE ARCHIVING RULE-SET, YOU MUST CHANGE THE CORRESPONDING ENTRY IN THE SCANNING JOB DEFINITION, IF THAT DOCUMENT WILL BE SCANNED AND UPLOADED. ------ 8 ------ SCANNING JOB DEFINITION notes: A scanning job defintion is provided called "SXE_DOCS.ufz" in the "sxe-scan" folder. Copy this file to the scanning/JobDefs folder of the image manager workstation. It has been designed to detect and process all the barcoded sxe forms using a single job, including header/attachment jobs where attachment pages receive the same indexes as the header page. Demo scanned images are provided for importing, both regular scans with no attachment pages, as well as ones with attachment pages. ------ 9 ------ DEMO BUILD SCRIPT notes: **CAUTION** THESE SCRIPTS ARE DESTRUCTIVE TO PREVIOUSLY ARCHIVED DOCUMENTS. PLEASE READ THIS CAREFULLY BEFORE USING THEM. - sxe-demo-80.sh for Linux/Unix - sxe-demo-80.vbs for Windows Execute the appropriate script from the server folder where the zip file was extracted. It builds demo archives from the text samples contained in the "sxe-txt-*" folders. Note that the scripts have some settings at the top of each file for specifying what form types you want to build for forms and checks. WHEN LAUNCHED, THE SCRIPTS START BY REMOVING THE SAMPLE LIBRARIES, SO DO NOT RUN THESE SCRIPTS ON A LIVE SYSTEM THAT USES THE SAME LIBRARY NAMES AS THE DEMO!! See the Archive notes for how to change the library names for the live system. Or modify the library name prefix at the top of the scripts to reference a non-live set of libraries. The build scripts will also create PDF's of the documents in the respective text file folders. If deliver feature is enabled and address book entries exist for document recipient entities then emails or faxes will be attempted, assuming proper configuration of deliver.ini and mailcall.ini. ------ 10 ------ ATTACH SCANNED IMAGE notes: The AR statement rule-sets contain a routine to retrieve scanned copies of invoices from the archive and attach them to the statement. There is a global to turn this feature ON or OFF in the constants merged rule-sets. By default, for each invoice listed on a statement, the routine looks for document images based on the following variables: dotypes$="Scan" - the image sub-id begins with the word "Scan" - change this in the ruleset if you change the sub-id in the scanning job definition tktlib$="MySxe_Sales" - change this in the ruleset to match your ssytem tktdocty$="Invoice" - change this in the ruleset if you change the doc type for archived invoices Imagemagick and/or Ghostscript must be available for this feature to work. By default images are tiled 2 across, 2 down in portrait orientation, as seen in the below command: images {images$},across 2, down 2 Remove the across and down arguments to attach full page images. [8.0 zMrg Configurator] # v7.x Archive date category compatibility? N=No; 7.1 used alpha month names which caused months to display ut of chronological order, Set Y to use alpha month names global EARCA_71=N # Attach scanned invoice proof of delv to statement copy 1 global STM_ATTCH_SCAN=N # Archiving ON=Y OFF=N for rule-sets # turn off for specific rule-set(s) by setting # the form constant(s) below to N global EARC_BALSHEET=N global EARC_BILLOFLADING=N global EARC_CHECKAPLONG=N global EARC_CHECKAPSHORT=N global EARC_CHECKAPOVERFLOW=N global EARC_INCOMESIMPLE=N global EARC_INCOMECOMPLEX=N global EARC_INVOICE=N global EARC_ORDACKQUO=N global EARC_PICKTICKET=N global EARC_PURCHASEORDER=N global EARC_SERVICEREPAIR=N global EARC_SPCLREPORTS=Y global EARC_STATEMENT=N global EARC_WHTRANSFER=N # Barcode for Scanning Copy: ON=Y OFF=N for rule-sets # use of 'text' in barcode commands requires # UnForm Windows Support Server global BCOD_BILLOFLADING=Y global BCOD_INVOICE=Y global BCOD_ORDACKQUO=Y global BCOD_PICKTICKET=Y global BCOD_PURCHASEORDER=Y global BCOD_SERVICEREPAIR=Y global BCOD_WHTRANSFER=Y #global EDEL_METHOD="8.0 EDM6 BOOK" global EDEL_METHOD="8.0 EDM5 TRAILPAGE v2" # Delivery(Email/Fax/Selective Copy Print) # ON=Y OFF=N for rule-sets global EDEL_BILLOFLADING=N global EDEL_INVOICE=N global EDEL_ORDACKQUO=N global EDEL_PICKTICKET=N global EDEL_PURCHASEORDER=N global EDEL_SPCLREPORTS=Y global EDEL_SERVICEREPAIR=N global EDEL_STATEMENT=N global EDEL_WHTRANSFER=N # Note, below rule-sets do not have deliver logic embedded # global EDEL_BALSHEET=N # global EDEL_CHECKAPLONG=N # global EDEL_CHECKAPSHORT=N # global EDEL_CHECKAPOVERFLOW=N # global EDEL_INCOMESIMPLE=N # global EDEL_INCOMECOMPLEX=N # Barcode symbology selection # 400=Code 3 of 9, supported by virtually all devices. # Note it only supports digits, upper-case letters # spaces, and these characters: - . $ / + %. # 605=Code 128 Series B, which offers support for # a wide range of printable characters. Most barcode # reading devices, including UnForm Image Manager # software, support this symbology. # We default to 605 due to its flexible character support. const BCSYMB=605 [8.0 zMrg ArcProps] # mje 072110 from SDS version # version 8.0 # placing archiving-related property assignments together in a # merged rule-set like this is designed to make the RE-GENERATION # of properties # establish text-based docdate format for date conversion # into segments adjust this format to fit your document local EARCA_DATEFMT="MM/DD/YY" # Turn flag off (=0) to bypass prefixing the "Company Abbreviation" to the library names # mje 061611, note the usage of this was moved out of case clauses and to the # bottom of the rule-set local EARC_LIBCOABRSUB=1 local EARC_COABREVSUJ="MySxe" # mje 061511, if not null, MUST contain the trailing slash! # To use the default path make the assignment "", # Do not remark out the local without making sure it is # assigned on a different line, or else the path constant will be taken as a literal #local EARC_LIBPATH="/tmp/myarcpath/" local EARC_LIBPATH="" prejob { day_format "EARCA_DATEFMT" earca_momask$="%Mz(%Ms)" earca_dtsep$="-" # v 7.x category compatibility earca_71$="EARCA_71" if lower(earca_71$)="y": earca_momask$="%Ms" earca_dtsep$=" " endif # defs for date categories def fnearca_yyyy$(q$)=dte(q$:"%Ys") def fnearca_mmm$(q$)=earca_dtsep$+dte(q$:earca_momask$) def fnearca_dd$(q$)=earca_dtsep$+dte(q$:"%Dz") def fnearca_yyyymmmdd$(q$)=fnearca_yyyy$(q$)+"|"+fnearca_yyyy$(q$)+fnearca_mmm$(q$)+"|"+fnearca_yyyy$(q$)+fnearca_mmm$(q$)+fnearca_dd$(q$) def fnearca_yyyymmm$(q$)=fnearca_yyyy$(q$)+"|"+fnearca_yyyy$(q$)+fnearca_mmm$(q$) } # AR statement pdf hot link library and docty global EARC_STMLINKLIB="MySxe_Sales" global EARC_STMLINKDOCTY="Invoice" postjob { # bypass during postjob; code is for gosub purposes goto skipcode1 process_arcprops: # note recat needs all variables, but currently will only update the categories if not(doing_recat): arcrule$="ARCRULE" endif # do this logic only in the main job only if not(uf.arcjob): switch arcrule$ case "service repair" day_format "MM/DD/YY" earca_library$="Sales" earca_doctype$="Service Repair" earca_docid$=get(19,3,20,1) earca_subid$="" earca_docdate$=get(69,5,8,1) if earca_docdate$="" then earca_docdate$=get(69,6,8,1) if earca_docdate$="" then earca_docdate$=dte(0:"%Mz/%Dz/%Yz") earca_custid$=get(20,9,10,1) earca_custname$=get(20,10,30,1) earca_title$=earca_custid$+": "+earca_custname$+" RO "+earca_docid$ earca_yyyy$=dte(earca_docdate$:"%Ys") earca_mmm$=dte(earca_docdate$:earca_momask$) earca_dd$=dte(earca_docdate$:"%Dz") earca_yyyymmmdd$=earca_yyyy$+"|"+earca_yyyy$+" "+earca_mmm$+"|"+earca_yyyy$+" "+earca_mmm$+" "+earca_dd$ earca_yyyymmm$=earca_yyyy$+"|"+earca_yyyy$+" "+earca_mmm$ earca_cats$="Customer|Id|"+earca_custid$+": "+earca_custname$+"|"+earca_yyyymmm$+";" earca_cats$+="Customer|Name|"+earca_custname$+"|"+earca_yyyymmm$+";" # see add'l date categories at bottom of rule-set earca_xty$="Forms" earca_links$="" earca_args$="-ce 1" earca_mm$=dte(earca_docdate$:"%Mz") earca_dtm$=earca_yyyy$+earca_mm$+earca_dd$ earca_subtitle$="" earca_subdtm$="" earca_notes$="" earca_keywords$="*;" earca_entid$=earca_custid$ break case "ap check long" day_format "MM/DD/YY" earca_library$="Accounting" earca_doctype$="A/P Check" earca_docid$=str(num(get(73,2,8,1)):fill(8,"0")) earca_subid$="" earca_docdate$=get(27,51,8,1) earca_vendid$=get(13,2,12,1) earca_vendname$=get(11,56,36,1) earca_title$="Vendor Id: "+earca_vendid$+" : "+earca_vendname$ earca_yyyy$=dte(earca_docdate$:"%Ys") earca_mmm$=dte(earca_docdate$:earca_momask$) earca_dd$=dte(earca_docdate$:"%Dz") earca_yyyymmmdd$=earca_yyyy$+"|"+earca_yyyy$+" "+earca_mmm$+"|"+earca_yyyy$+" "+earca_mmm$+" "+earca_dd$ earca_yyyymmm$=earca_yyyy$+"|"+earca_yyyy$+" "+earca_mmm$ earca_cats$="Vendor|Id|"+earca_vendid$+": "+earca_vendname$+"|"+earca_yyyymmm$+";" earca_cats$+="Vendor|Name|"+earca_vendname$+"|"+earca_yyyymmm$+";" # see add'l date categories at bottom of rule-set earca_xty$="Forms" earca_links$="" earca_args$="-ce 1" earca_mm$=dte(earca_docdate$:"%Mz") earca_dtm$=earca_yyyy$+earca_mm$+earca_dd$ earca_subtitle$="" earca_subdtm$="" earca_notes$="" earca_keywords$="*;" earca_entid$=earca_vendid$ break case "ap check overflow" day_format "MM/DD/YY" earca_library$="Accounting" earca_doctype$="A/P Check Overflow" earca_docid$=str(num(get(73,2,8,1)):fill(8,"0")) earca_subid$="" earca_docdate$=dte(0:"%Mz/%Dz/%Yz") earca_vendid$=get(13,2,12,1) earca_title$="Vendor Id: "+earca_vendid$+" - Check # "+earca_docid$ earca_yyyy$=dte(earca_docdate$:"%Ys") earca_mmm$=dte(earca_docdate$:earca_momask$) earca_dd$=dte(earca_docdate$:"%Dz") earca_yyyymmmdd$=earca_yyyy$+"|"+earca_yyyy$+" "+earca_mmm$+"|"+earca_yyyy$+" "+earca_mmm$+" "+earca_dd$ earca_yyyymmm$=earca_yyyy$+"|"+earca_yyyy$+" "+earca_mmm$ earca_cats$="Vendor|Id|"+earca_vendid$+": "+earca_vendname$+"|"+earca_yyyymmm$+";" # see add'l date categories at bottom of rule-set earca_xty$="Forms" earca_notes$="" earca_keywords$="*;" earca_links$="" earca_args$="-ce 1" earca_dtm$="" earca_subtitle$="" earca_subdtm$="" earca_entid$=earca_vendid$ break case "ap check short" day_format "MM/DD/YY" earca_library$="Accounting" earca_doctype$="A/P Check" earca_docid$=str(num(get(72,1,12,1)):fill(8,"0")) earca_subid$="" earca_docdate$=get(27,28,8,1) earca_vendid$=get(13,1,12,1) earca_vendname$=get(11,33,35,1) earca_title$=earca_vendid$+": "+earca_vendname$ earca_yyyy$=dte(earca_docdate$:"%Ys") earca_mmm$=dte(earca_docdate$:earca_momask$) earca_dd$=dte(earca_docdate$:"%Dz") earca_yyyymmmdd$=earca_yyyy$+"|"+earca_yyyy$+" "+earca_mmm$+"|"+earca_yyyy$+" "+earca_mmm$+" "+earca_dd$ earca_yyyymmm$=earca_yyyy$+"|"+earca_yyyy$+" "+earca_mmm$ earca_cats$="Vendor|Id|"+earca_vendid$+": "+earca_vendname$+"|"+earca_yyyymmm$+";" earca_cats$+="Vendor|Name|"+earca_vendname$+"|"+earca_yyyymmm$+";" # see add'l date categories at bottom of rule-set earca_xty$="Forms" earca_links$="" earca_args$="-ce 1" earca_mm$=dte(earca_docdate$:"%Mz") earca_dtm$=earca_yyyy$+earca_mm$+earca_dd$ earca_subtitle$="" earca_subdtm$="" earca_notes$="" earca_keywords$="*;" earca_entid$=earca_vendid$ break case "bill of lading" day_format "MM/DD/YY" earca_library$="Sales" earca_doctype$="Bill of Lading" earca_docid$=get(121,3,12,1) earca_subid$="" earca_docdate$=get(108,3,8,1) if earca_docdate$="" then earca_docdate$=get(94,5,8) if earca_docdate$="" then earca_docdate$=dte(0:"%Mz/%Dz/%Yz") earca_custid$=get(12,4,12,1) earca_custname$=get(15,6,30,1) earca_custpo$="PO "+get(104,5,22,1) if trim(earca_custpo$)="PO" then earca_custpo$="PO (none)" earca_title$=earca_custid$+": "+earca_custname$+" "+earca_custpo$ earca_yyyy$=dte(earca_docdate$:"%Ys") earca_mmm$=dte(earca_docdate$:earca_momask$) earca_dd$=dte(earca_docdate$:"%Dz") earca_yyyymmmdd$=earca_yyyy$+"|"+earca_yyyy$+" "+earca_mmm$+"|"+earca_yyyy$+" "+earca_mmm$+" "+earca_dd$ earca_yyyymmm$=earca_yyyy$+"|"+earca_yyyy$+" "+earca_mmm$ earca_cats$="Customer|Id|"+earca_custid$+": "+earca_custname$+"|"+earca_yyyymmm$+";" earca_cats$+="Customer|Name|"+earca_custname$+"|"+earca_yyyymmm$+";" earca_cats$+="CustPo|Id|"+earca_custid$+": "+earca_custname$+"|"+earca_custpo$+";" earca_cats$+="CustPo|Name|"+earca_custname$+"|"+earca_custpo$+";" # see add'l date categories at bottom of rule-set earca_xty$="Forms" earca_links$="" earca_args$="-ce 1" earca_mm$=dte(earca_docdate$:"%Mz") earca_dtm$=earca_yyyy$+earca_mm$+earca_dd$ earca_subtitle$="" earca_subdtm$="" earca_notes$="" earca_keywords$="*;" earca_entid$=earca_custid$ break case "invoice credit memo" day_format "MM/DD/YY" earca_library$="Sales" earca_doctype$="Invoice" earca_docid$=get(122,3,11,1) earca_subid$="" earca_docdate$=get(106,3,8,1) if earca_docdate$="" then earca_docdate$=get(1,20,8) if earca_docdate$="" then earca_docdate$=dte(0:"%Mz/%Dz/%Yz") earca_custid$=get(12,4,12,1) earca_custname$=get(12,14,30,1) earca_custpo$="PO "+get(104,5,22,1) if trim(earca_custpo$)="PO" then earca_custpo$="PO (none)" earca_title$="Customer: "+earca_custid$+": "+earca_custname$+" - "+earca_custpo$ earca_shiptoname$=get(12,7,30,1) earca_yyyy$=dte(earca_docdate$:"%Ys") earca_mmm$=dte(earca_docdate$:earca_momask$) earca_dd$=dte(earca_docdate$:"%Dz") earca_yyyymmmdd$=earca_yyyy$+"|"+earca_yyyy$+" "+earca_mmm$+"|"+earca_yyyy$+" "+earca_mmm$+" "+earca_dd$ earca_yyyymmm$=earca_yyyy$+"|"+earca_yyyy$+" "+earca_mmm$ earca_cats$="Customer|Id|"+earca_custid$+": "+earca_custname$+"|"+earca_yyyymmm$+";" earca_cats$+="Customer|Name|"+earca_custname$+"|"+earca_yyyymmm$+";" earca_cats$+="CustPo|Id|"+earca_custid$+": "+earca_custname$+"|"+earca_custpo$+";" earca_cats$+="CustPo|Name|"+earca_custname$+"|"+earca_custpo$+";" earca_cats$+="CustShipTo|Id|"+earca_custid$+": "+earca_custname$+"|"+earca_shiptoname$+"|"+earca_yyyymmm$+";" earca_cats$+="CustShipTo|Name|"+earca_custname$+"|"+earca_shiptoname$+"|"+earca_yyyymmm$+";" # see add'l date categories at bottom of rule-set earca_xty$="Forms" earca_links$="" earca_args$="-ce 1" earca_mm$=dte(earca_docdate$:"%Mz") earca_dtm$=earca_yyyy$+earca_mm$+earca_dd$ earca_subtitle$="" earca_subdtm$="" earca_notes$="" earca_keywords$="*;" earca_entid$=earca_custid$ break case "order ack quote" day_format "MM/DD/YY" earca_library$="Sales" earca_doctype$="Acknowledgement" if pos("Quote Order"=text$[2]) then earca_doctype$="Quote" earca_docid$=get(122,3,11,1) earca_subid$="" earca_docdate$=get(108,3,8,1) if earca_docdate$="" then earca_docdate$=get(94,5,8) if earca_docdate$="" then earca_docdate$=dte(0:"%Mz/%Dz/%Yz") earca_custid$=get(12,4,12,1) earca_custname$=get(12,7,30,1) earca_custpo$="PO "+get(104,5,22,1) if trim(earca_custpo$)="PO" then earca_custpo$="PO (none)" earca_title$="Customer: "+earca_custid$+": "+earca_custname$+" - "+earca_custpo$ earca_shiptoname$=get(12,13,30,1) earca_yyyy$=dte(earca_docdate$:"%Ys") earca_mmm$=dte(earca_docdate$:earca_momask$) earca_mm$=dte(earca_docdate$:"%Mz") earca_dd$=dte(earca_docdate$:"%Dz") earca_yyyymmmdd$=earca_yyyy$+"|"+earca_yyyy$+"-"+earca_mmm$+"|"+earca_yyyy$+"-"+earca_mmm$+"-"+earca_dd$ earca_yyyymmm$=earca_yyyy$+"|"+earca_yyyy$+"-"+earca_mmm$ earca_cats$="Customer|Id|"+earca_custid$+": "+earca_custname$+"|"+earca_yyyymmm$+";" earca_cats$+="Customer|Name|"+earca_custname$+"|"+earca_yyyymmm$+";" earca_cats$+="CustPo|Id|"+earca_custid$+": "+earca_custname$+"|"+earca_custpo$+";" earca_cats$+="CustPo|Name|"+earca_custname$+"|"+earca_custpo$+";" earca_cats$+="CustShipTo|Id|"+earca_custid$+": "+earca_custname$+"|"+earca_shiptoname$+"|"+earca_yyyymmm$+";" earca_cats$+="CustShipTo|Name|"+earca_custname$+"|"+earca_shiptoname$+"|"+earca_yyyymmm$+";" # see add'l date categories at bottom of rule-set earca_xty$="Forms" earca_links$="" earca_args$="-ce 1" earca_mm$=dte(earca_docdate$:"%Mz") earca_dtm$=earca_yyyy$+earca_mm$+earca_dd$ earca_subtitle$="" earca_subdtm$="" earca_notes$="" earca_keywords$="*;" earca_entid$=earca_custid$ break case "pick ticket" day_format "MM/DD/YY" earca_library$="Sales" earca_doctype$="Pick Ticket" earca_docid$=get(106,3,11,1) earca_subid$="" earca_docdate$=get(94,5,8,1) if earca_docdate$="" then earca_docdate$=get(110,16,8) if earca_docdate$="" then earca_docdate$=dte(0:"%Mz/%Dz/%Yz") earca_custid$=get(12,4,12,1) earca_custname$=get(12,7,30,1) earca_custpo$="PO "+get(104,5,22,1) if trim(earca_custpo$)="PO" then earca_custpo$="PO (none)" earca_title$="Customer: "+earca_custid$+": "+earca_custname$+" "+earca_custpo$ earca_notes$="" earca_keywords$="*;" earca_shiptoname$=get(12,13,30,1) earca_yyyy$=dte(earca_docdate$:"%Ys") earca_mmm$=dte(earca_docdate$:earca_momask$) earca_dd$=dte(earca_docdate$:"%Dz") earca_yyyymmmdd$=earca_yyyy$+"|"+earca_yyyy$+" "+earca_mmm$+"|"+earca_yyyy$+" "+earca_mmm$+" "+earca_dd$ earca_yyyymmm$=earca_yyyy$+"|"+earca_yyyy$+" "+earca_mmm$ earca_cats$="Customer|Id|"+earca_custid$+": "+earca_custname$+"|"+earca_yyyymmm$+";" earca_cats$+="Customer|Name|"+earca_custname$+"|"+earca_yyyymmm$+";" earca_cats$+="CustPo|Id|"+earca_custid$+": "+earca_custname$+"|"+earca_custpo$+";" earca_cats$+="CustPo|Name|"+earca_custname$+"|"+earca_custpo$+";" earca_cats$+="CustShipTo|Id|"+earca_custid$+": "+earca_custname$+"|"+earca_shiptoname$+"|"+earca_yyyymmm$+";" earca_cats$+="CustShipTo|Name|"+earca_custname$+"|"+earca_shiptoname$+"|"+earca_yyyymmm$+";" # see add'l date categories at bottom of rule-set earca_xty$="Forms" earca_links$="" earca_args$="-ce 1" earca_mm$=dte(earca_docdate$:"%Mz") earca_dtm$=earca_yyyy$+earca_mm$+earca_dd$ earca_subtitle$="" earca_subdtm$="" earca_entid$=earca_custid$ break case "purchase order" day_format "MM/DD/YY" earca_library$="Purchasing" earca_doctype$="Purchase Order" if get(11,1,8,1)="RETURN M" then earca_doctype$="Return" earca_docid$=get(116,2,11,1) earca_subid$="" earca_docdate$=get(105,2,8,1) if earca_docdate$="" then earca_docdate$=dte(0:"%Mz/%Dz/%Yz") earca_vendid$=get(11,3,12,1) earca_vendname$=get(11,5,30,1) earca_title$=earca_vendid$+": "+earca_vendname$ earca_soldtoname$=get(52,5,30,1) earca_invtoname$=get(96,5,30,1) earca_shiptoname$=get(11,12,30,1) earca_yyyy$=dte(earca_docdate$:"%Ys") earca_mmm$=dte(earca_docdate$:earca_momask$) earca_dd$=dte(earca_docdate$:"%Dz") earca_yyyymmmdd$=earca_yyyy$+"|"+earca_yyyy$+" "+earca_mmm$+"|"+earca_yyyy$+" "+earca_mmm$+" "+earca_dd$ earca_yyyymmm$=earca_yyyy$+"|"+earca_yyyy$+" "+earca_mmm$ earca_cats$="Vendor|Id|"+earca_vendid$+": "+earca_vendname$+"|"+earca_yyyymmm$+";" earca_cats$+="Vendor|Name|"+earca_vendname$+"|"+earca_yyyymmm$+";" earca_cats$+="VendShipTo|Id|"+earca_vendid$+": "+earca_vendname$+"|"+earca_shiptoname$+"|"+earca_yyyymmm$+";" earca_cats$+="VendShipTo|Name|"+earca_vendname$+"|"+earca_shiptoname$+"|"+earca_yyyymmm$+";" earca_cats$+="VendSoldTo|Id|"+earca_vendid$+": "+earca_vendname$+"|"+earca_shiptoname$+"|"+earca_yyyymmm$+";" earca_cats$+="VendSoldTo|Name|"+earca_vendname$+"|"+earca_shiptoname$+"|"+earca_yyyymmm$+";" earca_cats$+="VendInvoiceTo|Id|"+earca_vendid$+": "+earca_vendname$+"|"+earca_shiptoname$+"|"+earca_yyyymmm$+";" earca_cats$+="VendInvoiceTo|Name|"+earca_vendname$+"|"+earca_shiptoname$+"|"+earca_yyyymmm$+";" # see add'l date categories at bottom of rule-set earca_xty$="Forms" earca_links$="" earca_args$="-ce 1" earca_mm$=dte(earca_docdate$:"%Mz") earca_dtm$=earca_yyyy$+earca_mm$+earca_dd$ earca_subtitle$="" earca_subdtm$="" earca_notes$="" earca_keywords$="*;" earca_entid$=earca_custid$ break case "statement" day_format "MM/DD/YY" earca_library$="Accounting" earca_doctype$="Statement" earca_docdate$=get(69,7,8,1) if earca_docdate$="" then earca_docdate$=dte(0:"%Mz/%Dz/%Yz") earca_yyyy$=dte(earca_docdate$:"%Ys") earca_mmm$=dte(earca_docdate$:earca_momask$) earca_mm$=dte(earca_docdate$:"%Mz") earca_dd$=dte(earca_docdate$:"%Dz") earca_custid$=get(68,5,12,1) earca_docid$=earca_custid$+"-"+earca_yyyy$+upper(earca_mm$)+earca_dd$ earca_subid$="" earca_custname$=get(11,16,35,1) earca_title$=earca_custid$+": "+earca_custname$ earca_yyyymmmdd$=earca_yyyy$+"|"+earca_yyyy$+" "+earca_mmm$+"|"+earca_yyyy$+" "+earca_mmm$+" "+earca_dd$ earca_yyyymmm$=earca_yyyy$+"|"+earca_yyyy$+" "+earca_mmm$ earca_cats$="Customer|Id|"+pad(earca_custid$,10,"L")+": "+earca_custname$+"|"+earca_yyyy$+";" earca_cats$+="Customer|Name|"+earca_custname$+"|"+earca_yyyy$+";" # see add'l date categories at bottom of rule-set earca_xty$="Forms" earca_links$="" earca_args$="-ce 1" earca_mm$=dte(earca_docdate$:"%Mz") earca_dtm$=earca_yyyy$+earca_mm$+earca_dd$ earca_subtitle$="" earca_subdtm$="" earca_notes$="" earca_keywords$="*;" earca_entid$=earca_custid$ break case "transfer" day_format "MM/DD/YY" earca_library$="Purchasing" earca_doctype$="Transfer" earca_docid$=get(106,3,11,1) earca_subid$="" earca_docdate$=get(94,5,8,1) earca_custname$=get(12,7,30,1) earca_shiptoname$=get(12,13,30,1) if earca_custname$="" then earca_custname$=earca_shiptoname$ earca_title$=earca_custname$ earca_yyyy$=dte(earca_docdate$:"%Ys") earca_mmm$=dte(earca_docdate$:earca_momask$) earca_dd$=dte(earca_docdate$:"%Dz") earca_yyyymmmdd$=earca_yyyy$+"|"+earca_yyyy$+" "+earca_mmm$+"|"+earca_yyyy$+" "+earca_mmm$+" "+earca_dd$ earca_yyyymmm$=earca_yyyy$+"|"+earca_yyyy$+" "+earca_mmm$ earca_cats$="TransferEntity|"+earca_custname$+"|"+earca_yyyymmm$+";" earca_cats$+="TransferShipTo|"+earca_custname$+"|"+earca_shiptoname$+"|"+earca_yyyymmm$+";" # see add'l date categories at bottom of rule-set earca_xty$="Forms" earca_links$="" earca_args$="-ce 1" earca_mm$=dte(earca_docdate$:"%Mz") earca_dtm$=earca_yyyy$+earca_mm$+earca_dd$ earca_subtitle$="" earca_subdtm$="" earca_notes$="" earca_keywords$="*;" earca_entid$="" break case "balance sheet" if pagenum=1: day_format "MM/DD/YY" earca_library$="Financials" earca_doctype$="Balance Sheet" earca_subid$="" earca_title$=trim(get(1,5,80)) earca_docdate$=str(num(get(46,5,2)):"00")+"/01/"+get(49,5,2) earca_yyyy$=dte(earca_docdate$:"%Ys") earca_mmm$=dte(earca_docdate$:earca_momask$) earca_yyyymmmdd$=earca_yyyy$+"|"+earca_yyyy$+" "+earca_mmm$+"|"+earca_yyyy$+" "+earca_mmm$+" "+earca_dd$ earca_yyyymmm$=earca_yyyy$+"|"+earca_yyyy$+" "+earca_mmm$ # see add'l date categories at bottom of rule-set earca_xty$="Reports" earca_links$="" earca_args$="-ce 1" earca_dtm$="" earca_subtitle$="" earca_subdtm$="" earca_notes$="" earca_keywords$="*;" endif break case "income statement simple" if pagenum=1: day_format "MM/DD/YY" earca_library$="Financials" earca_doctype$="Income Statement" earca_subid$="" earca_docdate$=str(num(get(46,hdrbtm,2)):"00")+"/01/"+get(49,hdrbtm,2) earca_title$=trim(get(1,hdrbtm,80)) earca_yyyy$=dte(earca_docdate$:"%Ys") earca_mmm$=dte(earca_docdate$:earca_momask$) earca_yyyymmmdd$=earca_yyyy$+"|"+earca_yyyy$+" "+earca_mmm$+"|"+earca_yyyy$+" "+earca_mmm$+" "+earca_dd$ earca_yyyymmm$=earca_yyyy$+"|"+earca_yyyy$+" "+earca_mmm$ # see add'l date categories at bottom of rule-set earca_xty$="Reports" earca_links$="" earca_args$="-ce 1" earca_dtm$="" earca_subtitle$="" earca_subdtm$="" earca_notes$="" earca_keywords$="*;" endif break case "income statement complex" if pagenum=1: day_format "MM/DD/YY" earca_library$="Financials" earca_doctype$="Income Statement" earca_subid$="" earca_docdate$=str(num(get(46,6,2)):"00")+"/01/"+get(49,6,2) earca_title$=trim(get(1,hdrbtm,80)) earca_yyyy$=dte(earca_docdate$:"%Ys") earca_mmm$=dte(earca_docdate$:earca_momask$) earca_yyyymmmdd$=earca_yyyy$+"|"+earca_yyyy$+" "+earca_mmm$+"|"+earca_yyyy$+" "+earca_mmm$+" "+earca_dd$ earca_yyyymmm$=earca_yyyy$+"|"+earca_yyyy$+" "+earca_mmm$ # see add'l date categories at bottom of rule-set earca_xty$="Reports" earca_links$="" earca_args$="-ce 1" earca_dtm$="" earca_subtitle$="" earca_subdtm$="" earca_notes$="" earca_keywords$="*;" endif break endswitch # "CASE ALL" if (earca_xty$="Reports" and pagenum=1) or earca_xty$="Forms": earca_cats$+="by Year|"+fnearca_yyyy$(earca_docdate$)+";" earca_cats$+="by Month|"+fnearca_yyyymmm$(earca_docdate$)+";" earca_cats$+=earca_xty$+" By Type/Period|"+earca_doctype$+"|by Year|"+fnearca_yyyy$(earca_docdate$)+";" earca_cats$+=earca_xty$+" By Type/Period|"+earca_doctype$+"|by Month|"+fnearca_yyyymmm$(earca_docdate$)+";" earca_cats$+=earca_xty$+" By Period/Type|by Year|"+fnearca_yyyy$(earca_docdate$)+"|"+earca_doctype$+";" earca_cats$+=earca_xty$+" By Period/Type|by Month|"+fnearca_yyyymmm$(earca_docdate$)+"|"+earca_doctype$+";" if earca_xty$="Forms": earca_cats$+="by Day|"+fnearca_yyyymmmdd$(earca_docdate$)+";" earca_cats$+=earca_xty$+" By Type/Period|"+earca_doctype$+"|by Day|"+fnearca_yyyymmmdd$(earca_docdate$)+";" earca_cats$+=earca_xty$+" By Period/Type|by Day|"+fnearca_yyyymmmdd$(earca_docdate$)+"|"+earca_doctype$+";" endif endif # mje 061611 moved from each case down here into a single instance # for all forms and reports -- the "company abbreviation substitution" # which global is set at the top of this rule-set # is primarily for generation of demonstration libraries and it is # assumed will be used globally or not at all # mje 120711 adding pagenum=1 wrapper to the routine # if pagenum=1: if (earca_xty$="Reports" and pagenum=1) or earca_xty$="Forms": earca_libcoabrsub=EARC_LIBCOABRSUB if earca_libcoabrsub: earca_library$="EARC_COABREVSUJ"+"_"+earca_library$ endif # mje 061611 earca_library$="EARC_LIBPATH"+earca_library$ # endif endif # not(uf.arcjob) return # line label for postjob goto skipcode1: } [8.0 zMrg PDFLinks v2] # Implementation note: merge this near the top of a rule set # that needs the embedded (annotation-based) links # Use the fnCreateAnnotations$() function in precopy, # not prepage, as the uf.cpi value it may rely on isn't # updated until after prepage is run. prejob { js$="" crlf$=$0d0a$ if uf.arcjob then: js$+="function showDoc(url,lb,dtp,did) {"+crlf$ js$+=" var qpos=url.indexOf('?a=vw');"+crlf$ js$+=" if (qpos<0) {"+crlf$ js$+=" app.alert('This feature is only available when viewing this document via the UnForm archive browser interface.');"+crlf$ js$+=" return;"+crlf$ js$+=" }"+crlf$ js$+=" var base=url.substr(0,qpos);"+crlf$ js$+=" if (lb=='') {"+crlf$ js$+=" var querystring=url.substr(qpos);"+crlf$ js$+=" var lpos=querystring.indexOf('lb=');"+crlf$ js$+=" lb=querystring.substr(lpos+3);"+crlf$ js$+=" lpos=lb.indexOf('&');"+crlf$ js$+=" lb=lb.substr(0,lpos);"+crlf$ js$+=" lb=unescape(lb);"+crlf$ js$+=" }"+crlf$ js$+=" var myurl=base+'?a=vw&lb='+escape(lb)+'&doctype='+escape(dtp)+'&docid='+escape(did)+'&subid=@';"+crlf$ js$+=" app.launchURL(myurl,true);"+crlf$ js$+="}"+crlf$ end if def fnCreateAnnotations$(local pattern$,local startcol,local startrow,local endcol,local endrow,local colshift,local rowshift,local idpfx$,local idsfx$,local fontinfo$,local lib$,local doctype$) # returns 'annotate' lines for inter-document links # mje 062810 added rowshift, mje 070610 added local targDocty$ local annotations$,c,item,item$,cmd$,col,row,cols,pat$,width local fontname$,fontsize,fontattr,alignment$ local x,x$,getofs,getcols,haveofs local expr$,ignore$ local targDocty$ if uf.arcjob then: fontinfo$=sub(lcs(fontinfo$),"fit","") fontinfo$=sub(fontinfo$,"wrap","") fontname$="Courier",fontsize=uf.cpi,fontattr=0 c=count(fontinfo$,",") if c>0 then: for item=1 to c item$=parse(fontinfo$,item,",") if trim(item$)="" then continue fontsize=num(item$,err=*next);continue if lcs(item$)="bold" fontattr=fontattr+1;continue if lcs(item$)="italic" fontattr=fontattr+2;continue if lcs(item$)="center" or lcs(item$)="right" alignment$=lcs(item$);continue fontname$=item$ next item end if # Pattern can contain control info # expression prefixed by == # !! ignore word list (comma separated, case sensitive) x=pos("!!"=pattern$,-1) if x>0 then ignore$=pattern$(x+2),pattern$=pattern$(1,x-1) x=pos("=="=pattern$,-1) if x>0 then expr$=pattern$(x+2),pattern$=pattern$(1,x-1) # offset cols, length prefixed by // x=pos("//"=pattern$,-1) if x>0 then : haveofs=1 x$=pattern$(x+2),pattern$=pattern$(1,x-1) x=pos(","=x$) if x>0 then : getofs=num(x$(1,x-1)) getcols=num(x$(x+1)) else getofs=num(x$) getcols=1+endcol-startcol end if end if pat$=pattern$+"@"+str(startcol)+","+str(startrow)+","+str(endcol)+","+str(endrow) c=findpos(text$[],pat$,positions[]) if c>0 then: for item=0 to c-1 col=positions[item,0] row=positions[item,1] cols=1+endcol-startcol if haveofs then : col=col+getofs cols=getcols end if item$=get(col,row,cols) # Expression example: ==mid(item$,8,2)+$2D$+mid(item$,1,6) # To set a prefix and leave the link under a single column # use a compound statement starting with just item$ (becomes # item$=item$... Also, you can manipulate col to adjust position # eg: item$,idpfx$=mid(item$,1,2),item$=mid(item$,3),col+=3 if expr$>"" then execute "item$="+expr$ if fontinfo$="" then: leftpad=pos(" "<>item$) if leftpad>0 then leftpad-- end if item$=trim(item$) if ignore$>"" then if pos(","+item$+","=","+ignore$+",")>0 then continue width=textwidth(item$,fontname$,fontsize,fontattr) if alignment$="center" then col=col+(cols/2-width/2) if alignment$="right" then col=col+cols-width cmd$="annotate "+str(col-.5+colshift+leftpad)+","+str(rowshift+row-.5)+","+str(width)+",1,"+$22$+"javascript:showDoc(this.URL," cmd$+="'"+lib$+"'," # mje 070610 allow comma-delim list of docty's to test existence before creating link if pos(","=doctype$): w=1 while w<4 targDocty$=parse(doctype$,w,",") w+=1 if w=1 or docidexists(Lib$,targDocty$,item$) then: doctype$=targDocty$; break endif wend endif cmd$+="'"+doctype$+"'," cmd$+="'"+idpfx$+item$+idsfx$+"')" cmd$+=$22$+",link,style U,color blue" annotations$+=cmd$+$0a$ next item end if end if return annotations$ end def def fnAnnotation$(local col,local row,local fontinfo$,local lib$,local doctype$,local docid$,local idpfx$,local idsfx$,colshift) # returns 'annotate' lines for inter-document links local annotation$,c,item,item$,cmd$,cols,width local fontname$,fontsize,fontattr,alignment$,ofs local leftpad if uf.arcjob then: fontinfo$=sub(lcs(fontinfo$),"fit","") fontinfo$=sub(fontinfo$,"wrap","") fontname$="Courier",fontsize=uf.cpi,fontattr=0 c=count(fontinfo$,",") if c>0 then: for item=1 to c item$=parse(fontinfo$,item,",") if trim(item$)="" then continue fontsize=num(item$,err=*next);continue if lcs(item$)="bold" fontattr=fontattr+1;continue if lcs(item$)="italic" fontattr=fontattr+2;continue if lcs(item$)="center" or lcs(item$)="right" alignment$=lcs(item$);continue fontname$=item$ next item end if item$=docid$ if fontinfo$="" then: leftpad=pos(" "<>item$) if leftpad>0 then leftpad-- end if cols=len(item$) item$=trim(item$) width=textwidth(item$,fontname$,fontsize,fontattr) if alignment$="center" then ofs=cols/2-width/2 if alignment$="right" then ofs=cols-width cmd$="annotate "+str(col+ofs+leftpad+colshift-.5)+","+str(row-.5)+","+str(width)+",1,"+$22$+"javascript:showDoc(this.URL," cmd$+="'"+lib$+"'," cmd$+="'"+doctype$+"'," cmd$+="'"+idpfx$+item$+idsfx$+"');" cmd$+=$22$+",link,style U,color blue" annotation$=cmd$ end if return annotation$ end def } javascript {js$} [8.0 EDM6 BOOK] # address method 6 "Address Book" prepage { if lower(edel$)="y": if not(uf.subjob): edocid$=trim(edocid$) dlm$="|" eAddrEnt$=trim(eAddrEnt$) book$="sxe" # Assume a Hierarchy of address book entries to check # check with specific doctype doctype$=eForm$ prfx$="",sufx$="-E",entityid$=prfx$+eAddrEnt$+sufx$ xx=getaddress(book$,entityid$,doctype$,address$) if not(xx): prfx$="",sufx$="-F",entityid$=prfx$+eAddrEnt$+sufx$ xx=getaddress(book$,entityid$,doctype$,address$) endif if not(xx): prfx$="",sufx$="",entityid$=prfx$+eAddrEnt$+sufx$ xx=getaddress(book$,entityid$,doctype$,address$) endif if not(xx): # check with null or hard-coded doctype doctype$="" prfx$="",sufx$="-E",entityid$=prfx$+eAddrEnt$+sufx$ xx=getaddress(book$,entityid$,doctype$,address$) if not(xx): prfx$="",sufx$="-F",entityid$=prfx$+eAddrEnt$+sufx$ xx=getaddress(book$,entityid$,doctype$,address$) endif if not(xx): prfx$="",sufx$="",entityid$=prfx$+eAddrEnt$+sufx$ xx=getaddress(book$,entityid$,doctype$,address$) endif endif ex$="",fx$="",sx$="",yx$="",eaddr$="" if xx=1: yx$=address.sendto$ # determine email versus fax if pos("@"=yx$): eaddr$=yx$ einvno$="e"+edocid$ else faddr$=yx$ finvno$="f"+edocid$ ftoco$=address.entityname$ ftnam$=address.contactname$ endif endif endif endif } # do merge just for variable Inits merge "8.0 ED TAG PARSER" # UnForm Address book template # address.entityid$ (key seg1) # address.doctype$ (key seg2) # address.entityname$ # address.contactname$ # address.sendto$ # address.combine [8.0 EDM5 TRAILPAGE] # address method 5 "trailer page" (ref sxe osx) # was prejob, but switching to prepage for pagenum=1 only # so that it can work like other demo merges from a prepage prepage { if lower(edel$)="y": doing_method=5 if pagenum=1: if not(uf.subjob): edocid$=trim(edocid$) dlm$="|" # test for and erase blank last page due to 'FF' (sxe) for row=1 to 2 edelx$=get(1,row,80,1,uf.maxpage) # item 1 if edelx$<>"" then break next row # delete 'empty' last page if found if edelx$="" delpage(uf.maxpage) # mje 021811 new logic checks first line of last page only before proceeding # obsoleted the section below this for row=1 to 2 tptag$=get(1,row,5,1,uf.maxpage) if tptag$<>"" then break next row ex$=getpatternvalue("EMAIL","",tptag$,0,1) fx$=getpatternvalue("FAX","",tptag$,0,1) if ex$<>"" or fx$<>"": getpage(uf.maxpage,epg$[all]) delpage(uf.maxpage) arrtostr(epg$[all],text$,dlm$) ex$=getpatternvalue("EMAIL"+dlm$,"",text$) fx$=getpatternvalue("FAX"+dlm$,"",text$) endif # mje 021811 obsoleted this logic # old routine would 'fail' if word FAX or EMAIL was used at the end of a line # causing the last page to erroneously get deleted if it was not a true fax or # email trailer page # # get trailer page # getpage(uf.maxpage,epg$[all]) # arrtostr(epg$[all],text$,dlm$) # ex$=getpatternvalue("EMAIL"+dlm$,"",text$) # fx$=getpatternvalue("FAX"+dlm$,"",text$) # if ex$<>"" or fx$<>"": # delpage(uf.maxpage) # endif endif # not(uf.subjob) endif # pagenum=1 # mje 073010 if pagenum<>1 skipInit=1 endif } merge "8.0 ED TAG PARSER SXE-TRAILPAGE" # "Generic" SDSI (memo) from samples/eDeliver80.rul # Trailer page format expected is below # note the "tag=" prefix is optional # the line sequence governs, leave blank lines # for tags not used # note body= as 5th tag for single line body # or 'long' body= tags at bottom, up to 10 # # # email # copy=1 # to=demo@synergetic-data.com # from=mjescobar@msn.com # subj=my Doc title # body= # tach= # cc=demo@synergetic-data.com # bcc=mescobar@sdsi.us # ohdr= # logn= # pswd= # mime= # pcopy= # body=Tans 4 u Biz # body= # body= # mje 071610 # SXE OSX TRAILER PAGE IS DIFFERENT! ***************************** # SO TAG SEQUENCES CHANGED IN '8.0 ED TAG PARSER" # Sample Last Page from SDSI UnForm SXE script: # EMAIL # demo@synergetic-data.com # OE Acknowl for Order #:860558-01 # demo@synergetic-data.com # Text from the SXe print function that # will be sent with the document to the # user. I am uncertin how many lines will # be sent but the body appears to scroll # fro a very long time. # # The brown cow jumped over the fence to # get to the bright green grass on the # other side. While there the cow ate too # much and got very sick. This is the max [8.0 EDM5 TRAILPAGE v2] # address method 5 "trailer page" (ref sxe osx) prepage { if lower(edel$)="y": doing_method=5 if pagenum=1: if not(uf.subjob): edocid$=trim(edocid$) pass=1,dlm$="|" while pass<=2 row=0 # mje 022712 while edelx$="" row+=1; edelx$=get(1,row,80,1,uf.maxpage) if edelx$<>"" or row>66 then break wend # delete 'empty' last page if found if edelx$="": # dp+=1,tdocid$+="pass="+str(pass)+"(1)"+edocid$+"~" delpage(uf.maxpage) pass+=1 else break endif wend ex$=getpatternvalue("EMAIL","",edelx$,0,1) fx$=getpatternvalue("FAX","",edelx$,0,1) if ex$<>"" or fx$<>"": getpage(uf.maxpage,epg$[all]) delpage(uf.maxpage) # dp+=1,tdocid$+="pass="+str(pass)+"(2)"+edocid$+"~" arrtostr(epg$[all],text$,dlm$) ex$=getpatternvalue("EMAIL"+dlm$,"",text$) fx$=getpatternvalue("FAX"+dlm$,"",text$) endif endif # not(uf.subjob) endif # pagenum=1 if pagenum<>1 skipInit=1 # mje 073010 endif } merge "8.0 ED TAG PARSER SXE-TRAILPAGE" # "Generic" SDSI (memo) from samples/eDeliver80.rul # Trailer page format expected is below # note the "tag=" prefix is optional # the line sequence governs, leave blank lines # for tags not used # note body= as 5th tag for single line body # or 'long' body= tags at bottom, up to 10 # # # email # copy=1 # to=demo@synergetic-data.com # from=mjescobar@msn.com # subj=my Doc title # body= # tach= # cc=demo@synergetic-data.com # bcc=mescobar@sdsi.us # ohdr= # logn= # pswd= # mime= # pcopy= # body=Tans 4 u Biz # body= # body= # mje 071610 # SXE OSX TRAILER PAGE IS DIFFERENT! ***************************** # SO TAG SEQUENCES CHANGED IN '8.0 ED TAG PARSER" # Sample Last Page from SDSI UnForm SXE script: # EMAIL # demo@synergetic-data.com # OE Acknowl for Order #:860558-01 # demo@synergetic-data.com # Text from the SXe print function that # will be sent with the document to the # user. I am uncertin how many lines will # be sent but the body appears to scroll # fro a very long time. # # The brown cow jumped over the fence to # get to the bright green grass on the # other side. While there the cow ate too # much and got very sick. This is the max [8.0 ED TAG PARSER] # Common delimited tag parsing routine prepage { if lower(eDel$)="y": if not(skipInit): # reset tag variables for next Doc if not(uf.subjob): # email, ref tags in deliver.ini ecopy$="",efrom$="",esubj$="",ebody$="" etach$="",ecccc$="",ebbcc$="",eohdr$="" elogn$="",epswd$="",emime$="" eArg$="" # fax, ref tags in deliver.ini fcopy$="",ffrom$="",fsubj$="",fbody$="" ftach$="",fcovr$="" # ,ftnam$="",ftoco$="" ffrco$="",f11$="",f12$="" fArg$="" pcopy$="" if not(doing_method=6): ftnam$="",ftoco$="" endif endif endif okToParse=1 if doing_method=1 okToParse=0 if doing_method=6 okToParse=0 if doing_method=8 okToParse=0 if doing_method=4 and edocConnect_ok=0 then okToParse=0 if doing_method=5 and pagenum<>1 then okToParse=0 if okToParse: if not(uf.subjob): if ex$<>"": einvno$="e"+edocid$ ecopy$=fnEq$(parse(ex$,1,dlm$)) eaddr$=fnEq$(parse(ex$,2,dlm$)) if eaddr$<>"": efrom$=fnEq$(parse(ex$,3,dlm$)) esubj$=fnEq$(parse(ex$,4,dlm$)) ebody$=fnEq$(parse(ex$,5,dlm$)) etach$=fnEq$(parse(ex$,6,dlm$)) ecccc$=fnEq$(parse(ex$,7,dlm$)) ebbcc$=fnEq$(parse(ex$,8,dlm$)) eohdr$=fnEq$(parse(ex$,9,dlm$)) elogn$=fnEq$(parse(ex$,10,dlm$)) epswd$=fnEq$(parse(ex$,11,dlm$)) emime$=fnEq$(parse(ex$,12,dlm$)) pcopy$=fnEq$(parse(ex$,13,dlm$)) # LONG BODY, unique to method 5 if doing_method=5: lbrk$="
" # "\n" for regular text, "
" for mime text/html ebody$="" for rw=14 to 60 ebody$+=lbrk$+fnEq$(parse(ex$,rw,dlm$)) next rw mlf$=lbrk$+lbrk$+lbrk$ while pos(mlf$=ebody$) ebody$=sub(ebody$,mlf$,lbrk$) wend endif endif endif if fx$<>"": finvno$="f"+edocid$ fcopy$=fnEq$(parse(fx$,1,dlm$)) faddr$=fnEq$(parse(fx$,2,dlm$)) if faddr$<>"": ffrom$=fnEq$(parse(fx$,3,dlm$)) fsubj$=fnEq$(parse(fx$,4,dlm$)) fbody$=fnEq$(parse(fx$,5,dlm$)) ftach$=fnEq$(parse(fx$,6,dlm$)) fcovr$=fnEq$(parse(fx$,7,dlm$)) ftnam$=fnEq$(parse(fx$,8,dlm$)) ftoco$=fnEq$(parse(fx$,9,dlm$)) ffrco$=fnEq$(parse(fx$,10,dlm$)) f11$=fnEq$(parse(fx$,11,dlm$)) f12$=fnEq$(parse(fx$,12,dlm$)) pcopy$=fnEq$(parse(fx$,13,dlm$)) # LONG BODY, unique to method 5 if doing_method=5: lbrk$="\n" fbody$="" for rw=14 to 60 fbody$+=lbrk$+fnEq$(parse(fx$,rw,dlm$)) next rw mlf$=lbrk$+lbrk$+lbrk$ while pos(mlf$=fbody$) fbody$=sub(fbody$,mlf$,lbrk$) wend endif endif endif # for method 2; if a print| line exists, use it if sx$<>"" pcopy$=parse(sx$,1,dlm$) endif endif endif # allow "tag=value" format def fnEq$(q2$) q2$=sub(q2$,QUO,"") if pos("="=q2$): q2$=parse(q2$,2,"=") endif return q2$ end def } [8.0 ED TAG PARSER SXE-TRAILPAGE] # Common delimited tag parsing routine and variable initializer prepage { if lower(edel$)="y": if not(skipInit): # reset tag variables for next Doc if not(uf.subjob): # email, ref tags in deliver.ini ecopy$="",efrom$="",esubj$="",ebody$="" etach$="",ecccc$="",ebbcc$="",eohdr$="" elogn$="",epswd$="",emime$="" eArg$="" # fax, ref tags in deliver.ini fcopy$="",ffrom$="",fsubj$="",fbody$="" ftach$="",fcovr$="" # ,ftnam$="",ftoco$="" ffrco$="",f11$="",f12$="" fArg$="" pcopy$="" if not(doing_method=6): ftnam$="",ftoco$="" endif endif endif okToParse=1 if doing_method=1 okToParse=0 if doing_method=6 okToParse=0 if doing_method=8 okToParse=0 if doing_method=4 and edocConnect_ok=0 then okToParse=0 if doing_method=5 and pagenum<>1 then okToParse=0 # ********************************************************************** # mje 071610 # changed tag sequences to match SXE trailer page!! # and remarked un-passed tags # ********************************************************************** if okToParse: if not(uf.subjob): if ex$<>"": einvno$="e"+edocid$ # ecopy$=fnEq$(parse(ex$,1,dlm$)) eaddr$=fnEq$(parse(ex$,1,dlm$)) if eaddr$<>"": efrom$=fnEq$(parse(ex$,3,dlm$)) esubj$=fnEq$(parse(ex$,2,dlm$)) # ebody$=fnEq$(parse(ex$,5,dlm$)) # etach$=fnEq$(parse(ex$,6,dlm$)) # ecccc$=fnEq$(parse(ex$,7,dlm$)) # ebbcc$=fnEq$(parse(ex$,8,dlm$)) # eohdr$=fnEq$(parse(ex$,9,dlm$)) # elogn$=fnEq$(parse(ex$,10,dlm$)) # epswd$=fnEq$(parse(ex$,11,dlm$)) # emime$=fnEq$(parse(ex$,12,dlm$)) # pcopy$=fnEq$(parse(ex$,13,dlm$)) # LONG BODY, unique to method 5 if doing_method=5: lbrk$="
" # "\n" for regular text, "
" for mime text/html ebody$="" for rw=4 to 13 ebody$+=lbrk$+fnEq$(parse(ex$,rw,dlm$)) next rw mlf$=lbrk$+lbrk$+lbrk$ while pos(mlf$=ebody$) ebody$=sub(ebody$,mlf$,lbrk$) wend endif endif endif if fx$<>"": finvno$="f"+edocid$ # fcopy$=fnEq$(parse(fx$,1,dlm$)) faddr$=fnEq$(parse(fx$,1,dlm$)) if faddr$<>"": ffrom$=fnEq$(parse(fx$,4,dlm$)) fsubj$=fnEq$(parse(fx$,3,dlm$)) # fbody$=fnEq$(parse(fx$,5,dlm$)) # ftach$=fnEq$(parse(fx$,6,dlm$)) # fcovr$=fnEq$(parse(fx$,7,dlm$)) ftnam$=fnEq$(parse(fx$,2,dlm$)) # ftoco$=fnEq$(parse(fx$,9,dlm$)) # ffrco$=fnEq$(parse(fx$,10,dlm$)) # f11$=fnEq$(parse(fx$,11,dlm$)) # f12$=fnEq$(parse(fx$,12,dlm$)) # pcopy$=fnEq$(parse(fx$,13,dlm$)) # LONG BODY, unique to method 5 if doing_method=5: lbrk$="\n" fbody$="" for rw=5 to 14 fbody$+=lbrk$+fnEq$(parse(fx$,rw,dlm$)) next rw mlf$=lbrk$+lbrk$+lbrk$ while pos(mlf$=fbody$) fbody$=sub(fbody$,mlf$,lbrk$) wend endif endif endif # for method 2; if a print| line exists, use it if sx$<>"" pcopy$=parse(sx$,1,dlm$) endif endif endif # allow "tag=value" format def fnEq$(q2$) q2$=sub(q2$,QUO,"") if pos("="=q2$): q2$=parse(q2$,2,"=") endif return q2$ end def } [8.0 ED Selective Copy Printing] precopy { if not(uf.subjob) then : # selective copy printing from pcopy$ in eDel merges; # note new pcopy$ option in email and fax delimited lines # to eliminate need for separate 'print|' line in method 2 # re pcopy$ variable in eDel merges: # pcopy$ is print copy field, 0=suppress print, or see scopy options if pcopy$<>"": switch lower(pcopy$) case "none","0","" skip=1 break case "all" break default if pos(","+str(copy)+","=","+pcopy$+",")=0 then : skip=1 endif end switch endif endif # } [8.0 Drop In Code Sample] # Invoice Laser code as Drop In Code Sample # Section above archiving section is from "old" code block that # needed to be before archiving for timing purposes, rest of # old code is at bottom (except it was removed for sample) :) # ---------------------------------------------------------------------- prepage { # get invoice title doc_title$="INVOICE",reprint$="" # get title from body of invoice, if available. # Must handle credit memo text/quote. x$=trim(cut(18,10,26,"")) x=pos("REPRINT"=x$) if x then reprint$="REPRINT" x=pos("C R E D I T"=X$) if x then doc_title$="CREDIT MEMO" x=pos("Q U O T E"=X$) if x then doc_title$="QUOTE" } # --- 8.0 ARCHIVING ---------------------------------------------------- const ARCRULE="invoice" prepage { noarchive=1 earc$="EARC_INVOICE",doing_recat=0 earca_formtype$="laser" if lower(earc$)="y": noarchive=0 if not(uf.subjob): gosub process_arcProps # see 8.0 zMrg ArcProps ruleset endif endif } merge "8.0 zMrg ArcProps" if uf.arcenabled ARCHIVE {earca_library$},{earca_doctype$},{earca_docid$},subid {earca_subid$},title {earca_title$},notes {earca_notes$},keywords {earca_keywords$},categories {earca_cats$},links {earca_links$},args {earca_args$},dtm {earca_dtm$},subtitle {earca_subtitle$},subdtm {earca_subdtm$} endif # --- PDF HYPERLINK FOR ARCHIVING -------------------------------------- # # mje 062810 disabled due to different order doc types # merge "8.0 zMrg PDFLinks v2" # prepage { # exec(fnCreateAnnotations$("~ [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] ",61,22,70,22,0,"","","DBCFONT","EARC_ORDLINKLIB","EARC_ORDLINKDOCTY")) # } # --- SCANNING BARCODE -------------------------------------------------- prepage { bcod_docid$=get(112,7,8,1) } precopy { # Add barcodes for scanning interface. bcod$="BCOD_INVOICE" # Y/N Switch from global section bcod_Copies$="2" # which copy(s) get barcode if lower(bcod$)="y" then: if pos(str(copy)=bcod_Copies$): bcod_docty$="SOINV" rows$=str(MAXROWS+7) cmd$="text 2,"+str(MAXROWS+1.5)+","+$22$+"Do not write below this line"+$22$+",cgtimes,10,italic" cmd$+=$0a$+"cbox LEFTCOL,"+str(MAXROWS+2)+",RIGHTCOL,"+str(MAXROWS+2) cmd$+=$0a$+"barcode "+str(inchtocols(.5))+","+str(MAXROWS+4)+","+$22$+bcod_docty$+$22$+",BCSYMB,18.0,6,text" cmd$+=$0a$+"barcode "+str(inchtocols(3.5))+","+str(MAXROWS+4)+","+$22$+bcod_DocID$+$22$+",BCSYMB,18.0,6,text" exec(cmd$) end if end if } # --- PAGE X of Y FEATURE ----------------------------------------------- # change XOFYM_COPIES to "0" to turn off local XOFYM_COPIES="ALL" # or copy #'s to display local XOFYM_DROW =MAXROWS+.5 # row to display title # location of unique doc id local XOFYM_COL =112 # adjust as needed local XOFYM_ROW =7 # adjust as needed local XOFYM_NCOLS =8 # adjust as needed global XOFYM_FONT="univers,10,bold,left" merge "zMrgMultiPageXofY" # --- 8.0 DELIVER ------------------------------------------------------ # deliver email command - no change needed, ref tags in deliver.ini deliver {eaddr$},{einvno$},args {eArg$},from {efrom$},cc {ecccc$},bcc {ebbcc$},subject {esubj$},note {ebody$},login {elogn$},password {epswd$},attach {etach$},otherhead {eohdr$},bodymime {emime$},combine {eCombine$} # deliver fax command - no change needed, ref tags in deliver.ini deliver {faddr$},{finvno$},args {fArg$},fromname {ffrom$},subject {fsubj$},note {fbody$},coverpage {fcovr$},attach {ftach$},toname {ftnam$},tocompany {ftoco$},fromcompany {ffrco$},combine {fCombine$} prepage { # form-based data locations edel$="EDEL_INVOICE" if lower(edel$)="y": eDocid$=get(112,7,8,1) # Required ALL methods # Method 6: Address Book doc type, or subject component eDocty$="Invoice" # Method 6: Address entity ID for lookup eAddrEnt$=get(10,10,6,1) endif } # ADDRESS RETRIEVAL METHOD, set in global section! merge "EDEL_METHOD" # EMAIL defaults or overrides, remove conditional for override prepage { if lower(edel$)="y": if not(uf.subjob): if eAddr$<>"": # email, ref tags in deliver.ini if ecopy$="" ecopy$="1" if efrom$="" efrom$="" if esubj$="" esubj$=eDocty$+" "+eDocid$ if ebody$="" ebody$="\nThank you for your business.\n\nThe Management" if etach$="" etach$="" if ecccc$="" ecccc$="" if ebbcc$="" ebbcc$="" if eohdr$="" eohdr$="" if elogn$="" elogn$="" if epswd$="" epswd$="" if emime$="" emime$="" # "text/html" if pcopy$="" pcopy$="" eArg$="-ce "+ecopy$ eCombine$="no" endif endif endif } # FAX defaults or overrides, remove conditional for override prepage { if lower(edel$)="y": if not(uf.subjob): if fAddr$<>"": # fax, ref tags in deliver.ini if fcopy$="" fcopy$="1" if ffrom$="" ffrom$="" if fsubj$="" fsubj$=eDocty$+" "+eDocid$ if fbody$="" fbody$="" if ftach$="" ftach$="" if fcovr$="" fcovr$="" # Fax Pkg cover page if ftnam$="" ftnam$="" if ftoco$="" ftoco$="" if ffrco$="" ffrco$="" if pcopy$="" pcopy$="" fArg$="-ce "+fcopy$ fCombine$="no" endif endif endif } # remark this to ALWAYS print ALL copies of a delivered document merge "8.0 ED Selective Copy Printing" # --- ATTACH SCANNED IMAGES --------------------------------------------- prepage { do_attch$="STM_ATTCH_SCAN" if lower(do_attch$)="y" then: if not(uf.arcjob) then: begrow=20,endrow=54 tktcount=0,tktno$="" amask$=" [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] [A-Z][A-Z] " for row=begrow to endrow pp=msk(text$[row],amask$,err=*next) if not(pp) continue tktno$+=trim(mid(text$[row],pp+1,8))+"," tktcount+=1 next row continued=(xofym_pageno<>xofym_maxpgs) # above, other erp was pos("Continued On Next Page"=text$[50]) # dotypes$ has valid 1st char prefixes to filter sub-id's, if applicable dotypes$="Scan" tktlib$="Osas80_Sales" tktdocty$="Invoice" if tktcount then: for ii=1 to tktcount tktdocid$=parse(tktno$,ii,",") have_arc1=docidexists(tktlib$,tktdocty$,tktdocid$) if have_arc1 then: subidlist$=getsubids(tktlib$,tktdocty$,tktdocid$) subid_count=count(subidlist$,";") for x=1 to subid_count tktsubid$=parse(subidlist$,x,";") if tktsubid$<>"" then: if dotypes$="" or pos(left(tktsubid$,4)=dotypes$)=1 then: filename$="" getarc(tktlib$,tktdocty$,tktdocid$,tktsubid$,filename$,tkterrmsg$) imglist$+=filename$+";" endif endif next x endif next ii if not(continued) then images$=imglist$,imglist$="" end if endif endif } if copy 1 images {images$},across 2, down 2 end if # --- ORIGINAL CODE-BLOCK SECTION --------------------------------------- # --- 8.0 ARCHIVING ---------------------------------------------------- # --- PDF HYPERLINK FOR ARCHIVING -------------------------------------- # --- SCANNING BARCODE -------------------------------------------------- # --- PAGE X of Y FEATURE ----------------------------------------------- # --- 8.0 DELIVER ------------------------------------------------------ # --- ATTACH SCANNED IMAGES --------------------------------------------- # --- ORIGINAL CODE-BLOCK SECTION --------------------------------------- [~--- Other Merge Rule sets ---] [zMrgAdjustAddr] # v8.0 # # this merge code will take names and addresses # and merge them together # # the merge command belongs inside a code block # zinfo$ =zname$+$0a$+zaddr$ zinfo$ =striplines(zinfo$) citylen =len(zcity$) ziplen =len(zzip$) if citylen<24 or (citylen<29 and ziplen=5) then : zinfo$+=zcity$+" "+zzip$ else zinfo$+=zcity$+$0a$+zzip$ endif xright$=right(zinfo$,1) if xright$<>$0a$ then zinfo$=zinfo$+$0a$ [zMrgAdjustPage1Issue] # v8.0 prepage { # adjust for possible extra row 1 adjruleset$="RULESET",adjrow=3 if adjruleset$="APCHK" or adjruleset$="APCHKREM" then : adjrow=2 endif if pos(adjruleset$=text$[adjrow]) then : for row=2 to 66 text$[row-1]=text$[row] text$[row]="" next row # page 1 fixed, so replace original page 1 putpage(pagenum,text$[all]) endif } # end zMrgAdjustPage1Issue [zMrg bottom row] text 1,{MAXROWS+.5},{cash_disc$},DBLFONT text 1,{MAXROWS+.5},{rcvd_by$},DBLFONT text 1,{MAXROWS+.5},{copy_title$[copy]},HBCFONT,cols=MAXRCOLS # mje 072310 disabling re using page x of y now for 8.0 # text 1,{MAXROWS+.5},{cont$},DBRFONT,10,cols=MAXRCOLS [zMrg check continued] # mje 072310 not used anymore for printing "continued" or "last page" # but other routines for calculating bottom of lines section still use this cont_row=66,cont$="" for xrow=xrow1 to xrow2 cont$=get(1,xrow,19,1) if cont$="Continued" or cont$="Last Page" then break next xrow if xrow<=xrow2 then : cont_row=xrow endif if left(cont$,4)="Cont" then : cont$="Continued on next page ..." else cont$="... Last Page " endif [zMrg check reprint] reprint$="" if pos("R E P R I N T"=text$[xrow]) then reprint$="Reprint" if pos("D U P L I C A T E"=text$[xrow]) then reprint$="Duplicate" [zMrgDispCpyTitle] # # This merge rule set will display the copy title # on the row specified # using the font & justification specified # copy the following code as designated by the # global start / end remarks # to the globals area of the rule file # and adjust/remove as needed # OR merge in the globals from BaseMrgGlobals rule set ### global start for zMrgDispCpyTitle #global DCTFONT=univers,10,bold,center ### global end for zMrgDispCpyTitle # copy the following code as designated by the # local start / end remarks # to the bottom of the current rule set # and adjust/remove as needed # NOTE: MAX_COPIES must be placed before copies # command if used by copies command ### local start for zMrgDispCpyTitle #local MAXCOLS=80 # max # of cols in a row #local MAXROWS=66 # max # of rows on a page #local MAX_COPIES=2 # max # of copies #local DCTROW=MAXROWS+.5 # row to display title #local DCTCOL=0 # force start col of msg #local DCTFONT=DCTFONT # use global or ??? #prejob { # dim copy_title$[MAX_COPIES] # copy_title$[1]="Customer Copy" # copy_title$[2]="Office Copy" #} #merge "zMrgDispCpyTitle" ### local end for zMrgDispCpyTitle precopy { # find start col & # of cols from justification dctfont$=lower("DCTFONT") dctcol$="DCTCOL" dctcol=2,dctcols=MAXCOLS # left or no just if pos("center"=dctfont$) then : dctcol=1,dctcols=MAXCOLS endif if pos("right"=dctfont$) then : dctcol=1,dctcols=MAXCOLS-1 endif if num(dctcol$)>0 then : dctcol=num(dctcol$) dctcols=MAXCOLS-dctcol endif # setup display copy title cmd dctitle$ ="text "+str(dctcol)+","+str(DCTROW)+"," dctitle$+=$22$+copy_title$[copy]+$22$+"," dctitle$+=dctfont$+",cols="+str(dctcols) # display copy title exec(dctitle$) } # end zMrgDispCpyTitle [zMrg form header] # v80 # replaces old zMrg form header and zMrg form header osx # LOGO_IMAGE .1,.1,12,6,"COMP_LOGO" text 1,1.5,{comp_info$+"COMP_WEB\nCOMP_EMAIL"},\ DBCFONT,10,cols=MAXRCOLS text 1,1.5,{doc_title$},HBRFONT,14,cols=MAXRCOLS text 1,2.5,{reprint$},HBRFONT,cols=MAXRCOLS [zMrg form header Osx] # # old style # see zMrg form header for replacement # [zMrg load addr info] # v80 # using styles (osx, sds) # only difference is location of postnet barcode # maybe pass zbcol, zbrow, and zshift in rule set # then style will not be needed to be separate # #replaces zMrg load comp info & zMrg load cust info # switch xruleset$ case "ack-osx" # company info zname$ =get(68,7,40,1) zaddr$ =mget(68,8,30,3,"Y","Y") zcity$ =get(68,11,43,1) zzip$ ="" merge "zMrgAdjustAddr" comp_name$=zname$ comp_info$=zinfo$ # correspondence to postnet # zip$ =comp_info$ # zbcol=73,zbrow=12,zshift=0 # merge "zMrgZipPostnet" # ship to zname$ =get(12,13,30,1) zaddr$ =mget(12,14,30,3,"Y","Y") zcity$ =get(12,17,43,1) zzip$ ="" merge "zMrgAdjustAddr" ship$ =zinfo$, stname$=zname$ # postnet # zip$ =ship$ # zbcol=12,zbrow=12,zshift=0 # merge "zMrgZipPostnet" # bill to zname$ =get(12,7,30,1) zaddr$ =mget(12,8,30,3,"Y","Y") zcity$ =get(12,11,43,1) zzip$ ="" merge "zMrgAdjustAddr" bill$ =zinfo$, cust_name$=zname$ # postnet zip$ =bill$ zbcol=12,zbrow=18,zshift=0 merge "zMrgZipPostnet" break case "ack-sds" # company info zname$ =get(68,7,40,1) zaddr$ =mget(68,8,30,3,"Y","Y") zcity$ =get(68,11,43,1) zzip$ ="" merge "zMrgAdjustAddr" comp_name$=zname$ comp_info$=zinfo$ # bill to zname$ =get(12,7,30,1) zaddr$ =mget(12,8,30,3,"Y","Y") zcity$ =get(12,11,43,1) zzip$ ="" merge "zMrgAdjustAddr" bill$ =zinfo$, cust_name$=zname$ # postnet zip$ =bill$ zbcol=2,zbrow=14.5,zshift=0 merge "zMrgZipPostnet" # ship to zname$ =get(12,13,30,1) zaddr$ =mget(12,14,30,3,"Y","Y") zcity$ =get(12,17,43,1) zzip$ ="" merge "zMrgAdjustAddr" ship$ =zinfo$, stname$=zname$ # postnet # zip$ =ship$ # zbcol=50,zbrow=14.5,zshift=0 # merge "zMrgZipPostnet" break case "inv-osx" # company info zname$ =get(68,7,40,1) zaddr$ =mget(68,8,30,3,"Y","Y") zcity$ =get(68,11,43,1) zzip$ ="" merge "zMrgAdjustAddr" comp_name$=zname$ comp_info$=zinfo$ # correspondance to postnet # zip$ =comp_info$ # zbcol=81,zbrow=13 # merge "zMrgZipPostnet" # ship to zname$ =get(12,7,30,1) zaddr$ =mget(12,8,30,3,"Y","Y") zcity$ =get(12,11,43,1) zzip$ ="" merge "zMrgAdjustAddr" ship$ =zinfo$, stname$=zname$ # postnet # zip$ =ship$ # zbcol=12,zbrow=13,zshift=0 # merge "zMrgZipPostnet" # bill to zname$ =get(12,14,30,1) zaddr$ =mget(12,15,30,3,"Y","Y") zcity$ =get(12,18,35,1) zzip$ =get(12,19,10,1) merge "zMrgAdjustAddr" bill$ =zinfo$, cust_name$=zname$ # postnet zip$ =bill$ zbcol=12,zbrow=20,zshift=0 merge "zMrgZipPostnet" break case "inv-sds" # company info zname$ =get(68,7,40,1) zaddr$ =mget(68,8,30,3,"Y","Y") zcity$ =get(68,11,43,1) zzip$ ="" merge "zMrgAdjustAddr" comp_name$=zname$ comp_info$=zinfo$ # bill to zname$ =get(12,14,30,1) zaddr$ =mget(12,15,30,3,"Y","Y") zcity$ =get(12,18,35,1) zzip$ =get(12,19,10,1) merge "zMrgAdjustAddr" bill$ =zinfo$, cust_name$=zname$ # postnet zip$ =bill$ zbcol=2,zbrow=14,zshift=0 merge "zMrgZipPostnet" # ship to zname$ =get(12,7,30,1) zaddr$ =mget(12,8,30,3,"Y","Y") zcity$ =get(12,11,43,1) zzip$ ="" merge "zMrgAdjustAddr" ship$ =zinfo$, stname$=zname$ # postnet # zip$ =ship$ # zbcol=50,zbrow=14,zshift=0 # merge "zMrgZipPostnet" break case "pck-osx" # company info zname$ =get(68,7,40,1) zaddr$ =mget(68,8,30,3,"Y","Y") zcity$ =get(68,11,35,1) zzip$ ="" merge "zMrgAdjustAddr" comp_name$=zname$ comp_info$=zinfo$ # correspondence to postnet # zip$ =comp_info$ # zbcol=77,zbrow=14 # merge "zMrgZipPostnet" # bill to zname$ =get(12,7,30,1) zaddr$ =mget(12,8,30,3,"Y","Y") zcity$ =get(12,11,35,1) zzip$ ="" merge "zMrgAdjustAddr" bill$ =zinfo$, cust_name$=zname$ # postnet zip$ =bill$ zbcol=12,zbrow=14,zshift=0 merge "zMrgZipPostnet" # ship to zname$ =get(12,13,30,1) zaddr$ =mget(12,14,30,3,"Y","Y") zcity$ =get(12,17,45,1) zzip$ ="" merge "zMrgAdjustAddr" ship$ =zinfo$, stname$=zname$ # postnet # zip$ =ship$ # zbcol=12,zbrow=20.5,zshift=0 # merge "zMrgZipPostnet" break case "pck-sds" # company info zname$ =get(68,7,40,1) zaddr$ =mget(68,8,30,3,"Y","Y") zcity$ =get(68,11,35,1) zzip$ ="" merge "zMrgAdjustAddr" comp_name$=zname$ comp_info$=zinfo$ # bill to zname$ =get(12,7,30,1) zaddr$ =mget(12,8,30,3,"Y","Y") zcity$ =get(12,11,35,1) zzip$ ="" merge "zMrgAdjustAddr" bill$ =zinfo$, cust_name$=zname$ # postnet zip$ =bill$ zbcol=2,zbrow=15,zshift=0 merge "zMrgZipPostnet" # ship to zname$ =get(12,13,30,1) zaddr$ =mget(12,14,30,3,"Y","Y") zcity$ =get(12,17,45,1) zzip$ ="" merge "zMrgAdjustAddr" ship$ =zinfo$, stname$=zname$ # postnet # zip$ =ship$ # zbcol=49,zbrow=14,zshift=0 # merge "zMrgZipPostnet" break case "por-osx" # company info zname$ =get(52,5,30,1) zaddr$ =mget(52,6,30,3,"Y","Y") zcity$ =get(52,9,35,1) zzip$ =get(78,10,10,1) merge "zMrgAdjustAddr" comp_name$=zname$,comp_info$=zinfo$ # vendor zname$ =get(11,5,30,1) zaddr$ =mget(11,6,30,3,"Y","Y") zcity$ =get(11,9,35,1) zzip$ =get(37,10,10,1) merge "zMrgAdjustAddr" vend$ =zinfo$, vend_name$=zname$ # postnet zip$ =vend$ zbcol=12,zbrow=12,zshift=0 merge "zMrgZipPostnet" # invoice to zname$ =get(96,5,30,1) zaddr$ =mget(96,6,30,3,"Y","Y") zcity$ =get(96,9,35,1) zzip$ =get(122,10,10,1) merge "zMrgAdjustAddr" bill$ =zinfo$ # postnet # zip$ =bill$ # zbcol=78,zbrow=12,zshift=0 # merge "zMrgZipPostnet" # ship to zname$ =get(11,12,30,1) zaddr$ =mget(11,13,30,3,"Y","Y") zcity$ =get(11,16,43,1) zzip$ ="" merge "zMrgAdjustAddr" ship$ =zinfo$ # postnet # zip$ =ship$ # zbcol=12,zbrow=20,zshift=0 # merge "zMrgZipPostnet" break case "por-sds" # company info zname$ =get(52,5,30,1) zaddr$ =mget(52,6,30,3,"Y","Y") zcity$ =get(52,9,35,1) zzip$ =get(78,10,10,1) merge "zMrgAdjustAddr" comp_name$=zname$,comp_info$=zinfo$ # vendor zname$ =get(11,5,30,1) zaddr$ =mget(11,6,30,3,"Y","Y") zcity$ =get(11,9,35,1) zzip$ =get(37,10,10,1) merge "zMrgAdjustAddr" vend$ =zinfo$, vend_name$=zname$ # postnet zip$ =vend$ zbcol=2,zbrow=12,zshift=0 merge "zMrgZipPostnet" # sold to sold$ =comp_info$ # postnet # zip$ =sold$ # zbcol=58,zbrow=12,zshift=1 # merge "zMrgZipPostnet" # ship to zname$ =get(11,12,30,1) zaddr$ =mget(11,13,30,3,"Y","Y") zcity$ =get(11,16,43,1) zzip$ ="" merge "zMrgAdjustAddr" ship$ =zinfo$ # postnet # zip$ =ship$ # zbcol=2,zbrow=20,zshift=0 # merge "zMrgZipPostnet" # invoice to zname$ =get(96,5,30,1) zaddr$ =mget(96,6,30,3,"Y","Y") zcity$ =get(96,9,35,1) zzip$ =get(122,10,10,1) merge "zMrgAdjustAddr" bill$ =zinfo$ # postnet # zip$ =bill$ # zbcol=58,zbrow=20,zshift=1 # merge "zMrgZipPostnet" break case "stm-osx" # company info zname$ =get(11,5,30,1) zaddr$ =mget(11,6,30,3,"Y","Y") zcity$ =get(11,9,35,1) zzip$ ="" merge "zMrgAdjustAddr" comp_name$=zname$ comp_info$=zinfo$,remit$=zinfo$ # remit to postnet # zip$=remit$,zshift=0 # zbcol=11,zbrow=11.5 # merge "zMrgZipPostnet" # customer zname$ =get(11,16,35,1) zaddr$ =mget(11,17,35,3,"Y","Y") zcity$ =get(11,20,35,1) zzip$ ="" merge "zMrgAdjustAddr" bill$ =zinfo$, cust_name$=zname$ # postnet zip$ =bill$ zbcol=11,zbrow=18,zshift=0 merge "zMrgZipPostnet" break case "stm-sds" # company info zname$ =get(11,5,30,1) zaddr$ =mget(11,6,30,3,"Y","Y") zcity$ =get(11,9,35,1) zzip$ ="" merge "zMrgAdjustAddr" comp_name$=zname$ comp_info$=zinfo$,remit$=comp_info$ # remit to postnet # zip$=remit$,zshift=0 # zbcol=10,zbrow=12.5 # merge "zMrgZipPostnet" # customer zname$ =get(11,16,35,1) zaddr$ =mget(11,17,35,3,"Y","Y") zcity$ =get(11,20,35,1) zzip$ ="" merge "zMrgAdjustAddr" bill$ =zinfo$, cust_name$=zname$ # postnet zip$ =bill$ zbcol=10,zbrow=19,zshift=0 merge "zMrgZipPostnet" break case "whs-osx" # company info zname$ =get(68,7,40,1) zaddr$ =mget(68,8,30,3,"Y","Y") zcity$ =get(68,11,35,1) zzip$ ="" merge "zMrgAdjustAddr" comp_name$=zname$ comp_info$=zinfo$ # comp postnet # zip$=comp_info$,zshift=0 # zbcol=77,zbrow=13 # merge "zMrgZipPostnet" # bill to zname$ =get(12,7,30,1) zaddr$ =mget(12,8,30,3,"Y","Y") zcity$ =get(12,11,35,1) zzip$ ="" merge "zMrgAdjustAddr" bill$ =zinfo$, cust_name$=zname$ # postnet zip$ =bill$ zbcol=12,zbrow=13,zshift=0 merge "zMrgZipPostnet" # ship to zname$ =get(12,13,30,1) zaddr$ =mget(12,14,30,3,"Y","Y") zcity$ =get(12,17,35,1) zzip$ ="" merge "zMrgAdjustAddr" ship$ =zinfo$, stname$=zname$ # postnet # zip$ =ship$ # zbcol=12,zbrow=20,zshift=0 # merge "zMrgZipPostnet" break case "whs-sds" # company info zname$ =get(68,7,40,1) zaddr$ =mget(68,8,30,3,"Y","Y") zcity$ =get(68,11,35,1) zzip$ ="" merge "zMrgAdjustAddr" comp_name$=zname$ comp_info$=zinfo$ # bill to zname$ =get(12,7,30,1) zaddr$ =mget(12,8,30,3,"Y","Y") zcity$ =get(12,11,35,1) zzip$ ="" merge "zMrgAdjustAddr" bill$ =zinfo$, cust_name$=zname$ # postnet zip$ =bill$ zbcol=2,zbrow=13,zshift=0 merge "zMrgZipPostnet" # ship to zname$ =get(12,13,30,1) zaddr$ =mget(12,14,30,3,"Y","Y") zcity$ =get(12,17,35,1) zzip$ ="" merge "zMrgAdjustAddr" ship$ =zinfo$, stname$=zname$ # postnet # zip$ =ship$ # zbcol=53,zbrow=13,zshift=0 # merge "zMrgZipPostnet" break case "bol-sds" # company info zname$ =get(63,8,40,1) zaddr$ =mget(63,9,30,3,"Y","Y") zcity$ =get(63,12,43,1) zzip$ ="" merge "zMrgAdjustAddr" comp_name$=zname$ comp_info$=zinfo$ # destination zname$ =get(15,8,30,1) zaddr$ =mget(15,9,30,3,"Y","Y") zcity$ =get(15,12,43,1) zzip$ ="" merge "zMrgAdjustAddr" dest$ =zinfo$, cust_name$=zname$ # postnet zip$ =dest$ zbcol=16,zbrow=15,zshift=0 merge "zMrgZipPostnet" break end switch # end zMrg load addr info [zMrg load comp info] # # old style # see zMrg load addr info for replacement # [zMrg load cust info] # # old style # see zMrg load addr info for replacement # [zMrgMultiPageXofY] # v8.0 # This merge rule set will determine the # of pages # for each document in the text stream, # and using a look ahead methodology # display Page X of Y on the row specified using # the font & justification specified # # copy the following global constant to the globals # area of the rule file, for the purpose of making the # font used standard for all rule sets, if it doesn't # already exist. Un-comment and adjust as needed. #global XOFYM_FONT="univers,10,bold,left" # copy the following code from feature comment to merge # command, to the bottom of the rule set being changed # Un-comment and adjust as needed. # ok to remove if not needed or already set # Page X of Y feature # change XOFYM_COPIES to "0" to turn off #local MAXCOLS =80 # adjust as needed #local MAXROWS =66 # adjust as needed #local XOFYM_COPIES="ALL" # or copy #'s to display #local XOFYM_FONT ="XOFYM_FONT" # use global or ??? # if not using justification, set XOFYM_DCOL to start col #local XOFYM_DCOL =10 #local XOFYM_DROW =MAXROWS+.5 # row to display title # location of unique doc id #local XOFYM_COL =70 # adjust as needed #local XOFYM_ROW =5 # adjust as needed #local XOFYM_NCOLS =10 # adjust as needed #merge "zMrgMultiPageXofY" prepage { # check ahead to see if same doc id lastpgdocid$=get(XOFYM_COL,XOFYM_ROW,XOFYM_NCOLS,"Y",pagenum-1) thispgdocid$=trim(get(XOFYM_COL,XOFYM_ROW,XOFYM_NCOLS)) nextpgdocid$=get(XOFYM_COL,XOFYM_ROW,XOFYM_NCOLS,"Y",pagenum+1) # only run when on the first page # of a new document in the stream if thispgdocid$<>"" and thispgdocid$<>lastpgdocid$ then: xofym_maxpgs=1 # reset total pages for doc xofym_pageno=0 # reset doc page counter checkpage=pagenum checknextpgdocid$=nextpgdocid$ while checknextpgdocid$=thispgdocid$ checkpage+=1,xofym_maxpgs+=1 checknextpgdocid$=get(XOFYM_COL,XOFYM_ROW,XOFYM_NCOLS,"Y",checkpage+1) wend endif # set page # xofym_pageno+=1 # find start col & # of cols from justification xofym_font$=lower("XOFYM_FONT") xofym_dcol=0 # left justification if pos("left"=xofym_font$) then : xofym_dcol=2,xofym_dcols=MAXCOLS endif # center justification if pos("center"=xofym_font$) then : xofym_dcol=1,xofym_dcols=MAXCOLS endif # right justification if pos("right"=xofym_font$) then : xofym_dcol=1,xofym_dcols=MAXCOLS-1 endif # no justification, use XOFY_DCOL if xofym_dcol=0 then xofym_dcol=XOFYM_DCOL if xofym_dcol=0 then xofym_dcol=1 # setup X of Y cmd xofym_cmd$ ="text "+str(xofym_dcol)+","+str(XOFYM_DROW)+"," xofym_cmd$+=quo+"Page "+str(xofym_pageno)+" of " xofym_cmd$+=str(xofym_maxpgs)+quo xofym_cmd$+=","+xofym_font$+",cols="+str(xofym_dcols) } precopy { if pos(str(copy)="XOFYM_COPIES") or "XOFYM_COPIES"="ALL" then : # display page x of y exec(xofym_cmd$) endif } # end zMrgMultiPageXofY [zMrgReportHdr] # # This merge rule set will enhance report # headers on the rows specified # using the fonts & justifications specified # this rule set will perform the following functions # 1. cut the hdr text into 3 sections (L,C,R) # per row using a preset delimiter # from the page # 2. optionally draw full pg box # 3. make room for the hdr # 4. draw hdr box # 5. allow the header sections to be shifted # to new locations (L,C,R); upto 5 rows # 6. replace hdr text using the font # and justification specified # copy the following code as designated by the # global start / end remarks # to the globals area of the rule file # and adjust/remove as needed # OR merge in the globals from BaseMrgGlobals rule set ### global start for zMrgReportHdr ## full page box thickness, 0=none #global RPTFULLTBOX="5" # box line thickness #global RPTHDRFONT="univers,11" # default rpt hdr font # fonts to apply to the left column of headers #global RPTL1FONT="RPTHDRFONT,left" # row 1 #global RPTL2FONT="RPTL1FONT,10" # row 2 #global RPTL3FONT="RPTL1FONT,9" # row 3 and rest # fonts to apply to the center column of headers #global RPTC1FONT="RPTHDRFONT,12,bold,center"# row 1 #global RPTC2FONT="RPTC1FONT,11" # row 2 #global RPTC3FONT="RPTC1FONT,10" # row 3 and rest # fonts to apply to right column of headers #global RPTR1FONT="RPTHDRFONT,right" # row 1 #global RPTR2FONT="RPTR1FONT,10" # row 2 #global RPTR3FONT="RPTR1FONT,9" # row 3 and rest # rpt hdr delimiter #global RPTHDRDLM=" " # hdr dlm ### global end for zMrgReportHdr # copy the following code as designated by the # local start / end remarks # to the bottom of the current rule set # and adjust/remove as needed ### local start for zMrgReportHdr #local MAXCOLS=80 # max # of cols in a row #local MAXROWS=66 # max # of rows on a page ## full page box thickness, 0=none #local RPTFULLTBOX="RPTFULLTBOX" # global or ??? #local RPTHDR_ROWS=4 # max # of hdr rows #local RPTL1FONT="RPTL1FONT" # global or ??? #local RPTL2FONT="RPTL2FONT" # global or ??? #local RPTL3FONT="RPTL3FONT" # global or ??? #local RPTC1FONT="RPTC1FONT" # global or ??? #local RPTC2FONT="RPTC2FONT" # global or ??? #local RPTC3FONT="RPTC3FONT" # global or ??? #local RPTR1FONT="RPTR1FONT" # global or ??? #local RPTR2FONT="RPTR2FONT" # global or ??? #local RPTR3FONT="RPTR3FONT" # global or ??? #local RPTHDRDLM=" " # global or ??? # move text, upto 5 rows JUSTROW TO ??? "JUSTROW" # setup all hdrs to be moved # below are some samples #local RPTL1TO="R1" #local RPTR1TO="R2" #local RPTL2TO="L1" #local RPTC3TO="L3" #local RPTC4TO="R3" #merge "zMrgReportHdr" ### local end for zMrgReportHdr prepage { ### 1. make room for full page box if RPTFULLTBOX then : # if text in column 1, shift right 1 col for row=1 to MAXROWS if get(1,row,1)<>" " then : exec("cmove 1,1,MAXCOLS,MAXROWS,2,1") break endif next row # if row 1 not blank, shift down if trim(text$[1])<>"" then : exec("cmove 1,1,MAXCOLS,MAXROWS,1,2") endif endif ### 2. draw full box if RPTFULLTBOX then : exec("cbox 1,1,MAXCOLS,MAXROWS,RPTFULLTBOX") endif ### cut hdr text sections dim xltext$[RPTHDR_ROWS],xctext$[RPTHDR_ROWS],xrtext$[RPTHDR_ROWS] hdrdlm$="RPTHDRDLM" if hdrdlm$<>"0" then : for hdrrow=1 to RPTHDR_ROWS # make sure line is MAXCOLS long hdrln$=pad(text$[hdrrow],MAXCOLS) hdr=pos(hdrdlm$=hdrln$,1) if hdr>1 then : xltext$[hdrrow]=trim(cut(1,hdrrow,hdr-1,"")) endif hdr=pos(hdrdlm$=hdrln$,-1) if hdr+len(hdrdlm$)"" then : exec("cmove 1,RPTHDR_ROWS+1,MAXCOLS,MAXROWS,1,RPTHDR_ROWS+2") endif ### draw box hdrbox$ ="cbox 1,1,MAXCOLS,"+str(RPTHDR_ROWS+1.25)+",5,30" exec(hdrbox$) if not(hdrdlm$="0") then : ### move text to new location dim ltext$[RPTHDR_ROWS],ctext$[RPTHDR_ROWS],rtext$[RPTHDR_ROWS] for hrow=1 to RPTHDR_ROWS # parse row constants switch hrow case 1 lhdrcol$=trim(left("RPTL1TO",1)) lhdrrow$=trim(right("RPTL1TO",1)) chdrcol$=trim(left("RPTC1TO",1)) chdrrow$=trim(right("RPTC1TO",1)) rhdrcol$=trim(left("RPTR1TO",1)) rhdrrow$=trim(right("RPTR1TO",1)) break case 2 lhdrcol$=trim(left("RPTL2TO",1)) lhdrrow$=trim(right("RPTL2TO",1)) chdrcol$=trim(left("RPTC2TO",1)) chdrrow$=trim(right("RPTC2TO",1)) rhdrcol$=trim(left("RPTR2TO",1)) rhdrrow$=trim(right("RPTR2TO",1)) break case 3 lhdrcol$=trim(left("RPTL3TO",1)) lhdrrow$=trim(right("RPTL3TO",1)) chdrcol$=trim(left("RPTC3TO",1)) chdrrow$=trim(right("RPTC3TO",1)) rhdrcol$=trim(left("RPTR3TO",1)) rhdrrow$=trim(right("RPTR3TO",1)) break case 4 lhdrcol$=trim(left("RPTL4TO",1)) lhdrrow$=trim(right("RPTL4TO",1)) chdrcol$=trim(left("RPTC4TO",1)) chdrrow$=trim(right("RPTC4TO",1)) rhdrcol$=trim(left("RPTR4TO",1)) rhdrrow$=trim(right("RPTR4TO",1)) break case 5 lhdrcol$=trim(left("RPTL5TO",1)) lhdrrow$=trim(right("RPTL5TO",1)) chdrcol$=trim(left("RPTC5TO",1)) chdrrow$=trim(right("RPTC5TO",1)) rhdrcol$=trim(left("RPTR5TO",1)) rhdrrow$=trim(right("RPTR5TO",1)) break end switch # shift left text as requested hdrrow=0,hdrrow=num(lhdrrow$,err=next) while trim(xltext$[hrow])>"" if not(hdrrow) and ltext$[hrow]="" then : ltext$[hrow]=xltext$[hrow] else switch lhdrcol$ case "L" ltext$[hdrrow]=xltext$[hrow] break case "C" ctext$[hdrrow]=xltext$[hrow] break case "R" rtext$[hdrrow]=xltext$[hrow] break default ltext$[hdrrow]=xltext$[hrow] end switch endif xltext$[hrow]="" wend # shift center text as requested hdrrow=0,hdrrow=num(chdrrow$,err=next) while trim(xctext$[hrow])>"" if not(hdrrow) and ctext$[hrow]="" then : ctext$[hrow]=xctext$[hrow] else switch chdrcol$ case "L" ltext$[hdrrow]=xctext$[hrow] break case "C" ctext$[hdrrow]=xctext$[hrow] break case "R" rtext$[hdrrow]=xctext$[hrow] break default ctext$[hdrrow]=xctext$[hrow] end switch endif xctext$[hrow]="" wend # shift right text as requested hdrrow=0,hdrrow=num(rhdrrow$,err=next) while trim(xrtext$[hrow])>"" if not(hdrrow) and rtext$[hrow]="" then : rtext$[hrow]=xrtext$[hrow] else switch rhdrcol$ case "L" ltext$[hdrrow]=xrtext$[hrow] break case "C" ctext$[hdrrow]=xrtext$[hrow] break case "R" rtext$[hdrrow]=xrtext$[hrow] break default rtext$[hdrrow]=xrtext$[hrow] end switch endif xrtext$[hrow]="" wend next hrow ### put text sections back # put left sections back hdrtxt$="" for hdrrow=1 to RPTHDR_ROWS if trim(ltext$[hdrrow])>"" then : if trim(hdrtxt$)<>"" then : hdrtxt$+=$0a$ endif hdrtxt$+="text 2,"+str(hdrrow+.75)+"," hdrtxt$+=$22$+ltext$[hdrrow]+$22$ switch hdrrow case 1 hdrtxt$+=",RPTL1FONT" break case 2 hdrtxt$+=",RPTL2FONT" break default hdrtxt$+=",RPTL3FONT" end switch endif next hdrrow exec(hdrtxt$) # put center sections back hdrtxt$="" for hdrrow=1 to RPTHDR_ROWS if trim(ctext$[hdrrow])>"" then : if trim(hdrtxt$)<>"" then : hdrtxt$+=$0a$ endif hdrtxt$+="text 1,"+str(hdrrow+.75)+"," hdrtxt$+=$22$+ctext$[hdrrow]+$22$ switch hdrrow case 1 hdrtxt$+=",RPTC1FONT" break case 2 hdrtxt$+=",RPTC2FONT" break default hdrtxt$+=",RPTC3FONT" end switch hdrtxt$+=",cols=MAXCOLS" endif next hdrrow exec(hdrtxt$) # put right sections back hdrtxt$="" for hdrrow=1 to RPTHDR_ROWS if trim(rtext$[hdrrow])>"" then : if trim(hdrtxt$)<>"" then : hdrtxt$+=$0a$ endif hdrtxt$+="text 1,"+str(hdrrow+.75)+"," hdrtxt$+=$22$+rtext$[hdrrow]+$22$ switch hdrrow case 1 hdrtxt$+=",RPTR1FONT" break case 2 hdrtxt$+=",RPTR2FONT" break default hdrtxt$+=",RPTR3FONT" end switch hdrtxt$+=",cols="+str(MAXCOLS-1) endif next hdrrow exec(hdrtxt$) endif } # end zMrgReportHdr [zMrgSinglePageXofY] # v8.0 # This merge rule set will use the internal variables # pagenum, for the current page # and # uf.maxpage, for the total # of pages # for this single document text stream and # display Page X of Y on the row specified using # the font & justification specified # copy the following global constant to the globals # area of the rule file, for the purpose of making the # font used standard for all rule sets, if it doesn't # already exist. Un-comment and adjust as needed. #global XOFYS_FONT="univers,10,bold,left" # copy the following code from feature comment to merge # command, to the bottom of the rule set being changed # Un-comment and adjust as needed. # ok to remove if not needed or already set # Page X of Y feature # change XOFYS_COPIES to "0" to turn off #local MAXCOLS =80 # adjust as needed #local MAXROWS =66 # adjust as needed #local XOFYS_COPIES="ALL" # or copy #'s to display #local XOFYS_FONT ="XOFYS_FONT" # use global or ??? # if not using justification, set XOFYS_DCOL to start col #local XOFYS_DCOL =10 #local XOFYS_DROW =MAXROWS+.5 # row to display title #merge "zMrgSinglePageXofY" prepage { # find start col & # of cols from justification xofy_font$=lower("XOFYS_FONT") xofy_dcol=0 # left justification if pos("left"=xofy_font$) then : xofy_dcol=2,xofy_dcols=MAXCOLS endif # center justification if pos("center"=xofy_font$) then : xofy_dcol=1,xofy_dcols=MAXCOLS endif # right justification if pos("right"=xofy_font$) then : xofy_dcol=1,xofy_dcols=MAXCOLS-1 endif # no justification, use XOFYS_DCOL if xofy_dcol=0 then xofy_dcol=XOFYS_DCOL if xofy_dcol=0 then xofy_dcol=1 # setup X of Y cmd xofy_cmd$ ="text "+str(xofy_dcol)+","+str(XOFYS_DROW)+"," xofy_cmd$+=quo+"Page "+str(pagenum)+" of " xofy_cmd$+=str(uf.maxpage)+quo xofy_cmd$+=","+xofy_font$+",cols="+str(xofy_dcols) } precopy { if pos(str(copy)="XOFYS_COPIES") or "XOFYS_COPIES"="ALL" then : # display page x of y exec(xofy_cmd$) endif } # end zMrgSinglePageXofY [zMrg watermark] # # the merge rule set will place # watermark at the specified location # # It should be merged into a code block after setting the # following variables and constants # # global WTRMRK="text" # global WTRMRK_SHD=10 # local MAXCOLS=### column width on page # zbrow = watermark row # ztext$ = watermark text # x$="WTRMRK 1,"+str(zbrow)+","+$22$+ztext$+$22$+",cgtimes,72,center,fit,cols=MAXCOLS,shade=WTRMRK_SHD exec(x$) # end zMrg watermark [zMrgZipPostnet] # # the merge rule set will locate a valid # zip code and place the Postnet barcode # # It should be merged into a code block after setting the # following variables # # zip$ =complete address # zshift =shift zip left or not (0 or 1) # zbcol =postnet column # zbrow =postnet row # split address if right(zip$,1)<>$0a$ then zip$=zip$+$0a$ zlf=pos($0a$=zip$) dim xzip$[1:zlf] for zln=1 to zlf xzip$[zln]=parse(zip$,zln,$0a$) next zln # now look in reverse order for zip code xzip$="" for zln=zlf to 1 step -1 ztext$=trim(xzip$[zln]) if ztext$="" then continue z=mask(ztext$,"[0-9][0-9][0-9][0-9][0-9]") if z>0 then : xzip$=mid(ztext$,z,20) break endif next zln # strip any characters after space z=pos(" "=xzip$) if z then xzip$=xzip$(1,z-1) # strip - xzip$=sub(xzip$,"-","") # print postnet code xziplen=len(xzip$) if zshift and xziplen>5 then zbcol=zbcol-5 if xziplen=5 or xziplen=9 or xziplen=11 then : x$="barcode "+str(zbcol)+","+str(zbrow)+","+$22$+xzip$+$22$+",900,12.0,2" exec(x$) endif # end zMrgZipPostnet