// reverse all the changes in the sales order
$items_result = get_customer_trans_details($type, $type_no);
$order = get_customer_trans_order($type, $type_no);
if ($order) {
// reverse all the changes in the sales order
$items_result = get_customer_trans_details($type, $type_no);
$order = get_customer_trans_order($type, $type_no);
if ($order) {
- update_parent_line(13, $row['id'], -$row['quantity']);
+ $order_line = db_fetch($order_items);
+ update_parent_line(13, $order_line['id'], -$row['quantity']);