Skip to content

Fix: peppol parser rate calculation#32

Merged
pritambiswal merged 4 commits into
developfrom
fix/peppol-parser-rate-calculation
Jan 26, 2026
Merged

Fix: peppol parser rate calculation#32
pritambiswal merged 4 commits into
developfrom
fix/peppol-parser-rate-calculation

Conversation

@pritambiswal
Copy link
Copy Markdown
Contributor

Summary

  • Fix incorrect rate calculation in PEPPOL XML parser that was dividing PriceAmount by
    InvoicedQuantity instead of BaseQuantity

Problem

When parsing incoming PEPPOL UBL invoices, the parser was calculating the item rate incorrectly by
dividing PriceAmount by InvoicedQuantity (the line quantity) instead of BaseQuantity (from the
element).

Example XML:

2.00000
420.00

210.00000
1

Root Cause

In UBL 2.1 / PEPPOL BIS Billing 3.0:

  • cbc:PriceAmount = the price per base quantity unit
  • cbc:BaseQuantity = the quantity that the price applies to (default: 1)
  • cbc:InvoicedQuantity = the quantity being invoiced

The rate formula should be: rate = PriceAmount / BaseQuantity

The parser was incorrectly using: rate = PriceAmount / InvoicedQuantity

Preetam Biswal added 3 commits January 22, 2026 21:28
- Introduced new fields in EDocument JSON schema for matching status and data.
- Implemented `get_matching_status` and `save_matching_data` methods in EDocument class to handle matching logic.
- Updated EDocument Profile JSON to include matcher path configuration.
- Enhanced XML parser to accept EDocument instance for accessing matching data.
- Developed PEPPOL-specific matcher to extract and match supplier, items, and purchase order data from XML.
- Added dialog configuration for manual matching of unmatched entities.
- Created basic matcher as a fallback for profiles without specific matching logic.
@pritambiswal pritambiswal changed the title Fix/peppol parser rate calculation Fix: peppol parser rate calculation Jan 26, 2026
@pritambiswal pritambiswal merged commit 708c8fe into develop Jan 26, 2026
4 checks passed
@pritambiswal pritambiswal deleted the fix/peppol-parser-rate-calculation branch January 26, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant