Hey Everyone:
I figured there's a lot of people here that have taught me a lot about how to code in Dexterity, and I could use some of that magic right now... LOL
I have a client who - without going into too much detail - needs to be able to detect when an invoice contains a certain line item at the time of payment/void/reversal/etc. I've coded a module that will do everything except when the document is reversed using the write-off routine. Unfortunately, this is an important piece of functionality, and I can't seem to find where the hook should be located. Using the method that Tim Wappat taught me about how to profile scripts, I've managed to narrow down where I need to hook, except... I don't know how the system gets and compiles the list of documents that are being written off.
My first instinct is to hook after original onto 'Apply of form rmApply', except that when I noticed this, the form must be getting its list from somewhere because it has the source credit note and the desitnation invoice number. I suppose (as I write this, I think of it) that I could try and recreate the list of documents that it wants to write off using my own code, but that seems ... inelegant.
Does anyone have a better place to try and insert a script of this nature? Thoughts? Experience?
Thanks!
-J