          SUBROUTINE (QTY,RANGE,ATTR,START.DATE,END.DATE,INC.DIR,SLS.UM)
** Version# 9.0002[6] - 08/06/2015 - 10:59am - TSMITH - eclipse
*** V9.0002 Change - Custom Coding . - 08/06/2015 - TSMITH - eclipse
** Copied from BP DICT.PRD.SALES Version# 9 - 11/06/2008 - 12:06pm - JASONH - main

*---------ATTR Definition
*         3  = Sales Qtys
*         4  = Purchases Qtys
*         5  = Transfers Qtys
*         6  = Sales $
*         7  = Purch $
*         8  = Xfer $
*         9  = Sales COGS$
*        10  = Sales GP$
*        11  = Sales GP%
*        12  = Work Order Qtys
*        13  = Rental Qtys
*        14  = Work Order $
*        15  = Rental $

*---------Range Definition
*         1  = User Defined
*         2  = MTD
*         3  = YTD
*         4  = Fiscal MTD
*         5  = Fiscal YTD
*-------------------------------------------------------------------------*

          IF INC.DIR THEN
             INC.DIR = YES
          END ELSE
             *** The second attribute is a flag to always exclude directs
             *** in PRD.SLS.QTYS.GET no matter what the control record
             *** PROD.SLS.HIST.ALL is set to.
             INC.DIR    = NO
             INC.DIR<2> = YES
          END

          SD = DATE()-30
          ED = DATE()
          *SD = "07/01/15"
          *ED = "07/30/15"
          BR$ = 2

          DICT.DATE.GET RANGE,BR$,SD,ED
          PRD.SLS.QTYS.GET @ID,BR$,RANGE,ATTR,SD,ED,QTY,,INC.DIR

          IF SLS.UM THEN
             *BR = BR$<1,1,1>
             BR = 2
             PN = @ID
             GET.ALL.PRD BR,PN,'-1',GROUP
             DFLT.PER.GET 'S',DFLT.PER,DFLT.ALPHA
             QTY = ICONV(QTY/DFLT.PER,'MR2')
          END
          RETURN

!TSMITH~08/06/15~10:59
