Files
opensourcepos/application/models/inventory.php
jekkos 4ca452ef12 Fixed sale suspending / unsuspending (adapt db scripts)
Cleanup old code
More code review
Update item_quantities database model (composite pk)

git-svn-id: svn+ssh://svn.code.sf.net/p/opensourcepos/code/@120 c3eb156b-1dc0-44e1-88ae-e38439141b53
2014-08-19 19:55:46 +00:00

22 lines
486 B
PHP

<?php
class Inventory extends CI_Model
{
function insert($inventory_data)
{
return $this->db->insert('inventory',$inventory_data);
}
function get_inventory_data_for_item($item_id, $location_id=false)
{
$this->db->from('inventory');
$this->db->where('trans_items',$item_id);
if($location_id != false)
{
$this->db->where('trans_location',$location_id);
}
$this->db->order_by("trans_date", "desc");
return $this->db->get();
}
}
?>