X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=inventory%2Fincludes%2Fdb%2Fitems_db.inc;fp=inventory%2Fincludes%2Fdb%2Fitems_db.inc;h=18f441e3d07c8685b2a530bc9cafe1cdab62b24e;hb=772bf0b1831da4239fd643c3608a57f9e59d345c;hp=ed69376ef00d79101c95f3367ee187dd7b705823;hpb=a9d55e1c13cbd6a6305b9322ec8621a06516f9f3;p=fa-stable.git diff --git a/inventory/includes/db/items_db.inc b/inventory/includes/db/items_db.inc index ed69376e..18f441e3 100644 --- a/inventory/includes/db/items_db.inc +++ b/inventory/includes/db/items_db.inc @@ -64,7 +64,7 @@ function add_item($stock_id, $description, $long_description, $category_id, db_query($sql, "The item could not be added"); $sql = "INSERT INTO ".TB_PREF."loc_stock (loc_code, stock_id) - SELECT ".TB_PREF."locations.loc_code, ".db_escape($stock_id) + SELECT loc_code, ".db_escape($stock_id) ." FROM ".TB_PREF."locations"; db_query($sql, "The item locstock could not be added"); @@ -98,9 +98,10 @@ function delete_item($stock_id) function get_item($stock_id) { - $sql = "SELECT ".TB_PREF."stock_master.*,".TB_PREF."item_tax_types.name AS tax_type_name - FROM ".TB_PREF."stock_master,".TB_PREF."item_tax_types - WHERE ".TB_PREF."item_tax_types.id=".TB_PREF."stock_master.tax_type_id + $sql = "SELECT item.*, taxtype.name AS tax_type_name + FROM ".TB_PREF."stock_master item," + .TB_PREF."item_tax_types taxtype + WHERE taxtype.id=item.tax_type_id AND stock_id=".db_escape($stock_id); $result = db_query($sql,"an item could not be retreived");