Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0037263Openbravo ERP09. Financial managementpublic2017-11-08 13:152018-01-03 12:39
maite 
collazoandy4 
urgentmajoralways
closedfixed 
5
 
3.0PR18Q1 
dmiguelez
Core
No
0037263: "Last register amount" wrongly calculated by "Create VAT registers" process in Tax Payment window
Problem is that the process is not currently filtering by organization so, depending on your data, it is considering information form another organization
1. Create record in Tax Register Type window for * organization, name "purchase" set any gl item and "sales transaction" not checked

2. Create record in Tax Register Type window for * organization, name "sales" set any gl item and "sales transaction" checked. Add Lines:
  2.1. Tax "Entregas IVA 21% - IVA Normal" and "AR Invoice" document type
  2.2. Tax "NY Sales Tax - US State Sales Tax" and "AR Invoice" document type

3. Register Sales Invoice for "F&B US, Inc." organization, "Healthy Food Supermarkets, Co." business partner, Invoice Date = 19-10-2017. Add any line, process and post invoice. Write down below amounts:
Taxable amount i.e 2.04
Tax amount i.e 0.08 (as the tax rate selected was NY Sales Tax.

4. Create record in Tax Payment window for "F&B US, Inc." organization, "Healthy Food Supermarkets, Co." business partner, "USD" currency, Starting Date= 01-10-2017, Ending Date=31-10-2017, "Generate Payment"=N.

5. Run "Create VAT registers" process and realize that "Tax Total Amount" is properly calculated for "sales" line (i.e.Tax Total Amount = 0.08, Last Register Amount = 0.00). Process Tax Payment record

6. Register Sales Invoice for "F&B España, S.A" organization, "Alimentos y Supermercados, S.A" business partner, Invoice Date = 08-11-2017. Add any line, process and post invoice. Write down below amounts:
Taxable Amount i.e. 1.53
Tax Amount i.e. 0.32

7. Create a record in Tax Payment window for "F&B España, S.A" organization, "Alimentos y Supermercados, S.A" business partner, "EUR" currency, Starting Date= 01-11-2017, Ending Date=30-11-2017, "Generate Payment"=Y.
 
8. Run "Create VAT registers" process and realize that "Tax Total Amount" is properly calculated for "sales" line, that is 0.32. But problem is in "Last Register Amount", where information form another legal organization ("F&B US, Inc.") is being considered i.e. 0.08
Problem seems to be in "updateRegAccumAmt" method in TaxRegister.java file
No tags attached.
related to defect 0037292 closed collazoandy4 The organization field of Tax Payment window should only show legal entities 
Issue History
2017-11-08 13:15maiteNew Issue
2017-11-08 13:15maiteAssigned To => Triage Finance
2017-11-08 13:15maiteModules => Core
2017-11-08 13:15maiteResolution time => 1511910000
2017-11-08 13:15maiteTriggers an Emergency Pack => No
2017-11-08 13:15maiteIssue Monitored: networkb
2017-11-08 15:26psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=16251#r16251
2017-11-08 18:23dmiguelezAssigned ToTriage Finance => collazoandy4
2017-11-08 19:30collazoandy4Statusnew => scheduled
2017-11-09 16:49collazoandy4Note Added: 0100389
2017-11-14 14:13maiteRelationship addedrelated to 0037186
2017-11-14 14:13maiteRelationship deletedrelated to 0037186
2017-11-14 17:11collazoandy4Relationship addedrelated to 0037292
2017-11-17 12:47hgbotCheckin
2017-11-17 12:47hgbotNote Added: 0100579
2017-11-17 12:47hgbotStatusscheduled => resolved
2017-11-17 12:47hgbotResolutionopen => fixed
2017-11-17 12:47hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/12b3fad83754c5c3cc0c942c3c05058ce142bb5a [^]
2017-11-17 12:47hgbotCheckin
2017-11-17 12:47hgbotNote Added: 0100580
2017-11-17 12:47dmiguelezReview Assigned To => dmiguelez
2017-11-17 12:47dmiguelezNote Added: 0100581
2017-11-17 12:47dmiguelezStatusresolved => closed
2017-11-17 13:03dmiguelezFixed in Version => 3.0PR18Q1
2018-01-03 12:39hudsonbotCheckin
2018-01-03 12:39hudsonbotNote Added: 0101433
2018-01-03 12:39hudsonbotCheckin
2018-01-03 12:39hudsonbotNote Added: 0101434

Notes
(0100389)
collazoandy4   
2017-11-09 16:49   
Test Plan
  As F&B International Group Admin role
    Go to Tax Register Type window and create a new record:
      Organization: *
      Name: purchase
      GL Item: Funds transfer
      Sales transaction: N
    Create another record in Tax Register Type window:
      Organization: *
      Name: sales
      GL Item: Funds transfer
      Sales transaction: Y
      Create two records in Lines tab:
        Tax: NY Sales Tax - US State Sales Tax Document Type: AR Invoice
        Tax: Entregas IVA 21% - IVA Normal Document Type: AR Invoice
    Go to Sales Invoice and create a new record:
      Organization: F&B US, Inc.
      Business Partner: Healthy Food Supermarkets, Co.
      Invoice Date: first day of month
      Create a new record in Lines tab:
        Product: Ale Beer
        Invoiced Quantity: 1
        Tax: NY Sales Tax
      Complete and Post the invoice
      Check in Tax tab:
        Taxable amount: 2.04
        Tax amount: 0.08
    Go to Tax Payment window and create a new record:
      Organization: F&B US, Inc.
      Name: Issue
      Business Partner: Healthy Food Supermarkets, Co.
      Currency: USD
      Starting Date: first day of month
      Ending Date: last day of month
      Generate Payment: N
      Run Create VAT registers process
      Check Tax Total Amount: 0.08 for sales line
      Clic on Process and check ends successfull
    Go to Sales Invoice and create a new record:
      Organization: F&B España, S.A
      Business Partner: Alimentos y Supermercados, S.A
      Invoice Date: first day of next month
      Create a new record in Lines tab:
        Product: Agua sin Gas 1L
        Invoiced Quantity: 1
        Tax: Entregas IVA 21%
      Complete and Post the invoice
      Check in Tax tab:
        Taxable amount: 1.53
        Tax amount: 0.32
    Go to Tax Payment window and create a new record:
      Organization: F&B España, S.A.
      Name: Issue2
      Business Partner: Alimentos y Supermercados, S.A
      Currency: EUR
      Starting Date: first day of next month
      Ending Date: last day of next month
      Generate Payment: Y
      Run Create VAT registers process
      Check Tax Total Amount: 0.32 for sales line
(0100579)
hgbot   
2017-11-17 12:47   
Repository: erp/devel/pi
Changeset: 12b3fad83754c5c3cc0c942c3c05058ce142bb5a
Author: Armaignac <collazoandy4 <at> gmail.com>
Date: Tue Nov 14 17:11:26 2017 -0500
URL: http://code.openbravo.com/erp/devel/pi/rev/12b3fad83754c5c3cc0c942c3c05058ce142bb5a [^]

Fixes issue 37263:Last register amount wrongly calculated by Create VAT register
process in Tax Payment window

The query to update the last register amount of tax payment lines doesn't take
into account the organization natural tree was adding all procesed tax payment
amount

The organization natural tree filter was added to the subquery to filter the
records that belongs to the legal entity natural tree

---
M src/org/openbravo/erpCommon/ad_actionButton/CreateVatRegisters.java
M src/org/openbravo/erpCommon/ad_actionButton/TaxRegister.xsql
---
(0100580)
hgbot   
2017-11-17 12:47   
Repository: erp/devel/pi
Changeset: 9dee13d934416e9b6b7f9f4727dc7a4e94b17fc5
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Fri Nov 17 12:43:21 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/9dee13d934416e9b6b7f9f4727dc7a4e94b17fc5 [^]

Related to Issue 37263.

When filtering the data based on the selected organization (always a legal
entity), the organizations used for the filter must be the children of the
legal entity, not all the natural tree

---
M src/org/openbravo/erpCommon/ad_actionButton/CreateVatRegisters.java
---
(0100581)
dmiguelez   
2017-11-17 12:47   
Code Review + Testing Ok
(0101433)
hudsonbot   
2018-01-03 12:39   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/c81e0d3cbab5 [^]
Maturity status: Test
(0101434)
hudsonbot   
2018-01-03 12:39   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/c81e0d3cbab5 [^]
Maturity status: Test