return max($qoh - $quantity_before, 0);
}
+
+ function db_postwrite($cart, $trans_type) {
+ if(!is_a($cart, "Cart") ) return;
+
+ // It's a cart. Find all the stock_id and update the cache table
+ foreach($cart->line_items as $line_no => $item) {
+ $stock_id = $item->stock_id;
+ update_queue_quantity_for_item($stock_id);
+ update_qoh_for_item($stock_id);
+ }
+
+ }
}
?>
}
if (list_updated('stock_id') || in_ajax()) $Ajax->activate('item_schedule') ;
-else update_queue_quantities() && update_qoh_for_item();
+//else update_queue_quantities() && update_qoh_for_item();
//if (!@$_GET['popup'])