Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0036776Openbravo ERP07. Sales managementpublic2017-09-04 11:492017-09-21 16:49
ngarcia 
markmm82 
urgentmajoralways
closedfixed 
5
 
3.0PR17Q4 
aferraz
Core
No
0036776: Amounts in Invoice lines and taxes are rounded to price precision instead of standard precision in Create Lines From process
Amounts in Invoice lines and taxes are rounded to price precision instead of standard precision in Create Lines From process

In CreateFrom class, the price precision is used for rounding amounts instead of standard precision
Change the Format.xml to accept 3 decimals in prices

As System Admin role:
   Set Price Precision of EUR currency to 3

   Create a new sales price list, do not set it as Price Includes Tax
   Add 4 products to it with the following prices:
      101.15
      176.715
      8.33
      35.105

   Create a Sales Order
   Set the previously created price list
   Add the previously created 5 products (one unit of each, 2 units of the one with 101.15 price)
   Complete it
   Set its Invoice Terms as Immediate

   Create a Sales Invoice header
   Set the previously created price list
   Click on Create Lines From
   Add the 4 lines of the sales order with a price different from 0

   Check the total net amount (422.45) does not match with the sum of the Line Net Amount values in invoice lines (202.30 + 176.72 + 8.33 + 35.11 = 422.46)
      
   Check through database that the linenetamt is not rounded to standard precision but to priceprecision
No tags attached.
depends on backport 00367933.0PR17Q3 closed markmm82 Amounts in Invoice lines and taxes are rounded to price precision instead of standard precision in Create Lines From process 
depends on backport 00367943.0PR17Q2.3 closed markmm82 Amounts in Invoice lines and taxes are rounded to price precision instead of standard precision in Create Lines From process 
depends on backport 00367953.0PR17Q1.4 closed markmm82 Amounts in Invoice lines and taxes are rounded to price precision instead of standard precision in Create Lines From process 
blocks defect 0036705 closed markmm82 More than one pending payment plan detail for same invoice payment plan 
Issue History
2017-09-04 11:49ngarciaNew Issue
2017-09-04 11:49ngarciaAssigned To => Triage Finance
2017-09-04 11:49ngarciaModules => Core
2017-09-04 11:49ngarciaTriggers an Emergency Pack => No
2017-09-04 11:50ngarciaRelationship addedblocks 0036705
2017-09-04 11:50ngarciaIssue Monitored: networkb
2017-09-04 11:50ngarciaSummaryAmount in Invoice lines and taxes are rounded to price precision instead of standard precision in Create Lines From process => Amounts in Invoice lines and taxes are rounded to price precision instead of standard precision in Create Lines From process
2017-09-04 11:50ngarciaDescription Updatedbug_revision_view_page.php?rev_id=15794#r15794
2017-09-04 12:30aferrazAssigned ToTriage Finance => markmm82
2017-09-04 16:03markmm82Statusnew => scheduled
2017-09-04 18:55markmm82Note Added: 0098820
2017-09-05 13:56hgbotCheckin
2017-09-05 13:56hgbotNote Added: 0098832
2017-09-05 13:56hgbotStatusscheduled => resolved
2017-09-05 13:56hgbotResolutionopen => fixed
2017-09-05 13:56hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/ef2a84e698c4c76bef4f8ef984d4055c64b6d862 [^]
2017-09-05 13:57hgbotCheckin
2017-09-05 13:57hgbotNote Added: 0098833
2017-09-05 16:41aferrazStatusresolved => new
2017-09-05 16:41aferrazResolutionfixed => open
2017-09-05 16:41aferrazStatusnew => scheduled
2017-09-05 16:41aferrazStatusscheduled => resolved
2017-09-05 16:41aferrazResolutionopen => fixed
2017-09-05 18:19aferrazReview Assigned To => aferraz
2017-09-05 18:19aferrazNote Added: 0098853
2017-09-05 18:19aferrazStatusresolved => closed
2017-09-05 18:19aferrazFixed in Version => 3.0PR17Q4
2017-09-21 16:49hudsonbotCheckin
2017-09-21 16:49hudsonbotNote Added: 0099357
2017-09-21 16:49hudsonbotCheckin
2017-09-21 16:49hudsonbotNote Added: 0099358

Notes
(0098820)
markmm82   
2017-09-04 18:55   
Test Plan 1:
Change the Format.xml to accept 3 decimals in prices

As System Admin role:
   Set Price Precision of EUR currency to 3

   Create a new sales price list, do not set it as Price Includes Tax
   Add 4 products to it with the following prices:
      101.15
      176.715
      8.33
      35.105

   Create a Sales Order
   Set the previously created price list
   Add the previously created 5 products (one unit of each, 2 units of the one with 101.15 price)
   Complete it
   Set its Invoice Terms as Immediate

   Create a Sales Invoice header
   Set the previously created price list
   Click on Create Lines From
   Add the 4 lines of the sales order with a price different from 0

   Check the total net amount (422.46) matches with the sum of the Line Net Amount values in invoice lines (202.30 + 176.72 + 8.33 + 35.11 = 422.46) and Total Gross Amount is 511.18.
      
   Check through database that the linenetamt is rounded to standard precision.
   
Test for purchase flow and you will get same results.

Test Plan 2:
Change the Format.xml to accept 3 decimals in prices

As System Admin role:
   Set Price Precision of EUR currency to 3

   Create a new sales price list, do not set it as Price Includes Tax
   Add 4 products to it with the following prices:
      101.15
      176.715
      8.33
      35.105

   Create a Goods Shipment
   Add the previously created 5 products (one unit of each, 2 units of the one with 101.15 price)
   Complete it

   Create a Sales Invoice header
   Set the previously created price list
   Click on Create Lines From
   Add the 4 lines of the Goods shipment with a price different from 0

   Check the total net amount (422.46) matches with the sum of the Line Net Amount values in invoice lines (202.30 + 176.72 + 8.33 + 35.11 = 422.46) and Total Gross Amount is 511.18.
      
Test for purchase flow and you will get same results.
(0098832)
hgbot   
2017-09-05 13:56   
Repository: erp/devel/pi
Changeset: ef2a84e698c4c76bef4f8ef984d4055c64b6d862
Author: Mark <markmm82 <at> gmail.com>
Date: Mon Sep 04 12:44:00 2017 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/ef2a84e698c4c76bef4f8ef984d4055c64b6d862 [^]

Fixes issue 36776: Amounts in invoice lines and taxes rounded to price precision
instead of standard precision in Create Lines From process.

In CreateFrom class, the price precision was used for rounding amounts instead of
standard precision and it was causing differences with totals when invoices were
created from orders or shipments.

Now all prices are rounded with the price precision of it currency and amounts
with standard precision.

---
M src/org/openbravo/erpCommon/ad_actionButton/CreateFrom.java
M src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Invoice_data.xsql
---
(0098833)
hgbot   
2017-09-05 13:57   
Repository: erp/devel/pi
Changeset: f103322dedd4d728d88174ac9d887def053598c2
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Tue Sep 05 12:37:04 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/f103322dedd4d728d88174ac9d887def053598c2 [^]

Related to issue 36776: Code review improvements

Retrieve currency standard precision instead of price precision in selectFromPO, selectFromPOUpdate, selectFromPOUpdateSOTrx and selectPriceList methods.
Do not round price actual with price precision when calculating line net amount.
Remove unused priceprecision variable.
Use data variable to retrieve currency standard precision when creating invoice from order and dataAux variable when creating invoice from receipt/shipment.

---
M src/org/openbravo/erpCommon/ad_actionButton/CreateFrom.java
M src/org/openbravo/erpCommon/ad_actionButton/CreateFrom_Invoice_data.xsql
---
(0098853)
aferraz   
2017-09-05 18:19   
Code review + Testing OK
(0099357)
hudsonbot   
2017-09-21 16:49   
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/9750b78d3e5c [^]
Maturity status: Test
(0099358)
hudsonbot   
2017-09-21 16:49   
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/9750b78d3e5c [^]
Maturity status: Test