X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fdb%2Finventory_db.inc;h=52c016746e570cc741e1c645e1f71fd73a22a7e7;hb=85adfd5e202218a984ef5e1b64197472e0a2ccac;hp=55e3b687bc965090ac3f56c0cbe293e8ae0e4b24;hpb=dfb5670c0eb599ea0df7a9148a2864feec324e74;p=fa-stable.git diff --git a/includes/db/inventory_db.inc b/includes/db/inventory_db.inc index 55e3b687..52c01674 100644 --- a/includes/db/inventory_db.inc +++ b/includes/db/inventory_db.inc @@ -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)