M1.x Is Magento updated_at changed on Credit Memo / Refund when using Mage::getModel('sales/order')->getCollection()?

magento.stackexchange https://magento.stackexchange.com/questions/287439

  •  12-03-2021
  •  | 
  •  

Question

Is Magento updated_at changed on Credit Memo / Refund when using Mage::getModel('sales/order')->getCollection()?

We use

Mage::getModel('sales/order')->getCollection()

to find orders that have recently been placed.

Only after an order was shipped it can be returned and credit memoed/refunded.

With the below query would we then also include the credit memo's because updated_at is touched when issuing the credit memo or i this not the case -- and do we need some more magic to inlcude the credit memo orders?

thx

$collection = Mage::getModel('sales/order')->getCollection()
->addAttributeToSelect('customer_id', $customer_id)
->addFieldToFilter('status', array('eq' => 'complete'))
->addFieldToFilter('updated_at', array('from' => $dateStart, 'to' => $dateEnd));
Était-ce utile?

La solution

Even though the credit memo is a separate entity, when a credit memo/refund is raised it does update attributes on the order entity. i.e. base_total_refunded, base_shipping_refunded, etc... (these can be seen in table sales_flat_order)

Because of this, the updated_at attribute would also be updated.

Licencié sous: CC-BY-SA avec attribution
Non affilié à magento.stackexchange
scroll top