dbosnj35 Posted October 9, 2012 Share Posted October 9, 2012 how to add extra note on the bottom of the invoice if Tax Exempt is set for the client? Can someone help me with right code for invoicepdf.tpl file. I would like to set "if" contidion and that note to be visible only if the tax exempt is set to yes for the client and not on the invoices for other clients. Its the tax law in my country. Tx. 0 Quote Link to comment Share on other sites More sharing options...
dbosnj35 Posted December 11, 2022 Author Share Posted December 11, 2022 Only 10 yrs and no help... 🙂 0 Quote Link to comment Share on other sites More sharing options...
Humanbeing Posted December 11, 2022 Share Posted December 11, 2022 I suggest you reach out to whmcs support and ask for this feature to be included. 0 Quote Link to comment Share on other sites More sharing options...
AladdinJ Posted December 12, 2022 Share Posted December 12, 2022 (edited) I wrote this hook for you, this will help you add_hook('InvoiceCreated', 1, function($vars) { $invoice_ID = $vars['invoiceid']; $invoice = Capsule::table('tblinvoices')->WHERE('id', $invoice_ID)->first(); $userid = $invoice->userid; $command = 'GetClientsDetails'; $postData = array( 'clientid' => $userid, 'stats' => true, ); $results = localAPI($command, $postData); $taxexempt = $results["client"]["taxexempt"]; if ($taxexempt) $note = "This Customer is taxexempt"; else $note = "This Customer is Not taxexempt"; $command = 'UpdateInvoice'; $postData = array( 'invoiceid' => $invoice_ID, 'notes' => $note, ); $results = localAPI($command, $postData); }); Edited December 12, 2022 by AladdinJ 1 Quote Link to comment Share on other sites More sharing options...
dbosnj35 Posted December 12, 2022 Author Share Posted December 12, 2022 thank you very much. I will try it today 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.