Adjustment for statement calculations
This commit is contained in:
parent
c09c996c13
commit
f9496447b6
|
|
@ -454,13 +454,17 @@ class Statement
|
||||||
->where('is_deleted', 0);
|
->where('is_deleted', 0);
|
||||||
|
|
||||||
if ($range == '0') {
|
if ($range == '0') {
|
||||||
|
nlog("rrrrr");
|
||||||
$query->where(function ($q) use ($to, $from) {
|
$query->where(function ($q) use ($to, $from) {
|
||||||
$q->whereBetween('due_date', [$to, $from])->orWhereNull('due_date');
|
$q->where('due_date','>=', now())->orWhereNull('due_date');
|
||||||
|
// $q->whereBetween('due_date', [$to, $from])->orWhereNull('due_date');
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$query->whereBetween('due_date', [$to, $from]);
|
$query->whereBetween('due_date', [$to, $from]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nlog($query->toRawSql());
|
||||||
|
|
||||||
$amount = $query->sum('balance');
|
$amount = $query->sum('balance');
|
||||||
|
|
||||||
return Number::formatMoney($amount, $this->client);
|
return Number::formatMoney($amount, $this->client);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue