+ foreach ($prepayments as $invoice)
+ {
+ if ($show_this_payment || ($invoice['reference'] != $myrow['reference']))
+ {
+ $rep->NewLine();
+ $c = 1; $tot_pym += $invoice['prep_amount'];
+ $rep->TextCol($c++, $c, sql2date($invoice['tran_date']));
+ $rep->TextCol($c++, $c, $invoice['reference']);
+ $rep->TextCol($c++, $c, number_format2($invoice['prep_amount'], $dec));
+ }
+ if ($invoice['reference']==$myrow['reference']) break;
+ }
+ $rep->TextCol(1, 4, str_pad('', 150, '_'));
+ $rep->NewLine();
+ $rep->TextCol(2, 3, _("Total payments:"));
+ $rep->TextCol(3, 4, number_format2($tot_pym, $dec));
+ }
+
+
+ $doctype = ST_SALESINVOICE;
+
+ $rep->TextCol(3, 6, _("Sub-total"), -2);