This commit is contained in:
denisdulici 2017-11-05 16:22:10 +03:00
parent c90fbbf6c2
commit 7bba022101

View File

@ -25,6 +25,9 @@ class Dashboard extends Controller
*/
public function index()
{
$td = Date::today();
$month_days = $td->daysInMonth;
/*
* Cash Flow
*/
@ -32,8 +35,8 @@ class Dashboard extends Controller
// Daily
$day = array();
for ($j = 31; $j > -1; $j--) {
$day[31 - $j] = date("d M", strtotime("-$j day"));
for ($j = $month_days; $j > -1; $j--) {
$day[$month_days - $j] = date("d M", strtotime("-$j day"));
}
$daily_income = $this->getCashFlow('income', 'daily');
@ -79,7 +82,7 @@ class Dashboard extends Controller
$open_bill = $overdue_bill = 0;
$invoice_paid_amount = $bill_paid_amount = 0;
$today = Date::today()->toDateString();
$today = $td->toDateString();
// Invoices
$invoices = Invoice::with('payments')->get();