+ if ($custno != 0)
+ {
+ $rep->TextCol(0, 1, $custname);
+ $rep->TextCol(1, 2, $tax_id);
+ $rep->AmountCol(2, 3, $total, $dec);
+ $rep->AmountCol(3, 4, $tax, $dec);
+ $totalnet += $total;
+ $totaltax += $tax;
+ $total = $tax = 0;
+ $rep->NewLine();
+
+ if ($rep->row < $rep->bottomMargin + $rep->lineHeight)
+ {
+ $rep->Line($rep->row - 2);
+ $rep->NewPage();
+ }
+ }
+ $custno = $trans['debtor_no'];
+ $custname = $trans['cust_name'];
+ $tax_id = $trans['tax_id'];
+ }
+ $taxes = getTaxes($trans['type'], $trans['trans_no']);
+ if ($taxes != null)
+ {
+ if ($taxes['included_in_price'])
+ $trans['total'] -= $taxes['tax'];
+ $tax += $taxes['tax'];
+ }
+ $total += $trans['total'];
+ }
+ if ($custno != 0)
+ {
+ $rep->TextCol(0, 1, $custname);
+ $rep->TextCol(1, 2, $tax_id);
+ $rep->AmountCol(2, 3, $total, $dec);
+ $rep->AmountCol(3, 4, $tax, $dec);
+ $totalnet += $total;
+ $totaltax += $tax;
+ $rep->NewLine();