- //$rep->NewLine();
- //$rep->TextCol(0, 5, "type = ".$account['AccountType'].", level = $level, closing[0]-[1]-[2]-[3] = ".$closing[0]." ".$closing[1]." ".$closing[2]." ".$closing[3]." type[parent] = ".$account['parent']." last = ".$last);
- //$rep->NewLine();
- if ($typename[$level] != '')
- {
- for ( ; $level >= 0, $typename[$level] != ''; $level--)
- {
- if ($account['parent'] == $closing[$level] || $account['parent'] < $last)
- {
- $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 ($account['AccountClassName'] != $classname)
- {
- $rep->Font('bold');
- $rep->TextCol(0, 5, $account['AccountClassName']);
- $rep->Font();
- $rep->NewLine();
- }
- $level++;
- if ($account['parent'] != $last)
- $last = $account['parent'];
- $typename[$level] = $account['AccountTypeName'];
- $closing[$level] = $account['parent'];
- $rep->row -= 4;
- $rep->TextCol(0, 5, $account['AccountTypeName']);
- $rep->row -= 4;
- $rep->Line($rep->row);
- $rep->NewLine();