Hello All,
When I Edit items from order view Screen and click on update items link,
it will add "*Shipping and Handling*" and "*Adjustment Sales Tax*" to
the cart every time .
Steps to Generate bug:
-- Create an Approved Sales Order
Here we can find "*Shipping and Handling*" charges displayed and add
only one time.
-- Click on "*Edit Items*" Link.
-- Now Click on "*Update Items*" Link.
It will add the one more "*Shipping and Handling*" and "*Adjustment
Sales Tax*" charge in the list.
My findings regarding this issues are as follows : -
In OrderServices.java at Line 3562, it call the method
saveUpdatedCartToOrder(), which is responsible for creating multiple
records of adjustment.
In saveUpdatedCartToOrder() method on line no. 3832, It calls
makeAllAdjustments on cart object which creates GenericValue for all the
old adjustments of Order. which add objects to toStore list, which is
finally got saved, afterwards on line no. 3833 makeAllShipGroupInfos
method on cart object is called in which It create objects of shipping
and Handling adjustment according to the drop-down for shipment method
on order view screen.
What I did for this to be resolved is in makeAllAdjustments of
ShoppingCart.java, removed line no. 3505 i.e.
allAdjs.add(orderAdjustment);
and put this line in the else part of
if
("SHIPPING_CHARGES".equals(orderAdjustment.get("orderAdjustmentTypeId")))
in the same method. This helped me not to create records repeatetively
but this resulted in one more bug i.e. the manual shipping and handling
charges added were not get saved in OrderAdjustment entity.
Now as abovesaid about Line. no. 3833. more info about this is
"makeAllShipGroupInfos ()" method calls "makeItemShipGroupAndAssoc()"
Which make GenericValue of "OrderAdjustment" ,
"OrderItemShipGroupAssoc" and "OrderItemShipGroup" , in line number
4433 it is adding in
the list(values).
Please Let me know if my findings are in wrong direction.
Please suggest me further solution to this problem.
Comments will be highly appreciable and helpful.
Thanks and Regards
--
Arpit Singh Pandya