Jump to content

transaction.date in pdf


Recommended Posts

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 by essecosi
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

# 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 by essecosi
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated