barneby Posted August 12, 2022 Share Posted August 12, 2022 Hello, I need to perform a custom action after deleting the invoice, but I can't find any hook that would allow me to do this. How can I perform a custom action after deleting an invoice? Thank you. 0 Quote Link to comment Share on other sites More sharing options...
web2008 Posted August 12, 2022 Share Posted August 12, 2022 It's not really a good idea to delete invoices because of the accounts! You should rather cancel invoices that are incorrect or that are not to be paid. 1 Quote Link to comment Share on other sites More sharing options...
barneby Posted August 12, 2022 Author Share Posted August 12, 2022 I use pro forma invoicing. If it is a prpforma invoice, I can delete it. 0 Quote Link to comment Share on other sites More sharing options...
web2008 Posted August 12, 2022 Share Posted August 12, 2022 Yes, when the Proforma Invoice is in a separate number series, you can delete these. 0 Quote Link to comment Share on other sites More sharing options...
barneby Posted August 12, 2022 Author Share Posted August 12, 2022 (edited) Ok. How can I perform a custom action after deleting an proforma ? Edited August 12, 2022 by barneby 0 Quote Link to comment Share on other sites More sharing options...
pRieStaKos Posted August 13, 2022 Share Posted August 13, 2022 There is no InvoiceDeleted hook index. If you want to catch it, you should cancel and use InvoiceCancelled. 0 Quote Link to comment Share on other sites More sharing options...
Remitur Posted August 19, 2022 Share Posted August 19, 2022 On 8/12/2022 at 12:45 PM, barneby said: I use pro forma invoicing. If it is a prpforma invoice, I can delete it. You can, but you can't... Sometimes it may happen that you delete a proforma, but the corresponding rows (stored in a different table) are not deleted. So it happens that: - you delete proforma id 12345 - rows of deleted proforma id 12345 stay and are not deleted - you create a new proforma and... guess, its number will be the last one available,12345! - in the proforma you have just created your user will find the the rows of the "previous" proforma id 12345 (even if they were of a different user) So, a great mess... Right way to do: - never delete proforma: always just cancel them - if you want to delete them, do it for any of them but the last one (with the higher id) 1 Quote Link to comment Share on other sites More sharing options...
zitu4life Posted August 19, 2022 Share Posted August 19, 2022 2 hours ago, Remitur said: You can, but you can't... Sometimes it may happen that you delete a proforma, but the corresponding rows (stored in a different table) are not deleted. So it happens that: - you delete proforma id 12345 - rows of deleted proforma id 12345 stay and are not deleted - you create a new proforma and... guess, its number will be the last one available,12345! - in the proforma you have just created your user will find the the rows of the "previous" proforma id 12345 (even if they were of a different user) So, a great mess... Right way to do: - never delete proforma: always just cancel them - if you want to delete them, do it for any of them but the last one (with the higher id) great explanation. 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.