          SUBROUTINE (OLD.OID,NEW.OID,NEW.MODE,GEN,IS.PSOE)
** Version# 92.0301[2] - 01/20/2010 - 10:05am - SMITJR - eclipse
*** V92.0301 Change - Custom Coding CUSTOM - 01/20/2010 - SMITJR - eclipse
*** V92.03 Change - No Develop Ver Yet HIF663 - 10/02/2007 - EJO - r8.0base
*** V92.02 Change - No Develop Ver Yet CUI243 - 01/17/2007 - KRISTIS - r8.0base
*** V92.01 Change - No Develop Ver Yet CUC334 - 12/13/2006 - KRISTIS - r8.0base

*** Subroutine - OE.COPY.BID
*-------------------------------------------------------------------------*
*** This routine takes the current LED files and copies some (or possibly
*** all) of its contents to a new order. The new order can be of the same
*** type (Sales to Sales) or of a different type (Sales to Purchase). The
*** status of the new order will be Bid (B). The user has the option of
*** selecting if the current price/cost information will be kept as
*** overrides or if they will be recalced for new order.
*-------------------------------------------------------------------------*
*** Parameters:
*** OLD.OID  - OID of order being copied from                         [IN]
*** NEW.OID  - OID of new order created; copied to                    (OUT)
*** NEW.MODE - MODE (S=Sales,P=Purchase,etc) of new order created     (OUT)
*** GEN      - Current GEN of order being copied from                 [IN]
*** IS.PSOE  - Flag (1=True,0/NULL=False) indicated if the current    (IN)
***            order is a "Post" order. (Post Sales Order, Post
***            Purchase Order, etc). If so, it must be processed
***            before going to the newly created order
*-------------------------------------------------------------------------*
*** Common Variables:
***                             WARNING!!!                              ***
*** This routine destorys the current LED and LD arrays in favor of the ***
*** new order that has been created. If these arrays are needed intact, ***
*** create a copy of them before executing this routine                 ***
*-------------------------------------------------------------------------*
*** Phantom Friendly : NO
*** Java Friendly    : NO
*-------------------------------------------------------------------------*

START:    * Start over.
          COPY.PRC = ''
          COPY.COST = ''
          COPY.COGS = ''


          * Check control rec to see if copy cogs or cost has been disabled
          CTRL.ID = 'DISALLOW.COGS.COPY'
          READV DISALLOW.COGS.COPY FROM CTRLFILE,CTRL.ID,1 ELSE
             DISALLOW.COGS.COPY = ''
          END
          IF TRIM(DISALLOW.COGS.COPY) = '' THEN
             DISALLOW.COGS.COPY = 'NO'
          END
          IF DISALLOW.COGS.COPY = 1 THEN
             DISALLOW.COGS.COPY = 'YES'
          END

          CTRL.ID = 'DISALLOW.COST.COPY'
          READV DISALLOW.COST.COPY FROM CTRLFILE,CTRL.ID,1 ELSE
             DISALLOW.COST.COPY = ''
          END
          IF TRIM(DISALLOW.COST.COPY) = '' THEN
             DISALLOW.COST.COPY = 'NO'
          END
          IF DISALLOW.COST.COPY = 1 THEN
             DISALLOW.COST.COPY = 'YES'
          END

          ST.CN = ''
          IF OLD.OID[1,1]='S' THEN
             LOCATE 'P' IN LED(6)<1> SETTING POS THEN PRINT BELL:; RETURN
          END

          KEY.REQD = 'OE.COPY.BID'
          CHECK.KEY KEY.REQD,ENTRY.OK
          IF NOT(ENTRY.OK) THEN
             PRMPT    = 'Copy a bid'
             OE.GET.AUTH OLD.OID,PRMPT,KEY.REQD,ACTION.OK
             IF NOT(ACTION.OK) THEN RETURN
          END

          DIM LED2(200)

          MAT LED2 = MAT LED

          OLD.MODE = OLD.OID[1,1]

          IF NEW.MODE = '' THEN NEW.MODE = OLD.MODE
          IF NEW.MODE = 'S' THEN
             IF DISALLOW.COGS.COPY = 'YES' THEN
                * No one is allowed to copy COGS
                COPY.COGS.OPTS = 'No'
             END ELSE
                * Check auth key to see if they are allowed to copy COGS
                BEGIN CASE
                CASE DISALLOW.COGS.COPY = 'NO'; * Must have auth
                   CHECK.KEY 'COGS.EDIT',ENTRY.OK
                CASE OTHERWISE
                   ENTRY.OK = YES
                END CASE
                IF ENTRY.OK THEN
                   COPY.COGS.OPTS = ',Yes,No,Manual Overrides Only'
                END ELSE
                   COPY.COGS.OPTS = 'No'
                END
             END
             IF DISALLOW.COST.COPY = 'YES' THEN
                * No one is allowed to copy COST
                COPY.COST.OPTS =  'No'
             END ELSE
                BEGIN CASE
                CASE DISALLOW.COST.COPY = 'NO'
                   * Check auth key to see if they are allowed to copy COST
                   CHECK.KEY 'UD.OE.BID.COST.COPY$',ENTRY.OK
                CASE OTHERWISE
                   ENTRY.OK = YES
                END CASE
                IF ENTRY.OK THEN
                   COPY.COST.OPTS = ',Yes,No,Manual Overrides Only'
                END ELSE
                   COPY.COST.OPTS = 'No'
                END
             END
          END ELSE
             COPY.COST.OPTS = ',Yes,No,Manual Overrides Only'
             COPY.COGS.OPTS = ',Yes,No,Manual Overrides Only'
          END

          ORDERS.ALLOWED = NO
          VERF.ROUTINE   = 'VERF.CUS.ST'
          PRC.BR         = LED(2)<1,1,1>
          RCV.BR         = LED(2)<1,1,2>
          SAME.CN        = YES

          IF NEW.MODE # 'T' THEN
             SCREEN
             PRINT @(29,6):"No"   "L#21"
             PRINT @(29,7):"No"   "L#21"
             PRINT @(29,8):"No"   "L#21"
          END ELSE
             WINDOW ,,,,,'OE.COPY.BID2'
          END

          * Start the list of which choices are available.
          GEN.CHOICES                               = 'ALL'

          * 'All' is the only choice in some cases involving Lot Items or
          * MJB's or CHG's.
          OTHERS.OK                                 = YES
          IF LED(98)<1,GEN> THEN OTHERS.OK          = NO
          IF LED(128)<1,1>  THEN OTHERS.OK          = NO
          IF LED(129)<1,2>  THEN OTHERS.OK          = NO

          IF OTHERS.OK THEN
             GEN.CHOICES<1,-1>                      = 'CURRENT'

             * Check for Open GENS and add to list of copy choices
             OPEN.GENS                              = NO
             GEN.CT                                 = DCOUNT(LED(12),VM)
             FOR GLP                                = 1 TO GEN.CT
                IF LED(6)<1,GLP> # 'X' AND NOT(LED(8)<1,GLP>) THEN
                   OPEN.GENS                        = YES
                   CONTINUE
                END
             NEXT GLP
             IF OPEN.GENS THEN GEN.CHOICES := VM:'OPEN'
          END

          *** Allow them to change the shipping br, and price br OR recv
          *** br on xfer.  NOTE: IF THEY ARE CHANGING MODES THE
          *** SHP.BR = PRC.BR (OE.CREATE.LED)
          GENS = 'ALL'
          BEGIN CASE
          CASE NEW.MODE = 'T'
             MENU.LOAD 2,5,5,1,'B'
             PRINT @(21,1):PRC.BR
             PRINT @(19,0):'Copy To Transfer'
             RCV.BR = ''
             PRINT @(29,2):RCV.BR "L#4"
             GOTO IN.TSBR
          CASE NEW.MODE = 'P'
             PRINT @(20,0):'Copy To Purchase Order Bid'
             PRINT @(7,3):'From Same Ven? (Y/N)'
             PRINT @(7,4):'From Vendor'
             VERF.ROUTINE = 'VERF.VEN.SF'
          CASE OTHERWISE
             PRINT @(22,0):'Copy To Sales Order Bid'
          END CASE
          MENU.LOAD 2,10,5,1,'B'
          PRINT @(29,1):PRC.BR
          PRINT @(29,2):RCV.BR
          IF OLD.MODE # NEW.MODE THEN
             SAME.CN  = NO
             PRINT @(29,3):'Not Possible'
             COPY.PRC = YES
             PRINT @(29,6):'Option Not Available'
             GOTO IN.CUS
          END
          GOTO IN.SAME
*-------------------------------------------------------------------------*
IN.PBR:   INP.BR 29,1,4,PRC.BR,NAME,BRCHS,NO,NO
          IF F12 THEN GOTO ABORT.IT
          IF PRC.BR = '' THEN PRINT BELL:; GOTO IN.PBR
          ON MOVE+1 GOTO IN.PBR,IN.PBR,IN.PBR,IN.PBR
          IF OLD.MODE # NEW.MODE THEN GOTO IN.CUS
*-------------------------------------------------------------------------*
IN.SBR:   INP.BR 29,2,4,RCV.BR,NAME,BRCHS,NO,NO
          IF F12 THEN GOTO ABORT.IT
          IF RCV.BR = '' THEN PRINT BELL:; GOTO IN.SBR
          ON MOVE+1 GOTO IN.SBR,IN.SBR,IN.PBR,IN.SBR
          IF OLD.MODE # NEW.MODE THEN GOTO IN.CUS
*-------------------------------------------------------------------------*
IN.SAME:  INP SAME.CN,29,3,1,'YN'
          IF F12 THEN GOTO ABORT.IT
          IF SAME.CN THEN
             ST.CN = ''
             PRINT @(29,4):''     "L#35"
             COPY.PRC = ''
             COPY.COST = ''
             COPY.COGS = ''
             PRINT @(29,6):"No"   "L#21"
          END ELSE
             COPY.PRC = YES
             PRINT @(29,6):"Yes"  "L#21"
          END
          ON MOVE+1 GOTO IN.SAME,IN.SAME,IN.SBR,IN.SAME
          IF SAME.CN THEN GOTO IN.GEN
*-------------------------------------------------------------------------*
IN.CUS:   INP ST.CN,29,4,35,'TENTITY;X;1;1',V_'S:':VERF.ROUTINE
          IF F12 THEN GOTO ABORT.IT
          IF ST.CN THEN PRINT @(29,3):'N'; SAME.CN = NO
          IF MOVE+1 = 3 AND OLD.MODE # NEW.MODE THEN GOTO IN.PBR
          ON MOVE+1 GOTO IN.CUS,IN.CUS,IN.SAME,IN.CUS
*-------------------------------------------------------------------------*
IN.GEN:   INP GENS,29,5,7,'MCU',V_'D:':GEN.CHOICES
          IF GENS # 'ALL' AND IS.PSOE THEN
             MESS 6,2,'For Post Sales Orders, ALL GENS Must Be Copied!'
IN$$3:       INP A,,,0
             GENS = 'ALL'
             PRINT @(29,4):'ALL'  "L#7"
             GOTO IN.GEN
          END
          IF F12 THEN GOTO ABORT.IT
          IF SAME.CN AND MOVE+1 = 3 THEN GOTO IN.SAME
          ON MOVE+1 GOTO IN.GEN,IN.GEN,IN.CUS,IN.GEN
          IF (OLD.MODE # NEW.MODE) THEN GOTO IN.GEN
*-------------------------------------------------------------------------*
IN.PRC:   *** Copy pricing
          * The COPY.PRC variable has been converted to a tri-state flag
          * with the original values of 1 (YES), null (NO), and the new
          * value of 2 (copy manual overrides only).
          BEGIN CASE
          CASE COPY.PRC = 1  ; COPY.PRC = 'Yes'
          CASE COPY.PRC = '' ; COPY.PRC = 'No'
          CASE COPY.PRC = 2  ; COPY.PRC = 'Manual Overrides Only'
          CASE COPY.COST = 1  ; COPY.COST = 'Yes'
          CASE COPY.COST = '' ; COPY.COST = 'No'
          CASE COPY.COST = 2  ; COPY.COST = 'Manual Overrides Only'
          CASE COPY.COGS = 1  ; COPY.COGS = 'Yes'
          CASE COPY.COGS = '' ; COPY.COGS = 'No'
          CASE COPY.COGS = 2  ; COPY.COGS = 'Manual Overrides Only'
          END CASE
IN.PRC1:  INP COPY.PRC,29,6,21,V_'D:,Yes,No,Manual Overrides Only'
          BEGIN CASE
          CASE COPY.PRC = 'Yes'                   ; COPY.PRC = 1
          CASE COPY.PRC = 'No'                    ; COPY.PRC = ''
          CASE COPY.PRC = 'Manual Overrides Only' ; COPY.PRC = 2
          END CASE
          IF F12 THEN GOTO ABORT.IT
          !ON MOVE+1 GOTO IN.PRC,IN.PRC,IN.GEN,IN.PRC,IN.PRC,IN.PRC
          ON MOVE+1 GOTO IN.PRC,IN.PRC,IN.GEN,IN.PRC2,IN.PRC2,IN.PRC2
IN.PRC2:  INP COPY.COST,29,7,21,V_'D:':COPY.COST.OPTS
          BEGIN CASE
          CASE COPY.COST = 'Yes'                   ; COPY.COST = 1
          CASE COPY.COST = 'No'                    ; COPY.COST = ''
          CASE COPY.COST = 'Manual Overrides Only' ; COPY.COST = 2
          END CASE
          IF F12 THEN GOTO ABORT.IT
          ON MOVE+1 GOTO IN.PRC,IN.PRC,IN.PRC1,IN.PRC3,IN.PRC3,IN.PRC3
IN.PRC3:  INP COPY.COGS,29,8,21,V_'D:':COPY.COGS.OPTS
          BEGIN CASE
          CASE COPY.COGS = 'Yes'                   ; COPY.COGS = 1
          CASE COPY.COGS = 'No'                    ; COPY.COGS = ''
          CASE COPY.COGS = 'Manual Overrides Only' ; COPY.COGS = 2
          END CASE
          IF F12 THEN GOTO ABORT.IT
          ON MOVE+1 GOTO IN.PRC3,IN.PRC3,IN.PRC2,IN.PRC3,IN.PRC3,IN.PRC3
*-------------------------------------------------------------------------*
*-------------------------------------------------------------------------*
IN.TPBR:  INP.BR 21,1,8,PRC.BR,NAME,BRCHS,YES,NO
          IF F12 THEN GOTO ABORT.IT
          IF PRC.BR = '' THEN PRINT BELL:; GOTO IN.TPBR
          ON MOVE+1 GOTO IN.TPBR,IN.TPBR,IN.TPBR,IN.TPBR
*-------------------------------------------------------------------------*
IN.TSBR:  INP.BR 21,2,8,RCV.BR,NAME,BRCHS,YES,NO
          IF F12 THEN GOTO ABORT.IT
          IF RCV.BR = '' THEN PRINT BELL:; GOTO IN.TSBR
          ON MOVE+1 GOTO IN.TSBR,IN.TSBR,IN.TPBR,IN.TSBR
*-------------------------------------------------------------------------*
IN.TGEN:  INP GENS,21,3,7,'MCU',V_'D:,CURRENT,ALL,OPEN'
          IF F12 THEN GOTO ABORT.IT
          ON MOVE+1 GOTO IN.TGEN,IN.TGEN,IN.TSBR,IN.TGEN,IN.TGEN,IN.TGEN
*-------------------------------------------------------------------------*
SUBS:     ON OPTION GOTO DOIT
*-------------------------------------------------------------------------*
DOIT:     *
          *** If copying to Sales Order and if copying current GENS then
          *** inform that closed GENS will be copied. Ask if OK to proceed.
          IF GENS # 'ALL' AND IS.PSOE THEN
             MESS 6,2,'For Post Sales Orders, ALL GENS Must Be Copied!'
IN$$4:       INP A,,,0
             GENS = 'ALL'
             PRINT @(29,5):'ALL'  "L#7"
             RETURN TO IN.GEN
          END

          IF GENS = 'ALL' AND NOT(IS.PSOE) THEN
             CONT = 'N'
             PROMPT = 'All Open & Closed GENS will be Copied! Continue? (Y/N) : '
IN.CONT:     INP.PROMPT CONT,PROMPT,'YN',1
             IF NOT(CONT) THEN
                IF NEW.MODE = 'T' THEN
                   RETURN TO IN.TGEN
                END ELSE
                   RETURN TO IN.GEN
                END
             END ELSE
*** There is a new logic being incorporated now in which All GENS (both
*** open and closed) will be copied when "Current" is selected. If this
*** is selected, GENS will be set to AG (All GENS).
                GENS = 'AG'
             END
          END
          IF GENS = 'ALL' AND IS.PSOE THEN
             GENS = 'AG'
          END

          IF GENS = 'OPEN' AND NOT(IS.PSOE) THEN
             CONT = 'N'
             PROMPT = 'All Open GENS will be Copied! Continue? (Y/N) : '
IN.CONT.OPEN:INP.PROMPT CONT,PROMPT,'YN',1
             IF NOT(CONT) THEN
                IF NEW.MODE = 'T' THEN
                   RETURN TO IN.TGEN
                END ELSE
                   RETURN TO IN.GEN
                END
             END ELSE
                GENS = 'OG'
             END
          END
          IF GENS = 'OPEN' AND IS.PSOE THEN
             GENS = 'OG'
          END

          *** If user selected Copy to Purchase Order Bids,
          *** subroutine will be called
          IF (NEW.MODE = 'P' OR NEW.MODE = 'T')AND OLD.MODE = 'S' THEN
             COPT = '0'
             OE.COPY.BID.PUR COPT
             RECOST = NO
             *** Case statement checks the view selected in OE.COPY.BID.
             *** COGS will be copied to PO if the view is 2 and there is
             *** an override, or if view is 3
          END ELSE
             COPT = 0
          END

          IF SAME.CN THEN ST.CN = LED(5)<1,GEN>
          IF NEW.MODE#'T' AND ST.CN=''  THEN
             MESS 11,4,'Ship-To Customer is Required!'
IN$$5:       INP A,,,0
             PRINT BELL:;RETURN TO IN.CUS
          END
          IF NEW.MODE=OLD.MODE AND OLD.MODE='T' THEN GENS = 'ALL'

          *** Check the consignment status
          GOSUB CHK.CNSGN

          *** Initialize loop variables

          * Make sure the tri-state variable COPY.PRC is formatted properly
          BEGIN CASE
          CASE COPY.PRC = 'Yes'                   ; COPY.PRC = 1
          CASE COPY.PRC = 'No'                    ; COPY.PRC = ''
          CASE COPY.PRC = 'Manual Overrides Only' ; COPY.PRC = 2
          CASE COPY.COST = 'Yes'                  ; COPY.COST = 1
          CASE COPY.COST = 'No'                   ; COPY.COST = ''
          CASE COPY.COST = 'Manual Overrides Only'; COPY.COST = 2
          CASE COPY.COGS = 'Yes'                  ; COPY.COGS = 1
          CASE COPY.COGS = 'No'                   ; COPY.COGS = ''
          CASE COPY.COGS = 'Manual Overrides Only'; COPY.COGS = 2
          END CASE
          LED.REC     = ''
          KEY         = 'PRE.CHECK'
          VALUE       = ''
          VARS        = OLD.OID      ;* Current OID
          VARS<2>     = GEN
          VARS<3>     = NEW.MODE
          VARS<4>     = OLD.MODE
          VARS<5>     = COPT
          VARS<6>     = SAME.CN
          VARS<7>     = ST.CN
          VARS<9>     = GENS
          VARS<12>    = OLD.OID      ;* Old OID
          VARS<14>    = PRC.BR
          VARS<15>    = RCV.BR
          VARS<16>    = COPY.PRC
          VARS<17>    = CNSGN
          VARS<18>    = COPY.COST
          VARS<19>    = COPY.COGS
          *** This loop continues as long as an update is happening,
          *** if a gosub needs to end the loop, the gosub should return
          *** return to the end of the doit routine
          LOOP
             OE.COPY.BID.UPD KEY,VALUE,VARS,LED.REC
             OID = VARS<1>
             GEN = VARS<2>

             BEGIN CASE
             CASE KEY = 'ERROR'            ; GOSUB DISP.ERROR
             CASE KEY = 'COPY.IT'          ; GOSUB COPY.IT
             CASE KEY = 'COPY.IT2'         ; GOSUB COPY.IT2
             CASE KEY = 'UNLOCK.COPY'      ; GOSUB UNLOCK.COPY
             CASE KEY = 'GEN.PROMPT'       ; GOSUB GEN.PROMPT
             CASE KEY = 'CHANGE.MODE2'     ; GOSUB CHANGE.MODE2
             CASE KEY = 'CHANGE.MODE3'     ; GOSUB CHANGE.MODE3
             CASE KEY = 'CHANGE.MODE4'     ; GOSUB CHANGE.MODE4
             CASE OTHERWISE                ; GOTO END.LOOP
             END CASE
          REPEAT

END.LOOP: RETURN
END.DOIT: RETURN TO FINISH
*-------------------------------------------------------------------------*
CHK.CNSGN:*** Check the consignment status

          CNSGN = ''

          * Check for consignment authorization
          CHECK.KEY NEW.MODE:'OE.CONSIGNMENT.ALLOWED',ENTRY.OK,LEVEL
          IF NOT(ENTRY.OK) THEN RETURN

          * Check if consignment customer
          READV CUS.CNSGN FROM CUSFILE,ST.CN,124 ELSE CUS.CNSGN = ''
          IF NOT(CUS.CNSGN<1,1>) THEN RETURN

          * Check POs
          IF NEW.MODE = 'P' THEN
             ANS = ''
INCNS1:      INP.PROMPT ANS,'Is this a CONSIGNMENT PO? (Y/N) : ','YN',1
             IF ANS THEN CNSGN = 'R'
             RETURN
          END

          * Check Transfers
          IF NEW.MODE = 'T' THEN
             ANS = ''
INCNS2:      INP.PROMPT ANS,'Is this a CONSIGNMENT XFER? (Y/N) : ','YN',1
             IF ANS THEN CNSGN = 'T'
             RETURN
          END

          * Only continue if its a sales order
          IF NEW.MODE # 'S' THEN RETURN

          * Setup consignment status prompting
          TITLE = 'Consignment Status of Order'
          WRK   = 'Non-Consignment Order'
          IF LEVEL = 1 OR LEVEL > 2 THEN WRK<1,-1> = 'Consignment Transfer'
          IF LEVEL = 2 OR LEVEL > 2 THEN WRK<1,-1> = 'Consignment Billing'
          WK.CT = DCOUNT(WRK<1>,VM)
          WORD  = ''
          DFLT  = 1
          BEGIN CASE
          CASE WK.CT = 1
             WORD = WRK
          CASE LED(110) = 'S'
             LOCATE 'Consignment Transfer' IN WRK<1> SETTING DFLT ELSE NULL
          CASE LED(110) = 'B'
             LOCATE 'Consignment Billing'  IN WRK<1> SETTING DFLT ELSE NULL
          END CASE

          * Prompt for consignment status
          LOOP UNTIL WORD
             MENU.TABLE WORD,,,1,WK.CT,35,,,WRK,TITLE,DFLT
             QUIT = NO; F12 = NO
          REPEAT

          * Update consigment status
          BEGIN CASE
             CASE WORD = 'Consignment Transfer'; CNSGN = 'S'; COPY.PRC = NO
             CASE WORD = 'Consignment Billing';  CNSGN = 'B'
             CASE OTHERWISE;                     CNSGN = ''
          END CASE

          RETURN
*-------------------------------------------------------------------------*
DISP.ERROR:
IN$$1:    INP.PROMPT ,VALUE
          NEW.OID = ""
          RETURN TO END.LOOP
*-------------------------------------------------------------------------*
COPY.IT:  *
          SELECTIONS  = VALUE<1>
          GEN.LIST    = VALUE<2>
          NEW.OID     = VALUE<3>
          SELECTION   = ''
          SEL.CT      = DCOUNT(SELECTIONS, VM)

          IF SEL.CT > 0 THEN
             TITLE = "Authorized Personnel"
             ROWS  = SEL.CT
             IF ROWS > 7 THEN ROWS = 7

             MENU.TABLE SELECTION,,,1,ROWS,20,,,SELECTIONS,TITLE

             IF SELECTION = '' THEN
                RETURN TO END.LOOP
             END
          END

          GL.SOURCE.ID = ''
          GEN.CT = DCOUNT(GEN.LIST, VM)
          FOR GN = 1 TO GEN.CT
             IF GEN.LIST<1,GN> = '&PROMPT&' THEN
                IF NEW.MODE = 'S' THEN
                   IF NOT(GL.SOURCE.ID) THEN
                      OE.INIT.MODE NEW.MODE,1,,GL.SOURCE.ID
                   END
                   GEN.LIST<1,GN> = GL.SOURCE.ID
                END ELSE
                   GEN.LIST<1,GN> = ''
                END
             END
          NEXT GN

          VALUE    = GEN.LIST
          VALUE<2> = SELECTION

          RETURN
*-------------------------------------------------------------------------*
COPY.IT2: * This checks for Delete Items and prompts user for keeping them
          * on the new order.
          TEMP.VAL = VALUE
          CT = DCOUNT(TEMP.VAL,AM)

          FOR J = 1 TO CT
             PROMPT = RAISE(TEMP.VAL<J>)
             IF PROMPT # '' THEN
                CONVERT VM TO ' ' IN PROMPT
                OE.GET.AUTH OID,PROMPT,'OE.PRODUCT.USE.DELETE',ACTION.OK
                TEMP.VAL<J> = NOT(ACTION.OK)
             END
          NEXT J

          VALUE = ''
          VALUE<1> = LOWER(TEMP.VAL)

          RETURN
*-------------------------------------------------------------------------*
UNLOCK.COPY:  *
          OE.UNLOCK.LED OID

          GOSUB OPEN.OE

          RETURN TO END.DOIT
*-------------------------------------------------------------------------*
GEN.PROMPT:  *
          MSG = 'Current gen is closed and will be copied, continue?'
          ANS = ''
IN$$2:    INP.PROMPT ANS,MSG,'YN',1

          IF NOT(ANS) THEN
             RETURN TO END.LOOP
          END ELSE
             KEY = 'CHANGE.MODE'
             RETURN
          END
*-------------------------------------------------------------------------*
CHANGE.MODE2:   *
          CT = DCOUNT(VALUE<1>, VM)
          FOR J = 1 TO CT
             PROMPT = RAISE(RAISE(VALUE<1,J>))
             IF PROMPT # '' THEN
                OE.GET.AUTH OID,PROMPT,'OE.PRODUCT.USE.DELETE',ACTION.OK
                VALUE<1,J> = NOT(ACTION.OK)
             END
          NEXT J

          RETURN
*-------------------------------------------------------------------------*
CHANGE.MODE3:   *
          OE.INIT.MODE NEW.MODE,1,,VALUE

          RETURN
*-------------------------------------------------------------------------*
CHANGE.MODE4:   *
          GOSUB OPEN.OE

          RETURN TO END.DOIT
*-------------------------------------------------------------------------*
OPEN.OE:  *
          INIT.VIEW   = ''
          BEGIN CASE
          CASE NEW.MODE = 'S'; INIT.VIEW = SECURITY<21,1>
          CASE NEW.MODE = 'P'; INIT.VIEW = SECURITY<21,2>
          CASE NEW.MODE = 'T'; INIT.VIEW = SECURITY<21,3>
          END CASE
          IF INIT.VIEW = '' THEN INIT.VIEW = 1

          INIT.OID = OID
          OE.NEXT.SHIPDATE INIT.GEN

          OE NEW.MODE, INIT.VIEW, INIT.OID, INIT.GEN, NO
          NEW.OID = OID

          RETURN
*-------------------------------------------------------------------------*
ABORT.IT: IF F12 THEN
             CONFIRM.ABORT SURE
             IF NOT(SURE) THEN
                IF NEW.MODE = 'T' THEN
                   GOTO IN.TSBR
                END ELSE
                   GOTO IN.PBR
                END
             END
          END
*-------------------------------------------------------------------------*
FINISH:   *
          WINDOW.CLOSE
          RETURN
!SMITJR~01/20/10~10:05
