fixed total widgets with partial payments
This commit is contained in:
parent
92d5351bfb
commit
21b6035ca6
@ -18,7 +18,7 @@ class TotalExpenses extends Widget
|
|||||||
{
|
{
|
||||||
$current = $open = $overdue = 0;
|
$current = $open = $overdue = 0;
|
||||||
|
|
||||||
$this->applyFilters(Transaction::expense()->isNotTransfer())->each(function ($transaction) use (&$current) {
|
$this->applyFilters(Transaction::expense()->isNotDocument()->isNotTransfer())->each(function ($transaction) use (&$current) {
|
||||||
$current += $transaction->getAmountConvertedToDefault();
|
$current += $transaction->getAmountConvertedToDefault();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ class TotalIncome extends Widget
|
|||||||
{
|
{
|
||||||
$current = $open = $overdue = 0;
|
$current = $open = $overdue = 0;
|
||||||
|
|
||||||
$this->applyFilters(Transaction::income()->isNotTransfer())->each(function ($transaction) use (&$current) {
|
$this->applyFilters(Transaction::income()->isNotDocument()->isNotTransfer())->each(function ($transaction) use (&$current) {
|
||||||
$current += $transaction->getAmountConvertedToDefault();
|
$current += $transaction->getAmountConvertedToDefault();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ class TotalProfit extends Widget
|
|||||||
$current_income = $open_invoice = $overdue_invoice = 0;
|
$current_income = $open_invoice = $overdue_invoice = 0;
|
||||||
$current_expenses = $open_bill = $overdue_bill = 0;
|
$current_expenses = $open_bill = $overdue_bill = 0;
|
||||||
|
|
||||||
$this->applyFilters(Transaction::isNotTransfer())->each(function ($transaction) use (&$current_income, &$current_expenses) {
|
$this->applyFilters(Transaction::isNotDocument()->isNotTransfer())->each(function ($transaction) use (&$current_income, &$current_expenses) {
|
||||||
$amount = $transaction->getAmountConvertedToDefault();
|
$amount = $transaction->getAmountConvertedToDefault();
|
||||||
|
|
||||||
if ($transaction->type == 'income') {
|
if ($transaction->type == 'income') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user