It appears the only time the system calculates taxes is when the invoice is created and there is a shipping address, however we only create an invoice when payment information is entered in the checkout process, but we want to show the user the calculated tax amount and grand total prior to them entering payment (makes sense right?).
So I guess the question is how do I create an in-memory Invoice (I don't want to load the dashboard with more "junk" invoices than it already creates) based on the current Basket and shipping address? Or is there a different way to calculate taxes without having to create an invoice (ideally)?
That is what the PrepareInvoice() method does in the SalesPreparationBase class. Calling this method does not save anything to the database. Internally, it uses the InvoiceBuilderChain class to execute each "TaskChain" task which includes the calculate taxes for invoice task.
I'm hoping to make the taxation process more configurable but we can't just by default add tax to each product price and assume that we are always dealing with a system like VAT. In the US for example taxes can get extremely complicated - like in the state I live in (Washington State) we have to calculate taxes based on the destination address of recipient of whatever we are shipping and account for local municipality, county and state tax so the combination can vary quite a lot. Also, if we ship outside of the state we do not have to charge tax at all.
I have a concept to add a global setting to indicate if the taxes are origin or destination based and if origin, have an additional setting that would allow for computing the product cost with taxes included for things like VAT but that will also require some additional stuff in front end implementations to when rendering the price so it really needs to be thought through so things can continue to get easier to implement rather than add another complexity.
Calculating taxes prior to invoicing
It appears the only time the system calculates taxes is when the invoice is created and there is a shipping address, however we only create an invoice when payment information is entered in the checkout process, but we want to show the user the calculated tax amount and grand total prior to them entering payment (makes sense right?).
So I guess the question is how do I create an in-memory Invoice (I don't want to load the dashboard with more "junk" invoices than it already creates) based on the current Basket and shipping address? Or is there a different way to calculate taxes without having to create an invoice (ideally)?
That is what the PrepareInvoice() method does in the SalesPreparationBase class. Calling this method does not save anything to the database. Internally, it uses the InvoiceBuilderChain class to execute each "TaskChain" task which includes the calculate taxes for invoice task.
Perfect, thank you!
Keith I think that this a must for everyone to know the amout ( plus tax ) before. Why Does Merchello don't put this into the application?
Biagio
I'm hoping to make the taxation process more configurable but we can't just by default add tax to each product price and assume that we are always dealing with a system like VAT. In the US for example taxes can get extremely complicated - like in the state I live in (Washington State) we have to calculate taxes based on the destination address of recipient of whatever we are shipping and account for local municipality, county and state tax so the combination can vary quite a lot. Also, if we ship outside of the state we do not have to charge tax at all.
I have a concept to add a global setting to indicate if the taxes are origin or destination based and if origin, have an additional setting that would allow for computing the product cost with taxes included for things like VAT but that will also require some additional stuff in front end implementations to when rendering the price so it really needs to be thought through so things can continue to get easier to implement rather than add another complexity.
Hi, also in Europe the VAT law on ecommerce is changed and can be based on destination for not company purchase.
Is't possible to configure a default VAT?
is working on a reply...