Skip to content

Change Invoice Created Date equal to Invoice Paid Date WHMCS

1 min read

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!!

 

Related services

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.

Was this answer helpful?

Still stuck? Open a ticket