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

Tax calculation on allowance position #561

Open
InnuceEAN opened this issue Nov 15, 2024 · 3 comments · May be fixed by #568
Open

Tax calculation on allowance position #561

InnuceEAN opened this issue Nov 15, 2024 · 3 comments · May be fixed by #568

Comments

@InnuceEAN
Copy link
Contributor

InnuceEAN commented Nov 15, 2024

Parsing the following position which contains an allowance, but no CategoryTradeTax under the SpecifiedTradeAllowanceCharge element:

<ram:IncludedSupplyChainTradeLineItem>
	...
	<ram:SpecifiedLineTradeAgreement>
		<ram:NetPriceProductTradePrice>
			<ram:ChargeAmount>128.49</ram:ChargeAmount>
			<ram:BasisQuantity unitCode="LTR">100.</ram:BasisQuantity>
		</ram:NetPriceProductTradePrice>
	</ram:SpecifiedLineTradeAgreement>
	<ram:SpecifiedLineTradeDelivery>
		<ram:BilledQuantity unitCode="LTR">56.69</ram:BilledQuantity>
	</ram:SpecifiedLineTradeDelivery>
	<ram:SpecifiedLineTradeSettlement>
		<ram:ApplicableTradeTax>
			<ram:TypeCode>VAT</ram:TypeCode>
			<ram:CategoryCode>S</ram:CategoryCode>
			<ram:RateApplicablePercent>19.00</ram:RateApplicablePercent>
		</ram:ApplicableTradeTax>
		<ram:SpecifiedTradeAllowanceCharge>
			<ram:ChargeIndicator>
				<udt:Indicator>false</udt:Indicator>
			</ram:ChargeIndicator>
			<ram:ActualAmount>3.40</ram:ActualAmount>
			<ram:Reason>Rebate</ram:Reason>
		</ram:SpecifiedTradeAllowanceCharge>
		<ram:SpecifiedTradeSettlementLineMonetarySummation>
			<ram:LineTotalAmount>69.44</ram:LineTotalAmount>
		</ram:SpecifiedTradeSettlementLineMonetarySummation>
	</ram:SpecifiedLineTradeSettlement>
</ram:IncludedSupplyChainTradeLineItem>

The tax on the position is given with 19%, itemTotalNetAmount is quantity * netPrice = 56.69 * 1.2849 = 72.84.
Also there is a rebate of 3.40.
Now the TransactionCalculator is calculating tax on the itemTotalNetAmount without rebate because the "SpecifiedTradeAllowanceCharge" rebate position has no "CategoryTradeTax" and the importer only fetches the tax from the CategoryTradeTax:
ZUGFeRDInvoiceImporter.java#L664

Is this behavior of the parser correct that no tax is calculated for the rebate or should there have been a CategoryTradeTax node under SpecifiedTradeAllowanceCharge? I'm struggling to find any information on which is correct.

The documentation available for download under https://www.ferd-net.de states under "7.1.11 Zuschläge, Abschläge und Rabatte bzw. Ermäßigungen":

Auf Positionsebene, analog zur Rechnungsposition mit gleichem MwSt-Steuersatz wie die Position
(ansonsten müssen sie unabhängig voneinander eingefügt werden

Which might indicate an inheritance of the tax rate from the position, but I don't see any mention in BT-95 for that?

@InnuceEAN
Copy link
Contributor Author

I think I understand now, the code mentioned above is written only for header level allowances which requires a CategoryTradeTax node for taxes, but also picks up the allowance on item level in my case.

On item level allowance the tax from the position shall be used.

InnuceEAN added a commit to InnuceEAN/mustangproject that referenced this issue Nov 21, 2024
Adds support for allowances and charges on item level

Fixes ZUGFeRD#561

Previously charges/allowances on item level where handled same as header
level
@InnuceEAN InnuceEAN linked a pull request Nov 21, 2024 that will close this issue
@jstaerk
Copy link
Collaborator

jstaerk commented Dec 3, 2024

Hello,did you have a look at en16931 (https://www.dinmedia.de/de/norm/din-en-16931-1/327729047) already and does it work if you actually assign the allowance to the vat rate?

@InnuceEAN
Copy link
Contributor Author

Yeah I checked 16931 and I think it is pretty clear in BG-28:

Es wird davon ausgegangen, dass für alle Steuern und Abschläge derselbe Umsatzsteuersatz gilt wie für die betreffende Rechnungsposition.

so as far as I can tell we need to inherit the tax percentage from the corresponding position. I did the required changes in PR #568

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

Successfully merging a pull request may close this issue.

2 participants