Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Description

...

Approved/ Rejected Travel Expense (per hour)

...

Summary

...

Table of Contents
minLevel1
maxLevel1
typeflat
separatorpipe
All
Page Properties

Summary

The task fetches employees when the Travel Expense has been approved or rejected. The notification is

send

sent each hour.

Customer

Keywords

Employee Portal, Travel Expense, Approved/ Rejected

Keywords

Travel Expense

Compatibility APM Version

N/A

Compatibility SQL Version

N/A

Description

...

Description

The notification task sends out an automatic email to employees when the Travel Expense has been approved or rejected. The notification is send sent each hour.

...

Main data selection

All the persons whose travel expense has been approved or rejected withing within the last hour.

SQL Statement

Expand
titleSQL Statement
Code Block
select
	ORIGINATOR.FIRSTNAME #FIRSTNAME,
	DOC.DOCUMENT_ID #DOCUMENT_ID,
	convert (date, TRAVEL.TRAVEL_DATETIME_OUT) #DATEFROM,
	convert (date, TRAVEL.TRAVEL_DATETIME_IN) #DATETO,
	WF.STATE_NAME #STATE,
	APPROVER.NAME #APPROVER_NAME,
	email.teleno #EMAIL
	--'daria.chebotaieva@adonishr.com' #Email
from WEB_CP_DOCUMENTS DOC
left join WEB_CP_WORKFLOW WF on WF.DOCUMENT_ID=DOC.DOCUMENT_ID
left join WEB_CP_TRAVEL_BILLS TRAVEL on TRAVEL.DOCUMENT_ID=DOC.DOCUMENT_ID
left join PW001P01 ORIGINATOR on ORIGINATOR.PIN=DOC.PIN
left join PW001P01 APPROVER on APPROVER.PIN=WF.APPROVER_PIN
LEFT JOIN PW001P0T email
            ON  email.PIN = ORIGINATOR.PIN
            AND email.TELETYPE = 6
            AND email.TELEPRIORITY IS NOT NULL
            AND NOT EXISTS (
                    SELECT 1
                    FROM   PW001P0T t
                    WHERE  t.PIN = email.PIN
                           AND t.TELETYPE = email.TELETYPE
                           AND t.TELEPRIORITY IS NOT NULL
                           AND (
                                   t.TELEPRIORITY < email.TELEPRIORITY
                                   OR t.TELEPRIORITY = email.TELEPRIORITY
                                   AND t.SEQUENCENO < email.SEQUENCENO
                               )
                )
where 
	DOC.CODE = 'TravInv'
	AND WF.STATE_NAME IN ('Approved', 'Rejected') 
	AND WF.STATE IN (2, 3)
	AND WF.repl_
ModifiedDate
GMTModifiedDate > DATEADD (HOUR , -1, dateadd(MINUTE,-1,GETDATE())) 

Field Specification

#FIRSTNAME- the first name of the person from the Personal Details.

#DOCUMENT_ID - the ID of the Travel Expense document that was either approved or rejected.

#DATEFROM - strat start date of the Travel Expense document.

...

#EMAIL- e-mail address of the person from the Personal Details. The e-mail with the highest priority is taken.

Sample

...

E-mail Output

Hello [#FIRSTNAME],

This e-mail is to inform that your document [#DOCUMENT_ID] for the period [#DATEFROM] - [#DATETO] has been [#STATE] by the manager [#APPROVER_NAME].

...

Best regards,
Daria

Other

Recipients: affected crew.
Can be set to a fixed email list can be modified depending on the customer. It can be:

  • a fixed list of emails;

  • or dynamic list retrieved from the database.

Schedule: Hourly, every 60 minutes.