baymax Posted August 13, 2020 Share Posted August 13, 2020 Hi, If a Transaction is deleted, is there anyway to have to include the Invoice # (and the amount?) that was associated for that Transaction in Activity Logs? Right now, it only includes something like this: Deleted Transaction - Transaction ID: 1558 This is not very helpful... I know it's very bad practice to delete a Transaction but the reason I ask for this feature is because I can't control what our employees so sometimes mistakes are made. Is there a hook for this? 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted August 13, 2020 Share Posted August 13, 2020 Still in Activity Log try looking for 1558. You should find "Added Transaction - Transaction ID: 1558" followed by "Added Invoice Payment: Invoice ID XXX" . 0 Quote Link to comment Share on other sites More sharing options...
baymax Posted August 14, 2020 Author Share Posted August 14, 2020 Yes, but even with that requires a bit of investigation to find out the Invoice ID. If you do a search using the Trans ID, the 'Added Invoice Payment ' log does not come up hence why it would be helpful to have that included. 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted August 14, 2020 Share Posted August 14, 2020 (edited) You can do it yourself. <?php add_hook('AddTransaction', 1, function($vars) { logActivity('This is my custom log'); }); Edited August 14, 2020 by Kian 0 Quote Link to comment Share on other sites More sharing options...
baymax Posted August 17, 2020 Author Share Posted August 17, 2020 On 8/14/2020 at 11:18 AM, Kian said: You can do it yourself. <?php add_hook('AddTransaction', 1, function($vars) { logActivity('This is my custom log'); }); Hi Kian, Can you please let me know what this does? I added this hook but I didn't notice any changes. 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted August 17, 2020 Share Posted August 17, 2020 It creates a log in Utilities > Logs > Activity Log every time a transaction is added. You just need to get transactions details (eg. ID, amount, payment method...) with a query and store them in log. This way you can retreive information about deleted transactions directly from Activity Log. 0 Quote Link to comment Share on other sites More sharing options...
yggdrasil Posted August 17, 2020 Share Posted August 17, 2020 (edited) On 8/12/2020 at 10:20 PM, baymax said: Hi, If a Transaction is deleted, is there anyway to have to include the Invoice # (and the amount?) that was associated for that Transaction in Activity Logs? Right now, it only includes something like this: Deleted Transaction - Transaction ID: 1558 This is not very helpful... I know it's very bad practice to delete a Transaction but the reason I ask for this feature is because I can't control what our employees so sometimes mistakes are made. Is there a hook for this? Exactly, you should not delete transactions unless there is a good reason. You can't control what employees do? Yes you can. Why are you giving them permission to delete transactions? You can assign specific individual permissions per group and staff user. One of them is delete transactions. Just uncheck that for those users. Edited August 17, 2020 by yggdrasil 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.