Purchase Invoice
Overview
Direction: Zudello → Business Central
Sync Type: Real-time
Trigger: Invoice approval in Zudello
Purchase invoices flow from Zudello to Business Central after approval processing. This integration supports line items, dimensions, attachments, and includes comprehensive error handling with automatic rollback capabilities.
- Multi-step Processing - Header → Lines → Dimensions → Comments → Attachments
- Dimension Support - Full cost center and project tracking
- File Attachments - Automatic document upload with verification
- Error Rollback - Complete cleanup on any processing failure
- Real-time Status - Immediate feedback to Zudello on success/failure
Field Mappings
Header Fields
Business Central Field | Zudello Field | Data Type | Notes |
---|---|---|---|
currencyCode | currency.code | String | Invoice currency |
dueDate | date_due | Date | Payment due date (optional) |
invoiceDate | date_issued | Date | Invoice date |
postingDate | date_posted | Date | Posting date (defaults to date_issued) |
pricesIncludeTax | N/A | Boolean | Always set to false |
vendorInvoiceNumber | document_number | String | Supplier's invoice number |
vendorNumber | supplier.code | String | Supplier code |
Line Item Fields
Business Central Field | Zudello Field | Data Type | Notes |
---|---|---|---|
description | description | String | Description is limited to 100 characters |
documentId | N/A | GUID | Header document ID |
lineObjectNumber | item.code or account.code | String | Item or account reference |
lineType | N/A | String | "Item" or "Account" based on line type |
quantity | quantity | Decimal | Line quantity |
taxCode | tax_rate.code | String | Tax rate code |
unitCost | total_exclusive / quantity | Decimal | Calculated unit cost |
Dimension Fields
Business Central Field | Zudello Field | Data Type | Notes |
---|---|---|---|
code | metadata dimension mapping | String | Dimension code from metadata |
valueCode | {dimension}.code | String | Dimension value code |
Supported Dimensions
The following dimensions are supported if configured in metadata:
- batch
- bin
- cost_centre
- cost_type
- department
- project
- warehouse
- zone
Additional Features
Comment Lines
- Zudello URL: A comment line containing the Zudello document URL is added for reference
- Line Type: Set to "Comment"
- Description: Contains the short_url from Zudello
File Attachments
- Source: EXTRACTED file attachments from Zudello
- Process: Two-step attachment creation (record creation + file upload)
- Parent Type: "Purchase_x0020_Invoice"
- Verification: Attachment upload is verified by checking file size
Error Handling
To maintain data consistency, the integration includes a robust error handling process. If any step in creating the purchase invoice fails (including adding lines, dimensions, or attachments), the entire invoice is deleted from Business Central. The invoice in Zudello is then marked as "UNABLE", and detailed error information is logged to help identify and resolve the issue.
Configuration Requirements
To use dimensions with purchase invoices, you must first configure the dimension mappings in your metadata settings. This ensures that Zudello knows how to map data to the correct dimensions in Business Central, such as projects, departments, or cost centres.
Troubleshooting
Issue | Cause | Solution |
---|---|---|
Invoice creation fails | Missing supplier in BC | Verify supplier sync completed |
Line items rejected | Invalid item/account codes | Check master data synchronization |
Dimensions not applied | Missing metadata config | Configure dimension mappings |
Attachments missing | File upload failure | Check file size and format |
Status shows "UNABLE" | Processing error occurred | Review error logs for details |