0003862: Straight Line Depreciation value calculation is wrong
[fa-stable.git] / includes / db / inventory_db.inc
index 55e3b687bc965090ac3f56c0cbe293e8ae0e4b24..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)