refactored calculations

This commit is contained in:
Denis Duliçi
2020-07-06 09:54:18 +03:00
parent acacacbe62
commit 630fdb6e85
20 changed files with 549 additions and 871 deletions

View File

@ -160,6 +160,12 @@ class CashFlow extends Widget
$totals[$i] += $item->getAmountConvertedToDefault();
}
$precision = config('money.' . setting('default.currency') . '.precision');
foreach ($totals as $key => $value) {
$totals[$key] = round($value, $precision);
}
}
private function calculateProfit($incomes, $expenses)