I need to change the value of the qty_invoiced
column for certain order in the sales_flat_order_item
table, but unfortunately nothing happens.
here is my code:
$allOrders = Mage::getModel('sales/order')->getCollection()
->addFieldToFilter('status', 'complete');
foreach ($allOrders as $value) {
$order = Mage::getModel('sales/order')->load($value->getId());
if($order->getincrementId() == '100000003'){
foreach ($order->getAllItems() as $item) {
$qtyOrdered = $item->getQtyOrdered();
$item->setQtyInvoiced($qtyOrdered);
}
}
}