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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user