Fix incorrect date handling for closing order invoices

Replaced `created_at` with `closed_at` to accurately set the timestamp when closing collected order invoices. This ensures the correct date is applied during the invoice update process.
This commit is contained in:
Jepp9350
2025-05-06 12:14:41 +02:00
parent 45faa7c56a
commit 84b6d4de3e
@@ -420,9 +420,7 @@ class orderInvoicesRoute
// Add the collected order invoice to E-Conomic
$collected_order_invoices->addVehicleSubscriptionsTransaction();
// Close the collected order invoice
$collected_order_invoices->closeCollection();
// Set the correct date for the collected order invoice
$collected_order_invoices->created_at->set($timestamp_selected);
$collected_order_invoices->closed_at->set($timestamp_selected);
// Update the collected order invoice
$collected_order_invoices->objectChanged();
// Return the collected order invoice