From 39a3ea89c476e5fd26eee3ebd561b4e6de5f193f Mon Sep 17 00:00:00 2001 From: Marcus Hill Date: Thu, 26 Jan 2023 12:30:25 +0000 Subject: [PATCH] Move roundUpToNearestMultiple function used in multiple files to functions.php --- dashboard_financial.php | 6 ---- functions.php | 5 +++- report_expense_summary.php | 56 +++++++++++++++++--------------------- report_income_summary.php | 9 ++---- 4 files changed, 31 insertions(+), 45 deletions(-) diff --git a/dashboard_financial.php b/dashboard_financial.php index 0273438d..32dc8658 100644 --- a/dashboard_financial.php +++ b/dashboard_financial.php @@ -10,12 +10,6 @@ if ($_SESSION['user_role'] != 3) { ?> exit(); } - -function roundUpToNearestMultiple($n, $increment = 1000) -{ - return (int) ($increment * ceil($n / $increment)); -} - if (isset($_GET['year'])) { $year = intval($_GET['year']); } else { diff --git a/functions.php b/functions.php index 2d3e594c..639a4f42 100644 --- a/functions.php +++ b/functions.php @@ -535,4 +535,7 @@ function sendSingleEmail($config_smtp_host, $config_smtp_username, $config_smtp_ } } - +function roundUpToNearestMultiple($n, $increment = 1000) +{ + return (int) ($increment * ceil($n / $increment)); +} diff --git a/report_expense_summary.php b/report_expense_summary.php index 4a64ec3f..27939959 100644 --- a/report_expense_summary.php +++ b/report_expense_summary.php @@ -1,10 +1,4 @@ - -