Jam Posted December 19, 2019 Share Posted December 19, 2019 Hello again, I would like to ask how will be the Invoices send first to Draft before sending Invoice? 0 Quote Link to comment Share on other sites More sharing options...
WHMCS ChrisD Posted December 19, 2019 Share Posted December 19, 2019 @Jam invoices created manually will create in draft, invoices generated for renewal will not, out of the box it is not possible to change this behaviour but a third party addon or customisation may allow this to happen. 0 Quote Link to comment Share on other sites More sharing options...
Jam Posted December 19, 2019 Author Share Posted December 19, 2019 3 hours ago, WHMCS ChrisD said: @Jam invoices created manually will create in draft, invoices generated for renewal will not, out of the box it is not possible to change this behaviour but a third party addon or customisation may allow this to happen. Sorry, Sir, I didn't get your pouint 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted December 19, 2019 Share Posted December 19, 2019 1 hour ago, Jam said: Sorry, Sir, I didn't get your point he means that if you manually create an invoice in the admin area, it's status will default to being "Draft"; if WHMCS automatically creates it, e.g it's a renewal invoice or for a new order, then it will have another status, e.g Paid, Unpaid etc. but never Draft. renewal/order invoices can be assigned draft status using hook(s) - usually it's done with two hooks, one to change the status of the invoice to draft after it's created, and another to prevent the newly draft invoice from being emailed to the client.... note that clients shouldn't be able to view draft invoices from their client area. I assume the idea of your question is that you want to inspect / edit the invoices in the admin area before they get sent to the client ? 0 Quote Link to comment Share on other sites More sharing options...
Jam Posted December 20, 2019 Author Share Posted December 20, 2019 12 hours ago, brian! said: I assume the idea of your question is that you want to inspect / edit the invoices in the admin area before they get sent to the client ? I want the Invoices to send first to Draft before send to Unpaid For example, I make Bill Item and I click save changes, its automatically send to Unpaid Invoices, not in Draft. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted December 20, 2019 Share Posted December 20, 2019 9 hours ago, Jam said: For example, I make Bill Item and I click save changes, its automatically send to Unpaid Invoices, not in Draft. i'm not sure that I follow - a billable item won't become an invoice until you tell WHMCS to make it one... 0 Quote Link to comment Share on other sites More sharing options...
WHMCS ChrisD Posted December 23, 2019 Share Posted December 23, 2019 @Jam Are you talking about using Billable Items or your recurring invoices? 0 Quote Link to comment Share on other sites More sharing options...
Jam Posted December 27, 2019 Author Share Posted December 27, 2019 On 12/23/2019 at 12:15 PM, WHMCS ChrisD said: @Jam Are you talking about using Billable Items or your recurring invoices? Both Sir 0 Quote Link to comment Share on other sites More sharing options...
WHMCS ChrisD Posted December 27, 2019 Share Posted December 27, 2019 45 minutes ago, Jam said: Both Sir You can not do this with recurring items, these will always invoice to the client directly, for Billable items you have a choice of : Don't invoice for now - so it will remain listed in the clients account as an unbilled item Invoice on Next Cron Run - generate an invoice for it the next time your daily cron job runs Add to User's Next Invoice - add to the next automated recurring renewal invoice to be generated for products and services Invoice as Normal for Due Date - allows you to set a specific date the item is due and it will be invoiced X days in advance like all other products/services Recur - allowing you to set for the item to recur every X number of Days/Weeks/Months/Years for a defined or unlimited number of times 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted December 27, 2019 Share Posted December 27, 2019 9 hours ago, WHMCS ChrisD said: You can not do this with recurring items, these will always invoice to the client directly unless, as previously stated, you interrupt the process with a hook. 😎 0 Quote Link to comment Share on other sites More sharing options...
Chrisfish Posted August 27, 2020 Share Posted August 27, 2020 Hi, I was trying to achieve the same thing and did it by implemeting the following hook: /** * Sets the status of new invoices to Draft * @params array $vars [ * source => [adminarea, api, autogen] * user => (string) * invoiceid => (int) * status => (string) * ] */ add_hook('InvoiceCreation', 10, function($vars) { try { Capsule::table('tblinvoices') ->where('id', $vars['invoiceid']) ->update( [ 'status' => 'Draft', ] ); logActivity(sprintf('Invoice %d status automatically set to draft', $vars['invoiceid']), 0); } catch (\Exception $e) { logActivity(sprintf('Invoice %d status could not be set to draft', $vars['invoiceid']), 0); } }); 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.