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

View Revisions: Issue #29113 All Revisions ] Back to Issue ]
Summary 0029113: Openbravo interface is not rounding properly the database data
Revision 2015-03-04 09:21 by AugustoMauch
Steps To Reproduce Simplified version:
- Execute this in the javascript console:

OB.Utilities.Number.roundJSNumber(0.135, 2); // it returns 0.14, that is OK
OB.Utilities.Number.roundJSNumber(0.145, 2); // it returns 0.14, that is WRONG

====================

To see how to reproduce it using the UI, follow these steps:

- Open Sales Order
- Create a header and save it
- Create a line.
- Enter 0.135 in the Net Unit Price field and press tab. The price is roudned to 0.14, this is OK
- Enter 0.145 in the Net Unit Price field and press tab. The price is roudned to 0.14, this is WRONG
Revision 2015-03-03 16:42 by AugustoMauch
Steps To Reproduce Simplified version:
- Execute this in the javascript console:

OB.Utilities.Number.roundJSNumber(0.135, 2); // it returns 0.14, that is OK
OB.Utilities.Number.roundJSNumber(0.145, 2); // it returns 0.14, that is WRONG

====================

To see how to reproduce it using the UI, follow these steps:

-Go to Openbravo database and execute
alter table c_order disable trigger all;

update c_order set grandtotal=520.145 where documentno='XXXXX';

update c_order set totallines=520.105 where documentno='XXXXX';

alter table c_order enable trigger all;

Verify that if you go to order XXXXX you will see that total net amount is 520.11 and grandtotal is 520.15

It seems that we are not rounding properly to 2 decimals wehn the decimals are ".145".
Execute the following commands in the console
OB.Utilities.Number.OBPlainToOBMasked(1.105, '#0.00', '.', ',')
OB.Utilities.Number.OBPlainToOBMasked(1.115, '#0.00', '.', ',')
OB.Utilities.Number.OBPlainToOBMasked(1.125, '#0.00', '.', ',')
OB.Utilities.Number.OBPlainToOBMasked(1.135, '#0.00', '.', ',')
OB.Utilities.Number.OBPlainToOBMasked(1.145, '#0.00', '.', ',')
Revision 2015-03-03 16:41 by AugustoMauch
Steps To Reproduce Simplified version:
- Execute this in the javascript console:

OB.Utilities.Number.roundJSNumber(0.135, 2); // it returns 0.14, that is OK
OB.Utilities.Number.roundJSNumber(0.145, 2); // it returns 0.14, that is WRONG

To see how to reproduce it using the UI, follow these steps:

-Go to Openbravo database and execute
alter table c_order disable trigger all;

update c_order set grandtotal=520.145 where documentno='XXXXX';

update c_order set totallines=520.105 where documentno='XXXXX';

alter table c_order enable trigger all;

Verify that if you go to order XXXXX you will see that total net amount is 520.11 and grandtotal is 520.15

It seems that we are not rounding properly to 2 decimals wehn the decimals are ".145".
Execute the following commands in the console
OB.Utilities.Number.OBPlainToOBMasked(1.105, '#0.00', '.', ',')
OB.Utilities.Number.OBPlainToOBMasked(1.115, '#0.00', '.', ',')
OB.Utilities.Number.OBPlainToOBMasked(1.125, '#0.00', '.', ',')
OB.Utilities.Number.OBPlainToOBMasked(1.135, '#0.00', '.', ',')
OB.Utilities.Number.OBPlainToOBMasked(1.145, '#0.00', '.', ',')
Revision 2015-03-03 16:37 by AugustoMauch
Steps To Reproduce -Go to Openbravo database and execute
alter table c_order disable trigger all;

update c_order set grandtotal=520.145 where documentno='XXXXX';

update c_order set totallines=520.105 where documentno='XXXXX';

alter table c_order enable trigger all;

Verify that if you go to order XXXXX you will see that total net amount is 520.11 and grandtotal is 520.15

It seems that we are not rounding properly to 2 decimals wehn the decimals are ".145".
Execute the following commands in the console
OB.Utilities.Number.OBPlainToOBMasked(1.105, '#0.00', '.', ',')
OB.Utilities.Number.OBPlainToOBMasked(1.115, '#0.00', '.', ',')
OB.Utilities.Number.OBPlainToOBMasked(1.125, '#0.00', '.', ',')
OB.Utilities.Number.OBPlainToOBMasked(1.135, '#0.00', '.', ',')
OB.Utilities.Number.OBPlainToOBMasked(1.145, '#0.00', '.', ',')


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker