mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-05-05 22:35:29 -04:00
Add stock location filtering on items
This commit is contained in:
34
application/libraries/Item_lib.php
Normal file
34
application/libraries/Item_lib.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
class Item_lib
|
||||
{
|
||||
var $CI;
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$this->CI =& get_instance();
|
||||
}
|
||||
|
||||
function get_item_location()
|
||||
{
|
||||
if(!$this->CI->session->userdata('item_location'))
|
||||
{
|
||||
$stock_locations = $this->CI->Stock_locations->get_undeleted_all()->result_array();
|
||||
$location_name = $stock_locations[0]['location_id'];
|
||||
$this->set_item_location($location_name);
|
||||
}
|
||||
return $this->CI->session->userdata('item_location');
|
||||
}
|
||||
|
||||
function set_item_location($location)
|
||||
{
|
||||
$this->CI->session->set_userdata('item_location',$location);
|
||||
}
|
||||
|
||||
function clear_item_location()
|
||||
{
|
||||
$this->CI->session->unset_userdata('item_location');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
define("PRECISION", 3);
|
||||
|
||||
class Receiving_lib
|
||||
{
|
||||
@@ -135,7 +136,7 @@ class Receiving_lib
|
||||
}
|
||||
|
||||
$insertkey=$maxkey+1;
|
||||
$item_info=$this->CI->Item->get_info($item_id);
|
||||
$item_info=$this->CI->Item->get_info($item_id,$item_location);
|
||||
//array records are identified by $insertkey and item_id is just another field.
|
||||
$item = array(($insertkey)=>
|
||||
array(
|
||||
|
||||
@@ -231,7 +231,7 @@ class Sale_lib
|
||||
}
|
||||
|
||||
$insertkey=$maxkey+1;
|
||||
$item_info=$this->CI->Item->get_info($item_id);
|
||||
$item_info=$this->CI->Item->get_info($item_id,$item_location);
|
||||
//array/cart records are identified by $insertkey and item_id is just another field.
|
||||
$item = array(($insertkey)=>
|
||||
array(
|
||||
|
||||
Reference in New Issue
Block a user