Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0033864Openbravo ERP07. Sales managementpublic2016-08-31 09:322023-03-22 02:08
ngarcia 
AtulOpenbravo 
immediatemajoralways
closedfixed 
5
 
3.0PR16Q2.33.0PR16Q2.3 
aferraz
Core
No
0033864: 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.0PR16Q2.3
2016-08-31 14:24ngarciaResolution time1505944800 => 1474408800
2016-09-14 13:07AtulOpenbravoNote Added: 0089952
2016-09-16 09:17hgbotCheckin
2016-09-16 09:17hgbotNote Added: 0090013
2016-09-16 09:17hgbotStatusscheduled => resolved
2016-09-16 09:17hgbotResolutionopen => fixed
2016-09-16 09:17hgbotFixed in SCM revision => http://code.openbravo.com/erp/backports/3.0PR16Q2.3/rev/9cb8c61838fbe9c801b6e02b90f9e0858af52cd8 [^]
2016-09-16 09:32aferrazReview Assigned To => aferraz
2016-09-16 09:32aferrazNote Added: 0090026
2016-09-16 09:32aferrazStatusresolved => closed
2016-09-16 09:32aferrazFixed in Version => 3.0PR16Q2.3
2023-03-22 02:08okdweeNote Added: 0147794
2023-03-22 09:34shuehnerNote Deleted: 0147794

Notes
(0089952)
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.
(0090013)
hgbot   
2016-09-16 09:17   
Repository: erp/backports/3.0PR16Q2.3
Changeset: 9cb8c61838fbe9c801b6e02b90f9e0858af52cd8
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.0PR16Q2.3/rev/9cb8c61838fbe9c801b6e02b90f9e0858af52cd8 [^]

Fixes issue 33864: 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
---
(0090026)
aferraz   
2016-09-16 09:32   
Code review + Testing OK