- for ( ; $level >= 0, $typename[$level] != ''; $level--)
- {
- if ($account['parent'] == $closing[$level] || $account['parent'] < $last || $account['parent'] <= 0)
- {
- $rep->row += 6;
- $rep->Line($rep->row);
- $rep->NewLine();
- $rep->TextCol(0, 2, _('Total') . " " . $typename[$level]);
- $rep->AmountCol(2, 3, $typeopen[$level] * $convert, $dec);
- $rep->AmountCol(3, 4, $typeperiod[$level] * $convert, $dec);
- $rep->AmountCol(4, 5, $typeclose[$level] * $convert, $dec);
- if ($graphics)
- {
- $pg->x[] = $typename[$level];
- $pg->y[] = abs($typeclose[$level]);
- }
- $typeopen[$level] = $typeperiod[$level] = $typeclose[$level] = 0.0;
- }
- else
- break;
- $rep->NewLine();
- }
- //$rep->NewLine();
- if ($closeclass)
- {
- $calculateopen = -$assetsopen - $classopen;
- $calculateperiod = -$assetsperiod - $classperiod;
- $calculateclose = -$assetsclose - $classclose;
- if ($ctype == CL_EQUITY)
- {
- $equityopen += $classopen;
- $equityperiod += $classperiod;
- $equityclose += $classclose;
- }
- $rep->row += 6;
- $rep->Line($rep->row);
- $rep->NewLine();
- $rep->TextCol(0, 2, _('Calculated Return'));
- $rep->AmountCol(2, 3, $calculateopen * $convert, $dec);
- $rep->AmountCol(3, 4, $calculateperiod * $convert, $dec);
- $rep->AmountCol(4, 5, $calculateclose * $convert, $dec);
- if ($graphics)
- {
- $pg->x[] = _('Calculated Return');
- $pg->y[] = abs($calculateclose);
- }
- $rep->NewLine(2);
- $rep->Font('bold');
- $rep->TextCol(0, 2, _('Total') . " " . $classname);
- $rep->AmountCol(2, 3, -$assetsopen * $convert, $dec);
- $rep->AmountCol(3, 4, -$assetsperiod * $convert, $dec);
- $rep->AmountCol(4, 5, -$assetsclose * $convert, $dec);
- $rep->Font();
- $rep->NewLine();
- if ($equityopen != 0.0 || $equityperiod != 0.0 || $equityclose != 0.0 ||
- $lopen != 0.0 || $lperiod != 0.0 || $lclose != 0.0)
- {
- $rep->NewLine();
- $rep->Font('bold');
- $rep->TextCol(0, 2, _('Total') . " " . _('Liabilities') . _(' and ') . _('Equities'));
- $rep->AmountCol(2, 3, ($lopen + $equityopen + $calculateopen) * -1, $dec);
- $rep->AmountCol(3, 4, ($lperiod + $equityperiod + $calculateperiod) * -1, $dec);
- $rep->AmountCol(4, 5, ($lclose + $equityclose + $calculateclose) * -1, $dec);
- $rep->Font();
- $rep->NewLine();
- }
- }