applied new features of money package
This commit is contained in:
@@ -16,7 +16,7 @@ class AccountBalance extends Widget
|
||||
public function show()
|
||||
{
|
||||
$accounts = Account::with('income_transactions', 'expense_transactions')->enabled()->take(5)->get()->map(function($account) {
|
||||
$account->balance_formatted = money($account->balance, $account->currency_code, true);
|
||||
$account->balance_formatted = money($account->balance, $account->currency_code);
|
||||
|
||||
return $account;
|
||||
})->all();
|
||||
|
||||
@@ -53,9 +53,9 @@ class CashFlow extends Widget
|
||||
->setDataset(trans('general.outgoing'), 'column', $expense)
|
||||
->setDataset(trans_choice('general.profits', 1), 'line', $profit);
|
||||
|
||||
$incoming_amount = money(array_sum($income), default_currency(), true);
|
||||
$outgoing_amount = money(abs(array_sum($expense)), default_currency(), true);
|
||||
$profit_amount = money(array_sum($profit), default_currency(), true);
|
||||
$incoming_amount = money(array_sum($income));
|
||||
$outgoing_amount = money(abs(array_sum($expense)));
|
||||
$profit_amount = money(array_sum($profit));
|
||||
|
||||
$totals = [
|
||||
'incoming_exact' => $incoming_amount->format(),
|
||||
|
||||
@@ -52,7 +52,7 @@ class Payables extends Widget
|
||||
});
|
||||
|
||||
foreach ($periods as $period_name => $period_amount) {
|
||||
$periods[$period_name] = money($period_amount, default_currency(), true);
|
||||
$periods[$period_name] = money($period_amount);
|
||||
}
|
||||
|
||||
$has_progress = !empty($open) || !empty($overdue);
|
||||
@@ -61,9 +61,9 @@ class Payables extends Widget
|
||||
$grand = $open + $overdue;
|
||||
|
||||
$totals = [
|
||||
'grand' => money($grand, default_currency(), true),
|
||||
'open' => money($open, default_currency(), true),
|
||||
'overdue' => money($overdue, default_currency(), true),
|
||||
'grand' => money($grand),
|
||||
'open' => money($open),
|
||||
'overdue' => money($overdue),
|
||||
];
|
||||
|
||||
$grand_total_text = trans('widgets.total_unpaid_bills');
|
||||
|
||||
@@ -52,7 +52,7 @@ class Receivables extends Widget
|
||||
});
|
||||
|
||||
foreach ($periods as $period_name => $period_amount) {
|
||||
$periods[$period_name] = money($period_amount, default_currency(), true);
|
||||
$periods[$period_name] = money($period_amount);
|
||||
}
|
||||
|
||||
$has_progress = !empty($open) || !empty($overdue);
|
||||
@@ -61,9 +61,9 @@ class Receivables extends Widget
|
||||
$grand = $open + $overdue;
|
||||
|
||||
$totals = [
|
||||
'grand' => money($grand, default_currency(), true),
|
||||
'open' => money($open, default_currency(), true),
|
||||
'overdue' => money($overdue, default_currency(), true),
|
||||
'grand' => money($grand),
|
||||
'open' => money($open),
|
||||
'overdue' => money($overdue),
|
||||
];
|
||||
|
||||
$grand_total_text = trans('widgets.total_unpaid_invoices');
|
||||
|
||||
Reference in New Issue
Block a user