mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-10-27 02:28:47 -04:00
Add supplier attribute search for items (pull request #106)
Add company name to supplier column in summary report
This commit is contained in:
1 parent
eb3657e76f
commit
4ab2ec1b5b
9 files changed
+34
-13
No files matched your search
@@ -300,7 +300,7 @@ class Items extends Secure_area implements iData_controller
|
||||
$suppliers = array('' => $this->lang->line('items_none'));
|
||||
foreach($this->Supplier->get_all()->result_array() as $row)
|
||||
{
|
||||
$suppliers[$row['person_id']] = $row['first_name'] .' '. $row['last_name'];
|
||||
$suppliers[$row['person_id']] = $row['company_name'];
|
||||
}
|
||||
$data['suppliers'] = $suppliers;
|
||||
$data['allow_alt_description_choices'] = array(
|
||||
|
||||
@@ -216,7 +216,7 @@ function get_supplier_data_row($supplier,$controller)
|
||||
$table_data_row.='<td width="22%">'.mailto($supplier->email,character_limiter($supplier->email,22)).'</td>';
|
||||
$table_data_row.='<td width="17%">'.character_limiter($supplier->phone_number,13).'</td>';
|
||||
$table_data_row.='<td width="5%">'.character_limiter($supplier->person_id,5).'</td>';
|
||||
$table_data_row.='<td width="5%">'.anchor($controller_name."/view/$supplier->person_id/width:$width", $CI->lang->line('common_edit'),array('class'=>'thickbox','title'=>$CI->lang->line($controller_name.'_update'))).'</td>';
|
||||
$table_data_row.='<td width="5%">'.anchor($controller_name."/view/$supplier->person_id/width:$width", $CI->lang->line('common_edit'),array('class'=>'thickbox','title'=>$CI->lang->line($controller_name.'_update'))).'</td>';
|
||||
$table_data_row.='</tr>';
|
||||
|
||||
return $table_data_row;
|
||||
@@ -234,6 +234,7 @@ function get_items_manage_table($items,$controller)
|
||||
$CI->lang->line('items_item_number'),
|
||||
$CI->lang->line('items_name'),
|
||||
$CI->lang->line('items_category'),
|
||||
$CI->lang->line('suppliers_company_name'),
|
||||
$CI->lang->line('items_cost_price'),
|
||||
$CI->lang->line('items_unit_price'),
|
||||
$CI->lang->line('items_quantity'),
|
||||
@@ -295,6 +296,7 @@ function get_item_data_row($item,$controller)
|
||||
$table_data_row.='<td width="15%">'.$item->item_number.'</td>';
|
||||
$table_data_row.='<td width="20%">'.$item->name.'</td>';
|
||||
$table_data_row.='<td width="14%">'.$item->category.'</td>';
|
||||
$table_data_row.='<td width="14%">'.$item->company_name.'</td>';
|
||||
$table_data_row.='<td width="14%">'.to_currency($item->cost_price).'</td>';
|
||||
$table_data_row.='<td width="14%">'.to_currency($item->unit_price).'</td>';
|
||||
$table_data_row.='<td width="14%">'.$item->quantity.'</td>';
|
||||
|
||||
@@ -5,7 +5,7 @@ $lang["config_address_required"] = "L\'adresse est requise";
|
||||
$lang["config_backup_button"] = "Backup";
|
||||
$lang["config_backup_database"] = "Backup Database";
|
||||
$lang["config_barcode_company"] = "Nome de l\'Entreprise";
|
||||
$lang["config_barcode_configuration"] = "ตั้งค่าระบบบาร์โค้ด";
|
||||
$lang["config_barcode_configuration"] = "Barcode Configuration";
|
||||
$lang["config_barcode_content"] = "Barcode Content";
|
||||
$lang["config_barcode_first_row"] = "Row 2";
|
||||
$lang["config_barcode_font"] = "Font";
|
||||
|
||||
@@ -5,7 +5,7 @@ $lang["config_address_required"] = "ที่อยู่ต้องกรอ
|
||||
$lang["config_backup_button"] = "สำรองข้อมูล";
|
||||
$lang["config_backup_database"] = "สำรองฐานข้อมูล";
|
||||
$lang["config_barcode_company"] = "ชื่อร้านค้า";
|
||||
$lang["config_barcode_configuration"] = "Barcode Configuration";
|
||||
$lang["config_barcode_configuration"] = "ตั้งค่าระบบบาร์โค้ด";
|
||||
$lang["config_barcode_content"] = "รหัสที่พิมพ์";
|
||||
$lang["config_barcode_first_row"] = "แถว 1";
|
||||
$lang["config_barcode_font"] = "แบบอักษร";
|
||||
@@ -115,6 +115,6 @@ $lang["config_thousands_separator"] = "ตัวคั่นหลักพั
|
||||
$lang["config_timezone"] = "โซนเวลา";
|
||||
$lang["config_use_invoice_template"] = "Use invoice template";
|
||||
$lang["config_website"] = "เว็บไซต์";
|
||||
$lang["config_locale_configuration"] = "Localisation Configuration";
|
||||
$lang["config_locale_configuration"] = "ตั้งค่าภาษา";
|
||||
$lang["config_locale_info"] = "Localisation Configuration Information";
|
||||
$lang["config_datetimeformat"] = "รูปแบบวันเวลา";
|
||||
@@ -115,6 +115,6 @@ $lang["config_thousands_separator"] = "Thousands Separator";
|
||||
$lang["config_timezone"] = "Saat Dilimi";
|
||||
$lang["config_use_invoice_template"] = "Use invoice template";
|
||||
$lang["config_website"] = "Website";
|
||||
$lang["config_locale_configuration"] = "ตั้งค่าภาษา";
|
||||
$lang["config_locale_configuration"] = "Localisation Configuration";
|
||||
$lang["config_locale_info"] = "Localisation Configuration Information";
|
||||
$lang["config_datetimeformat"] = "Date and Time format";
|
||||
@@ -35,6 +35,7 @@ class Item extends CI_Model
|
||||
function get_found_rows($search,$stock_location_id=-1,$low_inventory=0,$is_serialized=0,$no_description=0,$search_custom=0,$is_deleted=0)
|
||||
{
|
||||
$this->db->from("items");
|
||||
$this->db->join('suppliers', 'suppliers.person_id = items.supplier_id', 'left');
|
||||
if ($stock_location_id > -1)
|
||||
{
|
||||
$this->db->join('item_quantities','item_quantities.item_id=items.item_id');
|
||||
@@ -47,6 +48,7 @@ class Item extends CI_Model
|
||||
$this->db->where("(name LIKE '%" . $search . "%' OR " .
|
||||
"item_number LIKE '" . $search . "%' OR " .
|
||||
$this->db->dbprefix('items').".item_id LIKE '" . $search . "%' OR " .
|
||||
"company_name LIKE '" . $search . "%' OR " .
|
||||
"category LIKE '%" . $search . "%')");
|
||||
}
|
||||
else
|
||||
@@ -85,12 +87,13 @@ class Item extends CI_Model
|
||||
function get_all($stock_location_id=-1, $rows = 0, $limit_from = 0)
|
||||
{
|
||||
$this->db->from('items');
|
||||
$this->db->join('suppliers', 'suppliers.person_id = items.supplier_id', 'left');
|
||||
if ($stock_location_id > -1)
|
||||
{
|
||||
$this->db->join('item_quantities','item_quantities.item_id=items.item_id');
|
||||
$this->db->where('location_id',$stock_location_id);
|
||||
}
|
||||
$this->db->where('deleted',0);
|
||||
$this->db->where('items.deleted',0);
|
||||
$this->db->order_by("name","asc");
|
||||
if ($rows > 0) {
|
||||
$this->db->limit($rows, $limit_from);
|
||||
@@ -104,6 +107,7 @@ class Item extends CI_Model
|
||||
function get_info($item_id)
|
||||
{
|
||||
$this->db->from('items');
|
||||
$this->db->join('suppliers', 'suppliers.person_id = items.supplier_id', 'left');
|
||||
$this->db->where('item_id',$item_id);
|
||||
|
||||
$query = $this->db->get();
|
||||
@@ -135,8 +139,9 @@ class Item extends CI_Model
|
||||
function get_item_id($item_number)
|
||||
{
|
||||
$this->db->from('items');
|
||||
$this->db->join('suppliers', 'suppliers.person_id = items.supplier_id', 'left');
|
||||
$this->db->where('item_number',$item_number);
|
||||
$this->db->where('deleted',0); // Parq 131226
|
||||
$this->db->where('items.deleted',0); // Parq 131226
|
||||
|
||||
$query = $this->db->get();
|
||||
|
||||
@@ -154,6 +159,7 @@ class Item extends CI_Model
|
||||
function get_multiple_info($item_ids)
|
||||
{
|
||||
$this->db->from('items');
|
||||
$this->db->join('suppliers', 'suppliers.person_id = items.supplier_id', 'left');
|
||||
$this->db->where_in('item_id',$item_ids);
|
||||
$this->db->order_by('item_id', 'asc');
|
||||
return $this->db->get();
|
||||
@@ -243,6 +249,17 @@ class Item extends CI_Model
|
||||
{
|
||||
$suggestions[]=$row->item_number;
|
||||
}
|
||||
|
||||
$this->db->from('suppliers');
|
||||
$this->db->like('company_name', $search);
|
||||
$this->db->where('deleted', 0);
|
||||
$this->db->order_by("company_name", "asc");
|
||||
$by_company_name = $this->db->get();
|
||||
foreach($by_company_name->result() as $row)
|
||||
{
|
||||
$suggestions[]=$row->company_name;
|
||||
}
|
||||
|
||||
/** GARRISON ADDED 4/21/2013 **/
|
||||
//Search by description
|
||||
$this->db->from('items');
|
||||
@@ -584,6 +601,7 @@ class Item extends CI_Model
|
||||
function search($search,$stock_location_id=-1,$low_inventory=0,$is_serialized=0,$no_description=0,$search_custom=0,$deleted=0,$rows = 0,$limit_from = 0)
|
||||
{
|
||||
$this->db->from("items");
|
||||
$this->db->join('suppliers', 'suppliers.person_id = items.supplier_id', 'left');
|
||||
if ($stock_location_id > -1)
|
||||
{
|
||||
$this->db->join('item_quantities','item_quantities.item_id=items.item_id');
|
||||
@@ -596,7 +614,8 @@ class Item extends CI_Model
|
||||
$this->db->where("(name LIKE '%" . $search . "%' OR " .
|
||||
"item_number LIKE '" . $search . "%' OR " .
|
||||
$this->db->dbprefix('items').".item_id LIKE '" . $search . "%' OR " .
|
||||
"category LIKE '%" . $search . "%')");
|
||||
"company_name LIKE '" . $search . "%' OR " .
|
||||
"category LIKE '%" . $search . "%')");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ class Summary_suppliers extends Report
|
||||
|
||||
public function getData(array $inputs)
|
||||
{
|
||||
$this->db->select('CONCAT(first_name, " ",last_name) as supplier, sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax,sum(profit) as profit', false);
|
||||
$this->db->select('CONCAT(company_name, " (", first_name, " ",last_name, ")") as supplier, sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax,sum(profit) as profit', false);
|
||||
$this->db->from('sales_items_temp');
|
||||
$this->db->join('suppliers', 'suppliers.person_id = sales_items_temp.supplier_id');
|
||||
$this->db->join('people', 'suppliers.person_id = people.person_id');
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long.
@@ -4,7 +4,7 @@ config_address_required,Het adres van het bedrijf moet ingevuld worden,Direcció
|
||||
config_backup_button,Backup,Respaldo,Backup,Backup,Backup,Backup,สำรองข้อมูล,Backup,Backup
|
||||
config_backup_database,Backup Database,Respaldo de Base de Datos,Backup Database,Backup Database,Backup Database,Backup Database,สำรองฐานข้อมูล,Backup Database,Backup Database
|
||||
config_barcode_company,Bedrijfsnaam,Nombre del Comercio,Company Name,Nome de l\'Entreprise,公司名稱,Название Компании,ชื่อร้านค้า,Şirket Adı,Nama Perusahaan
|
||||
config_barcode_configuration,Barcode Configuratie,Configuración de Código de Barras,Barcode Configuration,ตั้งค่าระบบบาร์โค้ด,Barcode Configuration,Barcode Configuration,Barcode Configuration,Barcode Configuration,Barcode Configuration
|
||||
config_barcode_configuration,Barcode Configuratie,Configuración de Código de Barras,Barcode Configuration,Barcode Configuration,Barcode Configuration,Barcode Configuration,ตั้งค่าระบบบาร์โค้ด,Barcode Configuration,Barcode Configuration
|
||||
config_barcode_content,Inhoud Barcode,Contenido de Código de Barras,Barcode Content,Barcode Content,Barcode Content,Barcode Content,รหัสที่พิมพ์,Barcode Content,Barcode Content
|
||||
config_barcode_first_row,Rij 1,Fila 1,Row 1,Row 2,Row 3,Row 4,แถว 1,Row 6,Row 7
|
||||
config_barcode_font,Lettertype,Fuente,Font,Font,Font,Font,แบบอักษร,Font,Font
|
||||
@@ -114,6 +114,6 @@ config_thousands_separator,Thousands Separator,Separador de miles,Thousands Sepa
|
||||
config_timezone,Tijdzone,Zona Horaria,Timezone,Fuseau Horaire,時區,Часовой пояс,โซนเวลา,Saat Dilimi,Zona Waktu
|
||||
config_use_invoice_template,Gebruik template voor facturen,Use plantilla de factura,Use invoice template,Use invoice template,Use invoice template,Use invoice template,Use invoice template,Use invoice template,Use invoice template
|
||||
config_website,Website,Sitio Web,Website,Site-web,網站,Веб-сайт,เว็บไซต์,Website,Situs Perusahaan
|
||||
config_locale_configuration,Localisation Configuration,Localisation Configuration,Localisation Configuration,Localisation Configuration,Localisation Configuration,Localisation Configuration,Localisation Configuration,ตั้งค่าภาษา,Localisation Configuration
|
||||
config_locale_configuration,Localisation Configuration,Localisation Configuration,Localisation Configuration,Localisation Configuration,Localisation Configuration,Localisation Configuration,ตั้งค่าภาษา,Localisation Configuration,Localisation Configuration
|
||||
config_locale_info,Localisation Configuration Information,Localisation Configuration Information,Localisation Configuration Information,Localisation Configuration Information,Localisation Configuration Information,Localisation Configuration Information,Localisation Configuration Information,Localisation Configuration Information,Localisation Configuration Information
|
||||
config_datetimeformat,Date and Time format,Date and Time format,Date and Time format,Date and Time format,Date and Time format,Date and Time format,รูปแบบวันเวลา,Date and Time format,Date and Time format
|
||||
|
Reference in new issue
Block a user