[ 
https://issues.apache.org/jira/browse/OFBIZ-3833?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14142064#comment-14142064
 ] 

Mridul Pathak commented on OFBIZ-3833:
--------------------------------------

The issue description is wrong. The actual issue is that invoice total is 
calculated different from order total in the scenario below.

- Create order with multiple items having sales tax applied.
- Once the order is in approved status, cancel any item having sales tax 
applied on it.
- An order header level adjustment will be created with (-)negative value as 
same as sales tax value applied on cancelled order item.
-  Now complete the order with quick ship entire order process. Invoice which 
gets generated after this, has difference in total from order total (due to 
negative adjustment created for cancelled item).

Potential fault in process:

- At the time of Cancel order item process, 'recalcTaxTotal' service is 
executed to re-calculate the tax total. This service fetch the existing tax 
total for all the adjustments. It then re-calculates the tax total by excluding 
the adjustments of Cancelled items. The difference between both existing tax 
total and new tax total is calculated and a negative adjustment with difference 
value is created on order header level.

- Now at the time of invoice generation, adjustments of cancelled items are 
excluded but the it includes the negative adjustment which is created at order 
level. This negative adjustment value creates the difference between Order 
Total and Invoice total.

The patch provided does solve the issue and pretty much in the correct way. 
Though usability of recalcTaxTotal service needs to be revisited, it has been 
used at a very few places (potentially 3) and is already producing wrong 
results as in this issue and also at the time of edit order items when a manual 
adjustments are added.

I think for now the patch provided by Akash could be committed.

> Payment capture is less than Order total
> ----------------------------------------
>
>                 Key: OFBIZ-3833
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-3833
>             Project: OFBiz
>          Issue Type: Bug
>          Components: order
>    Affects Versions: Release 4.0, Release 09.04.01, Release 10.04, Trunk
>            Reporter: Akash Jain
>            Priority: Minor
>         Attachments: OFBIZ-3833.patch
>
>
> Following are the steps to regenerate issue:
> (1) Create an order for state for which Sales Tax applied on product.
> (2) Cancel order item (for which sales tax applied) during Edit Items from 
> order detail page.
> (3) Now depress Quick Ship Entire Orde button, order will be completed.
> (4) There will be diffrence between payment capture and order total (payment 
> catpture will be less than order total).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to