essecosi Posted May 8, 2014 Share Posted May 8, 2014 (edited) Hi! I need to replace getTodaysDate with transaction.date $pdf->Cell(0,6,$_LANG["invoicesdatecreated"].': '.getTodaysDate(1).'',0,1,'L','1'); -> on this line $pdf->Cell(0,6,$_LANG["datum_placila"].': '.getTodaysDate(1).'',0,1,'L','1'); any solutions? regards Edited May 9, 2014 by essecosi 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 8, 2014 Share Posted May 8, 2014 forget the curly brackets - that's Smarty... the pdf invoice using PHP. it's already in the code (portal and default anyway)... # Transactions $pdf->SetFont('freesans','B',12); $pdf->Cell(0,4,$_LANG["invoicestransactions"],0,1); $pdf->Ln(5); $pdf->SetFont('freesans','',9); $tblhtml = '<table width="100%" bgcolor="#ccc" cellspacing="1" cellpadding="2" border="0"> <tr height="30" bgcolor="#efefef" style="font-weight:bold;text-align:center;"> <td width="25%">'.$_LANG['invoicestransdate'].'</td> <td width="25%">'.$_LANG['invoicestransgateway'].'</td> <td width="30%">'.$_LANG['invoicestransid'].'</td> <td width="20%">'.$_LANG['invoicestransamount'].'</td> </tr>'; if (!count($transactions)) { $tblhtml .= ' <tr bgcolor="#fff"> <td colspan="4" align="center">'.$_LANG['invoicestransnonefound'].'</td> </tr>'; } else { foreach ($transactions AS $trans) { $tblhtml .= ' <tr bgcolor="#fff"> <td align="center">'.$trans['date'].'</td> <td align="center">'.$trans['gateway'].'</td> <td align="center">'.$trans['transid'].'</td> <td align="center">'.$trans['amount'].'</td> </tr>'; } } $tblhtml .= ' <tr height="30" bgcolor="#efefef" style="font-weight:bold;"> <td colspan="3" align="right">'.$_LANG['invoicesbalance'].'</td> <td align="center">'.$balance.'</td> </tr> </table>'; $pdf->writeHTML($tblhtml, true, false, false, false, ''); you'll need to use - $trans['date'] - but you could probably just use the whole table if you want to display payment date, method and id. 0 Quote Link to comment Share on other sites More sharing options...
essecosi Posted May 8, 2014 Author Share Posted May 8, 2014 (edited) # Header Bar $pdf->SetXY(15,110); if ($status!="Paid") { $invoiceprefix = $_LANG["invoicenumber"]; $pdf->SetFont('dejavusans','B',12); $pdf->SetFillColor(226); $pdf->Cell(0,8,$invoiceprefix.$invoicenum.' - '.$_LANG["sklic"].$invoicenum,0,1,'L','1'); $pdf->SetFont('dejavusans','',10); $pdf->Cell(0,6,$_LANG["invoicesdatecreated"].': '.$datecreated.'',0,1,'L','1'); $pdf->Cell(0,6,$_LANG["invoicesdatedue"].': '.$duedate.'',0,1,'L','1'); $pdf->Ln(10); } else { $invoiceprefix = $_LANG["proformainvoicenumber"]; $pdf->SetFont('dejavusans','B',12); $pdf->SetFillColor(226); $pdf->Cell(0,8,$invoiceprefix.$invoicenum,0,1,'L','1'); $pdf->SetFont('dejavusans','',12); in this two line. need to replace getTodaysDate with transaction.date $pdf->Cell(0,6,$_LANG["invoicesdatecreated"].': '.getTodaysDate(1).'',0,1,'L','1'); -> on this line $pdf->Cell(0,6,$_LANG["datum_placila"].': '.getTodaysDate(1).'',0,1,'L','1'); -> and this $pdf->Ln(10); } Edited May 8, 2014 by essecosi 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 9, 2014 Share Posted May 9, 2014 if you mean transaction.date as the date the invoice was paid, you could use the following... foreach ($transactions AS $trans) { $transactiondate = $trans['date']; } $pdf->Cell(0,6,$_LANG["invoicesdatecreated"].': '.$transactiondate,0,1,'L','1'); $pdf->Cell(0,6,$_LANG["datum_placila"].': '.$transactiondate,0,1,'L','1'); if the invoice was paid with one payment, then there should only be one date in $transactiondate - if partial payments have been received, it should show the latest payment. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.