reset_day

This commit is contained in:
Ibnu Maksum 2024-06-19 16:29:36 +07:00
parent 703593d5e2
commit d758ea2b11
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5
2 changed files with 12 additions and 4 deletions

View File

@ -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);

View File

@ -22,7 +22,7 @@
<h4><sup>{$_c['currency_code']}</sup>
{number_format($imonth,0,$_c['dec_point'],$_c['thousands_sep'])}</h4>
<p>{Lang::T('Income This Month')}</p>
<p title="from {$first_day_month}">{Lang::T('Income This Month')}</p>
</div>
<div class="icon">
<i class="ion ion-stats-bars"></i>