mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-04-29 03:15:58 -04:00
Add item attributes functionality (#68)
This commit is contained in:
@@ -132,4 +132,4 @@ $autoload['language'] = array();
|
||||
|
|
||||
| $autoload['model'] = array('first_model' => 'first');
|
||||
*/
|
||||
$autoload['model'] = array('Appconfig', 'Person', 'Customer', 'Employee', 'Module', 'Item', 'Item_taxes', 'Sale', 'Supplier', 'Inventory', 'Receiving', 'Giftcard', 'Item_kit', 'Item_kit_items', 'Stock_location', 'Item_quantity', 'Dinner_table', 'Customer_rewards', 'Rewards', 'Tax', 'Expense_category', 'Expense', 'Cashup');
|
||||
$autoload['model'] = array('Appconfig', 'Person', 'Customer', 'Employee', 'Module', 'Item', 'Item_taxes', 'Sale', 'Supplier', 'Inventory', 'Receiving', 'Giftcard', 'Item_kit', 'Item_kit_items', 'Stock_location', 'Item_quantity', 'Dinner_table', 'Customer_rewards', 'Rewards', 'Tax', 'Expense_category', 'Expense', 'Cashup', 'Attribute');
|
||||
|
||||
195
application/controllers/Attributes.php
Normal file
195
application/controllers/Attributes.php
Normal file
@@ -0,0 +1,195 @@
|
||||
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once("Secure_Controller.php");
|
||||
|
||||
class Attributes extends Secure_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct('attributes');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$data['table_headers'] = $this->xss_clean(get_attribute_definition_manage_table_headers());
|
||||
|
||||
$this->load->view('attributes/manage', $data);
|
||||
}
|
||||
|
||||
/*
|
||||
Returns customer table data rows. This will be called with AJAX.
|
||||
*/
|
||||
public function search()
|
||||
{
|
||||
$search = $this->input->get('search');
|
||||
$limit = $this->input->get('limit');
|
||||
$offset = $this->input->get('offset');
|
||||
$sort = $this->input->get('sort');
|
||||
$order = $this->input->get('order');
|
||||
|
||||
$attributes = $this->Attribute->search($search, $limit, $offset, $sort, $order);
|
||||
$total_rows = $this->Attribute->get_found_rows($search);
|
||||
|
||||
$data_rows = array();
|
||||
foreach($attributes->result() as $attribute)
|
||||
{
|
||||
$attribute->definition_flags = $this->_get_attributes($attribute->definition_flags);
|
||||
$data_rows[] = get_attribute_definition_data_row($attribute, $this);
|
||||
}
|
||||
|
||||
$data_rows = $this->xss_clean($data_rows);
|
||||
|
||||
echo json_encode(array('total' => $total_rows, 'rows' => $data_rows));
|
||||
}
|
||||
|
||||
public function save_attribute_link($item_id)
|
||||
{
|
||||
if (!empty($this->input->post('attribute_id')))
|
||||
{
|
||||
$success = $this->Attribute->save_link($item_id, $this->input->post('definition_id'), $this->input->post('attribute_id'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$success = $this->Attribute->set_selected_category($item_id, $this->input->post('definition_id'));
|
||||
}
|
||||
|
||||
echo json_encode(array('success' => $success));
|
||||
}
|
||||
|
||||
public function delete_attribute_link($item_id)
|
||||
{
|
||||
$success = $this->Attribute->delete_link($item_id);
|
||||
|
||||
echo json_encode(array('success' => $success));
|
||||
}
|
||||
|
||||
public function save_attribute_value($attribute_value)
|
||||
{
|
||||
$success = $this->Attribute->save_value($attribute_value, $this->input->post('definition_id'), $this->input->post('item_id'), $this->input->post('attribute_id'));
|
||||
|
||||
echo json_encode(array('success' => $success));
|
||||
}
|
||||
|
||||
public function delete_attribute_value($attribute_value)
|
||||
{
|
||||
$success = $this->Attribute->delete_value($attribute_value, $this->input->post('$definition_id'));
|
||||
|
||||
echo json_encode(array('success' => $success));
|
||||
}
|
||||
|
||||
public function save_definition($definition_id = -1)
|
||||
{
|
||||
$definition_flags = 0;
|
||||
foreach($this->input->post('definition_flags') as $flag)
|
||||
{
|
||||
$definition_flags |= $flag;
|
||||
}
|
||||
|
||||
//Save definition data
|
||||
$definition_data = array(
|
||||
'definition_name' => $this->input->post('definition_name'),
|
||||
'definition_type' => DEFINITION_TYPES[$this->input->post('definition_type')],
|
||||
'definition_flags' => $definition_flags,
|
||||
'definition_fk' => $this->input->post('definition_parent') != '' ? $this->input->post('definition_parent') : NULL
|
||||
);
|
||||
|
||||
$definition_name = $this->xss_clean($definition_data['definition_name']);
|
||||
|
||||
if($this->Attribute->save_definition($definition_data, $definition_id))
|
||||
{
|
||||
//New definition
|
||||
if($definition_id == -1)
|
||||
{
|
||||
$definition_values = json_decode($this->input->post('definition_values'));
|
||||
|
||||
foreach($definition_values as $definition_value)
|
||||
{
|
||||
$this->Attribute->save_value($definition_value, $definition_data['definition_id']);
|
||||
}
|
||||
|
||||
echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('attributes_definition_successful_adding').' '.
|
||||
$definition_name, 'id' => $definition_data['definition_id']));
|
||||
}
|
||||
else //Existing definition
|
||||
{
|
||||
echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('attributes_definition_successful_updating').' '.
|
||||
$definition_name, 'id' => $definition_id));
|
||||
}
|
||||
}
|
||||
else//failure
|
||||
{
|
||||
echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('attribute_definitions_error_adding_updating').' '.
|
||||
$definition_name, 'id' => -1));
|
||||
}
|
||||
}
|
||||
|
||||
public function suggest_attribute($definition_id)
|
||||
{
|
||||
$suggestions = $this->xss_clean($this->Attribute->get_suggestions($definition_id, $this->input->get('term')));
|
||||
|
||||
echo json_encode($suggestions);
|
||||
}
|
||||
|
||||
public function get_row($row_id)
|
||||
{
|
||||
$attribute_definition_info = $this->Attribute->get_info($row_id);
|
||||
$attribute_definition_info->definition_flags = $this->_get_attributes($attribute_definition_info->definition_flags);
|
||||
$data_row = $this->xss_clean(get_attribute_definition_data_row($attribute_definition_info));
|
||||
|
||||
echo json_encode($data_row);
|
||||
}
|
||||
|
||||
private function _get_attributes($definition_flags = 0)
|
||||
{
|
||||
$definition_flag_names = array();
|
||||
foreach (Attribute::get_definition_flags() as $id => $term)
|
||||
{
|
||||
if (empty($definition_flags) || ($id & $definition_flags))
|
||||
{
|
||||
$definition_flag_names[$id] = $this->lang->line('attributes_' . strtolower($term) . '_visibility');
|
||||
}
|
||||
}
|
||||
return $definition_flag_names;
|
||||
}
|
||||
|
||||
public function view($definition_id = -1)
|
||||
{
|
||||
$info = $this->Attribute->get_info($definition_id);
|
||||
foreach(get_object_vars($info) as $property => $value)
|
||||
{
|
||||
$info->$property = $this->xss_clean($value);
|
||||
}
|
||||
|
||||
$data['definition_id'] = $definition_id;
|
||||
$data['definition_values'] = $this->Attribute->get_definition_values($definition_id);
|
||||
$data['definition_parent'] = $this->Attribute->get_definitions_by_type(CATEGORY, $definition_id);
|
||||
$data['definition_parent'][''] = $this->lang->line('common_none_selected_text');
|
||||
$data['definition_info'] = $info;
|
||||
|
||||
$data['definition_flags'] = $this->_get_attributes();
|
||||
$data['selected_definition_flags'] = $this->_get_attributes($info->definition_flags);
|
||||
|
||||
$this->load->view("attributes/form", $data);
|
||||
}
|
||||
|
||||
public function delete_value($attribute_id)
|
||||
{
|
||||
return $this->Attribute->delete_value($attribute_id);
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
$attributes_to_delete = $this->input->post('ids');
|
||||
|
||||
if($this->Attribute->delete_definition_list($attributes_to_delete))
|
||||
{
|
||||
$message = $this->lang->line('attributes_definition_successful_deleted') . ' ' . count($attributes_to_delete) . ' ' . $this->lang->line('attributes_definition_one_or_multiple');
|
||||
echo json_encode(array('success' => TRUE, 'message' => $message));
|
||||
}
|
||||
else
|
||||
{
|
||||
echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('attributes_definition_cannot_be_deleted')));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -299,18 +299,8 @@ class Config extends Secure_Controller
|
||||
'suggestions_second_column' => $this->input->post('suggestions_second_column'),
|
||||
'suggestions_third_column' => $this->input->post('suggestions_third_column'),
|
||||
'giftcard_number' => $this->input->post('giftcard_number'),
|
||||
'derive_sale_quantity' => $this->input->post('derive_sale_quantity') != NULL,
|
||||
'derive_sale_quantity' => $this->input->post('derive_sale_quantity') != NULL
|
||||
'multi_pack_enabled' => $this->input->post('multi_pack_enabled') != NULL,
|
||||
'custom1_name' => $this->input->post('custom1_name'),
|
||||
'custom2_name' => $this->input->post('custom2_name'),
|
||||
'custom3_name' => $this->input->post('custom3_name'),
|
||||
'custom4_name' => $this->input->post('custom4_name'),
|
||||
'custom5_name' => $this->input->post('custom5_name'),
|
||||
'custom6_name' => $this->input->post('custom6_name'),
|
||||
'custom7_name' => $this->input->post('custom7_name'),
|
||||
'custom8_name' => $this->input->post('custom8_name'),
|
||||
'custom9_name' => $this->input->post('custom9_name'),
|
||||
'custom10_name' => $this->input->post('custom10_name')
|
||||
);
|
||||
|
||||
$this->Module->set_show_office_group($this->input->post('show_office_group') != NULL);
|
||||
|
||||
@@ -25,7 +25,7 @@ class Items extends Secure_Controller
|
||||
'low_inventory' => $this->lang->line('items_low_inventory_items'),
|
||||
'is_serialized' => $this->lang->line('items_serialized_items'),
|
||||
'no_description' => $this->lang->line('items_no_description_items'),
|
||||
'search_custom' => $this->lang->line('items_search_custom_items'),
|
||||
'search_custom' => $this->lang->line('items_search_attributes'),
|
||||
'is_deleted' => $this->lang->line('items_is_deleted'),
|
||||
'temporary' => $this->lang->line('items_temp'));
|
||||
|
||||
@@ -164,16 +164,6 @@ class Items extends Secure_Controller
|
||||
|
||||
echo json_encode($suggestions);
|
||||
}
|
||||
|
||||
/*
|
||||
Gives search suggestions based on what is being searched for
|
||||
*/
|
||||
public function suggest_custom()
|
||||
{
|
||||
$suggestions = $this->xss_clean($this->Item->get_custom_suggestions($this->input->post('term'), $this->input->post('field_no')));
|
||||
|
||||
echo json_encode($suggestions);
|
||||
}
|
||||
|
||||
public function get_row($item_ids)
|
||||
{
|
||||
@@ -201,6 +191,12 @@ class Items extends Secure_Controller
|
||||
$data['default_tax_1_rate'] = '';
|
||||
$data['default_tax_2_rate'] = '';
|
||||
$data['item_kits_enabled'] = $this->Employee->has_grant('item_kits', $this->Employee->get_logged_in_employee_info()->person_id);
|
||||
$data['definition_values'] = $this->Attribute->get_attributes_by_item($item_id);
|
||||
$categories = array(-1 => $this->lang->line('common_none_selected_text'));
|
||||
$categories = $categories + $this->Attribute->get_definitions_by_type(CATEGORY);
|
||||
$selected_category = $this->Attribute->get_selected_category($item_id);
|
||||
$data['selected_category'] = empty($selected_category) ? NULL : $selected_category->definition_id;
|
||||
$data['categories'] = $categories;
|
||||
|
||||
$item_info = $this->Item->get_info($item_id);
|
||||
foreach(get_object_vars($item_info) as $property => $value)
|
||||
@@ -235,6 +231,7 @@ class Items extends Secure_Controller
|
||||
$item_info->receiving_quantity = 1;
|
||||
$item_info->reorder_level = 1;
|
||||
$item_info->item_type = ITEM; // standard
|
||||
$item_info->item_id = $item_id;
|
||||
$item_info->stock_type = HAS_STOCK;
|
||||
$item_info->tax_category_id = 1; // Standard
|
||||
$item_info->qty_per_pack = 1;
|
||||
@@ -389,6 +386,13 @@ class Items extends Secure_Controller
|
||||
$this->load->view('barcodes/barcode_sheet', $data);
|
||||
}
|
||||
|
||||
public function attributes($item_id, $definition_id)
|
||||
{
|
||||
$data['item_id'] = $item_id;
|
||||
$data['definition_values'] = $this->Attribute->get_values_by_parent($definition_id);
|
||||
$this->load->view('attributes/item', $data);
|
||||
}
|
||||
|
||||
public function bulk_edit()
|
||||
{
|
||||
$suppliers = array('' => $this->lang->line('items_none'));
|
||||
@@ -444,17 +448,7 @@ class Items extends Secure_Controller
|
||||
'qty_per_pack' => $this->input->post('qty_per_pack') == NULL ? 1 : $this->input->post('qty_per_pack'),
|
||||
'pack_name' => $this->input->post('pack_name') == NULL ? $default_pack_name : $this->input->post('pack_name'),
|
||||
'low_sell_item_id' => $this->input->post('low_sell_item_id') == NULL ? -1 : $this->input->post('low_sell_item_id'),
|
||||
'deleted' => $this->input->post('is_deleted') != NULL,
|
||||
'custom1' => $this->input->post('custom1') == NULL ? '' : $this->input->post('custom1'),
|
||||
'custom2' => $this->input->post('custom2') == NULL ? '' : $this->input->post('custom2'),
|
||||
'custom3' => $this->input->post('custom3') == NULL ? '' : $this->input->post('custom3'),
|
||||
'custom4' => $this->input->post('custom4') == NULL ? '' : $this->input->post('custom4'),
|
||||
'custom5' => $this->input->post('custom5') == NULL ? '' : $this->input->post('custom5'),
|
||||
'custom6' => $this->input->post('custom6') == NULL ? '' : $this->input->post('custom6'),
|
||||
'custom7' => $this->input->post('custom7') == NULL ? '' : $this->input->post('custom7'),
|
||||
'custom8' => $this->input->post('custom8') == NULL ? '' : $this->input->post('custom8'),
|
||||
'custom9' => $this->input->post('custom9') == NULL ? '' : $this->input->post('custom9'),
|
||||
'custom10' => $this->input->post('custom10') == NULL ? '' : $this->input->post('custom10')
|
||||
'deleted' => $this->input->post('is_deleted') != NULL
|
||||
);
|
||||
|
||||
if($item_data['item_type'] == ITEM_TEMP)
|
||||
@@ -748,8 +742,7 @@ class Items extends Secure_Controller
|
||||
// XSS file data sanity check
|
||||
$data = $this->xss_clean($data);
|
||||
|
||||
/* haven't touched this so old templates will work, or so I guess... */
|
||||
if(sizeof($data) >= 23)
|
||||
if(sizeof($data) >= 18)
|
||||
{
|
||||
$item_data = array(
|
||||
'name' => $data[1],
|
||||
@@ -760,17 +753,7 @@ class Items extends Secure_Controller
|
||||
'reorder_level' => $data[10],
|
||||
'supplier_id' => $this->Supplier->exists($data[3]) ? $data[3] : NULL,
|
||||
'allow_alt_description' => $data[12] != '' ? '1' : '0',
|
||||
'is_serialized' => $data[13] != '' ? '1' : '0',
|
||||
'custom1' => $data[14],
|
||||
'custom2' => $data[15],
|
||||
'custom3' => $data[16],
|
||||
'custom4' => $data[17],
|
||||
'custom5' => $data[18],
|
||||
'custom6' => $data[19],
|
||||
'custom7' => $data[20],
|
||||
'custom8' => $data[21],
|
||||
'custom9' => $data[22],
|
||||
'custom10' => $data[23]
|
||||
'is_serialized' => $data[13] != '' ? '1' : '0'
|
||||
);
|
||||
|
||||
/* we could do something like this, however, the effectiveness of
|
||||
@@ -778,7 +761,7 @@ class Items extends Secure_Controller
|
||||
into that directory, so you really can do whatever you want, this probably
|
||||
needs further discussion */
|
||||
|
||||
$pic_file = $data[24];
|
||||
$pic_file = $data[19];
|
||||
/*if(strcmp('.htaccess', $pic_file)==0)
|
||||
{
|
||||
$pic_file='';
|
||||
|
||||
@@ -523,6 +523,36 @@ function get_item_kit_data_row($item_kit)
|
||||
));
|
||||
}
|
||||
|
||||
function get_attribute_definition_manage_table_headers()
|
||||
{
|
||||
$CI =& get_instance();
|
||||
|
||||
$headers = array(
|
||||
array('definition_id' => $CI->lang->line('attributes_definition_id')),
|
||||
array('definition_name' => $CI->lang->line('attributes_definition_name')),
|
||||
array('definition_type' => $CI->lang->line('attributes_definition_type')),
|
||||
array('definition_flags' => $CI->lang->line('attributes_definition_flags')),
|
||||
array('category' => $CI->lang->line('attributes_category')),
|
||||
);
|
||||
|
||||
return transform_headers($headers);
|
||||
}
|
||||
|
||||
function get_attribute_definition_data_row($attribute)
|
||||
{
|
||||
$CI =& get_instance();
|
||||
$controller_name=strtolower(get_class($CI));
|
||||
|
||||
return array (
|
||||
'definition_id' => $attribute->definition_id,
|
||||
'definition_name' => $attribute->definition_name,
|
||||
'definition_type' => $attribute->definition_type,
|
||||
'category' => $attribute->parent_name,
|
||||
'definition_flags' => count($attribute->definition_flags) == 0 ? $CI->lang->line('common_none_selected_text') : implode(', ', $attribute->definition_flags),
|
||||
'edit' => anchor("$controller_name/view/$attribute->definition_id", '<span class="glyphicon glyphicon-edit"></span>',
|
||||
array('class'=>'modal-dlg', 'data-btn-submit' => $CI->lang->line('common_submit'), 'title'=>$CI->lang->line($controller_name.'_update'))
|
||||
));
|
||||
}
|
||||
|
||||
/*
|
||||
Get the header for the expense categories tabular view
|
||||
|
||||
25
application/language/ar-EG/attributes_lang.php
Normal file
25
application/language/ar-EG/attributes_lang.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
$lang["attributes_category"] = "";
|
||||
$lang["attributes_confirm_delete"] = "";
|
||||
$lang["attributes_definition_cannot_be_deleted"] = "";
|
||||
$lang["attributes_definition_flags"] = "";
|
||||
$lang["attributes_definition_id"] = "";
|
||||
$lang["attributes_definition_name"] = "";
|
||||
$lang["attributes_definition_one_or_multiple"] = "";
|
||||
$lang["attributes_definition_successful_adding"] = "";
|
||||
$lang["attributes_definition_successful_deleted"] = "";
|
||||
$lang["attributes_definition_successful_updating"] = "";
|
||||
$lang["attributes_definition_type"] = "";
|
||||
$lang["attributes_definition_values"] = "";
|
||||
$lang["attributes_new"] = "";
|
||||
$lang["attributes_no_attributes_to_display"] = "";
|
||||
$lang["attributes_receipt_visibility"] = "";
|
||||
$lang["attributes_show_in_items"] = "";
|
||||
$lang["attributes_show_in_items_visibility"] = "";
|
||||
$lang["attributes_show_in_receipt"] = "";
|
||||
$lang["attributes_show_in_receivings"] = "";
|
||||
$lang["attributes_show_in_receivings_visibility"] = "";
|
||||
$lang["attributes_show_in_sales"] = "";
|
||||
$lang["attributes_show_in_sales_visibility"] = "";
|
||||
$lang["attributes_update"] = "";
|
||||
@@ -46,16 +46,6 @@ $lang["config_country_codes"] = "أكواد الدولة";
|
||||
$lang["config_country_codes_tooltip"] = "قائمة مفصولة بفاصلة لاسماء الدول للبحث.";
|
||||
$lang["config_currency_decimals"] = "العلامة العشرية للعملة";
|
||||
$lang["config_currency_symbol"] = "رمز العملة";
|
||||
$lang["config_custom1"] = "حقل مخصص 1";
|
||||
$lang["config_custom10"] = "حقل مخصص 10";
|
||||
$lang["config_custom2"] = "حقل مخصص 2";
|
||||
$lang["config_custom3"] = "حقل مخصص 3";
|
||||
$lang["config_custom4"] = "حقل مخصص 4";
|
||||
$lang["config_custom5"] = "حقل مخصص 5";
|
||||
$lang["config_custom6"] = "حقل مخصص 6";
|
||||
$lang["config_custom7"] = "حقل مخصص 7";
|
||||
$lang["config_custom8"] = "حقل مخصص 8";
|
||||
$lang["config_custom9"] = "حقل مخصص 9";
|
||||
$lang["config_customer_reward"] = "المكافآت";
|
||||
$lang["config_customer_reward_duplicate"] = "المكافئة يجب ان تكون فريدة.";
|
||||
$lang["config_customer_reward_enable"] = "تمكين مكافآت العميل";
|
||||
|
||||
@@ -78,7 +78,6 @@ $lang["items_retrive_item_info"] = "استرجاع بيانات الصنف";
|
||||
$lang["items_sales_tax_1"] = "ضريبة المبيعات";
|
||||
$lang["items_sales_tax_2"] = "ضريبة المبيعات 2";
|
||||
$lang["items_search_attributes"] = "بحث الحقول المخصصة";
|
||||
$lang["items_search_custom_items"] = "بحث الاصناف المخصصة";
|
||||
$lang["items_select_image"] = "اختار صورة";
|
||||
$lang["items_serialized_items"] = "أصناف مسلسلة";
|
||||
$lang["items_standard"] = "اساسي";
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
$lang["module_attributes"] = "";
|
||||
$lang["module_attributes_desc"] = "";
|
||||
$lang["module_both"] = "الاثنين";
|
||||
$lang["module_config"] = "إعدادات الشركة";
|
||||
$lang["module_config_desc"] = "تغيير إعدادات الشركة.";
|
||||
|
||||
25
application/language/az-AZ/attributes_lang.php
Normal file
25
application/language/az-AZ/attributes_lang.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
$lang["attributes_category"] = "";
|
||||
$lang["attributes_confirm_delete"] = "";
|
||||
$lang["attributes_definition_cannot_be_deleted"] = "";
|
||||
$lang["attributes_definition_flags"] = "";
|
||||
$lang["attributes_definition_id"] = "";
|
||||
$lang["attributes_definition_name"] = "";
|
||||
$lang["attributes_definition_one_or_multiple"] = "";
|
||||
$lang["attributes_definition_successful_adding"] = "";
|
||||
$lang["attributes_definition_successful_deleted"] = "";
|
||||
$lang["attributes_definition_successful_updating"] = "";
|
||||
$lang["attributes_definition_type"] = "";
|
||||
$lang["attributes_definition_values"] = "";
|
||||
$lang["attributes_new"] = "";
|
||||
$lang["attributes_no_attributes_to_display"] = "";
|
||||
$lang["attributes_receipt_visibility"] = "";
|
||||
$lang["attributes_show_in_items"] = "";
|
||||
$lang["attributes_show_in_items_visibility"] = "";
|
||||
$lang["attributes_show_in_receipt"] = "";
|
||||
$lang["attributes_show_in_receivings"] = "";
|
||||
$lang["attributes_show_in_receivings_visibility"] = "";
|
||||
$lang["attributes_show_in_sales"] = "";
|
||||
$lang["attributes_show_in_sales_visibility"] = "";
|
||||
$lang["attributes_update"] = "";
|
||||
@@ -48,14 +48,6 @@ $lang["config_currency_decimals"] = "Məzənnə Rəqəmləri";
|
||||
$lang["config_currency_symbol"] = "Valyuta Simvolu";
|
||||
$lang["config_custom1"] = "Xüsusi Sahə 1";
|
||||
$lang["config_custom10"] = "Xüsusi Sahə 10";
|
||||
$lang["config_custom2"] = "Xüsusi Sahə 2";
|
||||
$lang["config_custom3"] = "Xüsusi Sahə 3";
|
||||
$lang["config_custom4"] = "Xususi Sahə 4";
|
||||
$lang["config_custom5"] = "Hazir. məsafə 5";
|
||||
$lang["config_custom6"] = "Özəl Sahə 6";
|
||||
$lang["config_custom7"] = "Xüsusi Sahə 7";
|
||||
$lang["config_custom8"] = "Xüsusi Sahə 8";
|
||||
$lang["config_custom9"] = "Xususi Sahə 9";
|
||||
$lang["config_customer_reward"] = "Mükafat";
|
||||
$lang["config_customer_reward_duplicate"] = "Mükafat unikal olmalıdir.";
|
||||
$lang["config_customer_reward_enable"] = "Müştəri mükafatlarını aktivləşdirin";
|
||||
|
||||
@@ -79,7 +79,6 @@ $lang["items_retrive_item_info"] = "Mal Haqqında Məlumat";
|
||||
$lang["items_sales_tax_1"] = "Satış Vergisi";
|
||||
$lang["items_sales_tax_2"] = "Satış Vergisi 2";
|
||||
$lang["items_search_attributes"] = "Atributları Axtar";
|
||||
$lang["items_search_custom_items"] = "Xüsusi Mallar Axtar";
|
||||
$lang["items_select_image"] = "Şəkil Seç";
|
||||
$lang["items_serialized_items"] = "Seriyalı Mallar";
|
||||
$lang["items_standard"] = "Standart";
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
|
||||
$lang["module_both"] = "";
|
||||
$lang["module_attributes"] = "Attributes";
|
||||
$lang["module_attributes_desc"] = "Add, Update, Delete, and Search item attributes";
|
||||
$lang["module_config"] = "Konfiqursiya";
|
||||
$lang["module_config_desc"] = "OSPOS's Konfiqurasiyasını dəyiş";
|
||||
$lang["module_customers"] = "Müştərilər";
|
||||
|
||||
25
application/language/de-CH/attributes_lang.php
Normal file
25
application/language/de-CH/attributes_lang.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
$lang["attributes_category"] = "";
|
||||
$lang["attributes_confirm_delete"] = "";
|
||||
$lang["attributes_definition_cannot_be_deleted"] = "";
|
||||
$lang["attributes_definition_flags"] = "";
|
||||
$lang["attributes_definition_id"] = "";
|
||||
$lang["attributes_definition_name"] = "";
|
||||
$lang["attributes_definition_one_or_multiple"] = "";
|
||||
$lang["attributes_definition_successful_adding"] = "";
|
||||
$lang["attributes_definition_successful_deleted"] = "";
|
||||
$lang["attributes_definition_successful_updating"] = "";
|
||||
$lang["attributes_definition_type"] = "";
|
||||
$lang["attributes_definition_values"] = "";
|
||||
$lang["attributes_new"] = "";
|
||||
$lang["attributes_no_attributes_to_display"] = "";
|
||||
$lang["attributes_receipt_visibility"] = "";
|
||||
$lang["attributes_show_in_items"] = "";
|
||||
$lang["attributes_show_in_items_visibility"] = "";
|
||||
$lang["attributes_show_in_receipt"] = "";
|
||||
$lang["attributes_show_in_receivings"] = "";
|
||||
$lang["attributes_show_in_receivings_visibility"] = "";
|
||||
$lang["attributes_show_in_sales"] = "";
|
||||
$lang["attributes_show_in_sales_visibility"] = "";
|
||||
$lang["attributes_update"] = "";
|
||||
@@ -46,16 +46,6 @@ $lang["config_country_codes"] = "Country Codes";
|
||||
$lang["config_country_codes_tooltip"] = "Comma separated list of country codes for nominatim address lookup.";
|
||||
$lang["config_currency_decimals"] = "Currency Decimals";
|
||||
$lang["config_currency_symbol"] = "Währungssymbol";
|
||||
$lang["config_custom1"] = "Zusatzfeld 1";
|
||||
$lang["config_custom10"] = "Zusatzfeld 10";
|
||||
$lang["config_custom2"] = "Zusatzfeld 2";
|
||||
$lang["config_custom3"] = "Zusatzfeld 3";
|
||||
$lang["config_custom4"] = "Zusatzfeld 4";
|
||||
$lang["config_custom5"] = "Zusatzfeld 5";
|
||||
$lang["config_custom6"] = "Zusatzfeld 6";
|
||||
$lang["config_custom7"] = "Zusatzfeld 7";
|
||||
$lang["config_custom8"] = "Zusatzfeld 8";
|
||||
$lang["config_custom9"] = "Zusatzfeld 9";
|
||||
$lang["config_customer_reward"] = "";
|
||||
$lang["config_customer_reward_duplicate"] = "";
|
||||
$lang["config_customer_reward_enable"] = "";
|
||||
|
||||
@@ -79,7 +79,6 @@ $lang["items_retrive_item_info"] = "Artikelinformation";
|
||||
$lang["items_sales_tax_1"] = "Umsatzsteuer 1";
|
||||
$lang["items_sales_tax_2"] = "Umsatzsteuer 2";
|
||||
$lang["items_search_attributes"] = "Suche in Zusatzfeldern";
|
||||
$lang["items_search_custom_items"] = "";
|
||||
$lang["items_select_image"] = "Select Image";
|
||||
$lang["items_serialized_items"] = "Serialisierte Artikel";
|
||||
$lang["items_standard"] = "";
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
$lang["module_attributes"] = "";
|
||||
$lang["module_attributes_desc"] = "";
|
||||
$lang["module_both"] = "";
|
||||
$lang["module_config"] = "Einstellungen";
|
||||
$lang["module_config_desc"] = "Einstellungen ändern";
|
||||
|
||||
25
application/language/de/attributes_lang.php
Normal file
25
application/language/de/attributes_lang.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
$lang["attributes_category"] = "";
|
||||
$lang["attributes_confirm_delete"] = "";
|
||||
$lang["attributes_definition_cannot_be_deleted"] = "";
|
||||
$lang["attributes_definition_flags"] = "";
|
||||
$lang["attributes_definition_id"] = "";
|
||||
$lang["attributes_definition_name"] = "";
|
||||
$lang["attributes_definition_one_or_multiple"] = "";
|
||||
$lang["attributes_definition_successful_adding"] = "";
|
||||
$lang["attributes_definition_successful_deleted"] = "";
|
||||
$lang["attributes_definition_successful_updating"] = "";
|
||||
$lang["attributes_definition_type"] = "";
|
||||
$lang["attributes_definition_values"] = "";
|
||||
$lang["attributes_new"] = "";
|
||||
$lang["attributes_no_attributes_to_display"] = "";
|
||||
$lang["attributes_receipt_visibility"] = "";
|
||||
$lang["attributes_show_in_items"] = "";
|
||||
$lang["attributes_show_in_items_visibility"] = "";
|
||||
$lang["attributes_show_in_receipt"] = "";
|
||||
$lang["attributes_show_in_receivings"] = "";
|
||||
$lang["attributes_show_in_receivings_visibility"] = "";
|
||||
$lang["attributes_show_in_sales"] = "";
|
||||
$lang["attributes_show_in_sales_visibility"] = "";
|
||||
$lang["attributes_update"] = "";
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
$lang["module_attributes"] = "";
|
||||
$lang["module_attributes_desc"] = "";
|
||||
$lang["module_both"] = "";
|
||||
$lang["module_config"] = "Einstellungen";
|
||||
$lang["module_config_desc"] = "Einstellungen ändern";
|
||||
|
||||
25
application/language/en-GB/attributes_lang.php
Normal file
25
application/language/en-GB/attributes_lang.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
$lang["attributes_category"] = "Category";
|
||||
$lang["attributes_confirm_delete"] = "Are you sure you want to delete the selected attribute(s)?";
|
||||
$lang["attributes_definition_cannot_be_deleted"] = "Could not delete selected attribute(s)";
|
||||
$lang["attributes_definition_flags"] = "Attribute Visibility";
|
||||
$lang["attributes_definition_id"] = "Id";
|
||||
$lang["attributes_definition_name"] = "Attribute Name";
|
||||
$lang["attributes_definition_one_or_multiple"] = "attribute(s)";
|
||||
$lang["attributes_definition_successful_adding"] = "You have successfully added item";
|
||||
$lang["attributes_definition_successful_deleted"] = "You have successfully deleted";
|
||||
$lang["attributes_definition_successful_updating"] = "You have successfully updated attribute";
|
||||
$lang["attributes_definition_type"] = "Attribute Type";
|
||||
$lang["attributes_definition_values"] = "Atttribute Values";
|
||||
$lang["attributes_new"] = "New Attribute";
|
||||
$lang["attributes_no_attributes_to_display"] = "No Items to display";
|
||||
$lang["attributes_receipt_visibility"] = "Receipt";
|
||||
$lang["attributes_show_in_items"] = "Show in items";
|
||||
$lang["attributes_show_in_items_visibility"] = "Items";
|
||||
$lang["attributes_show_in_receipt"] = "Show in receipt";
|
||||
$lang["attributes_show_in_receivings"] = "Show in receivings";
|
||||
$lang["attributes_show_in_receivings_visibility"] = "Receivings";
|
||||
$lang["attributes_show_in_sales"] = "Show in sales";
|
||||
$lang["attributes_show_in_sales_visibility"] = "Sales";
|
||||
$lang["attributes_update"] = "Update Attribute";
|
||||
@@ -46,16 +46,6 @@ $lang["config_country_codes"] = "Country Codes";
|
||||
$lang["config_country_codes_tooltip"] = "Comma separated list of country codes for nominatim address lookup.";
|
||||
$lang["config_currency_decimals"] = "Currency Decimals";
|
||||
$lang["config_currency_symbol"] = "Currency Symbol";
|
||||
$lang["config_custom1"] = "Custom Field 1";
|
||||
$lang["config_custom10"] = "Custom Field 10";
|
||||
$lang["config_custom2"] = "Custom Field 2";
|
||||
$lang["config_custom3"] = "Custom Field 3";
|
||||
$lang["config_custom4"] = "Custom Field 4";
|
||||
$lang["config_custom5"] = "Custom Field 5";
|
||||
$lang["config_custom6"] = "Custom Field 6";
|
||||
$lang["config_custom7"] = "Custom Field 7";
|
||||
$lang["config_custom8"] = "Custom Field 8";
|
||||
$lang["config_custom9"] = "Custom Field 9";
|
||||
$lang["config_customer_reward"] = "Reward";
|
||||
$lang["config_customer_reward_duplicate"] = "Please use a unique reward name";
|
||||
$lang["config_customer_reward_enable"] = "Enable Customer Rewards";
|
||||
|
||||
@@ -83,7 +83,6 @@ $lang["items_retrive_item_info"] = "Retrieve Item Info";
|
||||
$lang["items_sales_tax_1"] = "Sales Tax";
|
||||
$lang["items_sales_tax_2"] = "Sales Tax 2";
|
||||
$lang["items_search_attributes"] = "Search Attributes";
|
||||
$lang["items_search_custom_items"] = "Search Custom Items";
|
||||
$lang["items_select_image"] = "Select Image";
|
||||
$lang["items_serialized_items"] = "Serialised Items";
|
||||
$lang["items_standard"] = "Standard";
|
||||
|
||||
25
application/language/en-US/attributes_lang.php
Normal file
25
application/language/en-US/attributes_lang.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
$lang["attributes_category"] = "Category";
|
||||
$lang["attributes_confirm_delete"] = "Are you sure you want to delete the selected attribute(s)?";
|
||||
$lang["attributes_definition_cannot_be_deleted"] = "Could not delete selected attribute(s)";
|
||||
$lang["attributes_definition_flags"] = "Attribute Visibility";
|
||||
$lang["attributes_definition_id"] = "Id";
|
||||
$lang["attributes_definition_name"] = "Attribute Name";
|
||||
$lang["attributes_definition_one_or_multiple"] = "attribute(s)";
|
||||
$lang["attributes_definition_successful_adding"] = "You have successfully added item";
|
||||
$lang["attributes_definition_successful_deleted"] = "You have successfully deleted";
|
||||
$lang["attributes_definition_successful_updating"] = "You have successfully updated attribute";
|
||||
$lang["attributes_definition_type"] = "Attribute Type";
|
||||
$lang["attributes_definition_values"] = "Atttribute Values";
|
||||
$lang["attributes_new"] = "New Attribute";
|
||||
$lang["attributes_no_attributes_to_display"] = "No Items to display";
|
||||
$lang["attributes_receipt_visibility"] = "Receipt";
|
||||
$lang["attributes_show_in_items"] = "Show in items";
|
||||
$lang["attributes_show_in_items_visibility"] = "Items";
|
||||
$lang["attributes_show_in_receipt"] = "Show in receipt";
|
||||
$lang["attributes_show_in_receivings"] = "Show in receivings";
|
||||
$lang["attributes_show_in_receivings_visibility"] = "Receivings";
|
||||
$lang["attributes_show_in_sales"] = "Show in sales";
|
||||
$lang["attributes_show_in_sales_visibility"] = "Sales";
|
||||
$lang["attributes_update"] = "Update Attribute";
|
||||
@@ -46,16 +46,6 @@ $lang["config_country_codes"] = "Country Codes";
|
||||
$lang["config_country_codes_tooltip"] = "Comma separated list of country codes for nominatim address lookup.";
|
||||
$lang["config_currency_decimals"] = "Currency Decimals";
|
||||
$lang["config_currency_symbol"] = "Currency Symbol";
|
||||
$lang["config_custom1"] = "Custom Field 1";
|
||||
$lang["config_custom10"] = "Custom Field 10";
|
||||
$lang["config_custom2"] = "Custom Field 2";
|
||||
$lang["config_custom3"] = "Custom Field 3";
|
||||
$lang["config_custom4"] = "Custom Field 4";
|
||||
$lang["config_custom5"] = "Custom Field 5";
|
||||
$lang["config_custom6"] = "Custom Field 6";
|
||||
$lang["config_custom7"] = "Custom Field 7";
|
||||
$lang["config_custom8"] = "Custom Field 8";
|
||||
$lang["config_custom9"] = "Custom Field 9";
|
||||
$lang["config_customer_reward"] = "Reward";
|
||||
$lang["config_customer_reward_duplicate"] = "Reward must be unique.";
|
||||
$lang["config_customer_reward_enable"] = "Enable Customer Rewards";
|
||||
|
||||
@@ -83,7 +83,6 @@ $lang["items_retrive_item_info"] = "Retrive Item Info";
|
||||
$lang["items_sales_tax_1"] = "Sales Tax";
|
||||
$lang["items_sales_tax_2"] = "Sales Tax 2";
|
||||
$lang["items_search_attributes"] = "Search Attributes";
|
||||
$lang["items_search_custom_items"] = "Search Custom Items";
|
||||
$lang["items_select_image"] = "Select Image";
|
||||
$lang["items_serialized_items"] = "Serialized Items";
|
||||
$lang["items_standard"] = "Standard";
|
||||
|
||||
25
application/language/en/attributes_lang.php
Normal file
25
application/language/en/attributes_lang.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
$lang["attributes_category"] = "Category";
|
||||
$lang["attributes_confirm_delete"] = "Are you sure you want to delete the selected attributes?";
|
||||
$lang["attributes_definition_cannot_be_deleted"] = "Could not deleted selected attributes.";
|
||||
$lang["attributes_definition_flags"] = "Attribute Visibility";
|
||||
$lang["attributes_definition_id"] = "Id";
|
||||
$lang["attributes_definition_name"] = "Attribute Name";
|
||||
$lang["attributes_definition_one_or_multiple"] = "attribute(s)";
|
||||
$lang["attributes_definition_successful_adding"] = "You have successfully added item";
|
||||
$lang["attributes_definition_successful_deleted"] = "You have successfully deleted";
|
||||
$lang["attributes_definition_successful_updating"] = "You have successfully updated attribute";
|
||||
$lang["attributes_definition_type"] = "Attribute Type";
|
||||
$lang["attributes_definition_values"] = "Atttribute Values";
|
||||
$lang["attributes_new"] = "New Attribute";
|
||||
$lang["attributes_no_attributes_to_display"] = "No Items to display";
|
||||
$lang["attributes_receipt_visibility"] = "Receipt";
|
||||
$lang["attributes_show_in_items"] = "Show in items";
|
||||
$lang["attributes_show_in_items_visibility"] = "Items";
|
||||
$lang["attributes_show_in_receipt"] = "Show in receipt";
|
||||
$lang["attributes_show_in_receivings"] = "Show in receivings";
|
||||
$lang["attributes_show_in_receivings_visibility"] = "Receivings";
|
||||
$lang["attributes_show_in_sales"] = "Show in sales";
|
||||
$lang["attributes_show_in_sales_visibility"] = "Sales";
|
||||
$lang["attributes_update"] = "Update Attribute";
|
||||
25
application/language/es/attributes_lang.php
Normal file
25
application/language/es/attributes_lang.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
$lang["attributes_category"] = "";
|
||||
$lang["attributes_confirm_delete"] = "";
|
||||
$lang["attributes_definition_cannot_be_deleted"] = "";
|
||||
$lang["attributes_definition_flags"] = "";
|
||||
$lang["attributes_definition_id"] = "";
|
||||
$lang["attributes_definition_name"] = "";
|
||||
$lang["attributes_definition_one_or_multiple"] = "";
|
||||
$lang["attributes_definition_successful_adding"] = "";
|
||||
$lang["attributes_definition_successful_deleted"] = "";
|
||||
$lang["attributes_definition_successful_updating"] = "";
|
||||
$lang["attributes_definition_type"] = "";
|
||||
$lang["attributes_definition_values"] = "";
|
||||
$lang["attributes_new"] = "";
|
||||
$lang["attributes_no_attributes_to_display"] = "";
|
||||
$lang["attributes_receipt_visibility"] = "";
|
||||
$lang["attributes_show_in_items"] = "";
|
||||
$lang["attributes_show_in_items_visibility"] = "";
|
||||
$lang["attributes_show_in_receipt"] = "";
|
||||
$lang["attributes_show_in_receivings"] = "";
|
||||
$lang["attributes_show_in_receivings_visibility"] = "";
|
||||
$lang["attributes_show_in_sales"] = "";
|
||||
$lang["attributes_show_in_sales_visibility"] = "";
|
||||
$lang["attributes_update"] = "";
|
||||
@@ -46,16 +46,6 @@ $lang["config_country_codes"] = "Codigo de pais";
|
||||
$lang["config_country_codes_tooltip"] = "Lista de codigo de paises separado por coma para busqueda de direcciones.";
|
||||
$lang["config_currency_decimals"] = "Decimales de moneda";
|
||||
$lang["config_currency_symbol"] = "Símbolo de moneda";
|
||||
$lang["config_custom1"] = "Campo Libre 1";
|
||||
$lang["config_custom10"] = "Campo Libre 10";
|
||||
$lang["config_custom2"] = "Campo Libre 2";
|
||||
$lang["config_custom3"] = "Campo Libre 3";
|
||||
$lang["config_custom4"] = "Campo Libre 4";
|
||||
$lang["config_custom5"] = "Campo Libre 5";
|
||||
$lang["config_custom6"] = "Campo Libre 6";
|
||||
$lang["config_custom7"] = "Campo Libre 7";
|
||||
$lang["config_custom8"] = "Campo Libre 8";
|
||||
$lang["config_custom9"] = "Campo Libre 9";
|
||||
$lang["config_customer_reward"] = "Premio";
|
||||
$lang["config_customer_reward_duplicate"] = "Introduzca un nombre de premio único.";
|
||||
$lang["config_customer_reward_enable"] = "Activar los premios para los consumidores";
|
||||
|
||||
@@ -79,7 +79,6 @@ $lang["items_retrive_item_info"] = "Obtener Info de Artículo";
|
||||
$lang["items_sales_tax_1"] = "Impuesto de Ventas 1";
|
||||
$lang["items_sales_tax_2"] = "Impuesto de Ventas 2";
|
||||
$lang["items_search_attributes"] = "Atributos de búsqueda";
|
||||
$lang["items_search_custom_items"] = "Buscar en campos personalizados";
|
||||
$lang["items_select_image"] = "Seleccionar Imagen";
|
||||
$lang["items_serialized_items"] = "Artículos Serializados";
|
||||
$lang["items_standard"] = "Estándar";
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
$lang["module_attributes"] = "";
|
||||
$lang["module_attributes_desc"] = "";
|
||||
$lang["module_both"] = "Ambos";
|
||||
$lang["module_config"] = "Configuración de la Tienda";
|
||||
$lang["module_config_desc"] = "Cambiar la configuración de OSPOS.";
|
||||
|
||||
25
application/language/fr/attributes_lang.php
Normal file
25
application/language/fr/attributes_lang.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
$lang["attributes_category"] = "";
|
||||
$lang["attributes_confirm_delete"] = "";
|
||||
$lang["attributes_definition_cannot_be_deleted"] = "";
|
||||
$lang["attributes_definition_flags"] = "";
|
||||
$lang["attributes_definition_id"] = "";
|
||||
$lang["attributes_definition_name"] = "";
|
||||
$lang["attributes_definition_one_or_multiple"] = "";
|
||||
$lang["attributes_definition_successful_adding"] = "";
|
||||
$lang["attributes_definition_successful_deleted"] = "";
|
||||
$lang["attributes_definition_successful_updating"] = "";
|
||||
$lang["attributes_definition_type"] = "";
|
||||
$lang["attributes_definition_values"] = "";
|
||||
$lang["attributes_new"] = "";
|
||||
$lang["attributes_no_attributes_to_display"] = "";
|
||||
$lang["attributes_receipt_visibility"] = "";
|
||||
$lang["attributes_show_in_items"] = "";
|
||||
$lang["attributes_show_in_items_visibility"] = "";
|
||||
$lang["attributes_show_in_receipt"] = "";
|
||||
$lang["attributes_show_in_receivings"] = "";
|
||||
$lang["attributes_show_in_receivings_visibility"] = "";
|
||||
$lang["attributes_show_in_sales"] = "";
|
||||
$lang["attributes_show_in_sales_visibility"] = "";
|
||||
$lang["attributes_update"] = "";
|
||||
@@ -46,16 +46,6 @@ $lang["config_country_codes"] = "Codes de pays";
|
||||
$lang["config_country_codes_tooltip"] = "Liste des codes de pays, séparés par des virgules, pour la recherche d'adresses nominatives.";
|
||||
$lang["config_currency_decimals"] = "Décimales";
|
||||
$lang["config_currency_symbol"] = "Symbole Monétaire";
|
||||
$lang["config_custom1"] = "Champ Personnalisé 1";
|
||||
$lang["config_custom10"] = "Champ Personnalisé 10";
|
||||
$lang["config_custom2"] = "Champ Personnalisé 2";
|
||||
$lang["config_custom3"] = "Champ Personnalisé 3";
|
||||
$lang["config_custom4"] = "Champ Personnalisé 4";
|
||||
$lang["config_custom5"] = "Champ Personnalisé 5";
|
||||
$lang["config_custom6"] = "Champ Personnalisé 6";
|
||||
$lang["config_custom7"] = "Champ Personnalisé 7";
|
||||
$lang["config_custom8"] = "Champ Personnalisé 8";
|
||||
$lang["config_custom9"] = "Champ Personnalisé 9";
|
||||
$lang["config_customer_reward"] = "Récompense";
|
||||
$lang["config_customer_reward_duplicate"] = "La récompense doit être unique.";
|
||||
$lang["config_customer_reward_enable"] = "Activer les récompenses client";
|
||||
|
||||
@@ -79,7 +79,6 @@ $lang["items_retrive_item_info"] = "Récupérer l'informations";
|
||||
$lang["items_sales_tax_1"] = "Taxe vente";
|
||||
$lang["items_sales_tax_2"] = "Taxe vente 2";
|
||||
$lang["items_search_attributes"] = "Rechercher dans les Champs Choisis";
|
||||
$lang["items_search_custom_items"] = "Rechercher dans les Champs Choisis";
|
||||
$lang["items_select_image"] = "Sélectionner l'image";
|
||||
$lang["items_serialized_items"] = "Articles avec N° de série";
|
||||
$lang["items_standard"] = "La norme";
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
$lang["module_both"] = "Tous les deux";
|
||||
$lang["module_attributes_desc"] = "";
|
||||
$lang["module_config"] = "Paramètres";
|
||||
$lang["module_config_desc"] = "Paramètres de la boutique.";
|
||||
$lang["module_customers"] = "Clients";
|
||||
|
||||
25
application/language/hr-HR/attributes_lang.php
Normal file
25
application/language/hr-HR/attributes_lang.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
$lang["attributes_category"] = "";
|
||||
$lang["attributes_confirm_delete"] = "";
|
||||
$lang["attributes_definition_cannot_be_deleted"] = "";
|
||||
$lang["attributes_definition_flags"] = "";
|
||||
$lang["attributes_definition_id"] = "";
|
||||
$lang["attributes_definition_name"] = "";
|
||||
$lang["attributes_definition_one_or_multiple"] = "";
|
||||
$lang["attributes_definition_successful_adding"] = "";
|
||||
$lang["attributes_definition_successful_deleted"] = "";
|
||||
$lang["attributes_definition_successful_updating"] = "";
|
||||
$lang["attributes_definition_type"] = "";
|
||||
$lang["attributes_definition_values"] = "";
|
||||
$lang["attributes_new"] = "";
|
||||
$lang["attributes_no_attributes_to_display"] = "";
|
||||
$lang["attributes_receipt_visibility"] = "";
|
||||
$lang["attributes_show_in_items"] = "";
|
||||
$lang["attributes_show_in_items_visibility"] = "";
|
||||
$lang["attributes_show_in_receipt"] = "";
|
||||
$lang["attributes_show_in_receivings"] = "";
|
||||
$lang["attributes_show_in_receivings_visibility"] = "";
|
||||
$lang["attributes_show_in_sales"] = "";
|
||||
$lang["attributes_show_in_sales_visibility"] = "";
|
||||
$lang["attributes_update"] = "";
|
||||
@@ -46,16 +46,6 @@ $lang["config_country_codes"] = "Country Codes";
|
||||
$lang["config_country_codes_tooltip"] = "Comma separated list of country codes for nominatim address lookup.";
|
||||
$lang["config_currency_decimals"] = "Velutne decimale";
|
||||
$lang["config_currency_symbol"] = "Valutna oznaka";
|
||||
$lang["config_custom1"] = "Korisničko polje1";
|
||||
$lang["config_custom10"] = "Korisničko polje10";
|
||||
$lang["config_custom2"] = "Korisničko polje2";
|
||||
$lang["config_custom3"] = "Korisničko polje3";
|
||||
$lang["config_custom4"] = "Korisničko polje4";
|
||||
$lang["config_custom5"] = "Korisničko polje5";
|
||||
$lang["config_custom6"] = "Korisničko polje6";
|
||||
$lang["config_custom7"] = "Korisničko polje7";
|
||||
$lang["config_custom8"] = "Korisničko polje8";
|
||||
$lang["config_custom9"] = "Korisničko polje9";
|
||||
$lang["config_customer_reward"] = "";
|
||||
$lang["config_customer_reward_duplicate"] = "";
|
||||
$lang["config_customer_reward_enable"] = "";
|
||||
|
||||
@@ -78,8 +78,7 @@ $lang["items_reorder_level_required"] = "Numeracija je obavezna";
|
||||
$lang["items_retrive_item_info"] = "Info o zaprimljenom artiklu";
|
||||
$lang["items_sales_tax_1"] = "Prodajni porez 1";
|
||||
$lang["items_sales_tax_2"] = "Prodajni porez 2";
|
||||
$lang["items_search_attributes"] = "";
|
||||
$lang["items_search_custom_items"] = "Polje za pretragu";
|
||||
$lang["items_search_attributes"] = "Polje za pretragu";
|
||||
$lang["items_select_image"] = "Odaberi sliku";
|
||||
$lang["items_serialized_items"] = "Artikl ima ser. broj";
|
||||
$lang["items_standard"] = "";
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
$lang["module_attributes"] = "";
|
||||
$lang["module_attributes_desc"] = "";
|
||||
$lang["module_both"] = "";
|
||||
$lang["module_config"] = "Postavke";
|
||||
$lang["module_config_desc"] = "Promijeni postavke";
|
||||
|
||||
25
application/language/hu-HU/attributes_lang.php
Normal file
25
application/language/hu-HU/attributes_lang.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
$lang["attributes_category"] = "";
|
||||
$lang["attributes_confirm_delete"] = "";
|
||||
$lang["attributes_definition_cannot_be_deleted"] = "";
|
||||
$lang["attributes_definition_flags"] = "";
|
||||
$lang["attributes_definition_id"] = "";
|
||||
$lang["attributes_definition_name"] = "";
|
||||
$lang["attributes_definition_one_or_multiple"] = "";
|
||||
$lang["attributes_definition_successful_adding"] = "";
|
||||
$lang["attributes_definition_successful_deleted"] = "";
|
||||
$lang["attributes_definition_successful_updating"] = "";
|
||||
$lang["attributes_definition_type"] = "";
|
||||
$lang["attributes_definition_values"] = "";
|
||||
$lang["attributes_new"] = "";
|
||||
$lang["attributes_no_attributes_to_display"] = "";
|
||||
$lang["attributes_receipt_visibility"] = "";
|
||||
$lang["attributes_show_in_items"] = "";
|
||||
$lang["attributes_show_in_items_visibility"] = "";
|
||||
$lang["attributes_show_in_receipt"] = "";
|
||||
$lang["attributes_show_in_receivings"] = "";
|
||||
$lang["attributes_show_in_receivings_visibility"] = "";
|
||||
$lang["attributes_show_in_sales"] = "";
|
||||
$lang["attributes_show_in_sales_visibility"] = "";
|
||||
$lang["attributes_update"] = "";
|
||||
@@ -46,16 +46,6 @@ $lang["config_country_codes"] = "Country Codes";
|
||||
$lang["config_country_codes_tooltip"] = "Comma separated list of country codes for nominatim address lookup.";
|
||||
$lang["config_currency_decimals"] = "Currency Decimals";
|
||||
$lang["config_currency_symbol"] = "Pénznem";
|
||||
$lang["config_custom1"] = "Egyedi mező 1";
|
||||
$lang["config_custom10"] = "Egyedi mező 10";
|
||||
$lang["config_custom2"] = "Egyedi mező 2";
|
||||
$lang["config_custom3"] = "Egyedi mező 3";
|
||||
$lang["config_custom4"] = "Egyedi mező 4";
|
||||
$lang["config_custom5"] = "Egyedi mező 5";
|
||||
$lang["config_custom6"] = "Egyedi mező 6";
|
||||
$lang["config_custom7"] = "Egyedi mező 7";
|
||||
$lang["config_custom8"] = "Egyedi mező 8";
|
||||
$lang["config_custom9"] = "Egyedi mező 9";
|
||||
$lang["config_customer_reward"] = "";
|
||||
$lang["config_customer_reward_duplicate"] = "";
|
||||
$lang["config_customer_reward_enable"] = "";
|
||||
|
||||
@@ -78,8 +78,7 @@ $lang["items_reorder_level_required"] = "Újrarendelési mező kötelező";
|
||||
$lang["items_retrive_item_info"] = "Retrive Item Info";
|
||||
$lang["items_sales_tax_1"] = "Értékesítési adó 1";
|
||||
$lang["items_sales_tax_2"] = "Értékesítési adó 2";
|
||||
$lang["items_search_attributes"] = "";
|
||||
$lang["items_search_custom_items"] = "Egyedi mezők";
|
||||
$lang["items_search_attributes"] = "Egyedi mezők";
|
||||
$lang["items_select_image"] = "Kép kiválasztása";
|
||||
$lang["items_serialized_items"] = "Szerializált termékek";
|
||||
$lang["items_standard"] = "";
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
$lang["module_attributes"] = "";
|
||||
$lang["module_attributes_desc"] = "";
|
||||
$lang["module_both"] = "";
|
||||
$lang["module_config"] = "Bolt beállítás";
|
||||
$lang["module_config_desc"] = "Bolt beállításainak módosítása";
|
||||
|
||||
25
application/language/id/attributes_lang.php
Normal file
25
application/language/id/attributes_lang.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
$lang["attributes_category"] = "";
|
||||
$lang["attributes_confirm_delete"] = "";
|
||||
$lang["attributes_definition_cannot_be_deleted"] = "";
|
||||
$lang["attributes_definition_flags"] = "";
|
||||
$lang["attributes_definition_id"] = "";
|
||||
$lang["attributes_definition_name"] = "";
|
||||
$lang["attributes_definition_one_or_multiple"] = "";
|
||||
$lang["attributes_definition_successful_adding"] = "";
|
||||
$lang["attributes_definition_successful_deleted"] = "";
|
||||
$lang["attributes_definition_successful_updating"] = "";
|
||||
$lang["attributes_definition_type"] = "";
|
||||
$lang["attributes_definition_values"] = "";
|
||||
$lang["attributes_new"] = "";
|
||||
$lang["attributes_no_attributes_to_display"] = "";
|
||||
$lang["attributes_receipt_visibility"] = "";
|
||||
$lang["attributes_show_in_items"] = "";
|
||||
$lang["attributes_show_in_items_visibility"] = "";
|
||||
$lang["attributes_show_in_receipt"] = "";
|
||||
$lang["attributes_show_in_receivings"] = "";
|
||||
$lang["attributes_show_in_receivings_visibility"] = "";
|
||||
$lang["attributes_show_in_sales"] = "";
|
||||
$lang["attributes_show_in_sales_visibility"] = "";
|
||||
$lang["attributes_update"] = "";
|
||||
@@ -14,6 +14,7 @@ $lang["datepicker_same_month_last_year"] = "Bulan yang sama tahun kemarin";
|
||||
$lang["datepicker_same_month_to_same_day_last_year"] = "Bulan yang sama untuk hari yang sama tahun yang lalu";
|
||||
$lang["datepicker_this_financial_year"] = "";
|
||||
$lang["datepicker_this_month"] = "Bulan ini";
|
||||
$lang["datepicker_this_month_last_year"] = "Same Month Last Year";
|
||||
$lang["datepicker_this_year"] = "Tahun ini";
|
||||
$lang["datepicker_to"] = "sampai";
|
||||
$lang["datepicker_today"] = "Hari ini";
|
||||
|
||||
25
application/language/nl-BE/attributes_lang.php
Normal file
25
application/language/nl-BE/attributes_lang.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
$lang["attributes_category"] = "";
|
||||
$lang["attributes_confirm_delete"] = "";
|
||||
$lang["attributes_definition_cannot_be_deleted"] = "";
|
||||
$lang["attributes_definition_flags"] = "";
|
||||
$lang["attributes_definition_id"] = "";
|
||||
$lang["attributes_definition_name"] = "";
|
||||
$lang["attributes_definition_one_or_multiple"] = "";
|
||||
$lang["attributes_definition_successful_adding"] = "";
|
||||
$lang["attributes_definition_successful_deleted"] = "";
|
||||
$lang["attributes_definition_successful_updating"] = "";
|
||||
$lang["attributes_definition_type"] = "";
|
||||
$lang["attributes_definition_values"] = "";
|
||||
$lang["attributes_new"] = "";
|
||||
$lang["attributes_no_attributes_to_display"] = "";
|
||||
$lang["attributes_receipt_visibility"] = "";
|
||||
$lang["attributes_show_in_items"] = "";
|
||||
$lang["attributes_show_in_items_visibility"] = "";
|
||||
$lang["attributes_show_in_receipt"] = "";
|
||||
$lang["attributes_show_in_receivings"] = "";
|
||||
$lang["attributes_show_in_receivings_visibility"] = "";
|
||||
$lang["attributes_show_in_sales"] = "";
|
||||
$lang["attributes_show_in_sales_visibility"] = "";
|
||||
$lang["attributes_update"] = "";
|
||||
@@ -79,7 +79,6 @@ $lang["items_retrive_item_info"] = "Haal productinformatie op";
|
||||
$lang["items_sales_tax_1"] = "VAT";
|
||||
$lang["items_sales_tax_2"] = "VAT 2";
|
||||
$lang["items_search_attributes"] = "Zoek Attributen";
|
||||
$lang["items_search_custom_items"] = "Doorzoek Tags";
|
||||
$lang["items_select_image"] = "Selecteer Afbeelding";
|
||||
$lang["items_serialized_items"] = "Artikelen met serienummer";
|
||||
$lang["items_standard"] = "Standaard";
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
$lang["module_both"] = "Beide";
|
||||
$lang["module_attributes_desc"] = "";
|
||||
$lang["module_config"] = "Configuratie";
|
||||
$lang["module_config_desc"] = "Globale configuratie aanpassen.";
|
||||
$lang["module_customers"] = "Klanten";
|
||||
|
||||
25
application/language/pt-BR/attributes_lang.php
Normal file
25
application/language/pt-BR/attributes_lang.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
$lang["attributes_category"] = "";
|
||||
$lang["attributes_confirm_delete"] = "";
|
||||
$lang["attributes_definition_cannot_be_deleted"] = "";
|
||||
$lang["attributes_definition_flags"] = "";
|
||||
$lang["attributes_definition_id"] = "";
|
||||
$lang["attributes_definition_name"] = "";
|
||||
$lang["attributes_definition_one_or_multiple"] = "";
|
||||
$lang["attributes_definition_successful_adding"] = "";
|
||||
$lang["attributes_definition_successful_deleted"] = "";
|
||||
$lang["attributes_definition_successful_updating"] = "";
|
||||
$lang["attributes_definition_type"] = "";
|
||||
$lang["attributes_definition_values"] = "";
|
||||
$lang["attributes_new"] = "";
|
||||
$lang["attributes_no_attributes_to_display"] = "";
|
||||
$lang["attributes_receipt_visibility"] = "";
|
||||
$lang["attributes_show_in_items"] = "";
|
||||
$lang["attributes_show_in_items_visibility"] = "";
|
||||
$lang["attributes_show_in_receipt"] = "";
|
||||
$lang["attributes_show_in_receivings"] = "";
|
||||
$lang["attributes_show_in_receivings_visibility"] = "";
|
||||
$lang["attributes_show_in_sales"] = "";
|
||||
$lang["attributes_show_in_sales_visibility"] = "";
|
||||
$lang["attributes_update"] = "";
|
||||
25
application/language/ru/attributes_lang.php
Normal file
25
application/language/ru/attributes_lang.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
$lang["attributes_category"] = "";
|
||||
$lang["attributes_confirm_delete"] = "";
|
||||
$lang["attributes_definition_cannot_be_deleted"] = "";
|
||||
$lang["attributes_definition_flags"] = "";
|
||||
$lang["attributes_definition_id"] = "";
|
||||
$lang["attributes_definition_name"] = "";
|
||||
$lang["attributes_definition_one_or_multiple"] = "";
|
||||
$lang["attributes_definition_successful_adding"] = "";
|
||||
$lang["attributes_definition_successful_deleted"] = "";
|
||||
$lang["attributes_definition_successful_updating"] = "";
|
||||
$lang["attributes_definition_type"] = "";
|
||||
$lang["attributes_definition_values"] = "";
|
||||
$lang["attributes_new"] = "";
|
||||
$lang["attributes_no_attributes_to_display"] = "";
|
||||
$lang["attributes_receipt_visibility"] = "";
|
||||
$lang["attributes_show_in_items"] = "";
|
||||
$lang["attributes_show_in_items_visibility"] = "";
|
||||
$lang["attributes_show_in_receipt"] = "";
|
||||
$lang["attributes_show_in_receivings"] = "";
|
||||
$lang["attributes_show_in_receivings_visibility"] = "";
|
||||
$lang["attributes_show_in_sales"] = "";
|
||||
$lang["attributes_show_in_sales_visibility"] = "";
|
||||
$lang["attributes_update"] = "";
|
||||
@@ -46,16 +46,6 @@ $lang["config_country_codes"] = "Коды Страны";
|
||||
$lang["config_country_codes_tooltip"] = "Список разделенных запятыми кодов стран для поиска номинального адреса.";
|
||||
$lang["config_currency_decimals"] = "Десятичные суммы Валюты";
|
||||
$lang["config_currency_symbol"] = "Символ валюты";
|
||||
$lang["config_custom1"] = "Изготовленный пробел 1";
|
||||
$lang["config_custom10"] = "Изготовленный пробел 10";
|
||||
$lang["config_custom2"] = "Изготовленный пробел 2";
|
||||
$lang["config_custom3"] = "Изготовленный пробел 3";
|
||||
$lang["config_custom4"] = "Изготовленный пробел 4";
|
||||
$lang["config_custom5"] = "Изготовленный пробел 5";
|
||||
$lang["config_custom6"] = "Изготовленный пробел 6";
|
||||
$lang["config_custom7"] = "Изготовленный пробел 7";
|
||||
$lang["config_custom8"] = "Изготовленный пробел 8";
|
||||
$lang["config_custom9"] = "Изготовленный пробел 9";
|
||||
$lang["config_customer_reward"] = "Награда";
|
||||
$lang["config_customer_reward_duplicate"] = "Вознаграждение должно быть уникальным.";
|
||||
$lang["config_customer_reward_enable"] = "Активировать Вознаграждения Клиентов";
|
||||
|
||||
@@ -79,7 +79,6 @@ $lang["items_retrive_item_info"] = "Получить Детальная инфо
|
||||
$lang["items_sales_tax_1"] = "Налог на покупку";
|
||||
$lang["items_sales_tax_2"] = "Налог на покупку 2";
|
||||
$lang["items_search_attributes"] = "Поиск Атрибуты";
|
||||
$lang["items_search_custom_items"] = "Искать в дополнительных товарях";
|
||||
$lang["items_select_image"] = "выбор изображения";
|
||||
$lang["items_serialized_items"] = "Сериализованные товары";
|
||||
$lang["items_standard"] = "типичный";
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
$lang["module_attributes"] = "";
|
||||
$lang["module_attributes_desc"] = "";
|
||||
$lang["module_both"] = "Оба";
|
||||
$lang["module_config"] = "Конфигурация";
|
||||
$lang["module_config_desc"] = "Измените конфигурацию OSPOS.";
|
||||
|
||||
25
application/language/sv/attributes_lang.php
Normal file
25
application/language/sv/attributes_lang.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
$lang["attributes_category"] = "";
|
||||
$lang["attributes_confirm_delete"] = "";
|
||||
$lang["attributes_definition_cannot_be_deleted"] = "";
|
||||
$lang["attributes_definition_flags"] = "";
|
||||
$lang["attributes_definition_id"] = "";
|
||||
$lang["attributes_definition_name"] = "";
|
||||
$lang["attributes_definition_one_or_multiple"] = "";
|
||||
$lang["attributes_definition_successful_adding"] = "";
|
||||
$lang["attributes_definition_successful_deleted"] = "";
|
||||
$lang["attributes_definition_successful_updating"] = "";
|
||||
$lang["attributes_definition_type"] = "";
|
||||
$lang["attributes_definition_values"] = "";
|
||||
$lang["attributes_new"] = "";
|
||||
$lang["attributes_no_attributes_to_display"] = "";
|
||||
$lang["attributes_receipt_visibility"] = "";
|
||||
$lang["attributes_show_in_items"] = "";
|
||||
$lang["attributes_show_in_items_visibility"] = "";
|
||||
$lang["attributes_show_in_receipt"] = "";
|
||||
$lang["attributes_show_in_receivings"] = "";
|
||||
$lang["attributes_show_in_receivings_visibility"] = "";
|
||||
$lang["attributes_show_in_sales"] = "";
|
||||
$lang["attributes_show_in_sales_visibility"] = "";
|
||||
$lang["attributes_update"] = "";
|
||||
@@ -46,16 +46,6 @@ $lang["config_country_codes"] = "Landskod";
|
||||
$lang["config_country_codes_tooltip"] = "Kommaseparerad lista över landskoder för nominatimadressuppslag.";
|
||||
$lang["config_currency_decimals"] = "Valuta Decimaler";
|
||||
$lang["config_currency_symbol"] = "Valutasymbol";
|
||||
$lang["config_custom1"] = "Anpassat fält 1";
|
||||
$lang["config_custom10"] = "Anpassat fält 10";
|
||||
$lang["config_custom2"] = "Anpassat fält 2";
|
||||
$lang["config_custom3"] = "Anpassat fält 3";
|
||||
$lang["config_custom4"] = "Anpassat fält 4";
|
||||
$lang["config_custom5"] = "Anpassat fält 5";
|
||||
$lang["config_custom6"] = "Anpassat fält 6";
|
||||
$lang["config_custom7"] = "Anpassat fält 7";
|
||||
$lang["config_custom8"] = "Anpassat fält 8";
|
||||
$lang["config_custom9"] = "Anpassat fält 9";
|
||||
$lang["config_customer_reward"] = "Belöningen";
|
||||
$lang["config_customer_reward_duplicate"] = "Belöningen måste vara unik.";
|
||||
$lang["config_customer_reward_enable"] = "Aktivera kunders belöningar";
|
||||
|
||||
@@ -79,7 +79,6 @@ $lang["items_retrive_item_info"] = "Återställ artikelinfo";
|
||||
$lang["items_sales_tax_1"] = "Moms";
|
||||
$lang["items_sales_tax_2"] = "Moms 2";
|
||||
$lang["items_search_attributes"] = "Sök attribut";
|
||||
$lang["items_search_custom_items"] = "Sök anpassade artiklar";
|
||||
$lang["items_select_image"] = "Välj Bild";
|
||||
$lang["items_serialized_items"] = "Serialiserade artiklar";
|
||||
$lang["items_standard"] = "Standard";
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
$lang["module_attributes"] = "";
|
||||
$lang["module_attributes_desc"] = "";
|
||||
$lang["module_both"] = "Both";
|
||||
$lang["module_config"] = "Konfiguration";
|
||||
$lang["module_config_desc"] = "Ändra OSPOS: s konfiguration.";
|
||||
|
||||
25
application/language/th/attributes_lang.php
Normal file
25
application/language/th/attributes_lang.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
$lang["attributes_category"] = "";
|
||||
$lang["attributes_confirm_delete"] = "";
|
||||
$lang["attributes_definition_cannot_be_deleted"] = "";
|
||||
$lang["attributes_definition_flags"] = "";
|
||||
$lang["attributes_definition_id"] = "";
|
||||
$lang["attributes_definition_name"] = "";
|
||||
$lang["attributes_definition_one_or_multiple"] = "";
|
||||
$lang["attributes_definition_successful_adding"] = "";
|
||||
$lang["attributes_definition_successful_deleted"] = "";
|
||||
$lang["attributes_definition_successful_updating"] = "";
|
||||
$lang["attributes_definition_type"] = "";
|
||||
$lang["attributes_definition_values"] = "";
|
||||
$lang["attributes_new"] = "";
|
||||
$lang["attributes_no_attributes_to_display"] = "";
|
||||
$lang["attributes_receipt_visibility"] = "";
|
||||
$lang["attributes_show_in_items"] = "";
|
||||
$lang["attributes_show_in_items_visibility"] = "";
|
||||
$lang["attributes_show_in_receipt"] = "";
|
||||
$lang["attributes_show_in_receivings"] = "";
|
||||
$lang["attributes_show_in_receivings_visibility"] = "";
|
||||
$lang["attributes_show_in_sales"] = "";
|
||||
$lang["attributes_show_in_sales_visibility"] = "";
|
||||
$lang["attributes_update"] = "";
|
||||
@@ -46,16 +46,6 @@ $lang["config_country_codes"] = "Country Codes";
|
||||
$lang["config_country_codes_tooltip"] = "Comma separated list of country codes for nominatim address lookup.";
|
||||
$lang["config_currency_decimals"] = "Currency Decimals";
|
||||
$lang["config_currency_symbol"] = "สัญลักษณ์ค่าเงิน";
|
||||
$lang["config_custom1"] = "พื้นที่เพิ่มเติม 1";
|
||||
$lang["config_custom10"] = "พื้นที่เพิ่มเติม 10";
|
||||
$lang["config_custom2"] = "พื้นที่เพิ่มเติม 2";
|
||||
$lang["config_custom3"] = "พื้นที่เพิ่มเติม 3";
|
||||
$lang["config_custom4"] = "พื้นที่เพิ่มเติม 4";
|
||||
$lang["config_custom5"] = "พื้นที่เพิ่มเติม 5";
|
||||
$lang["config_custom6"] = "พื้นที่เพิ่มเติม 6";
|
||||
$lang["config_custom7"] = "พื้นที่เพิ่มเติม 7";
|
||||
$lang["config_custom8"] = "พื้นที่เพิ่มเติม 8";
|
||||
$lang["config_custom9"] = "พื้นที่เพิ่มเติม 9";
|
||||
$lang["config_customer_reward"] = "";
|
||||
$lang["config_customer_reward_duplicate"] = "";
|
||||
$lang["config_customer_reward_enable"] = "";
|
||||
|
||||
@@ -78,8 +78,7 @@ $lang["items_reorder_level_required"] = "ระดับการสั่งไ
|
||||
$lang["items_retrive_item_info"] = "รับข้อมูลสินค้า";
|
||||
$lang["items_sales_tax_1"] = "ถาษีขาย";
|
||||
$lang["items_sales_tax_2"] = "ภาษีขาย 2";
|
||||
$lang["items_search_attributes"] = "";
|
||||
$lang["items_search_custom_items"] = "ค้นหาในฟิลด์เสริม";
|
||||
$lang["items_search_attributes"] = "ค้นหาในฟิลด์เสริม";
|
||||
$lang["items_select_image"] = "Select Image";
|
||||
$lang["items_serialized_items"] = "รหัสสินค้า";
|
||||
$lang["items_standard"] = "";
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
$lang["module_attributes"] = "";
|
||||
$lang["module_attributes_desc"] = "";
|
||||
$lang["module_both"] = "";
|
||||
$lang["module_config"] = "ตั้งค่า";
|
||||
$lang["module_config_desc"] = "ปรับแต่งร้านค้า";
|
||||
|
||||
25
application/language/tr/attributes_lang.php
Normal file
25
application/language/tr/attributes_lang.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
$lang["attributes_category"] = "";
|
||||
$lang["attributes_confirm_delete"] = "";
|
||||
$lang["attributes_definition_cannot_be_deleted"] = "";
|
||||
$lang["attributes_definition_flags"] = "";
|
||||
$lang["attributes_definition_id"] = "";
|
||||
$lang["attributes_definition_name"] = "";
|
||||
$lang["attributes_definition_one_or_multiple"] = "";
|
||||
$lang["attributes_definition_successful_adding"] = "";
|
||||
$lang["attributes_definition_successful_deleted"] = "";
|
||||
$lang["attributes_definition_successful_updating"] = "";
|
||||
$lang["attributes_definition_type"] = "";
|
||||
$lang["attributes_definition_values"] = "";
|
||||
$lang["attributes_new"] = "";
|
||||
$lang["attributes_no_attributes_to_display"] = "";
|
||||
$lang["attributes_receipt_visibility"] = "";
|
||||
$lang["attributes_show_in_items"] = "";
|
||||
$lang["attributes_show_in_items_visibility"] = "";
|
||||
$lang["attributes_show_in_receipt"] = "";
|
||||
$lang["attributes_show_in_receivings"] = "";
|
||||
$lang["attributes_show_in_receivings_visibility"] = "";
|
||||
$lang["attributes_show_in_sales"] = "";
|
||||
$lang["attributes_show_in_sales_visibility"] = "";
|
||||
$lang["attributes_update"] = "";
|
||||
@@ -46,16 +46,6 @@ $lang["config_country_codes"] = "Ülke Kodları";
|
||||
$lang["config_country_codes_tooltip"] = "";
|
||||
$lang["config_currency_decimals"] = "";
|
||||
$lang["config_currency_symbol"] = "Para Birimi";
|
||||
$lang["config_custom1"] = "Özel Alan 1";
|
||||
$lang["config_custom10"] = "Özel Alan 10";
|
||||
$lang["config_custom2"] = "Özel Alan 2";
|
||||
$lang["config_custom3"] = "Özel Alan 3";
|
||||
$lang["config_custom4"] = "Özel Alan 4";
|
||||
$lang["config_custom5"] = "Özel Alan 5";
|
||||
$lang["config_custom6"] = "Özel Alan 6";
|
||||
$lang["config_custom7"] = "Özel Alan 7";
|
||||
$lang["config_custom8"] = "Özel Alan 8";
|
||||
$lang["config_custom9"] = "Özel Alan 9";
|
||||
$lang["config_customer_reward"] = "";
|
||||
$lang["config_customer_reward_duplicate"] = "";
|
||||
$lang["config_customer_reward_enable"] = "";
|
||||
|
||||
@@ -78,8 +78,7 @@ $lang["items_reorder_level_required"] = "Düşük Stok zorunlu alandır";
|
||||
$lang["items_retrive_item_info"] = "Ürün Bilgisi Getir";
|
||||
$lang["items_sales_tax_1"] = "Satış Vergisi";
|
||||
$lang["items_sales_tax_2"] = "Satış Vergisi 2";
|
||||
$lang["items_search_attributes"] = "";
|
||||
$lang["items_search_custom_items"] = "Özel Alanları Ara";
|
||||
$lang["items_search_attributes"] = "Özel Alanları Ara";
|
||||
$lang["items_select_image"] = "Resim Seç";
|
||||
$lang["items_serialized_items"] = "Seri Numaralı Ürünler";
|
||||
$lang["items_standard"] = "";
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
$lang["module_attributes"] = "";
|
||||
$lang["module_attributes_desc"] = "";
|
||||
$lang["module_both"] = "";
|
||||
$lang["module_config"] = "Yapılandırma";
|
||||
$lang["module_config_desc"] = "Yapılandırma bilgisi görme ve düzenleme";
|
||||
|
||||
25
application/language/zh/attributes_lang.php
Normal file
25
application/language/zh/attributes_lang.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
$lang["attributes_category"] = "";
|
||||
$lang["attributes_confirm_delete"] = "";
|
||||
$lang["attributes_definition_cannot_be_deleted"] = "";
|
||||
$lang["attributes_definition_flags"] = "";
|
||||
$lang["attributes_definition_id"] = "";
|
||||
$lang["attributes_definition_name"] = "";
|
||||
$lang["attributes_definition_one_or_multiple"] = "";
|
||||
$lang["attributes_definition_successful_adding"] = "";
|
||||
$lang["attributes_definition_successful_deleted"] = "";
|
||||
$lang["attributes_definition_successful_updating"] = "";
|
||||
$lang["attributes_definition_type"] = "";
|
||||
$lang["attributes_definition_values"] = "";
|
||||
$lang["attributes_new"] = "";
|
||||
$lang["attributes_no_attributes_to_display"] = "";
|
||||
$lang["attributes_receipt_visibility"] = "";
|
||||
$lang["attributes_show_in_items"] = "";
|
||||
$lang["attributes_show_in_items_visibility"] = "";
|
||||
$lang["attributes_show_in_receipt"] = "";
|
||||
$lang["attributes_show_in_receivings"] = "";
|
||||
$lang["attributes_show_in_receivings_visibility"] = "";
|
||||
$lang["attributes_show_in_sales"] = "";
|
||||
$lang["attributes_show_in_sales_visibility"] = "";
|
||||
$lang["attributes_update"] = "";
|
||||
@@ -46,16 +46,6 @@ $lang["config_country_codes"] = "Country Codes";
|
||||
$lang["config_country_codes_tooltip"] = "Comma separated list of country codes for nominatim address lookup.";
|
||||
$lang["config_currency_decimals"] = "Currency Decimals";
|
||||
$lang["config_currency_symbol"] = "貨幣符號";
|
||||
$lang["config_custom1"] = "Custom Field 1";
|
||||
$lang["config_custom10"] = "Custom Field 10";
|
||||
$lang["config_custom2"] = "Custom Field 2";
|
||||
$lang["config_custom3"] = "Custom Field 3";
|
||||
$lang["config_custom4"] = "Custom Field 4";
|
||||
$lang["config_custom5"] = "Custom Field 5";
|
||||
$lang["config_custom6"] = "Custom Field 6";
|
||||
$lang["config_custom7"] = "Custom Field 7";
|
||||
$lang["config_custom8"] = "Custom Field 8";
|
||||
$lang["config_custom9"] = "Custom Field 9";
|
||||
$lang["config_customer_reward"] = "";
|
||||
$lang["config_customer_reward_duplicate"] = "";
|
||||
$lang["config_customer_reward_enable"] = "";
|
||||
|
||||
@@ -78,8 +78,7 @@ $lang["items_reorder_level_required"] = "補貨點為必填欄位";
|
||||
$lang["items_retrive_item_info"] = "檢索產品訊息";
|
||||
$lang["items_sales_tax_1"] = "營業稅";
|
||||
$lang["items_sales_tax_2"] = "營業稅 2";
|
||||
$lang["items_search_attributes"] = "";
|
||||
$lang["items_search_custom_items"] = "Search Custom Fields";
|
||||
$lang["items_search_attributes"] = "Search Custom Fields";
|
||||
$lang["items_select_image"] = "Select Image";
|
||||
$lang["items_serialized_items"] = "序列化產品";
|
||||
$lang["items_standard"] = "";
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
$lang["module_attributes"] = "";
|
||||
$lang["module_attributes_desc"] = "";
|
||||
$lang["module_both"] = "";
|
||||
$lang["module_config"] = "系統配置";
|
||||
$lang["module_config_desc"] = "修改系統配置";
|
||||
|
||||
@@ -159,7 +159,7 @@ class Receiving_lib
|
||||
$this->CI->session->unset_userdata('recv_stock_destination');
|
||||
}
|
||||
|
||||
public function add_item($item_id, $quantity = 1, $item_location = NULL, $discount_type = 0, $discount = 0, $price = NULL, $description = NULL, $serialnumber = NULL, $receiving_quantity = NULL, $include_deleted = FALSE)
|
||||
public function add_item($item_id, $quantity = 1, $item_location = NULL, $discount_type = 0, $discount = 0, $price = NULL, $description = NULL, $serialnumber = NULL, $receiving_quantity = NULL, $receiving_id = NULL, $include_deleted = FALSE)
|
||||
{
|
||||
//make sure item exists in database.
|
||||
if(!$this->CI->Item->exists($item_id, $include_deleted))
|
||||
@@ -240,6 +240,7 @@ class Receiving_lib
|
||||
'name' => $item_info->name,
|
||||
'description' => $description != NULL ? $description: $item_info->description,
|
||||
'serialnumber' => $serialnumber != NULL ? $serialnumber: '',
|
||||
'attribute_values' => $this->CI->Attribute->get_link_values($item_id, 'receiving_id', $receiving_id, Attribute::SHOW_IN_RECEIVINGS)->attribute_values,
|
||||
'allow_alt_description' => $item_info->allow_alt_description,
|
||||
'is_serialized' => $item_info->is_serialized,
|
||||
'quantity' => $quantity,
|
||||
@@ -319,7 +320,7 @@ class Receiving_lib
|
||||
|
||||
foreach($this->CI->Receiving->get_receiving_items($receiving_id)->result() as $row)
|
||||
{
|
||||
$this->add_item($row->item_id, -$row->quantity_purchased, $row->item_location, $row->discount_type, $row->discount, $row->item_unit_price, $row->description, $row->serialnumber, $row->receiving_quantity, TRUE);
|
||||
$this->add_item($row->item_id, -$row->quantity_purchased, $row->item_location, $row->discount_type, $row->discount, $row->item_unit_price, $row->description, $row->serialnumber, $receiving_id, $row->receiving_quantity, TRUE);
|
||||
}
|
||||
|
||||
$this->set_supplier($this->CI->Receiving->get_supplier($receiving_id)->person_id);
|
||||
@@ -344,7 +345,7 @@ class Receiving_lib
|
||||
|
||||
foreach($this->CI->Receiving->get_receiving_items($receiving_id)->result() as $row)
|
||||
{
|
||||
$this->add_item($row->item_id, $row->quantity_purchased, $row->item_location, $row->discount_type, $row->discount, $row->item_unit_price, $row->description, $row->serialnumber, $row->receiving_quantity, TRUE);
|
||||
$this->add_item($row->item_id, $row->quantity_purchased, $row->item_location, $row->discount_type, $row->discount, $row->item_unit_price, $row->description, $row->serialnumber, $row->receiving_quantity, $receiving_id, TRUE);
|
||||
}
|
||||
|
||||
$this->set_supplier($this->CI->Receiving->get_supplier($receiving_id)->person_id);
|
||||
|
||||
@@ -696,10 +696,9 @@ class Sale_lib
|
||||
$this->CI->session->unset_userdata('sales_rewards_remainder');
|
||||
}
|
||||
|
||||
public function add_item(&$item_id, $quantity = 1, $item_location, $discount = 0, $discount_type = 0, $price_mode = PRICE_MODE_STANDARD, $kit_price_option = NULL, $kit_print_option = NULL, $price_override = NULL, $description = NULL, $serialnumber = NULL, $include_deleted = FALSE, $print_option = NULL )
|
||||
public function add_item(&$item_id, $quantity = 1, $item_location, $discount = 0, $discount_type = 0, $price_mode = PRICE_MODE_STANDARD, $kit_price_option = NULL, $kit_print_option = NULL, $price_override = NULL, $description = NULL, $serialnumber = NULL, $sale_id = NULL, $include_deleted = FALSE, $print_option = NULL )
|
||||
{
|
||||
$item_info = $this->CI->Item->get_info_by_id_or_number($item_id, $include_deleted);
|
||||
|
||||
//make sure item exists
|
||||
if(empty($item_info))
|
||||
{
|
||||
@@ -844,6 +843,7 @@ class Sale_lib
|
||||
'line' => $insertkey,
|
||||
'name' => $item_info->name,
|
||||
'item_number' => $item_info->item_number,
|
||||
'attribute_values' => $this->CI->Attribute->get_link_values($item_id, 'sale_id', $sale_id, Attribute::SHOW_IN_SALES)->attribute_values,
|
||||
'description' => $description != NULL ? $description : $item_info->description,
|
||||
'serialnumber' => $serialnumber != NULL ? $serialnumber : '',
|
||||
'allow_alt_description' => $item_info->allow_alt_description,
|
||||
@@ -1019,7 +1019,7 @@ class Sale_lib
|
||||
|
||||
foreach($this->CI->Sale->get_sale_items_ordered($sale_id)->result() as $row)
|
||||
{
|
||||
$this->add_item($row->item_id, $row->quantity_purchased, $row->item_location, $row->discount, $row->discount_type, PRICE_MODE_STANDARD, NULL, NULL, $row->item_unit_price, $row->description, $row->serialnumber, TRUE, $row->print_option);
|
||||
$this->add_item($row->item_id, $row->quantity_purchased, $row->item_location, $row->discount, $row->discount_type, PRICE_MODE_STANDARD, NULL, NULL, $row->item_unit_price, $row->description, $row->serialnumber, $sale_id, TRUE, $row->print_option);
|
||||
}
|
||||
|
||||
foreach($this->CI->Sale->get_sale_payments($sale_id)->result() as $row)
|
||||
@@ -1047,7 +1047,7 @@ class Sale_lib
|
||||
$this->empty_cart();
|
||||
foreach($this->CI->Sale->get_sale_items_ordered($sale_id)->result() as $row)
|
||||
{
|
||||
$this->add_item($row->item_id, $row->quantity_purchased, $row->item_location, $row->discount, $row->discount_type, PRICE_MODE_STANDARD, NULL, NULL, $row->item_unit_price, $row->description, $row->serialnumber, TRUE, $row->print_option);
|
||||
$this->add_item($row->item_id, $row->quantity_purchased, $row->item_location, $row->discount, $row->discount_type, PRICE_MODE_STANDARD, NULL, NULL, $row->item_unit_price, $row->description, $row->serialnumber, $sale_id, TRUE, $row->print_option);
|
||||
}
|
||||
|
||||
return $this->CI->session->userdata('sales_cart');
|
||||
|
||||
20
application/migrations/20180220100000_attributes.php
Normal file
20
application/migrations/20180220100000_attributes.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Migration_Attributes extends CI_Migration
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function up()
|
||||
{
|
||||
execute_script(APPPATH . 'migrations/sqlscripts/attributes.sql');
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
184
application/migrations/sqlscripts/attributes.sql
Normal file
184
application/migrations/sqlscripts/attributes.sql
Normal file
@@ -0,0 +1,184 @@
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `ospos_attribute_definitions` (
|
||||
`definition_id` INT(10) NOT NULL AUTO_INCREMENT,
|
||||
`definition_name` VARCHAR(255) NOT NULL,
|
||||
`definition_type` VARCHAR(45) NOT NULL,
|
||||
`definition_flags` TINYINT(4) NOT NULL,
|
||||
`definition_fk` INT(10) NULL,
|
||||
`deleted` TINYINT(1) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`definition_id`),
|
||||
KEY `definition_fk` (`definition_fk`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `ospos_attribute_values` (
|
||||
`attribute_id` INT NOT NULL AUTO_INCREMENT,
|
||||
`attribute_value` VARCHAR(45) NULL,
|
||||
PRIMARY KEY (`attribute_id`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `ospos_attribute_links` (
|
||||
`attribute_id` INT NULL,
|
||||
`definition_id` INT NOT NULL,
|
||||
`item_id` INT NULL,
|
||||
`sale_id` INT NULL,
|
||||
`receiving_id` INT NULL,
|
||||
KEY `attribute_id` (`attribute_id`),
|
||||
KEY `definition_id` (`definition_id`),
|
||||
KEY `item_id` (`item_id`),
|
||||
KEY `sale_id` (`sale_id`),
|
||||
KEY `receiving_id` (`receiving_id`),
|
||||
UNIQUE `attribute_links_uq1` (`attribute_id`, `definition_id`, `item_id`, `sale_id`, `receiving_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
ALTER TABLE `ospos_attribute_definitions`
|
||||
ADD CONSTRAINT `fk_ospos_attribute_definitions_ibfk_1` FOREIGN KEY (`definition_fk`) REFERENCES `ospos_attribute_definitions` (`definition_id`);
|
||||
|
||||
|
||||
ALTER TABLE `ospos_attribute_links`
|
||||
ADD CONSTRAINT `ospos_attribute_links_ibfk_1` FOREIGN KEY (`definition_id`) REFERENCES `ospos_attribute_definitions` (`definition_id`) ON DELETE CASCADE,
|
||||
ADD CONSTRAINT `ospos_attribute_links_ibfk_2` FOREIGN KEY (`attribute_id`) REFERENCES `ospos_attribute_values` (`attribute_id`) ON DELETE CASCADE,
|
||||
ADD CONSTRAINT `ospos_attribute_links_ibfk_3` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`),
|
||||
ADD CONSTRAINT `ospos_attribute_links_ibfk_4` FOREIGN KEY (`receiving_id`) REFERENCES `ospos_receivings` (`receiving_id`),
|
||||
ADD CONSTRAINT `ospos_attribute_links_ibfk_5` FOREIGN KEY (`sale_id`) REFERENCES `ospos_sales` (`sale_id`);
|
||||
|
||||
|
||||
UPDATE `ospos_modules` SET `sort` = 120 WHERE `name_lang_key` = 'module_config';
|
||||
|
||||
INSERT INTO `ospos_modules` (`name_lang_key`, `desc_lang_key`, `sort`, `module_id`) VALUES
|
||||
('module_attributes', 'module_attributes_desc', 110, 'attributes');
|
||||
|
||||
INSERT INTO `ospos_permissions` (`permission_id`, `module_id`) VALUES
|
||||
('attributes', 'attributes');
|
||||
|
||||
INSERT INTO `ospos_grants` (`permission_id`, `person_id`, `menu_group`) VALUES
|
||||
('attributes', 1, 'office');
|
||||
|
||||
-- migrate custom fields to text attributes
|
||||
-- NOTE: items with custom attributes won't keep their selected category!!
|
||||
INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom1_name';
|
||||
INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom2_name';
|
||||
INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom3_name';
|
||||
INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom4_name';
|
||||
INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom5_name';
|
||||
INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom6_name';
|
||||
INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom7_name';
|
||||
INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom8_name';
|
||||
INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom9_name';
|
||||
INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom10_name';
|
||||
|
||||
INSERT INTO ospos_attribute_links (definition_id, item_id) SELECT definition_id, item_id FROM ospos_attribute_definitions, ospos_app_config, ospos_items
|
||||
WHERE ospos_app_config.`key` = 'custom1_name' AND ospos_app_config.`value` = ospos_attribute_definitions.definition_name AND custom1 IS NOT NULL;
|
||||
INSERT INTO ospos_attribute_links (definition_id, item_id) SELECT definition_id, item_id FROM ospos_attribute_definitions, ospos_app_config, ospos_items
|
||||
WHERE ospos_app_config.`key` = 'custom2_name' AND ospos_app_config.`value` = ospos_attribute_definitions.definition_name AND custom2 IS NOT NULL;
|
||||
INSERT INTO ospos_attribute_links (definition_id, item_id) SELECT definition_id, item_id FROM ospos_attribute_definitions, ospos_app_config, ospos_items
|
||||
WHERE ospos_app_config.`key` = 'custom3_name' AND ospos_app_config.`value` = ospos_attribute_definitions.definition_name AND custom3 IS NOT NULL;
|
||||
INSERT INTO ospos_attribute_links (definition_id, item_id) SELECT definition_id, item_id FROM ospos_attribute_definitions, ospos_app_config, ospos_items
|
||||
WHERE ospos_app_config.`key` = 'custom4_name' AND ospos_app_config.`value` = ospos_attribute_definitions.definition_name AND custom4 IS NOT NULL;
|
||||
INSERT INTO ospos_attribute_links (definition_id, item_id) SELECT definition_id, item_id FROM ospos_attribute_definitions, ospos_app_config, ospos_items
|
||||
WHERE ospos_app_config.`key` = 'custom5_name' AND ospos_app_config.`value` = ospos_attribute_definitions.definition_name AND custom5 IS NOT NULL;
|
||||
INSERT INTO ospos_attribute_links (definition_id, item_id) SELECT definition_id, item_id FROM ospos_attribute_definitions, ospos_app_config, ospos_items
|
||||
WHERE ospos_app_config.`key` = 'custom6_name' AND ospos_app_config.`value` = ospos_attribute_definitions.definition_name AND custom6 IS NOT NULL;
|
||||
INSERT INTO ospos_attribute_links (definition_id, item_id) SELECT definition_id, item_id FROM ospos_attribute_definitions, ospos_app_config, ospos_items
|
||||
WHERE ospos_app_config.`key` = 'custom7_name' AND ospos_app_config.`value` = ospos_attribute_definitions.definition_name AND custom7 IS NOT NULL;
|
||||
INSERT INTO ospos_attribute_links (definition_id, item_id) SELECT definition_id, item_id FROM ospos_attribute_definitions, ospos_app_config, ospos_items
|
||||
WHERE ospos_app_config.`key` = 'custom8_name' AND ospos_app_config.`value` = ospos_attribute_definitions.definition_name AND custom8 IS NOT NULL;
|
||||
INSERT INTO ospos_attribute_links (definition_id, item_id) SELECT definition_id, item_id FROM ospos_attribute_definitions, ospos_app_config, ospos_items
|
||||
WHERE ospos_app_config.`key` = 'custom9_name' AND ospos_app_config.`value` = ospos_attribute_definitions.definition_name AND custom9 IS NOT NULL;
|
||||
INSERT INTO ospos_attribute_links (definition_id, item_id) SELECT definition_id, item_id FROM ospos_attribute_definitions, ospos_app_config, ospos_items
|
||||
WHERE ospos_app_config.`key` = 'custom10_name' AND ospos_app_config.`value` = ospos_attribute_definitions.definition_name AND custom10 IS NOT NULL;
|
||||
|
||||
INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom1 FROM ospos_items;
|
||||
INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom2 FROM ospos_items;
|
||||
INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom3 FROM ospos_items;
|
||||
INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom4 FROM ospos_items;
|
||||
INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom5 FROM ospos_items;
|
||||
INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom6 FROM ospos_items;
|
||||
INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom7 FROM ospos_items;
|
||||
INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom8 FROM ospos_items;
|
||||
INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom9 FROM ospos_items;
|
||||
INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom10 FROM ospos_items;
|
||||
|
||||
UPDATE ospos_attribute_links
|
||||
INNER JOIN ospos_items ON ospos_attribute_links.item_id = ospos_items.item_id
|
||||
INNER JOIN ospos_attribute_values ON attribute_value = custom1
|
||||
SET ospos_attribute_links.attribute_id = ospos_attribute_values.attribute_id
|
||||
WHERE definition_id IN (SELECT definition_id FROM ospos_attribute_definitions
|
||||
WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom1_name'));
|
||||
|
||||
UPDATE ospos_attribute_links
|
||||
INNER JOIN ospos_items ON ospos_attribute_links.item_id = ospos_items.item_id
|
||||
INNER JOIN ospos_attribute_values ON attribute_value = custom2
|
||||
SET ospos_attribute_links.attribute_id = ospos_attribute_values.attribute_id
|
||||
WHERE definition_id IN (SELECT definition_id FROM ospos_attribute_definitions
|
||||
WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom2_name'));
|
||||
|
||||
UPDATE ospos_attribute_links
|
||||
INNER JOIN ospos_items ON ospos_attribute_links.item_id = ospos_items.item_id
|
||||
INNER JOIN ospos_attribute_values ON attribute_value = custom3
|
||||
SET ospos_attribute_links.attribute_id = ospos_attribute_values.attribute_id
|
||||
WHERE definition_id IN (SELECT definition_id FROM ospos_attribute_definitions
|
||||
WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom3_name'));
|
||||
|
||||
UPDATE ospos_attribute_links
|
||||
INNER JOIN ospos_items ON ospos_attribute_links.item_id = ospos_items.item_id
|
||||
INNER JOIN ospos_attribute_values ON attribute_value = custom4
|
||||
SET ospos_attribute_links.attribute_id = ospos_attribute_values.attribute_id
|
||||
WHERE definition_id IN (SELECT definition_id FROM ospos_attribute_definitions
|
||||
WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom4_name'));
|
||||
|
||||
UPDATE ospos_attribute_links
|
||||
INNER JOIN ospos_items ON ospos_attribute_links.item_id = ospos_items.item_id
|
||||
INNER JOIN ospos_attribute_values ON attribute_value = custom5
|
||||
SET ospos_attribute_links.attribute_id = ospos_attribute_values.attribute_id
|
||||
WHERE definition_id IN (SELECT definition_id FROM ospos_attribute_definitions
|
||||
WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom5_name'));
|
||||
|
||||
UPDATE ospos_attribute_links
|
||||
INNER JOIN ospos_items ON ospos_attribute_links.item_id = ospos_items.item_id
|
||||
INNER JOIN ospos_attribute_values ON attribute_value = custom6
|
||||
SET ospos_attribute_links.attribute_id = ospos_attribute_values.attribute_id
|
||||
WHERE definition_id IN (SELECT definition_id FROM ospos_attribute_definitions
|
||||
WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom6_name'));
|
||||
|
||||
UPDATE ospos_attribute_links
|
||||
INNER JOIN ospos_items ON ospos_attribute_links.item_id = ospos_items.item_id
|
||||
INNER JOIN ospos_attribute_values ON attribute_value = custom7
|
||||
SET ospos_attribute_links.attribute_id = ospos_attribute_values.attribute_id
|
||||
WHERE definition_id IN (SELECT definition_id FROM ospos_attribute_definitions
|
||||
WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom7_name'));
|
||||
|
||||
UPDATE ospos_attribute_links
|
||||
INNER JOIN ospos_items ON ospos_attribute_links.item_id = ospos_items.item_id
|
||||
INNER JOIN ospos_attribute_values ON attribute_value = custom8
|
||||
SET ospos_attribute_links.attribute_id = ospos_attribute_values.attribute_id
|
||||
WHERE definition_id IN (SELECT definition_id FROM ospos_attribute_definitions
|
||||
WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom8_name'));
|
||||
|
||||
UPDATE ospos_attribute_links
|
||||
INNER JOIN ospos_items ON ospos_attribute_links.item_id = ospos_items.item_id
|
||||
INNER JOIN ospos_attribute_values ON attribute_value = custom9
|
||||
SET ospos_attribute_links.attribute_id = ospos_attribute_values.attribute_id
|
||||
WHERE definition_id IN (SELECT definition_id FROM ospos_attribute_definitions
|
||||
WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom9_name'));
|
||||
|
||||
UPDATE ospos_attribute_links
|
||||
INNER JOIN ospos_items ON ospos_attribute_links.item_id = ospos_items.item_id
|
||||
INNER JOIN ospos_attribute_values ON attribute_value = custom10
|
||||
SET ospos_attribute_links.attribute_id = ospos_attribute_values.attribute_id
|
||||
WHERE definition_id IN (SELECT definition_id FROM ospos_attribute_definitions
|
||||
WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom10_name'));
|
||||
|
||||
ALTER TABLE `ospos_items`
|
||||
DROP COLUMN `custom1`,
|
||||
DROP COLUMN `custom2`,
|
||||
DROP COLUMN `custom3`,
|
||||
DROP COLUMN `custom4`,
|
||||
DROP COLUMN `custom5`,
|
||||
DROP COLUMN `custom6`,
|
||||
DROP COLUMN `custom7`,
|
||||
DROP COLUMN `custom8`,
|
||||
DROP COLUMN `custom9`,
|
||||
DROP COLUMN `custom10`;
|
||||
408
application/models/Attribute.php
Normal file
408
application/models/Attribute.php
Normal file
@@ -0,0 +1,408 @@
|
||||
<?php
|
||||
|
||||
define('CATEGORY', 'CATEGORY');
|
||||
define('DROPDOWN', 'DROPDOWN');
|
||||
define('DATE', 'DATE');
|
||||
define('TEXT', 'TEXT');
|
||||
|
||||
const DEFINITION_TYPES = [CATEGORY, DROPDOWN, TEXT];
|
||||
|
||||
class Attribute extends CI_Model
|
||||
{
|
||||
const SHOW_IN_ITEMS = 1;
|
||||
const SHOW_IN_SALES = 2;
|
||||
const SHOW_IN_RECEIVINGS = 4;
|
||||
|
||||
public static function get_definition_flags()
|
||||
{
|
||||
$class = new ReflectionClass(__CLASS__);
|
||||
return array_flip($class->getConstants());
|
||||
}
|
||||
|
||||
/*
|
||||
Determines if a given definition_id is an attribute
|
||||
*/
|
||||
public function exists($definition_id, $deleted = FALSE)
|
||||
{
|
||||
$this->db->from('attribute_definitions');
|
||||
$this->db->where('definition_id', $definition_id);
|
||||
$this->db->where('deleted', $deleted);
|
||||
|
||||
return ($this->db->get()->num_rows() == 1);
|
||||
}
|
||||
|
||||
public function link_exists($item_id, $definition_id = FALSE)
|
||||
{
|
||||
$this->db->where('sale_id');
|
||||
$this->db->where('receiving_id');
|
||||
$this->db->from('attribute_links');
|
||||
if (empty($definition_id))
|
||||
{
|
||||
$this->db->where('definition_id <>');
|
||||
$this->db->where('attribute_id');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->db->where('definition_id', $definition_id);
|
||||
|
||||
}
|
||||
$this->db->where('item_id', $item_id);
|
||||
return $this->db->get()->num_rows() > 0;
|
||||
}
|
||||
|
||||
/*
|
||||
Gets information about a particular attribute definition
|
||||
*/
|
||||
public function get_info($definition_id)
|
||||
{
|
||||
$this->db->select('parent_definition.definition_name AS parent_name, definition.*');
|
||||
$this->db->from('attribute_definitions AS definition');
|
||||
$this->db->join('attribute_definitions AS parent_definition', 'parent_definition.definition_id = definition.definition_fk', 'left');
|
||||
$this->db->where('definition.definition_id', $definition_id);
|
||||
|
||||
$query = $this->db->get();
|
||||
|
||||
if($query->num_rows() == 1)
|
||||
{
|
||||
return $query->row();
|
||||
}
|
||||
else
|
||||
{
|
||||
//Get empty base parent object, as $item_id is NOT an item
|
||||
$item_obj = new stdClass();
|
||||
|
||||
//Get all the fields from items table
|
||||
foreach($this->db->list_fields('attribute_definitions') as $field)
|
||||
{
|
||||
$item_obj->$field = '';
|
||||
}
|
||||
|
||||
return $item_obj;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Performs a search on attribute definitions
|
||||
*/
|
||||
public function search($search, $rows = 0, $limit_from = 0, $sort = 'definition.definition_name', $order = 'asc')
|
||||
{
|
||||
$this->db->select('parent_definition.definition_name AS parent_name, definition.*');
|
||||
$this->db->from('attribute_definitions AS definition');
|
||||
$this->db->join('attribute_definitions AS parent_definition', 'parent_definition.definition_id = definition.definition_fk', 'left');
|
||||
|
||||
$this->db->group_start();
|
||||
$this->db->like('definition.definition_name', $search);
|
||||
$this->db->or_like('definition.definition_type', $search);
|
||||
$this->db->group_end();
|
||||
$this->db->where('definition.deleted', 0);
|
||||
$this->db->order_by($sort, $order);
|
||||
|
||||
if($rows > 0)
|
||||
{
|
||||
$this->db->limit($rows, $limit_from);
|
||||
}
|
||||
|
||||
return $this->db->get();
|
||||
}
|
||||
|
||||
public function get_attributes_by_item($item_id)
|
||||
{
|
||||
$this->db->from('attribute_definitions');
|
||||
$this->db->join('attribute_links', 'attribute_links.definition_id = attribute_definitions.definition_id');
|
||||
$this->db->where('item_id', $item_id);
|
||||
$this->db->where('deleted', 0);
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function get_values_by_parent($definition_fk)
|
||||
{
|
||||
$this->db->from('attribute_definitions');
|
||||
if ($definition_fk != -1)
|
||||
{
|
||||
$this->db->where('definition_fk', $definition_fk);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->db->where('definition_fk');
|
||||
}
|
||||
$this->db->where('deleted', 0);
|
||||
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function get_definitions_by_type($attribute_type, $definition_id = -1)
|
||||
{
|
||||
$this->db->from('attribute_definitions');
|
||||
$this->db->where('definition_type', $attribute_type);
|
||||
$this->db->where('deleted', 0);
|
||||
|
||||
if ($definition_id != -1)
|
||||
{
|
||||
$this->db->where('definition_id != ', $definition_id);
|
||||
}
|
||||
|
||||
$this->db->where('definition_fk');
|
||||
$results = $this->db->get()->result_array();
|
||||
|
||||
$attribute_definitions = array();
|
||||
foreach($results as $result)
|
||||
{
|
||||
$attribute_definitions[$result['definition_id']] = $result['definition_name'];
|
||||
}
|
||||
return $attribute_definitions;
|
||||
}
|
||||
|
||||
public function get_definition_values($definition_id)
|
||||
{
|
||||
$attribute_values = [];
|
||||
|
||||
if ($definition_id > -1)
|
||||
{
|
||||
$this->db->from('attribute_links');
|
||||
$this->db->join('attribute_values', 'attribute_values.attribute_id = attribute_links.attribute_id');
|
||||
$this->db->where('definition_id', $definition_id);
|
||||
$this->db->where('item_id');
|
||||
|
||||
$results = $this->db->get()->result_array();
|
||||
|
||||
$attribute_definitions = array();
|
||||
foreach($results as $result)
|
||||
{
|
||||
$attribute_definitions[$result['attribute_id']] = $result['attribute_value'];
|
||||
}
|
||||
return $attribute_definitions;
|
||||
}
|
||||
return $attribute_values;
|
||||
}
|
||||
|
||||
/*
|
||||
Gets total of rows
|
||||
*/
|
||||
public function get_total_rows()
|
||||
{
|
||||
$this->db->from('attribute_definitions');
|
||||
$this->db->where('deleted', 0);
|
||||
|
||||
return $this->db->count_all_results();
|
||||
}
|
||||
|
||||
/*
|
||||
Get number of rows
|
||||
*/
|
||||
public function get_found_rows($search)
|
||||
{
|
||||
return $this->search($search)->num_rows();
|
||||
}
|
||||
|
||||
/*
|
||||
Inserts or updates a definition
|
||||
*/
|
||||
public function save_definition(&$definition_data, $definition_id = -1)
|
||||
{
|
||||
//Run these queries as a transaction, we want to make sure we do all or nothing
|
||||
$this->db->trans_start();
|
||||
|
||||
if($definition_id === -1 || !$this->exists($definition_id))
|
||||
{
|
||||
$success = $this->db->insert('attribute_definitions', $definition_data);
|
||||
$definition_data['definition_id'] = $this->db->insert_id();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->db->where('definition_id', $definition_id);
|
||||
$success = $this->db->update('attribute_definitions', $definition_data);
|
||||
$definition_data['definition_id'] = $definition_id;
|
||||
}
|
||||
|
||||
$this->db->trans_complete();
|
||||
|
||||
$success &= $this->db->trans_status();
|
||||
|
||||
return $success;
|
||||
}
|
||||
|
||||
public function get_definition_by_name($definition_name, $definition_type)
|
||||
{
|
||||
$this->db->from('attribute_definitions');
|
||||
$this->db->where('definition_name', $definition_name);
|
||||
$this->db->where('definition_type', $definition_type);
|
||||
return $this->db->get()->row_object();
|
||||
}
|
||||
|
||||
public function save_link($item_id, $definition_id, $attribute_id)
|
||||
{
|
||||
$this->db->trans_start();
|
||||
if ($this->link_exists($item_id, $definition_id))
|
||||
{
|
||||
$this->db->where('definition_id', $definition_id);
|
||||
$this->db->where('item_id', $item_id);
|
||||
$this->db->where('sale_id');
|
||||
$this->db->where('receiving_id');
|
||||
$this->db->update('attribute_links', array('attribute_id' => $attribute_id));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->db->insert('attribute_links', array('attribute_id' => $attribute_id, 'item_id' => $item_id, 'definition_id' => $definition_id));
|
||||
}
|
||||
|
||||
$this->db->trans_complete();
|
||||
return $this->db->trans_status();
|
||||
}
|
||||
|
||||
public function delete_link($item_id)
|
||||
{
|
||||
$this->db->where('sale_id');
|
||||
$this->db->where('receiving_id');
|
||||
return $this->db->delete('attribute_links', array('item_id' => $item_id));
|
||||
}
|
||||
|
||||
public function set_selected_category($item_id, $definition_id)
|
||||
{
|
||||
$this->db->trans_start();
|
||||
|
||||
if ($this->link_exists($item_id))
|
||||
{
|
||||
$this->db->where('item_id', $item_id);
|
||||
$this->db->where('attribute_id');
|
||||
$this->db->update('attribute_links', array('definition_id' => $definition_id));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->db->insert('attribute_links', array('item_id' => $item_id, 'definition_id' => $definition_id));
|
||||
}
|
||||
|
||||
$this->db->trans_complete();
|
||||
|
||||
return $this->db->trans_status();
|
||||
}
|
||||
|
||||
public function get_selected_category($item_id)
|
||||
{
|
||||
$this->db->from('attribute_links');
|
||||
$this->db->join('attribute_definitions', 'attribute_definitions.definition_id = attribute_links.definition_id');
|
||||
$this->db->where('item_id', $item_id);
|
||||
$this->db->where('definition_type', CATEGORY);
|
||||
$this->db->where('definition_fk');
|
||||
return $this->db->get()->row();
|
||||
}
|
||||
|
||||
public function get_link_value($item_id, $definition_id)
|
||||
{
|
||||
$this->db->where('item_id', $item_id);
|
||||
$this->db->where('definition_id', $definition_id);
|
||||
$this->db->where('sale_id');
|
||||
$this->db->where('receiving_id');
|
||||
return $this->db->get('attribute_links')->row_object();
|
||||
}
|
||||
|
||||
public function get_link_values($item_id, $sale_receiving_fk, $id, $definition_flags)
|
||||
{
|
||||
$this->db->select('GROUP_CONCAT(attribute_value SEPARATOR ",") AS attribute_values');
|
||||
$this->db->from('attribute_links');
|
||||
$this->db->join('attribute_values', 'attribute_values.attribute_id = attribute_links.attribute_id');
|
||||
$this->db->join('attribute_definitions', 'attribute_definitions.definition_id = attribute_links.definition_id');
|
||||
$this->db->where('definition_type <>', CATEGORY);
|
||||
if (!empty($id))
|
||||
{
|
||||
$this->db->where($sale_receiving_fk, $id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->db->where('sale_id');
|
||||
$this->db->where('receiving_id');
|
||||
}
|
||||
$this->db->where('item_id', (int) $item_id);
|
||||
$this->db->where('definition_flags & ', $definition_flags);
|
||||
return $this->db->get()->row_object();
|
||||
}
|
||||
|
||||
public function get_attribute_value($item_id, $definition_id)
|
||||
{
|
||||
$this->db->from('attribute_values');
|
||||
$this->db->join('attribute_links', 'attribute_links.attribute_id = attribute_values.attribute_id');
|
||||
$this->db->where('definition_id', $definition_id);
|
||||
$this->db->where('sale_id');
|
||||
$this->db->where('receiving_id');
|
||||
$this->db->where('item_id', (int) $item_id);
|
||||
return $this->db->get()->row_object();
|
||||
}
|
||||
|
||||
public function copy_attribute_links($item_id, $sale_receiving_fk, $id)
|
||||
{
|
||||
$this->db->query(
|
||||
'INSERT INTO ospos_attribute_links (item_id, definition_id, attribute_id, ' . $sale_receiving_fk . ')
|
||||
SELECT ' . $this->db->escape($item_id) . ', definition_id, attribute_id, ' . $this->db->escape($id) . '
|
||||
FROM ' . $this->db->dbprefix('attribute_links') . '
|
||||
WHERE item_id = ' . $this->db->escape($item_id) . ' AND sale_id IS NULL AND receiving_id IS NULL'
|
||||
);
|
||||
}
|
||||
|
||||
public function get_suggestions($definition_id, $term)
|
||||
{
|
||||
$suggestions = array();
|
||||
$this->db->distinct();
|
||||
$this->db->select('attribute_value');
|
||||
$this->db->from('attribute_definitions AS definition');
|
||||
$this->db->join('attribute_links', 'attribute_links.definition_id = definition.definition_id');
|
||||
$this->db->join('attribute_values', 'attribute_values.attribute_id = attribute_links.attribute_id');
|
||||
$this->db->like('attribute_value', $term);
|
||||
$this->db->where('deleted', 0);
|
||||
$this->db->where('definition.definition_id', $definition_id);
|
||||
$this->db->order_by('attribute_value');
|
||||
foreach($this->db->get()->result() as $row)
|
||||
{
|
||||
$row_array = (array) $row;
|
||||
$suggestions[] = array('label' => $row_array['attribute_value']);
|
||||
}
|
||||
|
||||
return $suggestions;
|
||||
}
|
||||
|
||||
public function save_value($attribute_value, $definition_id, $item_id = FALSE, $attribute_id = FALSE)
|
||||
{
|
||||
$this->db->trans_start();
|
||||
|
||||
if (empty($attribute_id) || empty($item_id))
|
||||
{
|
||||
$this->db->insert('attribute_values', array('attribute_value' => $attribute_value));
|
||||
$attribute_id = $this->db->insert_id();
|
||||
|
||||
$this->db->insert('attribute_links', array(
|
||||
'attribute_id' => empty($attribute_id) ? NULL : $attribute_id,
|
||||
'item_id' => empty($item_id) ? NULL : $item_id,
|
||||
'definition_id' => $definition_id));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->db->where('attribute_id', $attribute_id);
|
||||
$this->db->update('attribute_values', array('attribute_value' => $attribute_value));
|
||||
}
|
||||
|
||||
$this->db->trans_complete();
|
||||
|
||||
return $this->db->trans_status();
|
||||
}
|
||||
|
||||
public function delete_value($attribute_value, $definition_id)
|
||||
{
|
||||
return $this->db->query("DELETE atrv, atrl FROM " . $this->db->dbprefix('attribute_values') . " atrv, " . $this->db->dbprefix('attribute_links') . " atrl " .
|
||||
"WHERE atrl.attribute_id = atrv.attribute_id AND atrv.attribute_value = " . $this->db->escape($attribute_value) . " AND atrl.definition_id = " . $this->db->escape($definition_id));
|
||||
}
|
||||
|
||||
public function delete_definition($definition_id)
|
||||
{
|
||||
$this->db->where('definition_id', $definition_id);
|
||||
|
||||
return $this->db->update('attribute_definitions', array('deleted' => 1));
|
||||
}
|
||||
|
||||
public function delete_definition_list($definition_ids)
|
||||
{
|
||||
$this->db->where_in('definition_id', $definition_ids);
|
||||
|
||||
return $this->db->update('attribute_definitions', array('deleted' => 1));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -130,16 +130,6 @@ class Item extends CI_Model
|
||||
$this->db->select('MAX(items.is_serialized) AS is_serialized');
|
||||
$this->db->select('MAX(items.pack_name) AS pack_name');
|
||||
$this->db->select('MAX(items.deleted) AS deleted');
|
||||
$this->db->select('MAX(items.custom1) AS custom1');
|
||||
$this->db->select('MAX(items.custom2) AS custom2');
|
||||
$this->db->select('MAX(items.custom3) AS custom3');
|
||||
$this->db->select('MAX(items.custom4) AS custom4');
|
||||
$this->db->select('MAX(items.custom5) AS custom5');
|
||||
$this->db->select('MAX(items.custom6) AS custom6');
|
||||
$this->db->select('MAX(items.custom7) AS custom7');
|
||||
$this->db->select('MAX(items.custom8) AS custom8');
|
||||
$this->db->select('MAX(items.custom9) AS custom9');
|
||||
$this->db->select('MAX(items.custom10) AS custom10');
|
||||
|
||||
$this->db->select('MAX(suppliers.person_id) AS person_id');
|
||||
$this->db->select('MAX(suppliers.company_name) AS company_name');
|
||||
@@ -190,24 +180,15 @@ class Item extends CI_Model
|
||||
$this->db->like('name', $search);
|
||||
$this->db->or_like('item_number', $search);
|
||||
$this->db->or_like('items.item_id', $search);
|
||||
$this->db->or_like('definition_name', $search);
|
||||
$this->db->or_like('company_name', $search);
|
||||
$this->db->or_like('items.category', $search);
|
||||
$this->db->group_end();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->db->group_start();
|
||||
$this->db->like('custom1', $search);
|
||||
$this->db->or_like('custom2', $search);
|
||||
$this->db->or_like('custom3', $search);
|
||||
$this->db->or_like('custom4', $search);
|
||||
$this->db->or_like('custom5', $search);
|
||||
$this->db->or_like('custom6', $search);
|
||||
$this->db->or_like('custom7', $search);
|
||||
$this->db->or_like('custom8', $search);
|
||||
$this->db->or_like('custom9', $search);
|
||||
$this->db->or_like('custom10', $search);
|
||||
$this->db->group_end();
|
||||
$this->db->join('attribute_values', 'attribute_links.attribute_id = attribute_values.attribute_id');
|
||||
$this->db->like('attribute_value', $search);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -380,18 +361,40 @@ class Item extends CI_Model
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
private function create_temp_table()
|
||||
{
|
||||
$this->db->query('CREATE TEMPORARY TABLE IF NOT EXISTS ' . $this->db->dbprefix('item_categories') .
|
||||
' (PRIMARY KEY(item_id, sale_id, receiving_id, definition_id), INDEX(item_id, sale_id, receiving_id, definition_id))
|
||||
(
|
||||
SELECT definition_name AS category, definition_type, attribute_links.item_id,
|
||||
sale_id, receiving_id, attribute_links.definition_id
|
||||
FROM ' . $this->db->dbprefix('attribute_links') . ' AS attribute_links
|
||||
INNER JOIN ' . $this->db->dbprefix('attribute_definitions') . ' AS attribute_definitions
|
||||
ON attribute_definitions.definition_id = attribute_links.definition_id AND definition_type = \'CATEGORY\'
|
||||
WHERE sale_id IS NULL AND receiving_id IS NULL
|
||||
)'
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
Gets information about multiple items
|
||||
*/
|
||||
public function get_multiple_info($item_ids, $location_id)
|
||||
{
|
||||
$this->create_temp_table();
|
||||
|
||||
$this->db->select('items.*');
|
||||
$this->db->select('company_name');
|
||||
$this->db->select('category');
|
||||
$this->db->select('quantity');
|
||||
$this->db->from('items');
|
||||
$this->db->join('suppliers', 'suppliers.person_id = items.supplier_id', 'left');
|
||||
$this->db->join('item_quantities', 'item_quantities.item_id = items.item_id', 'left');
|
||||
$this->db->join('item_categories', 'item_categories.item_id = items.item_id', 'left');
|
||||
$this->db->where('location_id', $location_id);
|
||||
$this->db->where_in('items.item_id', $item_ids);
|
||||
|
||||
return $this->db->get();
|
||||
return $this->db->get();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -638,19 +641,11 @@ class Item extends CI_Model
|
||||
//Search by custom fields
|
||||
if($filters['search_custom'] != FALSE)
|
||||
{
|
||||
$this->db->from('items');
|
||||
$this->db->group_start();
|
||||
$this->db->like('custom1', $search);
|
||||
$this->db->or_like('custom2', $search);
|
||||
$this->db->or_like('custom3', $search);
|
||||
$this->db->or_like('custom4', $search);
|
||||
$this->db->or_like('custom5', $search);
|
||||
$this->db->or_like('custom6', $search);
|
||||
$this->db->or_like('custom7', $search);
|
||||
$this->db->or_like('custom8', $search);
|
||||
$this->db->or_like('custom9', $search);
|
||||
$this->db->or_like('custom10', $search);
|
||||
$this->db->group_end();
|
||||
$this->db->from('attribute_links');
|
||||
$this->db->join('attribute_links.attribute_id = attribute_values.attribute_id');
|
||||
$this->db->join('attribute_definitions', 'attribute_definitions.definition_id = attribute_links.definition_id');
|
||||
$this->db->like('attribute_value', $search);
|
||||
$this->db->where('definition_type', TEXT);
|
||||
$this->db->where('deleted', $filters['is_deleted']);
|
||||
$this->db->where_in('item_type', $non_kit); // standard, exclude kit items since kits will be picked up later
|
||||
foreach($this->db->get()->result() as $row)
|
||||
@@ -748,20 +743,11 @@ class Item extends CI_Model
|
||||
//Search by custom fields
|
||||
if($filters['search_custom'] != FALSE)
|
||||
{
|
||||
$this->db->from('items');
|
||||
$this->db->group_start();
|
||||
$this->db->like('custom1', $search);
|
||||
$this->db->or_like('custom2', $search);
|
||||
$this->db->or_like('custom3', $search);
|
||||
$this->db->or_like('custom4', $search);
|
||||
$this->db->or_like('custom5', $search);
|
||||
$this->db->or_like('custom6', $search);
|
||||
$this->db->or_like('custom7', $search);
|
||||
$this->db->or_like('custom8', $search);
|
||||
$this->db->or_like('custom9', $search);
|
||||
$this->db->or_like('custom10', $search);
|
||||
$this->db->group_end();
|
||||
$this->db->where_in('item_type', $non_kit); // standard, exclude kit items since kits will be picked up later
|
||||
$this->db->from('attribute_links');
|
||||
$this->db->join('attribute_links.attribute_id = attribute_values.attribute_id');
|
||||
$this->db->join('attribute_definitions', 'attribute_definitions.definition_id = attribute_links.definition_id');
|
||||
$this->db->like('attribute_value', $search);
|
||||
$this->db->where('definition_type', TEXT);
|
||||
$this->db->where('stock_type', '0'); // stocked items only
|
||||
$this->db->where('deleted', $filters['is_deleted']);
|
||||
foreach($this->db->get()->result() as $row)
|
||||
@@ -937,24 +923,6 @@ class Item extends CI_Model
|
||||
return $suggestions;
|
||||
}
|
||||
|
||||
public function get_custom_suggestions($search, $field_no)
|
||||
{
|
||||
$suggestions = array();
|
||||
$this->db->distinct();
|
||||
$this->db->select('custom'.$field_no);
|
||||
$this->db->from('items');
|
||||
$this->db->like('custom'.$field_no, $search);
|
||||
$this->db->where('deleted', 0);
|
||||
$this->db->order_by('custom'.$field_no, 'asc');
|
||||
foreach($this->db->get()->result() as $row)
|
||||
{
|
||||
$row_array = (array) $row;
|
||||
$suggestions[] = array('label' => $row_array['custom'.$field_no]);
|
||||
}
|
||||
|
||||
return $suggestions;
|
||||
}
|
||||
|
||||
public function get_categories()
|
||||
{
|
||||
$this->db->select('category');
|
||||
|
||||
@@ -62,7 +62,7 @@ class Item_kit extends CI_Model
|
||||
kit_discount_type,
|
||||
price_option,
|
||||
print_option,
|
||||
category,
|
||||
definition_name,
|
||||
supplier_id,
|
||||
item_number,
|
||||
cost_price,
|
||||
@@ -73,21 +73,13 @@ class Item_kit extends CI_Model
|
||||
allow_alt_description,
|
||||
is_serialized,
|
||||
items.deleted,
|
||||
custom1,
|
||||
custom2,
|
||||
custom3,
|
||||
custom4,
|
||||
custom5,
|
||||
custom6,
|
||||
custom7,
|
||||
custom8,
|
||||
custom9,
|
||||
custom10,
|
||||
item_type,
|
||||
stock_type');
|
||||
|
||||
$this->db->from('item_kits');
|
||||
$this->db->join('items', 'item_kits.item_id = items.item_id', 'left');
|
||||
$this->db->join('attribute_links', 'attribute_links.item_id = items.item_id', 'left');
|
||||
$this->db->join('attribute_definitions', 'attribute_links.definition_id = attribute_definitions.definition_id AND definition_type = \'CATEGORY\'', 'left');
|
||||
$this->db->where('item_kit_id', $item_kit_id);
|
||||
|
||||
$query = $this->db->get();
|
||||
|
||||
@@ -59,7 +59,7 @@ class Receiving extends CI_Model
|
||||
return $this->db->update('receivings', $receiving_data);
|
||||
}
|
||||
|
||||
public function save($items, $supplier_id, $employee_id, $comment, $reference, $payment_type, $receiving_id = FALSE)
|
||||
public function save($items, $supplier_id, $employee_id, $comment, $reference, $payment_type)
|
||||
{
|
||||
if(count($items) == 0)
|
||||
{
|
||||
@@ -127,6 +127,8 @@ class Receiving extends CI_Model
|
||||
|
||||
$this->Inventory->insert($inv_data);
|
||||
|
||||
$this->Attribute->copy_attribute_links($item['item_id'], 'receiving_id', $receiving_id);
|
||||
|
||||
$supplier = $this->Supplier->get_info($supplier_id);
|
||||
}
|
||||
|
||||
|
||||
@@ -692,8 +692,10 @@ class Sale extends CI_Model
|
||||
$this->Inventory->insert($inv_data);
|
||||
}
|
||||
|
||||
// Calculate taxes and save the tax information for the sale. Return the result for printing
|
||||
$this->Attribute->copy_attribute_links($item['item_id'], 'sale_id', $sale_id);
|
||||
|
||||
// Calculate taxes and save the tax information for the sale. Return the result for printing
|
||||
$customer = $this->Customer->get_info($customer_id);
|
||||
if($customer_id == -1 || $customer->taxable)
|
||||
{
|
||||
if($this->config->item('tax_included'))
|
||||
@@ -935,14 +937,16 @@ class Sale extends CI_Model
|
||||
item_location,
|
||||
print_option,
|
||||
' . $this->Item->get_item_name('name') . ',
|
||||
category,
|
||||
definition_name,
|
||||
item_type,
|
||||
stock_type');
|
||||
$this->db->from('sales_items AS sales_items');
|
||||
$this->db->join('items AS items', 'sales_items.item_id = items.item_id');
|
||||
$this->db->join('attribute_links', 'items.item_id = attribute_links.item_id AND sales_items.sale_id = attribute_links.sale_id', 'left');
|
||||
$this->db->join('attribute_definitions', 'attribute_definitions.definition_id = attribute_links.definition_id', 'left');
|
||||
$this->db->where('sales_items.sale_id', $sale_id);
|
||||
|
||||
// Entry sequence (this will render kits in the expected sequence)
|
||||
// Entry sequenate (this will render kits in the expected sequence)
|
||||
if($this->config->item('line_sequence') == '0')
|
||||
{
|
||||
$this->db->order_by('line', 'asc');
|
||||
@@ -958,7 +962,7 @@ class Sale extends CI_Model
|
||||
// Group by Item Category
|
||||
elseif($this->config->item('line_sequence') == '2')
|
||||
{
|
||||
$this->db->order_by('category', 'asc');
|
||||
$this->db->order_by('definition_name', 'asc');
|
||||
$this->db->order_by('sales_items.description', 'asc');
|
||||
$this->db->order_by('items.name', 'asc');
|
||||
$this->db->order_by('items.qty_per_pack', 'asc');
|
||||
@@ -1189,7 +1193,7 @@ class Sale extends CI_Model
|
||||
items.item_id AS item_id,
|
||||
MAX(' . $this->Item->get_item_name() . ') AS name,
|
||||
MAX(items.item_number) AS item_number,
|
||||
MAX(items.category) AS category,
|
||||
MAX(definition_name) AS category,
|
||||
MAX(items.supplier_id) AS supplier_id,
|
||||
MAX(sales_items.quantity_purchased) AS quantity_purchased,
|
||||
MAX(sales_items.item_cost_price) AS item_cost_price,
|
||||
@@ -1214,6 +1218,10 @@ class Sale extends CI_Model
|
||||
ON sales_items.sale_id = sales.sale_id
|
||||
INNER JOIN ' . $this->db->dbprefix('items') . ' AS items
|
||||
ON sales_items.item_id = items.item_id
|
||||
LEFT OUTER JOIN ' . $this->db->dbprefix('attribute_links') . ' AS attribute_links
|
||||
ON attribute_links.item_id = items.item_id AND attribute_links.sale_id = sales_items.sale_id
|
||||
LEFT OUTER JOIN ' . $this->db->dbprefix('attribute_definitions') . ' AS attribute_definitions
|
||||
ON attribute_definitions.definition_id = attribute_links.definition_id AND definition_type = \'CATEGORY\'
|
||||
LEFT OUTER JOIN ' . $this->db->dbprefix('sales_payments_temp') . ' AS payments
|
||||
ON sales_items.sale_id = payments.sale_id
|
||||
LEFT OUTER JOIN ' . $this->db->dbprefix('suppliers') . ' AS supplier
|
||||
|
||||
@@ -97,10 +97,12 @@ class Detailed_receivings extends Report
|
||||
|
||||
foreach($data['summary'] as $key=>$value)
|
||||
{
|
||||
$this->db->select('name, item_number, category, quantity_purchased, serialnumber,total, discount, discount_type, item_location, receivings_items_temp.receiving_quantity');
|
||||
$this->db->select('name, item_number, category, quantity_purchased, serialnumber, total, discount, discount_type, item_location, receivings_items_temp.receiving_quantity');
|
||||
$this->db->from('receivings_items_temp');
|
||||
$this->db->join('items', 'receivings_items_temp.item_id = items.item_id');
|
||||
$this->db->where('receiving_id = '.$value['receiving_id']);
|
||||
$this->db->join('attribute_links', 'attribute_links.item_id = items.item_id AND attribute_links.receiving_id = receivings_items_temp.receiving_id', 'left');
|
||||
$this->db->join('attribute_definitions', 'attribute_definitions.definition_id = attribute_links.definition_id AND definition_type = \'CATEGORY\'', 'left');
|
||||
$this->db->where('receivings_items_temp.receiving_id', $value['receiving_id']);
|
||||
$data['details'][$key] = $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
|
||||
173
application/views/attributes/form.php
Normal file
173
application/views/attributes/form.php
Normal file
@@ -0,0 +1,173 @@
|
||||
<div id="required_fields_message"><?php echo $this->lang->line('common_fields_required_message'); ?></div>
|
||||
|
||||
<ul id="error_message_box" class="error_message_box"></ul>
|
||||
|
||||
<?php echo form_open('attributes/save_definition/'.$definition_id, array('id'=>'attribute_form', 'class'=>'form-horizontal')); ?>
|
||||
<fieldset id="attribute_basic_info">
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('attributes_definition_name'), 'definition_name', array('class' => 'control-label col-xs-3')); ?>
|
||||
<div class='col-xs-8'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'definition_name',
|
||||
'class'=>'form-control input-sm',
|
||||
'value'=>$definition_info->definition_name)
|
||||
);?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('attributes_definition_type'), 'definition_type', array('class'=>'control-label col-xs-3')); ?>
|
||||
<div class='col-xs-8'>
|
||||
<?php $disable_definition_type = $definition_info->definition_type == CATEGORY; ?>
|
||||
<?php echo form_dropdown('definition_type', DEFINITION_TYPES, array_search($definition_info->definition_type, DEFINITION_TYPES), 'id="definition_type" class="form-control" ' . ($disable_definition_type ? 'disabled="disabled"' : ''));?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('attributes_category'), 'definition_parent', array('class' => 'control-label col-xs-3')); ?>
|
||||
<div class='col-xs-8'>
|
||||
<?php echo form_dropdown('definition_parent', $definition_parent, $definition_info->definition_fk, 'id="definition_parent" class="form-control" ' . (empty($definition_parent) ? 'disabled="disabled"' : ''));?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm hidden">
|
||||
<?php echo form_label($this->lang->line('attributes_definition_flags'), 'definition_flags', array('class' => 'control-label col-xs-3')); ?>
|
||||
<div class='col-xs-8'>
|
||||
<div class="input-group">
|
||||
<?php echo form_multiselect('definition_flags[]', $definition_flags, array_keys($selected_definition_flags), array('id'=>'definition_flags', 'class'=>'selectpicker show-menu-arrow', 'data-none-selected-text'=>$this->lang->line('common_none_selected_text'), 'data-selected-text-format'=>'count > 1', 'data-style'=>'btn-default btn-sm', 'data-width'=>'fit')); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm hidden">
|
||||
<?php echo form_label($this->lang->line('attributes_definition_values'), 'definition_value', array('class' => 'control-label col-xs-3')); ?>
|
||||
<div class='col-xs-8'>
|
||||
<div class="input-group">
|
||||
<?php echo form_input(array('name'=>'definition_value', 'class'=>'form-control input-sm', 'id' => 'definition_value'));?>
|
||||
<span class="input-group-btn">
|
||||
<button id="definition_value_add" class="btn input-sm" type="button"><span class="glyphicon glyphicon-plus-sign"></span></button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm hidden">
|
||||
<?php echo form_label(' ', 'definition_list_group', array('class' => 'control-label col-xs-3')); ?>
|
||||
<div class='col-xs-8'>
|
||||
<ul id="definition_list_group" class="list-group"></ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
<?php echo form_close(); ?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
//validation and submit handling
|
||||
$(document).ready(function()
|
||||
{
|
||||
$(".modal-body").css("overflow-y", "visible");
|
||||
var values = [];
|
||||
var definition_id = <?php echo $definition_id; ?>;
|
||||
var is_new = definition_id == -1;
|
||||
|
||||
var show_hide_fields = function(event)
|
||||
{
|
||||
$("#definition_value, #definition_list_group").parents(".form-group").toggleClass("hidden", $("#definition_type").val() !== "1");
|
||||
$("#definition_flags").parents(".form-group").toggleClass("hidden", $("definition_type").val() == "0");
|
||||
};
|
||||
|
||||
$('#definition_type').change(show_hide_fields);
|
||||
show_hide_fields();
|
||||
|
||||
$('.selectpicker').each(function () {
|
||||
var $selectpicker = $(this);
|
||||
$.fn.selectpicker.call($selectpicker, $selectpicker.data());
|
||||
});
|
||||
|
||||
var remove_attribute_value = function()
|
||||
{
|
||||
var value = $(this).parents("li").text();
|
||||
|
||||
if (is_new)
|
||||
{
|
||||
values.splice($.inArray(value, values), 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$.post('<?php echo site_url($controller_name."/delete_attribute_value/");?>' + value, {definition_id: definition_id});
|
||||
}
|
||||
$(this).parents("li").remove();
|
||||
};
|
||||
|
||||
var add_attribute_value = function(value)
|
||||
{
|
||||
var is_event = typeof(value) !== 'string';
|
||||
|
||||
if (is_event)
|
||||
{
|
||||
value = $("#definition_value").val();
|
||||
|
||||
if (!value)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (is_new)
|
||||
{
|
||||
values.push(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
$.post('<?php echo site_url("attributes/save_attribute_value/");?>' + value, {definition_id: definition_id});
|
||||
}
|
||||
}
|
||||
|
||||
$("#definition_list_group").append("<li class='list-group-item'>" + value + "<a href='javascript:void(0);'><span class='glyphicon glyphicon-trash pull-right'></span></a></li>")
|
||||
.find(':last-child a').click(remove_attribute_value);
|
||||
$("#definition_value").val("");
|
||||
};
|
||||
|
||||
$("#definition_value_add").click(add_attribute_value);
|
||||
|
||||
$("#definition_value").keypress(function (e) {
|
||||
if (e.which == 13) {
|
||||
add_attribute_value();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
var definition_values = <?php echo json_encode($definition_values) ?>;
|
||||
$.each(definition_values, function(index, element) {
|
||||
add_attribute_value(element);
|
||||
});
|
||||
|
||||
$('#attribute_form').validate($.extend({
|
||||
submitHandler:function(form)
|
||||
{
|
||||
$(form).ajaxSubmit({
|
||||
beforeSerialize: function($form, options) {
|
||||
is_new && $('<input>').attr({
|
||||
id: 'definition_values',
|
||||
type: 'hidden',
|
||||
name: 'definition_values',
|
||||
value: JSON.stringify(values)
|
||||
}).appendTo($form);
|
||||
},
|
||||
success:function(response)
|
||||
{
|
||||
dialog_support.hide();
|
||||
table_support.handle_submit('<?php echo site_url($controller_name); ?>', response);
|
||||
},
|
||||
dataType:'json'
|
||||
});
|
||||
},
|
||||
rules:
|
||||
{
|
||||
definition_name: "required",
|
||||
definition_type: "required"
|
||||
}
|
||||
}, form_support.error));
|
||||
});
|
||||
</script>
|
||||
69
application/views/attributes/item.php
Normal file
69
application/views/attributes/item.php
Normal file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
foreach($definition_values as $definition_value)
|
||||
{
|
||||
if ($definition_value['definition_type'] == CATEGORY)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($definition_value['definition_name'], $definition_value['definition_name'], array('class'=>'control-label col-xs-3')); ?>
|
||||
<div class='col-xs-8'>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon input-sm"><span class="glyphicon glyphicon-tag"></span></span>
|
||||
<?php
|
||||
$definition_id = $definition_value['definition_id'];
|
||||
$definition_name = 'definition_' . $definition_id;
|
||||
if ($definition_value['definition_type'] == DATE)
|
||||
{
|
||||
echo form_input(array(
|
||||
'name' => $definition_name,
|
||||
'value' => date($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), strtotime($definition_value['attribute_value'])),
|
||||
'class' => 'form-control input-sm',
|
||||
'data-definition-id' => $definition_value['definition_id'],
|
||||
'readonly' => 'true'));
|
||||
}
|
||||
else if ($definition_value['definition_type'] == DROPDOWN)
|
||||
{
|
||||
$values = $this->Attribute->get_definition_values($definition_id);
|
||||
$selected_value = $this->Attribute->get_link_value($item_id, $definition_id);
|
||||
echo form_dropdown($definition_name, $values, (empty($selected_value) ? NULL : $selected_value->attribute_id), "class='form-control' data-definition-id='$definition_id'");
|
||||
}
|
||||
else if ($definition_value['definition_type'] == TEXT)
|
||||
{
|
||||
$attribute_value = $this->Attribute->get_attribute_value($item_id, $definition_id);
|
||||
$value = (empty($attribute_value) || empty($attribute_value->attribute_value)) ? NULL : $attribute_value->attribute_value;
|
||||
$id = (empty($attribute_value) || empty($attribute_value->attribute_id)) ? NULL : $attribute_value->attribute_id;
|
||||
echo form_input($definition_name, $value, "class='form-control' data-attribute-id='$id'");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
$('input[name="<?php echo $definition_name; ?>"]').autocomplete({
|
||||
source: '<?php echo site_url("attributes/suggest_attribute/$definition_id");?>',
|
||||
appendTo: '.modal-content',
|
||||
select: function (a, ui) {
|
||||
$(this).data('attribute_id', ui.item.value);
|
||||
$(this).val(ui.item.label);
|
||||
},
|
||||
delay:10
|
||||
});
|
||||
|
||||
$("input[name*='definition'][type='text']").change(function() {
|
||||
$.post('<?php echo site_url("attributes/save_attribute_value/");?>' + $(this).val(), {
|
||||
item_id: <?php echo $item_id; ?>,
|
||||
definition_id: <?php echo $definition_id; ?>,
|
||||
attribute_id: $(this).data('attribute-id')
|
||||
});
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
37
application/views/attributes/manage.php
Normal file
37
application/views/attributes/manage.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php $this->load->view("partial/header"); ?>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function()
|
||||
{
|
||||
<?php $this->load->view('partial/bootstrap_tables_locale'); ?>
|
||||
|
||||
table_support.init({
|
||||
resource: '<?php echo site_url($controller_name);?>',
|
||||
headers: <?php echo $table_headers; ?>,
|
||||
pageSize: <?php echo $this->config->item('lines_per_page'); ?>,
|
||||
uniqueId: 'definition_id'
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<div id="title_bar" class="btn-toolbar print_hide">
|
||||
|
||||
<button class='btn btn-info btn-sm pull-right modal-dlg' data-btn-submit='<?php echo $this->lang->line('common_submit') ?>' data-href='<?php echo site_url($controller_name."/view"); ?>'
|
||||
title='<?php echo $this->lang->line($controller_name . '_new'); ?>'>
|
||||
<span class="glyphicon glyphicon-star"> </span><?php echo $this->lang->line($controller_name. '_new'); ?>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div id="toolbar">
|
||||
<div class="pull-left form-inline" role="toolbar">
|
||||
<button id="delete" class="btn btn-default btn-sm print_hide">
|
||||
<span class="glyphicon glyphicon-trash"> </span><?php echo $this->lang->line("common_delete"); ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="table_holder">
|
||||
<table id="table"></table>
|
||||
</div>
|
||||
|
||||
<?php $this->load->view("partial/footer"); ?>
|
||||
@@ -235,116 +235,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_custom1'), 'config_custom1', array('class' => 'control-label col-xs-2')); ?>
|
||||
<div class='col-xs-2'>
|
||||
<?php echo form_input(array(
|
||||
'name' => 'custom1_name',
|
||||
'id' => 'custom1_name',
|
||||
'class' => 'form-control input-sm',
|
||||
'value' => $this->config->item('custom1_name'))); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_custom2'), 'config_custom2', array('class' => 'control-label col-xs-2')); ?>
|
||||
<div class='col-xs-2'>
|
||||
<?php echo form_input(array(
|
||||
'name' => 'custom2_name',
|
||||
'id' => 'custom2_name',
|
||||
'class' => 'form-control input-sm',
|
||||
'value' => $this->config->item('custom2_name'))); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_custom3'), 'config_custom3', array('class' => 'control-label col-xs-2')); ?>
|
||||
<div class='col-xs-2'>
|
||||
<?php echo form_input(array(
|
||||
'name' => 'custom3_name',
|
||||
'id' => 'custom3_name',
|
||||
'class' => 'form-control input-sm',
|
||||
'value' => $this->config->item('custom3_name'))); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_custom4'), 'config_custom4', array('class' => 'control-label col-xs-2')); ?>
|
||||
<div class='col-xs-2'>
|
||||
<?php echo form_input(array(
|
||||
'name' => 'custom4_name',
|
||||
'id' => 'custom4_name',
|
||||
'class' => 'form-control input-sm',
|
||||
'value' => $this->config->item('custom4_name'))); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_custom5'), 'config_custom5', array('class' => 'control-label col-xs-2')); ?>
|
||||
<div class='col-xs-2'>
|
||||
<?php echo form_input(array(
|
||||
'name' => 'custom5_name',
|
||||
'id' => 'custom5_name',
|
||||
'class' => 'form-control input-sm',
|
||||
'value' => $this->config->item('custom5_name'))); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_custom6'), 'config_custom6', array('class' => 'control-label col-xs-2')); ?>
|
||||
<div class='col-xs-2'>
|
||||
<?php echo form_input(array(
|
||||
'name' => 'custom6_name',
|
||||
'id' => 'custom6_name',
|
||||
'class' => 'form-control input-sm',
|
||||
'value' => $this->config->item('custom6_name'))); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_custom7'), 'config_custom7', array('class' => 'control-label col-xs-2')); ?>
|
||||
<div class='col-xs-2'>
|
||||
<?php echo form_input(array(
|
||||
'name' => 'custom7_name',
|
||||
'id' => 'custom7_name',
|
||||
'class' => 'form-control input-sm',
|
||||
'value' => $this->config->item('custom7_name'))); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_custom8'), 'config_custom8', array('class' => 'control-label col-xs-2')); ?>
|
||||
<div class='col-xs-2'>
|
||||
<?php echo form_input(array(
|
||||
'name' => 'custom8_name',
|
||||
'id' => 'custom8_name',
|
||||
'class' => 'form-control input-sm',
|
||||
'value' => $this->config->item('custom8_name'))); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_custom9'), 'config_custom9', array('class' => 'control-label col-xs-2')); ?>
|
||||
<div class='col-xs-2'>
|
||||
<?php echo form_input(array(
|
||||
'name' => 'custom9_name',
|
||||
'id' => 'custom9_name',
|
||||
'class' => 'form-control input-sm',
|
||||
'value' => $this->config->item('custom9_name'))); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_custom10'), 'config_custom10', array('class' => 'control-label col-xs-2')); ?>
|
||||
<div class='col-xs-2'>
|
||||
<?php echo form_input(array(
|
||||
'name' => 'custom10_name',
|
||||
'id' => 'custom10_name',
|
||||
'class' => 'form-control input-sm',
|
||||
'value' => $this->config->item('custom10_name'))); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_backup_database'), 'config_backup_database', array('class' => 'control-label col-xs-2')); ?>
|
||||
<div class='col-xs-2'>
|
||||
|
||||
@@ -46,6 +46,10 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="attributes">
|
||||
<?php $this->load->view('attributes/item', array('item_id' => $item_info->item_id)); ?>
|
||||
</div>
|
||||
|
||||
<?php if ($item_kits_enabled == '1'): ?>
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('items_stock_type'), 'stock_type', !empty($basic_version) ? array('class'=>'required control-label col-xs-3') : array('class'=>'control-label col-xs-3')); ?>
|
||||
@@ -387,44 +391,20 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
for ($i = 1; $i <= 10; ++$i)
|
||||
{
|
||||
?>
|
||||
<?php
|
||||
if($this->config->item('custom'.$i.'_name') != NULL)
|
||||
{
|
||||
$item_arr = (array)$item_info;
|
||||
?>
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->config->item('custom'.$i.'_name'), 'custom'.$i, array('class'=>'control-label col-xs-3')); ?>
|
||||
<div class='col-xs-8'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'custom'.$i,
|
||||
'id'=>'custom'.$i,
|
||||
'class'=>'form-control input-sm',
|
||||
'value'=>$item_arr['custom'.$i])
|
||||
);?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</fieldset>
|
||||
<?php echo form_close(); ?>
|
||||
|
||||
<script type="text/javascript">
|
||||
//validation and submit handling
|
||||
$(document).ready(function()
|
||||
{
|
||||
$('#new').click(function() {
|
||||
stay_open = true;
|
||||
$('#item_form').submit();
|
||||
});
|
||||
//validation and submit handling
|
||||
$(document).ready(function()
|
||||
{
|
||||
$("#new").click(function() {
|
||||
stay_open = true;
|
||||
$("#item_form").submit();
|
||||
});
|
||||
|
||||
$('#submit').click(function() {
|
||||
stay_open = false;
|
||||
$("#submit").click(function() {
|
||||
stay_open = false;
|
||||
});
|
||||
|
||||
var fill_value = function(event, ui) {
|
||||
@@ -441,176 +421,187 @@ $(document).ready(function()
|
||||
appendTo: '.modal-content',
|
||||
select: fill_value,
|
||||
focus: fill_value
|
||||
});
|
||||
});
|
||||
|
||||
var no_op = function(event, data, formatted){};
|
||||
$('#category').autocomplete({
|
||||
source: "<?php echo site_url('items/suggest_category'); ?>",
|
||||
appendTo: '.modal-content',
|
||||
delay: 10
|
||||
});
|
||||
$("#category").autocomplete({source: "<?php echo site_url('items/suggest_category');?>",delay:10,appendTo: '.modal-content'});
|
||||
|
||||
<?php for ($i = 1; $i <= 10; ++$i)
|
||||
{
|
||||
?>
|
||||
$('#custom' + <?php echo $i; ?>).autocomplete({
|
||||
source:function (request, response) {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: "<?php echo site_url('items/suggest_custom'); ?>",
|
||||
dataType: 'json',
|
||||
data: $.extend(request, {field_no: <?php echo $i; ?>}),
|
||||
success: function(data) {
|
||||
response($.map(data, function(item) {
|
||||
return {
|
||||
value: item.label
|
||||
};
|
||||
}))
|
||||
}
|
||||
var load_attributes = function(just_opened)
|
||||
{
|
||||
var definition_id = $(this).val() || 0;
|
||||
var item_id = $("form").attr('action').split("/").pop();
|
||||
|
||||
var save_link = function()
|
||||
{
|
||||
var definition_attr_id = $(this).data('definition-id');
|
||||
if (definition_attr_id)
|
||||
{
|
||||
$.post('<?php echo site_url("attributes/save_attribute_link/");?>' + item_id, {definition_id : definition_attr_id, attribute_id : $(this).val()});
|
||||
}
|
||||
else if (definition_id && definition_id != -1)
|
||||
{
|
||||
$.post('<?php echo site_url("attributes/save_attribute_link/");?>' + item_id, {definition_id : definition_id});
|
||||
}
|
||||
};
|
||||
|
||||
var delete_link = function()
|
||||
{
|
||||
$.get('<?php echo site_url("attributes/delete_attribute_link/");?>' + item_id);
|
||||
};
|
||||
|
||||
save_link.call(this);
|
||||
|
||||
$("#attributes").load('<?php echo site_url("items/attributes");?>/' + [item_id, definition_id].join("/"), function()
|
||||
{
|
||||
var new_def = definition_id < 0;
|
||||
new_def && typeof just_opened != 'boolean' && delete_link.call(this);
|
||||
|
||||
$("#attributes select, #attributes input[type='text']").each(function()
|
||||
{
|
||||
$(this).change(save_link) && save_link.call(this);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
$("#category").change(load_attributes);
|
||||
load_attributes.call($("#category"), true);
|
||||
|
||||
$("a.fileinput-exists").click(function() {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "<?php echo site_url("$controller_name/remove_logo/$item_info->item_id"); ?>",
|
||||
dataType: "json"
|
||||
})
|
||||
});
|
||||
|
||||
$('#item_form').validate($.extend({
|
||||
submitHandler: function(form, event) {
|
||||
$(form).ajaxSubmit({
|
||||
success: function(response) {
|
||||
var stay_open = dialog_support.clicked_id() != 'submit';
|
||||
if (stay_open)
|
||||
{
|
||||
// set action of item_form to url without item id, so a new one can be created
|
||||
$("#item_form").attr("action", "<?php echo site_url("items/save/")?>");
|
||||
// use a whitelist of fields to minimize unintended side effects
|
||||
$(':text, :password, :file, #description, #item_form').not('.quantity, #reorder_level, #tax_name_1,' +
|
||||
'#tax_percent_name_1, #reference_number, #name, #cost_price, #unit_price, #taxed_cost_price, #taxed_unit_price').val('');
|
||||
// de-select any checkboxes, radios and drop-down menus
|
||||
$(':input', '#item_form').not('#category').removeAttr('checked').removeAttr('selected');
|
||||
}
|
||||
else
|
||||
{
|
||||
dialog_support.hide();
|
||||
}
|
||||
table_support.handle_submit('<?php echo site_url('items'); ?>', response, stay_open);
|
||||
},
|
||||
dataType: 'json'
|
||||
});
|
||||
},
|
||||
delay: 10,
|
||||
appendTo: '.modal-content'});
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
$('a.fileinput-exists').click(function() {
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: "<?php echo site_url($controller_name . '/remove_logo/' . $item_info->item_id); ?>",
|
||||
dataType: 'json'
|
||||
})
|
||||
});
|
||||
|
||||
$('#item_form').validate($.extend({
|
||||
submitHandler: function(form, event) {
|
||||
$(form).ajaxSubmit({
|
||||
success: function(response) {
|
||||
var stay_open = dialog_support.clicked_id() != 'submit';
|
||||
if (stay_open)
|
||||
{
|
||||
// set action of item_form to url without item id, so a new one can be created
|
||||
$('#item_form').attr('action', "<?php echo site_url($controller_name . '/save')?>");
|
||||
// use a whitelist of fields to minimize unintended side effects
|
||||
$(':text, :password, :file, #description, #item_form').not('.quantity, #reorder_level, #tax_name_1,' +
|
||||
'#tax_percent_name_1, #reference_number, #name, #cost_price, #unit_price, #taxed_cost_price, #taxed_unit_price').val('');
|
||||
// de-select any checkboxes, radios and drop-down menus
|
||||
$(':input', '#item_form').not('#item_category_id').removeAttr('checked').removeAttr('selected');
|
||||
}
|
||||
else
|
||||
{
|
||||
dialog_support.hide();
|
||||
}
|
||||
table_support.handle_submit("<?php echo site_url($controller_name); ?>", response, stay_open);
|
||||
},
|
||||
dataType: 'json'
|
||||
});
|
||||
},
|
||||
|
||||
errorLabelContainer: '#error_message_box',
|
||||
|
||||
rules:
|
||||
{
|
||||
name: 'required',
|
||||
category: 'required',
|
||||
item_number:
|
||||
rules:
|
||||
{
|
||||
required: false,
|
||||
remote:
|
||||
name:"required",
|
||||
category: "required",
|
||||
item_number:
|
||||
{
|
||||
url: "<?php echo site_url($controller_name . '/check_item_number')?>",
|
||||
required: false,
|
||||
remote:
|
||||
{
|
||||
url: "<?php echo site_url($controller_name . '/check_item_number')?>",
|
||||
type: 'POST',
|
||||
data: {
|
||||
"item_id": "<?php echo $item_info->item_id; ?>",
|
||||
"item_number": function() {
|
||||
return $("#item_number").val();
|
||||
}
|
||||
"item_id" : "<?php echo $item_info->item_id; ?>",
|
||||
"item_number" : function()
|
||||
{
|
||||
return $("#item_number").val();
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
cost_price:
|
||||
{
|
||||
required: true,
|
||||
remote: "<?php echo site_url($controller_name . '/check_numeric')?>"
|
||||
},
|
||||
unit_price:
|
||||
{
|
||||
required: true,
|
||||
remote: "<?php echo site_url($controller_name . '/check_numeric')?>"
|
||||
},
|
||||
<?php
|
||||
foreach($stock_locations as $key=>$location_detail)
|
||||
{
|
||||
?>
|
||||
<?php echo 'quantity_' . $key ?>:
|
||||
},
|
||||
cost_price:
|
||||
{
|
||||
required: true,
|
||||
remote: "<?php echo site_url($controller_name . '/check_numeric')?>"
|
||||
},
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
receiving_quantity:
|
||||
{
|
||||
required: true,
|
||||
remote: "<?php echo site_url($controller_name . '/check_numeric')?>"
|
||||
},
|
||||
reorder_level:
|
||||
{
|
||||
required: true,
|
||||
remote: "<?php echo site_url($controller_name . '/check_numeric')?>"
|
||||
},
|
||||
tax_percent:
|
||||
{
|
||||
required: true,
|
||||
remote: "<?php echo site_url($controller_name . '/check_numeric')?>"
|
||||
}
|
||||
},
|
||||
|
||||
messages:
|
||||
{
|
||||
name: "<?php echo $this->lang->line('items_name_required'); ?>",
|
||||
item_number: "<?php echo $this->lang->line('items_item_number_duplicate'); ?>",
|
||||
category: "<?php echo $this->lang->line('items_category_required'); ?>",
|
||||
cost_price:
|
||||
{
|
||||
required: "<?php echo $this->lang->line('items_cost_price_required'); ?>",
|
||||
number: "<?php echo $this->lang->line('items_cost_price_number'); ?>"
|
||||
},
|
||||
unit_price:
|
||||
{
|
||||
required: "<?php echo $this->lang->line('items_unit_price_required'); ?>",
|
||||
number: "<?php echo $this->lang->line('items_unit_price_number'); ?>"
|
||||
},
|
||||
<?php
|
||||
foreach($stock_locations as $key=>$location_detail)
|
||||
{
|
||||
?>
|
||||
<?php echo 'quantity_' . $key ?>:
|
||||
unit_price:
|
||||
{
|
||||
required: "<?php echo $this->lang->line('items_quantity_required'); ?>",
|
||||
number: "<?php echo $this->lang->line('items_quantity_number'); ?>"
|
||||
required:true,
|
||||
remote: "<?php echo site_url($controller_name . '/check_numeric')?>"
|
||||
},
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
receiving_quantity:
|
||||
{
|
||||
required: "<?php echo $this->lang->line('items_quantity_required'); ?>",
|
||||
number: "<?php echo $this->lang->line('items_quantity_number'); ?>"
|
||||
<?php
|
||||
foreach($stock_locations as $key=>$location_detail)
|
||||
{
|
||||
?>
|
||||
<?php echo 'quantity_' . $key ?>:
|
||||
{
|
||||
required:true,
|
||||
remote: "<?php echo site_url($controller_name . '/check_numeric')?>"
|
||||
},
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
receiving_quantity:
|
||||
{
|
||||
required:true,
|
||||
remote: "<?php echo site_url($controller_name . '/check_numeric')?>"
|
||||
},
|
||||
reorder_level:
|
||||
{
|
||||
required:true,
|
||||
remote: "<?php echo site_url($controller_name . '/check_numeric')?>"
|
||||
},
|
||||
tax_percent:
|
||||
{
|
||||
required:true,
|
||||
remote: "<?php echo site_url($controller_name . '/check_numeric')?>"
|
||||
}
|
||||
},
|
||||
reorder_level:
|
||||
|
||||
messages:
|
||||
{
|
||||
required: "<?php echo $this->lang->line('items_reorder_level_required'); ?>",
|
||||
number: "<?php echo $this->lang->line('items_reorder_level_number'); ?>"
|
||||
},
|
||||
tax_percent:
|
||||
{
|
||||
required: "<?php echo $this->lang->line('items_tax_percent_required'); ?>",
|
||||
number: "<?php echo $this->lang->line('items_tax_percent_number'); ?>"
|
||||
name:"<?php echo $this->lang->line('items_name_required'); ?>",
|
||||
item_number: "<?php echo $this->lang->line('items_item_number_duplicate'); ?>",
|
||||
category: "<?php echo $this->lang->line('items_category_required'); ?>",
|
||||
cost_price:
|
||||
{
|
||||
required:"<?php echo $this->lang->line('items_cost_price_required'); ?>",
|
||||
number:"<?php echo $this->lang->line('items_cost_price_number'); ?>"
|
||||
},
|
||||
unit_price:
|
||||
{
|
||||
required:"<?php echo $this->lang->line('items_unit_price_required'); ?>",
|
||||
number:"<?php echo $this->lang->line('items_unit_price_number'); ?>"
|
||||
},
|
||||
<?php
|
||||
foreach($stock_locations as $key=>$location_detail)
|
||||
{
|
||||
?>
|
||||
<?php echo 'quantity_' . $key ?>:
|
||||
{
|
||||
required:"<?php echo $this->lang->line('items_quantity_required'); ?>",
|
||||
number:"<?php echo $this->lang->line('items_quantity_number'); ?>"
|
||||
},
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
receiving_quantity:
|
||||
{
|
||||
required:"<?php echo $this->lang->line('items_quantity_required'); ?>",
|
||||
number:"<?php echo $this->lang->line('items_quantity_number'); ?>"
|
||||
},
|
||||
reorder_level:
|
||||
{
|
||||
required:"<?php echo $this->lang->line('items_reorder_level_required'); ?>",
|
||||
number:"<?php echo $this->lang->line('items_reorder_level_number'); ?>"
|
||||
},
|
||||
tax_percent:
|
||||
{
|
||||
required:"<?php echo $this->lang->line('items_tax_percent_required'); ?>",
|
||||
number:"<?php echo $this->lang->line('items_tax_percent_number'); ?>"
|
||||
}
|
||||
}
|
||||
}
|
||||
}, form_support.error));
|
||||
});
|
||||
}, form_support.error));
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
<link rel="stylesheet" type="text/css" href="dist/opensourcepos.min.css?rel=88039333a5"/>
|
||||
<!-- end mincss template tags -->
|
||||
<!-- start minjs template tags -->
|
||||
<script type="text/javascript" src="dist/opensourcepos.min.js?rel=05b66e812a"></script>
|
||||
<script type="text/javascript" src="dist/opensourcepos.min.js?rel=d261c92f4f"></script>
|
||||
<!-- end minjs template tags -->
|
||||
<?php endif; ?>
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
|
||||
|
||||
<a class="navbar-brand hidden-sm" href="<?php echo site_url(); ?>">OSPOS</a>
|
||||
</div>
|
||||
|
||||
@@ -141,4 +141,4 @@
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $item['name']; ?></td>
|
||||
<td><?php echo $item['name'] . ' ' . $item['attribute_values']; ?></td>
|
||||
<td><?php echo to_currency($item['price']); ?></td>
|
||||
<td><?php echo to_quantity_decimals($item['quantity']) . " " . ($show_stock_locations ? " [" . $item['stock_name'] . "]" : "");
|
||||
?> x <?php echo $item['receiving_quantity'] != 0 ? to_quantity_decimals($item['receiving_quantity']) : 1; ?></td>
|
||||
|
||||
@@ -136,7 +136,7 @@ if (isset($success))
|
||||
<td><?php echo anchor($controller_name."/delete_item/$line", '<span class="glyphicon glyphicon-trash"></span>');?></td>
|
||||
<td><?php echo $item['item_number']; ?></td>
|
||||
<td style="align:center;">
|
||||
<?php echo $item['name']; ?><br /> <?php echo '[' . to_quantity_decimals($item['in_stock']) . ' in ' . $item['stock_name'] . ']'; ?>
|
||||
<?php echo $item['name'] . ' ' . $item['attribute_values']; ?><br /> <?php echo '[' . to_quantity_decimals($item['in_stock']) . ' in ' . $item['stock_name'] . ']'; ?>
|
||||
<?php echo form_hidden('location', $item['item_location']); ?>
|
||||
</td>
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ $(document).ready(function()
|
||||
?>
|
||||
<tr class="item-row">
|
||||
<td><?php echo $item['item_number']; ?></td>
|
||||
<td class="item-name"><textarea rows="4" cols="6"><?php echo $item['name']; ?></textarea></td>
|
||||
<td class="item-name"><textarea rows="4" cols="6"><?php echo ($item['is_serialized'] || $item['allow_alt_description']) && !empty($item['description']) ? $item['description'] : $item['name'] . ' ' . $item['attribute_values']; ?></textarea></td>
|
||||
<td style='text-align:center;'><textarea rows="5" cols="6"><?php echo to_quantity_decimals($item['quantity']); ?></textarea>
|
||||
</td>
|
||||
<td><textarea rows="4" cols="6"><?php echo to_currency($item['price']); ?></textarea></td>
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo ucfirst($item['name']); ?></td>
|
||||
<td><?php echo ucfirst($item['name'] . ' ' . $item['attribute_values']); ?></td>
|
||||
<td><?php echo to_currency($item['price']); ?></td>
|
||||
<td><?php echo to_quantity_decimals($item['quantity']); ?></td>
|
||||
<td class="total-value"><?php echo to_currency($item[($this->config->item('receipt_show_total_discount') ? 'total' : 'discounted_total')]); ?></td>
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo ucfirst($item['name']); ?></td>
|
||||
<td><?php echo ucfirst($item['name'] . ' ' . $item['attribute_values']); ?></td>
|
||||
<td><?php echo to_currency($item['price']); ?></td>
|
||||
<td><?php echo to_quantity_decimals($item['quantity']); ?></td>
|
||||
<td style="text-align:right;"><?php echo to_currency($item[($this->config->item('receipt_show_total_discount') ? 'total' : 'discounted_total')]); ?></td>
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo ucfirst($item['name']); ?></td>
|
||||
<td><?php echo ucfirst($item['name'] . ' ' . $item['attribute_values']); ?></td>
|
||||
<td><?php echo to_quantity_decimals($item['quantity']); ?></td>
|
||||
<td class="total-value"><?php echo to_currency($item[($this->config->item('receipt_show_total_discount') ? 'total' : 'discounted_total')]); ?></td>
|
||||
</tr>
|
||||
|
||||
@@ -156,7 +156,7 @@ if(isset($success))
|
||||
?>
|
||||
<td><?php echo $item['item_number']; ?></td>
|
||||
<td style="align: center;">
|
||||
<?php echo $item['name']; ?>
|
||||
<?php echo $item['name'] . ' ' . $item['attribute_values']; ?><br /> <?php if($item['stock_type'] == '0'): echo '[' . to_quantity_decimals($item['in_stock']) . ' in ' . $item['stock_name'] . ']'; endif; ?>
|
||||
<br/>
|
||||
<?php if ($item['stock_type'] == '0'): echo '[' . to_quantity_decimals($item['in_stock']) . ' in ' . $item['stock_name'] . ']'; endif; ?>
|
||||
</td>
|
||||
|
||||
@@ -46,6 +46,9 @@
|
||||
"bootstrap-tagsinput": "~0.8.0",
|
||||
"bootstrap-toggle": "^2.2.2"
|
||||
},
|
||||
"resolutions": {
|
||||
"jquery": "~1.12.4"
|
||||
},
|
||||
"overrides": {
|
||||
"jquery-ui": {
|
||||
"main": [
|
||||
|
||||
191
database/3.0_to_attributes.sql
Normal file
191
database/3.0_to_attributes.sql
Normal file
@@ -0,0 +1,191 @@
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `ospos_attribute_definitions` (
|
||||
`definition_id` INT(10) NOT NULL AUTO_INCREMENT,
|
||||
`definition_name` VARCHAR(255) NOT NULL,
|
||||
`definition_type` VARCHAR(45) NOT NULL,
|
||||
`definition_flags` TINYINT(4) NOT NULL,
|
||||
`definition_fk` INT(10) NULL,
|
||||
`deleted` TINYINT(1) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`definition_id`),
|
||||
KEY `definition_fk` (`definition_fk`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `ospos_attribute_values` (
|
||||
`attribute_id` INT NOT NULL AUTO_INCREMENT,
|
||||
`attribute_value` VARCHAR(45) NULL,
|
||||
PRIMARY KEY (`attribute_id`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `ospos_attribute_links` (
|
||||
`attribute_id` INT NULL,
|
||||
`definition_id` INT NOT NULL,
|
||||
`item_id` INT NULL,
|
||||
`sale_id` INT NULL,
|
||||
`receiving_id` INT NULL,
|
||||
KEY `attribute_id` (`attribute_id`),
|
||||
KEY `definition_id` (`definition_id`),
|
||||
KEY `item_id` (`item_id`),
|
||||
KEY `sale_id` (`sale_id`),
|
||||
KEY `receiving_id` (`receiving_id`),
|
||||
UNIQUE `attribute_links_uq1` (`attribute_id`, `definition_id`, `item_id`, `sale_id`, `receiving_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
ALTER TABLE `ospos_attribute_definitions`
|
||||
ADD CONSTRAINT `fk_ospos_attribute_definitions_ibfk_1` FOREIGN KEY (`definition_fk`) REFERENCES `ospos_attribute_definitions` (`definition_id`);
|
||||
|
||||
|
||||
ALTER TABLE `ospos_attribute_links`
|
||||
ADD CONSTRAINT `ospos_attribute_links_ibfk_1` FOREIGN KEY (`definition_id`) REFERENCES `ospos_attribute_definitions` (`definition_id`) ON DELETE CASCADE,
|
||||
ADD CONSTRAINT `ospos_attribute_links_ibfk_2` FOREIGN KEY (`attribute_id`) REFERENCES `ospos_attribute_values` (`attribute_id`) ON DELETE CASCADE,
|
||||
ADD CONSTRAINT `ospos_attribute_links_ibfk_3` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`),
|
||||
ADD CONSTRAINT `ospos_attribute_links_ibfk_4` FOREIGN KEY (`receiving_id`) REFERENCES `ospos_receivings` (`receiving_id`),
|
||||
ADD CONSTRAINT `ospos_attribute_links_ibfk_5` FOREIGN KEY (`sale_id`) REFERENCES `ospos_sales` (`sale_id`);
|
||||
|
||||
|
||||
UPDATE `ospos_modules` SET `sort` = 120 WHERE `name_lang_key` = 'module_config';
|
||||
|
||||
INSERT INTO `ospos_modules` (`name_lang_key`, `desc_lang_key`, `sort`, `module_id`) VALUES
|
||||
('module_attributes', 'module_attributes_desc', 110, 'attributes');
|
||||
|
||||
INSERT INTO `ospos_permissions` (`permission_id`, `module_id`) VALUES
|
||||
('attributes', 'attributes');
|
||||
|
||||
INSERT INTO `ospos_grants` (`permission_id`, `person_id`) VALUES
|
||||
('attributes', 1);
|
||||
|
||||
-- migrate categories to attribute table
|
||||
INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT category, 'CATEGORY' from ospos_items;
|
||||
INSERT INTO `ospos_attribute_links` (item_id, definition_id)
|
||||
SELECT item_id, definition_id FROM ospos_items
|
||||
JOIN ospos_attribute_definitions ON ospos_attribute_definitions.definition_name = ospos_items.category;
|
||||
|
||||
-- migrate custom fields to text attributes
|
||||
-- NOTE: items with custom attributes won't keep their selected category!!
|
||||
INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config where `key` = 'custom1';
|
||||
INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config where `key` = 'custom2';
|
||||
INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config where `key` = 'custom3';
|
||||
INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config where `key` = 'custom4';
|
||||
INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config where `key` = 'custom5';
|
||||
INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config where `key` = 'custom6';
|
||||
INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config where `key` = 'custom7';
|
||||
INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config where `key` = 'custom8';
|
||||
INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config where `key` = 'custom9';
|
||||
INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config where `key` = 'custom10';
|
||||
|
||||
INSERT INTO ospos_attribute_links (definition_id, item_id) SELECT definition_id, item_id FROM ospos_attribute_definitions, ospos_app_config, ospos_items
|
||||
WHERE ospos_app_config.`key` = 'custom1_name' AND ospos_app_config.`value` = ospos_attribute_definitions.definition_name AND custom1 IS NOT NULL;
|
||||
INSERT INTO ospos_attribute_links (definition_id, item_id) SELECT definition_id, item_id FROM ospos_attribute_definitions, ospos_app_config, ospos_items
|
||||
WHERE ospos_app_config.`key` = 'custom2_name' AND ospos_app_config.`value` = ospos_attribute_definitions.definition_name AND custom2 IS NOT NULL;
|
||||
INSERT INTO ospos_attribute_links (definition_id, item_id) SELECT definition_id, item_id FROM ospos_attribute_definitions, ospos_app_config, ospos_items
|
||||
WHERE ospos_app_config.`key` = 'custom3_name' AND ospos_app_config.`value` = ospos_attribute_definitions.definition_name AND custom3 IS NOT NULL;
|
||||
INSERT INTO ospos_attribute_links (definition_id, item_id) SELECT definition_id, item_id FROM ospos_attribute_definitions, ospos_app_config, ospos_items
|
||||
WHERE ospos_app_config.`key` = 'custom4_name' AND ospos_app_config.`value` = ospos_attribute_definitions.definition_name AND custom4 IS NOT NULL;
|
||||
INSERT INTO ospos_attribute_links (definition_id, item_id) SELECT definition_id, item_id FROM ospos_attribute_definitions, ospos_app_config, ospos_items
|
||||
WHERE ospos_app_config.`key` = 'custom5_name' AND ospos_app_config.`value` = ospos_attribute_definitions.definition_name AND custom5 IS NOT NULL;
|
||||
INSERT INTO ospos_attribute_links (definition_id, item_id) SELECT definition_id, item_id FROM ospos_attribute_definitions, ospos_app_config, ospos_items
|
||||
WHERE ospos_app_config.`key` = 'custom6_name' AND ospos_app_config.`value` = ospos_attribute_definitions.definition_name AND custom6 IS NOT NULL;
|
||||
INSERT INTO ospos_attribute_links (definition_id, item_id) SELECT definition_id, item_id FROM ospos_attribute_definitions, ospos_app_config, ospos_items
|
||||
WHERE ospos_app_config.`key` = 'custom7_name' AND ospos_app_config.`value` = ospos_attribute_definitions.definition_name AND custom7 IS NOT NULL;
|
||||
INSERT INTO ospos_attribute_links (definition_id, item_id) SELECT definition_id, item_id FROM ospos_attribute_definitions, ospos_app_config, ospos_items
|
||||
WHERE ospos_app_config.`key` = 'custom8_name' AND ospos_app_config.`value` = ospos_attribute_definitions.definition_name AND custom8 IS NOT NULL;
|
||||
INSERT INTO ospos_attribute_links (definition_id, item_id) SELECT definition_id, item_id FROM ospos_attribute_definitions, ospos_app_config, ospos_items
|
||||
WHERE ospos_app_config.`key` = 'custom9_name' AND ospos_app_config.`value` = ospos_attribute_definitions.definition_name AND custom9 IS NOT NULL;
|
||||
INSERT INTO ospos_attribute_links (definition_id, item_id) SELECT definition_id, item_id FROM ospos_attribute_definitions, ospos_app_config, ospos_items
|
||||
WHERE ospos_app_config.`key` = 'custom10_name' AND ospos_app_config.`value` = ospos_attribute_definitions.definition_name AND custom10 IS NOT NULL;
|
||||
|
||||
INSERT INTO ospos_attribute_values (attribute_value) SELECT custom1 FROM ospos_items;
|
||||
INSERT INTO ospos_attribute_values (attribute_value) SELECT custom2 FROM ospos_items;
|
||||
INSERT INTO ospos_attribute_values (attribute_value) SELECT custom3 FROM ospos_items;
|
||||
INSERT INTO ospos_attribute_values (attribute_value) SELECT custom4 FROM ospos_items;
|
||||
INSERT INTO ospos_attribute_values (attribute_value) SELECT custom5 FROM ospos_items;
|
||||
INSERT INTO ospos_attribute_values (attribute_value) SELECT custom6 FROM ospos_items;
|
||||
INSERT INTO ospos_attribute_values (attribute_value) SELECT custom7 FROM ospos_items;
|
||||
INSERT INTO ospos_attribute_values (attribute_value) SELECT custom8 FROM ospos_items;
|
||||
INSERT INTO ospos_attribute_values (attribute_value) SELECT custom9 FROM ospos_items;
|
||||
INSERT INTO ospos_attribute_values (attribute_value) SELECT custom10 FROM ospos_items;
|
||||
|
||||
UPDATE ospos_attribute_links
|
||||
INNER JOIN ospos_items ON ospos_attribute_links.item_id = ospos_items.item_id
|
||||
INNER JOIN ospos_attribute_values ON attribute_value = custom1
|
||||
SET ospos_attribute_links.attribute_id = ospos_attribute_values.attribute_id
|
||||
WHERE definition_id IN (SELECT definition_id FROM ospos_attribute_definitions
|
||||
WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom1_name'));
|
||||
|
||||
UPDATE ospos_attribute_links
|
||||
INNER JOIN ospos_items ON ospos_attribute_links.item_id = ospos_items.item_id
|
||||
INNER JOIN ospos_attribute_values ON attribute_value = custom2
|
||||
SET ospos_attribute_links.attribute_id = ospos_attribute_values.attribute_id
|
||||
WHERE definition_id IN (SELECT definition_id FROM ospos_attribute_definitions
|
||||
WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom2_name'));
|
||||
|
||||
UPDATE ospos_attribute_links
|
||||
INNER JOIN ospos_items ON ospos_attribute_links.item_id = ospos_items.item_id
|
||||
INNER JOIN ospos_attribute_values ON attribute_value = custom3
|
||||
SET ospos_attribute_links.attribute_id = ospos_attribute_values.attribute_id
|
||||
WHERE definition_id IN (SELECT definition_id FROM ospos_attribute_definitions
|
||||
WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom3_name'));
|
||||
|
||||
UPDATE ospos_attribute_links
|
||||
INNER JOIN ospos_items ON ospos_attribute_links.item_id = ospos_items.item_id
|
||||
INNER JOIN ospos_attribute_values ON attribute_value = custom4
|
||||
SET ospos_attribute_links.attribute_id = ospos_attribute_values.attribute_id
|
||||
WHERE definition_id IN (SELECT definition_id FROM ospos_attribute_definitions
|
||||
WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom4_name'));
|
||||
|
||||
UPDATE ospos_attribute_links
|
||||
INNER JOIN ospos_items ON ospos_attribute_links.item_id = ospos_items.item_id
|
||||
INNER JOIN ospos_attribute_values ON attribute_value = custom5
|
||||
SET ospos_attribute_links.attribute_id = ospos_attribute_values.attribute_id
|
||||
WHERE definition_id IN (SELECT definition_id FROM ospos_attribute_definitions
|
||||
WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom5_name'));
|
||||
|
||||
UPDATE ospos_attribute_links
|
||||
INNER JOIN ospos_items ON ospos_attribute_links.item_id = ospos_items.item_id
|
||||
INNER JOIN ospos_attribute_values ON attribute_value = custom6
|
||||
SET ospos_attribute_links.attribute_id = ospos_attribute_values.attribute_id
|
||||
WHERE definition_id IN (SELECT definition_id FROM ospos_attribute_definitions
|
||||
WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom6_name'));
|
||||
|
||||
UPDATE ospos_attribute_links
|
||||
INNER JOIN ospos_items ON ospos_attribute_links.item_id = ospos_items.item_id
|
||||
INNER JOIN ospos_attribute_values ON attribute_value = custom7
|
||||
SET ospos_attribute_links.attribute_id = ospos_attribute_values.attribute_id
|
||||
WHERE definition_id IN (SELECT definition_id FROM ospos_attribute_definitions
|
||||
WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom7_name'));
|
||||
|
||||
UPDATE ospos_attribute_links
|
||||
INNER JOIN ospos_items ON ospos_attribute_links.item_id = ospos_items.item_id
|
||||
INNER JOIN ospos_attribute_values ON attribute_value = custom8
|
||||
SET ospos_attribute_links.attribute_id = ospos_attribute_values.attribute_id
|
||||
WHERE definition_id IN (SELECT definition_id FROM ospos_attribute_definitions
|
||||
WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom8_name'));
|
||||
|
||||
UPDATE ospos_attribute_links
|
||||
INNER JOIN ospos_items ON ospos_attribute_links.item_id = ospos_items.item_id
|
||||
INNER JOIN ospos_attribute_values ON attribute_value = custom9
|
||||
SET ospos_attribute_links.attribute_id = ospos_attribute_values.attribute_id
|
||||
WHERE definition_id IN (SELECT definition_id FROM ospos_attribute_definitions
|
||||
WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom9_name'));
|
||||
|
||||
UPDATE ospos_attribute_links
|
||||
INNER JOIN ospos_items ON ospos_attribute_links.item_id = ospos_items.item_id
|
||||
INNER JOIN ospos_attribute_values ON attribute_value = custom10
|
||||
SET ospos_attribute_links.attribute_id = ospos_attribute_values.attribute_id
|
||||
WHERE definition_id IN (SELECT definition_id FROM ospos_attribute_definitions
|
||||
WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom10_name'));
|
||||
|
||||
ALTER TABLE `ospos_items`
|
||||
DROP COLUMN `custom1`,
|
||||
DROP COLUMN `custom2`,
|
||||
DROP COLUMN `custom3`,
|
||||
DROP COLUMN `custom4`,
|
||||
DROP COLUMN `custom5`,
|
||||
DROP COLUMN `custom6`,
|
||||
DROP COLUMN `custom7`,
|
||||
DROP COLUMN `custom8`,
|
||||
DROP COLUMN `custom9`,
|
||||
DROP COLUMN `custom10`,
|
||||
DROP COLUMN `category`;
|
||||
191
database/3.1.0_to_attributes.sql
Normal file
191
database/3.1.0_to_attributes.sql
Normal file
@@ -0,0 +1,191 @@
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `ospos_attribute_definitions` (
|
||||
`definition_id` INT(10) NOT NULL AUTO_INCREMENT,
|
||||
`definition_name` VARCHAR(255) NOT NULL,
|
||||
`definition_type` VARCHAR(45) NOT NULL,
|
||||
`definition_flags` TINYINT(4) NOT NULL,
|
||||
`definition_fk` INT(10) NULL,
|
||||
`deleted` TINYINT(1) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`definition_id`),
|
||||
KEY `definition_fk` (`definition_fk`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `ospos_attribute_values` (
|
||||
`attribute_id` INT NOT NULL AUTO_INCREMENT,
|
||||
`attribute_value` VARCHAR(45) NULL,
|
||||
PRIMARY KEY (`attribute_id`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `ospos_attribute_links` (
|
||||
`attribute_id` INT NULL,
|
||||
`definition_id` INT NOT NULL,
|
||||
`item_id` INT NULL,
|
||||
`sale_id` INT NULL,
|
||||
`receiving_id` INT NULL,
|
||||
KEY `attribute_id` (`attribute_id`),
|
||||
KEY `definition_id` (`definition_id`),
|
||||
KEY `item_id` (`item_id`),
|
||||
KEY `sale_id` (`sale_id`),
|
||||
KEY `receiving_id` (`receiving_id`),
|
||||
UNIQUE `attribute_links_uq1` (`attribute_id`, `definition_id`, `item_id`, `sale_id`, `receiving_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
ALTER TABLE `ospos_attribute_definitions`
|
||||
ADD CONSTRAINT `fk_ospos_attribute_definitions_ibfk_1` FOREIGN KEY (`definition_fk`) REFERENCES `ospos_attribute_definitions` (`definition_id`);
|
||||
|
||||
|
||||
ALTER TABLE `ospos_attribute_links`
|
||||
ADD CONSTRAINT `ospos_attribute_links_ibfk_1` FOREIGN KEY (`definition_id`) REFERENCES `ospos_attribute_definitions` (`definition_id`) ON DELETE CASCADE,
|
||||
ADD CONSTRAINT `ospos_attribute_links_ibfk_2` FOREIGN KEY (`attribute_id`) REFERENCES `ospos_attribute_values` (`attribute_id`) ON DELETE CASCADE,
|
||||
ADD CONSTRAINT `ospos_attribute_links_ibfk_3` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`),
|
||||
ADD CONSTRAINT `ospos_attribute_links_ibfk_4` FOREIGN KEY (`receiving_id`) REFERENCES `ospos_receivings` (`receiving_id`),
|
||||
ADD CONSTRAINT `ospos_attribute_links_ibfk_5` FOREIGN KEY (`sale_id`) REFERENCES `ospos_sales` (`sale_id`);
|
||||
|
||||
|
||||
UPDATE `ospos_modules` SET `sort` = 120 WHERE `name_lang_key` = 'module_config';
|
||||
|
||||
INSERT INTO `ospos_modules` (`name_lang_key`, `desc_lang_key`, `sort`, `module_id`) VALUES
|
||||
('module_attributes', 'module_attributes_desc', 110, 'attributes');
|
||||
|
||||
INSERT INTO `ospos_permissions` (`permission_id`, `module_id`) VALUES
|
||||
('attributes', 'attributes');
|
||||
|
||||
INSERT INTO `ospos_grants` (`permission_id`, `person_id`) VALUES
|
||||
('attributes', 1);
|
||||
|
||||
-- migrate categories to attribute table
|
||||
INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT DISTINCT category, 'CATEGORY' from ospos_items;
|
||||
INSERT INTO `ospos_attribute_links` (item_id, definition_id)
|
||||
SELECT item_id, definition_id FROM ospos_items
|
||||
JOIN ospos_attribute_definitions ON ospos_attribute_definitions.definition_name = ospos_items.category;
|
||||
|
||||
-- migrate custom fields to text attributes
|
||||
-- NOTE: items with custom attributes won't keep their selected category!!
|
||||
INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom1_name';
|
||||
INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom2_name';
|
||||
INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom3_name';
|
||||
INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom4_name';
|
||||
INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom5_name';
|
||||
INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom6_name';
|
||||
INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom7_name';
|
||||
INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom8_name';
|
||||
INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom9_name';
|
||||
INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom10_name';
|
||||
|
||||
INSERT INTO ospos_attribute_links (definition_id, item_id) SELECT definition_id, item_id FROM ospos_attribute_definitions, ospos_app_config, ospos_items
|
||||
WHERE ospos_app_config.`key` = 'custom1_name' AND ospos_app_config.`value` = ospos_attribute_definitions.definition_name AND custom1 IS NOT NULL;
|
||||
INSERT INTO ospos_attribute_links (definition_id, item_id) SELECT definition_id, item_id FROM ospos_attribute_definitions, ospos_app_config, ospos_items
|
||||
WHERE ospos_app_config.`key` = 'custom2_name' AND ospos_app_config.`value` = ospos_attribute_definitions.definition_name AND custom2 IS NOT NULL;
|
||||
INSERT INTO ospos_attribute_links (definition_id, item_id) SELECT definition_id, item_id FROM ospos_attribute_definitions, ospos_app_config, ospos_items
|
||||
WHERE ospos_app_config.`key` = 'custom3_name' AND ospos_app_config.`value` = ospos_attribute_definitions.definition_name AND custom3 IS NOT NULL;
|
||||
INSERT INTO ospos_attribute_links (definition_id, item_id) SELECT definition_id, item_id FROM ospos_attribute_definitions, ospos_app_config, ospos_items
|
||||
WHERE ospos_app_config.`key` = 'custom4_name' AND ospos_app_config.`value` = ospos_attribute_definitions.definition_name AND custom4 IS NOT NULL;
|
||||
INSERT INTO ospos_attribute_links (definition_id, item_id) SELECT definition_id, item_id FROM ospos_attribute_definitions, ospos_app_config, ospos_items
|
||||
WHERE ospos_app_config.`key` = 'custom5_name' AND ospos_app_config.`value` = ospos_attribute_definitions.definition_name AND custom5 IS NOT NULL;
|
||||
INSERT INTO ospos_attribute_links (definition_id, item_id) SELECT definition_id, item_id FROM ospos_attribute_definitions, ospos_app_config, ospos_items
|
||||
WHERE ospos_app_config.`key` = 'custom6_name' AND ospos_app_config.`value` = ospos_attribute_definitions.definition_name AND custom6 IS NOT NULL;
|
||||
INSERT INTO ospos_attribute_links (definition_id, item_id) SELECT definition_id, item_id FROM ospos_attribute_definitions, ospos_app_config, ospos_items
|
||||
WHERE ospos_app_config.`key` = 'custom7_name' AND ospos_app_config.`value` = ospos_attribute_definitions.definition_name AND custom7 IS NOT NULL;
|
||||
INSERT INTO ospos_attribute_links (definition_id, item_id) SELECT definition_id, item_id FROM ospos_attribute_definitions, ospos_app_config, ospos_items
|
||||
WHERE ospos_app_config.`key` = 'custom8_name' AND ospos_app_config.`value` = ospos_attribute_definitions.definition_name AND custom8 IS NOT NULL;
|
||||
INSERT INTO ospos_attribute_links (definition_id, item_id) SELECT definition_id, item_id FROM ospos_attribute_definitions, ospos_app_config, ospos_items
|
||||
WHERE ospos_app_config.`key` = 'custom9_name' AND ospos_app_config.`value` = ospos_attribute_definitions.definition_name AND custom9 IS NOT NULL;
|
||||
INSERT INTO ospos_attribute_links (definition_id, item_id) SELECT definition_id, item_id FROM ospos_attribute_definitions, ospos_app_config, ospos_items
|
||||
WHERE ospos_app_config.`key` = 'custom10_name' AND ospos_app_config.`value` = ospos_attribute_definitions.definition_name AND custom10 IS NOT NULL;
|
||||
|
||||
INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom1 FROM ospos_items;
|
||||
INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom2 FROM ospos_items;
|
||||
INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom3 FROM ospos_items;
|
||||
INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom4 FROM ospos_items;
|
||||
INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom5 FROM ospos_items;
|
||||
INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom6 FROM ospos_items;
|
||||
INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom7 FROM ospos_items;
|
||||
INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom8 FROM ospos_items;
|
||||
INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom9 FROM ospos_items;
|
||||
INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom10 FROM ospos_items;
|
||||
|
||||
UPDATE ospos_attribute_links
|
||||
INNER JOIN ospos_items ON ospos_attribute_links.item_id = ospos_items.item_id
|
||||
INNER JOIN ospos_attribute_values ON attribute_value = custom1
|
||||
SET ospos_attribute_links.attribute_id = ospos_attribute_values.attribute_id
|
||||
WHERE definition_id IN (SELECT definition_id FROM ospos_attribute_definitions
|
||||
WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom1_name'));
|
||||
|
||||
UPDATE ospos_attribute_links
|
||||
INNER JOIN ospos_items ON ospos_attribute_links.item_id = ospos_items.item_id
|
||||
INNER JOIN ospos_attribute_values ON attribute_value = custom2
|
||||
SET ospos_attribute_links.attribute_id = ospos_attribute_values.attribute_id
|
||||
WHERE definition_id IN (SELECT definition_id FROM ospos_attribute_definitions
|
||||
WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom2_name'));
|
||||
|
||||
UPDATE ospos_attribute_links
|
||||
INNER JOIN ospos_items ON ospos_attribute_links.item_id = ospos_items.item_id
|
||||
INNER JOIN ospos_attribute_values ON attribute_value = custom3
|
||||
SET ospos_attribute_links.attribute_id = ospos_attribute_values.attribute_id
|
||||
WHERE definition_id IN (SELECT definition_id FROM ospos_attribute_definitions
|
||||
WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom3_name'));
|
||||
|
||||
UPDATE ospos_attribute_links
|
||||
INNER JOIN ospos_items ON ospos_attribute_links.item_id = ospos_items.item_id
|
||||
INNER JOIN ospos_attribute_values ON attribute_value = custom4
|
||||
SET ospos_attribute_links.attribute_id = ospos_attribute_values.attribute_id
|
||||
WHERE definition_id IN (SELECT definition_id FROM ospos_attribute_definitions
|
||||
WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom4_name'));
|
||||
|
||||
UPDATE ospos_attribute_links
|
||||
INNER JOIN ospos_items ON ospos_attribute_links.item_id = ospos_items.item_id
|
||||
INNER JOIN ospos_attribute_values ON attribute_value = custom5
|
||||
SET ospos_attribute_links.attribute_id = ospos_attribute_values.attribute_id
|
||||
WHERE definition_id IN (SELECT definition_id FROM ospos_attribute_definitions
|
||||
WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom5_name'));
|
||||
|
||||
UPDATE ospos_attribute_links
|
||||
INNER JOIN ospos_items ON ospos_attribute_links.item_id = ospos_items.item_id
|
||||
INNER JOIN ospos_attribute_values ON attribute_value = custom6
|
||||
SET ospos_attribute_links.attribute_id = ospos_attribute_values.attribute_id
|
||||
WHERE definition_id IN (SELECT definition_id FROM ospos_attribute_definitions
|
||||
WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom6_name'));
|
||||
|
||||
UPDATE ospos_attribute_links
|
||||
INNER JOIN ospos_items ON ospos_attribute_links.item_id = ospos_items.item_id
|
||||
INNER JOIN ospos_attribute_values ON attribute_value = custom7
|
||||
SET ospos_attribute_links.attribute_id = ospos_attribute_values.attribute_id
|
||||
WHERE definition_id IN (SELECT definition_id FROM ospos_attribute_definitions
|
||||
WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom7_name'));
|
||||
|
||||
UPDATE ospos_attribute_links
|
||||
INNER JOIN ospos_items ON ospos_attribute_links.item_id = ospos_items.item_id
|
||||
INNER JOIN ospos_attribute_values ON attribute_value = custom8
|
||||
SET ospos_attribute_links.attribute_id = ospos_attribute_values.attribute_id
|
||||
WHERE definition_id IN (SELECT definition_id FROM ospos_attribute_definitions
|
||||
WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom8_name'));
|
||||
|
||||
UPDATE ospos_attribute_links
|
||||
INNER JOIN ospos_items ON ospos_attribute_links.item_id = ospos_items.item_id
|
||||
INNER JOIN ospos_attribute_values ON attribute_value = custom9
|
||||
SET ospos_attribute_links.attribute_id = ospos_attribute_values.attribute_id
|
||||
WHERE definition_id IN (SELECT definition_id FROM ospos_attribute_definitions
|
||||
WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom9_name'));
|
||||
|
||||
UPDATE ospos_attribute_links
|
||||
INNER JOIN ospos_items ON ospos_attribute_links.item_id = ospos_items.item_id
|
||||
INNER JOIN ospos_attribute_values ON attribute_value = custom10
|
||||
SET ospos_attribute_links.attribute_id = ospos_attribute_values.attribute_id
|
||||
WHERE definition_id IN (SELECT definition_id FROM ospos_attribute_definitions
|
||||
WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom10_name'));
|
||||
|
||||
ALTER TABLE `ospos_items`
|
||||
DROP COLUMN `custom1`,
|
||||
DROP COLUMN `custom2`,
|
||||
DROP COLUMN `custom3`,
|
||||
DROP COLUMN `custom4`,
|
||||
DROP COLUMN `custom5`,
|
||||
DROP COLUMN `custom6`,
|
||||
DROP COLUMN `custom7`,
|
||||
DROP COLUMN `custom8`,
|
||||
DROP COLUMN `custom9`,
|
||||
DROP COLUMN `custom10`,
|
||||
DROP COLUMN `category`;
|
||||
@@ -118,6 +118,22 @@ ALTER TABLE `ospos_suppliers`
|
||||
ALTER TABLE `ospos_giftcards`
|
||||
ADD CONSTRAINT `ospos_giftcards_ibfk_1` FOREIGN KEY (`person_id`) REFERENCES `ospos_people` (`person_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_attribute_definitions`
|
||||
--
|
||||
ALTER TABLE `ospos_attribute_definitions`
|
||||
ADD CONSTRAINT `fk_ospos_attribute_definitions_ibfk_1` FOREIGN KEY (`definition_fk`) REFERENCES `ospos_attribute_definitions` (`definition_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_attribute_links`
|
||||
--
|
||||
ALTER TABLE `ospos_attribute_links`
|
||||
ADD CONSTRAINT `ospos_attribute_links_ibfk_1` FOREIGN KEY (`definition_id`) REFERENCES `ospos_attribute_definitions` (`definition_id`) ON DELETE CASCADE,
|
||||
ADD CONSTRAINT `ospos_attribute_links_ibfk_2` FOREIGN KEY (`attribute_id`) REFERENCES `ospos_attribute_values` (`attribute_id`) ON DELETE CASCADE,
|
||||
ADD CONSTRAINT `ospos_attribute_links_ibfk_3` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`),
|
||||
ADD CONSTRAINT `ospos_attribute_links_ibfk_4` FOREIGN KEY (`receiving_id`) REFERENCES `ospos_receivings` (`receiving_id`) ON DELETE CASCADE,
|
||||
ADD CONSTRAINT `ospos_attribute_links_ibfk_5` FOREIGN KEY (`sale_id`) REFERENCES `ospos_sales` (`sale_id`) ON DELETE CASCADE;
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_customers_points`
|
||||
--
|
||||
@@ -130,4 +146,4 @@ ALTER TABLE `ospos_customers_points`
|
||||
-- Constraints for table `ospos_sales_reward_points`
|
||||
--
|
||||
ALTER TABLE `ospos_sales_reward_points`
|
||||
ADD CONSTRAINT `ospos_sales_reward_points_ibfk_1` FOREIGN KEY (`sale_id`) REFERENCES `ospos_sales` (`sale_id`);
|
||||
ADD CONSTRAINT `ospos_sales_reward_points_ibfk_1` FOREIGN KEY (`sale_id`) REFERENCES `ospos_sales_items` (`sale_id`);
|
||||
|
||||
@@ -229,7 +229,6 @@ CREATE TABLE `ospos_inventory` (
|
||||
|
||||
CREATE TABLE `ospos_items` (
|
||||
`name` varchar(255) NOT NULL,
|
||||
`category` varchar(255) NOT NULL,
|
||||
`supplier_id` int(11) DEFAULT NULL,
|
||||
`item_number` varchar(255) DEFAULT NULL,
|
||||
`description` varchar(255) NOT NULL,
|
||||
@@ -248,16 +247,6 @@ CREATE TABLE `ospos_items` (
|
||||
`pack_name` varchar(8) DEFAULT '',
|
||||
`low_sell_item_id` int(10) DEFAULT 0,
|
||||
`deleted` int(1) NOT NULL DEFAULT '0',
|
||||
`custom1` VARCHAR(255) DEFAULT NULL,
|
||||
`custom2` VARCHAR(255) DEFAULT NULL,
|
||||
`custom3` VARCHAR(255) DEFAULT NULL,
|
||||
`custom4` VARCHAR(255) DEFAULT NULL,
|
||||
`custom5` VARCHAR(255) DEFAULT NULL,
|
||||
`custom6` VARCHAR(255) DEFAULT NULL,
|
||||
`custom7` VARCHAR(255) DEFAULT NULL,
|
||||
`custom8` VARCHAR(255) DEFAULT NULL,
|
||||
`custom9` VARCHAR(255) DEFAULT NULL,
|
||||
`custom10` VARCHAR(255) DEFAULT NULL,
|
||||
PRIMARY KEY (`item_id`),
|
||||
KEY `item_number` (`item_number`),
|
||||
KEY `supplier_id` (`supplier_id`)
|
||||
@@ -363,7 +352,7 @@ CREATE TABLE `ospos_modules` (
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_modules` (`name_lang_key`, `desc_lang_key`, `sort`, `module_id`) VALUES
|
||||
('module_config', 'module_config_desc', 110, 'config'),
|
||||
('module_config', 'module_config_desc', 120, 'config'),
|
||||
('module_customers', 'module_customers_desc', 10, 'customers'),
|
||||
('module_employees', 'module_employees_desc', 80, 'employees'),
|
||||
('module_giftcards', 'module_giftcards_desc', 90, 'giftcards'),
|
||||
@@ -376,7 +365,8 @@ INSERT INTO `ospos_modules` (`name_lang_key`, `desc_lang_key`, `sort`, `module_i
|
||||
('module_reports', 'module_reports_desc', 50, 'reports'),
|
||||
('module_sales', 'module_sales_desc', 70, 'sales'),
|
||||
('module_suppliers', 'module_suppliers_desc', 40, 'suppliers'),
|
||||
('module_taxes', 'module_taxes_desc', 105, 'taxes');
|
||||
('module_taxes', 'module_taxes_desc', 105, 'taxes'),
|
||||
('module_attributes', 'module_attributes_desc', 110, 'attributes');
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@@ -452,7 +442,8 @@ INSERT INTO `ospos_permissions` (`permission_id`, `module_id`) VALUES
|
||||
('sales', 'sales'),
|
||||
('config', 'config'),
|
||||
('suppliers', 'suppliers'),
|
||||
('taxes', 'taxes');
|
||||
('taxes', 'taxes'),
|
||||
('attributes', 'attributes');
|
||||
|
||||
|
||||
|
||||
@@ -507,6 +498,7 @@ INSERT INTO `ospos_grants` (`permission_id`, `person_id`, `menu_group`) VALUES
|
||||
('suppliers', 1, 'home'),
|
||||
('taxes', 1, 'office'),
|
||||
('office', 1, 'home'),
|
||||
('attributes', 1, 'office'),
|
||||
('home', 1, 'office');
|
||||
|
||||
--
|
||||
@@ -809,6 +801,68 @@ CREATE TABLE IF NOT EXISTS `ospos_tax_code_rates` (
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_attribute_definitions`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `ospos_attribute_definitions` (
|
||||
`definition_id` INT(10) NOT NULL AUTO_INCREMENT,
|
||||
`definition_name` VARCHAR(255) NOT NULL,
|
||||
`definition_type` VARCHAR(45) NOT NULL,
|
||||
`definition_flags` TINYINT(4) NOT NULL,
|
||||
`definition_fk` INT(10) NULL,
|
||||
`deleted` TINYINT(1) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`definition_id`),
|
||||
KEY `definition_fk` (`definition_fk`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_attribute_definitions`
|
||||
--
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_attribute_values`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `ospos_attribute_values` (
|
||||
`attribute_id` INT NOT NULL AUTO_INCREMENT,
|
||||
`attribute_value` VARCHAR(45) NULL,
|
||||
PRIMARY KEY (`attribute_id`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
|
||||
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_attribute_values`
|
||||
--
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_attribute_links`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `ospos_attribute_links` (
|
||||
`attribute_id` INT NULL,
|
||||
`definition_id` INT NOT NULL,
|
||||
`item_id` INT NULL,
|
||||
`sale_id` INT NULL,
|
||||
`receiving_id` INT NULL,
|
||||
KEY `attribute_id` (`attribute_id`),
|
||||
KEY `definition_id` (`definition_id`),
|
||||
KEY `item_id` (`item_id`),
|
||||
KEY `sale_id` (`sale_id`),
|
||||
KEY `receiving_id` (`receiving_id`),
|
||||
UNIQUE `attribute_links_uq1` (`attribute_id`, `definition_id`, `item_id`, `sale_id`, `receiving_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_attribute_links`
|
||||
--
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
|
||||
Binary file not shown.
BIN
design/ospos_categories.mwb.bak
Normal file
BIN
design/ospos_categories.mwb.bak
Normal file
Binary file not shown.
@@ -1,2 +1,2 @@
|
||||
Barcode,Item Name,Category,Supplier ID,Cost Price,Unit Price,Tax 1 Name,Tax 1 Percent,Tax 2 Name ,Tax 2 Percent,Reorder Level,Description,Allow Alt Description,Item has Serial Number,custom1,custom2,custom3,custom4,custom5,custom6,custom7,custom8,custom9,custom10,item_image,location1,quantity1
|
||||
33333333,Apple iMac,Computers,,800,1200,Tax 1,8,Tax 2,10,1,Best Computer ever,y,,"Oz, Frank",The Bunny and the Hill,"Monkeys,Giraffes,Gorillas",English,New,Apple,,1999,D3lk3jlkjs,Hardbound,item.jpg,1,100
|
||||
Barcode,Item Name,Category,Supplier ID,Cost Price,Unit Price,Tax 1 Name,Tax 1 Percent,Tax 2 Name ,Tax 2 Percent,Reorder Level,Description,Allow Alt Description,Item has Serial Number,location_id,quantity,pic_idN
|
||||
33333334,Apple iMac,Computers,,800,1200,Tax 1,8,Tax 2,10,1,Best Computer ever,y,,1,100,null
|
||||
|
||||
|
28
license/.licenses
Normal file
28
license/.licenses
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
|
||||
=== [ NON-BOWER ] ===
|
||||
blockUI
|
||||
bootstrap
|
||||
bootstrap-daterangepicker
|
||||
bootstrap-select
|
||||
bootstrap-table
|
||||
bootstrap3-dialog
|
||||
bootswatch
|
||||
chartist
|
||||
chartist-plugin-axistitle
|
||||
chartist-plugin-pointlabels
|
||||
chartist-plugin-tooltip
|
||||
file-saver.js
|
||||
html2canvas
|
||||
jasny-bootstrap
|
||||
jquery
|
||||
jquery-form
|
||||
jquery-ui
|
||||
jquery-validate
|
||||
js-cookie
|
||||
jspdf
|
||||
jspdf-autotable
|
||||
moment
|
||||
remarkable-bootstrap-notify
|
||||
smalot-bootstrap-datetimepicker
|
||||
tableExport.jquery.plugin
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user