<?php
+/**********************************************************************
+ Copyright (C) FrontAccounting, LLC.
+ Released under the terms of the GNU General Public License, GPL,
+ as published by the Free Software Foundation, either version 3
+ of the License, or (at your option) any later version.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
+***********************************************************************/
/*
item_codes table is used to store both multiply foreign codes and
sale kits definition.
WHERE ";
if ($id == -1) // update with unknown $id i.e. from items table editor
- "item_code = ".db_escape($item_code)
+ $sql .= "item_code = ".db_escape($item_code)
." AND stock_id = ".db_escape($stock_id);
else
$sql .= "id = $id";
function delete_item_code($id)
{
- $sql="DELETE FROM ".TB_PREF."item_codes WHERE id=$id";
+ $sql="DELETE FROM ".TB_PREF."item_codes WHERE id='$id'";
db_query($sql,"an item code could not be deleted");
}
$sql = "SELECT item_code, description FROM "
.TB_PREF."item_codes "
. " WHERE stock_id='$item_code'
- AND item_
- code!='$item_code'";
+ AND item_code!='$item_code'";
return db_query($sql, "where used query failed");
}
?>
\ No newline at end of file