It depends on your model, especially how and when invoices are booked in your accounting system.
I have a system, where an invoice is booked immediately. To keep the accounting safe: nothing can be deleted, never, ever. If an invoice is booked and the order cancelled, my system has to issue a "credit note" (thereby cancelling the original invoice). In that system all invoices (and credit notes) are immediately emailed. So, if an order was still in the state that no invoice was yet made: no problem to delete. If it is in a confirmed state, then an invoice has been made and a credit-note should be made and emailed. And the system also marks both the invoice and credit note as payed. But if payment actions have already been done, then the customer must get that money back. Some of those patterns are described in Martin Fowler's first book : Analysis Patterns. http://martinfowler.com/books/ap.html Also see http://martinfowler.com/eaaDev/AccountingNarrative.html and http://martinfowler.com/eaaDev/ReversalAdjustment.html All in all I would be extremely cautious deleting invoices, especially to always keep accounting safe & sound. On Monday, 3 March 2014 14:59:57 UTC+1, EvidentHost wrote: > > I am using cascade delete, when an order is deleted the invoices will be > deleted too, but if invoices are deleted I want to ask user if they want > transactions to be deleted too. Because may be they don't want to delete > payment transactions on invoice delete. I guess for this case i should not > use cascade deleting in entity file but should delete transactions > manually? Or is there a trick to apply onDelete=cascade not on any deletion > but in a user defined case? > -- You received this message because you are subscribed to the Google Groups "doctrine-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/doctrine-user. For more options, visit https://groups.google.com/groups/opt_out.
