Closed stephanstapel closed 4 months ago
rounding rules from EN16931 https://github.com/stephanstapel/ZUGFeRD-csharp/issues/131
@goedo: did you change anything else?
I h think this was because of some tests, in which tradeLineItem.LineTotalAmount hat no value (which should never happen. Basically, the "if" shall not be needed, because the content is needed in any case. Possibly because of my adding lineTotalAmount to the TradeLineItem (decimal? lineTotalAmount = null), in AddTradeLineItem (4 times after billingperiodend) , the situation in which it has no value never happens (becaus I provide a value, taken from the invoice data to be converted). Basically, the minimum data provision is net value and tax percent, so a linetotalamount should be calculatable from this net value. Possibly, instead of adding it (like I did), it could be calculated anywhere in the InvoiceDescriptor22Writer.cs ... still not 100% sure how to consolidate everything.
See #269 for additional info. For my scenarios, I have solved the issue, possibly shortsighted for a general approach...
closed in #269
broken down from #254, submitted by @goedo
InvoiceDescriptor22Writer.cs, 404