TRTPCEB script: TRTPCEB
MAJ_CODCPT : Accounting code management
The MAJ_CODCPT entry point allows you to use accounting codes contained in specific tables.
Context and operating mode
Transaction
There is one transaction in progress.
Log file
A log file is normally open (this depends on the context).
Different call cases
The "INIACCCOD" entry point is located in the loop carried out on the setup of the accounting codes defined for the automatic journal line that is currently being generated. It is called just after the initialization of the accounting code to be used for the generation of a posting. It is then used to overwrite the initialization carried out as standard for the accounting code type. It is also used to initialize the accounting code for an accounting code type that has been added and is used in the automatic journals.
Available variables and masks
The journal is stored before its validation in the GACCENT0 [HAE0], GACCENT1 [HAE1] and GACCENT2 [HAE2] screens. All the fields in these screens are accessible and can be modified provided that the general rules for document validation are respected. If new fields are added to the accounting document tables, they must also be added in these screens.
The "INIACCCOD" entry point is called in the loop for accounting codes set up for the automatic journal line. K is the index used (For K=0 To [F :GAD]NBRTYP-1). [F:GAD]TYPACCCOD(K) corresponds to the accounting code type defined on the K-1 line in the accounting code setup table for the automatic journal line that is currently being generated.
The "CLECPT" local variable contains the value of the key for the table where the search is being carried out for the accounting code.
The "CODCPT" local variable is that which will contain the accounting code to be used in the generation of the posting line.
In order to modify the initialization carried out as standard or to initialize the accounting code for a new accounting code type defined and not managed as standard, it is necessary to write in the specific processing:
Case [F:GAD]TYPACCCOD(K)
when 20
Call LECTURE("ONA",CLECPT,"") from CONTOBJ
If fstat: CODCPT: Else: CODCPT = [F:ONA]ACCCOD: Endif
when ...
Endcase
Open tables
All the tables related to the creation of an accounting entry are open.
Table |
Significant content |
Table title |
GAUTACE [GAU] |
Yes |
Automatic journals |
GAUTACED [GAD] |
Yes |
Automatic journal lines |
GACCOUNT [GAC] |
No |
Accounts |
GACCCODE [CAC] |
No |
Sales invoice lines |
CACNA [CNA] |
No |
Natures |
COMPANY [CPY] |
No |
Companies |
FACILITY[FCY] |
No |
Sites |
In addition, the triggering table and the linked tables are on line.
Other tables can be on line depending on the call context.
Context and operating method
There is usually no transaction in progress.
There is usually no open log file.
Variables |
Definition |
Char CLECPT (250) |
Identifier(s) |
Char CODCPT |
Accounting code |
The CLECPT variable contains the identifier of the entity to be read in order to return the accounting code in the CODCPT variable.