Step by step: | This routine updates tables CT2, CT3, CT6, CT7 by importing data from a TXT file, using a preset file required by Microsiga Protheus for importing. Some attention must be given when assembling the txt file.
Instructions for TXT file assembly
The TXT booking process goes through the following 3 steps: 1- TXT Configuration, 2- Standard Entry Configuration, and 3- Execution of TXT Booking (Accounting)
1 - TXT Configuration You must configure a text file, observing only two system requirements:
- The first three characters of the line must refer to the code of the standard entry registered for this purpose.
- The user sets the quantity of bytes, that is, of columns used by the record (line), because the system asks for this information in the questions when TXT booking runs. For example: we can use 512 bytes (columns), up to a maximum of 999 bytes.
Note!
Be mindful that carriage control characters (CHR(10+13)) count as 2 characters and must be placed in columns 511 and 512.
2 - Standard Entry Configuration You must configure it in accordance with the TXT file layout, a standard entry the code of which must be in the 001 and 499 range. It must contain in its fields the functions to read text files (LerVal() and LerStr()).
3. Configuration Example
TXT File 200 X 123456 123456 Invoice Entry n. 00001 1000,25 ddmmyy or ddmmyyyy | | | | | | | | | | | |->Value (position 50 size 6) | | | | | | | | | |->Description (position 24 size 24) | | | | | | | |->Credit Account (position 17 size 6) | | | | | | ->Debit Account (position 8 size 6) | | | |-> Informative for TXT | |->Standard Entry Number (position 1 size 3)
Information to be contained in respective fields of Standard Entry. Code: 200 Debit Account: LerStr(8,6) Credit Account: LerStr(17,6) History: LerStr(24,24) Value: LerVal(50,6) Date: LerData(70,6) for ddmmyy, or lerdata(70,8) for ddmmyyyy.
Note: 1 - When executing a TXT booking, in which the accounting entry has more than one sequence, you must construct the TXT file with all entry sequences in the same line, and in each entry sequence enter the column to be read by functions LERSTR, LERVAL, and LERDATA.
2 - Upon using function LerData() to change the base date of the system, which is used as the accounting entry date, parameter 5 - Line Break in Doc. must be set to Yes, because each line can be a different date and, in this case, after running the function the system displays the booking screen. If the parameter is set to No, the system uses the date of the last line processed. 3 - For all lines to have access, you must enter one byte in addition to what is found in the file, in TXT import parameters. Example: If the TXT file has 240 characters, set import parameters to 241 bytes. |