This commit is contained in:
2025-03-18 15:04:41 +01:00
parent fc1ef6f3ec
commit aa52f216bd
14 changed files with 107 additions and 53 deletions
@@ -81,13 +81,15 @@ class DividendsSummary
if (!isset($test[$country]['incomes'][$val->getTax()])) {
$test[$country]['incomes'][$val->getTax()] = 0;
}
if ($this->getRate($val) < 1) {
die("Rate for date: ".$val->getDateTime()->format("Y-m-d")." / ".$val->getCurrency() . " is 0");
}
$income = round($val->getCount()*$val->getValue()*$this->getRate($val),5);
$test[$country]['incomeAll'] += $income;
$test[$country]['tax'] += round($this->count($val),5);
$test[$country]['destiny_tax'] += round($this->count($val,true),5);
$test[$country]['tax_cost'] += round($this->countTaxPrice($val),5);
$test[$country]['incomes'][$val->getTax()] += $income;
if (!isset($countryToCurrency[$country])) {
$countryToCurrency[$country] = $val->getCurrency();
}