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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0045448
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 03. Procurement managementmajoralways2020-11-16 10:242021-11-16 12:30
Reportersanti_lozanoView Statuspublic 
Assigned Tosanti_lozano 
PriorityhighResolutionout of dateFixed in Version
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tovmromanos
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0045448: Incorrect rounding while editing line net amount of a purchase order

DescriptionEdit a the Line Net Amount of a Purchase Order, to be 20000, it is converted to 20010 (livebuilds)
It is done on c_orderline_trg() line:
new.LineNetAmt := ROUND(new.QtyOrdered*new.PriceActual, v_Prec);

As tested with customer, which they had 19999.99 for this same case

After 1st workaround still happening something similar, review notes section
Steps To Reproduce-go to livebuilds, system admin role
-module window, set Core to be in development
-tables and columns, c_orderline table and for column LineNetAmt change its Read Only Logic to be nothing
-F&B International Group Admin, create a Purchase Order, with a product
-After it's created, modify the line net amount, to be 20000, it gets rounded incorrectly
TagsNo tags attached.
Attached Filespng file icon 18910 - reproduced livebuilds.png [^] (160,838 bytes) 2020-11-16 10:24


? file icon livebuild_linenetamt.mp4 [^] (1,022,335 bytes) 2020-12-04 13:25

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0124493)
dmiguelez (developer)
2020-11-18 17:24

Log in as Openbravo

Change Role to System Admin

Go to Tables And Columns window
Select the record with DB Table Name: C_OrderLine
Move to Column Tab
Select the record with DB Column Name: LineNetAmt
Remove the expression from the Read Only Logic field and save

Change the Role to F&B International Group Admin

Go to Purchase Order Window
Create a new record with:
  * Organization: F&B España - Región Norte
  * Business Partner: Bebidas Alegres
Move to Lines Tab and create a new record wiht:
  * Product: Cerveza Ale 0,5L
  * Line Net Amount: 20000
Save the record and validate that the Line Net Amount remains 20000
Complete the Order, the value remains 20000
Modify the value (from a functional point of view this should not be allowed, but the definition change in the first step allows this), the value remains 20000
(0124715)
santi_lozano (reporter)
2020-12-04 13:27

Customer reports that still happens something similar, reproduced on livebuilds (video attached):
1) apply the modifications commented on previous note
2) go to Purchase Order, create a new one for F&B US Org, add a line for Cherry Cola, set Ordered Quantity to be 1000, Line Net Amount to be 220, save it
3) modify Line Net Amount to be 221, save it, it gets saved as 220
(0124730)
AtulOpenbravo (developer)
2020-12-09 16:06

Test Plan
- Login as System admin
- Navigate to windows tabs field, select Purchase Order window, select Lines Tab record.
- In Field tab, search for field Edit Line Net Amount, set Displayed = Yes

- Logout and login as F&B International Group Admin
- Navigate to Purchase Order window
- Create Header for F&B US Inc organization and Be Soft Drinker, Inc. business partner.
- In Lines select product, Cherry Cola, set quantity 1000, realize that Line Net Amount is set as 550. (Read Only)
- In More Information section, set Edit Line Net Amount as Yes, realise that Line Net Amount is editable.
- Set Line Net Amount as 220.
- Try to re-set it to 221, Information is shown in Message Box as
"Info
It's not correct the amount provided: 221.00. Please consider using 220.00"
- Try to save the record error message is shown as
"Error
Saving failed. Line Amount Is Not Correct"

**Similar flow is tested successfully with Sales Order window.
The solution is implemented to maintain consistency as per Lines Tab "Edit Line Net Amount" field in Sales/Purchase Invoice window.
(0124791)
hgbot (developer)
2020-12-11 11:58

Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/258 [^]
(0124822)
vmromanos (manager)
2020-12-15 11:05

In feedback: ask the customer for the concrete use case.


IMHO we should implement something similar to what we have in Invoice window:

At the lines tab there is a flag called Edit Line Amount (which is hidden by default). If you enable it the Line Net Amount field becomes editable and you can set any amount there. Then there is a callout that tries to adjust the unit price accordingly. If the currency precision allows it, the callout automatically adjusts the unit price. If the currency precision avoids a good calculation, the callout informs the user about that. If the user tries to save the record with a wrong amount, the trigger avoids it.

Let see it with an example (currency precision = 2):
Qty= 1000
Unit price = 0.83
Line net amount (automatically calculated) = 830 (1000*0.83) OK
I set Edit Line Net Amount = Y
I edit the line net amount and set it to 910
The callout automatically changes the unit price to 0.91 (OK)
Now I change the Line Net amount to 911.
The callout informs me that this amount is not valid (as the unit price continues to be 0.91 due to the currency precision), and suggests to set it to 910.
If I try to save the 911 it fails to avoid an inconsistency.


The issue you're reporting is at the Order window. The behavior compared to the Invoice window is almost the same: it doesn't allow you to save wrong amounts. The obvious difference is that there is no callout info, and that the trigger silently rounds the line net amount instead of failing.


My proposal for this issue is to implement exactly the same behavior we showed in Invoice to the Orders, i.e. to have a callout that informs you in case of problems, and a trigger that avoids saving.

What we can't do is to increase the unit price precision to match the line net amount, as this would break the precision model.
(0131261)
dmitry_mezentsev (developer)
2021-08-23 10:59

No feedback for more than 6 months.
(0133102)
hgbot (developer)
2021-11-16 12:30

Merge request closed: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/258 [^]

- Issue History
Date Modified Username Field Change
2020-11-16 10:24 santi_lozano New Issue
2020-11-16 10:24 santi_lozano Assigned To => Triage Finance
2020-11-16 10:24 santi_lozano File Added: 18910 - reproduced livebuilds.png
2020-11-16 10:24 santi_lozano Modules => Core
2020-11-16 10:24 santi_lozano Triggers an Emergency Pack => No
2020-11-18 10:00 santi_lozano Resolution time => 1607468400
2020-11-18 10:00 santi_lozano Severity minor => major
2020-11-18 17:24 dmiguelez Note Added: 0124493
2020-11-18 17:24 dmiguelez Status new => closed
2020-11-18 17:24 dmiguelez Resolution open => unable to reproduce
2020-12-04 13:24 santi_lozano Resolution time 1607468400 => 1608850800
2020-12-04 13:24 santi_lozano Status closed => new
2020-12-04 13:24 santi_lozano Description Updated View Revisions
2020-12-04 13:25 santi_lozano File Added: livebuild_linenetamt.mp4
2020-12-04 13:27 santi_lozano Note Added: 0124715
2020-12-09 09:20 AtulOpenbravo Status new => scheduled
2020-12-09 09:20 AtulOpenbravo Assigned To Triage Finance => AtulOpenbravo
2020-12-09 16:06 AtulOpenbravo Note Added: 0124730
2020-12-11 11:58 hgbot Note Added: 0124791
2020-12-15 11:05 vmromanos Note Added: 0124822
2020-12-15 11:05 vmromanos Assigned To AtulOpenbravo => santi_lozano
2020-12-15 11:05 vmromanos Status scheduled => feedback
2021-08-23 10:59 dmitry_mezentsev Review Assigned To => vmromanos
2021-08-23 10:59 dmitry_mezentsev Note Added: 0131261
2021-08-23 10:59 dmitry_mezentsev Status feedback => closed
2021-08-23 10:59 dmitry_mezentsev Resolution unable to reproduce => out of date
2021-11-16 12:30 hgbot Note Added: 0133102


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker