wsd Posted August 16, 2018 Share Posted August 16, 2018 Hi, I have started upgrading the WHMCS from version 5.2.17 to 7.6.0 My first problem is that Fixed Invoice Data does not work in the file viewinvoice.tpl I've put the code in viewinvoice.tpl {php} # Begin Fixed Invoice Data Mod $invoiceid = $this->_tpl_vars['invoiceid']; $result = select_query("mod_invoicedata","",array("invoiceid"=>$invoiceid)); $data = mysql_fetch_array($result); $match = $data[0]; if ($match) { $this->_tpl_vars['clientsdetails'] = unserialize($data[1]); $this->_tpl_vars['customfields'] = unserialize($data[2]); } # End Fixed Invoice Data Mod {/php} After that, a blank screen will appear when an invoice is displayed. What did I do wrong ? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 16, 2018 Share Posted August 16, 2018 19 minutes ago, wsd said: What did I do wrong ? it's a little naughty to still be using {php} in the templates with v7 (or v6 for that matter) - ideally you should be using a hook to pass the variables back to the template... however, check out the v6 Template Migration documentation below and note what it says about changes to $this->_tpl_vars https://docs.whmcs.com/Version_6_Template_Migration_Guide#.7Bphp.7D_Block_Syntax 0 Quote Link to comment Share on other sites More sharing options...
wsd Posted August 16, 2018 Author Share Posted August 16, 2018 Thank you Brian!I just do what WHMCS writes in the module I will do 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 17, 2018 Share Posted August 17, 2018 there is a in-built feature in WHMCS called "Store Client Data Snapshot"... https://docs.whmcs.com/Invoice_Tab#Store_Client_Data_Snapshot http://help.whmcs.com/m/payments/l/755345-fixing-preserving-customer-invoice-data Quote With this option ticked, clients name, address & custom field data (for example VAT Numbers) will all be recorded and saved at the time an invoice is generated, and then both the client area and PDF invoice views will display the name/address information as it was at the time of initial creation. So even if the clients profile is edited or the billing contact changed, only future invoices will reflect those changes, existing invoices will keep their current addressee. Once the option is enabled invoice data will start being fixed, it does not apply to invoices generated prior to being enabled. if that feature is just reproducing the functionality of your script, then perhaps you will no longer need the script going forward - at least not for new invoices. there is also at least one module in Marketplace that can do this too... 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.