Bug 11644: (follow-up) add FIXME
authorGalen Charlton <gmc@esilibrary.com>
Wed, 19 Feb 2014 20:04:22 +0000 (20:04 +0000)
committerGalen Charlton <gmc@esilibrary.com>
Wed, 19 Feb 2014 20:04:22 +0000 (20:04 +0000)
Arithmetic with monetary amounts is a *hard* problem -- or if
not hard, at least super-fiddly, particularly since in theory
a Koha database could have to deal with dozens of currencies
if used by a large research library.  This patch adds a FIXME
implicitly commenting on the poor state of affairs of available
monetary calculation modules on CPAN.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
admin/check_parent_total.pl

index 653a9f2..ce7453a 100755 (executable)
@@ -96,6 +96,10 @@ else {
     $budget_period_unalloc = $period->{'budget_period_total'} - $period_sum->{'sum'} if $period->{'budget_period_total'};
 }
 
+# FIXME - we really need a better way to do this consistently
+# and across the board, be it bigints, Math::FixedPoint, a
+# modernized version of Math::Curency that isn't tied to the system
+# locale, or something else.
 $total                 = sprintf( "%.2f", $total );
 $sub_unalloc           = sprintf( "%.2f", $sub_unalloc );
 $budget_period_unalloc = sprintf( "%.2f", $budget_period_unalloc );