To proceed with the routine of file generation for Accounting, you must process Off-line Accounting.
This routine makes off-line accounting entries for outflow documents, according to the parameters selected and accounting rules of standard entries:
While making the standard entries, some files will be placed, such as:
Important: In Configurator, observe the content of parameter MV_OPTNFS that indicates if off-line accounting entries are ready to use queries. If parameter MV_OPTNFS is enabled, alias CTBANFE can be used when registering standard entry 611 to identify the outflow document and aliases SF1, SD1 and SDE to account the inflow document. This is necessary because is not possible to relate those tables to the accounting main query. |
(*) Those entries are only placed depending on the type of Outflow Document.
Off-line accounting for Outflow Document can be made using threads (multiple processes simultaneously).
To use threads, parameter MV_CTBTHR must be configured with the number of processes to be run simultaneously (minimum 1 and maximum 15 processes).
Procedures
Making offline accounting entries:
1. In the offline entries maintenance window, click Parameters.
A screen is displayed with report parameters to be configured.
2. Fill out the information according to the field help instructions.
3. Check data and confirm parameter configuration.
4. Click Ok to process the routine Offline Entries.
Important Considerations
This routine was created to run on any system version, yet the following differences must be observed:
In the versions that do not use Top Connect, the system provides for each standard entry, the Aliases entered above, before making each standard entry.
For Top Connect versions, there are two configuration modes to be known:
The routine selects records using database server resources (query) and, before making the standard entry, the Aliases will be placed and made available for use. Thus, the entries could be:
Credit | Iif(!SF2->F2_TIPO$’DB’,SA1->A1_CONTA,SA2->A2_CONTA) |
Debit | SD2->D2_CONTA |
Value | SD2->D2_TOTAL+SD2->D2_VALIPI+SD2->D2_ICMRET |
The routine selects records using database server resources (query). Besides, for execution of entries, the alias CTBANFS will be made available. CTBANFS has some fields of the tables mentioned in the standard entries. Thus, the entries could be:
Credit | Iif(!CTBANFS->F2_TIPO $ ’DB’,CTBANFS->A1_CONTA,CTBANFS->A2_CONTA) |
Debit | CTBANFS->D2_CONTA |
Value | CTBANFS->D2_TOTAL-CTBANFS->D2_VALIPI+CTBANFS->D2_ICMRET |
Important: If the parameter MV_OPTNFS is filled out with T, the files SD2 - Outflow Document Item and SF2 - Outflow Document Header will not be placed. Therefore, you must use the alias CTBANFS while adding standard entries, as shown in the example above. |
Fields available in the Alias CTBANFS
SF2 | All fields, except those started in F2_BASE |
SD2 | All fields, except those started in D2_BASE |
SA2 | A2_FILIAL, A2_COD, A2_LOJA, A2_CONTA, A2_NOME, A2_NREDUZ |
SA1 | A1_FILIAL, A1_COD, A1_LOJA, A1_CONTA, A1_NOME, A1_NREDUZ |
SB1 | B1_FILIAL, B1_COD, B1_CONTA |
SF4 | F4_FILIAL, F4_CODIGO, F4_CF |
Important: To add other fields, use the entry point CTBNFS. |
Example:
User Function CTBNFS()
If PARAMIXB<>Nil
aSelect := PARAMIXB[1]
aFrom : PARAMIXB[2]
cWhere := PARAIXB[3]
//Add the specific TIO field here.
Aadd(aSelect,{”F4_MEUTS”,"C",3.0})
//Add the specific Product field here.
Aadd(aSelect,{”B1_MEUPRD”,"C",15.0})
//Add the specific Customer field here.
Aadd(aSelect,{”B1_MEUSA1”,"C",6.0})
Return({aSelect,aFrom,cWhere})
Else
Return(PARAMIXB)
EndIf
See Also