          SUBROUTINE (AT.ID,AT.DATA,DOCS.PRD,SREC)
** Version# 13.0002[4] - 03/24/2011 - 04:04pm - SMITJR - eclipse
*** V13.0002 Change - Custom Coding .. - 03/24/2011 - SMITJR - eclipse
** Copied from BP EMAIL.ATD.S001 Version# 13 - 10/17/2007 - 03:04pm - BILLW - main

*** Subroutine - EMAIL.ATD.S001
*-------------------------------------------------------------------------*
*** Activity Subroutine for all text email Order Entry docs
*-------------------------------------------------------------------------*
*** AT.ID, AT.DATA, DOCS.PRD,SREC are Activity - Trigger parameters
*** AT.ID      - Activity Trigger ID (found in ENTTITY.TRIGGER field 1)
*** AT.DATA  1 - ...can be assigned...
*** AT.DATA  2 - CN , Entity ID (value 1 Ship To, value 2 Bill To)
*** AT.DATA  3 - BR , Branch concerning this activity-trigger
*** AT.DATA  4 - OID , Order ID
*** AT.DATA  5 - GEN , Generation (value position)
*** AT.DATA  6 - INV , Invoice number
*** AT.DATA  7 - STATUS, Current Status or Temp Status for document
***
*** DOCS.PRD   - Document Produced flag
*-------------------------------------------------------------------------*
*** PASSER and EM.DATA For EMAIL.DATA.GET
*** PASSER  1  - Email Address
*** PASSER  2  - Customer Number (e.g. Entity ID)
*** PASSER  3   - Contact ID
*** PASSER  4  - Receipiant Name
*** PASSER  5  - Subject
*** PASSER  6  - Attachment path
*** PASSER  7  - CC, Carbon Copies
*** PASSER  8  - BCC, Blind Carbon Copies
*** PASSER  9  - Flag to Append Body as Append
*** PASSER 10  - Flag that calling program will send the email
*** PASSER 11  - Flag to not call user for prompt
*** PASSER 12  - From Name (domain name will be system defined)
*                If not passed will default to @LOGNAME
*** PASSER 13  - EMAIL.SEND cannot override attachment flag (PASSER<9>)
*** PASSER 14  - If Passer9 (doc sent as append) then this will be the
*                message keyed in by user if need to pass to other pgms.
*** PASSER 15  - User BCC address for copies of EMAIL (from SEC-57)
*** PASSER 16  - User BCC Subject Prefix (from SEC-58)
*** PASSER 17  - ATTACHMENT path/key reference e.g. HOLD.FILE:nnnnn
***
*** EM.DATA  1 - CN Bill To  INIT.BT
*** EM.DATA  2 - CN Ship To  INIT.ST
*** EM.DATA  3 - BRanch  INIT.BR
*** EM.DATA  4 - OID, Order ID
*** EM.DATA  5 - GEN value position of currrent generation of order
*** EM.DATA  6 - Order Status for process
*** EM.DATA  7 - Info only call ... DO NOT SEND EMAIL
*-------------------------------------------------------------------------*
          PASSER       = RAISE(RAISE(SREC<6>))
          PASSER<10>   = YES ;* so EMAIL.DATA.GET will send email
          PASSER<11>   = YES ;* No need to prompt as promts in PASSER
          PASSER<21>   = AT.DATA<4>:'.':LED(12)<1,AT.DATA<5>>
          PASSER<9>    = NO
          PASSER<18>   = '.TXT'
          PASSER<19>   = ''


          NO.PT        = YES
          E.ATTACH     = ''
          EM.ERRS      = ''
          EM.DATA      = ''
          EM.DATA<1>   = AT.DATA<2,2> ;* CN Bill-To
          EM.DATA<2>   = AT.DATA<2,1> ;* CN Ship-To
          EM.DATA<3>   = AT.DATA<3>   ;* Branch
          EM.DATA<4>   = AT.DATA<4>   ;* OID
          EM.DATA<5>   = AT.DATA<5>   ;* GEN
          EM.DATA<6>   = "O"   ;* STATUS
          OID          = EM.DATA<4>
          GEN          = EM.DATA<5>
          OSTAT        = "O"

          IF PASSER<5> = '' THEN
             EMAIL.SET.SUBJECT 'S',OID,GEN,OSTAT,SUBJECT,ATT.NAME
             PASSER<5> = SUBJECT ;* Email Subject
          END

          *** Create the email document
          SOE.MBX.ORDER.O OID,GEN,NO.PT,OSTAT,,E.ATTACH

          EMAIL.DATA.GET EM.DATA,PASSER,,E.ATTACH,EM.ERRS
          IF NOT(EM.ERRS) THEN DOCS.PRD = YES

          RETURN
!SMITJR~03/24/11~16:04
