PORLEGLIB1 script: X3 connection properties
SET_FARMER_DOC entry point
SET_FARMER_DOC: Set farmers transport document.
This entry point allows you to define a transport document that has the farmer's transport document when the document is about to be communicated to the fiscal authorities via a web service.
Context and operating method
Transaction
There is no transaction in progress.
Log file
There is an open log file.
Different call cases
This entry point is called after gathering all relevant data from the document and before it is communicated via the web service.
Available variables
-
DTNUM variable: Indicates the document number.
-
DOCTYP variable: Indicates the document type. Depending on the document type, you can identify the origin of the document:
-
2: Document from the SDELIVERY table
-
3, 4 or 5: Document from the SRETURN table
-
6, 7 or 8: Document from the SCHGH table
-
9: Document from the PRETURN table
-
10: Document from the TRANNOTEH table
-
-
If the document is to be set as a farmer’s transport document, the FARMERDOC variable's value should be set to 1. In this case, the following variable values should also be provided (mandatory):
-
FPPD_ORIGINATING_ON: Global document number that this document should refer to (OrderReference\OriginatingON tag)
-
FPPD_MOVEMENT_TYPE: Global document type that this document should refer to (OrderReference\MovementType tag)
-
FARMER_TAX_ID: The farmer tax VAT number (FarmerTaxID tag, just the numbers, without the country code)
Open tables
Depending on the document type (DOCTYP variable), the following tables are open and with significant content:
-
SDELIVERY, with PTSDH abbreviation
-
SRETURN, with PTSRH abbreviation
-
SCHGH, with PTSGH abbreviation
-
PRETURN, with PTPNH abbreviation
-
TRANNOTEH, with PTTNH abbreviation
-
BPARTNER, with PTBPR abbreviation, for every type
TRDCOMTRACE: Prevents initialization of a new trace file during communication with Portuguese authorities.
Context and operating method
Transaction
A transaction is in progress.
Log file
There is a log file open.
Code context
This entry point is located in the PORLEGLIB1 process. It is used to prevent the initialization of a new trace file when a transport document is being communicated to the Portuguese authorities.
It is only activated if the communication is triggered via web services ([V]GWEBSERV ≠ 0).
The [L]PRIVTRACE local variable is available for use. It is initialized to 0.
To prevent the trace file from being opened, set PRIVTRACE to any value other than 0.
If PRIVTRACE = 0 and no other trace is open, a new trace file will be created.
This entry point is placed after variable declarations and table openings, but before any values are assigned or records are read.
Available variables and masks
Variable | Description |
---|---|
PRIVTRACE | Local variable (ShortInt). Set to a value other than 0 to prevent trace file creation. |
Open tables
All necessary tables for the process are already open at the time this entry point is called.