1. We need to edit invoicepdf.tpl file to achieve the same. The file is responsible for all the invoices PDF file generated.
2. The file can be found at whmcsfolder/templates/{your active template}/invoicepdf.tpl
3. Find the below code (around line number 64)
$pdf->Cell(0, 6, Lang::trans('invoicesdatecreated') . ': ' . $datecreated, 0, 1, 'L', '1');
$pdf->Cell(0, 6, Lang::trans('invoicesdatedue') . ': ' . $duedate, 0, 1, 'L', '1');
4. We need to replace the above code by the following lines of code :
if(!empty($datepaid)){
$pdf->Cell(0, 6, Lang::trans('invoicesdatecreated') . ': ' . $datepaid, 0, 1, 'L', '1');
}else{
$pdf->Cell(0, 6, Lang::trans('invoicesdatecreated') . ': ' . $datecreated, 0, 1, 'L', '1');
$pdf->Cell(0, 6, Lang::trans('invoicesdatedue') . ': ' . $duedate, 0, 1, 'L', '1');
}
5. Save the file.
Done!!
Ucartz services for this topic
- Managed cPanel VPS: cPanel included; we handle updates, security and monitoring.
- cPanel server management: hardening, migrations and 24/7 monitoring, with no long-term contract.
- cPanel, Plesk and LiteSpeed licences: for VPS and dedicated servers, with installation help on demand.
