Hello HTG friends, I have been having an issue with the billing module and finally i think why this has been happening. Whenever i create a recurring item and the client has a draft, it adds the draft to the recurring item when it's generated. This is a major problem because clients are receiving finalized invoices from drafts. Anyone who has any idea on how to solve this issue, please let me know a.s.a.p
That's how it should work. If there is a draft and you automatically create a new invoice, then this draft is incorporated into the final invoice. This way, you can add items to the draft during the month and when you issue invoices at the end of the month, these get included in the invoice which is sent to the client.
Thanks for the quick replay till. Can this be turned into a feature? (checkbox). If you can point me in the right direction i can program it into the script myself.
Take a look at the file billing/create_recurring_invoices.php around line 418: Code: $invoice = $app................... if($invoice['invoice_id'] > 0) { $invoice_id = $invoice['invoice_id']; } else { // There is no invoice draft, so we have to create one. Either remove the whole $invoice = ..... and the if/else plus matching closing curly bracket, which is probably the fastest solution, or change it as you like. I can add a feature request on adding an option to disable this function.
Code: "SELECT invoice_id FROM invoice WHERE client_id = ? AND invoice_type = ? AND invoice_company_id = ? AND status_printed = 'n'"... Wait, reading the code i can also bypass this by simply setting the draft's printed to "y" by checking the "printed" checkbox on the draft page, right?