hatster Posted January 11, 2015 Share Posted January 11, 2015 (edited) 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 January 11, 2015 by hatster 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted January 11, 2015 Share Posted January 11, 2015 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. 0 Quote Link to comment Share on other sites More sharing options...
hatster Posted January 11, 2015 Author Share Posted January 11, 2015 wow thanks. I shall try that this week coming and report back how i get on 0 Quote Link to comment Share on other sites More sharing options...
hatster Posted January 12, 2015 Author Share Posted January 12, 2015 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, 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted January 12, 2015 Share Posted January 12, 2015 yes it should be the one you need to replace (remember to customize the code provided to match it). how different? 0 Quote Link to comment Share on other sites More sharing options...
hatster Posted January 13, 2015 Author Share Posted January 13, 2015 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, 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted January 13, 2015 Share Posted January 13, 2015 you can use the same code to display entirely different invoice to logged-in admin, and keep the default layout to clients, the same logic can be used. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.