                    SUBROUTINE (MNFST,MANIFEST.NO,DRPT,PRT.ADDR,PRT.SHIP,PRT.SHP.TKTS,ERR.MESS,DOC.IDS,BAR.SIG)
** Version# 53.0004[52] - 12/14/2017 - 03:04pm - TSMITH - eclipse
*** V53.0004 Change - Custom Coding CUSTOM - 12/14/2017 - TSMITH - eclipse
** Copied from CBP SOE.MANIFEST.REPORT.BC Version# 53.0003 - 02/16/2017 - 10:53am - TSMITH - eclipse
*** V53.0003 Change - Custom Coding . - 02/16/2017 - TSMITH - eclipse
*** V53.0002 Change - Custom Coding . - 12/23/2014 - TSMITH - eclipse
*** V53.0001 Change - Custom Coding . - 02/18/2014 - TSMITH - eclipse

*** Subroutine: SOE.MANIFEST.REPORT.BC
*-------------------------------------------------------------------------*
*** This routine will print the Shipping Manifest Report with Bar Codes.
*** The barcode esc sequences will vary from site to site.  The Bar
*** sections that will need to be changed are marked with *** Barcode ***.
*** This routine will page break when there isn't enough room to print an
*** entire stop on one page.
*-------------------------------------------------------------------------*
*** MNFST - Manifest Controls                                       (IN)
***         MNFST<1>  = ship via
***         MNFST<2>  = ship date
***         MNFST<3>  = branch
***         MNFST<4>  = start time
***         MNFST<5>  = first delivery time
***         MNFST<6>  = delivery interval minutes
***         MNFST<7>  = closed flag
***         MNFST<8>  = dirver userid
***         MNFST<10> = stop info/override for stop
***         MNFST<11> = delivery time for stop #
***         MNFST<14> = time block list in order
***         MNFST<15> = value is stop # and subvalue is list of tickets
***                     on manifest for that stop
***         MNFST<16> = comments for ticket position matched with <5>
***
*** MANIFEST.NO - Manfest Number                                  (IN)
*** DRPT        -                                                 (IN)
*** PRT.ADDR    - Flag to Print Address                           (IN)
*** PRT.SHIP    - Flag to print shipping instructions             (IN)
*** PRT.SHP.TKTS- Flag to print ship tickets                      [IN]
*** ERR.MESS    - Error Message                                   (OUT)
*** DOC.IDS     - all document IDs that are printed               (OUT)
*-------------------------------------------------------------------------*

          GOSUB INIT

          TITLE = "Shipping Manifest ":MANIFEST.NO
          PRINTER.ON "MANIFEST.BC",TITLE,DOC.ID,,,RPT.DFLT=DRPT

          IF JAVA.PROC$ THEN
             JAVA.DOC.ID = FIELD(JAVA.PASSER$<JP.DOC.ID$>,'#',2)
             JAVA.FORM   = FIELD(JAVA.PASSER$<JP.FORM$>,'#',2)
             JAVA.DESC   = "Manifest ":MANIFEST.NO
             DOC.IDS<-1> = JAVA.DOC.ID:VM:JAVA.FORM:VM:JAVA.DESC
          END ELSE
             DOC.IDS<-1> = DOC.ID
          END

          GOSUB HEADER
          GOSUB DO.REPORT
          GOSUB CTRL.BC
          GOSUB FOOTER

          PRINTER.OFF
          IF PRT.SHP.TKTS THEN GOSUB PRT.SHIP
          SEND.MESSAGE 'Phantom',USER.ID,TITLE:' is Complete'

          RETURN
*-------------------------------------------------------------------------*
INIT:     * Initialize variables
          MED       = CHAR(27):'(8U'
          MED      := CHAR(27):'(s0p12h0s0b3T'
          ELPI      = CHAR(27):"&l8D"
          VIA       = MNFST<1>
          SHIP.DT   = MNFST<2>
          BR        = MNFST<3>
          STRT.TM   = MNFST<4>
          FDEL.TM   = MNFST<5>
          INTVL     = MNFST<6>
          DRIVER    = MNFST<8>
          LENGTH = ''

          PACK.TOTS = ""
          READV PRINT.PACKAGES FROM CTRBFILE, "PRINT.PACKAGES~":BR,1 ELSE PRINT.PACKAGES = ""

          TITLE = 'Shipping Manifest ':MANIFEST.NO
          PG.WIDTH = 96; WGT.TOT = 0; SIG.CNT = 0; HDG.STR = ''; PAGE= 0
          LINE.CT = 0; PRT.STR = '';LOD.TOT = 0 ; SPC = 0
          STP.ADR  = ''; BOD.LNS = 45; SIG.LN = '';OLD.STP = '@@@'

          SIG.LN<1> = STR('_',18):' ':'___/___/___'
          SIG.LN<2> = 'Signature':SPACE(14):'Date'
          SIG.LN<3> = STR('_',18):' ':'___________'
          SIG.LN<4> = 'Printed Name':SPACE(8):'# Items'

          RETURN
*-------------------------------------------------------------------------*
HEADER:   * Set up header lines and print them...
          PAGE +=1
          READV BR.CN FROM TERRFILE,BR,4 ELSE BR.CN = ''
          READV BNAME FROM TERRFILE,BR,3 ELSE BNAME = ''
          READV DRIVER.NAME FROM INIFILE,DRIVER,3 ELSE DRIVER.NAME = ''
          DRIVER.TXT = DRIVER:'  ':DRIVER.NAME

          READV PACKAGES FROM CTRLFILE,'PACKAGE.TYPES',1 ELSE PACKAGES = ''
          PKG.HDG = ''
          PKG.ID  = ''
          FOR P = 1 TO 4
          DATA = PACKAGES<1,P>
          IF DATA # '' THEN
             PKG.HDG := PACKAGES<1,P>"R#5":' '
             PKG.ID<-1> = P
             END
          NEXT P
          PKG.CT   = DCOUNT(PKG.ID,AM)

          HDG.STR<-1>= MED:'  ':MANIFEST.NO"L#10":SPACE(70):MANIFEST.NO
          CTR.CT  = INT(((35-LEN(BNAME))/2)+.5)
          CTR.CT += 29
          SPC = (96-(CTR.CT+LEN(BNAME)))

          HDG.STR<-1> = SPACE(CTR.CT):BNAME
          HDG.STR<-1> = 'BC.FLAG'
          HDG.STR<-1> = ' '
          HDG.STR<-1> = SPACE(29):'S H I P P I N G    M A N I F E S T'
          HDG.STR<-1> = ' '
          SPC = (44 - (LEN(VIA) + 10))/2
          HDG.STR<-1> = '   Manifest #: ':MANIFEST.NO"L#10":SPACE(SPC)
          HDG.STR    :='   Ship Via: ':VIA:SPACE(SPC):'Page ':PAGE
          HDG.STR<-1> = '   Verified by: _________________________'
          HDG.STR<-1> = '   Driver: ':DRIVER.TXT"L#34":SPACE(25)
          HDG.STR    :='Delivery Date: ':SHIP.DT"D4/"
          HDG.STR<-1> = ' '
          HDG.STR<-1> = 'Stop  Order #':SPACE(15):'Customer '
          HDG.STR    :='Information     Time         Signature Information'
          IF PRINT.PACKAGES THEN
             HDG.STR<-1> = SPACE(27):PKG.HDG
             HDG.CT = 13
          END ELSE
             HDG.CT = 12
          END
          HDG.STR<-1> = STR('=',PG.WIDTH)
*         HDG.STR<-1> = ' '
          FOR HH = 1 TO HDG.CT
             IF HDG.STR<HH>[1,7] = 'BC.FLAG' THEN
                PRINT CHAR(27):"*p1925x":
                PRINT CHAR(27):"*p125y":
                UT.PRINT.BARCODE ERR.CODE,'CODE128',125,100,6.7,MANIFEST.NO
             END ELSE
                PRINT HDG.STR<HH>
             END
          NEXT HH
          BOD.LNS = 45; HDG.STR = ''

          *If bar.sig is passed in as a blank, read for it now.
          IF UNASSIGNED(BAR.SIG) THEN BAR.SIG = ''
          IF BAR.SIG = '' THEN
             READV BAR.SIG FROM CTRLFILE,"SOE.MANIFEST.BARCODE",1 ELSE BAR.SIG = "One per Order"
          END

          RETURN
*-------------------------------------------------------------------------*
DO.REPORT:*** Build our print stings for each stop, then go to PRT.STP to
          *** determine if there's enough room left on the page to print
          *** the entire stop on one page...
          BLK.CT  = DCOUNT(MNFST<14>,VM)
          BLK.FRM = MNFST<14,1,1>
          BLK.NO  = 1

          ST.CT   = DCOUNT(MNFST<15>,VM)
          FOR STP = 1 TO ST.CT
             DEL.TM  = MNFST<11,STP>
BLK.LP:   *  For Time blocks
             IF BLK.NO <= BLK.CT AND DEL.TM > BLK.FRM THEN
                GOSUB DISP.BLK
                GOTO BLK.LP
             END
             IDS   = MNFST<15,STP>
             CMNTS = MNFST<16,STP>
             PKGS  = RAISE(RAISE(MNFST<42,STP>))
             TK.CT = DCOUNT(IDS,SVM)
             *** Go thru each ticket for this Stop gathering all our info..
             FOR TK = 1 TO TK.CT
                TICKET.ID = IDS<1,1,TK>
                CMNT      = RAISE(RAISE(CMNTS<1,1,TK>))
                OID       = FIELD(TICKET.ID,'.',1)
                INVN      = FIELD(TICKET.ID,'.',2)
                ERR.ENTRY = ''
                MATREAD LED FROM LEDFILE,OID ELSE GOTO DISP.NEXT.TKT
                IF LEN(INVN) = 3 THEN
                   LOCATE INVN+0 IN LED(8)<1> SETTING GEN ELSE GOTO DISP.NEXT.TKT
                END ELSE
                   TICKET.ID = OID
                   LOCATE INVN+0 IN LED(12)<1> SETTING GEN ELSE GOTO DISP.NEXT.TKT
                END

                *** We used to allow for skipping over the address portion
                *** if the Stop didn't change, but that was 'over ruled'
                *** but the logic is still here should the overruling get
                *** over ruled again...
                READV CNAME FROM CUSFILE,LED(5)<1,GEN>,1 ELSE CNAME = LED(5)<1,GEN>

                IF STP # OLD.STP OR (BAR.SIG = "One per Order") THEN
                   PRT.STR<-1>  = 'BC.FLAG~':TICKET.ID
                END ELSE
                   PRT.STR<-1> = SPACE(23)
                END

                P.STP = STP:'.'
                PRT.STR<-1> = P.STP                    "L#28"
                PRT.STR    := CNAME                    "L#25"
                PRT.STR    := OCONV(DEL.TM,'MTH')      "L#7"
                PRT.STR    := ' ':TIME.ZONE$'L#3'
                IF STP # OLD.STP OR (BAR.SIG = "One per Order") THEN
                   PRT.STR := SPACE(2):SIG.LN<1>       "L#32"
                END
                *** Get our address and sig lines in the right spot...
                ADDR       = RAISE(LED(78)<1,GEN>)
                ADDR<1,3> := ' ':LED(75)<1,GEN>
                ADDR = TRIM(FIELD(ADDR,VM,1,3),VM)
                ADDR.CT = DCOUNT(ADDR,VM)
                FOR J = 1 TO 4
                   ADDR<1,J> = TRIM(ADDR<1,J>)
                   IF ADDR<1,J> = '' THEN ADDR<1,J> = SPACE(62)
                   IF J = 1 THEN
                      PRT.STR<-1> = SPACE(6):TICKET.ID    "L#20":'  '
                      PRT.STR := ADDR<1,J>       "L#29":'  '
                      IF STP # OLD.STP OR (BAR.SIG = "One per Order") THEN
                         PRT.STR := SPACE(7):SIG.LN<J+1>    "L#36"
                      END
                   END ELSE
                      PRT.STR<-1> = SPACE(28):ADDR<1,J>   "L#30"
                      IF STP # OLD.STP OR (BAR.SIG = "One per Order") THEN
                         PRT.STR := SPACE(8):SIG.LN<J+1>
                      END
                   END
                NEXT J

                *** Activate our CUS and CUSS arrays...
                PRC.BR = LED(2)<1,GEN,1>
                BT.CN  = LED(1)<1,GEN>
                ST.CN  = LED(5)<1,GEN>
                OE.GET.QSIGN QSIGN,OID,GEN
                GET.CUS BR,BT.CN,ST.CN,QSIGN

                *** See if the Order is flagged for COD...
                SOE.CREDIT.CHECK ST.CN,,COD,,,,,OID,GEN,
                IF COD THEN
                   READV COD.MSG FROM CTRLFILE,'MANIFEST.COD.MSG',1 ELSE COD.MSG = ''
                   IF COD.MSG THEN
                      COD.CT = DCOUNT(COD.MSG, VM)
                      PRT.STR<-1> = SPACE(5):STR('!',32)
                      FOR CC = 1 TO COD.CT
                         PRT.STR<-1>= SPACE(5):"!":COD.MSG<1,CC> "L#30":"!"
                      NEXT CC
                      GOSUB GET.COD.TOTAL
                      COD.TOTAL.MSG = "COD Order Total : ":OCONV(COD.TOTAL,'MR2')
                      PRT.STR<-1> = SPACE(5):"!":COD.TOTAL.MSG"L#30":"!"
                      PRT.STR<-1> = SPACE(5):STR('!',32)
                   END
                END

                *** Get the weight and load totals...
                MATREAD LED FROM LEDFILE,OID ELSE MAT LED = ''
                OE.GET.WEIGHT OID,GEN,TOL.PCS,TOL.WGHT,TOL.LOAD
                WGT.TOT += TOL.WGHT
                LOD.TOT += TOL.LOAD
                *** Print Package quantities...
                READ LEDL FROM LEDLFILE,OID ELSE LEDL = ''
                STG.LOC= LEDL<22,GEN>
                IF PRINT.PACKAGES THEN
                   PACK.QTY = ""
                   PRT.STR<-1> = SPACE(10):"Loc: ":STG.LOC "L#12"
                   FOR P = 1 TO PKG.CT
                      PACK.QTY<P> += LEDL<18,GEN,P>
                   NEXT P

                   FOR YY = 1 TO PKG.CT
                      IF PACK.QTY<YY> = 0 THEN PACK.QTY<YY> = ""
                      PRT.STR := PACK.QTY<YY> "R#5":' '
                      PACK.TOTS<YY> += PACK.QTY<YY>
                   NEXT YY
                END

                *** Shipping instructions if flagged...
                IF PRT.SHIP AND LED(74)<1,GEN> THEN
                   PRT.STR<-1> = SPACE(5):STR('*',35):' ':'Shipping Instructions'
                   PRT.STR := STR('*',35)
                   SHP.INSTR = LED(74)<1,GEN>
                   CONVERT SVM TO VM IN SHP.INSTR
                   FOLD.STRING SHP.INSTR,87,SHP.INST,VCT
                   SHIP.LNS = DCOUNT(SHP.INST,VM)

                   FOR K = 1 TO SHIP.LNS
                      PRT.STR<-1>= SPACE(5):'* ':SHP.INST<1,K> "L#87":' *'
                   NEXT K

                   PRT.STR<-1> = SPACE(5):STR('*',91)
                END

*** Pipe List Mod Code

OE.GET.LDID.LIST LDID.LIST,OID,GEN
LDID.CT = DCOUNT(LDID.LIST,VM)

FOR LDID.CTR = 1 TO LDID.CT
LDID = LDID.LIST<1,LDID.CTR>
LD.GET LDID
PN = LD(1)<1,GEN>
PIPE.LENGTH = TRANS('PRODUCT.GPS',PN,16,'X')
IF PIPE.LENGTH = "" THEN GOTO SKIP.LD
IF SUM(LD(5)<1,GEN>)+SUM(LD(6)<1,GEN>) = 0 THEN GOTO SKIP.LD
DESC = TRANS('PRODUCT',PN,1,'X')
SHIP.QTY = LD(5)<1,GEN>+LD(6)<1,GEN>
PIECES = (SHIP.QTY/PIPE.LENGTH)*-1


**REMINDER CODE**
NORM.BOLD  = CHAR(27):'(8U'
NORM.BOLD := CHAR(27):'(s0p10h12v0s1b3T'
NORM       = CHAR(27):'(8U'
NORM      := CHAR(27):'(s0p10h12v0s0b3T'
REMIND = TRANS('PRODUCT.GPS',PN,15,'X')
BOLDED.REMINDER = NORM.BOLD:REMIND:MED
LOCATE REMIND IN DESC SETTING REMINDER ELSE REMINDER = ''
MOD.DESC  = EREPLACE (DESC,REMIND,'^')
DESC1     = MED:FIELD(MOD.DESC,'^',1)
DESC2     = BOLDED.REMINDER
DESC3     = FIELD(MOD.DESC,'^',2)
DESC = DESC1:DESC2:DESC3

CHAR.CT   = DCOUNT(MOD.DESC,'^')
IF CHAR.CT=2 THEN
DESC = EREPLACE (DESC,REMIND,BOLDED.REMINDER)
END
**END REMINDER CODE**

CONVERT SVM TO " " IN DESC

LENGTH<-1> = SPACE(5):MED:PIECES"L#3":' pcs - ':MED:DESC:' (.':PN:') for ':TICKET.ID

SKIP.LD:  NEXT LDID
*** End Pipe List Mod Code


                *** Manifest comments...
                CMNT.CT = DCOUNT(CMNT,VM)
                FOR L = 1 TO CMNT.CT
                   PRT.STR<-1> = SPACE(15):CMNT<1,L>
                NEXT L
                PRT.STR<-1> = ' '
DISP.NEXT.TKT: *** Move on to the next ticket...
                OLD.STP = STP
             NEXT TK
DISP.NEXT.STP: *** Move on to the next stop...
             GOSUB PRT.STP
          NEXT STP

          FOR L = BLK.NO TO BLK.CT
             GOSUB DISP.BLK
             GOSUB PRT.STP
          NEXT L

          RETURN
*-------------------------------------------------------------------------*
*** Force a page break
FORCE.PAGE.BREAK:*
          GOSUB CTRL.BC
          PRINT CHAR(12)
          GOSUB HEADER
          LINE.CT = 0
          RETURN
*-------------------------------------------------------------------------*
PRT.STP:  *** Print out our stop checking to see if there is enough room
          *** to print the entire stop. If there isn't enough room then we
          *** page break, reset counters and start printing.
          *** If STP = 1 then we don't want to page break even if it's
          *** larger than the avail space, we only want to break when
          *** we've reached the body limit for stop 1.
          STR.CNT = DCOUNT(PRT.STR,AM)
          * If the entire stop will not fit on the remainder of the page
          * go to the next page (unless we are already at the top of the
          * page)
          IF STR.CNT>BOD.LNS AND LINE.CT > 0 THEN
             GOSUB FORCE.PAGE.BREAK
          END
          FOR JJ = 1 TO STR.CNT
             * If the next line will not fit on this page, go to the next
             IF LINE.CT >= BOD.LNS THEN
                GOSUB FORCE.PAGE.BREAK
             END
             IF PRT.STR<JJ>[1,7] = 'BC.FLAG' THEN
                * The entire signature block must appear on the same page
                * as the barcode, make sure that there is enough room
                IF LINE.CT+5 > BOD.LNS THEN
                   GOSUB FORCE.PAGE.BREAK
                END
                TICK.ID = FIELD(PRT.STR<JJ>,'~',2)
                PRINT SPACE(5):
                UT.PRINT.BARCODE ERR.CODE,'CODE128',125,100,6.7,TICK.ID
                PRINT ' '
                SIG.CNT +=1
             END ELSE
                PRINT PRT.STR<JJ>
             END
             LINE.CT += 1
          NEXT JJ
          PRT.STR = ''

          RETURN
*-------------------------------------------------------------------------*
PRT.SHIP: * Loop through all the orders and print Ship tickets.
          ST.CT   = DCOUNT(MNFST<15>,VM)
          FOR STP = 1 TO ST.CT
             IDS         = MNFST<15,STP>
             TK.CT       = DCOUNT(IDS,SVM)
             FOR TK = 1 TO TK.CT
                TICKET.ID   = IDS<1,1,TK>
                OID         = FIELD(TICKET.ID,'.',1)
                INVN        = FIELD(TICKET.ID,'.',2)
                MATREAD LED FROM LEDFILE,OID ELSE GOTO NXT.TKT
                IF LEN(INVN) = 3 THEN
                   LOCATE INVN+0 IN LED(8)<1> SETTING GEN ELSE GOTO NXT.TKT
                END ELSE
                   LOCATE INVN+0 IN LED(12)<1> SETTING GEN ELSE GOTO NXT.TKT
                END
                MODE = OID[1,1]
                BEGIN CASE
                CASE MODE = 'T'
                   JAVA.DESC   = "Transfer ":OID
                   TOE.PRINT.ORDER OID,GEN,,'O'
                CASE MODE = 'P'
                   PRINT.HAZMAT = YES
                   JAVA.DESC   = "Purchase Order ":OID
                   POE.PRINT.ORDER OID,GEN,,'O',,,PRINT.HAZMAT
                CASE OTHERWISE
                   JAVA.DESC   = "Sales Order ":OID
                   SOE.PRINT.ORDER OID,GEN,,'O'
                END CASE

                IF JAVA.PROC$ THEN
                   JAVA.DOC.ID = FIELD(JAVA.PASSER$<JP.DOC.ID$>,'#',2)
                   JAVA.FORM   = FIELD(JAVA.PASSER$<JP.FORM$>,'#',2)
                   DOC.IDS<-1> = JAVA.DOC.ID:VM:JAVA.FORM:VM:JAVA.DESC
                END

                * Print 'Yard Ticket'
                SOE.PRINT.YARD OID,GEN,,'T'
                IF JAVA.PROC$ THEN
                   YARD.DOC.ID = FIELD(JAVA.PASSER$<JP.DOC.ID$>,'#',2)
                   * If a Yard Ticket printed, then we should have a new
                   * Doc ID in Java Passer
                   IF YARD.DOC.ID # JAVA.DOC.ID THEN
                      JAVA.FORM   = FIELD(JAVA.PASSER$<JP.FORM$>,'#',2)
                      JAVA.DESC   = "Yard Ticket ":OID
                      DOC.IDS<-1> = YARD.DOC.ID:VM:JAVA.FORM:VM:JAVA.DESC
                   END
                END

NXT.TKT:     NEXT TK
          NEXT STP

          RETURN
*-------------------------------------------------------------------------*
DISP.BLK: *  display block out record
          PRT.STR<-1> = '     ***** TIME BLOCKED - '
          PRT.STR := MNFST<14,BLK.NO,3>      "L#35"
          PRT.STR<-1>= SPACE(26):OCONV(BLK.FRM,'MTH') "L#7":' thru '
          PRT.STR := OCONV(MNFST<14,BLK.NO,2>,'MTH') "L#7"
          PRT.STR := ' ':TIME.ZONE$'L#3'
          PRT.STR<-1> = ' '
          PRT.STR<-1> = ' '
          BLK.NO += 1
          BLK.FRM = MNFST<14,BLK.NO,1>

          RETURN
*-------------------------------------------------------------------------*
GET.COD.TOTAL: * Calculate the amount due for COD Orders...

          OE.ORDER.TOTAL OID,GEN,QSIGN,TOTAL,SUB.TOL,FGHT,HNDL,TAX.TOL
          SOE.CALC.CASH OID,GEN,ORIG.AMT.DUE,AMT.PAID,CASH.DISC

          * Get WOE.DISC
          SOE.CALC.DISC OID,GEN,,,WOE.DISC
          CASH.DISC += WOE.DISC

          IF AMT.PAID THEN
             AR.ID = OID:'.':LED(8)<1,GEN>"R%3"
             READ ARREC2 FROM ARFILE,AR.ID ELSE ARREC2 = ''
             CASH.DISC.PAID = ASUB.GET.AMT(ARREC2,,,GL.AUTO.DISCG)
             IF CASH.DISC.PAID > 0 THEN AMT.PAID += CASH.DISC.PAID
          END

          * Get the Federal Excise Tax...
          FET.MODE = 'S'
          OE.CALC.FET.AMT FET.MODE,OID,GEN,QSIGN,FET

          * Calculate the amount due for this COD order...
          COD.TOTAL = SUB.TOL+FGHT+HNDL+TAX.TOL+AMT.PAID+CASH.DISC+FET
          IF COD.TOTAL = CASH.DISC THEN COD.TOTAL = 0

          RETURN
*-------------------------------------------------------------------------*
CTRL.BC:  * Print control Bar Code (count of signatures on the page)

          CONTROL.TXT = 'CONTROL':SIG.CNT
          PRINT
          PRINT SPACE(5):
          UT.PRINT.BARCODE ERR.CODE,'CODE128',125,100,6.7,CONTROL.TXT
          SIG.CNT = 0
          RETURN
*-------------------------------------------------------------------------*
FOOTER:   * Print Weight and Load totals

          PRT.STR<1> =  ' '; PRT.STR<2> =  ' '
          IF PRINT.PACKAGES THEN
             PRT.STR<3> = SPACE(27)
             FOR XX = 1 TO PKG.CT
                PRT.STR := '----- '
             NEXT XX
             FTR.NO = 4
          END ELSE
             FTR.NO = 3
          END
          PRT.STR<FTR.NO> = '      Totals:':SPACE(14)
          IF PRINT.PACKAGES THEN
             FOR XX = 1 TO PKG.CT
                PRT.STR := PACK.TOTS<XX> "R#5 "
             NEXT XX
             PRT.STR := "  "
          END
          PRT.STR := 'Weight: ':OCONV(WGT.TOT, 'MR2':PRD.WGHT$)
          PRT.STR := '  Load: ':OCONV(LOD.TOT, 'MR4')
          PRINT PRT.STR<1>
          PRINT PRT.STR<2>
          PRINT PRT.STR<3>
          IF PRINT.PACKAGES THEN
             PRINT PRT.STR<4>
          END

          PRINT CHAR(12)
          PAGE +=1
          PL.STR = ''
          PL.STR<-1>= MED:'  ':MANIFEST.NO"L#10":SPACE(70):MANIFEST.NO
          CTR.CT  = INT(((35-LEN(BNAME))/2)+.5)
          CTR.CT += 29
          SPC = (96-(CTR.CT+LEN(BNAME)))

          PL.STR<-1> = SPACE(CTR.CT):BNAME
          PL.STR<-1> = 'BC.FLAG'
          PL.STR<-1> = ' '
          PL.STR<-1> = SPACE(29):'S H I P P I N G    M A N I F E S T'
          PL.STR<-1> = ' '
          SPC = (44 - (LEN(VIA) + 10))/2
          PL.STR<-1> = '   Manifest #: ':MANIFEST.NO"L#10":SPACE(SPC)
          PL.STR    :='   Ship Via: ':VIA:SPACE(SPC):'Page ':PAGE
          PL.STR<-1> = '   Verified by: _________________________'
          PL.STR<-1> = '   Driver: ':DRIVER.TXT"L#34":SPACE(25)
          PL.STR    :='Delivery Date: ':SHIP.DT"D4/"
          PL.STR<-1> = ' '
          PL.STR<-1> = STR('=',PG.WIDTH)
          PL.CT = 12
          FOR HH = 1 TO PL.CT
             IF PL.STR<HH>[1,7] = 'BC.FLAG' THEN
                PRINT CHAR(27):"*p1925x":
                PRINT CHAR(27):"*p125y":
                UT.PRINT.BARCODE ERR.CODE,'CODE128',125,100,6.7,MANIFEST.NO
             END ELSE
                PRINT PL.STR<HH>
             END
          NEXT HH
          PRINT
          PRINT SPACE(41):NORM.BOLD:'PIPE  LIST':MED
          PRINT

          DCT = DCOUNT(LENGTH,AM)
          FOR J = 1 TO DCT

          PRINT LENGTH<J>
          NEXT J

          RETURN

*-------------------------------------------------------------------------*
!TSMITH~12/14/17~15:04
