stephanstapel / ZUGFeRD-csharp

C# assembly for creating and reading ZUGFeRD invoices
Apache License 2.0
166 stars 92 forks source link

Wrong parsing *TradeParty PostTradeAddress #346

Open dviry opened 1 week ago

dviry commented 1 week ago

Using the latest 14.1.0, Given the following in an X-Rechnung:

<ram:PostalTradeAddress>
          <ram:PostcodeCode>33333</ram:PostcodeCode>
          <ram:LineOne>str1</ram:LineOne>
          <ram:LineTwo>str2</ram:LineTwo>
          <ram:CityName>Wien</ram:CityName>
          <ram:CountryID>AT</ram:CountryID>
</ram:PostalTradeAddress>

Parses it as:

Seller.ContactName = "str1"
Seller.Street = "str2"
Seller.AddressLine3 = ""
stephanstapel commented 1 week ago

This behavior is intended and implementation hasn't changed for lots of versions: https://github.com/stephanstapel/ZUGFeRD-csharp/blob/4da012fc1978ec5cd2ed289f2d093a1aa494c4c7/ZUGFeRD/InvoiceDescriptor22CIIReader.cs#L667

respectively:

https://github.com/stephanstapel/ZUGFeRD-csharp/blob/4da012fc1978ec5cd2ed289f2d093a1aa494c4c7/ZUGFeRD/InvoiceDescriptor22CIIWriter.cs#L1383

this was implement in absence of proper mapping for line one and line two.

@dviry was there any change in behavior that you noticed compared with prior versions?

dviry commented 6 days ago

I wasn't comparing to previous versions - IMO it just looks "funky" in Quba (XRechnung viewer) - but who is to argue which one is right ;)

stephanstapel commented 6 days ago

There have been previous discussions of whether to map lineone, linetwo etc. 1:1 to C# structure instead of interpreting it. I'm not sure which way to go though