From 4aff29e09b39f44eb82454946d32e263497e38d7 Mon Sep 17 00:00:00 2001 From: Maxime Bourget Date: Sat, 15 Jun 2013 13:05:14 +0100 Subject: [PATCH] Add QOH in MOP --- includes/picking.inc | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/includes/picking.inc b/includes/picking.inc index 2713dc1..d4141dc 100644 --- a/includes/picking.inc +++ b/includes/picking.inc @@ -86,7 +86,8 @@ function pick_query() { } -function insert_pick($sku, $order_id, $detail_id, $debtor_no, $branch_code, $to_pick, $quantity) { +function insert_pick($sku, $order_id, $detail_id, $debtor_no, $branch_code, $to_pick, $quantity, $qoh_location=null) { + if($qoh_location == null) $qoh_location = OrderXtraConfig::$default_location; $item_link = "/modules/order_line_extra/item_schedule.php?stock_id=$sku"; $order_link = "/sales/sales_order_entry.php?OrderNumber=$order_id"; $base = substr($sku, 0, 8); @@ -122,6 +123,21 @@ function insert_pick($sku, $order_id, $detail_id, $debtor_no, $branch_code, $to_ type = 'booked'"; db_query($sql, 'There was a problem inserting the picking information.'); + # add QOH + $qoh = get_qoh_on_date($sku, $qoh_location); + $sql = "INSERT INTO ".TB_PREF."topick SET + order_id = $order_id, + order_link = '$order_link', + location = '$location', + sku = '$sku', + item_link = '$item_link', + base = '$base', + variation = '$variation', + quantity = $qoh, + detail_id = $detail_id, + type = 'stock'"; + db_query($sql, 'There was a problem inserting the picking information.'); + } function update_pick($detail_id, $to_pick) { -- 2.30.2