Minimum Version Required: 24.01
Pre-Conditions
Required:
Date: Enter the date in MM/dd/yyyy format for the intended Invoice Date
InvoiceNum: InvoiceNum
ProductID or ProductID_Translation: Product to be on invoice
CustomerID or CustomerID_Translation: Customer of the invoice
LocationID or LocationID_Translation: Location of the invoice
NumUnits: NumUnits for this transaction line
Steps
EDBL Routines Disclaimer: This EDBL routine represents advanced functionality primarily intended for use by Encompass technical staff. While technically proficient customers may utilize these routines, please be aware that they fall outside the scope of standard support. Assistance with EDBL routines is not covered under standard support agreements and may require billable services from our Professional Services team. Please ensure you thoroughly understand this routine before implementation in your production environment
Overview
The InvoiceOrders EDBL routine allows you to import non-verified invoice data into the system. This routine can create new invoices or update existing ones along with their related transaction line items. Each row in your imported file will represent a single line item to be added to an invoice.
Key Behaviors
Creates or updates invoices and their transaction line items
Groups rows with the same customer, date, route, PO number, and invoice number into a single invoice
Matches to existing invoices using various identifiers (InvoiceID, InvoiceNum, TranslationInvoiceNum, PONum)
Can set load sheet status during import
Supports multiple currency handling with exchange rate conversion
Can create payments on invoices when receipt amounts are included
Field Considerations
Required Fields
CustomerID or CustomerID_Translation: The customer for the invoice
ProductID or ProductID_Translation: The product for each invoice transaction
Date: The date for the invoice/load sheet
Key Matching Fields
InvoiceID: Direct match to an existing invoice ID
InvoiceNum: Match by invoice number
TranslationInvoiceNum: Match by external system invoice number
PONum: Match by purchase order number
LoadSheetID: Used for matching and grouping
Currency and Pricing Fields
FullPrice, UnitPrice, Discount, Discount2: Price components
CurrencyID or CurrencyID_Translation: Currency identifier
ExchangeRate: Exchange rate for currency conversion
NumUnits: Quantity of the product
NumUnitsCases: Alternative quantity as cases (will be converted to units)
Payment Fields
Receipt: Payment amount
PaymentTypeID or PaymentTypeID_Translation: Payment type
Paid: Mark invoice as paid (1) or unpaid (0)
Routing Fields
RouteID: Direct route assignment
RouteNum: Route number for matching to a route
RoutingMethod: Controls how invoices are routed
LoadSheetStatus: Controls status of the load sheet
Static Fields
Location: Numeric LocationID
PromoOverridden = 1 (required for Invoice; used for InvoiceOrders if current pricing structure cannot be used, Overrides Promotions if necessary)
LockPrices = 1 (to ensure Imported Prices are Locked and will not be recalculated)
Special Features
Date Formatting Options: Import accepts multiple date formats:
Standard date format in Date field
DateYYYYMMDD (8-digit format: YYYYMMDD)
DateMMDDYY (6-digit format: MMDDYY)
DateYYMMDD (6-digit format: YYMMDD)
Price Calculations: System will calculate missing price components:
If ExtPrice is provided but UnitPrice is missing, UnitPrice will be calculated
If FullPrice/UnitPrice and Discount are provided, missing components will be calculated
Currency conversion will be applied if CurrencyID/ExchangeRate are provided
Case/Unit Conversion: If NumUnitsCases is provided, it will be converted to NumUnits using the product's WholesaleUnitsPerCase value
Automatic Receipt Processing: If Paid=1 or Receipt value is provided, system will create payment records
ClearAllTrans Option: When set to 1, this will clear all existing transactions on an invoice that aren't in the imported data
Multiple Charge Types: Supports up to 5 different charge types per transaction (InvoiceChargeType1-5)
Import Actions
Add Only: Creates new invoices only, skips records that match existing invoices
Update or Add: Creates new invoices or updates existing ones based on matching fields
Update Only: Updates only existing invoices, will not create new ones
Notes and Limitations
If both InvoiceID and InvoiceNum are provided, InvoiceID takes precedence
When updating existing invoices, the system may create a new invoice audit record
Balanced or verified load sheets cannot be modified through this import
For secure payments, ensure PaymentTypeID is properly mapped
The ImportGroupID field helps segregate import data from different sources
EntrySource field allows tracking where invoices originated
Error Handling
If validation errors occur, they will appear in the import report warnings section. Common errors include:
Missing required fields (CustomerID, ProductID)
Non-existent references (products or customers that don't exist)
Permissions issues for locked invoices
Invalid LoadSheetStatus transitions