Philipp
dd32514938
Fix percentage-based allowance/charge calculations (EN16931 compliance)
...
Two arithmetic bugs caused wrong line totals when percentage-based allowances
or charges were used:
Bug A — Product-level (product.allowances): The percent discount was computed
as (price * pct/100) * quantity (line total), then subtracted from the unit
price and multiplied by quantity again — discount applied twice.
Bug B — Item-level (itemAllowances) with basisQuantity != 1: The percent was
applied to price * quantity instead of price * quantity / basisQuantity.
Fix: LineCalculator and XML pull providers now pass context-appropriate
IAbsoluteValueProvider wrappers (perUnitProvider for product-level,
itemBasisProvider for item-level). Allowance.java uses RoundingMode.HALF_UP
in getPercent().divide(100). BasisAmount in XML is formatted via
currencyFormat().
Files changed:
- LineCalculator.java: perUnitProvider, itemBasisProvider in allowance/charge loops
- Allowance.java: RoundingMode.HALF_UP, scale 18
- ZUGFeRD2PullProvider.java: correct providers, format BasisAmount
- OXPullProvider.java, DAPullProvider.java: perUnitProvider for product-level
- CalculationTest.java: @Test on 5 methods, 4 new regression tests
Verification: mvn test -pl library -Dtest=CalculationTest
Full PR description with before/after XML proof: see .project/PR-allowance-charge-fix.md
(Test evidence files in C:\temp\mustang-test\ are for PR attachment only, not in repo.)
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-04-27 18:09:13 +02:00
langfr
2490d1caf9
Add BasisAmount to CashDiscount.
2026-04-25 14:20:27 +01:00
langfr
6e9b5a1223
Merge branch 'bugfix/1022' of https://github.com/langfr/mustangproject into langfr-bugfix/1022
2026-04-25 13:20:19 +01:00
langfr
f5150d962a
Merge branch 'bugfix/DespatchDelivery' of https://github.com/langfr/mustangproject into langfr-bugfix/DespatchDelivery
2026-04-25 12:55:29 +01:00
Frank Langelage
bd69a3f32d
Merge branch 'master' into bugfix/1062
2026-04-25 12:58:10 +02:00
Jochen Stärk
6418c811bc
corrected history, test
2026-04-23 17:46:59 +02:00
Jochen Stärk
d0d6d99192
Added Extended-CTC-FR to profiles for commandline
2026-04-23 17:42:13 +02:00
Jochen Stärk
ca392054e5
corrected tests
2026-04-16 13:53:44 +02:00
Jochen Stärk
3040687147
corrected a test
2026-04-16 13:24:21 +02:00
Jochen Stärk
56e4be84bf
removed debug output
2026-04-16 13:23:55 +02:00
Jochen Stärk
98e3168d1d
Adding quotes around Strings sometimes helps...
2026-04-10 15:43:05 +02:00
Jochen Staerk
406f3c83d9
Merge pull request #1037 from pgjacobs/zugferd_pdf_xml_compression
...
Compress attachments
2026-04-10 15:38:23 +02:00
Jochen Staerk
a6946755a3
Merge pull request #1039 from xedaniel/master
...
fix : #1038
2026-04-10 15:35:49 +02:00
Jochen Staerk
1bcca05fc5
Merge pull request #1083 from truearken/feature-pdf-langs
...
PDF Visualizations in English and French
2026-04-09 11:22:16 +02:00
Jochen Staerk
6b9961d3e9
Merge pull request #1084 from Marcel-Aimpulse/fix-xml-description
...
Fix xml description
2026-04-08 16:20:28 +02:00
Jochen Staerk
edb032310d
Merge pull request #1055 from langfr/bugfix/ApplicableTradeTax
...
Correct order of ApplicableTradeTax sub-elements.
2026-04-08 16:17:13 +02:00
Jochen Staerk
060cf623be
Merge pull request #1052 from langfr/bugfix/1048
...
Remove parsing OriginatorDocumentReference.ID as date.
2026-04-08 16:05:39 +02:00
Jochen Staerk
d705f06f95
Merge pull request #1073 from kschwank/feature/hierarchical-positions-xml-export
...
add hierarchical invoice positions in CII XML export for EXTENDED pro…
2026-04-08 15:52:31 +02:00
Marcel Westenberg Aimpulse
b0f43c0bb5
Extracted local constant for XML description
2026-04-07 18:01:36 +02:00
Marcel Westenberg Aimpulse
e880bf7f6e
Changed old invalid link to new ZUGFeRD/factur-x link
2026-04-07 17:31:42 +02:00
Jochen Staerk
7fcf1e93cb
Merge pull request #1050 from klaus0x7c4/validation-report-pdf-with-validator-info
...
Add validator information to PDF report (name and version)
2026-04-07 15:56:59 +02:00
Jochen Staerk
cfb1f9f7a8
Merge pull request #1060 from meparis/fix-bt18-referenceTypeCode
...
Add ReferenceTypeCode for BT-18 AdditionalReferencedDocument
2026-04-07 15:55:25 +02:00
Jochen Staerk
cc4b8ab55c
Merge pull request #1046 from meparis/feature/bt23-settable
...
Add configurable BT-23 business process ID for CII export
2026-04-07 15:52:55 +02:00
Jochen Staerk
e4a139a815
Merge pull request #1061 from langfr/feature/TestIndicator
...
Add ability to mark an Invoice as a test invoice.
2026-04-07 15:50:28 +02:00
Jochen Staerk
8f85f3f9d1
Merge pull request #1082 from langfr/feature/xmlTools
...
Centralize and secure DocumentBuilder creation.
2026-04-07 15:46:11 +02:00
Aaron
08b3fbc227
feature: pdf visualization translations
2026-04-07 15:29:07 +02:00
Jochen Stärk
85457033fa
corrected two failing unit tests, partly reverting #1049
2026-04-06 16:06:30 +02:00
Jochen Stärk
d48f69f3bd
Merge branch 'master' of github.com:ZUGFeRD/mustangproject
2026-04-06 15:40:53 +02:00
Jochen Stärk
2a9b9221af
additional output in arithmetric exception
2026-04-06 15:40:41 +02:00
langfr
756191a081
Centralize and secure DocumentBuilder creation.
2026-03-31 20:18:34 +01:00
langfr
1d20f359f0
Allowed only for Extended profile.
2026-03-24 19:53:21 +01:00
Jochen Staerk
b0b21ae2d7
Merge pull request #1072 from langfr/bugfix/GrandTotal
...
Correct XPath-expressions for GrandTotal and TaxBasisTotalAmount.
2026-03-24 13:36:41 +01:00
Jochen Stärk
89042d505a
Merge branch 'master' of github.com:ZUGFeRD/mustangproject
2026-03-24 13:31:40 +01:00
Jochen Stärk
01c99d2d58
parse xml only if xml parseable in invoiceimporter (affecting metrics)
2026-03-24 13:31:24 +01:00
Jochen Staerk
6b6083f454
Merge pull request #1015 from ThomasChr/fix993
...
fix for #993
2026-03-24 13:14:36 +01:00
Karsten Schwank
c88d64680e
add hierarchical invoice positions in CII XML export for EXTENDED profile
2026-03-22 16:36:42 +01:00
langfr
ab25d54d58
Correct XPath-expressions for GrandTotal and TaxBasisTotalAmount.
2026-03-22 13:22:25 +01:00
langfr
4afa36c73e
Correct order of "DespatchAdviceReferencedDocument" and "DeliveryNoteReferencedDocument".
2026-03-20 16:16:55 +01:00
langfr
49624c6bda
Move getNamespaceForVersion and getPrefixForVersion to inheriting class.
2026-03-14 20:04:45 +01:00
Jochen Staerk
078e18b565
Merge pull request #1044 from langfr/bugfix/1040
...
Correct version of org.apache.pdfbox:fontbox from 3.0.3 to 3.0.6.
2026-03-11 16:08:29 +01:00
langfr
53c055576c
Add ability to mark an Invoice as a test invoice.
2026-03-06 11:52:00 +00:00
Zahi YOUSFI
4fd9148505
Add ReferenceTypeCode for BT-18 AdditionalReferencedDocument
2026-03-05 12:45:59 +01:00
langfr
4fc7ee1141
Correct order of ApplicableTradeTax sub-elements.
2026-03-02 22:36:32 +00:00
langfr
2f5b17132c
Remove parsing OriginatorDocumentReference.ID as date.
2026-03-01 12:42:41 +00:00
Jochen Stärk
a59fce7dab
closes #1049
2026-02-26 14:25:23 +01:00
Jochen Stärk
fb0634f279
prevent two exceptions
2026-02-26 13:50:05 +01:00
pgjacobs
8ce79b3678
Configurable PDF Attachment Compression
2026-02-26 12:26:21 +01:00
KNoeske
4a0ab87427
Add validator information to PDF report (name and version)
2026-02-25 20:07:33 +01:00
Zahi YOUSFI
00088fbc31
Fix unit test for configurable BT-23 (BusinessProcessIdCiiTest)
2026-02-19 16:50:43 +01:00
Zahi YOUSFI
be6db43e1e
Add configurable BT-23 business process ID for CII export
2026-02-19 15:59:00 +01:00