-
Notifications
You must be signed in to change notification settings - Fork 5.7k
VAT calculation and rounding #1992
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
Conversation
ceb8452 to
8223f93
Compare
4fefdec to
9d68989
Compare
08c5203 to
d35aca9
Compare
5b14172 to
28597a8
Compare
I've added tax calculation for associated products. With this you can sell sets having products with different tax rate.
May I suggest to define the next steps.
First of all a code review is needed. The pull request is a concept proposal to show how tax calculation could be implemented.
Example where the actual implementation fails. Prices incl. tax and setting shoppingcartsettings.roundpricesduringcalculation = true
with 10% Subtotal discount.
Version 3.8
Item1 = 7.99 and 10% tax
Item2 = 7.95 and 20% tax
Result: Subtotal 15.94, discount 1.59, tax 1.84 -> total 14.34. Should be 14.35.
Reason is a rounding error when calculating discount.
New
Result: Subtotal 15.94, discount 1.59, tax 1.84 -> total 14.35
To go further on we need to decide several issues:
-
Do we need the fields Incl/Excl in order? We could limit everything to what the order is intended for. For instance, orders with CustomerTaxDisplayTypeId = DisplayTax would have respective fields with tax, otherwise fields are without.
If we decide to keep them, then OrderDiscount should also have both fields (OrderDiscountInclTax and OrderDiscountExclTax) as it involves now tax calculation. Furthermore, in this case we should make CustomerTaxDisplayTypeId modifiable after the order has been posted, to allow printing invoices with different tax setup. This would be the case when a customer had the wrong setting. -
Should we add a tax-code to tax setup? Do we have the need to show tax texts per taxrate and tax exemption?
-
Reward points. Should they reduce tax?
-
Configurable tax and amount rounding?
e08f7c6 to
c65b3bc
Compare
d3f6c9b to
3f339ba
Compare
(nopSolutions#1323) Purchase reward points (nopSolutions#1809) taxable reward points with several new settings - rewardpointssettings.earnedrewardpointsaretaxable Fixes on associated product tax. Taxation splits now on associated products also for excl. tax. Remade taxSummary
fixes Itext7 back to 7.0.1 7.0.2 throws error when using PdfFontFactory.CreateFont
c65b3bc to
97197a2
Compare
Uh oh!
There was an error while loading. Please reload this page.
This is a suggestion for a possible new VAT calculation and should be verified and tested.
There is also a suggestion for an invoice report using iText7 implemented in PdfService7 but not activated yet. You can do this for testing purposes in Nop.Web.Framework\DependencyRegistrar using
builder.RegisterType<PdfService7>().As<IPdfService>().InstancePerLifetimeScope();.The main scope of this change is to implement VAT calculation as used in ERP systems to be compatible with most vat regulations.
There are still some issues that should be clarified:
Implementation
Use setting ordersettings.autoupdateordertotalsoneditingorder=true for OrderTotal update when editing an order in admin panel.
ToDo:
Migration of old orders. To update Order.TaxRates you have to edit the order and to save one of the products.