Kenya Webhosting Posted July 26, 2011 Share Posted July 26, 2011 (edited) Hi, I have added 'Date Paid' and 'Payment Method' to my invoice PDFs using this $pdf->SetFont('helvetica','B',15); $pdf->SetFillColor(239); $pdf->Cell(0,8,$invoiceprefix.$invoicenum,0,1,'L','1'); $pdf->SetFont('helvetica','',10); $pdf->Cell(0,6,$_LANG["invoicesdatecreated"].': '.$datecreated.'',0,1,'L','1'); $pdf->Cell(0,6,$_LANG["invoicesdatedue"].': '.$duedate.'',0,1,'L','1'); $pdf->Cell(0,6,$_LANG["invoicesdatepaid"].': '.$datepaid.'',0,1,'L','1'); $pdf->Cell(0,6,$_LANG["invoicespaymentmethod"].': '.$paymentmethod.'',0,1,'L','1'); and adding to the lang file It works fine EXCEPT how do I remove the 'time' element of the 'Date Paid' and The 'Date Paid' shows even if the invoice has not yet been paid (it shows 00.00.00etc, see attached). It needs to only show if the invoice has been paid. Pleae advise Thanks Edited July 26, 2011 by Kenya Webhosting 0 Quote Link to comment Share on other sites More sharing options...
expandmind Posted July 26, 2011 Share Posted July 26, 2011 replace this line: $pdf->Cell(0,6,$_LANG["invoicesdatepaid"].': '.$datepaid.'',0,1,'L','1'); with: if ($status=="Paid") { $pdf->Cell(0,6,$_LANG["invoicesdatepaid"].': '.$datepaid.'',0,1,'L','1'); } 0 Quote Link to comment Share on other sites More sharing options...
Kenya Webhosting Posted July 27, 2011 Author Share Posted July 27, 2011 That worked a treat! Many thanks 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.