Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Quantities / ChargeAmount / LineTotalAmount in Version 14.1.0 #408

Open
guitarhubby opened this issue Oct 22, 2024 · 8 comments

Comments

@guitarhubby
Copy link

Hello,

we found the following issue in the current Version of ZUGfeRD we're using in our project. In my understandig LineTotalAmount should be the result of the multiplicated values of Quantity and ChargeAmount. At least it had been in former versions, but isn't the case here anymore.

Anything we need to change or consider?

Here's a short sequence of the created XML file.

<ram:IncludedSupplyChainTradeLineItem>
  <ram:AssociatedDocumentLineDocument>
    <ram:LineID>1</ram:LineID>
  </ram:AssociatedDocumentLineDocument>
  <ram:SpecifiedTradeProduct>
    <ram:SellerAssignedID>5002</ram:SellerAssignedID>
    <ram:Name>Übernachtung Frühstück Einzelzimmer</ram:Name>
  </ram:SpecifiedTradeProduct>
  <ram:SpecifiedLineTradeAgreement>
    <ram:NetPriceProductTradePrice>
      <ram:ChargeAmount>70.90</ram:ChargeAmount>
      <ram:BasisQuantity unitCode="H87">13.0000</ram:BasisQuantity>
    </ram:NetPriceProductTradePrice>
  </ram:SpecifiedLineTradeAgreement>
  <ram:SpecifiedLineTradeDelivery>
    <ram:BilledQuantity unitCode="H87">13.0000</ram:BilledQuantity>
  </ram:SpecifiedLineTradeDelivery>
  <ram:SpecifiedLineTradeSettlement>
    <ram:ApplicableTradeTax>
      <ram:TypeCode>VAT</ram:TypeCode>
      <ram:CategoryCode>E</ram:CategoryCode>
      <ram:RateApplicablePercent>0.00</ram:RateApplicablePercent>
    </ram:ApplicableTradeTax>
    <ram:SpecifiedTradeSettlementLineMonetarySummation>
      <ram:LineTotalAmount>70.90</ram:LineTotalAmount>
    </ram:SpecifiedTradeSettlementLineMonetarySummation>
  </ram:SpecifiedLineTradeSettlement>
</r
@guitarhubby
Copy link
Author

Further info: Just downgraded to Version 12.8.0. Works as expected.

@stephanstapel
Copy link
Owner

Can you share the code? Are you specifying tradeLineItem.LineTotalAmount in your code?
Afaik, this code didn't change for ages:

grafik

@guitarhubby
Copy link
Author

Hi!

Thanks for the quick reaction, Stephan. Here's the code addressing the ZUGfeRD module.

image

In AddTradeLineItem no value for LineTotalAmount is set.

Following are the results from two versions. Same code and data used.

Result current version 14.1.0:

<ram:IncludedSupplyChainTradeLineItem>
  <ram:AssociatedDocumentLineDocument>
    <ram:LineID>1</ram:LineID>
  </ram:AssociatedDocumentLineDocument>
  <ram:SpecifiedTradeProduct>
    <ram:SellerAssignedID>5002</ram:SellerAssignedID>
    <ram:Name>Übernachtung Frühstück Einzelzimmer</ram:Name>
  </ram:SpecifiedTradeProduct>
  <ram:SpecifiedLineTradeAgreement>
    <ram:NetPriceProductTradePrice>
      <ram:ChargeAmount>70.90</ram:ChargeAmount>
      <ram:BasisQuantity unitCode="H87">13.0000</ram:BasisQuantity>
    </ram:NetPriceProductTradePrice>
  </ram:SpecifiedLineTradeAgreement>
  <ram:SpecifiedLineTradeDelivery>
    <ram:BilledQuantity unitCode="H87">13.0000</ram:BilledQuantity>
  </ram:SpecifiedLineTradeDelivery>
  <ram:SpecifiedLineTradeSettlement>
    <ram:ApplicableTradeTax>
      <ram:TypeCode>VAT</ram:TypeCode>
      <ram:CategoryCode>E</ram:CategoryCode>
      <ram:RateApplicablePercent>0.00</ram:RateApplicablePercent>
    </ram:ApplicableTradeTax>
    <ram:SpecifiedTradeSettlementLineMonetarySummation>
      <ram:LineTotalAmount>70.90</ram:LineTotalAmount>
    </ram:SpecifiedTradeSettlementLineMonetarySummation>
  </ram:SpecifiedLineTradeSettlement>
</ram:IncludedSupplyChainTradeLineItem>

Result Version 12.8.0

<ram:IncludedSupplyChainTradeLineItem>
  <ram:AssociatedDocumentLineDocument>
    <ram:LineID>1</ram:LineID>
  </ram:AssociatedDocumentLineDocument>
  <ram:SpecifiedTradeProduct>
    <ram:SellerAssignedID>5002</ram:SellerAssignedID>
    <ram:Name>Übernachtung Frühstück Einzelzimmer</ram:Name>
  </ram:SpecifiedTradeProduct>
  <ram:SpecifiedLineTradeAgreement>
    <ram:GrossPriceProductTradePrice>
      <ram:ChargeAmount>921.7000</ram:ChargeAmount>
      <ram:BasisQuantity unitCode="H87">13.0000</ram:BasisQuantity>
    </ram:GrossPriceProductTradePrice>
    <ram:NetPriceProductTradePrice>
      <ram:ChargeAmount>70.9000</ram:ChargeAmount>
      <ram:BasisQuantity unitCode="H87">13.0000</ram:BasisQuantity>
    </ram:NetPriceProductTradePrice>
  </ram:SpecifiedLineTradeAgreement>
  <ram:SpecifiedLineTradeDelivery>
    <ram:BilledQuantity unitCode="H87">13.0000</ram:BilledQuantity>
  </ram:SpecifiedLineTradeDelivery>
  <ram:SpecifiedLineTradeSettlement>
    <ram:ApplicableTradeTax>
      <ram:TypeCode>VAT</ram:TypeCode>
      <ram:CategoryCode>E</ram:CategoryCode>
      <ram:RateApplicablePercent>0.00</ram:RateApplicablePercent>
    </ram:ApplicableTradeTax>
    <ram:SpecifiedTradeSettlementLineMonetarySummation>
      <ram:LineTotalAmount>921.70</ram:LineTotalAmount>
    </ram:SpecifiedTradeSettlementLineMonetarySummation>
  </ram:SpecifiedLineTradeSettlement>
</ram:IncludedSupplyChainTradeLineItem>

@guitarhubby
Copy link
Author

I can spot another difference: In version 12.8.0 a tag ram:GrossPriceProductTradePrice is created. I cannot see it in Version 14.1.0.

@stephanstapel
Copy link
Owner

GrossPriceProductTradePrice is only written when:

Profile.Comfort | Profile.Extended | Profile.XRechnung1 | Profile.XRechnung

and also only if it specified. Which profile are you using?

@stephanstapel
Copy link
Owner

Since you are specifying LineTotalAmount in your code above, I can't see any reason why this:

378819198-91c2aa18-0885-4a1b-baac-51cbe5daf748

should not set _total to LineTotalAmount.Value. Could you set a breakpoint here and find out what happens?

@stephanstapel
Copy link
Owner

@guitarhubby : do you have an upate about this issue?

@guitarhubby
Copy link
Author

Sorry, Stephan,

not yet. We needed the quickest solution possible for our customer and went back to version 12.8.0. That works flawlessly. We will return to a newer version later on, when there's more time to check the process.

Shall we close the ticket for the time being and maybe set up a new one later on?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants