mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-04-04 15:13:40 -04:00
Add multi-stock feature
Finished task 1. User can add stock location in config page. Adding format is StockA,StockB,StockC for example 2. Item page, there is no more quantity column show in cert table. The quantity tracking is integrated in inventory detail 3. Receiving page, There is a stock location for user to select before receiving or returning stuff 4. Sale page, There is a stock location which is for user to select a stock location they sell from Remain task 1. Requisition work flow 2. Language editing 3. Remove unuse code PS
This commit is contained in:
@@ -109,7 +109,7 @@ $autoload['language'] = array();
|
||||
|
|
||||
*/
|
||||
|
||||
$autoload['model'] = array('Appconfig','Person','Customer','Employee','Module','Item', 'Item_taxes', 'Sale', 'Sale_suspended', 'Supplier','Inventory','Receiving','Giftcard', 'Item_kit', 'Item_kit_items','Item_unit');
|
||||
$autoload['model'] = array('Appconfig','Person','Customer','Employee','Module','Item', 'Item_taxes', 'Sale', 'Sale_suspended', 'Supplier','Inventory','Receiving','Giftcard', 'Item_kit', 'Item_kit_items','Item_unit','Stock_locations','Item_quantitys');
|
||||
|
||||
|
||||
/* End of file autoload.php */
|
||||
|
||||
@@ -30,6 +30,7 @@ class Config extends Secure_area
|
||||
'return_policy'=>$this->input->post('return_policy'),
|
||||
'language'=>$this->input->post('language'),
|
||||
'timezone'=>$this->input->post('timezone'),
|
||||
'stock_location'=>$this->input->post('stock_location'),
|
||||
'print_after_sale'=>$this->input->post('print_after_sale'),
|
||||
'custom1_name'=>$this->input->post('custom1_name'),/**GARRISON ADDED 4/20/2013**/
|
||||
'custom2_name'=>$this->input->post('custom2_name'),/**GARRISON ADDED 4/20/2013**/
|
||||
@@ -43,7 +44,13 @@ class Config extends Secure_area
|
||||
'custom10_name'=>$this->input->post('custom10_name')/**GARRISON ADDED 4/20/2013**/
|
||||
);
|
||||
|
||||
if( $this->Appconfig->batch_save( $batch_save_data ) )
|
||||
$stock_locations = explode( ',', $this->input->post('stock_location'));
|
||||
$stock_locations_trimmed=array();
|
||||
foreach($stock_locations as $location)
|
||||
{
|
||||
array_push($stock_locations_trimmed, trim($location, ' '));
|
||||
}
|
||||
if( $this->Appconfig->batch_save( $batch_save_data ) && $this->Stock_locations->array_save($stock_locations_trimmed))
|
||||
{
|
||||
echo json_encode(array('success'=>true,'message'=>$this->lang->line('config_saved_successfully')));
|
||||
}
|
||||
|
||||
@@ -24,23 +24,19 @@ class Items extends Secure_area implements iData_controller
|
||||
|
||||
function refresh()
|
||||
{
|
||||
$low_inventory=$this->input->post('low_inventory');
|
||||
$is_serialized=$this->input->post('is_serialized');
|
||||
$no_description=$this->input->post('no_description');
|
||||
$search_custom=$this->input->post('search_custom');//GARRISON ADDED 4/13/2013
|
||||
$is_deleted=$this->input->post('is_deleted'); // Parq 131215
|
||||
$stock_type=$this->input->post('stock_type');
|
||||
$is_deleted=$this->input->post('is_deleted'); // Parq 131215
|
||||
|
||||
$data['search_section_state']=$this->input->post('search_section_state');
|
||||
$data['low_inventory']=$this->input->post('low_inventory');
|
||||
$data['is_serialized']=$this->input->post('is_serialized');
|
||||
$data['no_description']=$this->input->post('no_description');
|
||||
$data['search_custom']=$this->input->post('search_custom');//GARRISON ADDED 4/13/2013
|
||||
$data['is_deleted']=$this->input->post('is_deleted'); // Parq 131215
|
||||
$data['stock_type']=$this->input->post('stock_type');
|
||||
$data['controller_name']=strtolower(get_class());
|
||||
$data['form_width']=$this->get_form_width();
|
||||
$data['manage_table']=get_items_manage_table($this->Item->get_all_filtered($low_inventory,$is_serialized,$no_description,$search_custom,$is_deleted,$stock_type),$this);//GARRISON MODIFIED 4/13/2013, Parq 131215
|
||||
$data['manage_table']=get_items_manage_table($this->Item->get_all_filtered($is_serialized,$no_description,$search_custom,$is_deleted),$this);//GARRISON MODIFIED 4/13/2013, Parq 131215
|
||||
$this->load->view('items/manage',$data);
|
||||
}
|
||||
|
||||
@@ -206,20 +202,48 @@ class Items extends Secure_area implements iData_controller
|
||||
$data['default_tax_2_rate']=($item_id==-1) ? $this->Appconfig->get('default_tax_2_rate') : '';
|
||||
$data['stock_type'] = $data['item_info']->stock_type;
|
||||
|
||||
$locations_data = $this->Stock_locations->get_undeleted_all()->result_array();
|
||||
$location_array;
|
||||
foreach($locations_data as $location)
|
||||
{
|
||||
$location_array['stock_'.$location['location_id']] = array('location_name'=>$location['location_name'],
|
||||
'quantity'=>($item_id == -1)?null:$this->Item_quantitys->get_item_quantity($item_id, $location['location_id'])->quantity);
|
||||
}
|
||||
$data['stock_locations']= $location_array;
|
||||
|
||||
$data['item_unit_info']=$this->Item_unit->get_info($item_id);
|
||||
$this->load->view("items/form",$data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Ramel Inventory Tracking
|
||||
function inventory($item_id=-1)
|
||||
{
|
||||
$data['item_info']=$this->Item->get_info($item_id);
|
||||
|
||||
$data['stock_locations'] = array();
|
||||
$stock_locations = $this->Stock_locations->get_undeleted_all()->result_array();
|
||||
foreach($stock_locations as $location_data)
|
||||
{
|
||||
$data['stock_locations']['stock_'.$location_data['location_id']] = $location_data['location_name'];
|
||||
$data['item_quantitys']['stock_'.$location_data['location_id']] = $this->Item_quantitys->get_item_quantity($item_id,$location_data['location_id'])->quantity;
|
||||
}
|
||||
|
||||
$this->load->view("items/inventory",$data);
|
||||
}
|
||||
|
||||
function count_details($item_id=-1)
|
||||
{
|
||||
$data['item_info']=$this->Item->get_info($item_id);
|
||||
|
||||
$data['stock_locations'] = array();
|
||||
$stock_locations = $this->Stock_locations->get_undeleted_all()->result_array();
|
||||
foreach($stock_locations as $location_data)
|
||||
{
|
||||
$data['stock_locations']['stock_'.$location_data['location_id']] = $location_data['location_name'];
|
||||
$data['item_quantitys']['stock_'.$location_data['location_id']] = $this->Item_quantitys->get_item_quantity($item_id,$location_data['location_id'])->quantity;
|
||||
}
|
||||
|
||||
$this->load->view("items/count_details",$data);
|
||||
} //------------------------------------------- Ramel
|
||||
|
||||
@@ -262,6 +286,7 @@ class Items extends Secure_area implements iData_controller
|
||||
|
||||
function save($item_id=-1)
|
||||
{
|
||||
//Save item data
|
||||
$item_data = array(
|
||||
'name'=>$this->input->post('name'),
|
||||
'description'=>$this->input->post('description'),
|
||||
@@ -270,7 +295,6 @@ class Items extends Secure_area implements iData_controller
|
||||
'item_number'=>$this->input->post('item_number')=='' ? null:$this->input->post('item_number'),
|
||||
'cost_price'=>$this->input->post('cost_price'),
|
||||
'unit_price'=>$this->input->post('unit_price'),
|
||||
'quantity'=>$this->input->post('quantity'),
|
||||
'reorder_level'=>$this->input->post('reorder_level'),
|
||||
'location'=>$this->input->post('location'),
|
||||
'allow_alt_description'=>$this->input->post('allow_alt_description'),
|
||||
@@ -308,15 +332,6 @@ class Items extends Secure_area implements iData_controller
|
||||
$item_data['name'],'item_id'=>$item_id));
|
||||
}
|
||||
|
||||
$inv_data = array
|
||||
(
|
||||
'trans_date'=>date('Y-m-d H:i:s'),
|
||||
'trans_items'=>$item_id,
|
||||
'trans_user'=>$employee_id,
|
||||
'trans_comment'=>$this->lang->line('items_manually_editing_of_quantity'),
|
||||
'trans_inventory'=>$cur_item_info ? $this->input->post('quantity') - $cur_item_info->quantity : $this->input->post('quantity')
|
||||
);
|
||||
$this->Inventory->insert($inv_data);
|
||||
$items_taxes_data = array();
|
||||
$tax_names = $this->input->post('tax_names');
|
||||
$tax_percents = $this->input->post('tax_percents');
|
||||
@@ -328,16 +343,31 @@ class Items extends Secure_area implements iData_controller
|
||||
}
|
||||
}
|
||||
$this->Item_taxes->save($items_taxes_data, $item_id);
|
||||
|
||||
|
||||
$items_unit_data = array(
|
||||
'item_id'=>$item_id,
|
||||
'unit_quantity'=>$this->input->post('unit_quantity'),
|
||||
'related_number'=>$this->input->post('related_number'));
|
||||
if($items_unit_data['related_number'] == null)
|
||||
//Save item quantity
|
||||
$stock_locations = $this->Stock_locations->get_undeleted_all()->result_array();
|
||||
foreach($stock_locations as $location_data)
|
||||
{
|
||||
$items_unit_data['related_number'] = $item_data['item_number'];
|
||||
}
|
||||
$this->Item_unit->save($items_unit_data, $item_id);
|
||||
$updated_quantity = $this->input->post('stock_'.$location_data['location_id'].'_quantity');
|
||||
$location_detail = array('item_id'=>$item_id,
|
||||
'location_id'=>$location_data['location_id'],
|
||||
'quantity'=>$updated_quantity);
|
||||
|
||||
$item_quantity = $this->Item_quantitys->get_item_quantity($item_id, $location_data['location_id']);
|
||||
$this->Item_quantitys->save($location_detail, $item_quantity->item_quantity_id);
|
||||
|
||||
$inv_data = array
|
||||
(
|
||||
'trans_date'=>date('Y-m-d H:i:s'),
|
||||
'trans_items'=>$item_id,
|
||||
'trans_user'=>$employee_id,
|
||||
'location_id'=>$location_data['location_id'],
|
||||
'trans_comment'=>$this->lang->line('items_manually_editing_of_quantity'),
|
||||
'trans_inventory'=>$item_quantity->item_quantity_id ? $updated_quantity - $item_quantity->quantity : $updated_quantity
|
||||
);
|
||||
$this->Inventory->insert($inv_data);
|
||||
}
|
||||
}
|
||||
else//failure
|
||||
{
|
||||
@@ -352,21 +382,27 @@ class Items extends Secure_area implements iData_controller
|
||||
{
|
||||
$employee_id=$this->Employee->get_logged_in_employee_info()->person_id;
|
||||
$cur_item_info = $this->Item->get_info($item_id);
|
||||
$location_id = $this->get_location_id_from_stock_location($this->input->post('stock_location'));
|
||||
$inv_data = array
|
||||
(
|
||||
'trans_date'=>date('Y-m-d H:i:s'),
|
||||
'trans_items'=>$item_id,
|
||||
'trans_user'=>$employee_id,
|
||||
'location_id'=>$location_id,
|
||||
'trans_comment'=>$this->input->post('trans_comment'),
|
||||
'trans_inventory'=>$this->input->post('newquantity')
|
||||
);
|
||||
$this->Inventory->insert($inv_data);
|
||||
|
||||
//Update stock quantity
|
||||
$item_data = array(
|
||||
'quantity'=>$cur_item_info->quantity + $this->input->post('newquantity')
|
||||
|
||||
$item_quantity= $this->Item_quantitys->get_item_quantity($item_id,$location_id);
|
||||
$item_quantity_data = array(
|
||||
'item_id'=>$item_id,
|
||||
'location_id'=>$location_id,
|
||||
'quantity'=>$item_quantity->quantity + $this->input->post('newquantity')
|
||||
);
|
||||
if($this->Item->save($item_data,$item_id))
|
||||
if($this->Item_quantitys->save($item_quantity_data,$item_quantity->item_quantity_id))
|
||||
{
|
||||
echo json_encode(array('success'=>true,'message'=>$this->lang->line('items_successful_updating').' '.
|
||||
$cur_item_info->name,'item_id'=>$item_id));
|
||||
@@ -572,5 +608,10 @@ class Items extends Secure_area implements iData_controller
|
||||
{
|
||||
echo $this->Item->is_sale_store_item_exist($item_number);
|
||||
}
|
||||
|
||||
function get_location_id_from_stock_location($location)
|
||||
{
|
||||
return substr($location, 6);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -15,7 +15,7 @@ class Receivings extends Secure_area
|
||||
|
||||
function item_search()
|
||||
{
|
||||
$suggestions = $this->Item->get_item_search_suggestions($this->input->post('q'),$this->input->post('limit'),'warehouse');
|
||||
$suggestions = $this->Item->get_item_search_suggestions($this->input->post('q'),$this->input->post('limit'));
|
||||
$suggestions = array_merge($suggestions, $this->Item_kit->get_item_kit_search_suggestions($this->input->post('q'),$this->input->post('limit')));
|
||||
echo implode("\n",$suggestions);
|
||||
}
|
||||
@@ -37,6 +37,12 @@ class Receivings extends Secure_area
|
||||
{
|
||||
$mode = $this->input->post("mode");
|
||||
$this->receiving_lib->set_mode($mode);
|
||||
|
||||
$stock_source = $this->input->post("stock_source");
|
||||
$this->receiving_lib->set_stock_source($stock_source);
|
||||
|
||||
$stock_deatination = $this->input->post("stock_deatination");
|
||||
$this->receiving_lib->set_stock_destination($stock_deatination);
|
||||
$this->receiving_lib->empty_cart();
|
||||
$this->_reload();
|
||||
}
|
||||
@@ -143,6 +149,7 @@ class Receivings extends Secure_area
|
||||
$emp_info=$this->Employee->get_info($employee_id);
|
||||
$payment_type = $this->input->post('payment_type');
|
||||
$data['payment_type']=$this->input->post('payment_type');
|
||||
$data['stock_location']=$this->receiving_lib->get_stock_source();
|
||||
|
||||
if ($this->input->post('amount_tendered'))
|
||||
{
|
||||
@@ -158,7 +165,7 @@ class Receivings extends Secure_area
|
||||
}
|
||||
|
||||
//SAVE receiving to database
|
||||
$data['receiving_id']='RECV '.$this->Receiving->save($data['cart'], $supplier_id,$employee_id,$comment,$payment_type);
|
||||
$data['receiving_id']='RECV '.$this->Receiving->save($data['cart'], $supplier_id,$employee_id,$comment,$payment_type,$data['stock_location']);
|
||||
|
||||
if ($data['receiving_id'] == 'RECV -1')
|
||||
{
|
||||
@@ -242,6 +249,17 @@ class Receivings extends Secure_area
|
||||
$data['cart']=$this->receiving_lib->get_cart();
|
||||
$data['modes']=array('receive'=>$this->lang->line('recvs_receiving'),'return'=>$this->lang->line('recvs_return'), 'requisition'=>$this->lang->line('recvs_requisition'));
|
||||
$data['mode']=$this->receiving_lib->get_mode();
|
||||
|
||||
$data['stock_locations'] = array();
|
||||
$stock_locations = $this->Stock_locations->get_undeleted_all()->result_array();
|
||||
foreach($stock_locations as $location_data)
|
||||
{
|
||||
$data['stock_locations']['stock_'.$location_data['location_id']] = $location_data['location_name'];
|
||||
}
|
||||
|
||||
$data['stock_source']=$this->receiving_lib->get_stock_source();
|
||||
$data['stock_destination']=$this->receiving_lib->get_stock_destination();
|
||||
|
||||
$data['total']=$this->receiving_lib->get_total();
|
||||
$data['items_module_allowed'] = $this->Employee->has_permission('items', $person_info->person_id);
|
||||
$data['payment_options']=array(
|
||||
|
||||
@@ -923,7 +923,7 @@ class Reports extends Secure_area
|
||||
$report_data = $model->getData(array());
|
||||
foreach($report_data as $row)
|
||||
{
|
||||
$tabular_data[] = array($row['name'], $row['item_number'], $row['description'], $row['quantity'], $row['reorder_level']);
|
||||
$tabular_data[] = array($row['name'], $row['item_number'], $row['description'], $row['quantity'], $row['reorder_level'], $row['location_name']);
|
||||
}
|
||||
|
||||
$data = array(
|
||||
@@ -946,7 +946,7 @@ class Reports extends Secure_area
|
||||
$report_data = $model->getData(array());
|
||||
foreach($report_data as $row)
|
||||
{
|
||||
$tabular_data[] = array($row['name'], $row['item_number'], $row['description'], $row['quantity'], $row['reorder_level']);
|
||||
$tabular_data[] = array($row['name'], $row['item_number'], $row['description'], $row['quantity'], $row['reorder_level'],$row['location_name']);
|
||||
}
|
||||
|
||||
$data = array(
|
||||
|
||||
@@ -15,16 +15,7 @@ class Sales extends Secure_area
|
||||
|
||||
function item_search()
|
||||
{
|
||||
$stock_type;
|
||||
if($this->sale_lib->get_mode()=='sale_wholesale')
|
||||
{
|
||||
$stock_type = 'warehouse';
|
||||
}
|
||||
else
|
||||
{
|
||||
$stock_type = 'sale_stock';
|
||||
}
|
||||
$suggestions = $this->Item->get_item_search_suggestions($this->input->post('q'),$this->input->post('limit'),$stock_type);
|
||||
$suggestions = $this->Item->get_item_search_suggestions($this->input->post('q'),$this->input->post('limit'));
|
||||
$suggestions = array_merge($suggestions, $this->Item_kit->get_item_kit_search_suggestions($this->input->post('q'),$this->input->post('limit')));
|
||||
echo implode("\n",$suggestions);
|
||||
}
|
||||
@@ -46,7 +37,10 @@ class Sales extends Secure_area
|
||||
{
|
||||
$this->sale_lib->clear_all();
|
||||
$mode = $this->input->post("mode");
|
||||
$this->sale_lib->set_mode($mode);
|
||||
$this->sale_lib->set_mode($mode);
|
||||
|
||||
$stock_location = $this->input->post("stock_location");
|
||||
$this->sale_lib->set_sale_location($stock_location);
|
||||
$this->_reload();
|
||||
}
|
||||
|
||||
@@ -122,7 +116,7 @@ class Sales extends Secure_area
|
||||
$data=array();
|
||||
$mode = $this->sale_lib->get_mode();
|
||||
$item_id_or_number_or_item_kit_or_receipt = $this->input->post("item");
|
||||
$quantity = (($mode=="sale_wholesale") or ($mode=="sale_retail"))? 1:-1;
|
||||
$quantity = ($mode=="return")? -1:1;
|
||||
|
||||
if($this->sale_lib->is_valid_receipt($item_id_or_number_or_item_kit_or_receipt) && $mode=='return')
|
||||
{
|
||||
@@ -203,7 +197,8 @@ class Sales extends Secure_area
|
||||
$data['payments']=$this->sale_lib->get_payments();
|
||||
$data['amount_change']=to_currency($this->sale_lib->get_amount_due() * -1);
|
||||
$data['employee']=$emp_info->first_name.' '.$emp_info->last_name;
|
||||
|
||||
$data['stock_location']=$this->sale_lib->get_sale_location();
|
||||
|
||||
if($customer_id!=-1)
|
||||
{
|
||||
$cust_info=$this->Customer->get_info($customer_id);
|
||||
@@ -211,7 +206,7 @@ class Sales extends Secure_area
|
||||
}
|
||||
|
||||
//SAVE sale to database
|
||||
$data['sale_id']='POS '.$this->Sale->save($data['cart'], $customer_id,$employee_id,$comment,$data['payments']);
|
||||
$data['sale_id']='POS '.$this->Sale->save($data['cart'], $customer_id,$employee_id,$comment,$data['payments'], $data['stock_location']);
|
||||
if ($data['sale_id'] == 'POS -1')
|
||||
{
|
||||
$data['error_message'] = $this->lang->line('sales_transaction_failed');
|
||||
@@ -351,8 +346,19 @@ class Sales extends Secure_area
|
||||
function _reload($data=array())
|
||||
{
|
||||
$person_info = $this->Employee->get_logged_in_employee_info();
|
||||
$data['cart']=$this->sale_lib->get_cart();
|
||||
$data['modes']=array('sale_retail'=>$this->lang->line('sales_sale_retail'),'sale_wholesale'=>$this->lang->line('sales_wholesale'),'return'=>$this->lang->line('sales_return'));
|
||||
$data['cart']=$this->sale_lib->get_cart();
|
||||
$data['modes']['return']=$this->lang->line('sales_return');
|
||||
$data['mode']=$this->sale_lib->get_mode();
|
||||
|
||||
$data['stock_locations'] = array();
|
||||
$stock_locations = $this->Stock_locations->get_undeleted_all()->result_array();
|
||||
foreach($stock_locations as $location_data)
|
||||
{
|
||||
$data['stock_locations']['stock_'.$location_data['location_id']] = $location_data['location_name'];
|
||||
}
|
||||
$data['stock_location']=$this->sale_lib->get_sale_location();
|
||||
|
||||
$data['modes']=array('sale'=>$this->lang->line('sales_sale'),'return'=>$this->lang->line('sales_return'));
|
||||
$data['mode']=$this->sale_lib->get_mode();
|
||||
$data['subtotal']=$this->sale_lib->get_subtotal();
|
||||
$data['taxes']=$this->sale_lib->get_taxes();
|
||||
|
||||
@@ -32,4 +32,7 @@ $lang['config_custom7'] = 'Custom Field 7'; //GARRISON ADDED 4/21/2013
|
||||
$lang['config_custom8'] = 'Custom Field 8'; //GARRISON ADDED 4/21/2013
|
||||
$lang['config_custom9'] = 'Custom Field 9'; //GARRISON ADDED 4/21/2013
|
||||
$lang['config_custom10'] = 'Custom Field 10'; //GARRISON ADDED 4/21/2013
|
||||
|
||||
$lang['config_stock_location'] = 'Stock location';
|
||||
$lang['config_stock_location_required'] = 'Stock location number is a required field';
|
||||
?>
|
||||
@@ -58,7 +58,6 @@ $lang['items_must_select_item_for_barcode'] = 'You must select at least 1 item t
|
||||
$lang['items_excel_import_failed'] = 'Excel import failed';
|
||||
$lang['items_allow_alt_description'] = 'Allow Alt Description';
|
||||
$lang['items_is_serialized'] = 'Item has Serial Number';
|
||||
$lang['items_low_inventory_items'] = 'Low Inventory Items';
|
||||
$lang['items_serialized_items'] = 'Serialized Items';
|
||||
$lang['items_no_description_items'] = 'No Description Items';
|
||||
$lang['items_search_custom_items'] = 'Search Custom Fields';//GARRISON ADDED
|
||||
@@ -80,7 +79,8 @@ $lang['items_location'] = 'Location';
|
||||
$lang['items_is_deleted'] = 'Deleted';// Parq 131215
|
||||
$lang['items_stock_type_sale'] = 'Sale stock';
|
||||
$lang['items_stock_type_warehouse'] = 'Warehouse stock';
|
||||
$lang['items_stock_type'] = 'Stock type';
|
||||
$lang['items_unit_quantity'] = 'Unit quantity';
|
||||
$lang['items_related_number'] = 'Related item number';
|
||||
|
||||
$lang['items_stock_location']='Stock location';
|
||||
?>
|
||||
|
||||
@@ -32,4 +32,8 @@ $lang['reqs_related_item_quantity']='Related item qty.';
|
||||
$lang['reqs_receipt']='Requisition Receipt';
|
||||
$lang['reqs_transaction_failed'] = 'Requisition Transactions Failed';
|
||||
$lang['reqs_unable_to_add_item']='Unable to add item to requisition';
|
||||
|
||||
$lang['recvs_stock_source']='Stock source';
|
||||
$lang['recvs_stock_destination']='Stock destination';
|
||||
$lang['recvs_stock_locaiton']='Stock location';
|
||||
?>
|
||||
|
||||
@@ -88,8 +88,7 @@ $lang['reports_receiving_type'] = 'Receiving Type';
|
||||
$lang['reports_all'] = 'All';
|
||||
$lang['reports_returns'] = 'Returns';
|
||||
$lang['reports_discount'] = 'Discounts';
|
||||
$lang['reports_sales_retail'] = 'Sales retail';
|
||||
$lang['reports_sales_wholesale'] = 'Sales wholesale';
|
||||
$lang['reports_sales'] = 'Sales';
|
||||
$lang['reports_requisition'] = 'Requisition';
|
||||
$lang['reports_receiving_id'] = 'Receiving ID';
|
||||
$lang['reports_requisition_id'] = 'Requisition ID';
|
||||
@@ -100,4 +99,6 @@ $lang['reports_requisition_related_item'] = 'Related item';
|
||||
$lang['reports_requisition_related_item_unit_quantity'] = 'Unit qty.';
|
||||
$lang['reports_requisition_related_item_total_quantity'] = 'Total qty.';
|
||||
$lang['reports_detailed_requisition_report'] = 'Detailed Requisitions Report';
|
||||
|
||||
$lang['reports_stock_location'] = 'Stock location';
|
||||
?>
|
||||
|
||||
@@ -34,8 +34,6 @@ $lang['sales_cancel_sale']='Cancel Sale';
|
||||
$lang['sales_add_payment']='Add Payment';
|
||||
$lang['sales_receipt']='Sales Receipt';
|
||||
$lang['sales_id']='Sale ID';
|
||||
$lang['sales_sale_retail']='Sale retail';
|
||||
$lang['sales_wholesale']='Sale wholesale';
|
||||
$lang['sales_return']='Return';
|
||||
$lang['sales_confirm_finish_sale'] = 'Are you sure you want to submit this sale? This cannot be undone.';
|
||||
$lang['sales_confirm_cancel_sale'] = 'Are you sure you want to clear this sale? All items will cleared.';
|
||||
@@ -85,4 +83,7 @@ $lang['sales_amount_due'] = 'Amount Due';
|
||||
$lang['sales_payment_type'] = "Type";
|
||||
$lang['sales_payment_amount'] = "Amount";
|
||||
$lang['sales_basic_information']='Sale information';
|
||||
|
||||
$lang['sales_stock_location']='Stock location';
|
||||
$lang['sales_sale']='Sale';
|
||||
?>
|
||||
|
||||
@@ -79,92 +79,7 @@ $lang['items_inventory'] = 'สินค้าคงเหลือ';
|
||||
$lang['items_location'] = 'ที่ตั้ง';
|
||||
$lang['items_unit_quantity'] = 'จำนวนหน่วย';
|
||||
$lang['items_related_number'] = 'สินค้าที่เกี่ยวข้อง';
|
||||
$lang['items_stock_type_sale'] = 'สินค้าหน้าร้าน';
|
||||
$lang['items_stock_type_warehouse'] = 'สินค้าหลังร้าน';
|
||||
$lang['items_stock_type'] = 'ชนิดของสินค้า';
|
||||
?>
|
||||
<?php
|
||||
$lang['items_item_number']='โค๊ด';
|
||||
$lang['items_retrive_item_info']='รับข้อมูลสินค้า';
|
||||
$lang['items_description']='รายละเอียด';
|
||||
$lang['items_amazon']='Amazon';
|
||||
$lang['items_upc_database']='UPC ฐานข้อมูล';
|
||||
$lang['items_cannot_find_item']='ไม่พบข้อมูลของสินค้า';
|
||||
$lang['items_info_provided_by']='จัดเตรียมข้อมูลโดย';
|
||||
$lang['items_basic_information']='ข้อมูลสินค้ส';
|
||||
$lang['items_number_information']='หมายเลขสินค้า';
|
||||
$lang['items_new']='สินค้าใหม่';
|
||||
$lang['items_update']='ปรับแต่งสินค้า';
|
||||
$lang['items_item']='สินค้า';
|
||||
$lang['items_edit_multiple_items']='แก้ใขสินค้าต่างๆ';
|
||||
$lang['items_name']='ชื่อสินค้า';
|
||||
$lang['items_category']='หมวดหมู่';
|
||||
$lang['items_cost_price']='ราคาทุน';//GARRISON ADDED 4/21/2013
|
||||
$lang['items_unit_price']='ราคาขาย';//GARRISON ADDED 4/21/2013
|
||||
$lang['items_tax_1']='ภาษี 1';
|
||||
$lang['items_tax_2']='ภาษี 2';
|
||||
$lang['items_sales_tax_1'] = 'ถาษีขาย';
|
||||
$lang['items_sales_tax_2'] = 'ภาษีขาย 2';
|
||||
$lang['items_tax_percent']='ภาษี(%)';
|
||||
$lang['items_tax_percents']='ภาษี(%)';
|
||||
$lang['items_reorder_level']='ระดับการสั่งใหม่';
|
||||
$lang['items_quantity']='จำนวน';
|
||||
$lang['items_reorder_level']='ระดับการสั่งใหม่';
|
||||
$lang['items_no_items_to_display']='ไม่มีสินค้าแสดง';
|
||||
$lang['items_bulk_edit']='แก้ไขความจุ';
|
||||
$lang['items_confirm_delete']='แน่ใจหรือไม่ที่จะลบสินค้าที่ถูกเลือก?';
|
||||
$lang['items_none_selected']='กรุณาเลือสินค้าที่ต้องการแก้ไข';
|
||||
$lang['items_confirm_bulk_edit']='แน่ใจหรือไม่ที่จะแก้ใขสินค้าทั้งหมดที่คุณเลือก?';
|
||||
$lang['items_successful_bulk_edit']='ปรับแต่งสินค้าสำเร็จ';
|
||||
$lang['items_error_updating_multiple']='ปรับแต่งสินค้าล้มเหลว';
|
||||
$lang['items_edit_fields_you_want_to_update']='แก้ไขสินค้าทุกชนิดที่คุณเลือก';
|
||||
$lang['items_error_adding_updating'] = 'เพิ่ม/ปรับแต่ง สินค้าล้มเหลว';
|
||||
$lang['items_successful_adding']='เพิ่มสินค้าสำเร็จ';
|
||||
$lang['items_successful_updating']='ปรับแต่งสินค้าสำเร็จ';
|
||||
$lang['items_successful_deleted']='ลบสินค้าสำเร็จ';
|
||||
$lang['items_one_or_multiple']='สินค้า(s)';
|
||||
$lang['items_cannot_be_deleted']='ไมม่สามารถลบสินค้าที่เลือก, สินค้าที่เลือกถูกขายไปแล้ว.';
|
||||
$lang['items_name_required']='ชื่อสินค้าต้องกรอก';
|
||||
$lang['items_category_required']='หมวดหมู่สินค้าต้องกรอก';
|
||||
$lang['items_buy_price_required']='ราคาซื้อขายต้องกรอก'; //GARRISON UPDATED 6/3/2013
|
||||
$lang['items_unit_price_required']='ราคาต่อหน่วยต้องกรอก'; //GARRISON UPDATED 6/3/2013
|
||||
$lang['items_cost_price_required']='ราคาทุนต้องกรอก'; //GARRISON UPDATED 6/3/2013
|
||||
$lang['items_tax_percent_required']='เปอร์เซ็นต์ต้องกรอก';
|
||||
$lang['items_quantity_required']='จำนวนต้องกรอก';
|
||||
$lang['items_reorder_level_required']='ระดับการสั่งไหม่ต้องกรอก';
|
||||
$lang['items_unit_price_number']='ราคาต่อหน่วยต้องเป็นตัวเลข';
|
||||
$lang['items_cost_price_number']='ราคาทุนต้องเป็นตัวเลข';
|
||||
$lang['items_quantity_number']='จำนวนต้องเป็นตัวเลข';
|
||||
$lang['items_reorder_level_number']='ระดับการสั่งใหม่ต้องเป็นตัวเลข';
|
||||
$lang['items_none'] = 'ว่างเปล่า';
|
||||
$lang['items_supplier'] = 'ผู้ผลิต';
|
||||
$lang['items_generate_barcodes'] = 'สร้างบาร์โค๊ด';
|
||||
$lang['items_must_select_item_for_barcode'] = 'คุต้องเลือกสินค้าอย่างน้อยหนึ่งอย่างเพื่อจะสร้างบาร์โค๊ด';
|
||||
$lang['items_excel_import_failed'] = 'นำเข้าข้อมูล Excel ล้มเหลว';
|
||||
$lang['items_allow_alt_desciption'] = 'Allow Alt Description';
|
||||
$lang['items_is_serialized'] = 'สินค้ามีซีเรียวนัมเบอร์';
|
||||
$lang['items_low_inventory_items'] = 'สินค้าคงเหลือน้อย';
|
||||
$lang['items_serialized_items'] = 'รหัสสินค้า';
|
||||
$lang['items_no_description_items'] = 'สินค้าที่ไม่มีคำอธิบายหรือวิธีการใช้';
|
||||
$lang['items_search_custom_items'] = 'Search Custom Fields';//GARRISON ADDED
|
||||
$lang['items_inventory_comments']='คำอธิบาย';
|
||||
$lang['items_count']='แก้ไขจำนวนสินค้าคงคลัง';
|
||||
$lang['items_details_count']='รายละเอียดจำนวนสินค้าคงคลัง';
|
||||
$lang['items_add_minus']='เพิ่ม/ลบ จำนวนสินค้าคงคลัง';
|
||||
$lang['items_current_quantity']='ปริมาณสินค้าคงคลัง';
|
||||
$lang['items_quantity_required']='จำนวนต้องกรอก. กรุณาปิดเพื่อยกเลิก';
|
||||
$lang['items_do_nothing'] = 'ไม่ต้องทำอะไร';
|
||||
$lang['items_change_all_to_serialized'] = 'เปลี่ยนแปลงรหัสสินค้าทั้งหมด';
|
||||
$lang['items_change_all_to_unserialized'] = 'ลบรหัสสินค้าทั้งหมด';
|
||||
$lang['items_change_all_to_allow_alt_desc'] = ' Allow Alt Desc For All';
|
||||
$lang['items_change_all_to_not_allow_allow_desc'] = 'Not Allow Alt Desc For All';
|
||||
$lang['items_use_inventory_menu'] = 'ใช้สินค้าคงเหลือเมนู';
|
||||
$lang['items_manually_editing_of_quantity'] = 'แก้ไขจำนวน';
|
||||
$lang['items_inventory'] = 'สินค้าคงเหลือ';
|
||||
$lang['items_location'] = 'ที่ตั้ง';
|
||||
$lang['items_unit_quantity'] = 'จำนวนหน่วย';
|
||||
$lang['items_related_number'] = 'สินค้าที่เกี่ยวข้อง';
|
||||
$lang['items_stock_type_sale'] = 'สินค้าหน้าร้าน';
|
||||
|
||||
$lang['items_stock_type_warehouse'] = 'สินค้าหลังร้าน';
|
||||
$lang['items_stock_type'] = 'ชนิดของสินค้า';
|
||||
?>
|
||||
|
||||
@@ -43,8 +43,6 @@ $lang['reports_comments'] = 'หมายเหตุ';
|
||||
$lang['reports_discount'] = 'ส่วนลด';
|
||||
$lang['reports_payment_type'] = 'ชนิดของการจ่าย';
|
||||
$lang['reports_sales'] = 'ขาย';
|
||||
$lang['reports_sales_retail'] = 'ขายปลีก';
|
||||
$lang['reports_sales_wholesale'] = 'ขายส่ง';
|
||||
$lang['reports_categories'] = 'หมวดหมู่';
|
||||
$lang['reports_customers'] = 'ลูกค้า';
|
||||
$lang['reports_suppliers'] = 'ผู้ผลิต';
|
||||
@@ -145,8 +143,6 @@ $lang['reports_comments'] = 'หมายเหตุ';
|
||||
$lang['reports_discount'] = 'ส่วนลด';
|
||||
$lang['reports_payment_type'] = 'ชนิดของการจ่าย';
|
||||
$lang['reports_sales'] = 'ขาย';
|
||||
$lang['reports_sales_retail'] = 'ขายปลีก';
|
||||
$lang['reports_sales_wholesale'] = 'ขายส่ง';
|
||||
$lang['reports_categories'] = 'หมวดหมู่';
|
||||
$lang['reports_customers'] = 'ลูกค้า';
|
||||
$lang['reports_suppliers'] = 'ผู้ผลิต';
|
||||
|
||||
@@ -34,8 +34,6 @@ $lang['sales_cancel_sale']='ยกเลิกการขาย';
|
||||
$lang['sales_add_payment']='เพิ่มบิล';
|
||||
$lang['sales_receipt']='บิลขาย';
|
||||
$lang['sales_id']='เลขที่ขาย';
|
||||
$lang['sales_sale_retail']='ขายปลีก';
|
||||
$lang['sales_wholesale']='ขายส่ง';
|
||||
$lang['sales_return']='คืน';
|
||||
$lang['sales_confirm_finish_sale'] = 'แน่ใจหรือไม่ที่จะสำเร็จการขาย? ไม่สามารถย้อนกลับได้.';
|
||||
$lang['sales_confirm_cancel_sale'] = 'แน่ใจหรือไม่ที่จะล้างรายการขาย? สินค้าทุกอย่างจะถูกลบจากบอร์ด.';
|
||||
@@ -114,8 +112,6 @@ $lang['sales_cancel_sale']='ยกเลิกการขาย';
|
||||
$lang['sales_add_payment']='เพิ่มบิล';
|
||||
$lang['sales_receipt']='บิลขาย';
|
||||
$lang['sales_id']='เลขที่ขาย';
|
||||
$lang['sales_sale_retail']='ขายปลีก';
|
||||
$lang['sales_wholesale']='ขายส่ง';
|
||||
$lang['sales_return']='คืน';
|
||||
$lang['sales_confirm_finish_sale'] = 'แน่ใจหรือไม่ที่จะสำเร็จการขาย? ไม่สามารถย้อนกลับได้.';
|
||||
$lang['sales_confirm_cancel_sale'] = 'แน่ใจหรือไม่ที่จะล้างรายการขาย? สินค้าทุกอย่างจะถูกลบจากบอร์ด.';
|
||||
|
||||
@@ -46,7 +46,44 @@ class Receiving_lib
|
||||
{
|
||||
$this->CI->session->set_userdata('recv_mode',$mode);
|
||||
}
|
||||
|
||||
function get_stock_source()
|
||||
{
|
||||
if(!$this->CI->session->userdata('recv_stock_source'))
|
||||
{
|
||||
$stock_locations = $this->CI->Stock_locations->get_undeleted_all()->result_array();
|
||||
$location_name = 'stock_'.$stock_locations[0]['location_id'];
|
||||
$this->set_stock_source($location_name);
|
||||
}
|
||||
return $this->CI->session->userdata('recv_stock_source');
|
||||
}
|
||||
|
||||
function set_stock_source($stock_source)
|
||||
{
|
||||
$this->CI->session->set_userdata('recv_stock_source',$stock_source);
|
||||
}
|
||||
|
||||
function get_stock_destination()
|
||||
{
|
||||
if(!$this->CI->session->userdata('recv_stock_destination'))
|
||||
{
|
||||
$stock_locations = $this->CI->Stock_locations->get_undeleted_all()->result_array();
|
||||
$location_name = 'stock_'.$stock_locations[0]['location_id'];
|
||||
$this->set_stock_destination($location_name);
|
||||
}
|
||||
return $this->CI->session->userdata('recv_stock_destination');
|
||||
}
|
||||
|
||||
function set_stock_destination($stock_destination)
|
||||
{
|
||||
$this->CI->session->set_userdata('recv_stock_destination',$stock_destination);
|
||||
}
|
||||
|
||||
function get_location_id_from_stock_location($location)
|
||||
{
|
||||
return substr($location, 6);
|
||||
}
|
||||
|
||||
function add_item($item_id,$quantity=1,$discount=0,$price=null,$description=null,$serialnumber=null)
|
||||
{
|
||||
//make sure item exists in database.
|
||||
|
||||
@@ -157,7 +157,7 @@ class Sale_lib
|
||||
function get_mode()
|
||||
{
|
||||
if(!$this->CI->session->userdata('sale_mode'))
|
||||
$this->set_mode('sale_retail');
|
||||
$this->set_mode('sale');
|
||||
|
||||
return $this->CI->session->userdata('sale_mode');
|
||||
}
|
||||
@@ -167,6 +167,22 @@ class Sale_lib
|
||||
$this->CI->session->set_userdata('sale_mode',$mode);
|
||||
}
|
||||
|
||||
function get_sale_location()
|
||||
{
|
||||
if(!$this->CI->session->userdata('sale_location'))
|
||||
{
|
||||
$stock_locations = $this->CI->Stock_locations->get_undeleted_all()->result_array();
|
||||
$location_name = 'stock_'.$stock_locations[0]['location_id'];
|
||||
$this->set_sale_location($location_name);
|
||||
}
|
||||
return $this->CI->session->userdata('sale_location');
|
||||
}
|
||||
|
||||
function set_sale_location($location)
|
||||
{
|
||||
$this->CI->session->set_userdata('sale_location',$location);
|
||||
}
|
||||
|
||||
function add_item($item_id,$quantity=1,$discount=0,$price=null,$description=null,$serialnumber=null)
|
||||
{
|
||||
//make sure item exists
|
||||
@@ -242,6 +258,11 @@ class Sale_lib
|
||||
|
||||
}
|
||||
|
||||
function get_location_id_from_stock_location($location)
|
||||
{
|
||||
return substr($location, 6);
|
||||
}
|
||||
|
||||
function out_of_stock($item_id)
|
||||
{
|
||||
//make sure item exists
|
||||
@@ -251,10 +272,12 @@ class Sale_lib
|
||||
}
|
||||
|
||||
|
||||
$item = $this->CI->Item->get_info($item_id);
|
||||
//$item = $this->CI->Item->get_info($item_id);
|
||||
$location_id = $this->get_location_id_from_stock_location($this->get_sale_location());
|
||||
$item_quantity = $this->CI->Item_quantitys->get_item_quantity($item_id, $location_id)->quantity;
|
||||
$quanity_added = $this->get_quantity_already_added($item_id);
|
||||
|
||||
if ($item->quantity - $quanity_added < 0)
|
||||
if ($item_quantity - $quanity_added < 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
37
application/models/Item_quantitys.php
Normal file
37
application/models/Item_quantitys.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
class Item_quantitys extends CI_Model
|
||||
{
|
||||
function exists($item_quantity_id)
|
||||
{
|
||||
$this->db->from('item_quantitys');
|
||||
$this->db->where('item_quantity_id',$item_quantity_id);
|
||||
$query = $this->db->get();
|
||||
|
||||
return ($query->num_rows()==1);
|
||||
}
|
||||
|
||||
function save($location_detail, $item_quantity_id=false)
|
||||
{
|
||||
if (!$item_quantity_id or !$this->exists($item_quantity_id))
|
||||
{
|
||||
if($this->db->insert('item_quantitys',$location_detail))
|
||||
{
|
||||
$location_detail['item_quantity_id']=$this->db->insert_id();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->db->where('item_quantity_id', $item_quantity_id);
|
||||
return $this->db->update('item_quantitys',$location_detail);
|
||||
}
|
||||
|
||||
function get_item_quantity($item_id, $location_id)
|
||||
{
|
||||
$this->db->from('item_quantitys');
|
||||
$this->db->where('item_id',$item_id);
|
||||
$this->db->where('location_id',$location_id);
|
||||
return $this->db->get()->row();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -6,10 +6,14 @@ class Inventory extends CI_Model
|
||||
return $this->db->insert('inventory',$inventory_data);
|
||||
}
|
||||
|
||||
function get_inventory_data_for_item($item_id)
|
||||
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('location_id',$location_id);
|
||||
}
|
||||
$this->db->order_by("trans_date", "desc");
|
||||
return $this->db->get();
|
||||
}
|
||||
|
||||
@@ -33,13 +33,9 @@ class Item extends CI_Model
|
||||
return $this->db->count_all_results();
|
||||
}
|
||||
|
||||
function get_all_filtered($low_inventory=0,$is_serialized=0,$no_description,$search_custom,$is_deleted,$stock_type)/**GARRISON MODIFIED 4/21/2013, Parq 131215 **/
|
||||
function get_all_filtered($is_serialized=0,$no_description,$search_custom,$is_deleted)/**GARRISON MODIFIED 4/21/2013, Parq 131215 **/
|
||||
{
|
||||
$this->db->from('items');
|
||||
if ($low_inventory !=0 )
|
||||
{
|
||||
$this->db->where('quantity <=','reorder_level', false);
|
||||
}
|
||||
if ($is_serialized !=0 )
|
||||
{
|
||||
$this->db->where('is_serialized',1);
|
||||
@@ -47,12 +43,7 @@ class Item extends CI_Model
|
||||
if ($no_description!=0 )
|
||||
{
|
||||
$this->db->where('description','');
|
||||
}
|
||||
|
||||
if($stock_type!='all')
|
||||
{
|
||||
$this->db->where('stock_type',$stock_type);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**GARRISON SECTION ADDED 4/21/2013**/
|
||||
@@ -273,13 +264,12 @@ class Item extends CI_Model
|
||||
|
||||
}
|
||||
|
||||
function get_item_search_suggestions($search,$limit=25,$stock_type='warehouse')
|
||||
function get_item_search_suggestions($search,$limit=25)
|
||||
{
|
||||
$suggestions = array();
|
||||
|
||||
$this->db->from('items');
|
||||
$this->db->where('deleted',0);
|
||||
$this->db->where('stock_type',$stock_type);
|
||||
$this->db->like('name', $search);
|
||||
$this->db->order_by("name", "asc");
|
||||
$by_name = $this->db->get();
|
||||
@@ -290,7 +280,6 @@ class Item extends CI_Model
|
||||
|
||||
$this->db->from('items');
|
||||
$this->db->where('deleted',0);
|
||||
$this->db->where('stock_type',$stock_type);
|
||||
$this->db->like('item_number', $search);
|
||||
$this->db->order_by("item_number", "asc");
|
||||
$by_item_number = $this->db->get();
|
||||
@@ -302,7 +291,6 @@ class Item extends CI_Model
|
||||
//Search by description
|
||||
$this->db->from('items');
|
||||
$this->db->where('deleted',0);
|
||||
$this->db->where('stock_type',$stock_type);
|
||||
$this->db->like('description', $search);
|
||||
$this->db->order_by("description", "asc");
|
||||
$by_description = $this->db->get();
|
||||
|
||||
@@ -24,7 +24,7 @@ class Receiving extends CI_Model
|
||||
return ($query->num_rows()==1);
|
||||
}
|
||||
|
||||
function save ($items,$supplier_id,$employee_id,$comment,$payment_type,$receiving_id=false)
|
||||
function save ($items,$supplier_id,$employee_id,$comment,$payment_type,$stock_location,$receiving_id=false)
|
||||
{
|
||||
if(count($items)==0)
|
||||
return -1;
|
||||
@@ -63,8 +63,11 @@ class Receiving extends CI_Model
|
||||
$this->db->insert('receivings_items',$receivings_items_data);
|
||||
|
||||
//Update stock quantity
|
||||
$item_data = array('quantity'=>$cur_item_info->quantity + $item['quantity']);
|
||||
$this->Item->save($item_data,$item['item_id']);
|
||||
$item_quantity = $this->Item_quantitys->get_item_quantity($item['item_id'], $this->receiving_lib->get_location_id_from_stock_location($stock_location));
|
||||
$this->Item_quantitys->save(array('quantity'=>$item_quantity->quantity + $item['quantity'],
|
||||
'item_id'=>$item['item_id'],
|
||||
'location_id'=>$this->receiving_lib->get_location_id_from_stock_location($stock_location)), $item_quantity->item_quantity_id);
|
||||
|
||||
|
||||
$qty_recv = $item['quantity'];
|
||||
$recv_remarks ='RECV '.$receiving_id;
|
||||
@@ -73,6 +76,7 @@ class Receiving extends CI_Model
|
||||
'trans_date'=>date('Y-m-d H:i:s'),
|
||||
'trans_items'=>$item['item_id'],
|
||||
'trans_user'=>$employee_id,
|
||||
'location_id'=>$this->receiving_lib->get_location_id_from_stock_location($stock_location),
|
||||
'trans_comment'=>$recv_remarks,
|
||||
'trans_inventory'=>$qty_recv
|
||||
);
|
||||
|
||||
@@ -39,16 +39,11 @@ class Detailed_sales extends Report
|
||||
$this->db->join('people as employee', 'sales_items_temp.employee_id = employee.person_id');
|
||||
$this->db->join('people as customer', 'sales_items_temp.customer_id = customer.person_id', 'left');
|
||||
$this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'"');
|
||||
if ($inputs['sale_type'] == 'sales_retail')
|
||||
if ($inputs['sale_type'] == 'sales')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type', 'sale_stock');
|
||||
}
|
||||
elseif($inputs['sale_type'] == 'sales_wholesale')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type', 'warehouse');
|
||||
}
|
||||
elseif ($inputs['sale_type'] == 'returns')
|
||||
{
|
||||
$this->db->where('quantity_purchased < 0');
|
||||
@@ -77,15 +72,9 @@ class Detailed_sales extends Report
|
||||
$this->db->select('sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax, sum(profit) as profit');
|
||||
$this->db->from('sales_items_temp');
|
||||
$this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'"');
|
||||
if ($inputs['sale_type'] == 'sales_retail')
|
||||
if ($inputs['sale_type'] == 'sales')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type', 'sale_stock');
|
||||
}
|
||||
elseif($inputs['sale_type'] == 'sales_wholesale')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type', 'warehouse');
|
||||
}
|
||||
elseif ($inputs['sale_type'] == 'returns')
|
||||
{
|
||||
|
||||
@@ -9,19 +9,25 @@ class Inventory_low extends Report
|
||||
|
||||
public function getDataColumns()
|
||||
{
|
||||
return array($this->lang->line('reports_item_name'), $this->lang->line('reports_item_number'), $this->lang->line('reports_description'), $this->lang->line('reports_count'), $this->lang->line('reports_reorder_level'));
|
||||
return array($this->lang->line('reports_item_name'), $this->lang->line('reports_item_number'), $this->lang->line('reports_description'), $this->lang->line('reports_count'), $this->lang->line('reports_reorder_level'), $this->lang->line('reports_stock_location'));
|
||||
}
|
||||
|
||||
public function getData(array $inputs)
|
||||
{
|
||||
$this->db->select('name, item_number, quantity, reorder_level, description');
|
||||
$this->db->from('items');
|
||||
$this->db->where('quantity <= reorder_level and deleted=0');
|
||||
$this->db->order_by('name');
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
public function getData(array $inputs)
|
||||
{
|
||||
$this->db->from('items');
|
||||
$this->db->join('item_quantitys','items.item_id=item_quantitys.item_id');
|
||||
$this->db->join('stock_locations','item_quantitys.location_id=stock_locations.location_id');
|
||||
|
||||
$this->db->select('name, item_number, reorder_level, item_quantitys.quantity,description,location_name');
|
||||
|
||||
}
|
||||
$this->db->where('item_quantitys.quantity <= reorder_level');
|
||||
$this->db->where('items.deleted = 0');
|
||||
|
||||
$this->db->order_by('name');
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
|
||||
}
|
||||
|
||||
public function getSummaryData(array $inputs)
|
||||
{
|
||||
|
||||
@@ -9,15 +9,18 @@ class Inventory_summary extends Report
|
||||
|
||||
public function getDataColumns()
|
||||
{
|
||||
return array($this->lang->line('reports_item_name'), $this->lang->line('reports_item_number'), $this->lang->line('reports_description'), $this->lang->line('reports_count'), $this->lang->line('reports_reorder_level'));
|
||||
return array($this->lang->line('reports_item_name'), $this->lang->line('reports_item_number'), $this->lang->line('reports_description'), $this->lang->line('reports_count'), $this->lang->line('reports_reorder_level'),$this->lang->line('reports_stock_location'));
|
||||
}
|
||||
|
||||
public function getData(array $inputs)
|
||||
{
|
||||
$this->db->select('name, item_number, quantity, reorder_level, description');
|
||||
$this->db->from('items');
|
||||
$this->db->where('deleted', 0);
|
||||
$this->db->order_by('name');
|
||||
$this->db->from('items');
|
||||
$this->db->join('item_quantitys','items.item_id=item_quantitys.item_id');
|
||||
$this->db->join('stock_locations','item_quantitys.location_id=stock_locations.location_id');
|
||||
|
||||
$this->db->select('name, item_number, reorder_level, item_quantitys.quantity, description,location_name');
|
||||
$this->db->where('items.deleted', 0);
|
||||
$this->db->order_by('items.name');
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
|
||||
|
||||
@@ -20,15 +20,9 @@ class Specific_customer extends Report
|
||||
$this->db->from('sales_items_temp');
|
||||
$this->db->join('people', 'sales_items_temp.employee_id = people.person_id');
|
||||
$this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'" and customer_id='.$inputs['customer_id']);
|
||||
if ($inputs['sale_type'] == 'sales_retail')
|
||||
if ($inputs['sale_type'] == 'sales')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type', 'sale_stock');
|
||||
}
|
||||
elseif($inputs['sale_type'] == 'sales_wholesale')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type', 'warehouse');
|
||||
}
|
||||
elseif ($inputs['sale_type'] == 'returns')
|
||||
{
|
||||
@@ -58,20 +52,14 @@ class Specific_customer extends Report
|
||||
$this->db->select('sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax, sum(profit) as profit');
|
||||
$this->db->from('sales_items_temp');
|
||||
$this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'" and customer_id='.$inputs['customer_id']);
|
||||
if ($inputs['sale_type'] == 'sales_retail')
|
||||
if ($inputs['sale_type'] == 'sales')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type', 'sale_stock');
|
||||
}
|
||||
elseif($inputs['sale_type'] == 'sales_wholesale')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type', 'warehouse');
|
||||
}
|
||||
elseif ($inputs['sale_type'] == 'returns')
|
||||
{
|
||||
$this->db->where('quantity_purchased < 0');
|
||||
}
|
||||
}
|
||||
return $this->db->get()->row_array();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,20 +21,14 @@ class Specific_employee extends Report
|
||||
$this->db->join('people', 'sales_items_temp.customer_id = people.person_id', 'left');
|
||||
$this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'" and employee_id='.$inputs['employee_id']);
|
||||
|
||||
if ($inputs['sale_type'] == 'sales_retail')
|
||||
if ($inputs['sale_type'] == 'sales')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type', 'sale_stock');
|
||||
}
|
||||
elseif($inputs['sale_type'] == 'sales_wholesale')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type', 'warehouse');
|
||||
}
|
||||
elseif ($inputs['sale_type'] == 'returns')
|
||||
{
|
||||
$this->db->where('quantity_purchased < 0');
|
||||
}
|
||||
}
|
||||
|
||||
$this->db->group_by('sale_id');
|
||||
$this->db->order_by('sale_date');
|
||||
@@ -60,20 +54,14 @@ class Specific_employee extends Report
|
||||
$this->db->select('sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax, sum(profit) as profit');
|
||||
$this->db->from('sales_items_temp');
|
||||
$this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'" and employee_id='.$inputs['employee_id']);
|
||||
if ($inputs['sale_type'] == 'sales_retail')
|
||||
if ($inputs['sale_type'] == 'sales')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type = \'sale_stock\'');
|
||||
}
|
||||
elseif($inputs['sale_type'] == 'sales_wholesale')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type = \'warehouse\'');
|
||||
}
|
||||
elseif ($inputs['sale_type'] == 'returns')
|
||||
{
|
||||
$this->db->where('quantity_purchased < 0');
|
||||
}
|
||||
}
|
||||
return $this->db->get()->row_array();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,20 +18,14 @@ class Summary_categories extends Report
|
||||
$this->db->from('sales_items_temp');
|
||||
$this->db->join('items', 'sales_items_temp.item_id = items.item_id');
|
||||
$this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'"');
|
||||
if ($inputs['sale_type'] == 'sales_retail')
|
||||
if ($inputs['sale_type'] == 'sales')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type', 'sale_stock');
|
||||
}
|
||||
elseif($inputs['sale_type'] == 'sales_wholesale')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type', 'warehouse');
|
||||
}
|
||||
elseif ($inputs['sale_type'] == 'returns')
|
||||
{
|
||||
$this->db->where('quantity_purchased < 0');
|
||||
}
|
||||
}
|
||||
$this->db->group_by('category');
|
||||
$this->db->order_by('category');
|
||||
|
||||
@@ -44,20 +38,14 @@ class Summary_categories extends Report
|
||||
$this->db->from('sales_items_temp');
|
||||
$this->db->join('items', 'sales_items_temp.item_id = items.item_id');
|
||||
$this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'"');
|
||||
if ($inputs['sale_type'] == 'sales_retail')
|
||||
if ($inputs['sale_type'] == 'sales')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type = \'sale_stock\'');
|
||||
}
|
||||
elseif($inputs['sale_type'] == 'sales_wholesale')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type = \'warehouse\'');
|
||||
}
|
||||
elseif ($inputs['sale_type'] == 'returns')
|
||||
{
|
||||
$this->db->where('quantity_purchased < 0');
|
||||
}
|
||||
}
|
||||
|
||||
return $this->db->get()->row_array();
|
||||
}
|
||||
|
||||
@@ -19,20 +19,14 @@ class Summary_customers extends Report
|
||||
$this->db->join('customers', 'customers.person_id = sales_items_temp.customer_id');
|
||||
$this->db->join('people', 'customers.person_id = people.person_id');
|
||||
$this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'"');
|
||||
if ($inputs['sale_type'] == 'sales_retail')
|
||||
if ($inputs['sale_type'] == 'sales')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type', 'sale_stock');
|
||||
}
|
||||
elseif($inputs['sale_type'] == 'sales_wholesale')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type', 'warehouse');
|
||||
}
|
||||
elseif ($inputs['sale_type'] == 'returns')
|
||||
{
|
||||
$this->db->where('quantity_purchased < 0');
|
||||
}
|
||||
}
|
||||
$this->db->group_by('customer_id');
|
||||
$this->db->order_by('last_name');
|
||||
|
||||
@@ -46,20 +40,14 @@ class Summary_customers extends Report
|
||||
$this->db->join('customers', 'customers.person_id = sales_items_temp.customer_id');
|
||||
$this->db->join('people', 'customers.person_id = people.person_id');
|
||||
$this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'"');
|
||||
if ($inputs['sale_type'] == 'sales_retail')
|
||||
if ($inputs['sale_type'] == 'sales')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type', 'sale_stock');
|
||||
}
|
||||
elseif($inputs['sale_type'] == 'sales_wholesale')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type', 'warehouse');
|
||||
}
|
||||
elseif ($inputs['sale_type'] == 'returns')
|
||||
{
|
||||
$this->db->where('quantity_purchased < 0');
|
||||
}
|
||||
}
|
||||
return $this->db->get()->row_array();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,20 +17,14 @@ class Summary_discounts extends Report
|
||||
$this->db->select('CONCAT(discount_percent, "%") as discount_percent, count(*) as count', false);
|
||||
$this->db->from('sales_items_temp');
|
||||
$this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'" and discount_percent > 0');
|
||||
if ($inputs['sale_type'] == 'sales_retail')
|
||||
if ($inputs['sale_type'] == 'sales')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type', 'sale_stock');
|
||||
}
|
||||
elseif($inputs['sale_type'] == 'sales_wholesale')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type', 'warehouse');
|
||||
}
|
||||
elseif ($inputs['sale_type'] == 'returns')
|
||||
{
|
||||
$this->db->where('quantity_purchased < 0');
|
||||
}
|
||||
}
|
||||
$this->db->group_by('sales_items_temp.discount_percent');
|
||||
$this->db->order_by('discount_percent');
|
||||
return $this->db->get()->result_array();
|
||||
@@ -41,20 +35,14 @@ class Summary_discounts extends Report
|
||||
$this->db->select('sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax,sum(profit) as profit');
|
||||
$this->db->from('sales_items_temp');
|
||||
$this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'"');
|
||||
if ($inputs['sale_type'] == 'sales_retail')
|
||||
if ($inputs['sale_type'] == 'sales')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type = \'sale_stock\'');
|
||||
}
|
||||
elseif($inputs['sale_type'] == 'sales_wholesale')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type = \'warehouse\'');
|
||||
}
|
||||
elseif ($inputs['sale_type'] == 'returns')
|
||||
{
|
||||
$this->db->where('quantity_purchased < 0');
|
||||
}
|
||||
}
|
||||
return $this->db->get()->row_array();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,20 +19,14 @@ class Summary_employees extends Report
|
||||
$this->db->join('employees', 'employees.person_id = sales_items_temp.employee_id');
|
||||
$this->db->join('people', 'employees.person_id = people.person_id');
|
||||
$this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'"');
|
||||
if ($inputs['sale_type'] == 'sales_retail')
|
||||
if ($inputs['sale_type'] == 'sales')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type', 'sale_stock');
|
||||
}
|
||||
elseif($inputs['sale_type'] == 'sales_wholesale')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type', 'warehouse');
|
||||
}
|
||||
elseif ($inputs['sale_type'] == 'returns')
|
||||
{
|
||||
$this->db->where('quantity_purchased < 0');
|
||||
}
|
||||
}
|
||||
$this->db->group_by('employee_id');
|
||||
$this->db->order_by('last_name');
|
||||
|
||||
@@ -46,15 +40,9 @@ class Summary_employees extends Report
|
||||
$this->db->join('employees', 'employees.person_id = sales_items_temp.employee_id');
|
||||
$this->db->join('people', 'employees.person_id = people.person_id');
|
||||
$this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'"');
|
||||
if ($inputs['sale_type'] == 'sales_retail')
|
||||
if ($inputs['sale_type'] == 'sales')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type = \'sale_stock\'');
|
||||
}
|
||||
elseif($inputs['sale_type'] == 'sales_wholesale')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type = \'warehouse\'');
|
||||
}
|
||||
elseif ($inputs['sale_type'] == 'returns')
|
||||
{
|
||||
|
||||
@@ -18,20 +18,14 @@ class Summary_items extends Report
|
||||
$this->db->from('sales_items_temp');
|
||||
$this->db->join('items', 'sales_items_temp.item_id = items.item_id');
|
||||
$this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'"');
|
||||
if ($inputs['sale_type'] == 'sales_retail')
|
||||
if ($inputs['sale_type'] == 'sales')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type', 'sale_stock');
|
||||
}
|
||||
elseif($inputs['sale_type'] == 'sales_wholesale')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type', 'warehouse');
|
||||
}
|
||||
elseif ($inputs['sale_type'] == 'returns')
|
||||
{
|
||||
$this->db->where('quantity_purchased < 0');
|
||||
}
|
||||
}
|
||||
$this->db->group_by('items.item_id');
|
||||
$this->db->order_by('name');
|
||||
|
||||
@@ -44,15 +38,9 @@ class Summary_items extends Report
|
||||
$this->db->from('sales_items_temp');
|
||||
$this->db->join('items', 'sales_items_temp.item_id = items.item_id');
|
||||
$this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'"');
|
||||
if ($inputs['sale_type'] == 'sales_retail')
|
||||
if ($inputs['sale_type'] == 'sales')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type = \'sale_stock\'');
|
||||
}
|
||||
elseif($inputs['sale_type'] == 'sales_wholesale')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type = \'warehouse\'');
|
||||
}
|
||||
elseif ($inputs['sale_type'] == 'returns')
|
||||
{
|
||||
|
||||
@@ -18,20 +18,14 @@ class Summary_payments extends Report
|
||||
$this->db->from('sales_payments');
|
||||
$this->db->join('sales', 'sales.sale_id=sales_payments.sale_id');
|
||||
$this->db->where('date(sale_time) BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'"');
|
||||
if ($inputs['sale_type'] == 'sales_retail')
|
||||
if ($inputs['sale_type'] == 'sales')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type', 'sale_stock');
|
||||
}
|
||||
elseif($inputs['sale_type'] == 'sales_wholesale')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type', 'warehouse');
|
||||
}
|
||||
elseif ($inputs['sale_type'] == 'returns')
|
||||
{
|
||||
$this->db->where('quantity_purchased < 0');
|
||||
}
|
||||
}
|
||||
$this->db->group_by("payment_type");
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
@@ -42,20 +36,14 @@ class Summary_payments extends Report
|
||||
$this->db->from('sales_items_temp');
|
||||
$this->db->join('items', 'sales_items_temp.item_id = items.item_id');
|
||||
$this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'"');
|
||||
if ($inputs['sale_type'] == 'sales_retail')
|
||||
if ($inputs['sale_type'] == 'sales')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type = \'sale_stock\'');
|
||||
}
|
||||
elseif($inputs['sale_type'] == 'sales_wholesale')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type = \'warehouse\'');
|
||||
}
|
||||
elseif ($inputs['sale_type'] == 'returns')
|
||||
{
|
||||
$this->db->where('quantity_purchased < 0');
|
||||
}
|
||||
}
|
||||
return $this->db->get()->row_array();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,20 +16,14 @@ class Summary_sales extends Report
|
||||
{
|
||||
$this->db->select('sale_date, sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax,sum(profit) as profit');
|
||||
$this->db->from('sales_items_temp');
|
||||
if ($inputs['sale_type'] == 'sales_retail')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type', 'sale_stock');
|
||||
}
|
||||
elseif($inputs['sale_type'] == 'sales_wholesale')
|
||||
if ($inputs['sale_type'] == 'sales')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type', 'warehouse');
|
||||
}
|
||||
elseif ($inputs['sale_type'] == 'returns')
|
||||
{
|
||||
$this->db->where('quantity_purchased < 0');
|
||||
}
|
||||
elseif ($inputs['sale_type'] == 'returns')
|
||||
{
|
||||
$this->db->where('quantity_purchased < 0');
|
||||
}
|
||||
|
||||
$this->db->group_by('sale_date');
|
||||
$this->db->having('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'"');
|
||||
@@ -42,20 +36,14 @@ class Summary_sales extends Report
|
||||
$this->db->select('sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax,sum(profit) as profit');
|
||||
$this->db->from('sales_items_temp');
|
||||
$this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'"');
|
||||
if ($inputs['sale_type'] == 'sales_retail')
|
||||
if ($inputs['sale_type'] == 'sales')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type = \'sale_stock\'');
|
||||
}
|
||||
elseif($inputs['sale_type'] == 'sales_wholesale')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type = \'warehouse\'');
|
||||
}
|
||||
elseif ($inputs['sale_type'] == 'returns')
|
||||
{
|
||||
$this->db->where('quantity_purchased < 0');
|
||||
}
|
||||
}
|
||||
return $this->db->get()->row_array();
|
||||
}
|
||||
|
||||
|
||||
@@ -19,20 +19,14 @@ class Summary_suppliers extends Report
|
||||
$this->db->join('suppliers', 'suppliers.person_id = sales_items_temp.supplier_id');
|
||||
$this->db->join('people', 'suppliers.person_id = people.person_id');
|
||||
$this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'"');
|
||||
if ($inputs['sale_type'] == 'sales_retail')
|
||||
if ($inputs['sale_type'] == 'sales')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type', 'sale_stock');
|
||||
}
|
||||
elseif($inputs['sale_type'] == 'sales_wholesale')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type', 'warehouse');
|
||||
}
|
||||
elseif ($inputs['sale_type'] == 'returns')
|
||||
{
|
||||
$this->db->where('quantity_purchased < 0');
|
||||
}
|
||||
}
|
||||
$this->db->group_by('supplier_id');
|
||||
$this->db->order_by('last_name');
|
||||
|
||||
@@ -46,20 +40,14 @@ class Summary_suppliers extends Report
|
||||
$this->db->join('suppliers', 'suppliers.person_id = sales_items_temp.supplier_id');
|
||||
$this->db->join('people', 'suppliers.person_id = people.person_id');
|
||||
$this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'"');
|
||||
if ($inputs['sale_type'] == 'sales_retail')
|
||||
if ($inputs['sale_type'] == 'sales')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type = \'sale_stock\'');
|
||||
}
|
||||
elseif($inputs['sale_type'] == 'sales_wholesale')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type = \'warehouse\'');
|
||||
}
|
||||
elseif ($inputs['sale_type'] == 'returns')
|
||||
{
|
||||
$this->db->where('quantity_purchased < 0');
|
||||
}
|
||||
}
|
||||
return $this->db->get()->row_array();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,20 +51,15 @@ class Summary_taxes extends Report
|
||||
$this->db->join('items', 'sales_items_temp.item_id = items.item_id');
|
||||
$this->db->where('sale_date BETWEEN "'. $inputs['start_date']. '" and "'. $inputs['end_date'].'"');
|
||||
|
||||
if ($inputs['sale_type'] == 'sales_retail')
|
||||
if ($inputs['sale_type'] == 'sales')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type', 'sale_stock');
|
||||
}
|
||||
elseif($inputs['sale_type'] == 'sales_wholesale')
|
||||
{
|
||||
$this->db->where('quantity_purchased > 0');
|
||||
$this->db->where('sale_type', 'warehouse');
|
||||
}
|
||||
elseif ($inputs['sale_type'] == 'returns')
|
||||
{
|
||||
$this->db->where('quantity_purchased < 0');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $this->db->get()->row_array();
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ class Sale extends CI_Model
|
||||
return $success;
|
||||
}
|
||||
|
||||
function save ($items,$customer_id,$employee_id,$comment,$payments,$sale_id=false)
|
||||
function save ($items,$customer_id,$employee_id,$comment,$payments,$stock_location, $sale_id=false)
|
||||
{
|
||||
if(count($items)==0)
|
||||
return -1;
|
||||
@@ -94,8 +94,11 @@ class Sale extends CI_Model
|
||||
$this->db->insert('sales_items',$sales_items_data);
|
||||
|
||||
//Update stock quantity
|
||||
$item_data = array('quantity'=>$cur_item_info->quantity - $item['quantity']);
|
||||
$this->Item->save($item_data,$item['item_id']);
|
||||
$item_quantity = $this->Item_quantitys->get_item_quantity($item['item_id'], $this->sale_lib->get_location_id_from_stock_location($this->sale_lib->get_sale_location()));
|
||||
$this->Item_quantitys->save(array('quantity'=>$item_quantity->quantity - $item['quantity'],
|
||||
'item_id'=>$item['item_id'],
|
||||
'location_id'=>$this->sale_lib->get_location_id_from_stock_location($stock_location)), $item_quantity->item_quantity_id);
|
||||
|
||||
|
||||
//Ramel Inventory Tracking
|
||||
//Inventory Count Details
|
||||
@@ -106,6 +109,7 @@ class Sale extends CI_Model
|
||||
'trans_date'=>date('Y-m-d H:i:s'),
|
||||
'trans_items'=>$item['item_id'],
|
||||
'trans_user'=>$employee_id,
|
||||
'location_id'=>$this->sale_lib->get_location_id_from_stock_location($stock_location),
|
||||
'trans_comment'=>$sale_remarks,
|
||||
'trans_inventory'=>$qty_buy
|
||||
);
|
||||
|
||||
84
application/models/stock_locations.php
Normal file
84
application/models/stock_locations.php
Normal file
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
class Stock_locations extends CI_Model
|
||||
{
|
||||
function exists($location_name)
|
||||
{
|
||||
$this->db->from('stock_locations');
|
||||
$this->db->where('location_name',$location_name);
|
||||
$query = $this->db->get();
|
||||
|
||||
return ($query->num_rows()==1);
|
||||
}
|
||||
|
||||
function get_all($limit=10000, $offset=0)
|
||||
{
|
||||
$this->db->from('stock_locations');
|
||||
$this->db->limit($limit);
|
||||
$this->db->offset($offset);
|
||||
return $this->db->get();
|
||||
}
|
||||
|
||||
function get_undeleted_all($limit=10000, $offset=0)
|
||||
{
|
||||
$this->db->from('stock_locations');
|
||||
$this->db->where('deleted',0);
|
||||
$this->db->limit($limit);
|
||||
$this->db->offset($offset);
|
||||
return $this->db->get();
|
||||
}
|
||||
|
||||
function get_location_id($location_name)
|
||||
{
|
||||
$this->db->from('stock_locations');
|
||||
$this->db->where('deleted',0);
|
||||
$this->db->where('location_name',$location_name);
|
||||
return $this->db->get()->row()->location_id;
|
||||
}
|
||||
|
||||
function array_save($stock_locations)
|
||||
{
|
||||
$location_db = $this->get_all()->result_array();
|
||||
//Delete all in db
|
||||
$this->db->trans_start();
|
||||
$location_ids=array();
|
||||
foreach($location_db as $db)
|
||||
{
|
||||
array_push($location_ids,$db['location_id']);
|
||||
}
|
||||
$this->db->where_in('location_id', $location_ids);
|
||||
$this->db->update('stock_locations',array('deleted'=>1));
|
||||
$this->db->trans_complete();
|
||||
|
||||
$location_db = $this->get_all()->result_array();
|
||||
//Update the stock location
|
||||
$this->db->trans_start();
|
||||
foreach ($stock_locations as $location)
|
||||
{
|
||||
$to_create = true;
|
||||
foreach($location_db as $db)
|
||||
{
|
||||
if($db['location_name'] == $location)
|
||||
{
|
||||
if($db['deleted'] == 1)
|
||||
{
|
||||
$this->db->where('location_id', $db['location_id']);
|
||||
|
||||
$this->db->update('stock_locations',array('location_name'=>$db['location_name'],'deleted'=>0));
|
||||
}
|
||||
$to_create = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if($to_create)
|
||||
{
|
||||
$location_data = array('location_name'=>$location,'deleted'=>0);
|
||||
$this->db->insert('stock_locations',$location_data);
|
||||
}
|
||||
}
|
||||
$this->db->trans_complete();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -258,6 +258,16 @@ echo form_open('config/save/',array('id'=>'config_form'));
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_stock_location').':', 'stock_location',array('class'=>'required wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'stock_location',
|
||||
'id'=>'stock_location',
|
||||
'value'=>$this->config->item('stock_location')));?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_print_after_sale').':', 'print_after_sale',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
@@ -420,7 +430,9 @@ $(document).ready(function()
|
||||
number:true
|
||||
},
|
||||
email:"email",
|
||||
return_policy: "required"
|
||||
return_policy: "required",
|
||||
stock_location_number:"required"
|
||||
|
||||
},
|
||||
messages:
|
||||
{
|
||||
@@ -433,7 +445,8 @@ $(document).ready(function()
|
||||
number:"<?php echo $this->lang->line('config_default_tax_rate_number'); ?>"
|
||||
},
|
||||
email: "<?php echo $this->lang->line('common_email_invalid_format'); ?>",
|
||||
return_policy:"<?php echo $this->lang->line('config_return_policy_required'); ?>"
|
||||
return_policy:"<?php echo $this->lang->line('config_return_policy_required'); ?>",
|
||||
stock_location_number:"<?php echo $this->lang->line('config_stock_location_required'); ?>"
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
@@ -59,6 +59,16 @@ echo form_open('items/save_inventory/'.$item_info->item_id,array('id'=>'item_for
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php echo form_label($this->lang->line('items_stock_location').':', 'stock_location',array('class'=>'wide')); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
echo form_dropdown('stock_location',$stock_locations,current($stock_locations),'onchange="display_stock(this.value)"');
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php echo form_label($this->lang->line('items_current_quantity').':', 'quantity',array('class'=>'wide')); ?>
|
||||
</td>
|
||||
<td>
|
||||
@@ -66,7 +76,7 @@ echo form_open('items/save_inventory/'.$item_info->item_id,array('id'=>'item_for
|
||||
|
||||
'name'=>'quantity',
|
||||
'id'=>'quantity',
|
||||
'value'=>$item_info->quantity,
|
||||
'value'=>current($item_quantitys),
|
||||
'style' => 'border:none',
|
||||
'readonly' => 'readonly'
|
||||
);
|
||||
@@ -89,26 +99,74 @@ echo form_open('items/save_inventory/'.$item_info->item_id,array('id'=>'item_for
|
||||
<?php
|
||||
echo form_close();
|
||||
?>
|
||||
<table border="0" align="center">
|
||||
<tr bgcolor="#FF0033" align="center" style="font-weight:bold"><td colspan="4">Inventory Data Tracking</td></tr>
|
||||
<tr align="center" style="font-weight:bold"><td width="15%">Date</td><td width="25%">Employee</td><td width="15%">In/Out Qty</td><td width="45%">Remarks</td></tr>
|
||||
<?php
|
||||
foreach($this->Inventory->get_inventory_data_for_item($item_info->item_id)->result_array() as $row)
|
||||
$inventory_array = $this->Inventory->get_inventory_data_for_item($item_info->item_id)->result_array();
|
||||
$employee_name = array();
|
||||
foreach( $inventory_array as $row)
|
||||
{
|
||||
?>
|
||||
<tr bgcolor="#CCCCCC" align="center">
|
||||
<td><?php echo $row['trans_date'];?></td>
|
||||
<td><?php
|
||||
$person_id = $row['trans_user'];
|
||||
$employee = $this->Employee->get_info($person_id);
|
||||
echo $employee->first_name." ".$employee->last_name;
|
||||
?>
|
||||
</td>
|
||||
<td align="right"><?php echo $row['trans_inventory'];?></td>
|
||||
<td><?php echo $row['trans_comment'];?></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
$person_id = $row['trans_user'];
|
||||
$employee = $this->Employee->get_info($person_id);
|
||||
array_push($employee_name, $employee->first_name." ".$employee->last_name);
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<table id="inventory_result" border="0" align="center">
|
||||
<tr bgcolor="#FF0033" align="center" style="font-weight:bold"><td colspan="4">Inventory Data Tracking</td></tr>
|
||||
<tr align="center" style="font-weight:bold"><td width="15%">Date</td><td width="25%">Employee</td><td width="15%">In/Out Qty</td><td width="45%">Remarks</td></tr>
|
||||
</table>
|
||||
|
||||
<script type='text/javascript'>
|
||||
$(document).ready(function()
|
||||
{
|
||||
display_stock(<?php echo json_encode(key($stock_locations)); ?>);
|
||||
});
|
||||
|
||||
function display_stock(stock)
|
||||
{
|
||||
var item_quantitys= <?php echo json_encode($item_quantitys ); ?>;
|
||||
document.getElementById("quantity").value = item_quantitys[stock];
|
||||
|
||||
var location_id = stock.substring(6);
|
||||
var inventory_data = <?php echo json_encode($inventory_array); ?>;
|
||||
var employee_data = <?php echo json_encode($employee_name); ?>;
|
||||
|
||||
var table = document.getElementById("inventory_result");
|
||||
//Remove old query
|
||||
var rowCount = table.rows.length;
|
||||
for (var index = rowCount; index > 2; index--)
|
||||
{
|
||||
table.deleteRow(index-1);
|
||||
}
|
||||
|
||||
//Add new query
|
||||
for (var index = 0; index < inventory_data.length; index++)
|
||||
{
|
||||
var data = inventory_data[index];
|
||||
if(data['location_id'] == location_id)
|
||||
{
|
||||
var tr = document.createElement('TR');
|
||||
tr.setAttribute("bgColor","#CCCCCC");
|
||||
tr.setAttribute("align","#center");
|
||||
|
||||
var td = document.createElement('TD');
|
||||
td.appendChild(document.createTextNode(data['trans_date']));
|
||||
tr.appendChild(td);
|
||||
|
||||
td = document.createElement('TD');
|
||||
td.appendChild(document.createTextNode(employee_data[index]));
|
||||
tr.appendChild(td);
|
||||
|
||||
td = document.createElement('TD');
|
||||
td.setAttribute("align","right");
|
||||
td.appendChild(document.createTextNode(data['trans_inventory']));
|
||||
tr.appendChild(td);
|
||||
|
||||
td = document.createElement('TD');
|
||||
td.appendChild(document.createTextNode(data['trans_comment']));
|
||||
tr.appendChild(td);
|
||||
|
||||
table.appendChild(tr);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
@@ -112,17 +112,25 @@ echo form_open('items/save/'.$item_info->item_id,array('id'=>'item_form'));
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('items_quantity').':', 'quantity',array('class'=>'required wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'quantity',
|
||||
'id'=>'quantity',
|
||||
'value'=>$item_info->quantity)
|
||||
);?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
foreach($stock_locations as $key=>$location_detail)
|
||||
{
|
||||
?>
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('items_quantity').' '.$location_detail['location_name'] .':',
|
||||
$key.'_quantity',
|
||||
array('class'=>'required wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>$key.'_quantity',
|
||||
'id'=>$key.'_quantity',
|
||||
'value'=>$location_detail['quantity'])
|
||||
);?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('items_reorder_level').':', 'reorder_level',array('class'=>'required wide')); ?>
|
||||
|
||||
@@ -62,6 +62,16 @@ echo form_open('items/save_inventory/'.$item_info->item_id,array('id'=>'item_for
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php echo form_label($this->lang->line('items_stock_location').':', 'stock_location',array('class'=>'wide')); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
echo form_dropdown('stock_location',$stock_locations,current($stock_locations),'onchange="fill_quantity(this.value)"');
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php echo form_label($this->lang->line('items_current_quantity').':', 'quantity',array('class'=>'wide')); ?>
|
||||
</td>
|
||||
<td>
|
||||
@@ -69,7 +79,7 @@ echo form_open('items/save_inventory/'.$item_info->item_id,array('id'=>'item_for
|
||||
|
||||
'name'=>'quantity',
|
||||
'id'=>'quantity',
|
||||
'value'=>$item_info->quantity,
|
||||
'value'=>current($item_quantitys),
|
||||
'style' => 'border:none',
|
||||
'readonly' => 'readonly'
|
||||
);
|
||||
@@ -154,4 +164,11 @@ $(document).ready(function()
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function fill_quantity(val)
|
||||
{
|
||||
var item_quantitys= <?php echo json_encode($item_quantitys ); ?>;
|
||||
document.getElementById("quantity").value = item_quantitys[val];
|
||||
}
|
||||
</script>
|
||||
@@ -22,7 +22,7 @@ $(document).ready(function()
|
||||
$(this).attr('href','index.php/items/generate_barcodes/'+selected.join(':'));
|
||||
});
|
||||
|
||||
$("#low_inventory, #is_serialized, #no_description, #search_custom, #is_deleted").click(function()
|
||||
$("#is_serialized, #no_description, #search_custom, #is_deleted").click(function()
|
||||
{
|
||||
$('#items_filter_form').submit();
|
||||
});
|
||||
@@ -135,18 +135,12 @@ function show_hide_search_filter(search_filter_section, switchImgTag) {
|
||||
|
||||
<div id="search_filter_section" style="display: <?php echo isset($search_section_state)? ( ($search_section_state)? 'block' : 'none') : 'none';?>;background-color:#EEEEEE;">
|
||||
<?php echo form_open("$controller_name/refresh",array('id'=>'items_filter_form')); ?>
|
||||
<?php echo form_label($this->lang->line('items_low_inventory_items').' '.':', 'low_inventory');?>
|
||||
<?php echo form_checkbox(array('name'=>'low_inventory','id'=>'low_inventory','value'=>1,'checked'=> isset($low_inventory)? ( ($low_inventory)? 1 : 0) : 0)).' | ';?>
|
||||
<?php echo form_label($this->lang->line('items_serialized_items').' '.':', 'is_serialized');?>
|
||||
<?php echo form_checkbox(array('name'=>'is_serialized','id'=>'is_serialized','value'=>1,'checked'=> isset($is_serialized)? ( ($is_serialized)? 1 : 0) : 0)).' | ';?>
|
||||
<?php echo form_label($this->lang->line('items_no_description_items').' '.':', 'no_description');?>
|
||||
<?php echo form_checkbox(array('name'=>'no_description','id'=>'no_description','value'=>1,'checked'=> isset($no_description)? ( ($no_description)? 1 : 0) : 0)).' | ';?>
|
||||
<?php echo form_label($this->lang->line('items_search_custom_items').' '.':', 'search_custom');//GARRISON ADDED 4/21/2013?>
|
||||
<?php echo form_checkbox(array('name'=>'search_custom','id'=>'search_custom','value'=>1,'checked'=> isset($search_custom)? ( ($search_custom)? 1 : 0) : 0)).' | ';//GARRISON ADDED 4/21/2013?>
|
||||
<?php echo form_label($this->lang->line('items_stock_type').' '.':', 'stock_type');?>
|
||||
<?php $stock_type_array = array('all'=>'All','sale_stock'=>$this->lang->line('items_stock_type_sale'),'warehouse'=>$this->lang->line('items_stock_type_warehouse'));
|
||||
echo form_dropdown('stock_type',$stock_type_array,$stock_type,'onchange="$(\'#items_filter_form\').submit();"'); ?>
|
||||
</form>
|
||||
<?php echo form_checkbox(array('name'=>'search_custom','id'=>'search_custom','value'=>1,'checked'=> isset($search_custom)? ( ($search_custom)? 1 : 0) : 0));//GARRISON ADDED 4/21/2013?>
|
||||
<input type="hidden" name="search_section_state" id="search_section_state" value="<?php echo isset($search_section_state)? ( ($search_section_state)? 'block' : 'none') : 'none';?>" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -13,8 +13,28 @@ if(isset($error))
|
||||
|
||||
<div id="register_wrapper">
|
||||
<?php echo form_open("receivings/change_mode",array('id'=>'mode_form')); ?>
|
||||
<span><?php echo $this->lang->line('recvs_mode') ?></span>
|
||||
<span><?php echo $this->lang->line('recvs_mode') ?></span>
|
||||
<?php echo form_dropdown('mode',$modes,$mode,'onchange="$(\'#mode_form\').submit();"'); ?>
|
||||
|
||||
<?php
|
||||
if($mode == 'requisition')
|
||||
{
|
||||
?>
|
||||
<span><?php echo $this->lang->line('recvs_stock_source') ?></span>
|
||||
<?php echo form_dropdown('stock_source',$stock_locations,$stock_source,'onchange="$(\'#mode_form\').submit();"'); ?>
|
||||
<span><?php echo $this->lang->line('recvs_stock_destination') ?></span>
|
||||
<?php echo form_dropdown('stock_destination',$stock_locations,$stock_destination,'onchange="$(\'#mode_form\').submit();"'); ?>
|
||||
<?php
|
||||
}
|
||||
else
|
||||
{
|
||||
?>
|
||||
<span><?php echo $this->lang->line('recvs_stock_locaiton') ?></span>
|
||||
<?php echo form_dropdown('stock_source',$stock_locations,$stock_source,'onchange="$(\'#mode_form\').submit();"'); ?>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</form>
|
||||
<?php echo form_open("receivings/add",array('id'=>'add_item_form')); ?>
|
||||
<label id="item_label" for="item">
|
||||
|
||||
@@ -47,8 +47,7 @@ if(isset($error))
|
||||
<?php echo form_label($this->lang->line('reports_sale_type'), 'reports_sale_type_label', array('class'=>'required')); ?>
|
||||
<div id='report_sale_type'>
|
||||
<?php echo form_dropdown('sale_type',array('all' => $this->lang->line('reports_all'),
|
||||
'sales_retail' => $this->lang->line('reports_sales_retail'),
|
||||
'sales_wholesale' => $this->lang->line('reports_sales_wholesale'),
|
||||
'sales' => $this->lang->line('reports_sales'),
|
||||
'returns' => $this->lang->line('reports_returns')), 'all', 'id="input_type"'); ?>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
@@ -26,8 +26,7 @@ if(isset($error))
|
||||
<?php echo form_label($this->lang->line('reports_sale_type'), 'reports_sale_type_label', array('class'=>'required')); ?>
|
||||
<div id='report_sale_type'>
|
||||
<?php echo form_dropdown('sale_type',array('all' => $this->lang->line('reports_all'),
|
||||
'sales_retail' => $this->lang->line('reports_sales_retail'),
|
||||
'sales_wholesale' => $this->lang->line('reports_sales_wholesale'),
|
||||
'sales' => $this->lang->line('reports_sales'),
|
||||
'returns' => $this->lang->line('reports_returns')), 'all', 'id="sale_type"'); ?>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -32,8 +32,7 @@ if(isset($error))
|
||||
<?php echo form_label($this->lang->line('reports_sale_type'), 'reports_sale_type_label', array('class'=>'required')); ?>
|
||||
<div id='report_sale_type'>
|
||||
<?php echo form_dropdown('sale_type',array('all' => $this->lang->line('reports_all'),
|
||||
'sales_retail' => $this->lang->line('reports_sales_retail'),
|
||||
'sales_wholesale' => $this->lang->line('reports_sales_wholesale'),
|
||||
'sales' => $this->lang->line('reports_sales'),
|
||||
'returns' => $this->lang->line('reports_returns')) , 'all', 'id="sale_type"'); ?>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -20,6 +20,8 @@ if (isset($success))
|
||||
<?php echo form_open("sales/change_mode",array('id'=>'mode_form')); ?>
|
||||
<span><?php echo $this->lang->line('sales_mode') ?></span>
|
||||
<?php echo form_dropdown('mode',$modes,$mode,'onchange="$(\'#mode_form\').submit();"'); ?>
|
||||
<span><?php echo $this->lang->line('sales_stock_location') ?></span>
|
||||
<?php echo form_dropdown('stock_location',$stock_locations,$stock_location,'onchange="$(\'#mode_form\').submit();"'); ?>
|
||||
<div id="show_suspended_sales_button">
|
||||
<?php echo anchor("sales/suspended/width:425",
|
||||
"<div class='small_button'><span style='font-size:73%;'>".$this->lang->line('sales_suspended_sales')."</span></div>",
|
||||
@@ -86,7 +88,10 @@ else
|
||||
<tr>
|
||||
<td><?php echo anchor("sales/delete_item/$line",'['.$this->lang->line('common_delete').']');?></td>
|
||||
<td><?php echo $item['item_number']; ?></td>
|
||||
<td style="align:center;"><?php echo $item['name']; ?><br /> [<?php echo $cur_item_info->quantity; ?> in stock]</td>
|
||||
<td style="align:center;"><?php echo $item['name']; ?><br /> [<?php
|
||||
$item_quantity = $this->Item_quantitys->get_item_quantity($item['item_id'], $this->sale_lib->get_location_id_from_stock_location($stock_location));
|
||||
echo $item_quantity->quantity;
|
||||
?> in stock]</td>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,14 +1,23 @@
|
||||
-- phpMyAdmin SQL Dump
|
||||
-- version 3.3.9
|
||||
-- version 4.0.9
|
||||
-- http://www.phpmyadmin.net
|
||||
--
|
||||
-- Host: localhost
|
||||
-- Generation Time: Apr 08, 2011 at 04:27 PM
|
||||
-- Server version: 5.1.54
|
||||
-- PHP Version: 5.3.3
|
||||
-- Host: 127.0.0.1
|
||||
-- Generation Time: Jul 02, 2014 at 06:13 AM
|
||||
-- Server version: 5.5.34
|
||||
-- PHP Version: 5.4.22
|
||||
|
||||
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
|
||||
SET time_zone = "+00:00";
|
||||
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!40101 SET NAMES utf8 */;
|
||||
|
||||
--
|
||||
-- Database: `pos`
|
||||
-- Database: `ospos_stock_db`
|
||||
--
|
||||
|
||||
-- --------------------------------------------------------
|
||||
@@ -17,7 +26,7 @@
|
||||
-- Table structure for table `ospos_app_config`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_app_config` (
|
||||
CREATE TABLE IF NOT EXISTS `ospos_app_config` (
|
||||
`key` varchar(255) NOT NULL,
|
||||
`value` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`key`)
|
||||
@@ -30,11 +39,30 @@ CREATE TABLE `ospos_app_config` (
|
||||
INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('address', '123 Nowhere street'),
|
||||
('company', 'Open Source Point of Sale'),
|
||||
('currency_side', '0'),
|
||||
('currency_symbol', ''),
|
||||
('custom10_name', ''),
|
||||
('custom1_name', ''),
|
||||
('custom2_name', ''),
|
||||
('custom3_name', ''),
|
||||
('custom4_name', ''),
|
||||
('custom5_name', ''),
|
||||
('custom6_name', ''),
|
||||
('custom7_name', ''),
|
||||
('custom8_name', ''),
|
||||
('custom9_name', ''),
|
||||
('default_tax_1_name', 'Sales Tax'),
|
||||
('default_tax_1_rate', ''),
|
||||
('default_tax_2_name', 'Sales Tax 2'),
|
||||
('default_tax_2_rate', ''),
|
||||
('default_tax_rate', '8'),
|
||||
('email', 'admin@pappastech.com'),
|
||||
('fax', ''),
|
||||
('language', 'en'),
|
||||
('phone', '555-555-5555'),
|
||||
('print_after_sale', '0'),
|
||||
('return_policy', 'Test'),
|
||||
('stock_location', 'stockD,stockE,stockA'),
|
||||
('timezone', 'America/New_York'),
|
||||
('website', '');
|
||||
|
||||
@@ -44,7 +72,7 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
-- Table structure for table `ospos_customers`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_customers` (
|
||||
CREATE TABLE IF NOT EXISTS `ospos_customers` (
|
||||
`person_id` int(10) NOT NULL,
|
||||
`account_number` varchar(255) DEFAULT NULL,
|
||||
`taxable` int(1) NOT NULL DEFAULT '1',
|
||||
@@ -53,18 +81,13 @@ CREATE TABLE `ospos_customers` (
|
||||
KEY `person_id` (`person_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_customers`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_employees`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_employees` (
|
||||
CREATE TABLE IF NOT EXISTS `ospos_employees` (
|
||||
`username` varchar(255) NOT NULL,
|
||||
`password` varchar(255) NOT NULL,
|
||||
`person_id` int(10) NOT NULL,
|
||||
@@ -86,20 +109,15 @@ INSERT INTO `ospos_employees` (`username`, `password`, `person_id`, `deleted`) V
|
||||
-- Table structure for table `ospos_giftcards`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_giftcards` (
|
||||
CREATE TABLE IF NOT EXISTS `ospos_giftcards` (
|
||||
`giftcard_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`giftcard_number` varchar(25) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`value` double(15,2) NOT NULL,
|
||||
`deleted` int(1) NOT NULL DEFAULT '0',
|
||||
`person_id` INT NOT NULL,
|
||||
`person_id` int(11) NOT NULL,
|
||||
PRIMARY KEY (`giftcard_id`),
|
||||
UNIQUE KEY `giftcard_number` (`giftcard_number`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=48 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_giftcards`
|
||||
--
|
||||
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@@ -107,22 +125,43 @@ CREATE TABLE `ospos_giftcards` (
|
||||
-- Table structure for table `ospos_inventory`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_inventory` (
|
||||
CREATE TABLE IF NOT EXISTS `ospos_inventory` (
|
||||
`trans_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`trans_items` int(11) NOT NULL DEFAULT '0',
|
||||
`trans_user` int(11) NOT NULL DEFAULT '0',
|
||||
`location_id` int(11) NOT NULL,
|
||||
`trans_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`trans_comment` text NOT NULL,
|
||||
`trans_inventory` int(11) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`trans_id`),
|
||||
KEY `ospos_inventory_ibfk_1` (`trans_items`),
|
||||
KEY `ospos_inventory_ibfk_2` (`trans_user`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=152 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_inventory`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_inventory` (`trans_id`, `trans_items`, `trans_user`, `location_id`, `trans_date`, `trans_comment`, `trans_inventory`) VALUES
|
||||
(133, 1, 1, 4, '2014-06-25 13:36:39', 'Manual Edit of Quantity', 0),
|
||||
(134, 1, 1, 6, '2014-06-25 13:36:39', 'Manual Edit of Quantity', 0),
|
||||
(135, 1, 1, 7, '2014-06-25 13:36:39', 'Manual Edit of Quantity', 0),
|
||||
(136, 1, 1, 4, '2014-06-25 13:37:33', '', -3),
|
||||
(137, 1, 1, 4, '2014-06-25 13:41:20', 'POS 24', -2),
|
||||
(138, 1, 1, 4, '2014-07-01 04:42:02', 'Manual Edit of Quantity', 0),
|
||||
(139, 1, 1, 6, '2014-07-01 04:42:02', 'Manual Edit of Quantity', 0),
|
||||
(140, 1, 1, 7, '2014-07-01 04:42:02', 'Manual Edit of Quantity', 0),
|
||||
(141, 1, 1, 4, '2014-07-01 05:58:00', 'Manual Edit of Quantity', 0),
|
||||
(142, 1, 1, 6, '2014-07-01 05:58:00', 'Manual Edit of Quantity', 0),
|
||||
(143, 1, 1, 7, '2014-07-01 05:58:01', 'Manual Edit of Quantity', 0),
|
||||
(144, 13, 1, 4, '2014-07-01 17:08:41', 'Manual Edit of Quantity', 10),
|
||||
(145, 13, 1, 6, '2014-07-01 17:08:41', 'Manual Edit of Quantity', 20),
|
||||
(146, 13, 1, 7, '2014-07-01 17:08:41', 'Manual Edit of Quantity', 30),
|
||||
(147, 15, 1, 4, '2014-07-01 17:09:00', 'Manual Edit of Quantity', 40),
|
||||
(148, 15, 1, 6, '2014-07-01 17:09:00', 'Manual Edit of Quantity', 50),
|
||||
(149, 15, 1, 7, '2014-07-01 17:09:00', 'Manual Edit of Quantity', 60),
|
||||
(150, 13, 1, 6, '2014-07-01 17:10:02', 'POS 25', -1),
|
||||
(151, 1, 1, 6, '2014-07-01 17:10:02', 'POS 25', -2);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@@ -130,7 +169,7 @@ CREATE TABLE `ospos_inventory` (
|
||||
-- Table structure for table `ospos_items`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_items` (
|
||||
CREATE TABLE IF NOT EXISTS `ospos_items` (
|
||||
`name` varchar(255) NOT NULL,
|
||||
`category` varchar(255) NOT NULL,
|
||||
`supplier_id` int(11) DEFAULT NULL,
|
||||
@@ -138,7 +177,6 @@ CREATE TABLE `ospos_items` (
|
||||
`description` varchar(255) NOT NULL,
|
||||
`cost_price` double(15,2) NOT NULL,
|
||||
`unit_price` double(15,2) NOT NULL,
|
||||
`quantity` double(15,2) NOT NULL DEFAULT '0.00',
|
||||
`reorder_level` double(15,2) NOT NULL DEFAULT '0.00',
|
||||
`location` varchar(255) NOT NULL,
|
||||
`item_id` int(10) NOT NULL AUTO_INCREMENT,
|
||||
@@ -146,25 +184,35 @@ CREATE TABLE `ospos_items` (
|
||||
`is_serialized` tinyint(1) NOT NULL,
|
||||
`deleted` int(1) NOT NULL DEFAULT '0',
|
||||
`stock_type` enum('sale_stock','warehouse') NOT NULL DEFAULT 'warehouse',
|
||||
`custom1` VARCHAR(25) NOT NULL,
|
||||
`custom2` VARCHAR(25) NOT NULL,
|
||||
`custom3` VARCHAR(25) NOT NULL,
|
||||
`custom4` VARCHAR(25) NOT NULL,
|
||||
`custom5` VARCHAR(25) NOT NULL,
|
||||
`custom6` VARCHAR(25) NOT NULL,
|
||||
`custom7` VARCHAR(25) NOT NULL,
|
||||
`custom8` VARCHAR(25) NOT NULL,
|
||||
`custom9` VARCHAR(25) NOT NULL,
|
||||
`custom10` VARCHAR(25) NOT NULL,
|
||||
`custom1` varchar(25) NOT NULL,
|
||||
`custom2` varchar(25) NOT NULL,
|
||||
`custom3` varchar(25) NOT NULL,
|
||||
`custom4` varchar(25) NOT NULL,
|
||||
`custom5` varchar(25) NOT NULL,
|
||||
`custom6` varchar(25) NOT NULL,
|
||||
`custom7` varchar(25) NOT NULL,
|
||||
`custom8` varchar(25) NOT NULL,
|
||||
`custom9` varchar(25) NOT NULL,
|
||||
`custom10` varchar(25) NOT NULL,
|
||||
PRIMARY KEY (`item_id`),
|
||||
UNIQUE KEY `item_number` (`item_number`),
|
||||
UNIQUE KEY `item_id` (`item_id`),
|
||||
UNIQUE KEY `item_id_2` (`item_id`),
|
||||
UNIQUE KEY `item_number_4` (`item_id`),
|
||||
KEY `ospos_items_ibfk_1` (`supplier_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=17 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_items`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_items` (`name`, `category`, `supplier_id`, `item_number`, `description`, `cost_price`, `unit_price`, `reorder_level`, `location`, `item_id`, `allow_alt_description`, `is_serialized`, `deleted`, `stock_type`, `custom1`, `custom2`, `custom3`, `custom4`, `custom5`, `custom6`, `custom7`, `custom8`, `custom9`, `custom10`) VALUES
|
||||
('Chang beer', 'Drinking', NULL, '01', '', 50.00, 55.00, 5.00, '', 1, 0, 0, 0, 'warehouse', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'),
|
||||
('(Pack) Chang beer', 'Drinking', NULL, '02', '', 6000.00, 6500.00, 1.00, '', 2, 0, 0, 1, 'warehouse', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'),
|
||||
('Chang beer', 'Drinking', NULL, '01', '', 50.00, 60.00, 1.00, '', 12, 0, 0, 1, 'sale_stock', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'),
|
||||
('Sing Ha', 'Drinking', NULL, '04', '', 60.00, 65.00, 1.00, '', 13, 0, 0, 0, 'warehouse', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'),
|
||||
('Tiger beer', 'Drinking', NULL, '05', '', 50.00, 55.00, 1.00, '', 14, 0, 0, 1, 'warehouse', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'),
|
||||
('Tiger beer', 'Drinking', NULL, '05', '', 50.00, 55.00, 1.00, '', 15, 0, 0, 0, 'warehouse', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'),
|
||||
('test', 'Drinking', NULL, '06', '', 100.00, 100.00, 2.00, '', 16, 0, 0, 0, 'warehouse', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0');
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@@ -172,35 +220,32 @@ CREATE TABLE `ospos_items` (
|
||||
-- Table structure for table `ospos_items_taxes`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_items_taxes` (
|
||||
CREATE TABLE IF NOT EXISTS `ospos_items_taxes` (
|
||||
`item_id` int(10) NOT NULL,
|
||||
`name` varchar(255) NOT NULL,
|
||||
`percent` double(15,3) NOT NULL,
|
||||
PRIMARY KEY (`item_id`,`name`,`percent`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_items_taxes`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_item_kits`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_item_kits` (
|
||||
CREATE TABLE IF NOT EXISTS `ospos_item_kits` (
|
||||
`item_kit_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(255) NOT NULL,
|
||||
`description` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`item_kit_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_item_kits`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_item_kits` (`item_kit_id`, `name`, `description`) VALUES
|
||||
(1, '(Pack) Chang beer', '12 bottles of beer');
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@@ -208,7 +253,7 @@ CREATE TABLE `ospos_item_kits` (
|
||||
-- Table structure for table `ospos_item_kit_items`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_item_kit_items` (
|
||||
CREATE TABLE IF NOT EXISTS `ospos_item_kit_items` (
|
||||
`item_kit_id` int(11) NOT NULL,
|
||||
`item_id` int(11) NOT NULL,
|
||||
`quantity` double(15,2) NOT NULL,
|
||||
@@ -220,6 +265,37 @@ CREATE TABLE `ospos_item_kit_items` (
|
||||
-- Dumping data for table `ospos_item_kit_items`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_item_kit_items` (`item_kit_id`, `item_id`, `quantity`) VALUES
|
||||
(1, 1, 12.00);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_item_quantitys`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `ospos_item_quantitys` (
|
||||
`item_quantity_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`item_id` int(11) NOT NULL,
|
||||
`location_id` int(11) NOT NULL,
|
||||
`quantity` int(11) NOT NULL,
|
||||
PRIMARY KEY (`item_quantity_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=69 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_item_quantitys`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_item_quantitys` (`item_quantity_id`, `item_id`, `location_id`, `quantity`) VALUES
|
||||
(60, 1, 4, -1),
|
||||
(61, 1, 6, 3),
|
||||
(62, 1, 7, 6),
|
||||
(63, 13, 4, 10),
|
||||
(64, 13, 6, 19),
|
||||
(65, 13, 7, 30),
|
||||
(66, 15, 4, 40),
|
||||
(67, 15, 6, 50),
|
||||
(68, 15, 7, 60);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@@ -238,46 +314,10 @@ CREATE TABLE IF NOT EXISTS `ospos_item_unit` (
|
||||
-- Dumping data for table `ospos_item_unit`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_requisitions`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `ospos_requisitions` (
|
||||
`requisition_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`employee_id` int(11) NOT NULL DEFAULT '0',
|
||||
`comment` text NOT NULL,
|
||||
`requisition_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (`requisition_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=111 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_requisitions`
|
||||
--
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_requisitions_items`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `ospos_requisitions_items` (
|
||||
`requisition_id` int(10) NOT NULL DEFAULT '0',
|
||||
`item_id` int(11) NOT NULL DEFAULT '0',
|
||||
`line` int(3) NOT NULL,
|
||||
`requisition_quantity` int(10) NOT NULL DEFAULT '0',
|
||||
`related_item_id` int(10) NOT NULL DEFAULT '0',
|
||||
`related_item_quantity` int(11) NOT NULL,
|
||||
`related_item_total_quantity` int(10) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`requisition_id`,`item_id`,`line`),
|
||||
KEY `item_id` (`item_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_requisitions_items`
|
||||
--
|
||||
INSERT INTO `ospos_item_unit` (`item_id`, `unit_quantity`, `related_number`) VALUES
|
||||
(1, 1, '01'),
|
||||
(2, 12, '01'),
|
||||
(12, 1, '01');
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@@ -285,7 +325,7 @@ CREATE TABLE IF NOT EXISTS `ospos_requisitions_items` (
|
||||
-- Table structure for table `ospos_modules`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_modules` (
|
||||
CREATE TABLE IF NOT EXISTS `ospos_modules` (
|
||||
`name_lang_key` varchar(255) NOT NULL,
|
||||
`desc_lang_key` varchar(255) NOT NULL,
|
||||
`sort` int(10) NOT NULL,
|
||||
@@ -317,7 +357,7 @@ INSERT INTO `ospos_modules` (`name_lang_key`, `desc_lang_key`, `sort`, `module_i
|
||||
-- Table structure for table `ospos_people`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_people` (
|
||||
CREATE TABLE IF NOT EXISTS `ospos_people` (
|
||||
`first_name` varchar(255) NOT NULL,
|
||||
`last_name` varchar(255) NOT NULL,
|
||||
`phone_number` varchar(255) NOT NULL,
|
||||
@@ -346,7 +386,7 @@ INSERT INTO `ospos_people` (`first_name`, `last_name`, `phone_number`, `email`,
|
||||
-- Table structure for table `ospos_permissions`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_permissions` (
|
||||
CREATE TABLE IF NOT EXISTS `ospos_permissions` (
|
||||
`module_id` varchar(255) NOT NULL,
|
||||
`person_id` int(10) NOT NULL,
|
||||
PRIMARY KEY (`module_id`,`person_id`),
|
||||
@@ -375,7 +415,7 @@ INSERT INTO `ospos_permissions` (`module_id`, `person_id`) VALUES
|
||||
-- Table structure for table `ospos_receivings`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_receivings` (
|
||||
CREATE TABLE IF NOT EXISTS `ospos_receivings` (
|
||||
`receiving_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`supplier_id` int(10) DEFAULT NULL,
|
||||
`employee_id` int(10) NOT NULL DEFAULT '0',
|
||||
@@ -385,12 +425,25 @@ CREATE TABLE `ospos_receivings` (
|
||||
PRIMARY KEY (`receiving_id`),
|
||||
KEY `supplier_id` (`supplier_id`),
|
||||
KEY `employee_id` (`employee_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=15 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_receivings`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_receivings` (`receiving_time`, `supplier_id`, `employee_id`, `comment`, `receiving_id`, `payment_type`) VALUES
|
||||
('2014-06-17 17:09:02', NULL, 1, '', 1, 'Cash'),
|
||||
('2014-06-17 17:10:40', NULL, 1, '', 2, 'Cash'),
|
||||
('2014-06-22 09:57:57', NULL, 1, '', 3, 'Cash'),
|
||||
('2014-06-22 09:59:54', NULL, 1, '', 4, 'Cash'),
|
||||
('2014-06-22 11:20:34', NULL, 1, '', 7, 'Cash'),
|
||||
('2014-06-22 11:22:28', NULL, 1, '', 8, 'Cash'),
|
||||
('2014-06-22 11:24:33', NULL, 1, '', 9, 'Cash'),
|
||||
('2014-06-23 17:18:55', NULL, 1, '', 10, 'Cash'),
|
||||
('2014-06-23 17:19:52', NULL, 1, '', 11, 'Cash'),
|
||||
('2014-06-23 17:23:01', NULL, 1, '', 12, 'Cash'),
|
||||
('2014-06-23 17:26:49', NULL, 1, '', 13, 'Cash'),
|
||||
('2014-06-23 17:27:31', NULL, 1, '', 14, 'Cash');
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@@ -398,7 +451,7 @@ CREATE TABLE `ospos_receivings` (
|
||||
-- Table structure for table `ospos_receivings_items`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_receivings_items` (
|
||||
CREATE TABLE IF NOT EXISTS `ospos_receivings_items` (
|
||||
`receiving_id` int(10) NOT NULL DEFAULT '0',
|
||||
`item_id` int(10) NOT NULL DEFAULT '0',
|
||||
`description` varchar(30) DEFAULT NULL,
|
||||
@@ -416,6 +469,73 @@ CREATE TABLE `ospos_receivings_items` (
|
||||
-- Dumping data for table `ospos_receivings_items`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_receivings_items` (`receiving_id`, `item_id`, `description`, `serialnumber`, `line`, `quantity_purchased`, `item_cost_price`, `item_unit_price`, `discount_percent`) VALUES
|
||||
(1, 1, '', '0', 1, 50, '50.00', 50.00, 0),
|
||||
(2, 1, '', '0', 1, -2, '50.00', 50.00, 0),
|
||||
(3, 1, '', '0', 1, 10, '50.00', 50.00, 0),
|
||||
(4, 1, '', '0', 1, 10, '50.00', 50.00, 0),
|
||||
(7, 13, '', '0', 1, 2, '60.00', 60.00, 0),
|
||||
(8, 13, '', '0', 1, 2, '60.00', 60.00, 0),
|
||||
(9, 1, '', '0', 1, 4, '50.00', 50.00, 0),
|
||||
(9, 13, '', '0', 2, 2, '60.00', 60.00, 0),
|
||||
(10, 1, '', '0', 1, 3, '50.00', 50.00, 0),
|
||||
(11, 1, '', '', 1, 1, '50.00', 50.00, 0),
|
||||
(12, 1, '', '', 1, 1, '50.00', 50.00, 0),
|
||||
(13, 1, '', '', 1, 1, '50.00', 50.00, 0),
|
||||
(14, 1, '', '', 1, 1, '50.00', 50.00, 0);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_requisitions`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `ospos_requisitions` (
|
||||
`requisition_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`employee_id` int(11) NOT NULL DEFAULT '0',
|
||||
`comment` text NOT NULL,
|
||||
`requisition_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (`requisition_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=11 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_requisitions`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_requisitions` (`requisition_time`, `employee_id`, `comment`, `requisition_id`) VALUES
|
||||
('2014-06-17 15:57:59', 1, '', 7),
|
||||
('2014-06-17 16:09:07', 1, '', 8),
|
||||
('2014-06-17 16:10:58', 1, '', 9),
|
||||
('2014-06-17 16:40:03', 1, '', 10);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_requisitions_items`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `ospos_requisitions_items` (
|
||||
`requisition_id` int(10) NOT NULL DEFAULT '0',
|
||||
`item_id` int(11) NOT NULL DEFAULT '0',
|
||||
`line` int(3) NOT NULL,
|
||||
`requisition_quantity` int(10) NOT NULL DEFAULT '0',
|
||||
`related_item_id` int(10) NOT NULL DEFAULT '0',
|
||||
`related_item_quantity` int(11) NOT NULL,
|
||||
`related_item_total_quantity` int(10) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`requisition_id`,`item_id`,`line`),
|
||||
KEY `item_id` (`item_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_requisitions_items`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_requisitions_items` (`requisition_id`, `item_id`, `line`, `requisition_quantity`, `related_item_id`, `related_item_quantity`, `related_item_total_quantity`) VALUES
|
||||
(7, 2, 1, 2, 12, 12, 24),
|
||||
(8, 1, 2, 10, 12, 1, 10),
|
||||
(8, 2, 1, 1, 12, 12, 12),
|
||||
(9, 1, 1, 4, 12, 1, 4),
|
||||
(10, 1, 1, 1, 12, 1, 1);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@@ -423,7 +543,7 @@ CREATE TABLE `ospos_receivings_items` (
|
||||
-- Table structure for table `ospos_sales`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_sales` (
|
||||
CREATE TABLE IF NOT EXISTS `ospos_sales` (
|
||||
`sale_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`customer_id` int(10) DEFAULT NULL,
|
||||
`employee_id` int(10) NOT NULL DEFAULT '0',
|
||||
@@ -433,12 +553,30 @@ CREATE TABLE `ospos_sales` (
|
||||
PRIMARY KEY (`sale_id`),
|
||||
KEY `customer_id` (`customer_id`),
|
||||
KEY `employee_id` (`employee_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=26 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_sales`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_sales` (`sale_time`, `customer_id`, `employee_id`, `comment`, `sale_id`, `payment_type`) VALUES
|
||||
('2014-06-22 06:18:43', NULL, 1, '0', 1, 'Cash: $480.00<br />'),
|
||||
('2014-06-22 06:46:30', NULL, 1, '0', 2, 'Cash: $480.00<br />'),
|
||||
('2014-06-22 06:54:07', NULL, 1, '0', 3, 'Cash: $480.00<br />'),
|
||||
('2014-06-22 06:56:13', NULL, 1, '0', 4, 'Cash: $55.00<br />'),
|
||||
('2014-06-22 13:21:14', NULL, 1, '0', 5, 'Cash: $480.00<br />'),
|
||||
('2014-06-22 13:31:30', NULL, 1, '0', 6, 'Cash: $480.00<br />'),
|
||||
('2014-06-22 14:05:37', NULL, 1, '0', 7, 'Cash: $480.00<br />'),
|
||||
('2014-06-22 14:07:33', NULL, 1, '0', 8, 'Cash: $260.00<br />'),
|
||||
('2014-06-23 03:57:39', NULL, 1, '0', 9, 'Cash: $285.00<br />'),
|
||||
('2014-06-23 04:00:37', NULL, 1, '0', 10, 'Cash: $65.00<br />'),
|
||||
('2014-06-23 04:04:30', NULL, 1, '0', 13, 'Cash: $55.00<br />'),
|
||||
('2014-06-23 04:16:29', NULL, 1, '0', 14, 'Cash: -$55.00<br />'),
|
||||
('2014-06-23 04:18:18', NULL, 1, '0', 15, 'Cash: $55.00<br />'),
|
||||
('2014-06-23 05:34:09', NULL, 1, '0', 16, 'Cash: $55.00<br />'),
|
||||
('2014-06-25 03:00:07', NULL, 1, '0', 23, 'Cash: $2750.00<br />'),
|
||||
('2014-06-25 13:41:20', NULL, 1, '0', 24, 'Cash: $110.00<br />'),
|
||||
('2014-07-01 17:10:02', NULL, 1, '0', 25, 'Cash: $175.00<br />');
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@@ -446,7 +584,7 @@ CREATE TABLE `ospos_sales` (
|
||||
-- Table structure for table `ospos_sales_items`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_sales_items` (
|
||||
CREATE TABLE IF NOT EXISTS `ospos_sales_items` (
|
||||
`sale_id` int(10) NOT NULL DEFAULT '0',
|
||||
`item_id` int(10) NOT NULL DEFAULT '0',
|
||||
`description` varchar(30) DEFAULT NULL,
|
||||
@@ -464,6 +602,32 @@ CREATE TABLE `ospos_sales_items` (
|
||||
-- Dumping data for table `ospos_sales_items`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_sales_items` (`sale_id`, `item_id`, `description`, `serialnumber`, `line`, `quantity_purchased`, `item_cost_price`, `item_unit_price`, `discount_percent`) VALUES
|
||||
(1, 1, '', '', 1, 4.00, '50.00', 55.00, 0),
|
||||
(1, 13, '', '', 2, 4.00, '60.00', 65.00, 0),
|
||||
(2, 1, '', '', 1, 4.00, '50.00', 55.00, 0),
|
||||
(2, 13, '', '', 2, 4.00, '60.00', 65.00, 0),
|
||||
(3, 1, '', '', 1, 4.00, '50.00', 55.00, 0),
|
||||
(3, 13, '', '', 2, 4.00, '60.00', 65.00, 0),
|
||||
(4, 1, '', '', 1, 1.00, '50.00', 55.00, 0),
|
||||
(5, 1, '', '', 1, 4.00, '50.00', 55.00, 0),
|
||||
(5, 13, '', '', 2, 4.00, '60.00', 65.00, 0),
|
||||
(6, 1, '', '', 1, 4.00, '50.00', 55.00, 0),
|
||||
(6, 13, '', '', 2, 4.00, '60.00', 65.00, 0),
|
||||
(7, 1, '', '', 1, 4.00, '50.00', 55.00, 0),
|
||||
(7, 13, '', '', 2, 4.00, '60.00', 65.00, 0),
|
||||
(8, 13, '', '', 1, 4.00, '60.00', 65.00, 0),
|
||||
(9, 1, '', '', 1, 4.00, '50.00', 55.00, 0),
|
||||
(9, 13, '', '', 2, 1.00, '60.00', 65.00, 0),
|
||||
(10, 13, '', '', 1, 1.00, '60.00', 65.00, 0),
|
||||
(13, 1, '', '', 1, 1.00, '50.00', 55.00, 0),
|
||||
(14, 1, '', '', 1, -1.00, '50.00', 55.00, 0),
|
||||
(15, 1, '', '', 1, 1.00, '50.00', 55.00, 0),
|
||||
(16, 1, '', '', 1, 1.00, '50.00', 55.00, 0),
|
||||
(23, 1, '', '', 1, 50.00, '50.00', 55.00, 0),
|
||||
(24, 1, '', '', 2, 2.00, '50.00', 55.00, 0),
|
||||
(25, 1, '', '', 2, 2.00, '50.00', 55.00, 0),
|
||||
(25, 13, '', '', 1, 1.00, '60.00', 65.00, 0);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@@ -471,7 +635,7 @@ CREATE TABLE `ospos_sales_items` (
|
||||
-- Table structure for table `ospos_sales_items_taxes`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_sales_items_taxes` (
|
||||
CREATE TABLE IF NOT EXISTS `ospos_sales_items_taxes` (
|
||||
`sale_id` int(10) NOT NULL,
|
||||
`item_id` int(10) NOT NULL,
|
||||
`line` int(3) NOT NULL DEFAULT '0',
|
||||
@@ -481,18 +645,13 @@ CREATE TABLE `ospos_sales_items_taxes` (
|
||||
KEY `item_id` (`item_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_sales_items_taxes`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_sales_payments`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_sales_payments` (
|
||||
CREATE TABLE IF NOT EXISTS `ospos_sales_payments` (
|
||||
`sale_id` int(10) NOT NULL,
|
||||
`payment_type` varchar(40) NOT NULL,
|
||||
`payment_amount` decimal(15,2) NOT NULL,
|
||||
@@ -503,6 +662,24 @@ CREATE TABLE `ospos_sales_payments` (
|
||||
-- Dumping data for table `ospos_sales_payments`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_sales_payments` (`sale_id`, `payment_type`, `payment_amount`) VALUES
|
||||
(1, 'Cash', '480.00'),
|
||||
(2, 'Cash', '480.00'),
|
||||
(3, 'Cash', '480.00'),
|
||||
(4, 'Cash', '55.00'),
|
||||
(5, 'Cash', '480.00'),
|
||||
(6, 'Cash', '480.00'),
|
||||
(7, 'Cash', '480.00'),
|
||||
(8, 'Cash', '260.00'),
|
||||
(9, 'Cash', '285.00'),
|
||||
(10, 'Cash', '65.00'),
|
||||
(13, 'Cash', '55.00'),
|
||||
(14, 'Cash', '-55.00'),
|
||||
(15, 'Cash', '55.00'),
|
||||
(16, 'Cash', '55.00'),
|
||||
(23, 'Cash', '2750.00'),
|
||||
(24, 'Cash', '110.00'),
|
||||
(25, 'Cash', '175.00');
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@@ -510,7 +687,7 @@ CREATE TABLE `ospos_sales_payments` (
|
||||
-- Table structure for table `ospos_sales_suspended`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_sales_suspended` (
|
||||
CREATE TABLE IF NOT EXISTS `ospos_sales_suspended` (
|
||||
`sale_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`customer_id` int(10) DEFAULT NULL,
|
||||
`employee_id` int(10) NOT NULL DEFAULT '0',
|
||||
@@ -522,18 +699,13 @@ CREATE TABLE `ospos_sales_suspended` (
|
||||
KEY `employee_id` (`employee_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_sales_suspended`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_sales_suspended_items`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_sales_suspended_items` (
|
||||
CREATE TABLE IF NOT EXISTS `ospos_sales_suspended_items` (
|
||||
`sale_id` int(10) NOT NULL DEFAULT '0',
|
||||
`item_id` int(10) NOT NULL DEFAULT '0',
|
||||
`description` varchar(30) DEFAULT NULL,
|
||||
@@ -547,18 +719,13 @@ CREATE TABLE `ospos_sales_suspended_items` (
|
||||
KEY `item_id` (`item_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_sales_suspended_items`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_sales_suspended_items_taxes`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_sales_suspended_items_taxes` (
|
||||
CREATE TABLE IF NOT EXISTS `ospos_sales_suspended_items_taxes` (
|
||||
`sale_id` int(10) NOT NULL,
|
||||
`item_id` int(10) NOT NULL,
|
||||
`line` int(3) NOT NULL DEFAULT '0',
|
||||
@@ -568,36 +735,26 @@ CREATE TABLE `ospos_sales_suspended_items_taxes` (
|
||||
KEY `item_id` (`item_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_sales_suspended_items_taxes`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_sales_suspended_payments`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_sales_suspended_payments` (
|
||||
CREATE TABLE IF NOT EXISTS `ospos_sales_suspended_payments` (
|
||||
`sale_id` int(10) NOT NULL,
|
||||
`payment_type` varchar(40) NOT NULL,
|
||||
`payment_amount` decimal(15,2) NOT NULL,
|
||||
PRIMARY KEY (`sale_id`,`payment_type`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_sales_suspended_payments`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_sessions`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_sessions` (
|
||||
CREATE TABLE IF NOT EXISTS `ospos_sessions` (
|
||||
`session_id` varchar(40) NOT NULL DEFAULT '0',
|
||||
`ip_address` varchar(45) NOT NULL DEFAULT '0',
|
||||
`user_agent` varchar(120) NOT NULL,
|
||||
@@ -610,6 +767,37 @@ CREATE TABLE `ospos_sessions` (
|
||||
-- Dumping data for table `ospos_sessions`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_sessions` (`session_id`, `ip_address`, `user_agent`, `last_activity`, `user_data`) VALUES
|
||||
('48a2db903a522a52236bafa2466d941f', '0.0.0.0', 'Mozilla/5.0 (Windows NT 6.2; rv:30.0) Gecko/20100101 Firefox/30.0 FirePHP/0.7.4', 1403454059, 'a:9:{s:9:"user_data";s:0:"";s:9:"person_id";s:1:"1";s:9:"recv_mode";s:6:"stockA";s:8:"supplier";i:-1;s:9:"sale_mode";b:0;s:4:"cart";a:0:{}s:8:"customer";i:-1;s:8:"payments";a:0:{}s:8:"cartRecv";a:0:{}}'),
|
||||
('bc68acd9512665d9fa88cb32a0c5cc9d', '0.0.0.0', 'Mozilla/5.0 (Windows NT 6.2; rv:30.0) Gecko/20100101 Firefox/30.0', 1403624516, 'a:12:{s:9:"user_data";s:0:"";s:9:"person_id";s:1:"1";s:13:"sale_location";s:7:"stock_7";s:9:"sale_mode";s:4:"sale";s:4:"cart";a:1:{i:1;a:11:{s:7:"item_id";s:1:"1";s:4:"line";i:1;s:4:"name";s:10:"Chang beer";s:11:"item_number";s:2:"01";s:11:"description";s:0:"";s:12:"serialnumber";s:0:"";s:21:"allow_alt_description";s:1:"0";s:13:"is_serialized";s:1:"0";s:8:"quantity";i:2;s:8:"discount";i:0;s:5:"price";s:5:"55.00";}}s:8:"customer";i:-1;s:8:"payments";a:0:{}s:9:"recv_mode";s:6:"return";s:17:"recv_stock_source";s:7:"stock_6";s:22:"recv_stock_destination";s:7:"stock_4";s:8:"supplier";i:-1;s:8:"cartRecv";a:0:{}}'),
|
||||
('bf7ea1962265e53d4c6ad896b14cb702', '0.0.0.0', 'Mozilla/5.0 (Windows NT 6.2; rv:30.0) Gecko/20100101 Firefox/30.0 FirePHP/0.7.4', 1404201007, 'a:12:{s:9:"user_data";s:0:"";s:9:"person_id";s:1:"1";s:9:"recv_mode";s:7:"receive";s:17:"recv_stock_source";s:7:"stock_4";s:22:"recv_stock_destination";s:7:"stock_4";s:13:"sale_location";s:7:"stock_6";s:8:"supplier";i:-1;s:8:"cartRecv";a:0:{}s:4:"cart";a:0:{}s:9:"sale_mode";s:4:"sale";s:8:"customer";i:-1;s:8:"payments";a:0:{}}'),
|
||||
('c51abb8d7500cd47aa11a90c2f748a65', '0.0.0.0', 'Mozilla/5.0 (Windows NT 6.2; rv:30.0) Gecko/20100101 Firefox/30.0 FirePHP/0.7.4', 1403702064, 'a:12:{s:9:"user_data";s:0:"";s:9:"person_id";s:1:"1";s:13:"sale_location";s:7:"stock_7";s:9:"recv_mode";s:7:"receive";s:17:"recv_stock_source";s:7:"stock_4";s:22:"recv_stock_destination";s:7:"stock_4";s:8:"supplier";i:-1;s:8:"cartRecv";a:0:{}s:9:"sale_mode";s:4:"sale";s:4:"cart";a:0:{}s:8:"customer";i:-1;s:8:"payments";a:0:{}}'),
|
||||
('c7739efbefa39eef2422d0d0e68e6741', '0.0.0.0', 'Mozilla/5.0 (Windows NT 6.2; rv:30.0) Gecko/20100101 Firefox/30.0', 1403460585, ''),
|
||||
('da0595ba7dbcb49c52fa2d30aa1c5618', '0.0.0.0', 'Mozilla/5.0 (Windows NT 6.2; rv:29.0) Gecko/20100101 Firefox/29.0', 1403017869, 'a:3:{s:9:"user_data";s:0:"";s:9:"person_id";s:1:"1";s:9:"recv_mode";s:6:"return";}');
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_stock_locations`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `ospos_stock_locations` (
|
||||
`location_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`location_name` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
|
||||
`deleted` int(1) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`location_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_stock_locations`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_stock_locations` (`location_id`, `location_name`, `deleted`) VALUES
|
||||
(3, 'stockC', 1),
|
||||
(4, 'stockA', 0),
|
||||
(5, 'stockB', 1),
|
||||
(6, 'stockD', 0),
|
||||
(7, 'stockE', 0);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@@ -617,7 +805,7 @@ CREATE TABLE `ospos_sessions` (
|
||||
-- Table structure for table `ospos_suppliers`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_suppliers` (
|
||||
CREATE TABLE IF NOT EXISTS `ospos_suppliers` (
|
||||
`person_id` int(10) NOT NULL,
|
||||
`company_name` varchar(255) NOT NULL,
|
||||
`account_number` varchar(255) DEFAULT NULL,
|
||||
@@ -626,11 +814,6 @@ CREATE TABLE `ospos_suppliers` (
|
||||
KEY `person_id` (`person_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_suppliers`
|
||||
--
|
||||
|
||||
|
||||
--
|
||||
-- Constraints for dumped tables
|
||||
--
|
||||
@@ -671,7 +854,13 @@ ALTER TABLE `ospos_items_taxes`
|
||||
--
|
||||
ALTER TABLE `ospos_item_kit_items`
|
||||
ADD CONSTRAINT `ospos_item_kit_items_ibfk_1` FOREIGN KEY (`item_kit_id`) REFERENCES `ospos_item_kits` (`item_kit_id`) ON DELETE CASCADE,
|
||||
ADD CONSTRAINT `ospos_item_kit_items_ibfk_2` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`) ON DELETE CASCADE;
|
||||
ADD CONSTRAINT `ospos_item_kit_items_ibfk_2` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`) ON DELETE CASCADE;
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_item_unit`
|
||||
--
|
||||
ALTER TABLE `ospos_item_unit`
|
||||
ADD CONSTRAINT `ospos_item_unit_ibfk_1` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`) ON DELETE CASCADE;
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_permissions`
|
||||
@@ -694,6 +883,13 @@ ALTER TABLE `ospos_receivings_items`
|
||||
ADD CONSTRAINT `ospos_receivings_items_ibfk_1` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`),
|
||||
ADD CONSTRAINT `ospos_receivings_items_ibfk_2` FOREIGN KEY (`receiving_id`) REFERENCES `ospos_receivings` (`receiving_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_requisitions_items`
|
||||
--
|
||||
ALTER TABLE `ospos_requisitions_items`
|
||||
ADD CONSTRAINT `ospos_requisitions_items_ibfk_1` FOREIGN KEY (`requisition_id`) REFERENCES `ospos_requisitions` (`requisition_id`) ON DELETE CASCADE,
|
||||
ADD CONSTRAINT `ospos_requisitions_items_ibfk_2` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_sales`
|
||||
--
|
||||
@@ -748,20 +944,12 @@ ALTER TABLE `ospos_sales_suspended_items_taxes`
|
||||
ALTER TABLE `ospos_sales_suspended_payments`
|
||||
ADD CONSTRAINT `ospos_sales_suspended_payments_ibfk_1` FOREIGN KEY (`sale_id`) REFERENCES `ospos_sales_suspended` (`sale_id`) ON DELETE CASCADE;
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_requisitions_items
|
||||
ALTER TABLE `ospos_requisitions_items`
|
||||
ADD CONSTRAINT `ospos_requisitions_items_ibfk_1` FOREIGN KEY (`requisition_id`) REFERENCES `ospos_requisitions` (`requisition_id`) ON DELETE CASCADE,
|
||||
ADD CONSTRAINT `ospos_requisitions_items_ibfk_2` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_item_unit`
|
||||
--
|
||||
ALTER TABLE `ospos_item_unit`
|
||||
ADD CONSTRAINT `ospos_item_unit_ibfk_1` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`) ON DELETE CASCADE;
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_suppliers`
|
||||
--
|
||||
ALTER TABLE `ospos_suppliers`
|
||||
ADD CONSTRAINT `ospos_suppliers_ibfk_1` FOREIGN KEY (`person_id`) REFERENCES `ospos_people` (`person_id`);
|
||||
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
|
||||
Reference in New Issue
Block a user