[0005214] Stock Check Sheet: changed option name to less confusing for shortages...
[fa-stable.git] / includes / db / inventory_db.inc
index 19f54f2b9802d08cafeba64bc362d9266433cad1..52c016746e570cc741e1c645e1f71fd73a22a7e7 100644 (file)
@@ -110,6 +110,20 @@ function get_unit_cost($stock_id)
        return $myrow[0];
 }
 
+//--------------------------------------------------------------------------------------
+function get_purchase_cost($stock_id)
+{
+       $sql = "SELECT purchase_cost
+               FROM ".TB_PREF."stock_master
+               WHERE stock_id=".db_escape($stock_id);
+       $result = db_query($sql, "The purchase cost cannot be retrieved");
+
+       $myrow = db_fetch_row($result);
+
+       return $myrow[0];
+}
+
 //--------------------------------------------------------------------------------------
 
 function is_inventory_item($stock_id)
@@ -317,7 +331,7 @@ function get_stock_gl_code($stock_id)
 {
        /*Gets the GL Codes relevant to the item account  */
        $sql = "SELECT mb_flag, inventory_account, cogs_account,
-               adjustment_account, sales_account, assembly_account, dimension_id, dimension2_id FROM
+               adjustment_account, sales_account, wip_account, dimension_id, dimension2_id FROM
                ".TB_PREF."stock_master WHERE stock_id = ".db_escape($stock_id);
 
        $get = db_query($sql,"retreive stock gl code");