Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0014920
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 07. Sales managementmajoralways2010-10-19 16:112010-12-09 16:07
ReporterrafarodaView Statuspublic 
Assigned Toadrianromero 
PriorityhighResolutionfixedFixed in Version
StatusclosedFix in branchpiFixed in SCM revision3e0886948e27
ProjectionnoneETAnoneTarget Version2.50MP24
OSLinux 32 bitDatabasePostgreSQLJava version1.6.0_18
OS VersionCommunity ApplianceDatabase version8.3.9Ant version1.7.1
Product VersionpiSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0014920: Wrong Net Unit Price when Line Net Amount is edited

DescriptionNet Unit Price is wrongly calculated when Line Net Amount is edited.
Steps To Reproduce1) Create a Sales Invoice header.
2) Create a Sales Invoice line with product = Donuts and Select a Tax. Save the record.
3) Change invoiced quantity to 26. Save the record.
4) Click on Edit Line Net Amount. Save the record.
5) Change Line Net Amount to 27 and try to save the record.

ERROR displayed: Line Amount Is Not Correct
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0015059 closeddalsasua Modules decimals error to edit Gross Unit Price 

-  Notes
(0031996)
rafaroda (developer)
2010-10-20 09:01

Take care with this division https://code.openbravo.com/erp/devel/pi/file/tip/src/org/openbravo/erpCommon/ad_callouts/SL_Invoice_Amt.java#l127 [^]

priceActual = LineNetAmt.divide(qtyInvoice, PricePrecision, BigDecimal.ROUND_HALF_UP);

There should be a check for the value of qtyInvoice to avoid a division by zero:

if (qtyInvoice.compareTo(BigDecimal.ZERO) == 0)
   priceActual = BigDecimal.ZERO;
else
   priceActual = LineNetAmt.divide(qtyInvoice, PricePrecision, BigDecimal.ROUND_HALF_UP);
(0032528)
hgbot (developer)
2010-11-10 10:55

Repository: erp/devel/pi
Changeset: 54eb8122cee0e6d2928032b362ce28e54a9c9944
Author: Sivaraman Rajagopal <sivaraman.rajagopal <at> openbravo.com>
Date: Wed Nov 10 15:23:10 2010 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/54eb8122cee0e6d2928032b362ce28e54a9c9944 [^]

Fixes issue 14920: Wrong Net Unit Price when Line Net Amount is edited

Line Net Amount is re-calculated, multiplying invoice quantity with actual price, in order to get below condition passed.

Line Net Amount == (price actual * invoice quantity)

i.e,

invoice quantity = 26
actual price = 1.04

If Net Amount is changed to 27 and invoice, it will be re-calculated as 27.04. Thus, we can get check passed in trigger and avoid error message

---
M src/org/openbravo/erpCommon/ad_callouts/SL_Invoice_Amt.java
---
(0032535)
sivaraman (reporter)
2010-11-10 11:27

Pre-requisition:
Make sure output format of price edition is "#0.00" in Format.xml

Steps to test:

1. Log on to Openbravo with Admin role
2. Go to Sales Management || Transactions || Sales Invoice
3. Create Header
4. Create a line with product = Donuts and Save the record
5. Change invoiced quantity to 26 and Save the record
6. Click on Edit Line Net Amount and Save the record
7. Change Line Net Amount to 27 and verify if record is successfully saved with following values
   Net Unit Price = 1.04
   Line Net Amount = 27.04

Note:
Change Line Net Amount with many different values and verify if it can be saved with re-calculated values. Also modify the output format of price edition as "#0.000" in Format.xml and verify the same behavior in saving invoice lines.
(0032544)
hudsonbot (developer)
2010-11-10 20:06

A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/54eb8122cee0 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/9c2b09096a6d [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.18851.obx [^]
(0032576)
sureshbabu (reporter)
2010-11-12 09:46

verified, now when i change the Line net amount to 27 it changes to 27.04
(0032578)
adrianromero (manager)
2010-11-12 10:24

In order to make the fix consistent with the behavior implemented in other areas related to the same situation. This issue has to be resolved again.
(0032579)
adrianromero (manager)
2010-11-12 10:25

The approach that has to be implemented is the same behavior implemented in the related issue 15059.

It will also be fixed the possible division by zero error described in the note: https://issues.openbravo.com/view.php?id=14920#c31996 [^]
(0032606)
hgbot (developer)
2010-11-15 05:34

Repository: erp/devel/pi
Changeset: 3e0886948e278090d12f46e270373c3b4be0a772
Author: Sivaraman Rajagopal <sivaraman.rajagopal <at> openbravo.com>
Date: Mon Nov 15 10:03:21 2010 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/3e0886948e278090d12f46e270373c3b4be0a772 [^]

Fixes issue 14920: Wrong Net Unit Price when Line Net Amount is edited

Line Net Amount is re-calculated, multiplying invoice quantity with actual price, in order to check below condition. Message will be thrown if it fail

Line Net Amount == (price actual * invoice quantity)

---
M src-db/database/sourcedata/AD_MESSAGE.xml
M src/org/openbravo/erpCommon/ad_callouts/SL_Invoice_Amt.java
---
(0032607)
sivaraman (reporter)
2010-11-15 05:47

Pre-requisition:
Make sure output format of price edition is "#0.00" in Format.xml

Steps to test:

1. Log on to Openbravo with Admin role
2. Go to Sales Management || Transactions || Sales Invoice
3. Create Header
4. Create a line with product = Donuts and Save the record
5. Change invoiced quantity to 26 and Save the record
6. Click on Edit Line Net Amount and Save the record
7. Change Line Net Amount to 27 and verify if message is shown suggesting re-calculated amount i.e, 27.04
8. Now, change Line Net Amount to 27.04 (suggested amount) and verify if it can be successfully saved

Note:
Change Line Net Amount with many different values and verify if it can be saved with re-calculated values. Also modify the output format of price edition as "#0.000" in Format.xml and verify the same behavior in saving invoice lines.
(0032615)
hudsonbot (developer)
2010-11-15 15:40

A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/3e0886948e27 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/2dbba9a7d6a0 [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.18900.obx [^]
(0032652)
sureshbabu (reporter)
2010-11-17 06:34

verified, still the information message needs to be fine tuned.

- Issue History
Date Modified Username Field Change
2010-10-19 16:11 rafaroda New Issue
2010-10-19 16:11 rafaroda Assigned To => adrianromero
2010-10-19 16:13 rafaroda Issue Monitored: rafaroda
2010-10-19 17:18 networkb Issue Monitored: networkb
2010-10-20 09:01 rafaroda Note Added: 0031996
2010-10-21 09:13 jonalegriaesarte Target Version => 2.50MP24
2010-11-10 10:55 hgbot Checkin
2010-11-10 10:55 hgbot Note Added: 0032528
2010-11-10 10:55 hgbot Status new => resolved
2010-11-10 10:55 hgbot Resolution open => fixed
2010-11-10 10:55 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/54eb8122cee0e6d2928032b362ce28e54a9c9944 [^]
2010-11-10 11:27 sivaraman Note Added: 0032535
2010-11-10 12:53 psarobe Note Added: 0032538
2010-11-10 12:53 psarobe Status resolved => new
2010-11-10 12:53 psarobe Resolution fixed => open
2010-11-10 13:02 psarobe Note Deleted: 0032538
2010-11-10 13:02 psarobe Status new => scheduled
2010-11-10 13:02 psarobe fix_in_branch => pi
2010-11-10 13:02 psarobe Status scheduled => resolved
2010-11-10 13:02 psarobe Resolution open => fixed
2010-11-10 13:14 rafaroda Relationship added related to 0015059
2010-11-10 20:06 hudsonbot Checkin
2010-11-10 20:06 hudsonbot Note Added: 0032544
2010-11-12 09:46 sureshbabu Note Added: 0032576
2010-11-12 09:46 sureshbabu Status resolved => closed
2010-11-12 10:24 adrianromero Note Added: 0032578
2010-11-12 10:24 adrianromero Status closed => new
2010-11-12 10:24 adrianromero Resolution fixed => open
2010-11-12 10:25 adrianromero Note Added: 0032579
2010-11-15 05:34 hgbot Checkin
2010-11-15 05:34 hgbot Note Added: 0032606
2010-11-15 05:34 hgbot Status new => resolved
2010-11-15 05:34 hgbot Resolution open => fixed
2010-11-15 05:34 hgbot Fixed in SCM revision http://code.openbravo.com/erp/devel/pi/rev/54eb8122cee0e6d2928032b362ce28e54a9c9944 [^] => http://code.openbravo.com/erp/devel/pi/rev/3e0886948e278090d12f46e270373c3b4be0a772 [^]
2010-11-15 05:47 sivaraman Note Added: 0032607
2010-11-15 15:40 hudsonbot Checkin
2010-11-15 15:40 hudsonbot Note Added: 0032615
2010-11-17 06:34 sureshbabu Note Added: 0032652
2010-11-17 06:34 sureshbabu Status resolved => closed
2010-12-09 16:07 anonymous sf_bug_id 0 => 3133523


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker