You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Raj Saini <ra...@gmail.com> on 2009/01/28 14:14:37 UTC

Quote to order - manual adjustments amount not included in cart grand total

Hi,

I am facing a problem while creating a order from a quote with a manual 
adjustment of shipping charges, the adjustment amount is not included in 
the cart grand total. Although manual adjustments are copied to order 
adjustment and added to cart adjustment (ShoppingCartService.java, lines 
676-781), they are filtered out while calculating the maxAmount for 
OrderPaymentPreference when calling the 
cart.getOrderOtherAdjustmentTotal() method which in turns calls the 
OrderReadHelper.calcOrderAdjustments(List orderHeaderAdjustments, 
BigDecimal subTotal, boolean includeOther, boolean includeTax, boolean 
includeShipping). This method filters out the SHIPPING_CHARGES order 
adjustment as includeShipping parameter is always true.

One way to solve the problem is to use the value of includeInShipping 
field from OrderAdjsutment entity in  
OrderHelper#filterOrderAdjustments(List adjustments, boolean 
includeOther, boolean includeTax, boolean includeShipping, boolean 
forTax, boolean forShipping) method and setting this to true in 
QuoteAdjustment entity. (quote adjustments are copied to order 
adjustment by loadCartFromQuote service). However, doing so wrongly 
shows the shipping charges twice in the Order view and also add the 
shipping charges to the total tax whereas the grand total remains correct.

It would be great help if someone having better insight can look into it 
and suggest the best way of solving the problem.

Thanks,

Raj


Re: Quote to order - manual adjustments amount not included in cart grand total

Posted by BJ Freeman <bj...@free-man.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

if you look at the resetGrandTotal
https://demo.hotwaxmedia.com/webtools/control/ArtifactInfo?type=service&uniqueId=resetGrandTotal
there are a bunch of ECAS that might be useful


Raj Saini sent the following on 1/28/2009 5:14 AM:
> Hi,
> 
> I am facing a problem while creating a order from a quote with a manual
> adjustment of shipping charges, the adjustment amount is not included in
> the cart grand total. Although manual adjustments are copied to order
> adjustment and added to cart adjustment (ShoppingCartService.java, lines
> 676-781), they are filtered out while calculating the maxAmount for
> OrderPaymentPreference when calling the
> cart.getOrderOtherAdjustmentTotal() method which in turns calls the
> OrderReadHelper.calcOrderAdjustments(List orderHeaderAdjustments,
> BigDecimal subTotal, boolean includeOther, boolean includeTax, boolean
> includeShipping). This method filters out the SHIPPING_CHARGES order
> adjustment as includeShipping parameter is always true.
> 
> One way to solve the problem is to use the value of includeInShipping
> field from OrderAdjsutment entity in 
> OrderHelper#filterOrderAdjustments(List adjustments, boolean
> includeOther, boolean includeTax, boolean includeShipping, boolean
> forTax, boolean forShipping) method and setting this to true in
> QuoteAdjustment entity. (quote adjustments are copied to order
> adjustment by loadCartFromQuote service). However, doing so wrongly
> shows the shipping charges twice in the Order view and also add the
> shipping charges to the total tax whereas the grand total remains correct.
> 
> It would be great help if someone having better insight can look into it
> and suggest the best way of solving the problem.
> 
> Thanks,
> 
> Raj
> 
> 
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJgMNbrP3NbaWWqE4RAtWJAKCkNYO0oDWbt45dJWt21Nxzy196FQCgn/dt
+YHFrILpWWbaR3xuFa3KAwc=
=p1Qz
-----END PGP SIGNATURE-----

Re: Quote to order - manual adjustments amount not included in cart grand total

Posted by Jacques Le Roux <ja...@les7arts.com>.
I did not look into code. Of course you could add the S&H charges after, editing items order, but I agree it's not really 
satisfactory.

My 2cts

Jacques

From: "Raj Saini" <ra...@gmail.com>
> Hi,
>
> I am facing a problem while creating a order from a quote with a manual adjustment of shipping charges, the adjustment amount is 
> not included in the cart grand total. Although manual adjustments are copied to order adjustment and added to cart adjustment 
> (ShoppingCartService.java, lines 676-781), they are filtered out while calculating the maxAmount for OrderPaymentPreference when 
> calling the cart.getOrderOtherAdjustmentTotal() method which in turns calls the OrderReadHelper.calcOrderAdjustments(List 
> orderHeaderAdjustments, BigDecimal subTotal, boolean includeOther, boolean includeTax, boolean includeShipping). This method 
> filters out the SHIPPING_CHARGES order adjustment as includeShipping parameter is always true.
>
> One way to solve the problem is to use the value of includeInShipping field from OrderAdjsutment entity in 
> OrderHelper#filterOrderAdjustments(List adjustments, boolean includeOther, boolean includeTax, boolean includeShipping, boolean 
> forTax, boolean forShipping) method and setting this to true in QuoteAdjustment entity. (quote adjustments are copied to order 
> adjustment by loadCartFromQuote service). However, doing so wrongly shows the shipping charges twice in the Order view and also 
> add the shipping charges to the total tax whereas the grand total remains correct.
>
> It would be great help if someone having better insight can look into it and suggest the best way of solving the problem.
>
> Thanks,
>
> Raj
>