- $prev_balance = get_gl_balance_from_to("", $from, $account["account_code"], $dimension, $dimension2);
-
- $curr_balance = get_gl_trans_from_to($from, $to, $account["account_code"], $dimension, $dimension2);
-
- if (!$prev_balance && !$curr_balance)
- continue;
-
- if ($account['AccountClassName'] != $classname)
- {
- if ($classname != '')
- {
- $closeclass = true;
- }
- }
-
- if ($account['AccountTypeName'] != $typename[$level])
- {
- if ($typename[$level] != '' && $account['parent'] == -1)
- {
- for ( ; $level >= 0; $level--)
- {
- $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);
- $typeopen[$level] = $typeperiod[$level] = $typeclose[$level] = 0.0;
- if ($parent[$level] == -1)
- break;
- $rep->NewLine();
- }
- if ($graphics)
- {
- $pg->x[] = $$typename[$level];
- $pg->y[] = abs($typeclose[$level]);
- }
- $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();
- }
- if ($account['parent'] != -1 && $account['parent'] != $parent[$level])
- $level++;
- $typename[$level] = $account['AccountTypeName'];
- $rep->row -= 4;
- $rep->TextCol(0, 5, $account['AccountTypeName']);
- $rep->row -= 4;
- $rep->Line($rep->row);
- $rep->NewLine();
- }
- $classname = $account['AccountClassName'];
- $parent[$level] = $account['parent'];
-
- for ($i = 0; $i <= $level; $i++)
+ $class_open_total = 0;
+ $class_period_total = 0;
+ $convert = get_class_type_convert($class["ctype"]);
+
+ //Print Class Name
+ $rep->Font('bold');
+ $rep->TextCol(0, 5, $class["class_name"]);
+ $rep->Font();
+ $rep->NewLine();
+
+ //Get Account groups/types under this group/type with no parents
+ $typeresult = get_account_types(false, $class['cid'], -1);
+ while ($accounttype=db_fetch($typeresult))