summary amount format change for Humans..
This commit is contained in:
@ -24,7 +24,17 @@ class Reconciliations extends Controller
|
||||
{
|
||||
$reconciliations = Reconciliation::with('account')->collect();
|
||||
|
||||
return $this->response('banking.reconciliations.index', compact('reconciliations'));
|
||||
$reconciled_amount = money($reconciliations->where('reconciled', 1)->sum('closing_balance'), setting('default.currency'), true);
|
||||
$in_progress_amount = money($reconciliations->where('reconciled', 0)->sum('closing_balance'), setting('default.currency'), true);
|
||||
|
||||
$summary_amounts = [
|
||||
'amount_exact' => $reconciled_amount->format(),
|
||||
'amount_for_humans' => $reconciled_amount->formatForHumans(),
|
||||
'in_progress_exact' => $in_progress_amount->format(),
|
||||
'in_progress_for_humans' => $in_progress_amount->formatForHumans(),
|
||||
];
|
||||
|
||||
return $this->response('banking.reconciliations.index', compact('reconciliations', 'summary_amounts'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -56,12 +56,25 @@ class Transactions extends Controller
|
||||
|
||||
$totals['profit'] = $totals['income'] - $totals['expense'];
|
||||
|
||||
$incoming_amount = money($totals['income'], setting('default.currency'), true);
|
||||
$expense_amount = money($totals['expense'], setting('default.currency'), true);
|
||||
$profit_amount = money($totals['profit'], setting('default.currency'), true);
|
||||
|
||||
$summary_amounts = [
|
||||
'incoming_exact' => $incoming_amount->format(),
|
||||
'incoming_for_humans' => $incoming_amount->formatForHumans(),
|
||||
'expense_exact' => $expense_amount->format(),
|
||||
'expense_for_humans' => $expense_amount->formatForHumans(),
|
||||
'profit_exact' => $profit_amount->format(),
|
||||
'profit_for_humans' => $profit_amount->formatForHumans(),
|
||||
];
|
||||
|
||||
$translations = $this->getTranslationsForConnect('income');
|
||||
|
||||
return $this->response('banking.transactions.index', compact(
|
||||
'transactions',
|
||||
'translations',
|
||||
'totals'
|
||||
'summary_amounts'
|
||||
));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user