- //$rep->NewLine();
- //$rep->TextCol(0, 5, "level = $level, closing[level] = ".$closing[$level].", type[parent] = ".$type['parent']." last = ".$last);
- //$rep->NewLine();
- if ($typename[$level] != '')
- {
- for ( ; $level >= 0, $typename[$level] != ''; $level--)
- {
- if ($type['parent'] == $closing[$level] || $type['parent'] == $last || $type['parent'] <= 0)
- {
- $rep->row += 6;
- $rep->Line($rep->row);
- $rep->NewLine();
- $rep->TextCol(0, 2, _('Total') . " " . $typename[$level]);
- $rep->AmountCol(2, 3, $typeopen[$level], $dec);
- $rep->AmountCol(3, 4, $typeperiod[$level], $dec);
- $rep->AmountCol(4, 5, $typeclose[$level], $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)
- {
- $rep->row += 6;
- $rep->Line($rep->row);
- $rep->NewLine();
- $rep->Font('bold');
- $rep->TextCol(0, 2, _('Total') . " " . $classname);
- $rep->AmountCol(2, 3, $classopen, $dec);
- $rep->AmountCol(3, 4, $classperiod, $dec);
- $rep->AmountCol(4, 5, $classclose, $dec);
- $rep->Font();
- $assetsopen += $classopen;
- $assetsperiod += $classperiod;
- $assetsclose += $classclose;
- $classopen = $classperiod = $classclose = 0.0;
- $rep->NewLine(2);
- $closeclass = false;
- }
- }
- if ($type['AccountClassName'] != $classname)
- {
- $rep->Font('bold');
- $rep->TextCol(0, 5, $type['AccountClassName']);
- $rep->Font();
- $rep->NewLine();
- }
- $level++;
- if ($type['parent'] != $last)
- $last = $type['parent'];
- $typename[$level] = $type['AccountTypeName'];
- $closing[$level] = $type['parent'];
- $rep->row -= 4;
- $rep->TextCol(0, 5, $type['AccountTypeName']);
- $rep->row -= 4;
- $rep->Line($rep->row);
- $rep->NewLine();