Jump to content

[Solved]How to change pdf invoice filename from order_id.pdf to invoice_number.pdf?


outlet.ee

Recommended Posts

Hi!

 

Try to modify the PDF.php in Classes folder.

 

Look for this code:

return $pdf->Output(sprintf('%06d', self::$order->id).'.pdf', $mode);
}

/**
* Product table with references, quantities...
*/
function ProdReturnTab()
{
 global $ecotax;
 $header = array(
  array(self::l('Description'), 'L'),
  array(self::l('Reference'), 'L'),
  array(self::l('Qty'), 'C')

 

and find this line (at the top of the code):

 

 

return $pdf->Output(sprintf('%06d', self::$order->id).'.pdf', $mode);

 

 

This line generate the invoice filename.

 

Here you can view the documentation of the FPDF: http://www.fpdf.org/en/doc/output.htm

 

Good Dev.

 

 

 

EDIT: Remember to make a backup before anything...

Edited by fernandokerber (see edit history)
Link to comment
Share on other sites

  • 3 months later...
  • 1 year later...
  • 2 months later...
  • 4 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...