          SUBROUTINE (INIT.OID,GEN,INIT.STATUS,PSTYLE.OVRD,VIEW.ONLY,DO.OPEN.TOTALS)
** Version# 141.0002[4] - 04/04/2013 - 03:57pm - TSMITH - eclipse
*** V141.0002 Change - Custom Coding . - 04/04/2013 - TSMITH - eclipse
*** V141.0001 Change - Add FULL Ver 143 - 10/15/2012 - ANNEM - r8.6emr

*** Subroutine: OE.PRINT.OPTS
*-------------------------------------------------------------------------*
*** This program allows the User to print a document for an Order.
*-------------------------------------------------------------------------*
*** INIT.OID    - Order ID                                           [IN]
*** GEN         - GEN (value posting for this generation             [IN]
*** INIT.STATUS - INIT.STATUS Status of the order, can be            [IN]
***               changed for selecting of Document Type             [IN]
*** PSTYLE.OVRD - Print Styles ID which determines the format        (IN)
***               and output of the document.
*** VIEW.ONLY   - View Only Flag                                     (IN)
*** DO.OPEN.TOTALS
***             - OID, GEN, etc. (see CC OE.EQUATES)                 (IN)
*-------------------------------------------------------------------------*
*** COMMON VARIABLES: LED
*-------------------------------------------------------------------------*
          SCREEN

          PTR.BR = LED(2)<1,GEN,2>
          ECLIPSE.FORMS.ENABLED PTR.BR

START:    CLEAR.SCREEN
          GOSUB DISP.INPS

          CHECK.KEY 'SOE.PRINT.INVOICE',PRNT.INV.OK
          DRPT   = ''
          FAX    = NO
          PRT.OK = YES
          MENU.CLEAR

          * Form Type instead of Print Style (for Eclipse Forms).
          IF USE.ECLIPSE.FORMS$ THEN
             UT.OPEN.FILE "ECLIPSE.FORMS.TYPES",EFTFILE,ERR.MSG,YES
             IF ERR.MSG THEN RETURN
          END

IN.ID:    IF INIT.OID = '' THEN
IN.OID:      INP ID,18,1,14,'MCU'
             IF QUIT THEN GOTO FINISH
             IF ID[1,1] = 'A' THEN
                ID = ''; PRINT @(18,1): ID "L#18"
                CLEAR.SCREEN
                GOSUB DISP.INPS
                ERR.MESS 2,2,BELL:'You can not print an Inventory Adjustment from this screen.'
                GOTO IN.ID
             END
             OID  = FIELD(ID,'.',1)
             INVN = FIELD(ID,'.',2)+0
             MATREAD LED FROM LEDFILE,OID ELSE PRINT BELL:; GOTO IN.ID
             LOCATE INVN IN LED(8)<1> SETTING GEN ELSE
                OE.SELECT.SHIPDATE OID,GEN,,NO
                IF GEN+0=0 THEN GOTO IN.ID
             END
             IF LED(6)<1,GEN>='$' THEN PRINT BELL:; GOTO IN.OID
          END ELSE
             OID = INIT.OID
          END

          EMAIL.CHECK.TIFF 'INV',OID,GEN,,EMAIL.TIFF

          FTYPE.OPTS  = OID:",":GEN
          CHANGE.FLAG = (LED(129)<1,2> # "")
*-------------------------------------------------------------------------*
ID.VER:   CPYS  = 1
          OSTAT = LED(6)<1,GEN>
          IF INIT.STATUS='$'  THEN PRINT BELL:; GOTO FINISH
          IF INIT.STATUS#''   THEN OSTAT = INIT.STATUS
          MODE = OID[1,1]

          IF OSTAT = 'Y' THEN MODE = 'P'
          IF OSTAT = 'Y' THEN
             CHECK.KEY 'COGS.VIEW',COGS.OK
             CHECK.KEY 'COST.VIEW',COST.OK
             IF NOT(COGS.OK) OR NOT(COST.OK) THEN GOTO FINISH
          END
IN$$4:    INP.STAT.CHG = YES
          CHECK.KEY 'WHSE.INPROCESS.EDIT',WH.INP.OK
          IF NOT(WH.INP.OK) THEN
IN$$5:       INP.STAT.CHG = NO
             GOSUB CHK.INPROCESS
             IF NOT(ORD.OPEN) THEN INP.STAT.CHG = YES
          END ELSE
             IF VIEW.ONLY THEN INP.STAT.CHG = NO
          END
          REPRINT = NO
          DIRECT.REPRINT = NO
          S.REPRINT = NO
          I.REPRINT = NO
          SHIP.TICKET.REPRINT = NO
          PICK.TICKET.REPRINT = NO
          ALLOW.INVOICE.REPRINT = NO

          IF LED(6)<1,GEN> = 'D' THEN DIR.SO = YES ELSE DIR.SO = NO
          IF LED(6)<1,GEN> = 'Y' THEN DIR.PO = YES ELSE DIR.PO = NO

*-------------------------------------------------------------------------*
          IF MODE='T' THEN
             LOCATE LED(2)<1,GEN,1> IN SECURITY<9> SETTING POS ELSE
                LOCATE LED(2)<1,GEN+1,1> IN SECURITY<9> SETTING POS ELSE
                   MESS 10,10,BELL:'Not Authorized for Branch # ':LED(2)<1,GEN,1>:' or ':LED(2)<1,GEN+1,1>
                   GOTO FINISH
                END
             END
          END ELSE
             LOCATE LED(2)<1,GEN,1> IN SECURITY<9> SETTING POS ELSE
                LOCATE LED(2)<1,GEN,2> IN SECURITY<9> SETTING POS ELSE
                   MESS 10,10,BELL:'Not Authorized for Branch # ':LED(2)<1,GEN,1>
                   GOTO FINISH
                END
             END
          END
*-------------------------------------------------------------------------*
          *** See if user has authority to Edit Directs...
          PRNT.OK = YES
          CHECK.KEY 'SOE.DIRECT.EDIT',KEY.OK,LVL
          IF NOT(KEY.OK) OR LVL+0 < 1 THEN PRNT.OK = NO

          *** Get all the Doc Types that have been logged as Printed...
          READV LEDL1 FROM LEDLFILE,OID,1 ELSE LEDL1 = ''

          * Allow print of Routing Copy
          ROUTING.COPY = NO
          SHP.BR       = LED(2)<1,GEN,2>
          READ BR.REC FROM TERRFILE,SHP.BR THEN
             LOCATE LED(70)<1,GEN> IN BR.REC<18> SETTING SV.POS THEN
                IF BR.REC<22,SV.POS> THEN
                   ROUTING.COPY = YES
                END
             END
          END

          BEGIN CASE
          CASE MODE = 'S'

             *** Need to know whether printing would be a 'Reprint', in
             *** case customer is on Credit Hold...

             LOCATE 'S' IN LEDL1<1,GEN> SETTING SLOG THEN
                S.REPRINT = YES
             END

             LOCATE 'I' IN LEDL1<1,GEN> SETTING SLOG THEN
                I.REPRINT = YES
             END ELSE
                LOCATE 'PI' IN LEDL1<1,GEN> SETTING SLOG THEN
                   I.REPRINT = YES
                END ELSE
                   LOCATE 'E810' IN LEDL1<1,GEN> SETTING SLOG THEN
                      I.REPRINT = YES
                   END
                END
             END
             IF I.REPRINT AND NOT(PRNT.INV.OK) THEN
                CHECK.KEY 'SOE.REPRINT.INVOICE',ALLOW.INVOICE.REPRINT
                PRNT.INV.OK = ALLOW.INVOICE.REPRINT
             END

             * Test to see if a ship ticket has already printed
             LOCATE 'O' IN LEDL1<1,GEN> SETTING TLOG THEN
                SHIP.TICKET.REPRINT = YES
             END

             * Test to see if a pick ticket has already printed
             LOCATE 'T' IN LEDL1<1,GEN> SETTING TLOG THEN
                PICK.TICKET.REPRINT = YES
             END

             *** Even if order is a Direct, can always print S/O side...
             DOC.TYPES = ''
             DOC.TYPES<1,1> = 'B - Bid'
             DOC.TYPES<1,2> = 'A - Acknowledge'

             IF LED(8)<1,GEN> OR OSTAT = 'T' THEN
                DOC.TYPES<1,-1> = 'T - Picking Ticket'
                DOC.TYPES<1,-1> = 'O - Shipping Order'
                IF LED(8)<1,GEN> THEN
                   DOC.TYPES<1,-1> = 'I - Invoice'
                END
             END

             IF ROUTING.COPY THEN
                DOC.TYPES<1,-1> = 'F - Routing Copy'
             END

             * If Eclipse Forms (DFG) is enabled, all the user to print
             * an Order Summary document.
             IF USE.ECLIPSE.FORMS$ THEN
                DOC.TYPES<1,-1> = "M - Order Summary"
             END

             * If this order has Cut Products, allow the Cut Ticket
             IF LED(140) # '' THEN
                DOC.TYPES<1,-1> = "U - Cut Ticket"
             END

             BEGIN CASE
             CASE CHANGE.FLAG;                   DOC.TYPE = 'A'
             CASE OSTAT = 'B';                   DOC.TYPE = 'B'
             CASE OSTAT = 'O';                   DOC.TYPE = 'O'
             CASE LED(8)<1,GEN>='';              DOC.TYPE = 'A'
             CASE OSTAT = 'I';                   DOC.TYPE = 'I'
             CASE OSTAT = 'T';                   DOC.TYPE = 'T'
             CASE OTHERWISE;                     DOC.TYPE = 'A'
             END CASE
          CASE MODE = 'P'
             *** No matter what, user can always print a Bid...
             DOC.TYPES = ''
             DOC.TYPES<1,1> = 'B - Bid'

             LOCATE 'D' IN LEDL1<1,GEN> SETTING DLOG THEN
                DIRECT.REPRINT = YES
             END

             *** If it's a Reprint, the user has Direct Edit authority when
             *** the order is a Direct, or it's just a regular P/O, give
             *** them all the doc types...
             IF DIRECT.REPRINT OR (DIR.PO AND PRNT.OK) OR NOT(DIR.PO) THEN
                DOC.TYPES<1,2> = 'O - Open P/O'
                DOC.TYPES<1,3> = 'R - Received P/O'
                DOC.TYPES<1,4> = 'V - P/O Receiver'

                BEGIN CASE
                CASE OSTAT = 'B';    DOC.TYPE = 'B'
                CASE OSTAT = 'R';    DOC.TYPE = 'R'
                CASE OTHERWISE;      DOC.TYPE = 'O'
                END CASE
             END ELSE
                DOC.TYPE = 'B'
             END
          CASE MODE = 'T'
             DOC.TYPES = ''
             DOC.TYPES<1,1> = 'B - Bid'
             DOC.TYPES<1,2> = 'O - Open Transfer'
             DOC.TYPES<1,3> = 'R - Received Transfer'

             BEGIN CASE
             CASE OSTAT = 'B';   DOC.TYPE = 'B'
             CASE OSTAT = 'R';   DOC.TYPE = 'R'
             CASE OTHERWISE;     DOC.TYPE = 'O'
             END CASE
          END CASE

          IF USE.ECLIPSE.FORMS$ THEN
             PSTYLE.OVRD = ""
          END ELSE
             IF PSTYLE.OVRD='' THEN PSTYLE.OVRD = LED(77)<1,GEN>
          END

          OE.GET.QSIGN QSIGN,OID,GEN
          BR    = LED(2)<1,GEN,1>
          BT.CN = LED(1)<1,GEN>
          ST.CN = LED(5)<1,GEN>
          GET.CUS BR,BT.CN,ST.CN,QSIGN

          INVN = LED(8)<1,GEN>
          IF INVN THEN
             ORN = OID:'.':INVN'R%3'
             ORDER.ID = ORN
          END ELSE
             ORN = OID
             ORDER.ID = OID:'.':LED(12)<1,GEN>'R%4'
          END
          RVW.ID  = OID:'.':LED(12)<1,GEN>"R%4"
          READ PRVW FROM PRVWFILE,RVW.ID ELSE PRVW = ''
          STAT    = PRVW<1>
          IF STAT = 'Printed' THEN INP.STAT.CHG = NO ;* Do not validate

          IF MODE = "S" THEN
             CHECK.KEY MODE:"OE.CLOSED.ORDER.FAX",CLOSED.FAX
          END ELSE
             CLOSED.FAX = YES
          END

          * Check EMAIL.SEND auth
          CHECK.KEY "EMAIL.SEND",EMAIL.OK
          IF MODE = 'T' AND NOT(USE.ECLIPSE.FORMS$) THEN
             * Transfers can only be emailed if tiff or pdf when not DFG
             IF NOT(EMAIL.TIFF) THEN
                EMAIL.OK = NO
             END
          END
          CHECK.KEY 'FAX.ALLOWED',FAX.ALLOWED,FAX.LEVEL

          GOSUB LOAD.HOTKEYS
          GOSUB CHK.MANIFEST
          GOSUB DISPLAY

          IF STAT THEN GOTO IN.CONS

          IF USE.ECLIPSE.FORMS$ THEN
             GOTO IN.STAT
          END ELSE
             GOTO IN.STYLE
          END
*-------------------------------------------------------------------------*
IN.STYLE: INP PSTYLE.OVRD,22,4,10,V_'PRINT.STYLES,1'
          IF QUIT THEN GOTO FILEIT
          ON MOVE+1 GOTO IN.STYLE,IN.STYLE,IN.OID,IN.STYLE,IN.STAT,IN.STAT
*-------------------------------------------------------------------------*
IN.STAT:  INP DTYP,22,SINP,1,'MCU',V_'D:':DOC.TYPES
          IF QUIT THEN GOTO FILEIT
          REPRMT = NO
          IF NOT(LED(8)<1,GEN>) THEN
             BEGIN CASE
             CASE MODE='S'
                REPRMT = (CHANGE.FLAG AND DTYP # "A")
                REPRMT = (REPRMT OR (DTYP='T' AND LED(6)<1,GEN>#'T'))
                REPRMT = (REPRMT OR DTYP='I')
                REPRMT = (REPRMT OR (DTYP='O'))
             CASE MODE='P'
                REPRMT = (DTYP='R')
             CASE MODE='T'
                REPRMT = (DTYP='S' OR DTYP='R')
             END CASE
             IF REPRMT THEN
                PRINT BELL
                PRINT @(22,SINP):DOC.TYPE                          "L#1"
                GOTO IN.STAT
             END
          END

          * If the user changed the doc type (and we are using Eclipse
          * Forms), clear the Form Type.
          IF ((DOC.TYPE # DTYP) AND USE.ECLIPSE.FORMS$) THEN
             PRINT @(22,5):""  "L#40"
             PSTYLE.OVRD = ""
          END

          DOC.TYPE = DTYP

          IF USE.ECLIPSE.FORMS$ THEN
             ON MOVE+1 GOTO IN.STAT,IN.STAT,IN.OID,IN.STAT,IN.FTYPE,IN.FTYPE
          END ELSE
             ON MOVE+1 GOTO IN.STAT,IN.STAT,IN.STYLE,IN.STAT,IN.CPYS,IN.CPYS
          END
*-------------------------------------------------------------------------*
IN.FTYPE: ***
          FOPTS = FTYPE.OPTS:",":DOC.TYPE
IN.FTYP:  INP PSTYLE.OVRD,22,5,40,V_"S:VERF.EFORMS.FORM,":FOPTS
          IF CHANGED THEN
             READV DESC FROM EFTFILE,PSTYLE.OVRD,1 ELSE DESC = ""
             PRINT @(22,5):DESC   "L#40"
          END
          IF QUIT THEN GOTO FILEIT
          ON MOVE+1 GOTO IN.FTYPE,IN.FTYPE,IN.STAT,IN.FTYPE,IN.CPYS,IN.CPYS
*-------------------------------------------------------------------------*
IN.CPYS:  INP CPYS,22,6,1,'R'
          IF QUIT THEN GOTO FILEIT
          IF CPYS<0 OR CPYS='' THEN PRINT BELL;GOTO IN.CPYS
          IF USE.ECLIPSE.FORMS$ THEN
             ON MOVE+1 GOTO IN.CPYS,IN.CPYS,IN.FTYPE,IN.CPYS,IN.CONS,IN.CONS
          END ELSE
             ON MOVE+1 GOTO IN.CPYS,IN.CPYS,IN.STAT,IN.CPYS,IN.CONS,IN.CONS
          END
*-------------------------------------------------------------------------*
IN.CONS:  IF INP.STAT.CHG THEN
IN.CONS1:    INP NEW.STAT,24,7,20,V_'C:VALID.INPROCESS.STATUSES'
          END ELSE
IN$$3:       INP AA,24,7,0
          END
          IF CHANGED THEN
             IF TRIM(NEW.STAT) = '' THEN
                ANS = ''
                MSG = 'Invalid Status, <Press Enter> '
IN$$6:          INP.PROMPT ANS,MSG
                GOTO IN.CONS1
             END
             IF UPCASE(NEW.STAT) = 'MANIFEST' AND STAT # 'MANIFEST' AND NOT(ORD.ON.MANIFEST) THEN
                GOSUB READY.MNFST
                IF NOT(OK.TO.MNFST) THEN
                   PRINT @(24,7):STAT "L#20"
                   GOTO IN.CONS
                END
             END ELSE
                OE.ORDER.STATUS.UPD OID,GEN,NEW.STAT,ERR.MSG
                IF ERR.MSG THEN
                   CONVERT AM TO ' ' IN ERR.MSG
                   FOLD ERR.MSG,50,PRT.MSG
                   CONVERT VM TO AM IN PRT.MSG
                   ERR.MESS 5,2,PRT.MSG
                   PRINT BELL:
                   PRINT @(24,7):STAT "L#20"
                   GOTO IN.CONS
                END
             END
             STAT = NEW.STAT
          END
          IF QUIT THEN GOTO FILEIT
          ON MOVE+1 GOTO IN.CONS,IN.CONS,IN.CPYS,IN.CONS,IN.CONS,IN.CONS
*-------------------------------------------------------------------------*
SUBS:     *
          DRPT = ''
          ON OPTION GOTO PRT.CPY, VIEW.OID, VIEW.OID, LABELS, FAX.IT, INPROC, SHIP.PKGS, EMAIL.IT, READY.MNFST, MNFST.COMMENTS, EDIT.MNFST
*-------------------------------------------------------------------------*
PRT.CPY:
          *** Check to see if the Purchase Order has been cancelled
          *** a prompt for verification...
          IF OID[1,1] = 'P' THEN
             IF LED(6)<1,GEN> = 'X' THEN
                MSG     = "You are about to reprint a Purchase Order"
                MSG<-1> = "that has been canceled. Continue Y/N?"
                ANS     = ''
IN$$7:          INP.PROMPT ANS,MSG,'YN',1
                IF NOT(ANS) THEN RETURN TO START
             END
          END
          NO.PT = YES

          *** An acknowledgement or bid doesn't RELEASE anything, so we
          *** don't need to check whether order is on Credit Hold to print
          *** one...
          IF DOC.TYPE # 'A' AND DOC.TYPE # 'B' THEN
             GOSUB CHK.CRED.CUS
          END

          IF NOT(PRT.OK) THEN RETURN
          IF MODE = 'S' AND DOC.TYPE = 'I' AND NOT(PRNT.INV.OK) THEN
             ERR.MESS 10,5,BELL:'You are not authorized to print this invoice.'
             RETURN
          END

          * Check Authorization for Reprint of a Ship Ticket
          IF MODE = 'S' AND DOC.TYPE = 'O' AND SHIP.TICKET.REPRINT THEN
             PRMPT    = 'Reprint a Ship Ticket'
             KEY.REQD = 'SOE.REPRINT.SHIP.TICK'
             OE.GET.AUTH OID,PRMPT,KEY.REQD,ACTION.OK,GEN
             IF NOT(ACTION.OK) THEN RETURN TO START
          END

          * Check Authorization for Reprint of a Pick Ticket
          IF MODE = 'S' AND DOC.TYPE = 'T' AND PICK.TICKET.REPRINT THEN
             PRMPT    = 'Reprint a Pick Ticket'
             KEY.REQD = 'SOE.REPRINT.PICK.TICK'
             OE.GET.AUTH OID,PRMPT,KEY.REQD,ACTION.OK,GEN
             IF NOT(ACTION.OK) THEN RETURN TO START
          END

          GOSUB CHECK.ASL

          IF ASL.ERR THEN RETURN TO START

          FOR X = 1 TO CPYS
          BEGIN CASE
          CASE MODE = 'S'
             UET.ENABLED = NO
             IF UET.ENABLED$ THEN
                CTRB.ID = 'UET.ENABLED~':LED(2)<1,GEN,2>
                READV UET.ENABLED FROM CTRBFILE,CTRB.ID,1 ELSE
                   UET.ENABLED = NO
                END
             END
             IF UET.ENABLED AND DOC.TYPE='T' THEN
                OID.DATA$<1> = OID
                OID.DATA$<2> = GEN
                UET.LOG.AUTO 'SDPTP'
             END

             ABC.ENABLED = NO
             IF ABC.ENABLED$ THEN
                CTRB.ID = 'ABC.ENABLED~':LED(2)<1,GEN,2>
                READV ABC.ENABLED FROM CTRBFILE,CTRB.ID,1 ELSE
                   ABC.ENABLED = NO
                END
             END
             IF ABC.ENABLED THEN
                OID.DATA$ = ''
                OID.DATA$<1> = OID
                OID.DATA$<2> = GEN
                ABC.DOC.TYPE = 'S'
                IF OSTAT = 'I' THEN ABC.DOC.TYPE = 'I'
                TMP = 'SDPTP.':ABC.DOC.TYPE
                ABC.LOG.AUTO TMP
             END
             *** Check to see if they have set the control record
             *** to print MSDS sheets following the invoice.
             READ PRT.MSDS FROM CTRLFILE,'PRINT.MSDS.INVOICE' ELSE
                PRT.MSDS = ''
             END


             *** If printing MSDS, there are two PRINTER.ON calls (one in
             *** SOE.PRINT.INVOICE and SOE.PRINT.MSDS.SUMMARY).  We use
             *** ACTIVE.FORMS$ because we only want to select the printer
             *** once.  Plus, we turn the printer on so that it will
             *** set ACTIVE.FORMS$ correctly.
             IF USER.ID="TSMITH" AND DOC.TYPE = 'I' AND NOT(USE.ECLIPSE.FORMS$) THEN
                PRT.ON = YES
                ACTIVE.FORMS$ = YES
                PRINTER.ON "INVOICE",,DOC.ID,RPT.DFLT=DRPT
             END ELSE
                PRT.ON = NO
             END

             BEGIN CASE
             CASE (CHANGE.FLAG)
                SOE.PRINT.CHANGE.ORDER OID,,PSTYLE.OVRD,PRT.ON,DRPT
             CASE (DOC.TYPE = 'U')
                SOE.PRINT.CUT.TICKET OID,GEN
             CASE OTHERWISE
                LOC.OVRD = LOCATION
                IF DO.OPEN.TOTALS THEN
                   * Open the SOE totals window
                   OE.TOTALS OID,GEN,,,'Done',YES
                   DO.OPEN.TOTALS = NO
                END
                SOE.PRINT.ORDER OID,GEN,NO.PT,DOC.TYPE,PSTYLE.OVRD,PRT.ON,DRPT,DOC.ID,LOC.OVRD
             END CASE

             *** if ACTIVE.FORMS$ is set, clear it out after the print and
             *** turn the printer off if it is on.
             IF USER.ID="TSMITH" AND DOC.TYPE = 'I' AND PRT.ON THEN
                PRT.ON = NO
                PRINTER.OFF DOC.ID
                ACTIVE.FORMS$ = ''
             END
          CASE MODE = 'P'
             IF DOC.TYPE='V' THEN
                POE.PRINT.RECVR OID,GEN
             END ELSE
                IF DO.OPEN.TOTALS THEN
                   IF LED(6)<1,GEN> = 'Y' THEN
                      * Locate associated SOE GEN
                      GID = LED(12)<1,GEN>
                      LOCATE GID IN LED(33)<1> SETTING GN ELSE
                         GN = 1
                      END

                      * Open the SOE totals window
                      OE.TOTALS OID,GN,,,'Done',YES
                   END ELSE
                      OE.TOTALS OID,GEN,,,'Done',YES
                   END
                   DO.OPEN.TOTALS = NO
                END
                POE.PRINT.ORDER OID,GEN,DOC.TYPE,PSTYLE.OVRD,DRPT=DRPT
             END
          CASE MODE = 'T'
             LOC.OVRD = LOCATION
             IF DO.OPEN.TOTALS THEN
                IF LED(6)<1,GEN> = 'Y' THEN
                   * Locate associated SOE GEN
                   GID = LED(12)<1,GEN>
                   LOCATE GID IN LED(33)<1> SETTING GN ELSE
                      GN = 1
                   END

                   * Open the SOE totals window
                   OE.TOTALS OID,GN,,,'Done',YES
                END ELSE
                   * Open the SOE totals window
                   OE.TOTALS OID,GEN,,,'Done',YES
                END
                DO.OPEN.TOTALS = NO
             END
             TOE.PRINT.ORDER OID,GEN,DOC.TYPE,PSTYLE.OVRD,,DRPT,LOC.OVRD
          END CASE
          NEXT X

          IF NOT(FAX) THEN
             IF INIT.OID#'' THEN RETURN TO FINISH
             PSTYLE.OVRD = ''
             RETURN TO START
          END ELSE
             GOTO FAX.IT2
          END
*-------------------------------------------------------------------------*
VIEW.OID: OE.VIEW.ONLY = (OPTION=2)
          OE.EXEC MODE,1,OID,GEN,OE.VIEW.ONLY
          RETURN
*-------------------------------------------------------------------------*
CHK.CRED.CUS:   *
          *** If PO GEN of direct look at DIRECT GEN for customer info...
          RELOAD.CUS = NO
          IF LED(6)<1,GEN> = 'Y' THEN
             TEMP.GEN = GEN
             LOCATE LED(33)<1,GEN> IN LED(12)<1> SETTING GEN ELSE GEN = 1
             GET.CUS BR,LED(1)<1,GEN>,LED(5)<1,GEN>,QSIGN
             RELOAD.CUS = YES
          END

          SOE.CREDIT.CHECK LED(5)<1,GEN>,NO.OE,COD,PRT.MSG,NO.SHIP,,,INIT.OID,GEN

          *** Reload Vendor for PO GEN
          IF RELOAD.CUS THEN
             GEN = TEMP.GEN
             GET.CUS BR,LED(1)<1,GEN>,LED(5)<1,GEN>,QSIGN
          END

          PRT.OK = YES

          *** Set the Reprint status based on the order/doc type we're on..
          *** (It's okay to print the S/O side OF A DIRECT)...
          BEGIN CASE
          CASE NOT(DIR.SO) AND DOC.TYPE = 'O'
             REPRINT = SHIP.TICKET.REPRINT
          CASE NOT(DIR.SO) AND DOC.TYPE = 'T'
             REPRINT = PICK.TICKET.REPRINT
          *** Need to check CASE direct PO first...
          CASE DIR.PO AND (DOC.TYPE='O' OR DOC.TYPE='R')
             REPRINT = DIRECT.REPRINT
          CASE MODE = 'S' AND NOT(DIR.SO)
             IF DOC.TYPE = 'I' THEN
                REPRINT = I.REPRINT
             END
             *** This DocType would have been logged as 'S'...
             IF DOC.TYPE = 'O' THEN
                REPRINT = S.REPRINT
             END
          END CASE

          *** For P/O side Directs, we don't care about checking Credit
          *** Release auth if they're just trying to print a Bid...
          OPEN.DIRECT = LED(6)<1,GEN> = 'Y' AND DOC.TYPE#'B'

          *** Do not recheck Invoiced orders...
          INVOICE = (LED(8)<1,GEN>+0 # 0)

          *** If it's not a Reprint and they're trying to fax/print an open
          *** P/O side of a Direct, or a regular S/O, make sure they have
          *** the right auth...
          IF NOT(REPRINT) AND (MODE = 'S' OR OPEN.DIRECT AND NOT(INVOICE)) AND (OSTAT #'B' AND OSTAT#'D') THEN
             SOE.CALC.CASH OID, GEN, AMT.DUE,,,,DIR.COD.DUE
             IF NO.OE OR NO.SHIP OR PRT.MSG OR (COD AND (AMT.DUE > 0 OR DIR.COD.DUE > 0)) THEN
                IF DO.OPEN.TOTALS THEN
                   IF LED(6)<1,GEN> = 'Y' THEN
                      * Locate associated SOE GEN
                      GID = LED(12)<1,GEN>
                      LOCATE GID IN LED(33)<1> SETTING GN ELSE
                         GN = 1
                      END

                      * Open the SOE totals window
                      OE.TOTALS OID,GN,,,'Done',YES
                   END ELSE
                      * Open the SOE totals window
                      OE.TOTALS OID,GEN,,,'Done',YES
                   END
                   DO.OPEN.TOTALS = NO
                END
                IF LED(6)<1,GEN> = 'Y' THEN
                   PRMPT    = 'Release a Direct P/O (Cust Credit Limit)'
                END ELSE
                   PRMPT    = 'Release an Order (Cust Credit Limit)'
                END
                SOE.CHECK.CREDIT.RELEASE OID,GEN,PRMPT,YES,PRT.OK,,2
             END
          END

          RETURN
*-------------------------------------------------------------------------*
FAX.IT:   INIT.CN = LED(5)<1,GEN>
          INIT.BR = LED(2)<1,GEN,2>
          DRPT<29,1> = LED(71)<1,GEN,2>
        * default to field of fax to the Ordered by field from Sales Order
          DRPT<29,3> = LED(68)<1,GEN>
        * each user will have own default message
          READ FAX.MSG FROM CTRLFILE,'FAX.DEFAULT.MSG:':USER.ID ELSE
             FAX.MSG = ''
          END
          CONVERT VM TO SVM IN FAX.MSG
          DRPT<29,5> = FAX.MSG<1>
          FAX.DATA.GET DRPT,INIT.CN,INIT.BR,OID,GEN
          IF F12 OR DRPT<29,1>='' THEN GOTO NO.PRT
          FAX      = YES

          FAX.DATA     = DRPT<29>
          FAX.PHONES   = RAISE(RAISE(FAX.DATA<1,1>))
          FAX.CONTACTS = RAISE(RAISE(FAX.DATA<1,3>))
          FAX.CT = DCOUNT(FAX.PHONES,AM)
          FOR FAX.EX = 1 TO FAX.CT
             FAX.DATA<1,1> = FAX.PHONES<FAX.EX>
             FAX.DATA<1,3> = FAX.CONTACTS<FAX.EX>
             DRPT<29> = FAX.DATA
             IF FAX.EX = FAX.CT THEN FAX = NO
             GOTO PRT.CPY
FAX.IT2:  NEXT FAX.EX
NO.PRT:   RETURN
*-------------------------------------------------------------------------*
EMAIL.IT: *
          IF NOT(EMAIL.OK) THEN RETURN
          IF MODE = 'S' AND DOC.TYPE = 'I' AND NOT(PRNT.INV.OK) THEN
             ERR.MESS 10,5,BELL:'You are not authorized to email this invoice.'
             RETURN
          END

          INIT.ST = LED(5)<1,GEN>
          INIT.BT = LED(1)<1,GEN>
          ESTAT   = DOC.TYPE
          IF OSTAT = 'Y' THEN ESTAT = 'Y'

          *** An Acknowledgement or bid doesn't RELEASE anything, so we
          *** don't need to check whether order is on Credit Hold to Email
          *** one...
          IF DOC.TYPE # 'A' AND DOC.TYPE # 'B' THEN
             GOSUB CHK.CRED.CUS
          END

          GOSUB CHECK.ASL
          IF ASL.ERR THEN RETURN

          IF PRT.OK THEN
             EM.ERRS = ''
             PASSER  = ''
             EM.DATA    = INIT.BT
             EM.DATA<2> = INIT.ST
             EM.DATA<4> = OID
             EM.DATA<5> = GEN
             EM.DATA<6> = ESTAT

             IF MODE = 'S' THEN
                ESTATUS = ESTAT
             END ELSE
                ESTATUS = OSTAT
             END

             EMAIL.SET.SUBJECT MODE,OID,GEN,ESTATUS,SUBJECT,ATT.NAME

             *** Use first email address as default
             EM.ADDR = CUSS(115)<1>
             IF NOT(EM.ADDR) THEN
                EM.ADDR = CUS(115)<1>
             END
             PASSER<1>  = EM.ADDR    ;* Email Address

             PASSER<17> = ATT.NAME   ;* Attachment notification
             PASSER<10> = YES        ;*flag so EMAIL.SEND won't send msg

             PASSER<5>  = SUBJECT    ;* Email Subject
             PASSER<21> = OID:'.':LED(12)<1,GEN> ;* Attachment filename
             NO.PT      = YES
             * Create the email document
             EM.DATA<8>  = PSTYLE.OVRD
             E.ATTACH = ''
             EM.FMT      = ''
             IF NOT(EMAIL.TIFF) THEN
                O.PROMPT = 'Email Format [HTML/Plain Text] : '
                FMT.OPTS = 'HTML':VM:'Plain Text'
IN.EM.FMT:      INP.PROMPT EM.FMT,O.PROMPT,,10,'D:':FMT.OPTS
             END
             BEGIN CASE
             CASE MODE = 'P' OR LED(6)<1,GEN> = 'Y'
                IF EM.FMT = 'HTML' THEN
                   POE.MBX.ORDER.HTML OID,GEN,OSTAT,E.ATTACH,PSTYLE.OVRD
                   PASSER<9>  = YES
                   PASSER<19> = 'HTML'
                   CONVERT CHAR(10) TO AM IN E.ATTACH
                END ELSE
                   POE.MBX.ORDER OID,GEN,DOC.TYPE,PSTYLE.OVRD,E.ATTACH
                END
             CASE MODE = 'S'
                IF EM.FMT = 'HTML' THEN
                   SOE.MBX.ORDER.HTML OID,GEN,DOC.TYPE,E.ATTACH,PSTYLE.OVRD
                   PASSER<9>  = YES
                   PASSER<19> = 'HTML'
                   CONVERT CHAR(10) TO AM IN E.ATTACH
                END ELSE
                   SOE.MBX.ORDER OID,GEN,NO.PT,DOC.TYPE,PSTYLE.OVRD,E.ATTACH
                END
             END CASE
             EMAIL.DATA.GET  EM.DATA,PASSER,,E.ATTACH,EM.ERRS

             * Only add a comment for emailing if we are not going to
             * have Eclipse Forms update the change log (for printing).
             IF NOT(USE.EF.PRINT.LOG$) THEN
                READV CMT FROM LEDLFILE,OID,10 ELSE CMT = ''
                LAST.CMT = DCOUNT(CMT,VM)
                E.ADDRESS = PASSER<1>
                E.CC = PASSER<7>
                E.BCC = PASSER<8>
                UT.REP.STR E.ADDRESS,VM,', '
                UT.REP.STR E.CC,VM,', '
                UT.REP.STR E.BCC,VM,', '
                CMT<1,LAST.CMT,6> := ' Emailed to: ':E.ADDRESS
                IF E.CC THEN
                   CMT<1,LAST.CMT,6> := " CC'ed to: ":E.CC
                END
                IF E.BCC THEN
                   CMT<1,LAST.CMT,6> := " BCC'ed to: ":E.BCC
                END
                WRITEV CMT ON LEDLFILE,OID,10
             END
          END

          RETURN
*-------------------------------------------------------------------------*
LABELS:   * Access the Label Print Routines
          READV SORT.PO FROM CTRLFILE,'SORT.JOHNSTONE.PO',1 ELSE SORT.PO=''
          *** We need to update the ledger before calling label routines
          *** Like for Johnstone that does a sort of the PO.
          IF SORT.PO THEN
             JS.SORT.PO OID,GEN
          END
          OE.LABEL.PRINT OID,GEN
          RETURN
*-------------------------------------------------------------------------*
INPROC:   WHSE.QUEUE.EDIT OID:'.':LED(12)<1,GEN>
          RETURN
*-------------------------------------------------------------------------*
SHIP.PKGS:
          IF VIEW.ONLY THEN MNFST.VIEW.ONLY = YES
          SOE.MANIFEST.SHIP.PKGS OID,GEN,MNFST.VIEW.ONLY

          RETURN
*-------------------------------------------------------------------------*
MNFST.COMMENTS:

          IF MNFST # '' THEN
             MNFST.VIEW.ONLY = NO
             IF MNFST<7> THEN
                MNFST.VIEW.ONLY = YES
             END ELSE
                CHECK.KEY 'SOE.MANIFEST.EDIT',EDIT.OK, EDIT.LVL
                IF NOT(EDIT.OK) THEN
                  MNFST.VIEW.ONLY = YES
                END
             END

             DONE = NO
             DCNT = DCOUNT(MNFST<10>,@VM)
             FOR C = 1 TO DCNT UNTIL DONE
                SCNT = DCOUNT(MNFST<15,C>,@SVM)
                FOR S = 1 TO SCNT UNTIL DONE
                   IF MNFST<15,C,S> = ORDER.ID THEN
                      DONE = YES
                      C.POS = C
                      S.POS = S
                   END
                NEXT S
             NEXT C
             DATA = RAISE(RAISE(MNFST<16,C.POS,S.POS>))
             OLD.DATA = DATA
             SOE.MANIFEST.COMMENTS 1,DATA,MNFST.VIEW.ONLY
             IF DATA # OLD.DATA THEN
                MANIFEST.CHANGED = YES
             END
             DATA = LOWER(LOWER(DATA))
             MNFST<16,C.POS,S.POS> = DATA
          END

          RETURN
*-------------------------------------------------------------------------*
READY.MNFST:

          OK.TO.MNFST = YES
          GOSUB CHK.INPROCESS

          IF OK.TO.MNFST THEN
             SOE.MANIFEST.READY ORN,GEN,PRVW
             * Re-read manifest info and display appropriate hotkeys
             GOSUB LOAD.HOTKEYS
             GOSUB CHK.MANIFEST
             GOSUB DISPLAY
          END ELSE
             GOSUB DISP.INP.ERR
          END

          RETURN
*-------------------------------------------------------------------------*
EDIT.MNFST:

          IF MANIFEST.CHANGED THEN
             GOSUB UPD.MANIFEST
          END

          * Save off CUS/CUSS because they can be stepped on in call
          * to SOE.MANIFEST.QUEUE
          MATBUILD SV.CUS  FROM CUS
          MATBUILD SV.CUSS FROM CUSS

          SOE.MANIFEST.QUEUE MANIFEST.ID
          MATREAD LED FROM LEDFILE,OID ELSE MAT LED = ''

          * Restore CUS/CUSS
          MATPARSE CUS  FROM SV.CUS
          MATPARSE CUSS FROM SV.CUSS

          * Reread manifest record in case changes made  *
          GOSUB LOAD.HOTKEYS
          GOSUB CHK.MANIFEST
          GOSUB DISPLAY

          RETURN
*-------------------------------------------------------------------------*
LOAD.HOTKEYS:

          MENU.CLEAR
          MENU.LOAD  2,10, 5,1,'P'
          MENU.LOAD 10,10, 4,1,'V'
          *** Does not load edit hotkey if in 'view only'
          IF VIEW.ONLY THEN
             MENU.LOAD
          END ELSE
             MENU.LOAD 17,10, 4,1,'E'
          END
          MENU.LOAD 24,10, 5,1,'L'
          IF FAX.LEVEL <=1 OR (LED(8)<1,GEN> AND NOT(CLOSED.FAX)) THEN
             MENU.LOAD
          END ELSE
             MENU.LOAD 32,10, 3,1,'F'
          END
          MENU.LOAD 38,10, 9,1,'I'
          IF MODE = 'S' THEN
             MENU.LOAD 50,10,13,1,'S'; * Shipping Pkgs key
          END ELSE
             MENU.LOAD 50,10,13,,
          END
          IF EMAIL.OK THEN
             MENU.LOAD 49,12, 6,4,'A'
          END ELSE
             MENU.LOAD 49,12, 6,,
          END

          RETURN
*-------------------------------------------------------------------------*
CHK.MANIFEST:

          MNFSTG = YES

          ORD.ON.MANIFEST = NO
          MNFST = ''
          MANIFEST.CHANGED = NO
          MNFST.VIEW.ONLY = NO

          OLD.MNSFT = ''

          READV MNFST.IDS FROM LEDLFILE,OID,17 ELSE MNFST.IDS = ''
          MANIFEST.ID = MNFST.IDS<1,GEN>
          READV PKGS FROM LEDLFILE,OID,18 ELSE PKGS = ''
          PKG.DATA    = PKGS<1,GEN>
          MNFST       = ''
          IF MANIFEST.ID THEN
             UT.OPEN.FILE 'MANIFESTS',MNFSTFILE,ERR.MSG,YES
             IF ERR.MSG = '' THEN
                READ MNFST FROM MNFSTFILE,MANIFEST.ID THEN
                   ORD.ON.MANIFEST = YES
                   OLD.MNFST = MNFST
                END
             END
          END

          IF MNFST<7> OR NOT(MNFSTG) THEN
             MNFST.VIEW.ONLY = YES; * Closed mnfst is view.only
          END ELSE
             CHECK.KEY 'SOE.MANIFEST.EDIT',EDIT.OK, EDIT.LVL
             IF NOT(EDIT.OK) THEN
               MNFST.VIEW.ONLY = YES
             END
          END

          GOSUB MNFST.KEYS

          RETURN
*-------------------------------------------------------------------------*
MNFST.KEYS:

          * Load Ready to Mnfst Key only if manifest is enabled
          * and the order is not currently on a manifest
          IF MNFSTG AND NOT(ORD.ON.MANIFEST) THEN
             MENU.LOAD  2,12,14,1,'R'
          END ELSE
             MENU.LOAD  2,12,14,,
          END

          * Load Mnfst Comments key
          * if order is currently on a manifest
          IF ORD.ON.MANIFEST THEN
             MENU.LOAD 19,12,14,7,'C'
          END ELSE
             MENU.LOAD 19,12,14,,
          END
          MENU.LOAD 36,12,10,6,'M'; * Edit manifest key

          RETURN
*-------------------------------------------------------------------------*
CHK.INPROCESS:

          GID = LED(12)<1,GEN>
          ORD.ID = OID:'.':GID
          *** use no-tote special index to see if any picks are open
          TST = ''
          ROOT = 'NT~':ORD.ID:'~'
          BSCAN WRK FROM WHQFILE,ROOT USING '&INDEX&.SPCL' BY 'A' THEN
             IF WRK[1,LEN(ROOT)] = ROOT THEN TST = YES
          END
          ORD.OPEN = (TST#'')
          IF ORD.OPEN THEN
             OK.TO.MNFST = NO
          END

          RETURN
*-------------------------------------------------------------------------*
DISP.INP.ERR:
          P.MSG = 'There are still inprocess quantities for this order, <Return> '
          RESP = ''
IN$$2:    INP.PROMPT RESP,P.MSG,,1

          RETURN
*-------------------------------------------------------------------------*
UPD.MANIFEST:

          UT.OPEN.FILE 'MANIFESTS',MNFSTFILE,ERR.MSG
          IF ERR.MSG # '' THEN RETURN TO ID.VER
          UPDATE.RECORD 'MANIFESTS',MNFSTFILE,MANIFEST.ID,OLD.MNFST,MNFST,UPD.ERR,CHNG
          RELEASE MNFSTFILE,MANIFEST.ID
          IF UPD.ERR THEN
             P.MSG = 'Manifest Comments updated by another user while editing, <Return> '
             RESP = ''
IN$$1:       INP.PROMPT RESP,P.MSG,,1
             RETURN TO ID.VER
          END

          RETURN
*-------------------------------------------------------------------------*
DISPLAY:
          PRINT @(18,1):ORN                         "L#14"
          PRINT @(51,1):OCONV(LED(9)<1,GEN>,'D2/')  "L#10"
          PRINT @(18,2):CUS(1)                      "L#35"

          IF USE.ECLIPSE.FORMS$ THEN
             PRINT @(22,4):DOC.TYPE                    "L#1"
             PRINT @(22,5):PSTYLE.OVRD                 "L#20"
          END ELSE
             PRINT @(22,4):PSTYLE.OVRD                 "L#20"
             PRINT @(22,5):DOC.TYPE                    "L#1"
          END

          PRINT @(22,6):CPYS                        "L#2"
          PRINT @(24,7):PRVW<1>                     "L#15"
          IF MANIFEST.ID # '' THEN
             PRINT @(45,7):'Mnfst# ':MANIFEST.ID "L#10"
          END ELSE
             PRINT @(45,7):SPACE(15)
          END
          PRINT @(24,8):LED(70)<1,GEN>              "L#30"

          RETURN
*-------------------------------------------------------------------------*
CHECK.ASL:*** See if this order should be on a hold...
          ASL.ERR = NO

          *** If ASL isn't turned on, don't bother checking gens.
          CTRL.ID = 'VALID.VENDOR.ASL.TYPES'
          READ ASL.LIST FROM CTRLFILE,CTRL.ID ELSE ASL.LIST = ''
          IF ASL.LIST = '' THEN RETURN

          BEGIN CASE
          CASE OID[1,1]='S' AND LED(6)<1,GEN>='Y'
             GOTO SOE.ASL
          CASE OID[1,1]='P'
             GOTO POE.ASL
          END CASE

          RETURN
*-------------------------------------------------------------------------*
SOE.ASL:  *** Checking the "Y" side of directs.

          HAS.HOLD = NO
          *** Check to see if this vendor has an automatic hold.
          BF.ENT = LED(1)<1,GEN>
          READV ASL.TYPE FROM CUSFILE,BF.ENT,176 ELSE ASL.TYPE = ''
          IF ASL.TYPE THEN
             LOCATE ASL.TYPE IN ASL.LIST<1> SETTING APOS THEN
                HAS.HOLD = ASL.LIST<2,APOS>
                IF HAS.HOLD THEN GOTO GET.AUTH
             END
          END

          LOCATE LED(33)<1,GEN> IN LED(12)<1> SETTING DGEN ELSE DGEN = 1
          BT.ENT = LED(1)<1,DGEN>
          ST.ENT = LED(5)<1,DGEN>

          READV BLIST FROM CUSFILE,BT.ENT,176 ELSE BLIST = ''
          LOCATE BF.ENT IN BLIST<1> SETTING BPOS THEN
             HAS.HOLD = YES
          END ELSE IF BT.ENT # ST.ENT THEN
             READV SLIST FROM CUSFILE,ST.ENT,176 ELSE SLIST = ''
             LOCATE BF.ENT IN SLIST<1> SETTING SPOS THEN
                HAS.HOLD = YES
             END
          END

          IF HAS.HOLD THEN GOTO GET.AUTH

          RETURN
*-------------------------------------------------------------------------*
POE.ASL:  *** Checking on the printing of POs.
          IF LED(6)<1,GEN> = 'X' THEN RETURN
          HAS.HOLD = NO
          *** Check to see if this vendor has an automatic hold.
          IF CUS(176) THEN
             LOCATE CUS(176) IN ASL.LIST<1> SETTING APOS THEN
                HAS.HOLD = ASL.LIST<2,APOS>
                IF HAS.HOLD THEN GOTO GET.AUTH
             END
          END

          LDIDS = LED(49)
          IF LED(8)<1,GEN> THEN LDIDS = RAISE(LED(48)<1,GEN>)

          LD.CT = DCOUNT(LDIDS,VM)
          FOR LL = 1 TO LD.CT UNTIL HAS.HOLD
             LDID = LDIDS<1,LL>
             LD.GET LDID

             SQ = SUM(LD(5)<1,GEN>) + SUM(LD(6)<1,GEN>)
             IF SQ+0=0 THEN CONTINUE

             LLL.CT = DCOUNT(LD(7)<1,GEN>,SVM)
             FOR LLL = 1 TO LLL.CT UNTIL HAS.HOLD
                TAG = FIELD(LD(7)<1,GEN,LLL>,'^',2)
                TOID = FIELD(TAG,'.',1)
                TLDID = FIELD(TAG,'.',2)
                IF TOID # '' AND TLDID # '' THEN GOSUB CHECK.TAG
             NEXT LLL
          NEXT LL

          IF HAS.HOLD THEN GOTO GET.AUTH

          RETURN
*-------------------------------------------------------------------------*
CHECK.TAG:*** Check the associated tagged order for ASL conflicts with the
          *** current PayTo.

          READ TLED FROM LEDFILE,TOID ELSE RETURN

          LD.ATTB = 149+TLDID

          GX.CT = DCOUNT(TLED<9>,VM)
          FOR GX = 1 TO GX.CT UNTIL HAS.HOLD
             SQ = SUM(TLED<LD.ATTB,5,GX>) + SUM(TLED<LD.ATTB,6,GX>)
             IF SQ+0#0 THEN
                S.ENT = TLED<5,GX>
                B.ENT = TLED<1,GX>
                READV TCUSS FROM CUSFILE,S.ENT,176 ELSE TCUSS = ''
                LOCATE LED(1)<1,GEN> IN TCUSS<1> SETTING LDPOS THEN
                   HAS.HOLD = YES
                   CONTINUE
                END ELSE IF B.ENT # S.ENT THEN
                   READV TCUS FROM CUSFILE,B.ENT,176 ELSE TCUS = ''
                   LOCATE LED(1)<1,GEN> IN TCUS<1> SETTING LDPOS THEN
                      HAS.HOLD = YES
                      CONTINUE
                   END
                END
             END
          NEXT GX

          RETURN
*-------------------------------------------------------------------------*
GET.AUTH: *** Prompt user for authorization to release an ASL hold.

          PRMPT  = "Release an ASL Hold"
          KEY.ID = "POE.ASL.RELEASE"
          LGMV   = GEN
          OE.GET.AUTH OID,PRMPT,KEY.ID,ACTION.OK,LGMV
          IF NOT(ACTION.OK) THEN ASL.ERR = YES

          RETURN
*-------------------------------------------------------------------------*
DISP.INPS: *** Dynamically add Order Status/Form Type/Print Style to the
          *** screen in the right order based on Eclipse Forms.
          IF USE.ECLIPSE.FORMS$ THEN
             PRINT @(2,4):"Order Status      :"
             PRINT @(2,5):"Form Type         :"
             SINP = 4
          END ELSE
             PRINT @(2,4):"Print Style       :"
             PRINT @(2,5):"Order Status      :"
             SINP = 5
          END
          RETURN
*-------------------------------------------------------------------------*
FILEIT:   IF F12 THEN
             CONFIRM.ABORT SURE
             IF NOT(SURE) THEN
                IF USE.ECLIPSE.FORMS$ THEN
                   GOTO IN.STYLE
                END ELSE
                   GOTO IN.FTYPE
                END
             END
          END
          IF MANIFEST.CHANGED THEN
             GOSUB UPD.MANIFEST                                                      END

          IF INIT.OID='' THEN
             PSTYLE.OVRD = ''
             GOTO START
          END
*-------------------------------------------------------------------------*
FINISH:   WINDOW.CLOSE
          RETURN
*-------------------------------------------------------------------------*

!TSMITH~04/04/13~15:57
