mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-11-08 21:15:33 +09:00
🐛 Fix cron cleanup leaving order/invoice data inconsistent onAfterAdminCronRun() removed overdue unpaid invoices with a raw SQL DELETE, bypassing rmInvoice(). This left client_order.unpaid_ invoice_id pointing at a deleted invoice, orphaned invoice_item rows, and skipped releasing reserved stock/promo redemptions. Add InvoiceRepository::findUnpaidOlderThan() and route the cron cleanup through rmInvoice() for each matching invoice so related orders, invoice items, and reserved resources stay consistent. Fixes #4178 Claude-Session: https://claude.ai/code/session_01KdphsdrmmWYBi7mFZK94QQ Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>