Jump to content

Changing invoice template


avisonjohn

Recommended Posts

OK, been searching for this but found nothing.

 

I'm looking to purchase WHMCS owned non branded license, however I have a single issue I need to address first.

 

Is it possible, with the quote and invoices, to select a different template?

Ie, When emailing a quote or invoice, I want the invoice to include our logo, but in the admin section, I want to be able to download the quote/invoice without showing the logo so that we are able to print it out on our headed paper which will already include our logo.

 

The reason I ask this, is that our headed paper is borderless, and it would be much easier (and cheaper) not to have to hae the logo and background printed from the PDF as this wont be borderless either.

 

If this is possible, I'll happily purchase WHMCS, otherwise I will have to stick with our current solution.

Link to comment
Share on other sites

WHMCS doesn't support multiple invoice templates but what you could do is edit the viewinvoice.tpl template file and add a conditional statement to look to see if an admin user is logged in and display things differently.

 

e.g. the following would not add the logo if an admin user is accessing the view invoice page.

# Logo
if (!isset($_SESSION['adminid'])) {
 if (file_exists(ROOTDIR.'/images/logo.png')) $pdf->Image(ROOTDIR.'/images/logo.png',20,25,75); 
 elseif (file_exists(ROOTDIR.'/images/logo.jpg')) $pdf->Image(ROOTDIR.'/images/logo.jpg',20,25,75);
 else $pdf->Image(ROOTDIR.'/images/placeholder.png',20,25,75);
}

Link to comment
Share on other sites

WHMCS doesn't support multiple invoice templates but what you could do is edit the viewinvoice.tpl template file and add a conditional statement to look to see if an admin user is logged in and display things differently.

 

e.g. the following would not add the logo if an admin user is accessing the view invoice page.

# Logo
if (!isset($_SESSION['adminid'])) {
 if (file_exists(ROOTDIR.'/images/logo.png')) $pdf->Image(ROOTDIR.'/images/logo.png',20,25,75); 
 elseif (file_exists(ROOTDIR.'/images/logo.jpg')) $pdf->Image(ROOTDIR.'/images/logo.jpg',20,25,75);
 else $pdf->Image(ROOTDIR.'/images/placeholder.png',20,25,75);
}

 

Thats a brilliant idea, but I would want to be able to choose to download the invoice with or without the logo.

Is there anyway, in the admin section where the invoice button is, that I can add an additional button next to it which opens the same link but maybe with an additional query string parameter and in the invoice template file, I can check to see if that parameter is set instead of checking if the admin is logged in.

 

If this isnt possible (mainly due to the file being encrypted), does WHMCS offer any customisation/tweaking service in which they can simply add the button in and send the encrypted file over to me for a cost?

Link to comment
Share on other sites

Only a few of the admin area templates can be changed an the invoice page is not one of them.

 

What you could do is pass a variable in the URL to hide the logo.

 

https://yourdomain.com/dl.php?type=i&id=1234&viewpdf=1&hidelogo=1

 

Then check for the variable in the invoicepdf.tpl and make sure they are an admin user

if (!isset($_SESSION['adminid']) || ($_REQUEST['hidelogo'] != 1 && isset($_SESSION['adminid']))) {

Link to comment
Share on other sites

  • 10 months later...
Anyone have any suggestions?

 

Starting to wonder if this is the right section on the forum for this.

 

My suggestion to you is to try ****http://www.fetchflow.com/invoice-templates. Here you will find all of your answer and you search has now been stopped. Lot of features and easy to customise and you can use it in your website, softwares and custom invoice templates.

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