mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for statements
This commit is contained in:
parent
cdd6bee046
commit
6bcca461ef
@ -279,10 +279,13 @@ class Statement
|
|||||||
private function getAgingAmount($range)
|
private function getAgingAmount($range)
|
||||||
{
|
{
|
||||||
$ranges = $this->calculateDateRanges($range);
|
$ranges = $this->calculateDateRanges($range);
|
||||||
nlog($ranges);
|
|
||||||
$from = $ranges[0];
|
$from = $ranges[0];
|
||||||
$to = $ranges[1];
|
$to = $ranges[1];
|
||||||
|
|
||||||
|
nlog("from ".$from->format("Y-m-d"));
|
||||||
|
nlog("to ".$to->format("Y-m-d"));
|
||||||
|
|
||||||
$client = Client::where('id', $this->client->id)->first();
|
$client = Client::where('id', $this->client->id)->first();
|
||||||
|
|
||||||
$amount = Invoice::where('company_id', $this->client->company->id)
|
$amount = Invoice::where('company_id', $this->client->company->id)
|
||||||
@ -291,7 +294,7 @@ nlog($ranges);
|
|||||||
->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', [$from, $to])
|
->whereBetween('date', [$to, $from])
|
||||||
->sum('balance');
|
->sum('balance');
|
||||||
|
|
||||||
return Number::formatMoney($amount, $client);
|
return Number::formatMoney($amount, $client);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user