Commit Graph

2522 Commits

Author SHA1 Message Date
langfr
3cd2273621 Merge branch 'master' of https://github.com/ladapos/mustangproject into ladapos-master 2026-05-28 15:12:57 +01:00
langfr
90ecf8313b Merge branch 'langfr-bugfix/1127' 2026-05-28 15:01:21 +01:00
langfr
a542a61194 Merge branch 'bugfix/1127' of https://github.com/langfr/mustangproject into langfr-bugfix/1127 2026-05-28 14:58:51 +01:00
langfr
a8d5ee8822 Fix possible StringIndexOutOfBoundsException when extracting XMP. 2026-05-28 14:49:39 +01:00
A422382
938d23dc87 Fix #1126 IncludedNote SubjectCode ACB, INV 2026-05-27 12:15:23 +02:00
Jochen Stärk
926a953292 [maven-release-plugin] prepare for next development iteration 2026-05-21 10:04:24 +02:00
Jochen Stärk
55486cca41 [maven-release-plugin] prepare release core-2.23.1 2026-05-21 09:59:26 +02:00
Jochen Stärk
7a28c24c91 Around an hour of manual javadoc documentation (why don't I just use chatGPT for that?) 2026-05-21 09:55:06 +02:00
Jochen Stärk
a9b72da265 closes #1120 2026-05-21 09:03:54 +02:00
Jochen Stärk
abf8468958 [maven-release-plugin] rollback the release of core-2.23.1 2026-05-16 14:18:43 +02:00
Jochen Stärk
b7c778d6db [maven-release-plugin] prepare for next development iteration 2026-05-16 09:14:07 +02:00
Jochen Stärk
3c34115c34 [maven-release-plugin] prepare release core-2.23.1 2026-05-16 09:10:45 +02:00
Jochen Stärk
a2bcd02b29 changed my gpg key as announced 2026-05-16 09:00:31 +02:00
Jochen Stärk
b8b4e40cbb added some forgotten previos merges 2026-05-16 09:00:12 +02:00
Jochen Stärk
e7ba1a6978 Merge branch 'master' of github.com:ZUGFeRD/mustangproject 2026-05-16 08:49:25 +02:00
Jochen Stärk
48457e2065 [maven-release-plugin] rollback the release of core-2.23.1 2026-05-16 08:47:28 +02:00
langfr
c7e700405a Merge branch 'WorkProg-dont-emit-empty-node-for-definedTradeContact' 2026-05-14 21:33:37 +01:00
langfr
448bd0b356 Merge branch 'dont-emit-empty-node-for-definedTradeContact' of https://github.com/WorkProg/mustangproject into WorkProg-dont-emit-empty-node-for-definedTradeContact 2026-05-14 21:30:40 +01:00
langfr
078bb49c87 Merge branch 'langfr-feature/UltimateShipToTradeParty' 2026-05-14 13:32:03 +01:00
langfr
7ebd1b61a5 Merge branch 'feature/UltimateShipToTradeParty' of https://github.com/langfr/mustangproject into langfr-feature/UltimateShipToTradeParty 2026-05-14 13:30:17 +01:00
langfr
ea6dace318 Merge branch 'langfr-feature/DeliveryTypeCode' 2026-05-14 13:28:11 +01:00
langfr
3655c1de7a Support <ram:DeliveryTypeCode/> 2026-05-13 22:15:02 +01:00
langfr
04d06b14f0 Support <ram:UltimateShipToTradeParty/> 2026-05-13 19:35:35 +01:00
Jochen Stärk
e3237c659e [maven-release-plugin] prepare for next development iteration 2026-05-13 14:19:19 +02:00
Jochen Stärk
5300440c0f [maven-release-plugin] prepare release core-2.23.1 2026-05-13 14:19:18 +02:00
Jochen Stärk
0544f3a866 closes #1108 2026-05-13 14:15:13 +02:00
Roland Fredenhagen
dcd9012cd0 dont emit empty node for definedTradeContact 2026-05-12 13:39:44 +02:00
Jochen Staerk
13a85809da Merge pull request #1043 from PhilippGoetje/fix/allowance-charge-percent
Fix percentage-based allowance/charge calculations (EN16931 compliance)
2026-05-12 12:33:56 +02:00
Jochen Stärk
42df52275d Revert "Merge pull request #1067 from phax/java17-base"
This reverts commit f6b6c0a36e, reversing
changes made to d8313dae20.
2026-05-07 13:24:02 +02:00
Jochen Staerk
f6b6c0a36e Merge pull request #1067 from phax/java17-base
Set Java 17 as base + dependency updates + test fix
2026-05-07 13:22:43 +02:00
Jochen Stärk
d8313dae20 Merge branch 'master' of github.com:ZUGFeRD/mustangproject 2026-05-07 13:15:19 +02:00
langfr
6989cf02be Merge branch 'Marcel-Aimpulse-feature-fix-xml-description' 2026-05-05 13:55:28 +01:00
langfr
ad46e97bba Merge branch 'feature-fix-xml-description' of https://github.com/Marcel-Aimpulse/mustangproject into Marcel-Aimpulse-feature-fix-xml-description 2026-05-05 13:53:44 +01:00
langfr
6fbf023ed8 Merge branch 'langfr-bugfix/XMP_null' 2026-05-05 13:45:14 +01:00
langfr
189bbda416 Avoid NPE by checking zi.getXMP() is not null. 2026-05-05 13:36:58 +01:00
Marcel Westenberg Aimpulse
1af1e2f14a Added variable for XML_DESCRIPTION string 2026-05-04 15:59:52 +02:00
Marcel Westenberg Aimpulse
81a3e857e2 Added correct link to ZUGFeRD documentation 2026-05-04 15:47:51 +02:00
Philip Helger
51a216bb94 Merge branch 'ZUGFeRD-master' into java17-base 2026-05-01 20:29:46 +02:00
Philip Helger
1b51a4d0ce Version bump 2026-05-01 20:27:50 +02:00
Philip Helger
1abbccc878 Auto-close 2026-05-01 20:26:47 +02:00
Philip Helger
5ec6f460fc Even newer versions 2026-05-01 20:26:47 +02:00
Philip Helger
54c65d9947 Action update 2026-05-01 20:26:47 +02:00
Philip Helger
8722399455 Github to run with Java 17 as well 2026-05-01 20:26:47 +02:00
Philip Helger
8f484dfc2c Added @TestMethodOrder to honour @Ordered annotation 2026-05-01 20:25:57 +02:00
Philip Helger
48c5c8b5cb Updated to Java 17 + version bumps 2026-05-01 20:25:52 +02:00
Philipp
73b5952c1d Fix line-level SpecifiedTradeAllowanceCharge BasisAmount (BT-137/BT-142)
The line-level BasisAmount in SpecifiedTradeAllowanceCharge must equal
the value the percentage is applied to (BT-137/BT-142 semantic
definition, EN 16931-1:2017+A1:2019). For an item with basisQuantity != 1
that value is (price / basisQuantity) * quantity = the line subtotal, not
the per-unit price/basisQuantity value.

Also matches the line-net formula confirmed for EN 16931-1:2026 (BR-67,
ConnectingEurope/eInvoicing-EN16931 issue #445).

- ZUGFeRD2PullProvider.getItemTotalAllowanceChargeStr: emit
  currencyFormat(item.getValue().multiply(item.getQuantity())).
- getAllowanceChargeStr (product-level, BG-29 GrossPrice path) is
  intentionally NOT changed: there BasisAmount is the gross unit price
  per BT-148, which is per-unit by definition.
- CalculationTest: two new XML-level regression tests asserting
  BasisAmount and ActualAmount in emitted CII XML for allowance and
  charge cases with basisQuantity != 1 (Extended profile).

Fixes #925 (Extended profile), related to #948.

Made-with: Cursor
2026-04-27 18:13:56 +02:00
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
Philip Helger
751d6ccf0b Version bump 2026-04-26 23:15:56 +02:00
Philip Helger
3531e8c7c8 Updated 2026-04-26 23:04:05 +02:00
langfr
ce60fa42d2 Merge branch 'philippfischer143-issue/1095' 2026-04-25 14:41:09 +01:00