Rev 36925 |
Last modification |
Compare with Previous |
View Log
| RSS feed
Last modification
- Rev 36926 2026-06-25 14:20:36
- Author: amit
- Log message:
- Link returnorderinfo to credit_note in DN-refund path (approveDebitNoteRefund)
approveDebitNoteRefund issues a RETURNS credit note but created the
ReturnOrderInfo rows before the CN and never set credit_note_id, so DN
returns showed a null FK (blank CN in reports) despite a valid CN existing.
r36817 only wired this FK into applyInvoiceReturnViaCreditNote. Collect the
created ReturnOrderInfo rows and stamp credit_note_id after the CN is
persisted (parity with the invoice-return path).
Add backfill_dn_return_credit_note_id.sql to link existing null-FK rows by
invoice -> RETURNS CN, excluding ambiguous multi-CN invoices.