From 6710112f3d2d0b999169675d60fe9810314ae51f Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Tue, 17 Feb 2015 12:20:53 +0100 Subject: [PATCH 1/2] Change to bc-style operations for totals calculation in receivings --- application/libraries/Receiving_lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/libraries/Receiving_lib.php b/application/libraries/Receiving_lib.php index 38eb70358..e74040a06 100644 --- a/application/libraries/Receiving_lib.php +++ b/application/libraries/Receiving_lib.php @@ -366,7 +366,7 @@ class Receiving_lib $total = 0; foreach($this->get_cart() as $item) { - $total += $this->get_item_total($item['quantity'], $item['price'], $item['discount']); + $total = bcadd($total, $this->get_item_total($item['quantity'], $item['price'], $item['discount']), PRECISION); } return $total; From 4bc1d877829bf1dd6e9a6240a02fda124ff963f6 Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Tue, 17 Feb 2015 12:39:32 +0100 Subject: [PATCH 2/2] Fix reports listing (listing itself was based on empty labels) --- application/helpers/report_helper.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/application/helpers/report_helper.php b/application/helpers/report_helper.php index 7b3c21d37..191e818aa 100644 --- a/application/helpers/report_helper.php +++ b/application/helpers/report_helper.php @@ -99,10 +99,11 @@ function show_report_if_allowed($report_prefix, $report_name, $person_id, $permi function show_report($report_prefix, $report_name, $lang_key='') { $CI =& get_instance(); - $report_label = $CI->lang->line(empty($lang_key) ? $report_name : $lang_key); + $lang_key = empty($lang_key) ? $report_name : $lang_key; + $report_label = $CI->lang->line($lang_key); $report_prefix = empty($report_prefix) ? '' : $report_prefix . '_'; // no summary nor detailed reports for receivings - if (!empty($report_label)) + if (!empty($report_label) && $report_label != $lang_key . ' (TBD)') { ?>