Import-Nav2016PurchaseInvoices

1.0.0

Accepts one format: *.xml, UBL 2.1 Invoice in the PEPPOL BIS 2.0 profile, one file per invoice.
NAV accepts the same file by hand through Incoming Documents.

The G/L account and the dimensions of a line are not part of the standard. The script reads them
from cac:InvoiceLine/cbc:AccountingCost, written like this:
   GL=8210;DEPARTMENT=ADM;PROJECT=TOYOTA
GL is the G/
Accepts one format: *.xml, UBL 2.1 Invoice in the PEPPOL BIS 2.0 profile, one file per invoice.
NAV accepts the same file by hand through Incoming Documents.

The G/L account and the dimensions of a line are not part of the standard. The script reads them
from cac:InvoiceLine/cbc:AccountingCost, written like this:
   GL=8210;DEPARTMENT=ADM;PROJECT=TOYOTA
GL is the G/L account number. Every other key is the code of a dimension that is a Shortcut
Dimension 1..8 in General Ledger Setup. A line without GL= is an error, unless config.json sets
defaultGLAccount. The vendor is taken from cbc:CustomerAssignedAccountID (NAV Vendor No.); when
that is missing, it is looked up by VAT number. Every line becomes a G/L account line with
quantity 1 and the amount of cbc:LineExtensionAmount. Credit notes and document-level allowances
and charges (cac:AllowanceCharge) are not supported.

Goes through the incoming folder. For every *.xml file it:
 1. checks that the vendor exists in NAV;
 2. checks whether an unposted invoice with the same vendor and Vendor Invoice No. already
    exists;
 3. if not, creates the invoice with all its lines and dimensions through the SOAP web service
    over Page 51 "Purchase Invoice": with one Create call, or, when the vendor card carries a
    currency, in three steps (see New-InvoiceInSteps);
 4. moves the file to processed (success) or to error (failure, together with an .err.txt
    file that holds the reason).

Nothing is posted. The invoice stays in the Purchase Invoices list and waits for Post.

The settings are read from config.json. -CreateSampleConfig creates a sample file; its fields
are described in the NOTES section (Get-Help -Full).

Show more

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Script -Name Import-Nav2016PurchaseInvoices

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Package Details

FileList

Version History

Version Downloads Last updated
1.0.0 (current version) 11 11/23/2026