Mas-J Posted July 3, 2019 Share Posted July 3, 2019 Hello Everyone, I activate the proforma invoice feature for invoice. I want rename the PDF being sent to client if the invoice status is Unpaid become "Proforma Invoice-1900001" instead of the standard name "Invoice-1900001" So, it will make a differenciation between Unpaid invoice and Paid invoice PDF when client recieved it. Do you know what file and script should I edit to make it possible ? 0 Quote Link to comment Share on other sites More sharing options...
smart-mouse Posted June 17, 2020 Share Posted June 17, 2020 Same problem here, please. Did you resolve this? Thank you 0 Quote Link to comment Share on other sites More sharing options...
anoopk40 Posted June 18, 2020 Share Posted June 18, 2020 same here. Waiting for the update. 0 Quote Link to comment Share on other sites More sharing options...
Maison Posted August 1, 2020 Share Posted August 1, 2020 Changing/Translating Filename The default filename for invoices is Invoice-xxx. For quotes, this is Quote-xxx. For both, xxx is the ID of the invoice or quote. It may be desirable to change the filenames the clients see or translate into other languages. Achieve this in the same way as any text within WHMCS, by using the Language Files. Look for these strings: $_LANG['invoicefilename'] = "Invoice-"; $_LANG['quotefilename'] = "Quote-"; 0 Quote Link to comment Share on other sites More sharing options...
Mas-J Posted August 3, 2020 Author Share Posted August 3, 2020 On 8/1/2020 at 7:17 PM, zimbahost said: Changing/Translating Filename The default filename for invoices is Invoice-xxx. For quotes, this is Quote-xxx. For both, xxx is the ID of the invoice or quote. It may be desirable to change the filenames the clients see or translate into other languages. Achieve this in the same way as any text within WHMCS, by using the Language Files. Look for these strings: $_LANG['invoicefilename'] = "Invoice-"; $_LANG['quotefilename'] = "Quote-"; Thanks for the suggestion, but this is not the solution for my question actually 🙂 0 Quote Link to comment Share on other sites More sharing options...
Maison Posted August 3, 2020 Share Posted August 3, 2020 Sorry I got it wrong, you need two names in the files, one name when the invoice is open and one when the invoice is paid. Cool this idea also had thinking about it before. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 3, 2020 Share Posted August 3, 2020 2 hours ago, zimbahost said: Sorry I got it wrong, you need two names in the files, one name when the invoice is open and one when the invoice is paid. this would be so easy for WHMCS to do. themselves. 2 hours ago, zimbahost said: Cool this idea also had thinking about it before. I assume the feature request below was from Mas-J ? https://requests.whmcs.com/topic/change-proforma-file-name-without-eu-vat-addon I can think of one potential way to do it with a hook (untested - so it's only theoretical) - but doesn't Kian's Billing Extension rename the filename ?? if so, he'll know how to do this. 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted August 3, 2020 Share Posted August 3, 2020 (edited) There's no way to do that with standard WHMCS. The first solution that comes to mind is boring but should work. Use EmailPreSend to detect invoice-related emails and abort sending (you can't handle attachments via API) Re-create the same email directly including phpMailer class Download the invoice from dl.php file (Admin authentication required) and store it in a PHP variable (eg. $output = curl_exec($ch);) Query db to retreive invoice status and anything you want Name the PDF as you wish like for example "I am Sexy 2020 this invoice is Unpaid You are client ID 120 with USD currency.pdf") bold words come from database echo $output in that file setting haders (application/pdf) Attach the newly generated file in th email and send it As I said it is boring. Edited August 3, 2020 by Kian 0 Quote Link to comment Share on other sites More sharing options...
Mas-J Posted August 4, 2020 Author Share Posted August 4, 2020 14 hours ago, zimbahost said: Sorry I got it wrong, you need two names in the files, one name when the invoice is open and one when the invoice is paid. Cool this idea also had thinking about it before. No problem, hehe.. 10 hours ago, brian! said: this would be so easy for WHMCS to do. themselves. I assume the feature request below was from Mas-J ? https://requests.whmcs.com/topic/change-proforma-file-name-without-eu-vat-addon I can think of one potential way to do it with a hook (untested - so it's only theoretical) - but doesn't Kian's Billing Extension rename the filename ?? if so, he'll know how to do this. It's not me, but I've vote for it but I think WHMCS didn't consider it since 2 years ago LoL 9 hours ago, Kian said: There's no way to do that with standard WHMCS. The first solution that comes to mind is boring but should work. Use EmailPreSend to detect invoice-related emails and abort sending (you can't handle attachments via API) Re-create the same email directly including phpMailer class Download the invoice from dl.php file (Admin authentication required) and store it in a PHP variable (eg. $output = curl_exec($ch);) Query db to retreive invoice status and anything you want Name the PDF as you wish like for example "I am Sexy 2020 this invoice is Unpaid You are client ID 120 with USD currency.pdf") bold words come from database echo $output in that file setting haders (application/pdf) Attach the newly generated file in th email and send it As I said it is boring. Cool ! Thanks for the insight, however I can't create the script but I'll give this clue to our dev on other custom modules. 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.