diff --git a/system/controllers/dashboard.php b/system/controllers/dashboard.php index ad8afe37..7f5e7acb 100644 --- a/system/controllers/dashboard.php +++ b/system/controllers/dashboard.php @@ -20,10 +20,17 @@ if(isset($_GET['refresh'])){ r2(U . 'dashboard', 's', 'Data Refreshed'); } -$fdate = date('Y-m-01'); -$tdate = date('Y-m-t'); +$reset_day = $config['reset_day']; +if(empty($reset_day)){ + $reset_day = 1; +} + //first day of month -$first_day_month = date('Y-m-01'); +if($reset_day >= date("d")){ + $first_day_month = date('Y-m-'.$reset_day); +}else{ + $first_day_month = date('Y-m-'.$reset_day, strtotime("-1 MONTH")); +} $mdate = date('Y-m-d'); $month_n = date('n'); @@ -194,6 +201,7 @@ if (file_exists($cacheMSfile) && time() - filemtime($cacheMSfile) < 43200) { } // Assign the monthly sales data to Smarty +$ui->assign('first_day_month',$first_day_month); $ui->assign('monthlySales', $monthlySales); $ui->assign('xfooter', ''); $ui->assign('monthlyRegistered', $monthlyRegistered); diff --git a/ui/ui/dashboard.tpl b/ui/ui/dashboard.tpl index 57aac3e0..34f540d3 100644 --- a/ui/ui/dashboard.tpl +++ b/ui/ui/dashboard.tpl @@ -22,7 +22,7 @@
{Lang::T('Income This Month')}
+{Lang::T('Income This Month')}