Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0033863Openbravo ERP07. Sales managementpublic2016-08-31 09:322016-09-16 09:32
ngarcia 
AtulOpenbravo 
immediatemajoralways
closedfixed 
5
 
3.0PR16Q3.23.0PR16Q3.2 
aferraz
Core
No
0033863: Wrong Total Gross Amount in orders and invoices as the changes made in tax tab records do not recalculate it
Wrong Total Gross Amount in orders and invoices as the changes made in tax tab records do not recalculate it

Should the user be able to edit or remove the records in tax tab with recalculate = 'Y'?
As group admin role:
   Create a Sales Invoice
   Add a line with a product and a tax rate different from 0
   Go to Tax tab and modify the tax amount. Check the recalculate checkbox is selected
   The total gross amount is not updated
   Complete it and check the total gross amount is not the total net amount plus tax amount
   Repeat the process with purchase invoice
   Repeat the process also by deleting the record in Tax tab instead of editing it
   In this case the problem is also reproducible in orders
   If you post the invoice the difference is posted in the Suspence Balancing Account
It should not be posible to either modify or delete "Tax" set as "Recalculate" = Yes (the ones created automatically by Openbravo)

New lines should be created manually in case a given adjustment is required.

No tags attached.
blocks defect 0033859 closed AtulOpenbravo Wrong Total Gross Amount in orders and invoices as the changes made in tax tab records do not recalculate it 
Issue History
2016-08-31 12:22aferrazTypedefect => backport
2016-08-31 12:22aferrazTarget Version => 3.0PR16Q3.2
2016-08-31 14:24ngarciaResolution time1505944800 => 1474408800
2016-09-14 13:07AtulOpenbravoNote Added: 0089953
2016-09-16 09:15hgbotCheckin
2016-09-16 09:15hgbotNote Added: 0090009
2016-09-16 09:15hgbotStatusscheduled => resolved
2016-09-16 09:15hgbotResolutionopen => fixed
2016-09-16 09:15hgbotFixed in SCM revision => http://code.openbravo.com/erp/backports/3.0PR16Q3.2/rev/d71a86791e4ae08169b6a29734ac68a64dbb54b8 [^]
2016-09-16 09:32aferrazReview Assigned To => aferraz
2016-09-16 09:32aferrazNote Added: 0090025
2016-09-16 09:32aferrazStatusresolved => closed
2016-09-16 09:32aferrazFixed in Version => 3.0PR16Q3.2

Notes
(0089953)
AtulOpenbravo   
2016-09-14 13:07   
Test Plan
- Create a Sales Invoice for "Moon Light Restaurants, Co." in F&B US Inc Org.
- Create Line with Product "Ale Beer", Quantity = 1, Unit Price 100, Tax = CA Sales Tax.
- Check Header info: Total Gross Amount = 108.25, Total Net Amount = 100.
- Go to Tax Tab: Select record with CA Sales Tax.
- Check Tax, Tax Amount, Taxable Amount fields are not editable, Recalculate flag = Yes.
- Try to delete above record: Error message is shown:"Cannot delete invoice tax record with recalculate flag = yes."
- Add new record in Invoice Tax Tab with Tax "FL Sales Tax",Taxable amount=100.
- Check Tax, Tax Amount, Taxable Amount fields are editable, Recalculate flag = No. Tax Amount = 6.
- Check Header info: Total Gross Amount = 114.25, Total Net Amount = 100.
- Try to delete above record. Record is deleted successfully.
- Check Header info: Total Gross Amount = 108.25, Total Net Amount = 100.
- Try to delete Invoice Header. Record is deleted successfully.
(0090009)
hgbot   
2016-09-16 09:15   
Repository: erp/backports/3.0PR16Q3.2
Changeset: d71a86791e4ae08169b6a29734ac68a64dbb54b8
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Wed Sep 14 15:36:20 2016 +0530
URL: http://code.openbravo.com/erp/backports/3.0PR16Q3.2/rev/d71a86791e4ae08169b6a29734ac68a64dbb54b8 [^]

Fixes issue 33863: Wrong Total Gross Amount in orders and invoices

Wrong Total Gross Amount in orders and invoices as the changes made in tax tab records do not recalculate it.

For Purchase Order and Sales Order, Tax tab is made read only so only record are created, modified and deleted only through order lines.
Manual insertion, updation and deletion is not possible.

In case of Sales Invoice and Purchase Invoices, records created by invoice line are marked with recalculate flag = Yes.
Read Only logic based on this flag does not allow user to modify fields tax, tax amount and taxable amount of invoice tax records.
Event handler restricts user to delete invoice tax records with recalculate flag = Yes.
To avoid event handlers interference with ReorderCascadingChildDeletionsHandler.java, on Invoice deletetion, before deleting invoice tax records, flag recalculate is set = No

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/event/ReorderCascadingChildDeletionsHandler.java
M src-db/database/sourcedata/AD_COLUMN.xml
M src-db/database/sourcedata/AD_MESSAGE.xml
M src-db/database/sourcedata/AD_TAB.xml
A src/org/openbravo/event/InvoiceTaxEventHandler.java
---
(0090025)
aferraz   
2016-09-16 09:32   
Code review + Testing OK