You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Willem Janssen <wi...@zchok.nl> on 2010/01/25 22:54:58 UTC

sales tax included twice in shopping cart

Hello,

In the ecommerce application I see there is one path of user actions  
that leads to the display of the total product price in the cart where  
the sales tax is included twice (also in the trunk).

This happens when:
- navigating away from the chechoutreview screen (not finalizing order)
- the productStore setting "Show prices with VAT tax included = J".

Technically speaking I think the following is happening:
- When going from the checkoutoptions to the checkoutreview screen the  
tax is calculated for the cart, by calling the function  
cart.getTotalSalesTax(); in checkoutreview.groovy.
- The debugger mentions this: TaxAuthorityServices.java:118:INFO ] For  
productId [zszSanRemo1] added [38.000] of tax to price for geoId  
[NLD], new price is [238.000]
- In shoppingcart.java, in the getDisplayGrandTotal function, which  
output is used to show the cart prices, the tax is added. (to the  
price that is already including the sales tax)

When in ShoppingCart.java in the function getDisplayGrandTotal,  
replacing
return  
this 
.getDisplaySubTotal 
().add 
(this 
.getTotalShipping 
()).add 
(this.getTotalSalesTax()).add(this.getOrderOtherAdjustmentTotal());

with
return  
this 
.getDisplaySubTotal 
().add 
(this.getTotalShipping()).add(this.getOrderOtherAdjustmentTotal());

the prices are shown as I would expect them to show:
"Show prices with VAT tax included = J" you always want to display  
prices including sales tax and, with value N never, also not after you  
abort the checkout proces.

I've been working with OFBiz a bit longer now and usually there are  
some good reasons to do things, as I expect there are for the above  
mentioned example. However this leads to undesired results when  
showing prices including sales tax?

Like to read your thoughts on this.

Met vriendelijke groet,

Willem Janssen

T: 073 532 74 11
F: 073 532 74 12
M: 06 27 888 464
E: info@zchok.nl
W: www.zchok.nl







Re: sales tax included twice in shopping cart

Posted by Willem Janssen <of...@zchok.nl>.
Thank you for this feedback Hans!

Another attempt then to explain this issue (reproduced in the demo  
system):



First of all some backend data has to be set to reproduce this problem:

1. Set up a tax authority for the demo shop. I used the tax authority  
party with ID ON_TAXMAN, because this one already has ‘Include Tax in  
Price = Y’. At ‘Product Rates’ I added a sales tax value for the demo  
store (9000).

2. Then the store settings for store with ID 9000: Prorate taxes = Y,  
Show prices with vat tax included = Y, Show tax is exempt = Y, Vat Tax  
Auth Geo Id = ON, Vat Tax Auth Party Id = ON_TAXMAN. (no changes to  
other store data)



In in the ecommerce application:

3. Add a product to the shopping cart

4. Check out (use a shipping address in Ontario, Canada to use the tax  
settings).

5. From the Final Checkout Review screen navigate back to home (so not  
submitting the order)

6. Navigate to shopping cart

=> The Sales Tax is included twice in the total display amount.



If things remain unclear please let me know (I could provide  
screenshots to reproduce).

Willem





Op 3 feb 2010, om 13:47 heeft Hans Bakker het volgende geschreven:

> Hi Willem,
>
> Your story is too general. If you would like to have a clear answer  
> try
> to reconstruct it on your local system (demo system is down at the
> moment) using a standard trunk version and standard demo data.
>
> If you you can give a replayable series of inputs which shows the
> problem, you have a much bigger chance to receive an answer on this
> problem.
>
> Regards,
> Hans
>
> On Mon, 2010-01-25 at 22:54 +0100, Willem Janssen wrote:
>> Hello,
>>
>> In the ecommerce application I see there is one path of user actions
>> that leads to the display of the total product price in the cart  
>> where
>> the sales tax is included twice (also in the trunk).
>>
>> This happens when:
>> - navigating away from the chechoutreview screen (not finalizing  
>> order)
>> - the productStore setting "Show prices with VAT tax included = J".
>>
>> Technically speaking I think the following is happening:
>> - When going from the checkoutoptions to the checkoutreview screen  
>> the
>> tax is calculated for the cart, by calling the function
>> cart.getTotalSalesTax(); in checkoutreview.groovy.
>> - The debugger mentions this: TaxAuthorityServices.java:118:INFO ]  
>> For
>> productId [zszSanRemo1] added [38.000] of tax to price for geoId
>> [NLD], new price is [238.000]
>> - In shoppingcart.java, in the getDisplayGrandTotal function, which
>> output is used to show the cart prices, the tax is added. (to the
>> price that is already including the sales tax)
>>
>> When in ShoppingCart.java in the function getDisplayGrandTotal,
>> replacing
>> return
>> this
>> .getDisplaySubTotal
>> ().add
>> (this
>> .getTotalShipping
>> ()).add
>> (this.getTotalSalesTax()).add(this.getOrderOtherAdjustmentTotal());
>>
>> with
>> return
>> this
>> .getDisplaySubTotal
>> ().add
>> (this.getTotalShipping()).add(this.getOrderOtherAdjustmentTotal());
>>
>> the prices are shown as I would expect them to show:
>> "Show prices with VAT tax included = J" you always want to display
>> prices including sales tax and, with value N never, also not after  
>> you
>> abort the checkout proces.
>>
>> I've been working with OFBiz a bit longer now and usually there are
>> some good reasons to do things, as I expect there are for the above
>> mentioned example. However this leads to undesired results when
>> showing prices including sales tax?
>>
>> Like to read your thoughts on this.
>>
>> Met vriendelijke groet,
>>
>> Willem Janssen
>>
>> T: 073 532 74 11
>> F: 073 532 74 12
>> M: 06 27 888 464
>> E: info@zchok.nl
>> W: www.zchok.nl
>>
>>
>>
>>
>>
>>
> -- 
> Antwebsystems.com: Quality OFBiz services for competitive rates
>

Met vriendelijke groet,

Willem Janssen

T: 073 532 74 11
F: 073 532 74 12
M: 06 27 888 464
E: info@zchok.nl
W: www.zchok.nl







Re: sales tax included twice in shopping cart

Posted by Hans Bakker <ma...@antwebsystems.com>.
Hi Willem,

Your story is too general. If you would like to have a clear answer try
to reconstruct it on your local system (demo system is down at the
moment) using a standard trunk version and standard demo data.

If you you can give a replayable series of inputs which shows the
problem, you have a much bigger chance to receive an answer on this
problem.

Regards,
Hans

On Mon, 2010-01-25 at 22:54 +0100, Willem Janssen wrote:
> Hello,
> 
> In the ecommerce application I see there is one path of user actions  
> that leads to the display of the total product price in the cart where  
> the sales tax is included twice (also in the trunk).
> 
> This happens when:
> - navigating away from the chechoutreview screen (not finalizing order)
> - the productStore setting "Show prices with VAT tax included = J".
> 
> Technically speaking I think the following is happening:
> - When going from the checkoutoptions to the checkoutreview screen the  
> tax is calculated for the cart, by calling the function  
> cart.getTotalSalesTax(); in checkoutreview.groovy.
> - The debugger mentions this: TaxAuthorityServices.java:118:INFO ] For  
> productId [zszSanRemo1] added [38.000] of tax to price for geoId  
> [NLD], new price is [238.000]
> - In shoppingcart.java, in the getDisplayGrandTotal function, which  
> output is used to show the cart prices, the tax is added. (to the  
> price that is already including the sales tax)
> 
> When in ShoppingCart.java in the function getDisplayGrandTotal,  
> replacing
> return  
> this 
> .getDisplaySubTotal 
> ().add 
> (this 
> .getTotalShipping 
> ()).add 
> (this.getTotalSalesTax()).add(this.getOrderOtherAdjustmentTotal());
> 
> with
> return  
> this 
> .getDisplaySubTotal 
> ().add 
> (this.getTotalShipping()).add(this.getOrderOtherAdjustmentTotal());
> 
> the prices are shown as I would expect them to show:
> "Show prices with VAT tax included = J" you always want to display  
> prices including sales tax and, with value N never, also not after you  
> abort the checkout proces.
> 
> I've been working with OFBiz a bit longer now and usually there are  
> some good reasons to do things, as I expect there are for the above  
> mentioned example. However this leads to undesired results when  
> showing prices including sales tax?
> 
> Like to read your thoughts on this.
> 
> Met vriendelijke groet,
> 
> Willem Janssen
> 
> T: 073 532 74 11
> F: 073 532 74 12
> M: 06 27 888 464
> E: info@zchok.nl
> W: www.zchok.nl
> 
> 
> 
> 
> 
> 
-- 
Antwebsystems.com: Quality OFBiz services for competitive rates