+ // set to start of summary line:
+ $rep->row = $summary_start_row;
+ if (isset($prepayments))
+ {
+ // Partial invoices table
+ $rep->TextCol(0, 3,_("Prepayments invoiced to this order up to day:"));
+ $rep->TextCol(0, 3, str_pad('', 150, '_'));
+ $rep->cols[2] -= 20;
+ $rep->aligns[2] = 'right';
+ $rep->NewLine(); $c = 0; $tot_pym=0;
+ $rep->TextCol(0, 3, str_pad('', 150, '_'));
+ $rep->TextCol($c++, $c, _("Date"));
+ $rep->TextCol($c++, $c, _("Invoice reference"));
+ $rep->TextCol($c++, $c, _("Amount"));
+
+ foreach ($prepayments as $invoice)
+ {
+ if ($show_this_payment || ($invoice['reference'] != $myrow['reference']))
+ {
+ $rep->NewLine();
+ $c = 0; $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(0, 3, str_pad('', 150, '_'));
+ $rep->NewLine();
+ $rep->TextCol(1, 2, _("Total payments:"));
+ $rep->TextCol(2, 3, number_format2($tot_pym, $dec));
+ }
+
+
+ $doctype = ST_SALESINVOICE;
+ $rep->row = $summary_start_row;
+ $rep->cols[2] += 20;
+ $rep->cols[3] += 20;
+ $rep->aligns[3] = 'left';