          SUBROUTINE (PASSER)
** Version# 27 - 05/16/2002 - 05:09pm - ERINZ - develop

*** Subroutine: SLS.DVR.CUST.COMPR
*-------------------------------------------------------------------------*
*** This is the driver for the Customer Sales Comparison Report
*-------------------------------------------------------------------------*
*** Parameters:
***       PASSER    - not used
*-------------------------------------------------------------------------*

          SCREEN

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

          DRPT$      = 'Customer Comparison Report'
          SD         = DATE()
          SLSP       = ''
          SLSIN.OUT  = 'Outside'
          SORTBY     = 'Salesperson'
          BRCHS      = ''
          SBRCHS     = ''
          FISCAL.DT  = 'Fiscal'
          LEVEL      = 'Bill-To'
          SHOW.MISC  = 'Exclude'
          SUPPR      = YES
          USE.BLBR   = 0
          XCURR      = ''
          TERR.OK = YES
          TPQ        = ''
          SORTS      = 'Salesperson,Customer,Salesperson by SelCode,Salesperson Summary,'
          SORTS     := 'MTD Sales,YTD Sales,LYTD Sales,MTD-GP$,YTD-GP$,LYTD-GP$,MTD-GP%,YTD-GP%,LYTD-GP%,'
          SORTS     := 'Salesperson-MTD Sales,Salesperson-YTD Sales,Salesperson-LYTD Sales,Salesperson-MTD-GP$,Salesperson-YTD-GP$,Salesperson-LYTD-GP$,Salesperson-MTD-GP%,Salesperson-YTD-GP%,Salesperson-LYTD-GP%'
          CONVERT "," TO VM IN SORTS

          PRINT @(29,5):OCONV(SD,'D4/')"L#10"
          PRINT @(40,12):'NY'[SUPPR+1,1]
          PRINT @(40,13):'NY'[USE.BLBR+1,1]
*-------------------------------------------------------------------------*
INBR:     INP.BR 29,3,10,BR,NAME,BRCHS,TERR.OK
          IF F12 THEN GOTO FINISH
          ON MOVE+1 GOTO INBR,INBR,INBR,INBR,INSBR,INSBR
*-------------------------------------------------------------------------*
INSBR:    INP.BR 29,4,10,SBR,NAME,SBRCHS,TERR.OK
          IF F12 THEN GOTO FINISH
          ON MOVE+1 GOTO INSBR,INSBR,INBR,INSBR,INSD,INSD
*-------------------------------------------------------------------------*
INSD:     INP SD,29,5,10,'VD4/'
          IF F12 THEN GOTO FINISH
          ON MOVE+1 GOTO INSD,INSD,INSBR,INSD,INSLSP,INSLSP
*-------------------------------------------------------------------------*
INSLSP:   INP SLSP,29,6,10,'MCU',V_'INITIALS'
          IF F12 THEN GOTO FINISH
          ON MOVE+1 GOTO INSLSP,INSLSP,INSD,INSLSP,INTYPE,INTYPE
*-------------------------------------------------------------------------*
INTYPE:   INP SLSIN.OUT,29,7,7,V_'D:,Outside,Inside'
          IF F12 THEN GOTO FINISH
          ON MOVE+1 GOTO INTYPE,INTYPE,INSLSP,INTYPE,INSORT,INSORT
*-------------------------------------------------------------------------*
INSORT:   INP SORTBY,29,8,23,V_'D:':SORTS
          IF F12 THEN GOTO FINISH
          ON MOVE+1 GOTO INSORT,INSORT,INTYPE,INSORT,INFCL,INFCL
*-------------------------------------------------------------------------*
INFCL:    INP FISCAL.DT,29,9,10,V_'D:Fiscal':VM:'Calendar'
          IF F12 THEN GOTO FINISH
          ON MOVE+1 GOTO INFCL,INFCL,INSORT,INFCL
*-------------------------------------------------------------------------*
INBS:     INP LEVEL,29,10,7,V_'D:,Bill-To,Ship-To,Parent'
          IF F12 THEN GOTO FINISH
          ON MOVE+1 GOTO INBS,INBS,INFCL,INBS
*-------------------------------------------------------------------------*
INTPQ:    INP TPQ,29,11,4,"R0"
          IF F12 THEN GOTO FINISH
          ON MOVE+1 GOTO INTPQ,INTPQ,INBS,INTPQ
*-------------------------------------------------------------------------*
INSUP:    INP SUPPR,40,12,1,'YN'
          IF F12 THEN GOTO FINISH
          ON MOVE+1 GOTO INSUP,INSUP,INTPQ,INSUP
*-------------------------------------------------------------------------*
INBLBR:   INP USE.BLBR,40,13,1,'YN'
          IF F12 THEN GOTO FINISH
          ON MOVE+1 GOTO INBLBR,INBLBR,INSUP,INBLBR,INCURR,INCURR
*-------------------------------------------------------------------------*
INCURR:   INP XCURR,29,14,6,V_'S:VERF.XCURR.ID'
          IF F12 THEN GOTO FINISH
          ON MOVE+1 GOTO INCURR,INCURR,INBLBR,INCURR
*-------------------------------------------------------------------------*
*** Include/Exclude/Only show Direct Orders Input...
INMISC:   INP SHOW.MISC,33,15,7,V_'D:Exclude':VM:'Include':VM:'Only'
          IF F12 THEN GOTO FINISH
          ON MOVE+1 GOTO INMISC,INMISC,INCURR,INMISC,INMISC,INMISC
*-------------------------------------------------------------------------*

SUBS:     IF SD=''        THEN PRINT BELL:; RETURN TO INSD
          IF BRCHS=''     THEN PRINT BELL:; RETURN TO INBR
          IF SBRCHS=''    THEN PRINT BELL:; RETURN TO INSBR
          IF SLSIN.OUT='' THEN PRINT BELL:; RETURN TO INTYPE
          IF SORTBY=''    THEN PRINT BELL:; RETURN TO INSORT
          IF FISCAL.DT='' THEN PRINT BELL:; RETURN TO INFCL
          IF LEVEL=''     THEN PRINT BELL:; RETURN TO INBS

          IF OPTION < 3 THEN
             PH.COST.AUTH.CHECK COST.TYPE
             IF COST.TYPE = '' THEN RETURN
          END

          ADDL.DATA = XCURR:VM:SHOW.MISC

          PH.EXE 'SLS.PHR.CUST.COMPR',BRCHS,BR,SD,SLSP,SORTBY,FISCAL.DT,SBRCHS,SBR,COST.TYPE,USE.BLBR,LEVEL,SLSIN.OUT,TPQ,SUPPR,ADDL.DATA
          IF F12 THEN RETURN

          RETURN TO FINISH
*-------------------------------------------------------------------------*
FINISH:   WINDOW.CLOSE
          RETURN
!ERINZ~05/16/02~17:09
