Jump to content

Customising viewinvoice - what does it affect ?


hatster

Recommended Posts

Hi,

 

I want to set up a EPOS type printer in our office so we can issue till-type receipts to people who pay in person (cutting down on wasted A4 and warmup time for our laser printer). Im thinking if I modify the viewinvoice template to match the paper size in my printer (till roll), then when the staff take a payment they can just click "printable version" and then print it to the till printer. Firstly can anyone see why this wouldnt work, and secondly, is this template used for anything else other than the "printable version" page from the admin portal, such as e-mailed invoices to clients, invoices viewed by clients in the client area, etc ?

 

If it is used by other things then I guess I will have to find a different way, maybe a custom script by whmcs ?

 

Thanks,

Edited by hatster
Link to comment
Share on other sites

when you click on "Printable Version" from admin area, it will popup with URL of the invoice from client area template, so what you see is what your client actually see, this is the template used (templates/templateName/viewinvoice.tpl).

 

so you need to customize "viewinvoice.tpl" for your own stuff/admin users, and for your clients you need to keep the same style.

 

as a quick idea of how you can do this, you may use different invoice.css for invoice when the person who viewing is logged-in in admin area:

1) open viewinvoice.tpl with any editor (NotePad++, ..).

2) replace line #7~ (CSS file for invoice):

it looks like this:

   <link href="templates/{$template}/css/invoice.css" rel="stylesheet">

 

you may modified it to:

 

{php}
if ($_SESSION['adminid']!='' && $_SESSION['adminid']!='0'){
 echo '<link href="templates/'.$this->_tpl_vars['template'].'/css/invoice-admin.css" rel="stylesheet">';
} else {
 echo '<link href="templates/'.$this->_tpl_vars['template'].'/css/invoice.css" rel="stylesheet">';
}
{/php}

 

so "invoice-admin.css" file has all the customization you want to apply to invoice view for your stuff members and your Printer :)

and your clients will never notice any deference.

Link to comment
Share on other sites

Just looking at this.

 

If i rename the viewinvoice.tpl file in each template folder (classic/default/orderforms/portal) one by one and test loading an invoice to identify which template is being used. The only one that stops it working is in the portal folder.

 

When looking at the file, line 4 is the one i need i think, it shows:

 

<link rel="stylesheet" type="text/css" href="templates/{$template}/invoicestyle.css">

 

Is this the right line ? this file looks different to the ones in all the other folders.....

 

Thanks,

Link to comment
Share on other sites

Thanks for the info but i dont think its really what im trying to achieve. I think I actually need a seperate "viewinvoice.tpl" for admin or user.

The script you gave me appears to let me change fonts, etc, but I want to completely change what information is displayed and how. I dont want a full invoice printed from the admin area.

 

Thanks,

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