close #1053 Added: Dashboard date filter

This commit is contained in:
Cüneyt Şentürk
2019-12-30 12:30:30 +03:00
parent 237b161fe0
commit bd0598b4d4
14 changed files with 152 additions and 56 deletions

View File

@ -12,11 +12,11 @@ class TotalIncome extends Widget
{
$current = $open = $overdue = 0;
Transaction::type('income')->isNotTransfer()->each(function ($transaction) use (&$current) {
$this->applyFilters(Transaction::type('income')->isNotTransfer())->each(function ($transaction) use (&$current) {
$current += $transaction->getAmountConvertedToDefault();
});
Invoice::accrued()->notPaid()->each(function ($invoice) use (&$open, &$overdue) {
$this->applyFilters(Invoice::accrued()->notPaid(), ['date_field' => 'created_at'])->each(function ($invoice) use (&$open, &$overdue) {
list($open_tmp, $overdue_tmp) = $this->calculateDocumentTotals($invoice);
$open += $open_tmp;