mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-16 05:04:39 -04:00
Sum balance
instead of amount
This commit is contained in:
parent
a5852f61fe
commit
00e37ea681
@ -232,7 +232,7 @@ class Design extends BaseDesign
|
|||||||
]],
|
]],
|
||||||
['element' => 'tr', 'properties' => [], 'elements' => [
|
['element' => 'tr', 'properties' => [], 'elements' => [
|
||||||
['element' => 'th', 'properties' => [], 'content' => '$balance_due_label'],
|
['element' => 'th', 'properties' => [], 'content' => '$balance_due_label'],
|
||||||
['element' => 'th', 'properties' => [], 'content' => Number::formatMoney($this->invoices->sum('amount'), $this->entity->client)],
|
['element' => 'th', 'properties' => [], 'content' => Number::formatMoney($this->invoices->sum('balance'), $this->entity->client)],
|
||||||
]],
|
]],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@ -379,7 +379,7 @@ class Design extends BaseDesign
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
$outstanding = $this->invoices->sum('amount');
|
$outstanding = $this->invoices->sum('balance');
|
||||||
|
|
||||||
return [
|
return [
|
||||||
['element' => 'p', 'content' => '$outstanding_label: ' . Number::formatMoney($outstanding, $this->entity->client)],
|
['element' => 'p', 'content' => '$outstanding_label: ' . Number::formatMoney($outstanding, $this->entity->client)],
|
||||||
@ -424,10 +424,14 @@ class Design extends BaseDesign
|
|||||||
|
|
||||||
public function statementPaymentTableTotals(): array
|
public function statementPaymentTableTotals(): array
|
||||||
{
|
{
|
||||||
if ($this->type !== self::STATEMENT || !$this->payments->first()) {
|
if (is_null($this->payments) && $this->type !== self::STATEMENT) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (\array_key_exists('show_payments_table', $this->options) && $this->options['show_payments_table'] === false) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
$payment = $this->payments->first();
|
$payment = $this->payments->first();
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user