Processing Purchase Invoices Downloaded from the NSeI
Polish Localization for Business Central uses the standard E-Documents functionality that has been customized to convert a document received from the National System of e-Invoices into a purchase document. To use this functionality:
Define the NSeI integration settings as described in the Setting up Integration with the National System of e-Invoices.
Define the settings for the E-Documents functionality.
Download incoming documents from the NSeI. For more information, read Downloading Purchase Invoices from the National System of e-Invoices.
Warning
The described functionality is available for Business Central 26.0 and later versions.
E-Document Service Setup
To start using the E-Documents feature that enables the processing of purchase documents you receive from the NSeI, you need to create and configure the E-Document Service feature. To set up the E-Document Service feature:
Choose the
icon, enter E-Document Service, and then choose the related link.Choose the New action.
On the E-Document Service page, on the General FastTab, complete the following fields:
- Code - Specifies the name of the service used to handle incoming documents in the system.
- Description - Specifies the description of the service used to handle incoming documents in the system. The field is filled in automatically.
- Document Format - Specifies the format of the incoming document. In the case of the functionality described, NSeI will be the document format.
- Service integration - In the current functionality version, this field should remain empty.
- E-Document Process Type - Specifies the type of processing e-documents for NSeI-related purposes. Defines the behavior of the Create E-Document action that is run on the NSeI Incoming Documents page. The following options are available:
- Blank - is used to automatically create the e-document;
- E-Document and Purchase Header - is used to automatically create the e-document header and purchase document header without filled-in lines;
- E-Document and Purchase Document with Lines - is used to automatically create the e-document and purchase document with lines filled in. If any errors occur during document processing, the purchase document is not created.
Note
The E-Document Process Type option is available from version Business Central 27.0.
On the Import FastTab, select the following fields:
- Resolve Unit Of Measure - Specify whether the unit of measure should be included during import.
- Lookup Item Reference - Specify whether the item reference should be searched during import.
- Lookup Account Mapping - Specify whether the search on the account should be based on the incoming document text while the accounts are mapped during import.
The other fields can remain selected.
Warning
In the case of the NSeI, even if the Auto Import field is selected, the documents are automatically downloaded by the system.
Setup on the Vendor Card
In order to correctly create purchase documents based on incoming documents received from the NSeI, it is necessary to enter settings on the vendor card. To define the required settings:
Choose the
icon, enter Vendors, and then select a related link.Open the card of the selected vendor the purchase document will be imported for.
On the Receiving FastTab, in the Receive E-Document To field select whether you want to create purchase orders or purchase invoices from the e-documents received from the NSeI. Corrective documents will be used to create credit memos.
If several vendor cards with the same VAT Registration No. exist, select the Default for NSeI field on the Receiving FastTab, so that the vendor card is automatically assigned to NSeI incoming documents that contain a respective VAT Registration No.
If item purchase orders are recorded for the selected vendor, choose Related - Vendor - Other - Item References on the action bar.
On the Item References page, fill in the fields:
- Reference No. - Specifies the contents of the Index field on an incoming invoice received from the selected vendor
- Item No. - Specifies the item code from Business Central.
- Variant Code - Specifies the variant code of the item variant; this field is optional.
- Unit of Measure - Specifies the default unit of measure for shipped items.
- Description - Specifies the description of the item that is associated with the given designation.
- Starting Date and Ending Date - Specifies the date range during which the specified item reference is valid. The fields can be empty.
If purchase orders are recorded in the general ledger for a selected vendor, choose Related - Purchases - Map Text to Account on the action bar.
Complete the following fields on the Mapping Text to Account page:
- Mapping Text - Specifies the contents of the P_7 field on an incoming invoice received from the selected vendor.
- Vendor No. - Specifies the vendor to which the mapping applies. The field is filled in automatically.
- Debit Acc. No. - Specifies the number of a G/L account that will be used to post purchase document transactions.
- Credit Acc. No. - Specifies the number of a G/L account that will be used to post a purchase transaction based on the credit memo.
- Balancing Account Type and Balancing Account No. - The fields are used only when journal lines are created; they are not used in the NSeI functionality.
- VAT Prod. Posting Group - Specifies the default VAT product posting group for a given transaction.
To correctly map the unit of measure for the G/L account that will be mapped based on the defined settings, choose Related - Purchases - E-Document Mapping on the action bar.
Complete the following fields on the NSeI Text Mapping page:
- Mapping Text - Specifies the value to be mapped from the source NSeI document for the type specified in the Target Type field.
- Target Type - Specifies the type of the value from the NSeI document. The following options are available:
- Unit of Measure - the value of P_8A - Miara dostarczonych towarów lub zakres wykonanych usług field on the NSeI incoming invoice;
- Payment Method - the value of the FormaPlatnosci field or the value of the OpisPlatnosci field, if another form of payment is used on the NSeI incoming invoice.
- Target Value - Specifies the value after mapping for the type selected in the Target Type field.
Note
If you receive invoices from local government units and/or VAT groups where the additional issuers are: respectively, local government subordinate units or members of a VAT group, you must define appropriate settings on the vendor card. For details, read Settings on Vendor Cards.
Creating a New Purchase Document
To create a purchase document based on an imported NSeI document:
Choose the
icon, enter NSeI Incoming Documents, and then select a related link.Select the document you want to create a purchase document for, and then select Create E-Document.
Note
The document must have the Downloaded status in order to be processed.
On the E-Document Services list page, select the service you created earlier for the NSeI and choose OK.
If the system finds multiple vendors with a selected VAT Registration No. and the Default for NSeI field is not selected for any of these vendors, the system will inform you it is necessary to select the appropriate vendor. Choose OK, and select the appropriate vendor for the invoice and confirm your selection.
After the e-document is created, decide whether the created document should be displayed. Select Yes to complete the purchase document.
Note
On the E-Document page, you can view data imported from an .xml file. To see more detailed data, select Related - View extracted data on the action bar. It is also possible to preview invoices from the NSeI. To do this, choose Preview - Preview Invoice.
To create a purchase document, choose the Reprocess Document action.
If Purchase Order is selected in the Receive e-Document to field on the vendor card, the system will prompt you to select a purchase order. To create a new document, select Cancel.
If the document is processed without errors, the Document field will display the number of the created purchase document and a direct link to it.
Warning
When inserting purchase lines, the E-documents feature may overwrite the VAT rate that was sent via NSeI. In this case, a notification is displayed and the document will be created.
Linking an Existing Order to an Invoice Received from the NSeI
The E-Documents feature allows you to import data not only into a new document, but also into an existing purchase order. To define required settings:
Steps 1-5 described in Creating a New Purchase Document are the same.
If one order number has been entered on the NSeI invoice and Purchase Order has been selected in the Receive E-Document field on the vendor's card, the system will automatically link the document to the existing, specified order. Otherwise, the system will prompt you to select the order manually.
After linking the e-document, choose the Match Purchase Order action on the action bar.
Note
Items must be received and not invoiced in order to match the lines to the order.
In the action bar, under Matching, select:
Match Automatically - when the system is to match lines based on line type, number, unit price, discount, and unit of measure;
Match Manually - to match lines manually to the purchase order. First, in the Imported Lines and Purchase Order Lines sections, select the lines to be matched.
Once all lines of the incoming invoice received from the NSeI have been matched to the purchase order, select Apply To Purchase Order on the action bar.
Creating a Purchase Document Header
The E-Documents functionality described in this article does not cover all scenarios. The following basic scenarios are not supported by the E-Documents functionality:
- a correction with the Before and After lines;
- an increasing correction;
- a document containing a line with the line type other than Item and G/L Account;
- a document of a type other than VAT and KOR in the NSeI.
In such scenarios, if the errors cannot be resolved, you may manually create the purchase document header. To create a purchase document header:
Choose the
icon, enter NSeI Incoming Documents, and then select a related link.Select the document you want to create a purchase document for, and then select Create E-Document.
On the E-Document Services list page, select the service you created earlier for the NSeI and choose OK.
After the e-document is created, the system will prompt you to confirm whether you want to display it. Select Yes to complete the creation of the purchase document.
To create a purchase document header, choose the Create Purchase Header action.
The Document field will display the number of the created purchase document and a direct link to it.
Note
You can preview the invoice downloaded from the NSeI from the created document. To do this, select Actions - E-Document - Preview NSeI Invoice on the action bar.
Creating a Purchase Document from a Local Government Unit or VAT Group
The application allows for the recording of invoices issued by a local government unit (LGU) or VAT group (GV) where a local government subordinate unit or a member of the VAT group is included as an additional entity (Podmiot3).
Creating a purchase document based on an invoice received from a local government unit (LGU) or a VAT group member (GV) follows the same procedure as described in Creating a New Purchase Document.
To facilitate the identification of entities listed on purchase invoices, new fields have been added to the e-document to map the seller and any third parties, if they appear in specific roles on the invoice received from the NSeI. If an imported invoice includes a local government unit or VAT group and a third party is listed as the LGU - issuer or VAT Group - issuer, respectively:
- The Sell-to/Buy-from No. and Sell-to/Buy-from Name fields are filled in with the details of the third party acting as a local government unit (LGU) - issuer or VAT group - issuer.
- The Bill-to/Pay-to No. and Bill-to/Pay-to Name fields are filled in with the seller's information - an LGU or VAT group.
If the vendor cards have been configured according to the guidelines in Settings on Vendor Cards, the system will automatically populate the vendor and pay-to vendor details.
The process for handling transactions with local government units and VAT groups, including issuing invoices for these entities has been described in Handling Transactions with Local Government Units (JST) and VAT Groups.
Warning
To use the feature for automatic completion of third-party data on a purchase invoice, select Bill-to/Pay-to No. in the Bill-to/Sell-to VAT Calc. field on the General Ledger Setup page.
Validation of Gross and VAT Amounts on the Purchase Document
By default, the Business Central system validates the gross amounts and VAT amounts for documents created via E-documents. For documents in the local currency, you can disable this validation feature in the E-document service. However, due to the specific requirements of the National e- System of e-Invoices, it is necessary to validate the gross amount in the foreign currency and the VAT amount in the local currency for foreign-currency invoices when the VAT amount is recorded as a separate entry. For foreign currency invoices that are not posted in a separate VAT entry, the validation applies only to the gross amount in this currency.
Disabling VAT Amount Validation
In justified cases, you can disable the validation of the gross amount in a foreign currency and the VAT amount in the local currency when posting the VAT amount as a separate entry.
To disable validation of the gross amount in a foreign currency and the VAT amount in the local currency:
- Choose the
icon, enter NSeI Setup, and then choose the related link. - Select the Disable VAT Amount (LCY) Validation field.
Editing Amounts Imported from the NSeI
If an invoice contains non-standard lines with deductions, charges, deposits, or other values that affect the document’s total value, the system imports and verifies only the amounts corresponding to invoice lines. If any additional amounts are to be posted for the invoice, you must edit the imported values to reflect the change in the gross amount or the VAT amount.
Similarly, if the invoice is to be posted excluding VAT, even though the original invoice included VAT, these amounts must also be adjusted. Polish Localization provides a feature to edit the gross amount and VAT amount entered from an imported document.
To edit amounts imported from the NSeI:
Choose the
icon, enter NSeI Incoming Documents, and then select a related link.On the NSeI Incoming Documents page, in the Purchase Document No. field choose a number of an invoice you want to modify to include the imported amounts.
On the Purchase Invoice page, select the Edit Imported NSeI Amounts action.
On the Edit Imported NSeI Amounts page, change the values in the following fields:
- Doc. Amount Incl. VAT (Imported) - Specifies the total amount (including VAT) of the purchase invoice or credit memo based on the imported external document. This field is read-only.
- Doc. Amount VAT (Imported) - Specifies the total amount (including VAT) of the purchase invoice or credit memo based on the imported external document. This field is read-only.
- Doc. Amount Incl. VAT - Specifies the total amount (including VAT) of the purchase invoice or credit memo.
- Doc. Amount VAT - Specifies the total VAT amount of the purchase invoice or credit memo.
Choose Close to save your changes. The system will automatically update the Doc. Amount VAT and Document VAT Amount fields on the Purchase Invoice page based on the amounts you entered.
Correcting or Cancelling Purchase Invoices with an NSeI Number
The Polish Localization application includes a feature that allows you to correct or cancel incorrectly posted purchase invoices that include an assigned NSeI number. This feature is described on the following page: Correcting or Cancelling Purchase Invoices with an NSeI Number.
Deleting Processed NSeI Incoming Documents
To reduce the amount of stored data, a mechanism has been implemented to delete XML files and QR codes associated with processed incoming NSeI incoming documents. This mechanism can be triggered automatically when an invoice is posted, using the Remove Processed Documents by Date report, or using the job queue.
Deleting Processed Incoming NSeI Incoming Documents after Posting
To set up the automatic removal of processed incoming NSeI incoming documents after posting:
- Choose the
icon, enter NSeI Setup, and then choose the related link. - On the NSeI Setup page, select the Delete XML Invoice After Posting option so that the XML file and QR code for the corresponding NSeI incoming document are automatically deleted after the purchase document is posted.
Bulk Deletion of Processed Incoming NSeI Incoming Documents after Posting
To run a bulk deletion of archived NSeI incoming documents:
- Choose the
icon, enter Delete Processed NSeI Incoming Documents, and then select a related link. - On the Delete Processed NSeI Incoming Documents page, on the Options FastTab, set the value in the Remove Documents Processed By Date field to specify the date by which NSeI incoming documents with the Processed status will be removed.
- On the NSeI Incoming Document filter FastTab in the Status field select the status of the documents to be deleted.
- Choose OK to delete NSeI incoming documents according to the setting you have defined.
Note
By default, NSeI incoming documents older than 3 months with the following statuses: Skipped for Processing,Purchase Document Posted and Gen. Journal Posted are deleted. You can change the setting that specifies the deletion date, but the latest date you can set is always a date that is not earlier than 3 months ago.
Note
You can also initiate the deletion of processed NSeI incoming documents using the job queue run with codeunit DeletePostedNSeIIncDocs. The job queue works in the same way as the report and uses the default setup for deleting documents.
See Also
Setting up Integration with the National System of e-Invoices
Issuing and Posting a Structured Invoice
Sending Invoices to the National System of e-Invoices
Invoicing Modes and the NSeI Unavailability Log
Downloading Purchase Invoices from the National System of e-Invoices
Entering an NSeI Number or a Designation for a Missing NSeI Number