          SUBROUTINE (MNFST,MANIFEST.ID,ERR.MESS)
** Version# 36.0002[1] - 05/23/2014 - 12:18pm - TSMITH - eclipse
*** V36.0001 Change - Custom Coding . - 02/18/2014 - TSMITH - eclipse

*** Subroutine - SOE.MANIFEST.RPTS
*-------------------------------------------------------------------------*
*** This routine is responsible for prompting the user to select a type of
*** manifest to print. Once selected, this routine will kick off the
*** proper printing routine, or call Eclipse Forms.
*-------------------------------------------------------------------------*
*** MNFST       - The manifest record for the manifest that is going  [IN]
***             - to be printed.
*** MANIFEST.ID - The ID of the manifest record in the MANIFESTS      [IN]
***             - file.
*** ERR.MESS    - Any errors that are encountered within this         (OUT)
***             - routine.
*-------------------------------------------------------------------------*

          GOSUB INIT

          SCREEN

          DISP.TBL = ''
          DISP.TBL<1, 1> = 'Full Manifest w/ BC & Ship Tickets'
          DISP.TBL<2, 1> = 'SOE.MANIFEST.REPORT.BC'
          DISP.TBL<1, 2> = 'Full Manifest & Ship Tickets'
          DISP.TBL<2, 2> = 'SOE.MANIFEST.REPORT'
          DISP.TBL<1, 3> = 'Full Manifest'
          DISP.TBL<2, 3> = 'SOE.MANIFEST.REPORT'
          DISP.TBL<1, 4> = 'Full Manifest w/ BC'
          DISP.TBL<2, 4> = 'SOE.MANIFEST.REPORT.BC'
          DISP.TBL<1, 5> = 'Pre-load Manifest Report'
          DISP.TBL<2, 5> = 'SOE.MANIFEST.RPT.PRELOAD'
          DISP.TBL<1, 6> = 'Palm Pilot EManifest Download'
          DISP.TBL<2, 6> = 'PP.EMANIFEST.DOWNLOAD'
          DISP.TBL<1, 7> = 'Full Manifest Report w/ BC & Ship Tickets'
          DISP.TBL<2, 7> = 'SOE.MANIFEST.TRUE.RPT.BC'
          DISP.TBL<1, 8> = 'Full Manifest Report & Ship Tickets'
          DISP.TBL<2, 8> = 'SOE.MANIFEST.TRUE.RPT'
          DISP.TBL<1, 9> = 'Full Manifest Report'
          DISP.TBL<2, 9> = 'SOE.MANIFEST.TRUE.RPT'
          DISP.TBL<1,10> = 'Full Manifest Report w/ BC'
          DISP.TBL<2,10> = 'SOE.MANIFEST.TRUE.RPT.BC'

          * Do not allow access to barcode manifests if not auth for sig
          * crop
          UT.SEC3 36,AUTH.OK,,NO
          IF NOT(AUTH.OK) THEN
             DISP.TBL = DELETE(DISP.TBL,1,10)
             DISP.TBL = DELETE(DISP.TBL,2,10)
             DISP.TBL = DELETE(DISP.TBL,1, 7)
             DISP.TBL = DELETE(DISP.TBL,2, 7)

             * Do not include Pre-Load option for Eclipse Forms.
             IF USE.ECLIPSE.FORMS$ THEN
                DISP.TBL = DELETE(DISP.TBL,1,5)
                DISP.TBL = DELETE(DISP.TBL,2,5)
             END

          *   DISP.TBL = DELETE(DISP.TBL,1, 4)
          *   DISP.TBL = DELETE(DISP.TBL,2, 4)
          *   DISP.TBL = DELETE(DISP.TBL,1, 1)
          *   DISP.TBL = DELETE(DISP.TBL,2, 1)
          END ELSE
             * Do not include Pre-Load option for Eclipse Forms.
             IF USE.ECLIPSE.FORMS$ THEN
                DISP.TBL = DELETE(DISP.TBL,1,5)
                DISP.TBL = DELETE(DISP.TBL,2,5)
             END
          END

          READV DFLT.TYP FROM CTRLFILE,"DFLT.MNFST.REPORT.TYPE",1 ELSE DFLT.TYP=DISP.TBL<1,1>
          LOCATE DFLT.TYP IN DISP.TBL<1> SETTING POS THEN
             SEL = DISP.TBL<1,POS>
          END ELSE
             SEL = DISP.TBL<1,1>
          END

          DRPT     = ''
          ERR.MESS = ''
          BAR.SIG  = ''
          PRT.ADDR = YES
          IF INDEX(SEL,'Ship Tickets',1) THEN
             PRT.SHP.TKTS = YES
          END ELSE
             PRT.SHP.TKTS = NO
          END
          *** Determine, by control setting what the default for printing
          *** the shipping instructions should be.
          READV PRT.SHIP FROM CTRLFILE,"DFLT.MNFST.INST",1 ELSE PRT.SHIP=NO

          PRINT @(17,1):SEL "L#45"
          PRINT @(17,2):'Y'
          PRINT @(31,3):YN[(PRT.SHIP+1),1]

          MENU.LOAD  2,5,5,1,'P'
          MENU.LOAD 10,5,4,1,'H'

          GOTO IN.SEL
*-------------------------------------------------------------------------*
IN.SEL:   INP SEL,17,1,45,V_'D:':DISP.TBL<1>

          IF SEL = 'Palm Pilot EManifest Download' THEN
             GOSUB DISABLE.HOLD
          END ELSE
             GOSUB ENABLE.HOLD
          END

          IF QUIT AND NOT(F12) THEN PRINT BELL:; GOTO IN.SEL ELSE
             IF QUIT AND F12 THEN GOTO FINISH
          END
          IF INDEX(SEL,'Ship Tickets',1) THEN
             PRT.SHP.TKTS = YES
          END ELSE
             PRT.SHP.TKTS = NO
          END
          IF INDEX(SEL,'BC',1) THEN
             PRT.ADDR = YES
             PRINT @(17,2):'Y'
             ON MOVE+1 GOTO IN.SEL,IN.SEL,IN.SEL,IN.SEL,IN.SHIP,IN.SHIP
          END ELSE
             ON MOVE+1 GOTO IN.SEL,IN.SEL,IN.SEL,IN.SEL,IN.ADDR,IN.ADDR
          END
*-------------------------------------------------------------------------*
IN.ADDR:  INP PRT.ADDR,17,2,1,'YN'
          IF QUIT AND NOT(F12) THEN PRINT BELL:; GOTO IN.ADDR ELSE
             IF QUIT AND F12 THEN GOTO FINISH
          END
          ON MOVE+1 GOTO IN.ADDR,IN.ADDR,IN.SEL,IN.ADDR,IN.SHIP,IN.SHIP
*-------------------------------------------------------------------------*
IN.SHIP:  INP PRT.SHIP,31,3,1,'YN'
          IF QUIT AND NOT(F12) THEN PRINT BELL:; GOTO IN.SHIP ELSE
             IF QUIT AND F12 THEN GOTO FINISH
          END
          IF INDEX(SEL,'BC',1) THEN
             ON MOVE+1 GOTO IN.SHIP,IN.SHIP,IN.SEL,IN.SHIP,IN.SHIP,IN.SHIP
          END ELSE
             ON MOVE+1 GOTO IN.SHIP,IN.SHIP,IN.ADDR,IN.SHIP,IN.SHIP,IN.SHIP
          END
*-------------------------------------------------------------------------*
SUBS:     ON OPTION GOTO PRT.IT,HOLD.IT
*-------------------------------------------------------------------------*
DISABLE.HOLD:*
          MENU.CLEAR
          MENU.LOAD  2,5,5,1,'P'
          MENU.LOAD ,,,,
          RETURN
*-------------------------------------------------------------------------*
ENABLE.HOLD:*
          MENU.CLEAR
          MENU.LOAD  2,5,5,1,'P'
          MENU.LOAD 10,5,4,1,'H'
          RETURN
*-------------------------------------------------------------------------*
HOLD.IT:  *
          IF SEL='' THEN PRINT BELL:; RETURN TO IN.SEL
          DRPT<27> = 'HOLD'
          IS.HOLD  = YES
          GOTO PRT.IT
*-------------------------------------------------------------------------*
PRT.IT:   *
          IF SEL='' THEN PRINT BELL:; RETURN TO IN.SEL

          IF F12 THEN RETURN
          LOCATE SEL IN DISP.TBL<1> SETTING POS ELSE RETURN
          SUBR = DISP.TBL<2,POS>
          DRPT<1> = SEL
          DOC.ID = ''

          * Determine what routine is going to be called.
          BEGIN CASE

          * Call the E-Manifest Download Routine.
          CASE SUBR = "PP.EMANIFEST.DOWNLOAD"
             CALL @SUBR(MNFST,MANIFEST.ID,DRPT,PRT.ADDR,ERR.MESS)

          * If Eclipse Forms (DFG) are enabled, then call the program
          * that will build/send the XML. It doesn't matter which option
          * the user selects. MANIFEST.DELIVER will take care of it.
          CASE USE.ECLIPSE.FORMS$ AND NOT(IS.HOLD)
             MANIFEST.DELIVER MANIFEST.ID,SUBR,PRT.ADDR,PRT.SHIP,PRT.SHP.TKTS

          * Manifest Report with Barcodes...
          CASE SUBR = 'SOE.MANIFEST.REPORT.BC'
             *** Find what kind of barcode printing to perform
             READV BAR.SIG FROM CTRLFILE,"SOE.MANIFEST.BARCODE",1 ELSE BAR.SIG = "One per Order"
             PRT.SHP.TKTS.COPY = NO
             CALL @SUBR(MNFST,MANIFEST.ID,DRPT,PRT.ADDR,PRT.SHIP,PRT.SHP.TKTS.COPY,ERR.MESS,DOC.ID,BAR.SIG)
             CALL @SUBR(MNFST,MANIFEST.ID,DRPT,PRT.ADDR,PRT.SHIP,PRT.SHP.TKTS,ERR.MESS,DOC.ID,BAR.SIG)

          * Manifest Report without Barcodes...
          CASE SUBR = 'SOE.MANIFEST.REPORT'
             CALL @SUBR(MNFST,MANIFEST.ID,DRPT,PRT.ADDR,PRT.SHIP,PRT.SHP.TKTS,ERR.MESS,DOC.ID)

          * Manifest Form with Barcodes...
          CASE SUBR = 'SOE.MANIFEST.TRUE.RPT.BC'
             *** Find what kind of barcode printing to perform
             READV BAR.SIG FROM CTRLFILE,"SOE.MANIFEST.BARCODE",1 ELSE BAR.SIG = "One per Order"
             CALL @SUBR(MNFST,MANIFEST.ID,DRPT,PRT.ADDR,PRT.SHIP,PRT.SHP.TKTS,ERR.MESS,DOC.ID,BAR.SIG)

          * Manifest Form without Barcodes...
          CASE SUBR = 'SOE.MANIFEST.TRUE.RPT'
             CALL @SUBR(MNFST,MANIFEST.ID,DRPT,PRT.ADDR,PRT.SHIP,PRT.SHP.TKTS,ERR.MESS,DOC.ID)

          * For any other routine, call it directly.
          CASE OTHERWISE
             CALL @SUBR(MNFST,MANIFEST.ID,DRPT,PRT.ADDR,ERR.MESS)

          END CASE

          RETURN TO FINISH
*-------------------------------------------------------------------------*
INIT:     *** Initialize variables / settings
          IS.HOLD = NO
          RETURN
*-------------------------------------------------------------------------*
FINISH:   *
          WINDOW.CLOSE
          RETURN
*-------------------------------------------------------------------------*
!TSMITH~05/23/14~12:18
