Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0031550Openbravo ERP03. Procurement managementpublic2015-11-20 13:412015-12-04 15:58
ngarcia 
aferraz 
urgentmajoralways
closedfixed 
5
 
 
dmiguelez
Core
No
0031550: Net Unit Price is changed after saving the invoice line if price includes taxes and price precision is higher than 2
Net Unit Price is changed after saving the invoice line if price includes taxes and price precision is higher than 2
Configure the Format.xml file in order to show 6 decimals for prices

As system admin role:
   Change the price precision of EUR currency to 6

As group admin role:
   Create a price list:
      Sales Price List = 'N'
      Price Includes Taxes = 'Y'
   Create a version and add a product to it with a price of 1.573
   Create a Purchase Invoice with that price list
   Add a line with that product and check the Net Unit Price is shown as 1.30
   Save it and check the Net Unit Price changes to 1.297521
The c_get_net_price_from_gross database function is being called with different values in the p_grossamt parameter in the SL_Invoice_Amt callout and in the c_invoiceline_before_trg:

- SL_Invoice_Amt: 1.573 (gross unit price)
- c_invoiceline_before_trg: 1.57 (line gross amount)
No tags attached.
Issue History
2015-11-20 13:41ngarciaNew Issue
2015-11-20 13:41ngarciaAssigned To => Triage Finance
2015-11-20 13:41ngarciaModules => Core
2015-11-20 13:41ngarciaTriggers an Emergency Pack => No
2015-11-20 13:42ngarciaIssue Monitored: networkb
2015-11-20 13:43ngarciaResolution time => 1451516400
2015-11-20 16:20eugeniIssue Monitored: eugeni
2015-11-27 10:05aferrazAssigned ToTriage Finance => aferraz
2015-11-27 10:05aferrazStatusnew => scheduled
2015-12-02 14:48psanjuanNote Added: 0082536
2015-12-02 14:51psanjuanNote Added: 0082537
2015-12-02 14:53psanjuanNote Edited: 0082537bug_revision_view_page.php?bugnote_id=0082537#r10388
2015-12-02 15:10psanjuanNote Edited: 0082536bug_revision_view_page.php?bugnote_id=0082536#r10390
2015-12-04 10:11hgbotCheckin
2015-12-04 10:11hgbotNote Added: 0082566
2015-12-04 10:11hgbotStatusscheduled => resolved
2015-12-04 10:11hgbotResolutionopen => fixed
2015-12-04 10:11hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/e867bcaa1cc6d81847568342992f0040429f0d4f [^]
2015-12-04 10:12dmiguelezReview Assigned To => dmiguelez
2015-12-04 10:12dmiguelezNote Added: 0082567
2015-12-04 10:12dmiguelezStatusresolved => closed
2015-12-04 15:58hudsonbotCheckin
2015-12-04 15:58hudsonbotNote Added: 0082576

Notes
(0082536)
psanjuan   
2015-12-02 14:48   
(edited on: 2015-12-02 15:10)
Issue Verified.

Net Unit price changes to 1.297521
Line Net Amount = 1.30
Tax = Adquisiciones IVA 21%
Total Net Amount = 1.30
Total Gross Amount = 1.57

(0082537)
psanjuan   
2015-12-02 14:51   
(edited on: 2015-12-02 14:53)
Test Plan

Configure the Format.xml file in order to show 6 decimals for prices

As system admin role:
   Change the price precision of EUR currency to 6

As group admin role:
   Create a price list:
      Sales Price List = 'N'
      Price Includes Taxes = 'Y'
   Create a version and add a product to it with a price of 1.573
   Create a Purchase Invoice for Bebidas Alegres with that price list
   Add a line with that product and check that the Gross Unit Price shown is 1.573, while line gross amount is 1.57

(0082566)
hgbot   
2015-12-04 10:11   
Repository: erp/devel/pi
Changeset: e867bcaa1cc6d81847568342992f0040429f0d4f
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Tue Dec 01 19:06:20 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/e867bcaa1cc6d81847568342992f0040429f0d4f [^]

Fixes issue 31550: Net Unit Price is changed after saving the invoice line

Update call to C_GET_NET_PRICE_FROM_GROSS from C_ORDERLINE_TRG and C_INVOICELINE_BEFORE_TRG to do it with gross_unit_price * qtyinvoiced and taxbaseamt.

---
M src-db/database/model/triggers/C_INVOICELINE_BEFORE_TRG.xml
M src-db/database/model/triggers/C_ORDERLINE_TRG.xml
---
(0082567)
dmiguelez   
2015-12-04 10:12   
Code Review + Testing Ok
(0082576)
hudsonbot   
2015-12-04 15:58   
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/e875b083dc70 [^]
Maturity status: Test