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, we know the origin of the document:

2 - document from SDELIVERY table

3, 4 or 5 - document from SRETURN table

6, 7 or 8 - document from SCHGH table

9 - document from PRETURN table

10 - document from TRANNOTEH table

If the document is to be set as a farmer’s transport document, the variable FARMERDOC 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