Skip to main content
Version: Current

Purchase Credit Memo

Overview

Direction: Zudello → Business Central
Sync Type: Real-time
Trigger: Credit memo approval in Zudello

Purchase credit memos flow from Zudello to Business Central for supplier credit processing. This integration mirrors the invoice structure but handles credit amounts and includes automatic cleanup on failures.

Key Features
  • Automatic Amount Conversion - Negative values converted to positive credits
  • Sequential Processing - Lines processed individually with immediate error handling
  • Status Tracking - Real-time status updates back to Zudello
  • Cleanup on Failure - Automatic rollback using document ID

Field Mappings

Header Fields

Business Central FieldZudello FieldData TypeNotes
currencyCodecurrency.codeStringCredit memo currency
creditMemoDatedate_issuedDateCredit memo date
postingDatedate_postedDatePosting date (defaults to date_issued)
invoiceNumbernumberStringCredit memo reference number
vendorNumbersupplier.codeStringSupplier code

Line Item Fields

Business Central FieldZudello FieldData TypeNotes
descriptiondescriptionStringLine item description
documentIdN/AGUIDHeader document ID
lineObjectNumberitem.code or account.codeStringItem or account reference
lineTypeN/AString"Item" or "Account" based on line type
quantityquantityDecimalAbsolute value of quantity
taxCodetax_rate.codeStringTax rate code
unitCosttotal_exclusive / quantityDecimalAbsolute value of calculated unit cost

Credit Amount Handling

Business Central expects credit memo amounts to be positive. The integration automatically converts any negative credit amounts from Zudello into positive values before sending them to Business Central. Both the quantity and unit cost are converted to their absolute (positive) values.

Error Handling

To ensure data integrity, if any part of the credit memo creation process fails, the entire transaction is rolled back.

  • Line Item Failures: If a line item fails to be created, the entire credit memo is automatically deleted from Business Central.
  • Status Tracking: The credit memo in Zudello will be marked as "UNABLE" to indicate the failure.
  • Error Logging: Detailed error messages are recorded to help with troubleshooting.

Processing Logic

Amount Handling

  • Positive Values: The integration ensures all quantities and costs sent to Business Central are positive, as required for credit memos.
  • Credit Logic: Business Central is designed to handle credit amounts as positive numbers, and the integration respects this by converting all values accordingly.

Error Recovery

  1. Failure Detection: The system immediately detects if any line item fails to process.
  2. Document Cleanup: Upon failure, the integration automatically deletes the entire credit memo from Business Central to prevent partial data.
  3. Status Update: The original record in Zudello is marked as "UNABLE", and the reason for the failure is logged.

Troubleshooting

IssueCauseSolution
Credit memo creation failsMissing supplierVerify supplier exists in Business Central
Line items rejectedInvalid item/account codesCheck master data synchronization
Amount calculation errorsZero quantity valuesVerify line item quantities in Zudello
Status shows "UNABLE"Processing failureReview error logs for specific failure point
Processing Notes
  • Sequential Lines: Each line is processed individually
  • Immediate Failure: First error stops processing and triggers cleanup
  • Positive Amounts: All negative Zudello values become positive in Business Central