2

Does anyone know how I can change the order and invoicedate in Magento? I want to change the order date back in time.

Can anyone help me?

Lars Boele
  • 375
  • 2
  • 10
  • 26

2 Answers2

3

If you don't want to do this programatically you can modify the information stored in the sales_flat_order and sales_flat_invoice tables.

If the invoice date also needs to be updated in the overview you must modify sales_flat_order_grid and sales_flat_invoice_grid aswell.

Kenny
  • 5,350
  • 7
  • 29
  • 43
  • Thank you Kenny, if I do that. In the invoice the date is changed but in the overview of all the invoice, the old date still stands there. How can I change that? – Lars Boele Oct 09 '12 at 14:01
  • Updated my answer to modify the invoice date in the grid overview. – Kenny Oct 10 '12 at 08:09
1

Try

    /* @var Mage_Sales_Model_Order_Invoice $invoice */
    $invoice = Mage::getModel('sales/order_invoice')->loadByIncrementId($invoiceIncrementId);
    $invoice->setCreatedAt(...);
    $invoice->setUpdatedAt(...);
    $invoice->save();
Dmytro Zavalkin
  • 5,265
  • 1
  • 30
  • 34