Entry points > Module Supervisor > Standard script TRTDIV 

ESC_AGIO

The ESC_AGIO entry point is used to insert additional logic to recalculate a discount or charge amounts

Context and operating mode

The following tables are on line :

Table

Significant content

Table description

COMPANY [CPY]

No

Company

FACILITY [FCY]

No

Sites

TABCUR [TCU]

No

Currency table

There is generally one transaction in process.

There may or may not be an open log file according to the calling program.

Different call cases

This entry point is called in :

- The entry of payments : SUBPAY2

- The payment proposition : PAYPROPAL2

- The open item management : MODECHE and SUBDDM2

- The printing of the customer reminders : RELANCE1

- The management of sales invoices : TRTVENFACP

- The dialogue box to verify and modify the calculation of the discount/charge (right click on the amount in the payment entry) PAYDEP

Available variables

Variables

Definition

 Value Char DEP

Discount/Charge code

Decimal value AMT

Base amount

 Value Date DATREF

Reference date

 Value Date DATPCE

Date of the initial document

 Variable Integer DELAI

Deadline

 Variable Decimal TAUX

Discount or charge rate

 Variable Decimal AMTDEP

Discount and charge amount

 Value Integer ACCNUM

These two parameters are used to identify the open item (possibility to go back up to the invoice)

 Value Integer DUDLIG

Open tables

The open tables depend on the calling program.

In all call cases, GACCDUDATE (open item table) is on line.

Important notes

- In all the call cases, the base amount is that of the open item EXCEPT for the GESPAY function (payment entry) where the amount already contains the discount or charge. Warning, for this call case, the amount on exiting the entry point (AMTDEP) must always contain the base amount +/- the discount/charge amount.

- It is not necessary to correct the amount but the rate and the lead-time must be adjusted. These variable are used for new calculations or for information.

- It is the sign of the rate that differentiates a discount amount from a charge amount.

           * The charge (+) possesses a positive rate

           * The discount (-) possesses a negative rate

- To calculate the discounts/charges see the Discount/charge calculation documentation.

COURS

Entry point COURS is used to modify the standard rate initialized in document entry (documents and invoices).

Context and operating mode

There is usually no transaction in process
There is usually no open log file.

Variables

Definition

 Value Char DEVORG

Initial currency

Value Char SITE

Site

 Value Description TYPCUR

Exchange rate type

Value    Date    DAT

°Exchange rate date

Variable Decimal COURS

Exchange rate

 Variable Integer SPSTAT

°Return status

The following tables are always open:

-COMPANY [CPY](companies)

-         FACILITY [FCY]      (sites) 

-         TABCUR [TCU]        (currencies)

The other open tables depend on the calling program.