Minor fixes for Statements

This commit is contained in:
David Bomba 2021-10-13 08:43:38 +11:00
parent feab95caa7
commit 48dbd143be

View File

@ -291,7 +291,7 @@ class Statement
->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL]) ->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL])
->where('balance', '>', 0) ->where('balance', '>', 0)
->where('is_deleted', 0) ->where('is_deleted', 0)
->whereBetween('date', [$to, $from]) ->whereBetween('due_date', [$to, $from])
->sum('balance'); ->sum('balance');
return Number::formatMoney($amount, $this->client); return Number::formatMoney($amount, $this->client);
@ -326,7 +326,7 @@ class Statement
return $ranges; return $ranges;
case '120+': case '120+':
$ranges[0] = now()->startOfDay()->subDays(120); $ranges[0] = now()->startOfDay()->subDays(120);
$ranges[1] = now()->startOfDay()->subYears(40); $ranges[1] = now()->startOfDay()->subYears(20);
return $ranges; return $ranges;
default: default:
$ranges[0] = now()->startOfDay()->subDays(0); $ranges[0] = now()->startOfDay()->subDays(0);