Skip to content

Commit b3315c2

Browse files
committed
error with line allowance fixed
1 parent f5a6f68 commit b3315c2

File tree

6 files changed

+56
-22
lines changed

6 files changed

+56
-22
lines changed

Delphi6/Samples/XRechnungUnit2TestCases.pas

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -526,16 +526,27 @@ class procedure TInvoiceTestCases.Gesamtbeispiel(inv: TInvoice;
526526

527527
//Nachlass zur Position generieren
528528
if NachlaesseZuschlaegeVerwenden then
529-
with AllowanceCharges.AddAllowanceCharge do
530529
begin
531-
ChargeIndicator := false;
532-
ReasonCodeAllowance := iacic_Discount;
533-
BaseAmount := 100.00;
534-
MultiplierFactorNumeric := 5; //5 Prozent auf 100 EUR
535-
Amount := 5.00;
536-
//Nicht erforderlich TaxPercent := 19.0;
537-
//Nicht erforderlich TaxCategory := TInvoiceDutyTaxFeeCategoryCode.idtfcc_S_StandardRate;
538-
LineAmount := LineAmount - Amount; //Positionssumme um Nachlass reduzieren
530+
with AllowanceCharges.AddAllowanceCharge do
531+
begin
532+
ChargeIndicator := false;
533+
ReasonCodeAllowance := TInvoiceAllowanceOrChargeIdentCode.iacic_Discount;
534+
BaseAmount := 50.00;
535+
MultiplierFactorNumeric := 5; //5 Prozent auf 50 EUR
536+
Amount := 2.50;
537+
//Nicht erforderlich TaxPercent := 19.0;
538+
//Nicht erforderlich TaxCategory := TInvoiceDutyTaxFeeCategoryCode.idtfcc_S_StandardRate;
539+
LineAmount := LineAmount - Amount; //Positionssumme um Nachlass reduzieren
540+
end;
541+
with AllowanceCharges.AddAllowanceCharge do
542+
begin
543+
ChargeIndicator := false;
544+
ReasonCodeAllowance := TInvoiceAllowanceOrChargeIdentCode.iacic_Discount;
545+
BaseAmount := 0;
546+
MultiplierFactorNumeric := 0;
547+
Amount := 2.50;
548+
LineAmount := LineAmount - Amount; //Positionssumme um Nachlass reduzieren
549+
end;
539550
end;
540551
end;
541552

Delphi6/intfXRechnung_2_3.pas

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,7 @@ class procedure TXRechnungInvoiceAdapter230.SaveDocumentUBL(_Invoice: TInvoice;
884884
Attributes['currencyID'] := _Invoice.TaxCurrencyCode;
885885
Text := TXRechnungHelper.AmountToStr(_Invoiceline.AllowanceCharges[i].Amount);
886886
end;
887+
if _Invoiceline.AllowanceCharges[i].MultiplierFactorNumeric <> 0 then
887888
with AddChild('cbc:BaseAmount') do
888889
begin
889890
Attributes['currencyID'] := _Invoice.TaxCurrencyCode;
@@ -1470,8 +1471,10 @@ class procedure TXRechnungInvoiceAdapter230.SaveDocumentUNCEFACT(
14701471
begin
14711472
AddChild('ram:ChargeIndicator').AddChild('udt:Indicator').Text := LowerCase(BoolToStr(_Invoiceline.AllowanceCharges[i].ChargeIndicator,true));
14721473
if _Invoiceline.AllowanceCharges[i].MultiplierFactorNumeric <> 0 then
1474+
begin
14731475
AddChild('ram:CalculationPercent').Text := TXRechnungHelper.FloatToStr(_Invoiceline.AllowanceCharges[i].MultiplierFactorNumeric);
1474-
AddChild('ram:BasisAmount').Text := TXRechnungHelper.AmountToStr(_Invoiceline.AllowanceCharges[i].BaseAmount);
1476+
AddChild('ram:BasisAmount').Text := TXRechnungHelper.AmountToStr(_Invoiceline.AllowanceCharges[i].BaseAmount);
1477+
end;
14751478
AddChild('ram:ActualAmount').Text := TXRechnungHelper.AmountToStr(_Invoiceline.AllowanceCharges[i].Amount);
14761479
AddChild('ram:ReasonCode').Text :=
14771480
IfThen(_Invoiceline.AllowanceCharges[i].ChargeIndicator,

Delphi6/intfXRechnung_3_0.pas

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,7 @@ class procedure TXRechnungInvoiceAdapter301.SaveDocumentUBL(_Invoice: TInvoice;
884884
Attributes['currencyID'] := _Invoice.TaxCurrencyCode;
885885
Text := TXRechnungHelper.AmountToStr(_Invoiceline.AllowanceCharges[i].Amount);
886886
end;
887+
if _Invoiceline.AllowanceCharges[i].MultiplierFactorNumeric <> 0 then
887888
with AddChild('cbc:BaseAmount') do
888889
begin
889890
Attributes['currencyID'] := _Invoice.TaxCurrencyCode;
@@ -1471,8 +1472,10 @@ class procedure TXRechnungInvoiceAdapter301.SaveDocumentUNCEFACT(
14711472
begin
14721473
AddChild('ram:ChargeIndicator').AddChild('udt:Indicator').Text := LowerCase(BoolToStr(_Invoiceline.AllowanceCharges[i].ChargeIndicator,true));
14731474
if _Invoiceline.AllowanceCharges[i].MultiplierFactorNumeric <> 0 then
1475+
begin
14741476
AddChild('ram:CalculationPercent').Text := TXRechnungHelper.FloatToStr(_Invoiceline.AllowanceCharges[i].MultiplierFactorNumeric);
1475-
AddChild('ram:BasisAmount').Text := TXRechnungHelper.AmountToStr(_Invoiceline.AllowanceCharges[i].BaseAmount);
1477+
AddChild('ram:BasisAmount').Text := TXRechnungHelper.AmountToStr(_Invoiceline.AllowanceCharges[i].BaseAmount);
1478+
end;
14761479
AddChild('ram:ActualAmount').Text := TXRechnungHelper.AmountToStr(_Invoiceline.AllowanceCharges[i].Amount);
14771480
AddChild('ram:ReasonCode').Text :=
14781481
IfThen(_Invoiceline.AllowanceCharges[i].ChargeIndicator,

Samples/XRechnungUnit2TestCases.pas

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -527,16 +527,27 @@ class procedure TInvoiceTestCases.Gesamtbeispiel(inv: TInvoice;
527527

528528
//Nachlass zur Position generieren
529529
if NachlaesseZuschlaegeVerwenden then
530-
with AllowanceCharges.AddAllowanceCharge do
531530
begin
532-
ChargeIndicator := false;
533-
ReasonCodeAllowance := TInvoiceAllowanceOrChargeIdentCode.iacic_Discount;
534-
BaseAmount := 100.00;
535-
MultiplierFactorNumeric := 5; //5 Prozent auf 100 EUR
536-
Amount := 5.00;
537-
//Nicht erforderlich TaxPercent := 19.0;
538-
//Nicht erforderlich TaxCategory := TInvoiceDutyTaxFeeCategoryCode.idtfcc_S_StandardRate;
539-
LineAmount := LineAmount - Amount; //Positionssumme um Nachlass reduzieren
531+
with AllowanceCharges.AddAllowanceCharge do
532+
begin
533+
ChargeIndicator := false;
534+
ReasonCodeAllowance := TInvoiceAllowanceOrChargeIdentCode.iacic_Discount;
535+
BaseAmount := 50.00;
536+
MultiplierFactorNumeric := 5; //5 Prozent auf 50 EUR
537+
Amount := 2.50;
538+
//Nicht erforderlich TaxPercent := 19.0;
539+
//Nicht erforderlich TaxCategory := TInvoiceDutyTaxFeeCategoryCode.idtfcc_S_StandardRate;
540+
LineAmount := LineAmount - Amount; //Positionssumme um Nachlass reduzieren
541+
end;
542+
with AllowanceCharges.AddAllowanceCharge do
543+
begin
544+
ChargeIndicator := false;
545+
ReasonCodeAllowance := TInvoiceAllowanceOrChargeIdentCode.iacic_Discount;
546+
BaseAmount := 0;
547+
MultiplierFactorNumeric := 0;
548+
Amount := 2.50;
549+
LineAmount := LineAmount - Amount; //Positionssumme um Nachlass reduzieren
550+
end;
540551
end;
541552
end;
542553

intf.XRechnung_2_3.pas

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,7 @@ class procedure TXRechnungInvoiceAdapter230.SaveDocumentUBL(_Invoice: TInvoice;
884884
Attributes['currencyID'] := _Invoice.TaxCurrencyCode;
885885
Text := TXRechnungHelper.AmountToStr(_Invoiceline.AllowanceCharges[i].Amount);
886886
end;
887+
if _Invoiceline.AllowanceCharges[i].MultiplierFactorNumeric <> 0 then
887888
with AddChild('cbc:BaseAmount') do
888889
begin
889890
Attributes['currencyID'] := _Invoice.TaxCurrencyCode;
@@ -1470,8 +1471,10 @@ class procedure TXRechnungInvoiceAdapter230.SaveDocumentUNCEFACT(
14701471
begin
14711472
AddChild('ram:ChargeIndicator').AddChild('udt:Indicator').Text := LowerCase(BoolToStr(_Invoiceline.AllowanceCharges[i].ChargeIndicator,true));
14721473
if _Invoiceline.AllowanceCharges[i].MultiplierFactorNumeric <> 0 then
1474+
begin
14731475
AddChild('ram:CalculationPercent').Text := TXRechnungHelper.FloatToStr(_Invoiceline.AllowanceCharges[i].MultiplierFactorNumeric);
1474-
AddChild('ram:BasisAmount').Text := TXRechnungHelper.AmountToStr(_Invoiceline.AllowanceCharges[i].BaseAmount);
1476+
AddChild('ram:BasisAmount').Text := TXRechnungHelper.AmountToStr(_Invoiceline.AllowanceCharges[i].BaseAmount);
1477+
end;
14751478
AddChild('ram:ActualAmount').Text := TXRechnungHelper.AmountToStr(_Invoiceline.AllowanceCharges[i].Amount);
14761479
AddChild('ram:ReasonCode').Text :=
14771480
IfThen(_Invoiceline.AllowanceCharges[i].ChargeIndicator,

intf.XRechnung_3_0.pas

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,7 @@ class procedure TXRechnungInvoiceAdapter301.SaveDocumentUBL(_Invoice: TInvoice;
884884
Attributes['currencyID'] := _Invoice.TaxCurrencyCode;
885885
Text := TXRechnungHelper.AmountToStr(_Invoiceline.AllowanceCharges[i].Amount);
886886
end;
887+
if _Invoiceline.AllowanceCharges[i].MultiplierFactorNumeric <> 0 then
887888
with AddChild('cbc:BaseAmount') do
888889
begin
889890
Attributes['currencyID'] := _Invoice.TaxCurrencyCode;
@@ -1471,8 +1472,10 @@ class procedure TXRechnungInvoiceAdapter301.SaveDocumentUNCEFACT(
14711472
begin
14721473
AddChild('ram:ChargeIndicator').AddChild('udt:Indicator').Text := LowerCase(BoolToStr(_Invoiceline.AllowanceCharges[i].ChargeIndicator,true));
14731474
if _Invoiceline.AllowanceCharges[i].MultiplierFactorNumeric <> 0 then
1475+
begin
14741476
AddChild('ram:CalculationPercent').Text := TXRechnungHelper.FloatToStr(_Invoiceline.AllowanceCharges[i].MultiplierFactorNumeric);
1475-
AddChild('ram:BasisAmount').Text := TXRechnungHelper.AmountToStr(_Invoiceline.AllowanceCharges[i].BaseAmount);
1477+
AddChild('ram:BasisAmount').Text := TXRechnungHelper.AmountToStr(_Invoiceline.AllowanceCharges[i].BaseAmount);
1478+
end;
14761479
AddChild('ram:ActualAmount').Text := TXRechnungHelper.AmountToStr(_Invoiceline.AllowanceCharges[i].Amount);
14771480
AddChild('ram:ReasonCode').Text :=
14781481
IfThen(_Invoiceline.AllowanceCharges[i].ChargeIndicator,

0 commit comments

Comments
 (0)