Jump to content

Company name instead of name


Recommended Posts

Hello,

 

When my WHMCS generates an invoice it is generating with the person's name, but I would like it to appear the company name (if any).

 

For example a new user registers, and uses the documents of his company, but if he puts his name and company when the invoice is generated instead of going on behalf of the company, appears with his name.

 

Do you know any way that I use to show the company name (if any) on the invoice instead of the name.

 

Thank you,

 

Marcos Antonio

Link to comment
Share on other sites

if you mean the pdf invoice, you will need to edit the invoicepdf.tpl template in your template directory.

 

inside invoicepdf.tpl, there should be lines similar to below...

 

if ($clientsdetails["companyname"]) {
$pdf->Cell(0,4,$clientsdetails["companyname"],0,1,'L');
$pdf->Cell(0,4,$_LANG["invoicesattn"].": ".$clientsdetails["firstname"]." ".$clientsdetails["lastname"],0,1,'L');
} else {
$pdf->Cell(0,4,$clientsdetails["firstname"]." ".$clientsdetails["lastname"],0,1,'L');

this should display company name (if it exists) and then on the line below:

ATTN: firstname lastname

 

to get rid of the above line and have the invoice show the company name (or just firstname lastname if no company name exists), change the code to the following...

 

if ($clientsdetails["companyname"]) {
$pdf->Cell(0,4,$clientsdetails["companyname"],0,1,'L');
} else {
$pdf->Cell(0,4,$clientsdetails["firstname"]." ".$clientsdetails["lastname"],0,1,'L');

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