-
Notifications
You must be signed in to change notification settings - Fork 4
Fix validation erros and parsing #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes several validation errors and parsing issues in the CII (Cross Industry Invoice) parser, particularly around handling advances, allowances/charges, and party identities. The changes ensure that empty amounts are properly handled, missing descriptions are provided, and percentage calculations are correctly derived when only base amounts are available.
- Fixes advance payment parsing to handle full payments and provide required descriptions
- Adds validation check to test suite to catch parsing errors earlier
- Implements percentage calculation from base amounts when percentage is not explicitly provided
- Adds support for parsing Legal Organization identities from party data
Reviewed Changes
Copilot reviewed 13 out of 28 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| settlement_parse.go | Adds descriptions for advances and improves payment term parsing logic |
| allowance_charge_parse.go | Implements percentage calculation from base amounts for charges and discounts |
| party_parse.go | Adds support for parsing Legal Organization identities |
| lines_parse.go | Adds null checks for product ID fields before assignment |
| examples_test.go | Adds validation check to test suite |
| party_parse_test.go | Updates test expectations for new identity parsing |
| test/data/convert/xrechnung/invoice-partial-payment.json | New test data file for partial payment scenarios |
| test/data/parse/*.xml | Test data updates with consistent tax registration IDs |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## fix-buyer-reference #34 +/- ##
=======================================================
- Coverage 72.75% 71.54% -1.22%
=======================================================
Files 23 23
Lines 1681 1743 +62
=======================================================
+ Hits 1223 1247 +24
- Misses 376 410 +34
- Partials 82 86 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This was originally tackled due to an issue with CII not having a field that specified an ammount and gobl parsed that as an empty amount which is 0. This has led me down a rabbit hole where we there where a few issues parsing. I'll describe these in more detail bellow: