ZUGFeRD-csharp: AddTradeLineCommentItem creates invalid LineExtensionAmount element in UBL output
When using AddTradeLineCommentItem to add a comment line, the resulting TradeLineItem has LineTotalAmount = null, which is written by the UBL writer like this:
<cbc:LineExtensionAmount currencyID="EUR"></cbc:LineExtensionAmount>
The missing value causes the following two validation errors:
- ‘’ is not a valid value for ‘decimal’.
- Element ‘cbc:LineExtensionAmount’ must have no element [children], and the value must be valid.
Suggested solution: Just like GrossUnitPrice and a few other nullable members of TradeLineItem, LineTotalAmount could be initialized with 0m in AddTradeLineCommentItem.
I reproduced the bug in version 16.1.0, but I’ve checked the current code and the problem should exist in the latest version as well.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 18 (9 by maintainers)
Commits related to this issue
- fix for LineExtensionAmount #727 — committed to stephanstapel/ZUGFeRD-csharp by stephanstapel 2 years ago
- Added notes to UBL #727 — committed to stephanstapel/ZUGFeRD-csharp by stephanstapel 2 years ago
- Update InvoiceDescriptor22UBLWriter.cs added to #727 — committed to stephanstapel/ZUGFeRD-csharp by stephanstapel 2 years ago
Yes, I’m ok with that.
Thank you very much!
jap: https://github.com/stephanstapel/ZUGFeRD-csharp/commit/ef5707baff1f1d66935441071da9651b2786b7dd that should do it.