- $rep->TextCol(0, 1, $trans['cust_name']);
- $rep->TextCol(1, 2, $trans['tax_id']);
- $rep->AmountCol(2, 3, $trans['total'], $dec);
- $rep->AmountCol(3, 4, $trans['tax'], $dec);
- $totalnet += $trans['total'];
- $totaltax += $trans['tax'];
-
- $rep->NewLine();
-
- if ($rep->row < $rep->bottomMargin + $rep->lineHeight)
+ if ($custno != $trans['debtor_no'])
+ {
+ 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)