[Bug 7495] New: Tax calculations problem for new orders.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7495 Bug #: 7495 Summary: Tax calculations problem for new orders. Classification: Unclassified Change sponsored?: --- Product: Koha Version: rel_3_6 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P5 - low Component: Acquisitions AssignedTo: henridamien@koha-fr.org ReportedBy: fcapovilla@live.ca QAContact: koha.sekjal@gmail.com When creating a new order, the automatic tax calculations may sometimes be wrong because of loss of precision. Example : With gist=0, create a new order and put 18.99 into the "Vendor price" field. The "Budgeted cost" and "Total" fields are automatically set to 18.98 when they should be 19.99 The same happens with 16.99 . Possible cause of the problem : http://stackoverflow.com/questions/3730019/why-not-use-double-or-float-to-re... Here are some utility functions that could be used to correct the problem : function to_Cents(val) { return Math.round(val*100); } function to_Dollars(val) { return (Math.round(val)/100).toFixed(2); } -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7495 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |veron@veron.ch --- Comment #1 from Marc Véron <veron@veron.ch> --- I do not think that rounding will really help because with double or float you loose precision in an almost arbitrary way. The most solid resolution would be to make use of BigFloat for all currency calculations. http://perldoc.perl.org/Math/BigFloat.html -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7495 --- Comment #2 from Frédérick Capovilla <fcapovilla@live.ca> --- BigFloat is for perl. The problem I'm mentioning is in a tax calculation done in javascript. The rounding solution seems to be acceptable for currency calculations. By rounding, you convert the amount into an int so you don't suffer from the precision loss of floats. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7495 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m Depends on| |5335 --- Comment #3 from Jonathan Druart <jonathan.druart@biblibre.com> --- Please verify that this issue is not fixed by patch for Bug 5335 before continuing the workflow of this bug. Bug 5335 has already been rebased a lot of time and it is very difficult to do it. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7495 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|henridamien@koha-fr.org |koha-bugs@lists.koha-commun | |ity.org -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7495 --- Comment #4 from Jonathan Druart <jonathan.druart@biblibre.com> --- Frédérick, could you check if the issue still exists on master please? -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7495 Viktor Sarge <viktor.sarge@regionhalland.se> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |viktor.sarge@regionhalland. | |se --- Comment #5 from Viktor Sarge <viktor.sarge@regionhalland.se> --- Created attachment 21128 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=21128&action=edit A new mobile.css with the positioning top:0px of div#top-bar If mobile.css is a static file then this one might do the trick for this bug. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7495 --- Comment #6 from Viktor Sarge <viktor.sarge@regionhalland.se> --- Sorry peope - the previous got posted on the wrong bug somehow and I can't find any way to delete my comment and/or attachment from this bug. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7495 mathieu saby <mathieu.saby@univ-rennes2.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mathieu.saby@univ-rennes2.f | |r --- Comment #7 from mathieu saby <mathieu.saby@univ-rennes2.fr> --- By the way, the problem described in this bug is still existing! Mathieu -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7495 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #21128|0 |1 is obsolete| | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7495 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |WORKSFORME --- Comment #8 from Jonathan Druart <jonathan.druart@biblibre.com> --- I don't reproduce this bug on master. Please reopen it if I am wrong. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org