@@ -327,6 +327,7 @@ class function TXRechnungInvoiceAdapter230.LoadDocumentUBL(_Invoice: TInvoice;
327327 _Invoice.AllowanceTotalAmount := TXRechnungHelper.AmountFromStr(TXRechnungXMLHelper.SelectNodeText(xml,' //cac:LegalMonetaryTotal/cbc:AllowanceTotalAmount' ));
328328 _Invoice.ChargeTotalAmount := TXRechnungHelper.AmountFromStr(TXRechnungXMLHelper.SelectNodeText(xml,' //cac:LegalMonetaryTotal/cbc:ChargeTotalAmount' ));
329329 _Invoice.PrepaidAmount := TXRechnungHelper.AmountFromStr(TXRechnungXMLHelper.SelectNodeText(xml,' //cac:LegalMonetaryTotal/cbc:PrepaidAmount' ));
330+ _Invoice.PayableRoundingAmount := TXRechnungHelper.AmountFromStr(TXRechnungXMLHelper.SelectNodeText(xml,' //cac:LegalMonetaryTotal/cbc:PayableRoundingAmount' ));
330331 _Invoice.PayableAmount := TXRechnungHelper.AmountFromStr(TXRechnungXMLHelper.SelectNodeText(xml,' //cac:LegalMonetaryTotal/cbc:PayableAmount' ));
331332
332333 if TXRechnungXMLHelper.SelectNodes(xml,' .//cac:InvoiceLine' ,nodes) then
@@ -791,6 +792,7 @@ class function TXRechnungInvoiceAdapter230.LoadDocumentUNCEFACT(_Invoice: TInvoi
791792 _Invoice.TaxCurrencyCode := TXRechnungXMLHelper.SelectAttributeText(node,' currencyID' );
792793 _Invoice.TaxAmountTotal := TXRechnungHelper.AmountFromStr(node.text);
793794 end ;
795+ _Invoice.PayableRoundingAmount := TXRechnungHelper.AmountFromStr(TXRechnungXMLHelper.SelectNodeText(node2,' .//ram:RoundingAmount' ));
794796 _Invoice.TaxInclusiveAmount := TXRechnungHelper.AmountFromStr(TXRechnungXMLHelper.SelectNodeText(node2,' .//ram:GrandTotalAmount' ));
795797 _Invoice.PrepaidAmount := TXRechnungHelper.AmountFromStr(TXRechnungXMLHelper.SelectNodeText(node2,' .//ram:TotalPrepaidAmount' ));
796798 _Invoice.PayableAmount := TXRechnungHelper.AmountFromStr(TXRechnungXMLHelper.SelectNodeText(node2,' .//ram:DuePayableAmount' ));
@@ -1335,7 +1337,12 @@ class procedure TXRechnungInvoiceAdapter230.SaveDocumentUBL(_Invoice: TInvoice;
13351337 Attributes[' currencyID' ] := _Invoice.TaxCurrencyCode;
13361338 Text := TXRechnungHelper.AmountToStr(_Invoice.PrepaidAmount);
13371339 end ;
1338- // <cbc:PayableRoundingAmount currencyID="EUR">0</cbc:PayableRoundingAmount>
1340+ if _Invoice.PayableRoundingAmount <> 0.0 then
1341+ with AddChild(' cbc:PayableRoundingAmount' ) do
1342+ begin
1343+ Attributes[' currencyID' ] := _Invoice.TaxCurrencyCode;
1344+ Text := TXRechnungHelper.AmountToStr(_Invoice.PayableRoundingAmount);
1345+ end ;
13391346 with AddChild(' cbc:PayableAmount' ) do
13401347 begin
13411348 Attributes[' currencyID' ] := _Invoice.TaxCurrencyCode;
@@ -1804,7 +1811,8 @@ class procedure TXRechnungInvoiceAdapter230.SaveDocumentUNCEFACT(
18041811 Attributes[' currencyID' ] := _Invoice.TaxCurrencyCode;
18051812 Text := TXRechnungHelper.AmountToStr(_Invoice.TaxAmountTotal);
18061813 end ;
1807- // <ram:RoundingAmount>0</ram:RoundingAmount>
1814+ if _Invoice.PayableRoundingAmount <> 0.0 then
1815+ AddChild(' ram:RoundingAmount' ).Text := TXRechnungHelper.AmountToStr(_Invoice.PayableRoundingAmount);
18081816 AddChild(' ram:GrandTotalAmount' ).Text := TXRechnungHelper.AmountToStr(_Invoice.TaxInclusiveAmount);
18091817 AddChild(' ram:TotalPrepaidAmount' ).Text := TXRechnungHelper.AmountToStr(_Invoice.PrepaidAmount);
18101818 AddChild(' ram:DuePayableAmount' ).Text := TXRechnungHelper.AmountToStr(_Invoice.PayableAmount);
0 commit comments