From 2426fad52e6233892bcab6e7380df94eab876bcd Mon Sep 17 00:00:00 2001 From: jekkos Date: Mon, 30 Apr 2018 11:09:20 +0200 Subject: [PATCH 001/568] Add FORCE_HTTPS environment variable (#1956) --- docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yml b/docker-compose.yml index 22db04151..8ebe12f8c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,6 +20,7 @@ services: volumes: - uploads:/app/public/uploads environment: + - FORCE_HTTPS=false - PHP_TIMEZONE=UTC - MYSQL_USERNAME=admin - MYSQL_PASSWORD=pointofsale From c62dc5fe2a5033b5aa1a5cebb1e8dd32074d86aa Mon Sep 17 00:00:00 2001 From: jekkos Date: Mon, 30 Apr 2018 11:47:11 +0200 Subject: [PATCH 002/568] Add demo url to README.md (#1956) --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 35781784e..d9a8aca14 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,11 @@ It also has improved functionality and security. Deployed to a Cloud it's a SaaS (Software as a Service) solution. +DEMO +---- + +A demo version of the latest master version can be found on our [Demo server](https://demo.opensourcepos.org). This is a containerized install which will be reinitialized when new functionality is added to the code repository. + Installation ------------ From bcd1b05961baf3586ea8e8fd8cdd5c7525eac858 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Mon, 30 Apr 2018 21:28:32 +0100 Subject: [PATCH 003/568] Fix customer import issue and complete anonymisation (#1949) --- application/controllers/Customers.php | 10 +++++-- application/models/Customer.php | 41 ++++++++++++++++++++++++--- 2 files changed, 44 insertions(+), 7 deletions(-) diff --git a/application/controllers/Customers.php b/application/controllers/Customers.php index 0022eaddb..b9cbae6e8 100644 --- a/application/controllers/Customers.php +++ b/application/controllers/Customers.php @@ -380,14 +380,15 @@ class Customers extends Persons // XSS file data sanity check $data = $this->xss_clean($data); - if(sizeof($data) >= 16) + $consent = $data[3] == '' ? 0 : 1; + + if(sizeof($data) >= 16 && $consent) { $email = strtolower($data[4]); $person_data = array( 'first_name' => $data[0], 'last_name' => $data[1], 'gender' => $data[2], - 'consent' => $data[3] == '' ? 0 : 1, 'email' => $email, 'phone_number' => $data[5], 'address_1' => $data[6], @@ -400,9 +401,12 @@ class Customers extends Persons ); $customer_data = array( + 'consent' => $consent, 'company_name' => $data[13], 'discount_percent' => $data[15], - 'taxable' => $data[16] == '' ? 0 : 1 + 'taxable' => $data[16] == '' ? 0 : 1, + 'date' => date('Y-m-d H:i:s'), + 'employee_id' => $this->Employee->get_logged_in_employee_info()->person_id ); $account_number = $data[14]; diff --git a/application/models/Customer.php b/application/models/Customer.php index 7f1f647f2..615ea2bc2 100644 --- a/application/models/Customer.php +++ b/application/models/Customer.php @@ -223,17 +223,50 @@ class Customer extends Person */ public function delete($customer_id) { + $result = TRUE; + // if privacy enforcement is selected scramble customer data if($this->config->item('enforce_privacy')) { $this->db->where('person_id', $customer_id); - return $this->db->update('people', array('first_name' => $customer_id, 'last_name' => $customer_id, 'phone_number' => '', 'email' => '')); + $result &= $this->db->update('people', array( + 'first_name' => $customer_id, + 'last_name' => $customer_id, + 'phone_number' => '', + 'email' => '', + 'gender' => NULL, + 'address_1' => '', + 'address_2' => '', + 'city' => '', + 'state' => '', + 'zip' => '', + 'country' => '', + 'comments' => '' + )); + + $this->db->where('person_id', $customer_id); + + $result &= $this->db->update('customers', array( + 'consent' => 0, + 'company_name' => NULL, + 'account_number' => NULL, + 'taxable' => 0, + 'discount_percent' => 0.00, + 'package_id' => NULL, + 'points' => NULL, + 'sales_tax_code' => 1, + 'deleted' => 1 + )); + } + else + { + $this->db->where('person_id', $customer_id); + + $result &= $this->db->update('customers', array('deleted' => 1)); } - $this->db->where('person_id', $customer_id); - - return $this->db->update('customers', array('deleted' => 1)); + return $result; } /* From 0015bdffcf67816ff5a136758544200a7c093874 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Mon, 30 Apr 2018 21:33:54 +0100 Subject: [PATCH 004/568] Remove example entries from expenses tables --- application/migrations/sqlscripts/3.1.1_to_3.2.0.sql | 9 --------- 1 file changed, 9 deletions(-) diff --git a/application/migrations/sqlscripts/3.1.1_to_3.2.0.sql b/application/migrations/sqlscripts/3.1.1_to_3.2.0.sql index de433753f..4fa20ba59 100644 --- a/application/migrations/sqlscripts/3.1.1_to_3.2.0.sql +++ b/application/migrations/sqlscripts/3.1.1_to_3.2.0.sql @@ -142,9 +142,6 @@ CREATE TABLE IF NOT EXISTS `ospos_expense_categories` ( `deleted` int(1) NOT NULL DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -INSERT INTO `ospos_expense_categories` (`expense_category_id`, `category_name`, `category_description`) VALUES -(1, 'Utilities', 'Water'); - -- Table structure for table `ospos_expenses` @@ -160,12 +157,6 @@ CREATE TABLE IF NOT EXISTS `ospos_expenses` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- Dumping data for table `ospos_expenses` - -INSERT INTO `ospos_expenses` (`expense_id`, `date`, `amount`, `expense_category_id`, `description`, `employee_id`) VALUES -(1, '2017-04-20 07:00:00', '15.00', 1, 'Water', 1); - - -- Indexes for table `ospos_expense_categories` ALTER TABLE `ospos_expense_categories` From 455e39260d48e5a71a5360a2a26e5ef458efeddc Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Tue, 1 May 2018 17:07:28 +0000 Subject: [PATCH 005/568] Translated using Weblate (Italian) Currently translated at 100.0% (268 of 268 strings) --- application/language/it/config_lang.php | 36 ++++++++++++------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/application/language/it/config_lang.php b/application/language/it/config_lang.php index 1cfd7055f..fd67acbd0 100644 --- a/application/language/it/config_lang.php +++ b/application/language/it/config_lang.php @@ -5,7 +5,7 @@ $lang["config_address_required"] = "Il campo Indirizzo Azienda è obbligatorio." $lang["config_allow_duplicate_barcodes"] = "Permetti Codice a Barre duplicati"; $lang["config_apostrophe"] = "apostrofo"; $lang["config_backup_button"] = "Backup"; -$lang["config_backup_database"] = "Database Backup"; +$lang["config_backup_database"] = "Backup del Database"; $lang["config_barcode"] = "Codici a Barre"; $lang["config_barcode_company"] = "Nome Azienda"; $lang["config_barcode_configuration"] = "Configurazione Codici a Barre"; @@ -26,7 +26,7 @@ $lang["config_barcode_page_width"] = "Mostra larghezza pagina"; $lang["config_barcode_price"] = "Prezzo"; $lang["config_barcode_second_row"] = "Riga 2"; $lang["config_barcode_third_row"] = "Riga 3"; -$lang["config_barcode_tooltip"] = "Attenzione: Questa funzionalità può causare la duplicazione dei prodotti da essere importati o creati. Non usarla se non vuoi barcode duplicati."; +$lang["config_barcode_tooltip"] = "Attenzione: Questa funzionalità può causare la duplicazione dei prodotti da essere importati o creati. Non usarla se non vuoi codi a barra duplicati."; $lang["config_barcode_type"] = "Tipo Codice a Barre"; $lang["config_barcode_width"] = "Larghezza (px)"; $lang["config_bottom"] = "Parte inferiore"; @@ -97,7 +97,7 @@ $lang["config_dinner_table_invalid_chars"] = "Nome Tavolo non può contenere '_' $lang["config_dinner_table_required"] = "Tavolo è un campo obbligatorio."; $lang["config_dot"] = "punto"; $lang["config_email"] = "Email"; -$lang["config_email_configuration"] = "Email Configuration"; +$lang["config_email_configuration"] = "Configurazione Email"; $lang["config_email_mailpath"] = "Percorso per Sendmail"; $lang["config_email_protocol"] = "Protocol"; $lang["config_email_smtp_crypto"] = "SMTP Encryption"; @@ -108,18 +108,18 @@ $lang["config_email_smtp_timeout"] = "SMTP Timeout (s)"; $lang["config_email_smtp_user"] = "SMTP Username"; $lang["config_fax"] = "Fax"; $lang["config_financial_year"] = "Data Inizio Anno Fiscale"; -$lang["config_financial_year_apr"] = "1st of April"; -$lang["config_financial_year_aug"] = "1st of August"; -$lang["config_financial_year_dec"] = "1st of December"; -$lang["config_financial_year_feb"] = "1st of February"; -$lang["config_financial_year_jan"] = "1st of January"; -$lang["config_financial_year_jul"] = "1st of July"; -$lang["config_financial_year_jun"] = "1st of June"; -$lang["config_financial_year_mar"] = "1st of March"; -$lang["config_financial_year_may"] = "1st of May"; -$lang["config_financial_year_nov"] = "1st of November"; -$lang["config_financial_year_oct"] = "1st of October"; -$lang["config_financial_year_sep"] = "1st of September"; +$lang["config_financial_year_apr"] = "1mo di Aprile"; +$lang["config_financial_year_aug"] = "1mo di Agosto"; +$lang["config_financial_year_dec"] = "1mo di Dicembre"; +$lang["config_financial_year_feb"] = "1mo di Febbraio"; +$lang["config_financial_year_jan"] = "1mo di Gennaio"; +$lang["config_financial_year_jul"] = "1mo di Luglio"; +$lang["config_financial_year_jun"] = "1mo di Giugno"; +$lang["config_financial_year_mar"] = "1mo di Marzo"; +$lang["config_financial_year_may"] = "1mo di Maggio"; +$lang["config_financial_year_nov"] = "1mo di Novembre"; +$lang["config_financial_year_oct"] = "1mo di Ottobre"; +$lang["config_financial_year_sep"] = "1mo di Settembre"; $lang["config_gcaptcha_enable"] = "Login Page reCAPTCHA"; $lang["config_gcaptcha_secret_key"] = "reCAPTCHA Secret Key"; $lang["config_gcaptcha_secret_key_required"] = "reCAPTCHA Secret Key è un campo obbligatorio"; @@ -139,7 +139,7 @@ $lang["config_invoice_default_comments"] = "Commenti Fattura di Default"; $lang["config_invoice_email_message"] = "Template Email di Fattura"; $lang["config_invoice_enable"] = "Abilita Fatturazione"; $lang["config_invoice_printer"] = "Stampante per Fattura"; -$lang["config_jsprintsetup_required"] = "Attenzione: Questa funzionalità funzionerà solo se è instalato l'addon di FifeFox jsPrintSetup. Salvare ugualmente ?"; +$lang["config_jsprintsetup_required"] = "Attenzione: Questa funzionalità funzionerà solo se è installato l'addon di FifeFox jsPrintSetup. Salvare ugualmente ?"; $lang["config_language"] = "Lingua"; $lang["config_last_used_invoice_number"] = "Ultimo Numero Fattura usato"; $lang["config_last_used_quote_number"] = "Ultimo Numero Preventivo usato"; @@ -175,9 +175,9 @@ $lang["config_msg_src"] = "SMS-API Sender ID"; $lang["config_msg_src_required"] = "SMS-API Sender ID è un campo obbligatorio"; $lang["config_msg_uid"] = "SMS-API Username"; $lang["config_msg_uid_required"] = "SMS-API Username è un campo obbligatorio"; -$lang["config_none"] = "none"; +$lang["config_none"] = "nessuno"; $lang["config_notify_alignment"] = "Posizione Popup di Notifica"; -$lang["config_number_format"] = "Number Format"; +$lang["config_number_format"] = "Formato Numero"; $lang["config_number_locale"] = "Localizzazione"; $lang["config_number_locale_invalid"] = "La località inserita non è valida. Controlla il link nel tooltip per cercare una località valida."; $lang["config_number_locale_required"] = "Numero Località è un campo obbligatorio."; From 9d149ad4f393c0b08a884479e1ece3f97aa6332f Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Tue, 1 May 2018 20:46:18 +0100 Subject: [PATCH 006/568] Autoreturn to Sale page after receipt printing (#1966) --- application/controllers/Config.php | 1 + application/language/en-GB/config_lang.php | 3 ++ application/language/en-US/config_lang.php | 3 ++ ...hp => 20180501100000_upgrade_to_3_2_1.php} | 0 .../migrations/sqlscripts/3.2.0_to_3.2.1.sql | 6 +++ application/views/configs/receipt_config.php | 53 ++++++++++++++----- application/views/partial/print_receipt.php | 17 +++--- application/views/sales/receipt.php | 39 +++++++------- 8 files changed, 83 insertions(+), 39 deletions(-) rename application/migrations/{20180429100000_upgrade_to_3_2_1.php => 20180501100000_upgrade_to_3_2_1.php} (100%) diff --git a/application/controllers/Config.php b/application/controllers/Config.php index d7beefee9..a16458559 100644 --- a/application/controllers/Config.php +++ b/application/controllers/Config.php @@ -813,6 +813,7 @@ class Config extends Secure_Controller $batch_save_data = array ( 'receipt_template' => $this->input->post('receipt_template'), 'receipt_font_size' => $this->input->post('receipt_font_size'), + 'print_delay_autoreturn' => $this->input->post('print_delay_autoreturn'), 'email_receipt_check_behaviour' => $this->input->post('email_receipt_check_behaviour'), 'print_receipt_check_behaviour' => $this->input->post('print_receipt_check_behaviour'), 'receipt_show_company_name' => $this->input->post('receipt_show_company_name') != NULL, diff --git a/application/language/en-GB/config_lang.php b/application/language/en-GB/config_lang.php index 044bfdb08..81f73742b 100644 --- a/application/language/en-GB/config_lang.php +++ b/application/language/en-GB/config_lang.php @@ -194,6 +194,9 @@ $lang["config_phone_required"] = "Company phone is a required field"; $lang["config_print_bottom_margin"] = "Margin Bottom"; $lang["config_print_bottom_margin_number"] = "Default Bottom Margin must be a number"; $lang["config_print_bottom_margin_required"] = "Default Bottom Margin is a required field"; +$lang["config_print_delay_autoreturn"] = "Autoreturn to Sale delay"; +$lang["config_print_delay_autoreturn_required"] = "Autoreturn to Sale delay must be a number"; +$lang["config_print_delay_autoreturn_number"] = "Autoreturn to Sale delay is a required field"; $lang["config_print_footer"] = "Print Browser Footer"; $lang["config_print_header"] = "Print Browser Header"; $lang["config_print_left_margin"] = "Margin Left"; diff --git a/application/language/en-US/config_lang.php b/application/language/en-US/config_lang.php index 1ba77a526..7b39c5ae8 100644 --- a/application/language/en-US/config_lang.php +++ b/application/language/en-US/config_lang.php @@ -194,6 +194,9 @@ $lang["config_phone_required"] = "Company Phone is a required field."; $lang["config_print_bottom_margin"] = "Margin Bottom"; $lang["config_print_bottom_margin_number"] = "Margin Bottom must be a number."; $lang["config_print_bottom_margin_required"] = "Margin Bottom is a required field."; +$lang["config_print_delay_autoreturn"] = "Autoreturn to Sale delay"; +$lang["config_print_delay_autoreturn_required"] = "Autoreturn to Sale delay must be a number."; +$lang["config_print_delay_autoreturn_number"] = "Autoreturn to Sale delay is a required field."; $lang["config_print_footer"] = "Print Browser Footer"; $lang["config_print_header"] = "Print Browser Header"; $lang["config_print_left_margin"] = "Margin Left"; diff --git a/application/migrations/20180429100000_upgrade_to_3_2_1.php b/application/migrations/20180501100000_upgrade_to_3_2_1.php similarity index 100% rename from application/migrations/20180429100000_upgrade_to_3_2_1.php rename to application/migrations/20180501100000_upgrade_to_3_2_1.php diff --git a/application/migrations/sqlscripts/3.2.0_to_3.2.1.sql b/application/migrations/sqlscripts/3.2.0_to_3.2.1.sql index ac92db486..0baf01230 100644 --- a/application/migrations/sqlscripts/3.2.0_to_3.2.1.sql +++ b/application/migrations/sqlscripts/3.2.0_to_3.2.1.sql @@ -13,3 +13,9 @@ ALTER TABLE `ospos_customers` INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('enforce_privacy', '0'); + + +-- Add print receipt autoreturn delay + +INSERT INTO `ospos_app_config` (`key`, `value`) VALUES +('print_delay_autoreturn', '0'); diff --git a/application/views/configs/receipt_config.php b/application/views/configs/receipt_config.php index d7e665ebe..8c7bad56c 100644 --- a/application/views/configs/receipt_config.php +++ b/application/views/configs/receipt_config.php @@ -27,12 +27,29 @@ 'name' => 'receipt_font_size', 'id' => 'receipt_font_size', 'class' => 'form-control input-sm required', - 'value'=>$this->config->item('receipt_font_size'))); ?> + 'value' => $this->config->item('receipt_font_size'))); ?> px +
+ lang->line('config_print_delay_autoreturn'), 'print_delay_autoreturn', array('class' => 'control-label col-xs-2 required')); ?> +
+
+ 'number', + 'min' => '0', + 'max' => '30', + 'name' => 'print_delay_autoreturn', + 'id' => 'print_delay_autoreturn', + 'class' => 'form-control input-sm required', + 'value' => $this->config->item('print_delay_autoreturn'))); ?> + s +
+
+
+
lang->line('config_email_receipt_check_behaviour'), 'email_receipt_check_behaviour', array('class' => 'control-label col-xs-2')); ?>
@@ -94,7 +111,7 @@ 'name' => 'receipt_show_company_name', 'value' => 'receipt_show_company_name', 'id' => 'receipt_show_company_name', - 'checked'=>$this->config->item('receipt_show_company_name'))); ?> + 'checked' => $this->config->item('receipt_show_company_name'))); ?>
@@ -105,7 +122,7 @@ 'name' => 'receipt_show_taxes', 'value' => 'receipt_show_taxes', 'id' => 'receipt_show_taxes', - 'checked'=>$this->config->item('receipt_show_taxes'))); ?> + 'checked' => $this->config->item('receipt_show_taxes'))); ?> @@ -116,7 +133,7 @@ 'name' => 'receipt_show_total_discount', 'value' => 'receipt_show_total_discount', 'id' => 'receipt_show_total_discount', - 'checked'=>$this->config->item('receipt_show_total_discount'))); ?> + 'checked' => $this->config->item('receipt_show_total_discount'))); ?> @@ -127,7 +144,7 @@ 'name' => 'receipt_show_description', 'value' => 'receipt_show_description', 'id' => 'receipt_show_description', - 'checked'=>$this->config->item('receipt_show_description'))); ?> + 'checked' => $this->config->item('receipt_show_description'))); ?> @@ -138,7 +155,7 @@ 'name' => 'receipt_show_serialnumber', 'value' => 'receipt_show_serialnumber', 'id' => 'receipt_show_serialnumber', - 'checked'=>$this->config->item('receipt_show_serialnumber'))); ?> + 'checked' => $this->config->item('receipt_show_serialnumber'))); ?> @@ -149,7 +166,7 @@ 'name' => 'print_silently', 'id' => 'print_silently', 'value' => 'print_silently', - 'checked'=>$this->config->item('print_silently'))); ?> + 'checked' => $this->config->item('print_silently'))); ?> @@ -160,7 +177,7 @@ 'name' => 'print_header', 'id' => 'print_header', 'value' => 'print_header', - 'checked'=>$this->config->item('print_header'))); ?> + 'checked' => $this->config->item('print_header'))); ?> @@ -171,7 +188,7 @@ 'name' => 'print_footer', 'id' => 'print_footer', 'value' => 'print_footer', - 'checked'=>$this->config->item('print_footer'))); ?> + 'checked' => $this->config->item('print_footer'))); ?> @@ -207,7 +224,7 @@ 'name' => 'print_top_margin', 'id' => 'print_top_margin', 'class' => 'form-control input-sm required', - 'value'=>$this->config->item('print_top_margin'))); ?> + 'value' => $this->config->item('print_top_margin'))); ?> px @@ -224,7 +241,7 @@ 'name' => 'print_left_margin', 'id' => 'print_left_margin', 'class' => 'form-control input-sm required', - 'value'=>$this->config->item('print_left_margin'))); ?> + 'value' => $this->config->item('print_left_margin'))); ?> px @@ -241,7 +258,7 @@ 'name' => 'print_bottom_margin', 'id' => 'print_bottom_margin', 'class' => 'form-control input-sm required', - 'value'=>$this->config->item('print_bottom_margin'))); ?> + 'value' => $this->config->item('print_bottom_margin'))); ?> px @@ -258,7 +275,7 @@ 'name' => 'print_right_margin', 'id' => 'print_right_margin', 'class' => 'form-control input-sm required', - 'value'=>$this->config->item('print_right_margin'))); ?> + 'value' => $this->config->item('print_right_margin'))); ?> px @@ -343,6 +360,11 @@ $(document).ready(function() number:true }, receipt_font_size: + { + required:true, + number:true + }, + print_delay_autoreturn: { required:true, number:true @@ -375,6 +397,11 @@ $(document).ready(function() { required:"lang->line('config_receipt_font_size_required'); ?>", number:"lang->line('config_receipt_font_size_number'); ?>" + }, + print_delay_autoreturn: + { + required:"lang->line('config_print_delay_autoreturn_required'); ?>", + number:"lang->line('config_print_delay_autoreturn_number'); ?>" } } })); diff --git a/application/views/partial/print_receipt.php b/application/views/partial/print_receipt.php index 8f064976d..5ffe3ef3e 100644 --- a/application/views/partial/print_receipt.php +++ b/application/views/partial/print_receipt.php @@ -62,16 +62,21 @@ function printdoc() } } - - $(window).load(function() + $(window).load(function() { - // executes when complete page is fully loaded, including all frames, objects and images - printdoc(); - }); + // executes when complete page is fully loaded, including all frames, objects and images + printdoc(); + + // after a delay, return to sales view + setTimeout(function () { + window.location.href = ""; + }, config->item('print_delay_autoreturn') * 1000; ?>); + }); - \ No newline at end of file + diff --git a/application/views/sales/receipt.php b/application/views/sales/receipt.php index 72e6e0436..870f735f8 100644 --- a/application/views/sales/receipt.php +++ b/application/views/sales/receipt.php @@ -9,34 +9,33 @@ if (isset($error_message)) ?> - + + send_email(); + + }); + load->view('partial/print_receipt', array('print_after_sale'=>$print_after_sale, 'selected_printer'=>'receipt_printer')); ?> -
+
lang->line('config_timezone'), 'timezone', array('class' => 'control-label col-xs-2')); ?>
config->item('timezone') ? $this->config->item('timezone') : date_default_timezone_get(), array('class' => 'form-control input-sm')); ?>
-
+
lang->line('config_datetimeformat'), 'datetimeformat', array('class' => 'control-label col-xs-2')); ?>
- config->item('dateformat'), array('class' => 'form-control input-sm')); ?>
- config->item('timeformat'), array('class' => 'form-control input-sm')); ?> From 37390ae9dd0f1475fca34607a3792f08d823d479 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sat, 12 May 2018 18:56:25 +0100 Subject: [PATCH 035/568] Fix issue with barcode scanner and customer field (#871) --- application/views/sales/register.php | 37 +++++++++++++++++----------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/application/views/sales/register.php b/application/views/sales/register.php index 58bed9894..734259d80 100644 --- a/application/views/sales/register.php +++ b/application/views/sales/register.php @@ -601,6 +601,13 @@ if(isset($success)) + diff --git a/bower.json b/bower.json index f23e02cc5..6c825b2e3 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "opensourcepos", "description": "Open Source Point of Sale is a web based POS system written in the PHP language. It uses MySQL as backend and has a simple user interface", - "version": "3.2.2", + "version": "3.2.3", "license": "MIT", "authors": [ "jekkos ", diff --git a/composer.lock b/composer.lock index 02ab3eec8..c187907ef 100644 --- a/composer.lock +++ b/composer.lock @@ -9,16 +9,16 @@ "packages": [ { "name": "codeigniter/framework", - "version": "3.1.8", + "version": "3.1.9", "source": { "type": "git", "url": "https://github.com/bcit-ci/CodeIgniter.git", - "reference": "02a0518e1c56ba3506f370362ac5ebdb8a138312" + "reference": "30e2eafa86c4c7b6b39cea3e7089a90df9f603fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bcit-ci/CodeIgniter/zipball/71e647782764184e3aab4faffe6d99176758979f", - "reference": "02a0518e1c56ba3506f370362ac5ebdb8a138312", + "url": "https://api.github.com/repos/bcit-ci/CodeIgniter/zipball/30e2eafa86c4c7b6b39cea3e7089a90df9f603fb", + "reference": "30e2eafa86c4c7b6b39cea3e7089a90df9f603fb", "shasum": "" }, "require": { @@ -38,7 +38,7 @@ ], "description": "The CodeIgniter framework", "homepage": "https://codeigniter.com", - "time": "2018-01-13 11:57:11" + "time": "2018-06-12 13:45:46" }, { "name": "dompdf/dompdf", @@ -103,16 +103,16 @@ }, { "name": "paragonie/random_compat", - "version": "v2.0.11", + "version": "v2.0.15", "source": { "type": "git", "url": "https://github.com/paragonie/random_compat.git", - "reference": "5da4d3c796c275c55f057af5a643ae297d96b4d8" + "reference": "10bcb46e8f3d365170f6de9d05245aa066b81f09" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/5da4d3c796c275c55f057af5a643ae297d96b4d8", - "reference": "5da4d3c796c275c55f057af5a643ae297d96b4d8", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/10bcb46e8f3d365170f6de9d05245aa066b81f09", + "reference": "10bcb46e8f3d365170f6de9d05245aa066b81f09", "shasum": "" }, "require": { @@ -144,10 +144,11 @@ "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", "keywords": [ "csprng", + "polyfill", "pseudorandom", "random" ], - "time": "2017-09-27 21:40:39" + "time": "2018-06-08 15:26:40" }, { "name": "phenx/php-font-lib", diff --git a/deployment.json b/deployment.json index d3e27ccf2..74ae5f1de 100644 --- a/deployment.json +++ b/deployment.json @@ -14,7 +14,7 @@ "public_stats": true }, "version": { - "name": "3.2.2" + "name": "3.2.3" }, "files": [ {"includePattern": "dist(.*)\\.(zip)", "uploadPattern": "$1.$2"} diff --git a/package.json b/package.json index 978bf4875..810f0a232 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "opensourcepos", - "version": "3.2.2", + "version": "3.2.3", "description": "Open Source Point of Sale is a web based point of sale system written in the PHP language. It uses MySQL as the data storage back-end and has a simple user interface.", "main": "index.php", "license": "MIT", diff --git a/public/license/composer.LICENSES b/public/license/composer.LICENSES index 33010d468..d3b8a0fe9 100644 --- a/public/license/composer.LICENSES +++ b/public/license/composer.LICENSES @@ -1,6 +1,6 @@ { "name": "OpenSourcePOS", - "version": "3.2.2", + "version": "3.2.3", "license": [ "MIT" ], From ebdc1880d9217e7445877ce676b27ecd00b258b6 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Wed, 6 Jun 2018 22:00:30 +0100 Subject: [PATCH 117/568] Bump version to 3.3.0 for next phase --- application/config/config.php | 2 +- bower.json | 2 +- deployment.json | 2 +- package.json | 2 +- public/license/composer.LICENSES | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/application/config/config.php b/application/config/config.php index 9efc52e09..3a345c88d 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -8,7 +8,7 @@ | | */ -$config['application_version'] = '3.2.3'; +$config['application_version'] = '3.3.0'; /* |-------------------------------------------------------------------------- diff --git a/bower.json b/bower.json index 6c825b2e3..4467c9607 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "opensourcepos", "description": "Open Source Point of Sale is a web based POS system written in the PHP language. It uses MySQL as backend and has a simple user interface", - "version": "3.2.3", + "version": "3.3.0", "license": "MIT", "authors": [ "jekkos ", diff --git a/deployment.json b/deployment.json index 74ae5f1de..6459b492b 100644 --- a/deployment.json +++ b/deployment.json @@ -14,7 +14,7 @@ "public_stats": true }, "version": { - "name": "3.2.3" + "name": "3.3.0" }, "files": [ {"includePattern": "dist(.*)\\.(zip)", "uploadPattern": "$1.$2"} diff --git a/package.json b/package.json index 810f0a232..f72b41c32 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "opensourcepos", - "version": "3.2.3", + "version": "3.3.0", "description": "Open Source Point of Sale is a web based point of sale system written in the PHP language. It uses MySQL as the data storage back-end and has a simple user interface.", "main": "index.php", "license": "MIT", diff --git a/public/license/composer.LICENSES b/public/license/composer.LICENSES index d3b8a0fe9..92e054589 100644 --- a/public/license/composer.LICENSES +++ b/public/license/composer.LICENSES @@ -1,12 +1,12 @@ { "name": "OpenSourcePOS", - "version": "3.2.3", + "version": "3.3.0", "license": [ "MIT" ], "dependencies": { "codeigniter/framework": { - "version": "3.1.8", + "version": "3.1.9", "license": [ "MIT" ] @@ -24,7 +24,7 @@ ] }, "paragonie/random_compat": { - "version": "2.0.11", + "version": "2.0.15", "license": [ "MIT" ] From c6b5ff1934b3005d3d35632061878538499ff5cd Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sat, 9 Jun 2018 19:19:32 +0100 Subject: [PATCH 118/568] Restore CSRF change with & issue fix (#1990, #2009) --- application/views/configs/locale_config.php | 6 ++--- .../views/configs/mailchimp_config.php | 5 ++--- application/views/customers/form.php | 8 +++---- application/views/giftcards/form.php | 6 ++--- application/views/partial/header_js.php | 22 ++++++++++++++----- application/views/sales/form.php | 8 +++---- 6 files changed, 33 insertions(+), 22 deletions(-) diff --git a/application/views/configs/locale_config.php b/application/views/configs/locale_config.php index c613886a4..5ac983086 100644 --- a/application/views/configs/locale_config.php +++ b/application/views/configs/locale_config.php @@ -234,7 +234,7 @@ $(document).ready(function() var data = { number_locale: $('#number_locale').val() }; data[field] = value; $.post("", - $.extend(csrf_form_base(), data), + data, function(response) { $('#number_locale_example').text(response.number_locale_example); }, @@ -253,10 +253,10 @@ $(document).ready(function() { url: "", type: 'POST', - data: $.extend(csrf_form_base(), { + data: { 'number_locale': $('#number_locale').val(), 'thousands_separator': $('#thousands_separator').is(':checked') - }), + }, dataFilter: function(data) { setup_csrf_token(); var response = JSON.parse(data); diff --git a/application/views/configs/mailchimp_config.php b/application/views/configs/mailchimp_config.php index 6cbf2b060..6be5ebd6d 100644 --- a/application/views/configs/mailchimp_config.php +++ b/application/views/configs/mailchimp_config.php @@ -50,10 +50,9 @@ $(document).ready(function() { $('#mailchimp_api_key').change(function() { - $.post("", - $.extend(csrf_form_base(), { + $.post("", { 'mailchimp_api_key': $('#mailchimp_api_key').val() - }), + }, function(response) { $.notify(response.message, {type: response.success ? 'success' : 'danger'} ); $('#mailchimp_list_id').empty(); diff --git a/application/views/customers/form.php b/application/views/customers/form.php index e08b4abea..43c3a1e3b 100644 --- a/application/views/customers/form.php +++ b/application/views/customers/form.php @@ -460,10 +460,10 @@ $(document).ready(function() { url: "", type: 'POST', - data: $.extend(csrf_form_base(), { + data: { 'person_id': 'person_id; ?>' // email is posted by default - }) + } } }, account_number: @@ -472,10 +472,10 @@ $(document).ready(function() { url: "", type: 'POST', - data: $.extend(csrf_form_base(), { + data: { 'person_id': 'person_id; ?>' // account_number is posted by default - }) + } } } }, diff --git a/application/views/giftcards/form.php b/application/views/giftcards/form.php index 434a116cc..6004b96e1 100644 --- a/application/views/giftcards/form.php +++ b/application/views/giftcards/form.php @@ -76,7 +76,7 @@ $(document).ready(function() source: '', minChars: 0, delay: 15, - cacheLength: 1, + cacheLength: 1, appendTo: '.modal-content', select: fill_value, focus: fill_value @@ -125,9 +125,9 @@ $(document).ready(function() { url: "", type: 'POST', - data: $.extend(csrf_form_base(), { + data: { 'amount': $('#giftcard_amount').val() - }), + }, dataFilter: function(data) { setup_csrf_token(); var response = JSON.parse(data); diff --git a/application/views/partial/header_js.php b/application/views/partial/header_js.php index 025cd157e..c61e507ac 100644 --- a/application/views/partial/header_js.php +++ b/application/views/partial/header_js.php @@ -16,8 +16,6 @@ from: 'config->item('notify_vertical_position'); ?>' }}); - var post = $.post; - var csrf_token = function() { return Cookies.get('config->item('csrf_cookie_name'); ?>'); }; @@ -26,9 +24,23 @@ return { security->get_csrf_token_name(); ?> : function () { return csrf_token(); } }; }; - $.post = function() { - arguments[1] = csrf_token() ? $.extend(arguments[1], csrf_form_base()) : arguments[1]; - post.apply(this, arguments); + var ajax = $.ajax; + + $.ajax = function() { + var args = arguments[0]; + + if (args['type'] && args['type'].toLowerCase() == 'post' && csrf_token()) { + if (typeof args['data'] === 'string') + { + args['data'] += '&' + $.param(csrf_form_base()); + } + else + { + args['data'] = $.extend(args['data'], csrf_form_base()); + } + } + + return ajax.apply(this, arguments); }; var setup_csrf_token = function() { diff --git a/application/views/sales/form.php b/application/views/sales/form.php index 8f664541e..2c2048b60 100755 --- a/application/views/sales/form.php +++ b/application/views/sales/form.php @@ -191,12 +191,12 @@ $(document).ready(function() { url: "", type: 'POST', - data: $.extend(csrf_form_base(), { - 'sale_id' : , - 'invoice_number' : function() { + data: { + 'sale_id': , + 'invoice_number': function() { return $('#invoice_number').val(); } - }) + } } } }, From 5ef8a88000b6410529ce2d73092823d7bec4bcd4 Mon Sep 17 00:00:00 2001 From: Steve Ireland Date: Thu, 3 May 2018 21:39:23 -0400 Subject: [PATCH 119/568] Add support for temporary items. --- application/controllers/Items.php | 59 ++++++- application/controllers/Sales.php | 59 ++++++- application/language/en-GB/items_lang.php | 1 + application/language/en-US/items_lang.php | 1 + application/libraries/Sale_lib.php | 35 ++++- application/models/Item.php | 53 ++++++- application/models/Sale.php | 1 - application/views/items/form.php | 16 +- application/views/sales/register.php | 182 ++++++++++++++++------ 9 files changed, 337 insertions(+), 70 deletions(-) diff --git a/application/controllers/Items.php b/application/controllers/Items.php index f6f7991bc..2e6d2a3a8 100644 --- a/application/controllers/Items.php +++ b/application/controllers/Items.php @@ -13,6 +13,8 @@ class Items extends Secure_Controller public function index() { + $this->session->set_userdata('allow_temp_items', 0); + $data['table_headers'] = $this->xss_clean(get_items_manage_table_headers()); $data['stock_location'] = $this->xss_clean($this->item_lib->get_item_location()); @@ -24,7 +26,8 @@ class Items extends Secure_Controller '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'), - 'is_deleted' => $this->lang->line('items_is_deleted')); + 'is_deleted' => $this->lang->line('items_is_deleted'), + 'temporary' => $this->lang->line('items_temp')); $this->load->view('items/manage', $data); } @@ -50,7 +53,8 @@ class Items extends Secure_Controller 'is_serialized' => FALSE, 'no_description' => FALSE, 'search_custom' => FALSE, - 'is_deleted' => FALSE); + 'is_deleted' => FALSE, + 'temporary' => FALSE); // check if any filter is set in the multiselect dropdown $filledup = array_fill_keys($this->input->get('filters'), TRUE); @@ -177,6 +181,9 @@ class Items extends Secure_Controller public function view($item_id = -1) { + // allow_temp_items is set in the index function of items.php or sales.php + $data['allow_temp_item'] = $this->session->userdata('allow_temp_items'); + $data['item_tax_info'] = $this->xss_clean($this->Item_taxes->get_info($item_id)); $data['default_tax_1_rate'] = ''; $data['default_tax_2_rate'] = ''; @@ -188,6 +195,25 @@ class Items extends Secure_Controller $item_info->$property = $this->xss_clean($value); } + if($data['allow_temp_item'] == 1) + { + if($item_id != -1) + { + if($item_info->item_type != ITEM_TEMP) + { + $data['allow_temp_item'] = 0; + } + } + } + else + { + if($item_info->item_type == ITEM_TEMP) + { + $data['allow_temp_item'] = 1; + } + } + + if($item_id == -1) { $data['default_tax_1_rate'] = $this->config->item('default_tax_1_rate'); @@ -364,19 +390,26 @@ class Items extends Secure_Controller $upload_success = $this->_handle_image_upload(); $upload_data = $this->upload->data(); + $receiving_quantity = parse_decimals($this->input->post('receiving_quantity')); + $item_type = $this->input->post('item_type') == NULL ? ITEM : $this->input->post('item_type'); + + if($receiving_quantity == '0' && $item_type!= ITEM_TEMP) + { + $receiving_quantity = '1'; + } //Save item data $item_data = array( 'name' => $this->input->post('name'), 'description' => $this->input->post('description'), 'category' => $this->input->post('category'), - 'item_type' => $this->input->post('item_type') == NULL ? ITEM : $this->input->post('item_type'), + 'item_type' => $item_type, 'stock_type' => $this->input->post('stock_type') == NULL ? HAS_STOCK : $this->input->post('stock_type'), 'supplier_id' => $this->input->post('supplier_id') == '' ? NULL : $this->input->post('supplier_id'), 'item_number' => $this->input->post('item_number') == '' ? NULL : $this->input->post('item_number'), 'cost_price' => parse_decimals($this->input->post('cost_price')), 'unit_price' => parse_decimals($this->input->post('unit_price')), 'reorder_level' => parse_decimals($this->input->post('reorder_level')), - 'receiving_quantity' => parse_decimals($this->input->post('receiving_quantity')), + 'receiving_quantity' => $receiving_quantity, 'allow_alt_description' => $this->input->post('allow_alt_description') != NULL, 'is_serialized' => $this->input->post('is_serialized') != NULL, 'deleted' => $this->input->post('is_deleted') != NULL, @@ -392,6 +425,13 @@ class Items extends Secure_Controller 'custom10' => $this->input->post('custom10') == NULL ? '' : $this->input->post('custom10') ); + if($item_data['item_type'] == ITEM_TEMP) + { + $item_data['stock_type'] = HAS_NO_STOCK; + $item_data['receiving_quantity'] = 0; + $item_data['reorder_level'] = 0; + } + $x = $this->input->post('tax_category_id'); if(!isset($x)) { @@ -412,8 +452,7 @@ class Items extends Secure_Controller } $employee_id = $this->Employee->get_logged_in_employee_info()->person_id; - $cur_item_info = $this->Item->get_info($item_id); - + if($this->Item->save($item_data, $item_id)) { $success = TRUE; @@ -424,7 +463,7 @@ class Items extends Secure_Controller $item_id = $item_data['item_id']; $new_item = TRUE; } - + $items_taxes_data = array(); $tax_names = $this->input->post('tax_names'); $tax_percents = $this->input->post('tax_percents'); @@ -444,9 +483,15 @@ class Items extends Secure_Controller foreach($stock_locations as $location) { $updated_quantity = parse_decimals($this->input->post('quantity_' . $location['location_id'])); + if($item_data['item_type'] == ITEM_TEMP) + { + $updated_quantity = 0; + } $location_detail = array('item_id' => $item_id, 'location_id' => $location['location_id'], 'quantity' => $updated_quantity); + + $item_quantity = $this->Item_quantity->get_item_quantity($item_id, $location['location_id']); if($item_quantity->quantity != $updated_quantity || $new_item) { diff --git a/application/controllers/Sales.php b/application/controllers/Sales.php index 01388f403..556aabc50 100644 --- a/application/controllers/Sales.php +++ b/application/controllers/Sales.php @@ -19,6 +19,7 @@ class Sales extends Secure_Controller public function index() { + $this->session->set_userdata('allow_temp_items', 1); $this->_reload(); } @@ -1274,6 +1275,10 @@ class Sales extends Secure_Controller $this->session->set_userdata('sale_id', -1); } } + else + { + $this->sale_lib->remove_temp_items(); + } $this->sale_lib->clear_all(); $this->_reload(); @@ -1387,6 +1392,58 @@ class Sales extends Secure_Controller return $filtered_cart; } -} + public function change_item_number() + { + $item_id = $this->input->post('item_id'); + $item_number = $this->input->post('item_number'); + $this->Item->update_item_number($item_id, $item_number); + $cart = $this->sale_lib->get_cart(); + $x = $this->search_cart_for_item_id($item_id, $cart); + if($x != NULL) + { + $cart[$x]['item_number'] = $item_number; + } + $this->sale_lib->set_cart($cart); + } + + public function change_item_name() + { + $item_id = $this->input->post('item_id'); + $name = $this->input->post('item_name'); + $this->Item->update_item_name($item_id, $name); + $cart = $this->sale_lib->get_cart(); + $x = $this->search_cart_for_item_id($item_id, $cart); + if($x != NULL) { + $cart[$x]['name'] = $name; + } + $this->sale_lib->set_cart($cart); + } + + public function change_item_description() + { + $item_id = $this->input->post('item_id'); + $description = $this->input->post('item_description'); + $this->Item->update_item_description($item_id, $description); + $cart = $this->sale_lib->get_cart(); + $x = $this->search_cart_for_item_id($item_id, $cart); + if($x != NULL) + { + $cart[$x]['description'] = $description; + } + $this->sale_lib->set_cart($cart); + } + + function search_cart_for_item_id($id, $array) + { + foreach($array as $key => $val) + { + if ($val['item_id'] === $id) + { + return $key; + } + } + return NULL; + } +} ?> diff --git a/application/language/en-GB/items_lang.php b/application/language/en-GB/items_lang.php index 9c116f555..f993612c0 100644 --- a/application/language/en-GB/items_lang.php +++ b/application/language/en-GB/items_lang.php @@ -97,6 +97,7 @@ $lang["items_tax_percent"] = "Tax Percent"; $lang["items_tax_percent_number"] = "Tax Percent must be a numeric value"; $lang["items_tax_percent_required"] = "Tax Percent is a required field"; $lang["items_tax_percents"] = "Tax Percent(s)"; +$lang["items_temp"] = "Temporary"; $lang["items_type"] = "Item Type"; $lang["items_unit_price"] = "Sell Price"; $lang["items_unit_price_number"] = "Sell Price must be a number"; diff --git a/application/language/en-US/items_lang.php b/application/language/en-US/items_lang.php index bb5928912..bf8527123 100644 --- a/application/language/en-US/items_lang.php +++ b/application/language/en-US/items_lang.php @@ -97,6 +97,7 @@ $lang["items_tax_percent"] = "Tax Percent"; $lang["items_tax_percent_number"] = "Tax Percent must be a numeric value"; $lang["items_tax_percent_required"] = "Tax Percent is a required field."; $lang["items_tax_percents"] = "Tax Percent(s)"; +$lang["items_temp"] = "Temporary"; $lang["items_type"] = "Item Type"; $lang["items_unit_price"] = "Retail Price"; $lang["items_unit_price_number"] = "Unit price must be a number."; diff --git a/application/libraries/Sale_lib.php b/application/libraries/Sale_lib.php index 61ca5d259..4c90e2612 100644 --- a/application/libraries/Sale_lib.php +++ b/application/libraries/Sale_lib.php @@ -66,7 +66,7 @@ class Sale_lib $filtered_cart = array(); - foreach($cart as $k=>$v) + foreach($cart as $k => $v) { if($v['print_option'] == PRINT_YES) { @@ -78,7 +78,7 @@ class Sale_lib if($this->CI->config->item('line_sequence') == '0') { $sort = array(); - foreach($filtered_cart as $k=>$v) + foreach($filtered_cart as $k => $v) { $sort['line'][$k] = $v['line']; } @@ -88,19 +88,19 @@ class Sale_lib elseif($this->CI->config->item('line_sequence') == '1') { $sort = array(); - foreach($filtered_cart as $k=>$v) + foreach($filtered_cart as $k => $v) { $sort['stock_type'][$k] = $v['stock_type']; $sort['description'][$k] = $v['description']; $sort['name'][$k] = $v['name']; } - array_multisort($sort['stock_type'], SORT_DESC, $sort['description'], SORT_ASC, $sort['name'], SORT_ASC. $filtered_cart); + array_multisort($sort['stock_type'], SORT_DESC, $sort['description'], SORT_ASC, $sort['name'], SORT_ASC . $filtered_cart); } // Group by Item Category elseif($this->CI->config->item('line_sequence') == '2') { $sort = array(); - foreach($filtered_cart as $k=>$v) + foreach($filtered_cart as $k => $v) { $sort['category'][$k] = $v['stock_type']; $sort['description'][$k] = $v['description']; @@ -112,7 +112,7 @@ class Sale_lib else { $sort = array(); - foreach($filtered_cart as $k=>$v) + foreach($filtered_cart as $k => $v) { $sort['line'][$k] = $v['line']; } @@ -132,6 +132,19 @@ class Sale_lib $this->CI->session->unset_userdata('sales_cart'); } + public function remove_temp_items() + { + // Loop through the cart items and delete temporary items specific to this sale + $cart = $this->get_cart(); + foreach($cart as $line=>$item) + { + if($item['item_type'] == ITEM_TEMP) + { + $this->CI->Item->delete($item['item_id']); + } + } + } + public function get_comment() { // avoid returning a NULL that results in a 0 in the comment if nothing is set/available @@ -685,7 +698,7 @@ class Sale_lib public function add_item(&$item_id, $quantity = 1, $item_location, $discount = 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 ) { - $item_info = $this->CI->Item->get_info_by_id_or_number($item_id); + $item_info = $this->CI->Item->get_info_by_id($item_id); //make sure item exists if(empty($item_info)) @@ -862,7 +875,7 @@ class Sale_lib //make sure item exists if($item_id != -1) { - $item_info = $this->CI->Item->get_info_by_id_or_number($item_id); + $item_info = $this->CI->Item->get_info_by_id($item_id); if($item_info->stock_type == HAS_STOCK) { @@ -940,6 +953,12 @@ class Sale_lib public function delete_item($line) { $items = $this->get_cart(); + $item_type = $items[$line]['item_type']; + if($item_type == ITEM_TEMP) + { + $item_id = $items[$line]['item_id']; + $this->CI->Item->delete($item_id); + } unset($items[$line]); $this->set_cart($items); } diff --git a/application/models/Item.php b/application/models/Item.php index 48589a28d..5a085aecc 100644 --- a/application/models/Item.php +++ b/application/models/Item.php @@ -6,6 +6,7 @@ define('HAS_NO_STOCK', 1); define('ITEM', 0); define('ITEM_KIT', 1); define('ITEM_AMOUNT_ENTRY', 2); +define('ITEM_TEMP', 3); define('PRINT_ALL', 0); define('PRINT_PRICED', 1); @@ -65,7 +66,7 @@ class Item extends CI_Model $this->db->where('item_number', (string) $item_number); // check if $item_id is a number and not a string starting with 0 // because cases like 00012345 will be seen as a number where it is a barcode - if(ctype_digit($item_id) && substr($item_id, 0, 1) != '0') + if(is_numeric($item_id) && substr($item_id, 0, 1) != '0') { $this->db->where('item_id !=', (int) $item_id); } @@ -225,6 +226,15 @@ class Item extends CI_Model { $this->db->where('items.description', ''); } + if($filters['temporary'] != FALSE) + { + $this->db->where('items.item_type', ITEM_TEMP); + } + else + { + $non_temp = array(ITEM, ITEM_KIT, ITEM_AMOUNT_ENTRY); + $this->db->where_in('items.item_type', $non_temp); + } // get_found_rows case if($count_only == TRUE) @@ -341,6 +351,26 @@ class Item extends CI_Model return ''; } + /* + * Gets information about a particular active item by item id + */ + public function get_info_by_id($item_id) + { + $this->db->from('items'); + + $this->db->where('items.item_id', (int) $item_id); + + $this->db->where('items.deleted', 0); + + $query = $this->db->get(); + + if($query->num_rows() == 1) + { + return $query->row(); + } + + return ''; + } /* Get an item id given an item number */ @@ -388,10 +418,8 @@ class Item extends CI_Model if($this->db->insert('items', $item_data)) { $item_data['item_id'] = $this->db->insert_id(); - return TRUE; } - return FALSE; } @@ -923,5 +951,24 @@ class Item extends CI_Model return $this->save($data, $item_id); } + + public function update_item_number($item_id, $item_number) + { + $this->db->where('item_id', $item_id); + $this->db->update('items', array('item_number'=>$item_number)); + } + + public function update_item_name($item_id, $item_name) + { + $this->db->where('item_id', $item_id); + $this->db->update('items', array('name'=>$item_name)); + } + + public function update_item_description($item_id, $item_description) + { + $this->db->where('item_id', $item_id); + $this->db->update('items', array('description'=>$item_description)); + } + } ?> diff --git a/application/models/Sale.php b/application/models/Sale.php index c4b3bfe2f..9c1cba3ce 100644 --- a/application/models/Sale.php +++ b/application/models/Sale.php @@ -1292,7 +1292,6 @@ class Sale extends CI_Model $this->db->update('sales', array('sale_status'=>$sale_status)); } - /** * Gets the quote_number for the selected sale */ diff --git a/application/views/items/form.php b/application/views/items/form.php index 637ee9056..08bae1e5a 100644 --- a/application/views/items/form.php +++ b/application/views/items/form.php @@ -107,7 +107,21 @@ - + + +
diff --git a/application/views/sales/register.php b/application/views/sales/register.php index 734259d80..3762dd06e 100644 --- a/application/views/sales/register.php +++ b/application/views/sales/register.php @@ -135,13 +135,33 @@ if(isset($success)) ?> 'form-horizontal', 'id'=>'cart_'.$line)); ?> - ');?> - - -
+ + '); ?> + 'hidden', 'name'=>'item_id', 'value'=>$item['item_id'])); ?> - + + 'item_number', 'id'=>'item_number','class'=>'form-control input-sm', 'value'=>$item['item_number'], 'tabindex'=>++$tabindex));?> + + 'name','id'=>'name', 'class'=>'form-control input-sm', 'value'=>$item['name'], 'tabindex'=>++$tabindex));?> + + + + + +
+ + + - lang->line('sales_description_abbrv');?> + 'hidden', 'name'=>'item_id', 'value'=>$item['item_id'])); ?> + + 'item_description', 'id'=>'item_description', 'class'=>'form-control input-sm', 'value'=>$item['description'], 'tabindex'=>++$tabindex));?> + + + + + + lang->line('sales_description_abbrv');?> + + + + 'description', 'class'=>'form-control input-sm', 'value'=>$item['description'], 'onClick'=>'this.select();')); + } + else + { + if($item['description']!='') + { + echo $item['description']; + echo form_hidden('description', $item['description']); + } + else + { + echo $this->lang->line('sales_no_description'); + echo form_hidden('description',''); + } + } + ?> + +   + + lang->line('sales_serial'); + } + ?> + + + 'serialnumber', 'class'=>'form-control input-sm', 'value'=>$item['serialnumber'], 'onClick'=>'this.select();')); + } + else + { + echo form_hidden('serialnumber', ''); + } + ?> + - - 'description', 'class'=>'form-control input-sm', 'value'=>$item['description'], 'onClick'=>'this.select();')); - } - else - { - if($item['description']!='') - { - echo $item['description']; - echo form_hidden('description', $item['description']); - } - else - { - echo $this->lang->line('sales_no_description'); - echo form_hidden('description',''); - } - } - ?> - -   - - lang->line('sales_serial'); - } - ?> - - - 'serialnumber', 'class'=>'form-control input-sm', 'value'=>$item['serialnumber'], 'onClick'=>'this.select();')); - } - else - { - echo form_hidden('serialnumber', ''); - } - ?> - $(document).ready(function() { + $("input[name='item_number']").change(function(){ + var item_id = $(this).parents("tr").find("input[name='item_id']").val(); + var item_number = $(this).val(); + $.ajax({ + url: "", + method: 'post', + data: $.extend(csrf_form_base(), + { + "item_id" : item_id, + "item_number" : item_number, + }), + dataType: 'json' + }); + }); + + $("input[name='name']").change(function(){ + var item_id = $(this).parents("tr").find("input[name='item_id']").val(); + var item_name = $(this).val(); + $.ajax({ + url: "", + method: 'post', + data: $.extend(csrf_form_base(), + { + "item_id" : item_id, + "item_name" : item_name, + }), + dataType: 'json' + }); + }); + + $("input[name='item_description']").change(function(){ + var item_id = $(this).parents("tr").find("input[name='item_id']").val(); + var item_description = $(this).val(); + $.ajax({ + url: "", + method: 'post', + data: $.extend(csrf_form_base(), + { + "item_id" : item_id, + "item_description" : item_description, + }), + dataType: 'json' + }); + }); + $('#item').focus(); $('#item').blur(function() From 019fc7a3d554a0f5676355465f171f5436059886 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sun, 10 Jun 2018 08:58:07 +0100 Subject: [PATCH 120/568] Remove generated database sql files --- database/database.sql | 1020 ------------------------- database/migrate_phppos_dist.sql | 1191 ------------------------------ 2 files changed, 2211 deletions(-) delete mode 100644 database/database.sql delete mode 100644 database/migrate_phppos_dist.sql diff --git a/database/database.sql b/database/database.sql deleted file mode 100644 index ef62555f5..000000000 --- a/database/database.sql +++ /dev/null @@ -1,1020 +0,0 @@ --- >> This file is autogenerated from tables.sql and constraints.sql. Do not modify directly << -- --- --- Table structure for table `ospos_app_config` --- - -CREATE TABLE `ospos_app_config` ( - `key` varchar(50) NOT NULL, - `value` varchar(500) NOT NULL, - PRIMARY KEY (`key`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_app_config` --- - -INSERT INTO `ospos_app_config` (`key`, `value`) VALUES -('address', '123 Nowhere street'), -('company', 'Open Source Point of Sale'), -('default_register_mode', 'sale'), -('default_tax_rate', '8'), -('default_tax_category', 'Standard'), -('email', 'changeme@example.com'), -('fax', ''), -('phone', '555-555-5555'), -('return_policy', 'Test'), -('timezone', 'America/New_York'), -('website', ''), -('company_logo', ''), -('tax_included', '0'), -('barcode_content', 'id'), -('barcode_type', 'Code39'), -('barcode_formats', '[]'), -('barcode_width', '250'), -('barcode_height', '50'), -('barcode_quality', '100'), -('barcode_font', 'Arial'), -('barcode_font_size', '10'), -('barcode_first_row', 'category'), -('barcode_second_row', 'item_code'), -('barcode_third_row', 'unit_price'), -('barcode_num_in_row', '2'), -('barcode_page_width', '100'), -('barcode_page_cellspacing', '20'), -('barcode_generate_if_empty', '0'), -('receipt_show_company_name', '1'), -('receipt_show_taxes', '0'), -('receipt_show_total_discount', '1'), -('receipt_show_description', '1'), -('receipt_show_serialnumber', '1'), -('invoice_enable', '1'), -('last_used_invoice_number', '0'), -('last_used_quote_number', '0'), -('line_sequence', '0'), -('recv_invoice_format', '{CO}'), -('sales_invoice_format', '{CO}'), -('sales_quote_format', 'Q%y{QSEQ:6}'), -('invoice_email_message', 'Dear {CU}, In attachment the receipt for sale $INV'), -('invoice_default_comments', 'This is a default comment'), -('print_silently', '1'), -('print_header', '0'), -('print_footer', '0'), -('print_top_margin', '0'), -('print_left_margin', '0'), -('print_bottom_margin', '0'), -('print_right_margin', '0'), -('default_sales_discount', '0'), -('lines_per_page', '25'), -('dateformat', 'm/d/Y'), -('timeformat', 'H:i:s'), -('currency_symbol', '$'), -('number_locale', 'en_US'), -('thousands_separator', '1'), -('currency_decimals', '2'), -('tax_decimals', '2'), -('quantity_decimals', '0'), -('country_codes', 'us'), -('default_tax_1_name', ''), -('default_tax_1_rate', ''), -('default_tax_2_name', ''), -('default_tax_2_rate', ''), -('msg_msg', ''), -('msg_uid', ''), -('msg_src', ''), -('msg_pwd', ''), -('notify_horizontal_position', 'center'), -('notify_vertical_position', 'bottom'), -('payment_options_order', 'cashdebitcredit'), -('protocol', 'mail'), -('mailpath', '/usr/sbin/sendmail'), -('smtp_port', '465'), -('smtp_timeout', '5'), -('smtp_crypto', 'ssl'), -('smtp_host', ''), -('smtp_pass', ''), -('smtp_user', ''), -('receipt_template', 'receipt_default'), -('theme', 'flatly'), -('customer_sales_tax_support', '0'), -('language', 'english'), -('language_code', 'en-US'), -('date_or_time_format', ''), -('dinner_table_enable', '0'), -('customer_reward_enable', '0'), -('default_origin_tax_code', ''), -('cash_decimals', '2'), -('cash_rounding_code', '0'), -('financial_year', '1'), -('giftcard_number', 'series'), -('receipt_font_size', '12'), -('gcaptcha_enable', '0'), -('gcaptcha_secret_key', ''), -('gcaptcha_site_key', ''), -('receiving_calculate_average_price', '0'), -('work_order_enable', '0'), -('work_order_format', 'W%y{WSEQ:6}'), -('last_used_work_order_number', '0'), -('suggestions_first_column', 'name'), -('suggestions_second_column', ''), -('suggestions_third_column', ''), -('allow_duplicate_barcodes', '0'), -('quote_default_comments', 'This is a default quote comment'); - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_customers` --- - -CREATE TABLE `ospos_customers` ( - `person_id` int(10) NOT NULL, - `company_name` varchar(255) DEFAULT NULL, - `account_number` varchar(255) DEFAULT NULL, - `taxable` int(1) NOT NULL DEFAULT '1', - `sales_tax_code` varchar(32) NOT NULL DEFAULT '1', - `discount_percent` decimal(15,2) NOT NULL DEFAULT '0', - `package_id` int(11) DEFAULT NULL, - `points` int(11) DEFAULT NULL, - `deleted` int(1) NOT NULL DEFAULT '0', - UNIQUE KEY `account_number` (`account_number`), - KEY `person_id` (`person_id`), - KEY `package_id` (`package_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_customers` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_employees` --- - -CREATE TABLE `ospos_employees` ( - `username` varchar(255) NOT NULL, - `password` varchar(255) NOT NULL, - `person_id` int(10) NOT NULL, - `deleted` int(1) NOT NULL DEFAULT '0', - `hash_version` int(1) NOT NULL DEFAULT '2', - `language` VARCHAR(48) DEFAULT NULL, - `language_code` VARCHAR(8) DEFAULT NULL, - UNIQUE KEY `username` (`username`), - KEY `person_id` (`person_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_employees` --- - -INSERT INTO `ospos_employees` (`username`, `password`, `person_id`, `deleted`, `hash_version`) VALUES - ('admin', '$2y$10$vJBSMlD02EC7ENSrKfVQXuvq9tNRHMtcOA8MSK2NYS748HHWm.gcG', 1, 0, 2); - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_giftcards` --- - -CREATE TABLE `ospos_giftcards` ( - `record_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `giftcard_id` int(11) NOT NULL AUTO_INCREMENT, - `giftcard_number` VARCHAR(255) NULL, - `value` decimal(15,2) NOT NULL, - `deleted` int(1) NOT NULL DEFAULT '0', - `person_id` INT(10) DEFAULT NULL, - PRIMARY KEY (`giftcard_id`), - UNIQUE KEY `giftcard_number` (`giftcard_number`), - KEY `person_id` (`person_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_giftcards` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_inventory` --- - -CREATE TABLE `ospos_inventory` ( - `trans_id` int(11) NOT NULL AUTO_INCREMENT, - `trans_items` int(11) NOT NULL DEFAULT '0', - `trans_user` int(11) NOT NULL DEFAULT '0', - `trans_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `trans_comment` text NOT NULL, - `trans_location` int(11) NOT NULL, - `trans_inventory` decimal(15,3) NOT NULL DEFAULT '0', - PRIMARY KEY (`trans_id`), - KEY `trans_items` (`trans_items`), - KEY `trans_user` (`trans_user`), - KEY `trans_location` (`trans_location`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_inventory` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_items` --- - -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, - `cost_price` decimal(15,2) NOT NULL, - `unit_price` decimal(15,2) NOT NULL, - `reorder_level` decimal(15,3) NOT NULL DEFAULT '0', - `receiving_quantity` decimal(15,3) NOT NULL DEFAULT '1', - `item_id` int(10) NOT NULL AUTO_INCREMENT, - `pic_filename` varchar(255) DEFAULT NULL, - `allow_alt_description` tinyint(1) NOT NULL, - `is_serialized` tinyint(1) NOT NULL, - `stock_type` TINYINT(2) NOT NULL DEFAULT 0, - `item_type` TINYINT(2) NOT NULL DEFAULT 0, - `tax_category_id` int(10) NOT NULL DEFAULT 1, - `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`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_items` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_items_taxes` --- - -CREATE TABLE `ospos_items_taxes` ( - `item_id` int(10) NOT NULL, - `name` varchar(255) NOT NULL, - `percent` decimal(15,3) NOT NULL, - PRIMARY KEY (`item_id`,`name`,`percent`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_items_taxes` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_item_kits` --- - -CREATE TABLE `ospos_item_kits` ( - `item_kit_id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(255) NOT NULL, - `item_id` INT(10) NOT NULL DEFAULT 0, - `kit_discount_percent` DECIMAL(15,2) NOT NULL DEFAULT 0.00, - `price_option` TINYINT(2) NOT NULL DEFAULT 0, - `print_option` TINYINT(2) NOT NULL DEFAULT 0, - `description` varchar(255) NOT NULL, - PRIMARY KEY (`item_kit_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_item_kits` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_item_kit_items` --- - -CREATE TABLE `ospos_item_kit_items` ( - `item_kit_id` int(11) NOT NULL, - `item_id` int(11) NOT NULL, - `quantity` decimal(15,3) NOT NULL, - `kit_sequence` INT(3) NOT NULL DEFAULT 0, - PRIMARY KEY (`item_kit_id`,`item_id`,`quantity`), - KEY `ospos_item_kit_items_ibfk_2` (`item_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_item_kit_items` --- - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_item_quantities` --- - -CREATE TABLE IF NOT EXISTS `ospos_item_quantities` ( - `item_id` int(11) NOT NULL, - `location_id` int(11) NOT NULL, - `quantity` decimal(15,3) NOT NULL DEFAULT '0', - PRIMARY KEY (`item_id`,`location_id`), - KEY `item_id` (`item_id`), - KEY `location_id` (`location_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_modules` --- - -CREATE TABLE `ospos_modules` ( - `name_lang_key` varchar(255) NOT NULL, - `desc_lang_key` varchar(255) NOT NULL, - `sort` int(10) NOT NULL, - `module_id` varchar(255) NOT NULL, - PRIMARY KEY (`module_id`), - UNIQUE KEY `desc_lang_key` (`desc_lang_key`), - UNIQUE KEY `name_lang_key` (`name_lang_key`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for 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_customers', 'module_customers_desc', 10, 'customers'), -('module_employees', 'module_employees_desc', 80, 'employees'), -('module_giftcards', 'module_giftcards_desc', 90, 'giftcards'), -('module_home', 'module_home_desc', 1, 'home'), -('module_items', 'module_items_desc', 20, 'items'), -('module_item_kits', 'module_item_kits_desc', 30, 'item_kits'), -('module_messages', 'module_messages_desc', 98, 'messages'), -('module_office', 'module_office_desc', 999, 'office'), -('module_receivings', 'module_receivings_desc', 60, 'receivings'), -('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'); - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_people` --- - -CREATE TABLE `ospos_people` ( - `first_name` varchar(255) NOT NULL, - `last_name` varchar(255) NOT NULL, - `gender` int(1) DEFAULT NULL, - `phone_number` varchar(255) NOT NULL, - `email` varchar(255) NOT NULL, - `address_1` varchar(255) NOT NULL, - `address_2` varchar(255) NOT NULL, - `city` varchar(255) NOT NULL, - `state` varchar(255) NOT NULL, - `zip` varchar(255) NOT NULL, - `country` varchar(255) NOT NULL, - `comments` text NOT NULL, - `person_id` int(10) NOT NULL AUTO_INCREMENT, - PRIMARY KEY (`person_id`), - KEY `email` (`email`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_people` --- - -INSERT INTO `ospos_people` (`first_name`, `last_name`, `phone_number`, `email`, `address_1`, `address_2`, `city`, `state`, `zip`, `country`, `comments`, `person_id`) VALUES -('John', 'Doe', '555-555-5555', 'changeme@example.com', 'Address 1', '', '', '', '', '', '', 1); - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_permissions` --- - -CREATE TABLE `ospos_permissions` ( - `permission_id` varchar(255) NOT NULL, - `module_id` varchar(255) NOT NULL, - `location_id` int(10) DEFAULT NULL, - PRIMARY KEY (`permission_id`), - KEY `module_id` (`module_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_permissions` --- - -INSERT INTO `ospos_permissions` (`permission_id`, `module_id`) VALUES -('reports_customers', 'reports'), -('reports_receivings', 'reports'), -('reports_items', 'reports'), -('reports_employees', 'reports'), -('reports_suppliers', 'reports'), -('reports_sales', 'reports'), -('reports_discounts', 'reports'), -('reports_taxes', 'reports'), -('reports_inventory', 'reports'), -('reports_categories', 'reports'), -('reports_payments', 'reports'), -('customers', 'customers'), -('employees', 'employees'), -('giftcards', 'giftcards'), -('home', 'home'), -('items', 'items'), -('item_kits', 'item_kits'), -('messages', 'messages'), -('office', 'office'), -('receivings', 'receivings'), -('reports', 'reports'), -('sales', 'sales'), -('config', 'config'), -('suppliers', 'suppliers'), -('taxes', 'taxes'); - - - -INSERT INTO `ospos_permissions` (`permission_id`, `module_id`, `location_id`) VALUES -('items_stock', 'items', 1), -('sales_stock', 'sales', 1), -('receivings_stock', 'receivings', 1); - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_grants` --- - -CREATE TABLE `ospos_grants` ( - `permission_id` varchar(255) NOT NULL, - `person_id` int(10) NOT NULL, - `menu_group` varchar(32) DEFAULT 'home', - PRIMARY KEY (`permission_id`,`person_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_grants` --- --- -------------------------------------------------------- - -INSERT INTO `ospos_grants` (`permission_id`, `person_id`, `menu_group`) VALUES -('reports_customers', 1, 'home'), -('reports_receivings', 1, 'home'), -('reports_items', 1, 'home'), -('reports_inventory', 1, 'home'), -('reports_employees', 1, 'home'), -('reports_suppliers', 1, 'home'), -('reports_sales', 1, 'home'), -('reports_discounts', 1, 'home'), -('reports_taxes', 1, 'home'), -('reports_categories', 1, 'home'), -('reports_payments', 1, 'home'), -('customers', 1, 'home'), -('employees', 1, 'office'), -('giftcards', 1, 'home'), -('items', 1, 'home'), -('item_kits', 1, 'home'), -('messages', 1, 'home'), -('receivings', 1, 'home'), -('reports', 1, 'home'), -('sales', 1, 'home'), -('config', 1, 'office'), -('items_stock', 1, 'home'), -('sales_stock', 1, 'home'), -('receivings_stock', 1, 'home'), -('suppliers', 1, 'home'), -('taxes', 1, 'office'), -('office', 1, 'home'), -('home', 1, 'office'); - --- --- Table structure for table `ospos_receivings` --- - -CREATE TABLE `ospos_receivings` ( - `receiving_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `supplier_id` int(10) DEFAULT NULL, - `employee_id` int(10) NOT NULL DEFAULT '0', - `comment` text DEFAULT NULL, - `receiving_id` int(10) NOT NULL AUTO_INCREMENT, - `payment_type` varchar(20) DEFAULT NULL, - `reference` varchar(32) DEFAULT NULL, - PRIMARY KEY (`receiving_id`), - KEY `supplier_id` (`supplier_id`), - KEY `employee_id` (`employee_id`), - KEY `reference` (`reference`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_receivings` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_receivings_items` --- - -CREATE TABLE `ospos_receivings_items` ( - `receiving_id` int(10) NOT NULL DEFAULT '0', - `item_id` int(10) NOT NULL DEFAULT '0', - `description` varchar(30) DEFAULT NULL, - `serialnumber` varchar(30) DEFAULT NULL, - `line` int(3) NOT NULL, - `quantity_purchased` decimal(15,3) NOT NULL DEFAULT '0', - `item_cost_price` decimal(15,2) NOT NULL, - `item_unit_price` decimal(15,2) NOT NULL, - `discount_percent` decimal(15,2) NOT NULL DEFAULT '0', - `item_location` int(11) NOT NULL, - `receiving_quantity` decimal(15,3) NOT NULL DEFAULT '1', - PRIMARY KEY (`receiving_id`,`item_id`,`line`), - KEY `item_id` (`item_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_receivings_items` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_sales` --- - -CREATE TABLE `ospos_sales` ( - `sale_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `customer_id` int(10) DEFAULT NULL, - `employee_id` int(10) NOT NULL DEFAULT '0', - `comment` text DEFAULT NULL, - `invoice_number` varchar(32) DEFAULT NULL, - `quote_number` varchar(32) DEFAULT NULL, - `sale_id` int(10) NOT NULL AUTO_INCREMENT, - `sale_status` tinyint(2) NOT NULL DEFAULT 0, - `dinner_table_id` int(11) NULL, - `work_order_number` varchar(32) DEFAULT NULL, - `sale_type` tinyint(2) NOT NULL DEFAULT 0, - PRIMARY KEY (`sale_id`), - KEY `customer_id` (`customer_id`), - KEY `employee_id` (`employee_id`), - KEY `sale_time` (`sale_time`), - KEY `dinner_table_id` (`dinner_table_id`), - UNIQUE KEY `invoice_number` (`invoice_number`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_sales` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_sales_items` --- - -CREATE TABLE `ospos_sales_items` ( - `sale_id` int(10) NOT NULL DEFAULT '0', - `item_id` int(10) NOT NULL DEFAULT '0', - `description` varchar(255) DEFAULT NULL, - `serialnumber` varchar(30) DEFAULT NULL, - `line` int(3) NOT NULL DEFAULT '0', - `quantity_purchased` decimal(15,3) NOT NULL DEFAULT '0', - `item_cost_price` decimal(15,2) NOT NULL, - `item_unit_price` decimal(15,2) NOT NULL, - `discount_percent` decimal(15,2) NOT NULL DEFAULT '0', - `item_location` int(11) NOT NULL, - `print_option` TINYINT(2) NOT NULL DEFAULT 0, - PRIMARY KEY (`sale_id`,`item_id`,`line`), - KEY `sale_id` (`sale_id`), - KEY `item_id` (`item_id`), - KEY `item_location` (`item_location`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_sales_items` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_sales_items_taxes` --- - -CREATE TABLE `ospos_sales_items_taxes` ( - `sale_id` int(10) NOT NULL, - `item_id` int(10) NOT NULL, - `line` int(3) NOT NULL DEFAULT '0', - `name` varchar(255) NOT NULL, - `percent` decimal(15,4) NOT NULL DEFAULT 0.0000, - `tax_type` tinyint(2) NOT NULL DEFAULT 0, - `rounding_code` tinyint(2) NOT NULL DEFAULT 0, - `cascade_tax` tinyint(2) NOT NULL DEFAULT 0, - `cascade_sequence` tinyint(2) NOT NULL DEFAULT 0, - `item_tax_amount` decimal(15,4) NOT NULL DEFAULT 0, - PRIMARY KEY (`sale_id`,`item_id`,`line`,`name`,`percent`), - KEY `sale_id` (`sale_id`), - KEY `item_id` (`item_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_sales_items_taxes` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_sales_payments` --- - -CREATE TABLE `ospos_sales_payments` ( - `sale_id` int(10) NOT NULL, - `payment_type` varchar(40) NOT NULL, - `payment_amount` decimal(15,2) NOT NULL, - PRIMARY KEY (`sale_id`,`payment_type`), - KEY `sale_id` (`sale_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_sales_payments` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_sales_taxes` --- - -CREATE TABLE `ospos_sales_taxes` ( - `sale_id` int(10) NOT NULL, - `tax_type` smallint(2) NOT NULL, - `tax_group` varchar(32) NOT NULL, - `sale_tax_basis` decimal(15,4) NOT NULL, - `sale_tax_amount` decimal(15,4) NOT NULL, - `print_sequence` tinyint(2) NOT NULL DEFAULT 0, - `name` varchar(255) NOT NULL, - `tax_rate` decimal(15,4) NOT NULL, - `sales_tax_code` varchar(32) NOT NULL DEFAULT '', - `rounding_code` tinyint(2) NOT NULL DEFAULT 0, - PRIMARY KEY (`sale_id`,`tax_type`,`tax_group`), - KEY `print_sequence` (`sale_id`,`print_sequence`,`tax_type`,`tax_group`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_sales_taxes` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_sessions` --- - -CREATE TABLE `ospos_sessions` ( - `id` varchar(40) NOT NULL, - `ip_address` varchar(45) NOT NULL, - `timestamp` int(10) unsigned DEFAULT 0 NOT NULL, - `data` blob NOT NULL, - KEY `ci_sessions_timestamp` (`timestamp`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_sessions` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_stock_locations` --- - -CREATE TABLE `ospos_stock_locations` ( - `location_id` int(11) NOT NULL AUTO_INCREMENT, - `location_name` varchar(255) DEFAULT NULL, - `deleted` int(1) NOT NULL DEFAULT '0', - PRIMARY KEY (`location_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_stock_locations` --- - -INSERT INTO `ospos_stock_locations` (`location_name` ) VALUES ('stock'); - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_suppliers` --- - -CREATE TABLE `ospos_suppliers` ( - `person_id` int(10) NOT NULL, - `company_name` varchar(255) NOT NULL, - `agency_name` varchar(255) NOT NULL, - `account_number` varchar(255) DEFAULT NULL, - `deleted` int(1) NOT NULL DEFAULT '0', - UNIQUE KEY `account_number` (`account_number`), - KEY `person_id` (`person_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_tax_categories` --- - -CREATE TABLE IF NOT EXISTS `ospos_tax_categories` ( - `tax_category_id` int(10) NOT NULL AUTO_INCREMENT, - `tax_category` varchar(32) NOT NULL, - `tax_group_sequence` tinyint(2) NOT NULL, - PRIMARY KEY (`tax_category_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; - --- --- Dumping data for table `ospos_stock_locations` --- - -INSERT INTO `ospos_tax_categories` (`tax_category`, `tax_group_sequence` ) VALUES - ('Standard', 10), - ('Service', 12), - ('Alcohol', 11); - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_tax_codes` --- - -CREATE TABLE IF NOT EXISTS `ospos_tax_codes` ( - `tax_code` varchar(32) NOT NULL, - `tax_code_name` varchar(255) NOT NULL DEFAULT '', - `tax_code_type` tinyint(2) NOT NULL DEFAULT 0, - `city` varchar(255) NOT NULL DEFAULT '', - `state` varchar(255) NOT NULL DEFAULT '', - PRIMARY KEY (`tax_code`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_tax_codes` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_tax_code_rates` --- - -CREATE TABLE IF NOT EXISTS `ospos_tax_code_rates` ( - `rate_tax_code` varchar(32) NOT NULL, - `rate_tax_category_id` int(10) NOT NULL, - `tax_rate` decimal(15,4) NOT NULL DEFAULT 0.0000, - `rounding_code` tinyint(2) NOT NULL DEFAULT 0, - PRIMARY KEY (`rate_tax_code`,`rate_tax_category_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_tax_code_rates` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_dinner_tables` --- - -CREATE TABLE `ospos_dinner_tables` ( - `dinner_table_id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(30) NOT NULL, - `status` tinyint(1) NOT NULL DEFAULT '0', - `deleted` int(1) NOT NULL DEFAULT '0', - PRIMARY KEY (`dinner_table_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; - --- --- Dumping data for table `ospos_dinner_tables` --- - -INSERT INTO `ospos_dinner_tables` (`name`) VALUES ('Delivery'), ('Take Away'); - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_customer_packages` --- - -CREATE TABLE IF NOT EXISTS `ospos_customers_packages` ( - `package_id` int(11) NOT NULL AUTO_INCREMENT, - `package_name` varchar(255) DEFAULT NULL, - `points_percent` float NOT NULL DEFAULT '0', - `deleted` int(1) NOT NULL DEFAULT '0', - PRIMARY KEY (`package_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; - -INSERT INTO `ospos_customers_packages` (`package_name`, `points_percent`) VALUES - ('Default', 0), - ('Bronze', 10), - ('Silver', 20), - ('Gold', 30), - ('Premium', 50); - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_customer_points` --- - -CREATE TABLE IF NOT EXISTS `ospos_customers_points` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `person_id` int(11) NOT NULL, - `package_id` int(11) NOT NULL, - `sale_id` int(11) NOT NULL, - `points_earned` int(11) NOT NULL, - PRIMARY KEY (`id`), - KEY `person_id` (`person_id`), - KEY `package_id` (`package_id`), - KEY `sale_id` (`sale_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_sales_reward_points` --- - -CREATE TABLE IF NOT EXISTS `ospos_sales_reward_points` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `sale_id` int(11) NOT NULL, - `earned` float NOT NULL, - `used` float NOT NULL, - PRIMARY KEY (`id`), - KEY `sale_id` (`sale_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; - - --- -------------------------------------------------------- - --- --- Constraints for dumped tables --- - --- --- Constraints for table `ospos_customers` --- -ALTER TABLE `ospos_customers` - ADD CONSTRAINT `ospos_customers_ibfk_1` FOREIGN KEY (`person_id`) REFERENCES `ospos_people` (`person_id`), - ADD CONSTRAINT `ospos_customers_ibfk_2` FOREIGN KEY (`package_id`) REFERENCES `ospos_customers_packages` (`package_id`); - --- --- Constraints for table `ospos_employees` --- -ALTER TABLE `ospos_employees` - ADD CONSTRAINT `ospos_employees_ibfk_1` FOREIGN KEY (`person_id`) REFERENCES `ospos_people` (`person_id`); - --- --- Constraints for table `ospos_inventory` --- -ALTER TABLE `ospos_inventory` - ADD CONSTRAINT `ospos_inventory_ibfk_1` FOREIGN KEY (`trans_items`) REFERENCES `ospos_items` (`item_id`), - ADD CONSTRAINT `ospos_inventory_ibfk_2` FOREIGN KEY (`trans_user`) REFERENCES `ospos_employees` (`person_id`), - ADD CONSTRAINT `ospos_inventory_ibfk_3` FOREIGN KEY (`trans_location`) REFERENCES `ospos_stock_locations` (`location_id`); - --- --- Constraints for table `ospos_items` --- -ALTER TABLE `ospos_items` - ADD CONSTRAINT `ospos_items_ibfk_1` FOREIGN KEY (`supplier_id`) REFERENCES `ospos_suppliers` (`person_id`); - --- --- Constraints for table `ospos_items_taxes` --- -ALTER TABLE `ospos_items_taxes` - ADD CONSTRAINT `ospos_items_taxes_ibfk_1` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`) ON DELETE CASCADE; - --- --- Constraints for table `ospos_item_kit_items` --- -ALTER TABLE `ospos_item_kit_items` - ADD CONSTRAINT `ospos_item_kit_items_ibfk_1` FOREIGN KEY (`item_kit_id`) REFERENCES `ospos_item_kits` (`item_kit_id`) ON DELETE CASCADE, - ADD CONSTRAINT `ospos_item_kit_items_ibfk_2` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`) ON DELETE CASCADE; - --- --- Constraints for table `ospos_permissions` --- -ALTER TABLE `ospos_permissions` - ADD CONSTRAINT `ospos_permissions_ibfk_1` FOREIGN KEY (`module_id`) REFERENCES `ospos_modules` (`module_id`) ON DELETE CASCADE, - ADD CONSTRAINT `ospos_permissions_ibfk_2` FOREIGN KEY (`location_id`) REFERENCES `ospos_stock_locations` (`location_id`) ON DELETE CASCADE; - --- --- Constraints for table `ospos_grants` --- -ALTER TABLE `ospos_grants` - ADD CONSTRAINT `ospos_grants_ibfk_1` foreign key (`permission_id`) references `ospos_permissions` (`permission_id`) ON DELETE CASCADE, - ADD CONSTRAINT `ospos_grants_ibfk_2` foreign key (`person_id`) references `ospos_employees` (`person_id`) ON DELETE CASCADE; - --- --- Constraints for table `ospos_receivings` --- -ALTER TABLE `ospos_receivings` - ADD CONSTRAINT `ospos_receivings_ibfk_1` FOREIGN KEY (`employee_id`) REFERENCES `ospos_employees` (`person_id`), - ADD CONSTRAINT `ospos_receivings_ibfk_2` FOREIGN KEY (`supplier_id`) REFERENCES `ospos_suppliers` (`person_id`); - --- --- Constraints for table `ospos_receivings_items` --- -ALTER TABLE `ospos_receivings_items` - ADD CONSTRAINT `ospos_receivings_items_ibfk_1` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`), - ADD CONSTRAINT `ospos_receivings_items_ibfk_2` FOREIGN KEY (`receiving_id`) REFERENCES `ospos_receivings` (`receiving_id`); - --- --- Constraints for table `ospos_sales` --- -ALTER TABLE `ospos_sales` - ADD CONSTRAINT `ospos_sales_ibfk_1` FOREIGN KEY (`employee_id`) REFERENCES `ospos_employees` (`person_id`), - ADD CONSTRAINT `ospos_sales_ibfk_2` FOREIGN KEY (`customer_id`) REFERENCES `ospos_customers` (`person_id`), - ADD CONSTRAINT `ospos_sales_ibfk_3` FOREIGN KEY (`dinner_table_id`) REFERENCES `ospos_dinner_tables` (`dinner_table_id`); - --- --- Constraints for table `ospos_sales_items` --- -ALTER TABLE `ospos_sales_items` - ADD CONSTRAINT `ospos_sales_items_ibfk_1` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`), - ADD CONSTRAINT `ospos_sales_items_ibfk_2` FOREIGN KEY (`sale_id`) REFERENCES `ospos_sales` (`sale_id`), - ADD CONSTRAINT `ospos_sales_items_ibfk_3` FOREIGN KEY (`item_location`) REFERENCES `ospos_stock_locations` (`location_id`); - --- --- Constraints for table `ospos_sales_items_taxes` --- -ALTER TABLE `ospos_sales_items_taxes` - ADD CONSTRAINT `ospos_sales_items_taxes_ibfk_1` FOREIGN KEY (`sale_id`) REFERENCES `ospos_sales_items` (`sale_id`), - ADD CONSTRAINT `ospos_sales_items_taxes_ibfk_2` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`); - --- --- Constraints for table `ospos_sales_payments` --- -ALTER TABLE `ospos_sales_payments` - ADD CONSTRAINT `ospos_sales_payments_ibfk_1` FOREIGN KEY (`sale_id`) REFERENCES `ospos_sales` (`sale_id`); - --- --- Constraints for table `ospos_item_quantities` --- -ALTER TABLE `ospos_item_quantities` - ADD CONSTRAINT `ospos_item_quantities_ibfk_1` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`), - ADD CONSTRAINT `ospos_item_quantities_ibfk_2` FOREIGN KEY (`location_id`) REFERENCES `ospos_stock_locations` (`location_id`); - --- --- Constraints for table `ospos_suppliers` --- -ALTER TABLE `ospos_suppliers` - ADD CONSTRAINT `ospos_suppliers_ibfk_1` FOREIGN KEY (`person_id`) REFERENCES `ospos_people` (`person_id`); - --- --- Constraints for table `ospos_giftcards` --- -ALTER TABLE `ospos_giftcards` - ADD CONSTRAINT `ospos_giftcards_ibfk_1` FOREIGN KEY (`person_id`) REFERENCES `ospos_people` (`person_id`); - --- --- Constraints for table `ospos_customers_points` --- -ALTER TABLE `ospos_customers_points` - ADD CONSTRAINT `ospos_customers_points_ibfk_1` FOREIGN KEY (`person_id`) REFERENCES `ospos_customers` (`person_id`), - ADD CONSTRAINT `ospos_customers_points_ibfk_2` FOREIGN KEY (`package_id`) REFERENCES `ospos_customers_packages` (`package_id`), - ADD CONSTRAINT `ospos_customers_points_ibfk_3` FOREIGN KEY (`sale_id`) REFERENCES `ospos_sales` (`sale_id`); - --- --- 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`); diff --git a/database/migrate_phppos_dist.sql b/database/migrate_phppos_dist.sql deleted file mode 100644 index 92406c936..000000000 --- a/database/migrate_phppos_dist.sql +++ /dev/null @@ -1,1191 +0,0 @@ --- >> This file is autogenerated from tables.sql and constraints.sql. Do not modify directly << -- --- --- Table structure for table `ospos_app_config` --- - -CREATE TABLE `ospos_app_config` ( - `key` varchar(50) NOT NULL, - `value` varchar(500) NOT NULL, - PRIMARY KEY (`key`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_app_config` --- - -INSERT INTO `ospos_app_config` (`key`, `value`) VALUES -('address', '123 Nowhere street'), -('company', 'Open Source Point of Sale'), -('default_register_mode', 'sale'), -('default_tax_rate', '8'), -('default_tax_category', 'Standard'), -('email', 'changeme@example.com'), -('fax', ''), -('phone', '555-555-5555'), -('return_policy', 'Test'), -('timezone', 'America/New_York'), -('website', ''), -('company_logo', ''), -('tax_included', '0'), -('barcode_content', 'id'), -('barcode_type', 'Code39'), -('barcode_formats', '[]'), -('barcode_width', '250'), -('barcode_height', '50'), -('barcode_quality', '100'), -('barcode_font', 'Arial'), -('barcode_font_size', '10'), -('barcode_first_row', 'category'), -('barcode_second_row', 'item_code'), -('barcode_third_row', 'unit_price'), -('barcode_num_in_row', '2'), -('barcode_page_width', '100'), -('barcode_page_cellspacing', '20'), -('barcode_generate_if_empty', '0'), -('receipt_show_company_name', '1'), -('receipt_show_taxes', '0'), -('receipt_show_total_discount', '1'), -('receipt_show_description', '1'), -('receipt_show_serialnumber', '1'), -('invoice_enable', '1'), -('last_used_invoice_number', '0'), -('last_used_quote_number', '0'), -('line_sequence', '0'), -('recv_invoice_format', '{CO}'), -('sales_invoice_format', '{CO}'), -('sales_quote_format', 'Q%y{QSEQ:6}'), -('invoice_email_message', 'Dear {CU}, In attachment the receipt for sale $INV'), -('invoice_default_comments', 'This is a default comment'), -('print_silently', '1'), -('print_header', '0'), -('print_footer', '0'), -('print_top_margin', '0'), -('print_left_margin', '0'), -('print_bottom_margin', '0'), -('print_right_margin', '0'), -('default_sales_discount', '0'), -('lines_per_page', '25'), -('dateformat', 'm/d/Y'), -('timeformat', 'H:i:s'), -('currency_symbol', '$'), -('number_locale', 'en_US'), -('thousands_separator', '1'), -('currency_decimals', '2'), -('tax_decimals', '2'), -('quantity_decimals', '0'), -('country_codes', 'us'), -('default_tax_1_name', ''), -('default_tax_1_rate', ''), -('default_tax_2_name', ''), -('default_tax_2_rate', ''), -('msg_msg', ''), -('msg_uid', ''), -('msg_src', ''), -('msg_pwd', ''), -('notify_horizontal_position', 'center'), -('notify_vertical_position', 'bottom'), -('payment_options_order', 'cashdebitcredit'), -('protocol', 'mail'), -('mailpath', '/usr/sbin/sendmail'), -('smtp_port', '465'), -('smtp_timeout', '5'), -('smtp_crypto', 'ssl'), -('smtp_host', ''), -('smtp_pass', ''), -('smtp_user', ''), -('receipt_template', 'receipt_default'), -('theme', 'flatly'), -('customer_sales_tax_support', '0'), -('language', 'english'), -('language_code', 'en-US'), -('date_or_time_format', ''), -('dinner_table_enable', '0'), -('customer_reward_enable', '0'), -('default_origin_tax_code', ''), -('cash_decimals', '2'), -('cash_rounding_code', '0'), -('financial_year', '1'), -('giftcard_number', 'series'), -('receipt_font_size', '12'), -('gcaptcha_enable', '0'), -('gcaptcha_secret_key', ''), -('gcaptcha_site_key', ''), -('receiving_calculate_average_price', '0'), -('work_order_enable', '0'), -('work_order_format', 'W%y{WSEQ:6}'), -('last_used_work_order_number', '0'), -('suggestions_first_column', 'name'), -('suggestions_second_column', ''), -('suggestions_third_column', ''), -('allow_duplicate_barcodes', '0'), -('quote_default_comments', 'This is a default quote comment'); - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_customers` --- - -CREATE TABLE `ospos_customers` ( - `person_id` int(10) NOT NULL, - `company_name` varchar(255) DEFAULT NULL, - `account_number` varchar(255) DEFAULT NULL, - `taxable` int(1) NOT NULL DEFAULT '1', - `sales_tax_code` varchar(32) NOT NULL DEFAULT '1', - `discount_percent` decimal(15,2) NOT NULL DEFAULT '0', - `package_id` int(11) DEFAULT NULL, - `points` int(11) DEFAULT NULL, - `deleted` int(1) NOT NULL DEFAULT '0', - UNIQUE KEY `account_number` (`account_number`), - KEY `person_id` (`person_id`), - KEY `package_id` (`package_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_customers` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_employees` --- - -CREATE TABLE `ospos_employees` ( - `username` varchar(255) NOT NULL, - `password` varchar(255) NOT NULL, - `person_id` int(10) NOT NULL, - `deleted` int(1) NOT NULL DEFAULT '0', - `hash_version` int(1) NOT NULL DEFAULT '2', - `language` VARCHAR(48) DEFAULT NULL, - `language_code` VARCHAR(8) DEFAULT NULL, - UNIQUE KEY `username` (`username`), - KEY `person_id` (`person_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_employees` --- - -INSERT INTO `ospos_employees` (`username`, `password`, `person_id`, `deleted`, `hash_version`) VALUES - ('admin', '$2y$10$vJBSMlD02EC7ENSrKfVQXuvq9tNRHMtcOA8MSK2NYS748HHWm.gcG', 1, 0, 2); - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_giftcards` --- - -CREATE TABLE `ospos_giftcards` ( - `record_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `giftcard_id` int(11) NOT NULL AUTO_INCREMENT, - `giftcard_number` VARCHAR(255) NULL, - `value` decimal(15,2) NOT NULL, - `deleted` int(1) NOT NULL DEFAULT '0', - `person_id` INT(10) DEFAULT NULL, - PRIMARY KEY (`giftcard_id`), - UNIQUE KEY `giftcard_number` (`giftcard_number`), - KEY `person_id` (`person_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_giftcards` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_inventory` --- - -CREATE TABLE `ospos_inventory` ( - `trans_id` int(11) NOT NULL AUTO_INCREMENT, - `trans_items` int(11) NOT NULL DEFAULT '0', - `trans_user` int(11) NOT NULL DEFAULT '0', - `trans_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `trans_comment` text NOT NULL, - `trans_location` int(11) NOT NULL, - `trans_inventory` decimal(15,3) NOT NULL DEFAULT '0', - PRIMARY KEY (`trans_id`), - KEY `trans_items` (`trans_items`), - KEY `trans_user` (`trans_user`), - KEY `trans_location` (`trans_location`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_inventory` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_items` --- - -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, - `cost_price` decimal(15,2) NOT NULL, - `unit_price` decimal(15,2) NOT NULL, - `reorder_level` decimal(15,3) NOT NULL DEFAULT '0', - `receiving_quantity` decimal(15,3) NOT NULL DEFAULT '1', - `item_id` int(10) NOT NULL AUTO_INCREMENT, - `pic_filename` varchar(255) DEFAULT NULL, - `allow_alt_description` tinyint(1) NOT NULL, - `is_serialized` tinyint(1) NOT NULL, - `stock_type` TINYINT(2) NOT NULL DEFAULT 0, - `item_type` TINYINT(2) NOT NULL DEFAULT 0, - `tax_category_id` int(10) NOT NULL DEFAULT 1, - `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`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_items` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_items_taxes` --- - -CREATE TABLE `ospos_items_taxes` ( - `item_id` int(10) NOT NULL, - `name` varchar(255) NOT NULL, - `percent` decimal(15,3) NOT NULL, - PRIMARY KEY (`item_id`,`name`,`percent`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_items_taxes` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_item_kits` --- - -CREATE TABLE `ospos_item_kits` ( - `item_kit_id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(255) NOT NULL, - `item_id` INT(10) NOT NULL DEFAULT 0, - `kit_discount_percent` DECIMAL(15,2) NOT NULL DEFAULT 0.00, - `price_option` TINYINT(2) NOT NULL DEFAULT 0, - `print_option` TINYINT(2) NOT NULL DEFAULT 0, - `description` varchar(255) NOT NULL, - PRIMARY KEY (`item_kit_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_item_kits` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_item_kit_items` --- - -CREATE TABLE `ospos_item_kit_items` ( - `item_kit_id` int(11) NOT NULL, - `item_id` int(11) NOT NULL, - `quantity` decimal(15,3) NOT NULL, - `kit_sequence` INT(3) NOT NULL DEFAULT 0, - PRIMARY KEY (`item_kit_id`,`item_id`,`quantity`), - KEY `ospos_item_kit_items_ibfk_2` (`item_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_item_kit_items` --- - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_item_quantities` --- - -CREATE TABLE IF NOT EXISTS `ospos_item_quantities` ( - `item_id` int(11) NOT NULL, - `location_id` int(11) NOT NULL, - `quantity` decimal(15,3) NOT NULL DEFAULT '0', - PRIMARY KEY (`item_id`,`location_id`), - KEY `item_id` (`item_id`), - KEY `location_id` (`location_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_modules` --- - -CREATE TABLE `ospos_modules` ( - `name_lang_key` varchar(255) NOT NULL, - `desc_lang_key` varchar(255) NOT NULL, - `sort` int(10) NOT NULL, - `module_id` varchar(255) NOT NULL, - PRIMARY KEY (`module_id`), - UNIQUE KEY `desc_lang_key` (`desc_lang_key`), - UNIQUE KEY `name_lang_key` (`name_lang_key`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for 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_customers', 'module_customers_desc', 10, 'customers'), -('module_employees', 'module_employees_desc', 80, 'employees'), -('module_giftcards', 'module_giftcards_desc', 90, 'giftcards'), -('module_home', 'module_home_desc', 1, 'home'), -('module_items', 'module_items_desc', 20, 'items'), -('module_item_kits', 'module_item_kits_desc', 30, 'item_kits'), -('module_messages', 'module_messages_desc', 98, 'messages'), -('module_office', 'module_office_desc', 999, 'office'), -('module_receivings', 'module_receivings_desc', 60, 'receivings'), -('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'); - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_people` --- - -CREATE TABLE `ospos_people` ( - `first_name` varchar(255) NOT NULL, - `last_name` varchar(255) NOT NULL, - `gender` int(1) DEFAULT NULL, - `phone_number` varchar(255) NOT NULL, - `email` varchar(255) NOT NULL, - `address_1` varchar(255) NOT NULL, - `address_2` varchar(255) NOT NULL, - `city` varchar(255) NOT NULL, - `state` varchar(255) NOT NULL, - `zip` varchar(255) NOT NULL, - `country` varchar(255) NOT NULL, - `comments` text NOT NULL, - `person_id` int(10) NOT NULL AUTO_INCREMENT, - PRIMARY KEY (`person_id`), - KEY `email` (`email`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_people` --- - -INSERT INTO `ospos_people` (`first_name`, `last_name`, `phone_number`, `email`, `address_1`, `address_2`, `city`, `state`, `zip`, `country`, `comments`, `person_id`) VALUES -('John', 'Doe', '555-555-5555', 'changeme@example.com', 'Address 1', '', '', '', '', '', '', 1); - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_permissions` --- - -CREATE TABLE `ospos_permissions` ( - `permission_id` varchar(255) NOT NULL, - `module_id` varchar(255) NOT NULL, - `location_id` int(10) DEFAULT NULL, - PRIMARY KEY (`permission_id`), - KEY `module_id` (`module_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_permissions` --- - -INSERT INTO `ospos_permissions` (`permission_id`, `module_id`) VALUES -('reports_customers', 'reports'), -('reports_receivings', 'reports'), -('reports_items', 'reports'), -('reports_employees', 'reports'), -('reports_suppliers', 'reports'), -('reports_sales', 'reports'), -('reports_discounts', 'reports'), -('reports_taxes', 'reports'), -('reports_inventory', 'reports'), -('reports_categories', 'reports'), -('reports_payments', 'reports'), -('customers', 'customers'), -('employees', 'employees'), -('giftcards', 'giftcards'), -('home', 'home'), -('items', 'items'), -('item_kits', 'item_kits'), -('messages', 'messages'), -('office', 'office'), -('receivings', 'receivings'), -('reports', 'reports'), -('sales', 'sales'), -('config', 'config'), -('suppliers', 'suppliers'), -('taxes', 'taxes'); - - - -INSERT INTO `ospos_permissions` (`permission_id`, `module_id`, `location_id`) VALUES -('items_stock', 'items', 1), -('sales_stock', 'sales', 1), -('receivings_stock', 'receivings', 1); - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_grants` --- - -CREATE TABLE `ospos_grants` ( - `permission_id` varchar(255) NOT NULL, - `person_id` int(10) NOT NULL, - `menu_group` varchar(32) DEFAULT 'home', - PRIMARY KEY (`permission_id`,`person_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_grants` --- --- -------------------------------------------------------- - -INSERT INTO `ospos_grants` (`permission_id`, `person_id`, `menu_group`) VALUES -('reports_customers', 1, 'home'), -('reports_receivings', 1, 'home'), -('reports_items', 1, 'home'), -('reports_inventory', 1, 'home'), -('reports_employees', 1, 'home'), -('reports_suppliers', 1, 'home'), -('reports_sales', 1, 'home'), -('reports_discounts', 1, 'home'), -('reports_taxes', 1, 'home'), -('reports_categories', 1, 'home'), -('reports_payments', 1, 'home'), -('customers', 1, 'home'), -('employees', 1, 'office'), -('giftcards', 1, 'home'), -('items', 1, 'home'), -('item_kits', 1, 'home'), -('messages', 1, 'home'), -('receivings', 1, 'home'), -('reports', 1, 'home'), -('sales', 1, 'home'), -('config', 1, 'office'), -('items_stock', 1, 'home'), -('sales_stock', 1, 'home'), -('receivings_stock', 1, 'home'), -('suppliers', 1, 'home'), -('taxes', 1, 'office'), -('office', 1, 'home'), -('home', 1, 'office'); - --- --- Table structure for table `ospos_receivings` --- - -CREATE TABLE `ospos_receivings` ( - `receiving_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `supplier_id` int(10) DEFAULT NULL, - `employee_id` int(10) NOT NULL DEFAULT '0', - `comment` text DEFAULT NULL, - `receiving_id` int(10) NOT NULL AUTO_INCREMENT, - `payment_type` varchar(20) DEFAULT NULL, - `reference` varchar(32) DEFAULT NULL, - PRIMARY KEY (`receiving_id`), - KEY `supplier_id` (`supplier_id`), - KEY `employee_id` (`employee_id`), - KEY `reference` (`reference`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_receivings` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_receivings_items` --- - -CREATE TABLE `ospos_receivings_items` ( - `receiving_id` int(10) NOT NULL DEFAULT '0', - `item_id` int(10) NOT NULL DEFAULT '0', - `description` varchar(30) DEFAULT NULL, - `serialnumber` varchar(30) DEFAULT NULL, - `line` int(3) NOT NULL, - `quantity_purchased` decimal(15,3) NOT NULL DEFAULT '0', - `item_cost_price` decimal(15,2) NOT NULL, - `item_unit_price` decimal(15,2) NOT NULL, - `discount_percent` decimal(15,2) NOT NULL DEFAULT '0', - `item_location` int(11) NOT NULL, - `receiving_quantity` decimal(15,3) NOT NULL DEFAULT '1', - PRIMARY KEY (`receiving_id`,`item_id`,`line`), - KEY `item_id` (`item_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_receivings_items` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_sales` --- - -CREATE TABLE `ospos_sales` ( - `sale_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `customer_id` int(10) DEFAULT NULL, - `employee_id` int(10) NOT NULL DEFAULT '0', - `comment` text DEFAULT NULL, - `invoice_number` varchar(32) DEFAULT NULL, - `quote_number` varchar(32) DEFAULT NULL, - `sale_id` int(10) NOT NULL AUTO_INCREMENT, - `sale_status` tinyint(2) NOT NULL DEFAULT 0, - `dinner_table_id` int(11) NULL, - `work_order_number` varchar(32) DEFAULT NULL, - `sale_type` tinyint(2) NOT NULL DEFAULT 0, - PRIMARY KEY (`sale_id`), - KEY `customer_id` (`customer_id`), - KEY `employee_id` (`employee_id`), - KEY `sale_time` (`sale_time`), - KEY `dinner_table_id` (`dinner_table_id`), - UNIQUE KEY `invoice_number` (`invoice_number`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_sales` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_sales_items` --- - -CREATE TABLE `ospos_sales_items` ( - `sale_id` int(10) NOT NULL DEFAULT '0', - `item_id` int(10) NOT NULL DEFAULT '0', - `description` varchar(255) DEFAULT NULL, - `serialnumber` varchar(30) DEFAULT NULL, - `line` int(3) NOT NULL DEFAULT '0', - `quantity_purchased` decimal(15,3) NOT NULL DEFAULT '0', - `item_cost_price` decimal(15,2) NOT NULL, - `item_unit_price` decimal(15,2) NOT NULL, - `discount_percent` decimal(15,2) NOT NULL DEFAULT '0', - `item_location` int(11) NOT NULL, - `print_option` TINYINT(2) NOT NULL DEFAULT 0, - PRIMARY KEY (`sale_id`,`item_id`,`line`), - KEY `sale_id` (`sale_id`), - KEY `item_id` (`item_id`), - KEY `item_location` (`item_location`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_sales_items` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_sales_items_taxes` --- - -CREATE TABLE `ospos_sales_items_taxes` ( - `sale_id` int(10) NOT NULL, - `item_id` int(10) NOT NULL, - `line` int(3) NOT NULL DEFAULT '0', - `name` varchar(255) NOT NULL, - `percent` decimal(15,4) NOT NULL DEFAULT 0.0000, - `tax_type` tinyint(2) NOT NULL DEFAULT 0, - `rounding_code` tinyint(2) NOT NULL DEFAULT 0, - `cascade_tax` tinyint(2) NOT NULL DEFAULT 0, - `cascade_sequence` tinyint(2) NOT NULL DEFAULT 0, - `item_tax_amount` decimal(15,4) NOT NULL DEFAULT 0, - PRIMARY KEY (`sale_id`,`item_id`,`line`,`name`,`percent`), - KEY `sale_id` (`sale_id`), - KEY `item_id` (`item_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_sales_items_taxes` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_sales_payments` --- - -CREATE TABLE `ospos_sales_payments` ( - `sale_id` int(10) NOT NULL, - `payment_type` varchar(40) NOT NULL, - `payment_amount` decimal(15,2) NOT NULL, - PRIMARY KEY (`sale_id`,`payment_type`), - KEY `sale_id` (`sale_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_sales_payments` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_sales_taxes` --- - -CREATE TABLE `ospos_sales_taxes` ( - `sale_id` int(10) NOT NULL, - `tax_type` smallint(2) NOT NULL, - `tax_group` varchar(32) NOT NULL, - `sale_tax_basis` decimal(15,4) NOT NULL, - `sale_tax_amount` decimal(15,4) NOT NULL, - `print_sequence` tinyint(2) NOT NULL DEFAULT 0, - `name` varchar(255) NOT NULL, - `tax_rate` decimal(15,4) NOT NULL, - `sales_tax_code` varchar(32) NOT NULL DEFAULT '', - `rounding_code` tinyint(2) NOT NULL DEFAULT 0, - PRIMARY KEY (`sale_id`,`tax_type`,`tax_group`), - KEY `print_sequence` (`sale_id`,`print_sequence`,`tax_type`,`tax_group`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_sales_taxes` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_sessions` --- - -CREATE TABLE `ospos_sessions` ( - `id` varchar(40) NOT NULL, - `ip_address` varchar(45) NOT NULL, - `timestamp` int(10) unsigned DEFAULT 0 NOT NULL, - `data` blob NOT NULL, - KEY `ci_sessions_timestamp` (`timestamp`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_sessions` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_stock_locations` --- - -CREATE TABLE `ospos_stock_locations` ( - `location_id` int(11) NOT NULL AUTO_INCREMENT, - `location_name` varchar(255) DEFAULT NULL, - `deleted` int(1) NOT NULL DEFAULT '0', - PRIMARY KEY (`location_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_stock_locations` --- - -INSERT INTO `ospos_stock_locations` (`location_name` ) VALUES ('stock'); - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_suppliers` --- - -CREATE TABLE `ospos_suppliers` ( - `person_id` int(10) NOT NULL, - `company_name` varchar(255) NOT NULL, - `agency_name` varchar(255) NOT NULL, - `account_number` varchar(255) DEFAULT NULL, - `deleted` int(1) NOT NULL DEFAULT '0', - UNIQUE KEY `account_number` (`account_number`), - KEY `person_id` (`person_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_tax_categories` --- - -CREATE TABLE IF NOT EXISTS `ospos_tax_categories` ( - `tax_category_id` int(10) NOT NULL AUTO_INCREMENT, - `tax_category` varchar(32) NOT NULL, - `tax_group_sequence` tinyint(2) NOT NULL, - PRIMARY KEY (`tax_category_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; - --- --- Dumping data for table `ospos_stock_locations` --- - -INSERT INTO `ospos_tax_categories` (`tax_category`, `tax_group_sequence` ) VALUES - ('Standard', 10), - ('Service', 12), - ('Alcohol', 11); - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_tax_codes` --- - -CREATE TABLE IF NOT EXISTS `ospos_tax_codes` ( - `tax_code` varchar(32) NOT NULL, - `tax_code_name` varchar(255) NOT NULL DEFAULT '', - `tax_code_type` tinyint(2) NOT NULL DEFAULT 0, - `city` varchar(255) NOT NULL DEFAULT '', - `state` varchar(255) NOT NULL DEFAULT '', - PRIMARY KEY (`tax_code`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_tax_codes` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_tax_code_rates` --- - -CREATE TABLE IF NOT EXISTS `ospos_tax_code_rates` ( - `rate_tax_code` varchar(32) NOT NULL, - `rate_tax_category_id` int(10) NOT NULL, - `tax_rate` decimal(15,4) NOT NULL DEFAULT 0.0000, - `rounding_code` tinyint(2) NOT NULL DEFAULT 0, - PRIMARY KEY (`rate_tax_code`,`rate_tax_category_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `ospos_tax_code_rates` --- - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_dinner_tables` --- - -CREATE TABLE `ospos_dinner_tables` ( - `dinner_table_id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(30) NOT NULL, - `status` tinyint(1) NOT NULL DEFAULT '0', - `deleted` int(1) NOT NULL DEFAULT '0', - PRIMARY KEY (`dinner_table_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; - --- --- Dumping data for table `ospos_dinner_tables` --- - -INSERT INTO `ospos_dinner_tables` (`name`) VALUES ('Delivery'), ('Take Away'); - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_customer_packages` --- - -CREATE TABLE IF NOT EXISTS `ospos_customers_packages` ( - `package_id` int(11) NOT NULL AUTO_INCREMENT, - `package_name` varchar(255) DEFAULT NULL, - `points_percent` float NOT NULL DEFAULT '0', - `deleted` int(1) NOT NULL DEFAULT '0', - PRIMARY KEY (`package_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; - -INSERT INTO `ospos_customers_packages` (`package_name`, `points_percent`) VALUES - ('Default', 0), - ('Bronze', 10), - ('Silver', 20), - ('Gold', 30), - ('Premium', 50); - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_customer_points` --- - -CREATE TABLE IF NOT EXISTS `ospos_customers_points` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `person_id` int(11) NOT NULL, - `package_id` int(11) NOT NULL, - `sale_id` int(11) NOT NULL, - `points_earned` int(11) NOT NULL, - PRIMARY KEY (`id`), - KEY `person_id` (`person_id`), - KEY `package_id` (`package_id`), - KEY `sale_id` (`sale_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; - - --- -------------------------------------------------------- - --- --- Table structure for table `ospos_sales_reward_points` --- - -CREATE TABLE IF NOT EXISTS `ospos_sales_reward_points` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `sale_id` int(11) NOT NULL, - `earned` float NOT NULL, - `used` float NOT NULL, - PRIMARY KEY (`id`), - KEY `sale_id` (`sale_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; - - --- -------------------------------------------------------- - --- --- This migration script should be run after creating tables with the regular database script and before applying the constraints. --- - --- --- Copy data to table `ospos_app_config` --- - -DELETE FROM `ospos_app_config` WHERE `key` = 'address'; -INSERT INTO `ospos_app_config` (`key`, `value`) -SELECT `key`, `value` FROM `phppos`.phppos_app_config WHERE `key` = 'address'; -DELETE FROM `ospos_app_config` WHERE `key` = 'company'; -INSERT INTO `ospos_app_config` (`key`, `value`) -SELECT `key`, `value` FROM `phppos`.phppos_app_config WHERE `key` = 'company'; -DELETE FROM `ospos_app_config` WHERE `key` = 'default_tax_1_name'; -INSERT INTO `ospos_app_config` (`key`, `value`) -SELECT `key`, `value` FROM `phppos`.phppos_app_config WHERE `key` = 'default_tax_1_name'; -DELETE FROM `ospos_app_config` WHERE `key` = 'default_tax_1_rate'; -INSERT INTO `ospos_app_config` (`key`, `value`) -SELECT `key`, `value` FROM `phppos`.phppos_app_config WHERE `key` = 'default_tax_1_rate'; -DELETE FROM `ospos_app_config` WHERE `key` = 'default_tax_2_name'; -INSERT INTO `ospos_app_config` (`key`, `value`) -SELECT `key`, `value` FROM `phppos`.phppos_app_config WHERE `key` = 'default_tax_2_name'; -DELETE FROM `ospos_app_config` WHERE `key` = 'default_tax_2_rate'; -INSERT INTO `ospos_app_config` (`key`, `value`) -SELECT `key`, `value` FROM `phppos`.phppos_app_config WHERE `key` = 'default_tax_2_rate'; -DELETE FROM `ospos_app_config` WHERE `key` = 'default_tax_rate'; -INSERT INTO `ospos_app_config` (`key`, `value`) -SELECT `key`, `value` FROM `phppos`.phppos_app_config WHERE `key` = 'default_tax_rate'; -DELETE FROM `ospos_app_config` WHERE `key` = 'email'; -INSERT INTO `ospos_app_config` (`key`, `value`) -SELECT `key`, `value` FROM `phppos`.phppos_app_config WHERE `key` = 'email'; -DELETE FROM `ospos_app_config` WHERE `key` = 'fax'; -INSERT INTO `ospos_app_config` (`key`, `value`) -SELECT `key`, `value` FROM `phppos`.phppos_app_config WHERE `key` = 'fax'; -DELETE FROM `ospos_app_config` WHERE `key` = 'phone'; -INSERT INTO `ospos_app_config` (`key`, `value`) -SELECT `key`, `value` FROM `phppos`.phppos_app_config WHERE `key` = 'phone'; -DELETE FROM `ospos_app_config` WHERE `key` = 'website'; -INSERT INTO `ospos_app_config` (`key`, `value`) -SELECT `key`, `value` FROM `phppos`.phppos_app_config WHERE `key` = 'website'; -DELETE FROM `ospos_app_config` WHERE `key` = 'return_policy'; -INSERT INTO `ospos_app_config` (`key`, `value`) -SELECT `key`, `value` FROM `phppos`.phppos_app_config WHERE `key` = 'return_policy'; - --- --- Copy data to table `ospos_customers` --- - -INSERT INTO `ospos_customers` (`person_id`, `account_number`, `taxable`, `deleted`) -SELECT `person_id`, `account_number`, `taxable`, `deleted` FROM `phppos`.phppos_customers; -UPDATE `ospos_customers` c1, `ospos_customers` c2 SET `c1`.`account_number` = NULL WHERE `c1`.`person_id` > `c2`.`person_id` AND `c1`.`account_number` = `c2`.`account_number`; - --- --- Copy data to table `ospos_employees` --- - -INSERT INTO `ospos_employees` (`username`, `password`, `person_id`, `deleted`, `hash_version`) -SELECT `username`, `password`, `person_id`, `deleted`, 1 FROM `phppos`.phppos_employees; - --- --- Copy data to table `ospos_giftcards` --- - -INSERT INTO `ospos_giftcards` (`giftcard_id`, `giftcard_number`, `value`, `deleted`, `person_id`) -SELECT `giftcard_id`, `giftcard_number`, `value`, `deleted`, `person_id` FROM `phppos`.phppos_giftcards; - --- --- Copy data to table `ospos_inventory` --- - -INSERT INTO `ospos_inventory` (`trans_id`, `trans_items`, `trans_user`, `trans_date`, `trans_comment`, `trans_location`, `trans_inventory`) -SELECT `trans_id`, `trans_items`, `trans_user`, `trans_date`, `trans_comment`, 1, `trans_inventory` FROM `phppos`.phppos_inventory; - --- --- Copy data to table `ospos_items` --- - -INSERT INTO `ospos_items` (`name`, `category`, `supplier_id`, `item_number`, `description`, `cost_price`, `unit_price`, `reorder_level`, `receiving_quantity`, `item_id`, `pic_id`, `allow_alt_description`, `is_serialized`, `deleted`, `custom1`, `custom2`, `custom3`, `custom4`, `custom5`, `custom6`, `custom7`, `custom8`, `custom9`, `custom10`) -SELECT `name`, `category`, `supplier_id`, `item_number`, `description`, `cost_price`, `unit_price`, `reorder_level`, 1, `item_id`, NULL, `allow_alt_description`, `is_serialized`, `deleted`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 FROM `phppos`.phppos_items; - --- --- Copy data to table `ospos_items_taxes` --- - -INSERT INTO `ospos_items_taxes` (`item_id`, `name`, `percent`) -SELECT `item_id`, `name`, `percent` FROM `phppos`.phppos_items_taxes; - --- --- Copy data to table `ospos_item_kits` --- - -INSERT INTO `ospos_item_kits` (`item_kit_id`, `name`, `description`) -SELECT `item_kit_id`, `name`, `description` FROM `phppos`.phppos_item_kits; - --- --- Copy data to table `ospos_item_kit_items` --- - -INSERT INTO `ospos_item_kit_items` (`item_kit_id`, `item_id`, `quantity`) -SELECT `item_kit_id`, `item_id`, `quantity` FROM `phppos`.phppos_item_kit_items; - --- --- Copy data to table `ospos_people` --- - -INSERT INTO `ospos_people` (`first_name`, `last_name`, `phone_number`, `email`, `address_1`, `address_2`, `city`, `state`, `zip`, `country`, `comments`, `person_id`) -SELECT `first_name`, `last_name`, `phone_number`, `email`, `address_1`, `address_2`, `city`, `state`, `zip`, `country`, `comments`, `person_id` FROM `phppos`.phppos_people; - --- --- Copy data to table `ospos_receivings` --- - -INSERT INTO `ospos_receivings` (`receiving_time`, `supplier_id`, `employee_id`, `comment`, `receiving_id`, `payment_type`, `reference`) -SELECT `receiving_time`, `supplier_id`, `employee_id`, `comment`, `receiving_id`, `payment_type`, NULL FROM `phppos`.phppos_receivings; - --- --- Copy data to table `ospos_receivings_items` --- - -INSERT INTO `ospos_receivings_items` (`receiving_id`, `item_id`, `description`, `serialnumber`, `line`, `quantity_purchased`, `item_cost_price`, `item_unit_price`, `discount_percent`, `item_location`) -SELECT `receiving_id`, `item_id`, `description`, `serialnumber`, `line`, `quantity_purchased`, `item_cost_price`, `item_unit_price`, `discount_percent`, 1 FROM `phppos`.phppos_receivings_items; - --- --- Copy data to table `ospos_sales` --- - -INSERT INTO `ospos_sales` (`sale_time`, `customer_id`, `employee_id`, `comment`, `sale_id`, `invoice_number`) -SELECT `sale_time`, `customer_id`, `employee_id`, `comment`, `sale_id`, NULL FROM `phppos`.phppos_sales; - --- --- Copy data to table `ospos_sales_items` --- - -INSERT INTO `ospos_sales_items` (`sale_id`, `item_id`, `description`, `serialnumber`, `line`, `quantity_purchased`, `item_cost_price`, `item_unit_price`, `discount_percent`, `item_location`) -SELECT `sale_id`, `item_id`, `description`, `serialnumber`, `line`, `quantity_purchased`, `item_cost_price`, `item_unit_price`, `discount_percent`, 1 FROM `phppos`.phppos_sales_items; - --- --- Copy data to table `ospos_sales_items_taxes` --- - -INSERT INTO `ospos_sales_items_taxes` (`sale_id`, `item_id`, `line`, `name`, `percent`) -SELECT `sale_id`, `item_id`, `line`, `name`, `percent` FROM `phppos`.phppos_sales_items_taxes; - --- --- Copy data to table `ospos_sales_payments` --- - -INSERT INTO `ospos_sales_payments` (`sale_id`, `payment_type`, `payment_amount`) -SELECT `sale_id`, `payment_type`, `payment_amount` FROM `phppos`.phppos_sales_payments; - --- --- Copy data to table `ospos_item_quantities` --- - -INSERT INTO `ospos_item_quantities` (`item_id`, `location_id`, `quantity`) -SELECT `item_id`, 1, `quantity` FROM `phppos`.`phppos_items`; - --- --- Copy data to table `ospos_suppliers` --- - -INSERT INTO `ospos_suppliers` (`person_id`, `company_name`, `account_number`, `deleted`) -SELECT `person_id`, `company_name`, `account_number`, `deleted` FROM `phppos`.phppos_suppliers; - --- --- Copy data to table `ospos_dinner_tables` --- - -INSERT INTO `ospos_dinner_tables` (`dinner_table_id`, `name`, `status`, `deleted`) -SELECT `dinner_table_id`, `name`, `status`, `deleted` FROM `phppos`.phppos_dinner_tables; --- --- Constraints for dumped tables --- - --- --- Constraints for table `ospos_customers` --- -ALTER TABLE `ospos_customers` - ADD CONSTRAINT `ospos_customers_ibfk_1` FOREIGN KEY (`person_id`) REFERENCES `ospos_people` (`person_id`), - ADD CONSTRAINT `ospos_customers_ibfk_2` FOREIGN KEY (`package_id`) REFERENCES `ospos_customers_packages` (`package_id`); - --- --- Constraints for table `ospos_employees` --- -ALTER TABLE `ospos_employees` - ADD CONSTRAINT `ospos_employees_ibfk_1` FOREIGN KEY (`person_id`) REFERENCES `ospos_people` (`person_id`); - --- --- Constraints for table `ospos_inventory` --- -ALTER TABLE `ospos_inventory` - ADD CONSTRAINT `ospos_inventory_ibfk_1` FOREIGN KEY (`trans_items`) REFERENCES `ospos_items` (`item_id`), - ADD CONSTRAINT `ospos_inventory_ibfk_2` FOREIGN KEY (`trans_user`) REFERENCES `ospos_employees` (`person_id`), - ADD CONSTRAINT `ospos_inventory_ibfk_3` FOREIGN KEY (`trans_location`) REFERENCES `ospos_stock_locations` (`location_id`); - --- --- Constraints for table `ospos_items` --- -ALTER TABLE `ospos_items` - ADD CONSTRAINT `ospos_items_ibfk_1` FOREIGN KEY (`supplier_id`) REFERENCES `ospos_suppliers` (`person_id`); - --- --- Constraints for table `ospos_items_taxes` --- -ALTER TABLE `ospos_items_taxes` - ADD CONSTRAINT `ospos_items_taxes_ibfk_1` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`) ON DELETE CASCADE; - --- --- Constraints for table `ospos_item_kit_items` --- -ALTER TABLE `ospos_item_kit_items` - ADD CONSTRAINT `ospos_item_kit_items_ibfk_1` FOREIGN KEY (`item_kit_id`) REFERENCES `ospos_item_kits` (`item_kit_id`) ON DELETE CASCADE, - ADD CONSTRAINT `ospos_item_kit_items_ibfk_2` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`) ON DELETE CASCADE; - --- --- Constraints for table `ospos_permissions` --- -ALTER TABLE `ospos_permissions` - ADD CONSTRAINT `ospos_permissions_ibfk_1` FOREIGN KEY (`module_id`) REFERENCES `ospos_modules` (`module_id`) ON DELETE CASCADE, - ADD CONSTRAINT `ospos_permissions_ibfk_2` FOREIGN KEY (`location_id`) REFERENCES `ospos_stock_locations` (`location_id`) ON DELETE CASCADE; - --- --- Constraints for table `ospos_grants` --- -ALTER TABLE `ospos_grants` - ADD CONSTRAINT `ospos_grants_ibfk_1` foreign key (`permission_id`) references `ospos_permissions` (`permission_id`) ON DELETE CASCADE, - ADD CONSTRAINT `ospos_grants_ibfk_2` foreign key (`person_id`) references `ospos_employees` (`person_id`) ON DELETE CASCADE; - --- --- Constraints for table `ospos_receivings` --- -ALTER TABLE `ospos_receivings` - ADD CONSTRAINT `ospos_receivings_ibfk_1` FOREIGN KEY (`employee_id`) REFERENCES `ospos_employees` (`person_id`), - ADD CONSTRAINT `ospos_receivings_ibfk_2` FOREIGN KEY (`supplier_id`) REFERENCES `ospos_suppliers` (`person_id`); - --- --- Constraints for table `ospos_receivings_items` --- -ALTER TABLE `ospos_receivings_items` - ADD CONSTRAINT `ospos_receivings_items_ibfk_1` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`), - ADD CONSTRAINT `ospos_receivings_items_ibfk_2` FOREIGN KEY (`receiving_id`) REFERENCES `ospos_receivings` (`receiving_id`); - --- --- Constraints for table `ospos_sales` --- -ALTER TABLE `ospos_sales` - ADD CONSTRAINT `ospos_sales_ibfk_1` FOREIGN KEY (`employee_id`) REFERENCES `ospos_employees` (`person_id`), - ADD CONSTRAINT `ospos_sales_ibfk_2` FOREIGN KEY (`customer_id`) REFERENCES `ospos_customers` (`person_id`), - ADD CONSTRAINT `ospos_sales_ibfk_3` FOREIGN KEY (`dinner_table_id`) REFERENCES `ospos_dinner_tables` (`dinner_table_id`); - --- --- Constraints for table `ospos_sales_items` --- -ALTER TABLE `ospos_sales_items` - ADD CONSTRAINT `ospos_sales_items_ibfk_1` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`), - ADD CONSTRAINT `ospos_sales_items_ibfk_2` FOREIGN KEY (`sale_id`) REFERENCES `ospos_sales` (`sale_id`), - ADD CONSTRAINT `ospos_sales_items_ibfk_3` FOREIGN KEY (`item_location`) REFERENCES `ospos_stock_locations` (`location_id`); - --- --- Constraints for table `ospos_sales_items_taxes` --- -ALTER TABLE `ospos_sales_items_taxes` - ADD CONSTRAINT `ospos_sales_items_taxes_ibfk_1` FOREIGN KEY (`sale_id`) REFERENCES `ospos_sales_items` (`sale_id`), - ADD CONSTRAINT `ospos_sales_items_taxes_ibfk_2` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`); - --- --- Constraints for table `ospos_sales_payments` --- -ALTER TABLE `ospos_sales_payments` - ADD CONSTRAINT `ospos_sales_payments_ibfk_1` FOREIGN KEY (`sale_id`) REFERENCES `ospos_sales` (`sale_id`); - --- --- Constraints for table `ospos_item_quantities` --- -ALTER TABLE `ospos_item_quantities` - ADD CONSTRAINT `ospos_item_quantities_ibfk_1` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`), - ADD CONSTRAINT `ospos_item_quantities_ibfk_2` FOREIGN KEY (`location_id`) REFERENCES `ospos_stock_locations` (`location_id`); - --- --- Constraints for table `ospos_suppliers` --- -ALTER TABLE `ospos_suppliers` - ADD CONSTRAINT `ospos_suppliers_ibfk_1` FOREIGN KEY (`person_id`) REFERENCES `ospos_people` (`person_id`); - --- --- Constraints for table `ospos_giftcards` --- -ALTER TABLE `ospos_giftcards` - ADD CONSTRAINT `ospos_giftcards_ibfk_1` FOREIGN KEY (`person_id`) REFERENCES `ospos_people` (`person_id`); - --- --- Constraints for table `ospos_customers_points` --- -ALTER TABLE `ospos_customers_points` - ADD CONSTRAINT `ospos_customers_points_ibfk_1` FOREIGN KEY (`person_id`) REFERENCES `ospos_customers` (`person_id`), - ADD CONSTRAINT `ospos_customers_points_ibfk_2` FOREIGN KEY (`package_id`) REFERENCES `ospos_customers_packages` (`package_id`), - ADD CONSTRAINT `ospos_customers_points_ibfk_3` FOREIGN KEY (`sale_id`) REFERENCES `ospos_sales` (`sale_id`); - --- --- 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`); From f49c896e4f054afddb065705cc004a386b158212 Mon Sep 17 00:00:00 2001 From: Steve Ireland Date: Sun, 10 Jun 2018 15:24:52 -0400 Subject: [PATCH 121/568] Restore ctype_digit --- application/models/Item.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/Item.php b/application/models/Item.php index 5a085aecc..7b911b7dd 100644 --- a/application/models/Item.php +++ b/application/models/Item.php @@ -66,7 +66,7 @@ class Item extends CI_Model $this->db->where('item_number', (string) $item_number); // check if $item_id is a number and not a string starting with 0 // because cases like 00012345 will be seen as a number where it is a barcode - if(is_numeric($item_id) && substr($item_id, 0, 1) != '0') + if(ctype_digit($item_id) && substr($item_id, 0, 1) != '0') { $this->db->where('item_id !=', (int) $item_id); } From 3f12d57f8212f2eb24441d306ea7df69fc3b78b0 Mon Sep 17 00:00:00 2001 From: Steve Ireland Date: Mon, 11 Jun 2018 14:02:04 -0400 Subject: [PATCH 122/568] Fix item select issue introduced with temp item feature --- application/libraries/Sale_lib.php | 4 ++-- application/models/Item.php | 20 -------------------- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/application/libraries/Sale_lib.php b/application/libraries/Sale_lib.php index 4c90e2612..7dfb3fed9 100644 --- a/application/libraries/Sale_lib.php +++ b/application/libraries/Sale_lib.php @@ -698,7 +698,7 @@ class Sale_lib public function add_item(&$item_id, $quantity = 1, $item_location, $discount = 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 ) { - $item_info = $this->CI->Item->get_info_by_id($item_id); + $item_info = $this->CI->Item->get_info_by_id_or_number($item_id); //make sure item exists if(empty($item_info)) @@ -875,7 +875,7 @@ class Sale_lib //make sure item exists if($item_id != -1) { - $item_info = $this->CI->Item->get_info_by_id($item_id); + $item_info = $this->CI->Item->get_info_by_id_or_number($item_id); if($item_info->stock_type == HAS_STOCK) { diff --git a/application/models/Item.php b/application/models/Item.php index 7b911b7dd..fcb28c670 100644 --- a/application/models/Item.php +++ b/application/models/Item.php @@ -351,26 +351,6 @@ class Item extends CI_Model return ''; } - /* - * Gets information about a particular active item by item id - */ - public function get_info_by_id($item_id) - { - $this->db->from('items'); - - $this->db->where('items.item_id', (int) $item_id); - - $this->db->where('items.deleted', 0); - - $query = $this->db->get(); - - if($query->num_rows() == 1) - { - return $query->row(); - } - - return ''; - } /* Get an item id given an item number */ From abd23e5cb4db26467a7a3be8449dac78a95e6d2f Mon Sep 17 00:00:00 2001 From: jekkos Date: Wed, 13 Jun 2018 22:53:20 +0200 Subject: [PATCH 123/568] Refresh language files --- application/language/ar-EG/config_lang.php | 3 +- application/language/ar-EG/customers_lang.php | 3 +- application/language/ar-EG/items_lang.php | 4 +- application/language/ar-EG/reports_lang.php | 3 +- application/language/ar-EG/sales_lang.php | 3 +- application/language/az-AZ/items_lang.php | 1 + application/language/bg/items_lang.php | 1 + .../language/cs/bootstrap_tables_lang.php | 3 +- application/language/cs/common_lang.php | 6 +- application/language/cs/config_lang.php | 273 +++++++++++++++++- application/language/cs/customers_lang.php | 50 ++++ application/language/cs/datepicker_lang.php | 3 +- application/language/cs/employees_lang.php | 37 +++ application/language/cs/enum_lang.php | 9 + application/language/cs/error_lang.php | 4 + .../language/cs/expenses_categories_lang.php | 20 ++ application/language/cs/expenses_lang.php | 45 +++ application/language/cs/giftcards_lang.php | 70 +++++ application/language/cs/item_kits_lang.php | 32 ++ application/language/cs/items_lang.php | 18 +- application/language/cs/login_lang.php | 3 +- application/language/cs/messages_lang.php | 3 +- application/language/cs/module_lang.php | 4 +- application/language/cs/receivings_lang.php | 24 +- application/language/cs/reports_lang.php | 123 ++++++++ application/language/cs/sales_lang.php | 36 ++- application/language/cs/suppliers_lang.php | 19 ++ application/language/cs/taxes_lang.php | 33 ++- application/language/de-CH/items_lang.php | 1 + application/language/de/items_lang.php | 1 + application/language/es/items_lang.php | 4 +- application/language/es/sales_lang.php | 3 +- application/language/fr/config_lang.php | 3 +- application/language/fr/customers_lang.php | 3 +- application/language/fr/enum_lang.php | 3 +- .../language/fr/expenses_categories_lang.php | 3 +- application/language/fr/expenses_lang.php | 3 +- application/language/fr/item_kits_lang.php | 3 +- application/language/fr/items_lang.php | 4 +- application/language/fr/module_lang.php | 3 +- application/language/fr/reports_lang.php | 3 +- application/language/fr/sales_lang.php | 3 +- application/language/fr/suppliers_lang.php | 3 +- application/language/fr/taxes_lang.php | 3 +- application/language/hr-HR/items_lang.php | 1 + application/language/hu-HU/items_lang.php | 1 + application/language/id/common_lang.php | 3 +- application/language/id/config_lang.php | 3 +- application/language/id/items_lang.php | 1 + application/language/id/module_lang.php | 3 +- application/language/id/sales_lang.php | 3 +- application/language/it/items_lang.php | 1 + application/language/it/taxes_lang.php | 3 +- application/language/km/items_lang.php | 1 + application/language/lo/items_lang.php | 1 + application/language/nl-BE/common_lang.php | 3 +- application/language/nl-BE/config_lang.php | 3 +- application/language/nl-BE/items_lang.php | 4 +- application/language/nl/items_lang.php | 1 + application/language/pt-BR/items_lang.php | 1 + application/language/ru/config_lang.php | 3 +- application/language/ru/items_lang.php | 1 + application/language/sv/items_lang.php | 1 + application/language/th/items_lang.php | 1 + application/language/tr/items_lang.php | 1 + application/language/vi/items_lang.php | 1 + application/language/zh/items_lang.php | 1 + 67 files changed, 875 insertions(+), 46 deletions(-) create mode 100644 application/language/cs/customers_lang.php create mode 100644 application/language/cs/employees_lang.php create mode 100644 application/language/cs/enum_lang.php create mode 100644 application/language/cs/error_lang.php create mode 100644 application/language/cs/expenses_categories_lang.php create mode 100644 application/language/cs/expenses_lang.php create mode 100644 application/language/cs/giftcards_lang.php create mode 100644 application/language/cs/item_kits_lang.php create mode 100644 application/language/cs/reports_lang.php create mode 100644 application/language/cs/suppliers_lang.php diff --git a/application/language/ar-EG/config_lang.php b/application/language/ar-EG/config_lang.php index 7a1014dd0..05bc70412 100644 --- a/application/language/ar-EG/config_lang.php +++ b/application/language/ar-EG/config_lang.php @@ -1,4 +1,5 @@ - Date: Wed, 13 Jun 2018 22:30:37 +0100 Subject: [PATCH 124/568] Revert "Fix Item form issue (#2021)" --- application/views/items/form.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/views/items/form.php b/application/views/items/form.php index 08bae1e5a..551b91ce9 100644 --- a/application/views/items/form.php +++ b/application/views/items/form.php @@ -393,7 +393,7 @@ $(document).ready(function() type: 'POST', url: "", dataType: 'json', - data: $.extend(request, $extend(csrf_form_base(), {field_no: })), + data: $.extend(request, {field_no: }), success: function(data) { response($.map(data, function(item) { return { @@ -453,12 +453,12 @@ $(document).ready(function() { url: "", type: 'POST', - data: $.extend(csrf_form_base(), { + data: { "item_id": "item_id; ?>", "item_number": function() { return $("#item_number").val(); } - }) + } } }, cost_price: From b52174216e8ee40a4f89e953fc419b08737b2ce0 Mon Sep 17 00:00:00 2001 From: jekkos Date: Wed, 13 Jun 2018 23:10:29 +0200 Subject: [PATCH 125/568] Update LICENSE --- LICENSE | 1 + 1 file changed, 1 insertion(+) diff --git a/LICENSE b/LICENSE index 882aae407..dcea0bfc2 100644 --- a/LICENSE +++ b/LICENSE @@ -18,6 +18,7 @@ Copyright (c) 2017 Deep Shah (aka deepshah) Copyright (c) 2017 Joshua Fernandez (aka joshua1234511) Copyright (c) 2017 odiea Copyright (c) 2017 asadjaved63 +Copyright (c) 2018 WebShells/Shady Sh Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in From b2aaae9f38bac6497c729ce514967152cf8ea1ff Mon Sep 17 00:00:00 2001 From: jekkos Date: Sun, 17 Jun 2018 14:27:35 +0200 Subject: [PATCH 126/568] Update cloud install instructions --- INSTALL.md | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 6e2cceb15..ae6bb766f 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -56,32 +56,4 @@ From now on ospos can be deployed using Docker on Linux, Mac or Windows. This se Cloud install ------------- -A quick option would be to install directly to [Digitalocean](https://m.do.co/c/ac38c262507b) using their preconfigured LAMP stack. -Create a DO account first, add a droplet with preconfigured LAMP and follow the instructions for Local Install below. You will be running a provisioned VPS within minutes. - - -Cloud install using Docker --------------------------- -This installation is NOT Recommended anymore and will soon be replaced by a one click DO installation procedure. -Existing setups will keep working until the 21th of May but will need to be migrated in time in order to ensure user's safety. - - -If you want to run a quick demo of ospos or run it permanently in the cloud, then we -suggest using Docker cloud together with the DigitalOcean hosting platform. This way all the -configuration is done automatically and the install will just work. - -If you choose *DigitalOcean* [through this link](https://m.do.co/c/ac38c262507b), you will get a *$10 credit* for a first -month of uptime on the platform. A full setup will only take about 2 minutes by following steps below. - -1. Create a [Digitalocean account](https://m.do.co/c/ac38c262507b) -2. Create a [docker cloud account](https://cloud.docker.com) -3. Login to docker cloud -4. Associate your docker cloud account with your previously created digital ocean account under settings -5. Create a new node on DigitalOcean through the `Infrastructure > Nodes` tab. Fill in a name (ospos) and choose a region near to you. We recommend to choose a node with minimum 1G RAM for the whole stack -6. Click [![Deploy to Docker Cloud](https://files.cloud.docker.com/images/deploy-to-dockercloud.svg)](https://cloud.docker.com/stack/deploy/?repo=https://github.com/opensourcepos/opensourcepos) -7. Othewise create a new stack under `Applications > Stacks` and paste the [contents of docker-cloud.yml](https://github.com/opensourcepos/opensourcepos/blob/master/docker-cloud.yml) from the source repository in the text field and hit `Create and deploy` -8. Find your website url under `Infrastructure > Nodes > > Endpoints > web` -9. Login with default username/password admin/pointofsale -10. DNS name for this server can be easily configured in the DigitalOcean control panel - -More info [on maintaining a docker](https://github.com/opensourcepos/opensourcepos/wiki/Docker-cloud-maintenance) install can be found on the wiki +If you choose *DigitalOcean* [through this link](https://m.do.co/c/ac38c262507b), you will get a *$10 credit* for a first month. [Check the wiki](https://github.com/opensourcepos/opensourcepos/wiki/DOCS-USERS-Getting-Started-installations#cloud-deploy-installation) for further instructions on how to install the necessary components. From 500f14d0026aec28475548d79ef67c6f233aab92 Mon Sep 17 00:00:00 2001 From: WShells Date: Sun, 24 Jun 2018 04:18:18 +0300 Subject: [PATCH 127/568] Update INSTALL.md Resetting Demo... From 72245c8631f10ff4ed6dcce51a5a6bbd2943bfa8 Mon Sep 17 00:00:00 2001 From: Steve Ireland Date: Thu, 28 Jun 2018 20:40:41 -0400 Subject: [PATCH 128/568] Fix issue with item kits not being listed. --- application/controllers/Item_kits.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/controllers/Item_kits.php b/application/controllers/Item_kits.php index bf7e8ecd7..c7621e537 100644 --- a/application/controllers/Item_kits.php +++ b/application/controllers/Item_kits.php @@ -14,10 +14,10 @@ class Item_kits extends Secure_Controller */ private function _add_totals_to_item_kit($item_kit) { - $kit_item_info = $this->Item->get_info($item_kit->item_id); + $kit_item_info = $this->Item->get_info(isset($item_kit->kit_item_id) ? $item_kit->kit_item_id : $item_kit->item_id); $item_kit->total_cost_price = 0; - $item_kit->total_unit_price = $kit_item_info->unit_price; + $item_kit->total_unit_price = (float)$kit_item_info->unit_price; foreach($this->Item_kit_items->get_info($item_kit->item_kit_id) as $item_kit_item) { From bc0077012d457921abecafc987d7d69bcd26ae2c Mon Sep 17 00:00:00 2001 From: jekkos Date: Thu, 14 Jun 2018 00:43:17 +0200 Subject: [PATCH 129/568] Use backend for amount validation (#2020, #2018) --- application/controllers/Expenses.php | 6 +++++ application/controllers/Giftcards.php | 2 +- application/language/en-US/expenses_lang.php | 1 + application/views/configs/locale_config.php | 1 - application/views/expenses/form.php | 24 ++++++++++++++++++-- application/views/giftcards/form.php | 3 +-- application/views/partial/header_js.php | 15 ++++-------- 7 files changed, 36 insertions(+), 16 deletions(-) diff --git a/application/controllers/Expenses.php b/application/controllers/Expenses.php index 9f852dae5..e4c9639ca 100644 --- a/application/controllers/Expenses.php +++ b/application/controllers/Expenses.php @@ -159,6 +159,12 @@ class Expenses extends Secure_Controller } } + public function ajax_check_amount() + { + $parsed_value = parse_decimals(array_pop($this->input->post())); + echo json_encode(array('success' => $parsed_value !== FALSE, 'amount' => to_currency_no_money($parsed_value))); + } + public function delete() { $expenses_to_delete = $this->input->post('ids'); diff --git a/application/controllers/Giftcards.php b/application/controllers/Giftcards.php index 4b37366dd..a988361b8 100644 --- a/application/controllers/Giftcards.php +++ b/application/controllers/Giftcards.php @@ -131,7 +131,7 @@ class Giftcards extends Secure_Controller public function ajax_check_number_giftcard() { $parsed_value = parse_decimals($this->input->post('giftcard_amount')); - echo json_encode(array('success' => $parsed_value !== FALSE, 'giftcard_amount' => $parsed_value)); + echo json_encode(array('success' => $parsed_value !== FALSE, 'giftcard_amount' => to_currency_no_money($parsed_value))); } public function delete() diff --git a/application/language/en-US/expenses_lang.php b/application/language/en-US/expenses_lang.php index d00e6b208..2496630d2 100644 --- a/application/language/en-US/expenses_lang.php +++ b/application/language/en-US/expenses_lang.php @@ -2,6 +2,7 @@ $lang["expenses_add_item"] = "Add Expense"; $lang["expenses_amount"] = "Amount"; +$lang["expenses_tax_amount"] = "Amount"; $lang["expenses_amount_number"] = "Amount must be a number"; $lang["expenses_amount_required"] = "Expense Amount required"; $lang["expenses_by_category"] = "Category"; diff --git a/application/views/configs/locale_config.php b/application/views/configs/locale_config.php index 5ac983086..1e98d6829 100644 --- a/application/views/configs/locale_config.php +++ b/application/views/configs/locale_config.php @@ -258,7 +258,6 @@ $(document).ready(function() 'thousands_separator': $('#thousands_separator').is(':checked') }, dataFilter: function(data) { - setup_csrf_token(); var response = JSON.parse(data); $('#number_locale_example').text(response.number_locale_example); $('#currency_symbol').val(response.currency_symbol); diff --git a/application/views/expenses/form.php b/application/views/expenses/form.php index fdede11a7..248f9e871 100644 --- a/application/views/expenses/form.php +++ b/application/views/expenses/form.php @@ -188,6 +188,18 @@ $(document).ready(function() }); }; + var amount_validator = function(field) { + return { + url: "", + type: 'POST', + dataFilter: function(data) { + var response = JSON.parse(data); + $(field).val(response.amount); + return response.success; + } + } + } + $('#expenses_edit_form').validate($.extend( { submitHandler: function(form) @@ -204,7 +216,11 @@ $(document).ready(function() amount: { required: true, - number: true + remote: amount_validator("#amount") + }, + tax_amount: + { + remote: amount_validator("#tax_amount") } }, messages: @@ -218,7 +234,11 @@ $(document).ready(function() amount: { required: 'lang->line('expenses_amount_required'); ?>', - number: 'lang->line('expenses_amount_number'); ?>' + remote: 'lang->line('expenses_amount_number'); ?>' + }, + tax_amount: + { + remote: 'lang->line('expenses_tax_amount_number'); ?>' } } }, form_support.error)); diff --git a/application/views/giftcards/form.php b/application/views/giftcards/form.php index 6004b96e1..dc9091918 100644 --- a/application/views/giftcards/form.php +++ b/application/views/giftcards/form.php @@ -129,9 +129,8 @@ $(document).ready(function() 'amount': $('#giftcard_amount').val() }, dataFilter: function(data) { - setup_csrf_token(); var response = JSON.parse(data); - $('#giftcard_amount').text(response.value); + $('#giftcard_amount').val(response.giftcard_amount); return response.success; } } diff --git a/application/views/partial/header_js.php b/application/views/partial/header_js.php index c61e507ac..b075c2fa5 100644 --- a/application/views/partial/header_js.php +++ b/application/views/partial/header_js.php @@ -40,22 +40,17 @@ } } - return ajax.apply(this, arguments); + var result = ajax.apply(this, arguments); + + setup_csrf_token(); + + return result; }; var setup_csrf_token = function() { $('input[name="security->get_csrf_token_name(); ?>"]').val(csrf_token()); }; - setup_csrf_token(); - - $.ajaxSetup({ - dataFilter: function(data) { - setup_csrf_token(); - return data; - } - }); - var submit = $.fn.submit; $.fn.submit = function() { From e6e7fb2e2ac35aaf0c96da4ff8d51927655de377 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sat, 16 Jun 2018 11:29:48 +0100 Subject: [PATCH 130/568] Remove translation duplication --- application/language/en-US/expenses_lang.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/application/language/en-US/expenses_lang.php b/application/language/en-US/expenses_lang.php index 2496630d2..939a76705 100644 --- a/application/language/en-US/expenses_lang.php +++ b/application/language/en-US/expenses_lang.php @@ -2,7 +2,6 @@ $lang["expenses_add_item"] = "Add Expense"; $lang["expenses_amount"] = "Amount"; -$lang["expenses_tax_amount"] = "Amount"; $lang["expenses_amount_number"] = "Amount must be a number"; $lang["expenses_amount_required"] = "Expense Amount required"; $lang["expenses_by_category"] = "Category"; @@ -14,7 +13,7 @@ $lang["expenses_category_required"] = "category is a required field"; $lang["expenses_check"] = "Check"; $lang["expenses_check_filter"] = "Check"; $lang["expenses_confirm_delete"] = "Are you sure you want to delete the selected Expense?"; -$lang["expenses_confirm_restore"] = "Are you sure you want to restore selected Expenses(s)?"; +$lang["expenses_confirm_restore"] = "Are you sure you want to restore the selected Expenses(s)?"; $lang["expenses_credit"] = "Credit Card"; $lang["expenses_credit_filter"] = "Credit Card"; $lang["expenses_date"] = "Date"; From 086c2de4416362464b62e824ba96688a63e5a4df Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sat, 16 Jun 2018 14:22:32 +0100 Subject: [PATCH 131/568] Remove csrf_form_base() from register --- application/views/sales/register.php | 63 +++++++++++++--------------- 1 file changed, 30 insertions(+), 33 deletions(-) diff --git a/application/views/sales/register.php b/application/views/sales/register.php index 3762dd06e..da73240c8 100644 --- a/application/views/sales/register.php +++ b/application/views/sales/register.php @@ -644,13 +644,12 @@ $(document).ready(function() var item_id = $(this).parents("tr").find("input[name='item_id']").val(); var item_number = $(this).val(); $.ajax({ - url: "", + url: '', method: 'post', - data: $.extend(csrf_form_base(), - { - "item_id" : item_id, - "item_number" : item_number, - }), + data: { + "item_id" : item_id, + "item_number" : item_number, + }, dataType: 'json' }); }); @@ -659,13 +658,12 @@ $(document).ready(function() var item_id = $(this).parents("tr").find("input[name='item_id']").val(); var item_name = $(this).val(); $.ajax({ - url: "", + url: '', method: 'post', - data: $.extend(csrf_form_base(), - { - "item_id" : item_id, - "item_name" : item_name, - }), + data: { + "item_id" : item_id, + "item_name" : item_name, + }, dataType: 'json' }); }); @@ -674,13 +672,12 @@ $(document).ready(function() var item_id = $(this).parents("tr").find("input[name='item_id']").val(); var item_description = $(this).val(); $.ajax({ - url: "", + url: '', method: 'post', - data: $.extend(csrf_form_base(), - { - "item_id" : item_id, - "item_description" : item_description, - }), + data: { + "item_id" : item_id, + "item_description" : item_description, + }, dataType: 'json' }); }); @@ -689,10 +686,10 @@ $(document).ready(function() $('#item').blur(function() { - $(this).val("lang->line('sales_start_typing_item_name'); ?>"); + $(this).val('lang->line('sales_start_typing_item_name'); ?>'); }); - $("#item").autocomplete( + $('#item').autocomplete( { source: '', minChars: 0, @@ -714,7 +711,7 @@ $(document).ready(function() var clear_fields = function() { - if($(this).val().match("lang->line('sales_start_typing_item_name') . '|' . $this->lang->line('sales_start_typing_customer_name'); ?>")) + if($(this).val().match('lang->line('sales_start_typing_item_name') . '|' . $this->lang->line('sales_start_typing_customer_name'); ?>')) { $(this).val(''); } @@ -727,7 +724,7 @@ $(document).ready(function() $('#customer').blur(function() { - $(this).val("lang->line('sales_start_typing_customer_name'); ?>"); + $(this).val('lang->line('sales_start_typing_customer_name'); ?>'); }); $("#customer").autocomplete( @@ -903,30 +900,30 @@ function check_payment_type() { var cash_rounding = ; - if($("#payment_types").val() == "lang->line('sales_giftcard'); ?>") + if($("#payment_types").val() == 'lang->line('sales_giftcard'); ?>') { - $("#sale_total").html(""); - $("#sale_amount_due").html(""); - $("#amount_tendered_label").html("lang->line('sales_giftcard_number'); ?>"); + $("#sale_total").html(''); + $("#sale_amount_due").html(''); + $("#amount_tendered_label").html('lang->line('sales_giftcard_number'); ?>'); $("#amount_tendered:enabled").val('').focus(); $(".giftcard-input").attr('disabled', false); $(".non-giftcard-input").attr('disabled', true); $(".giftcard-input:enabled").val('').focus(); } - else if($("#payment_types").val() == "lang->line('sales_cash'); ?>" && cash_rounding) + else if($("#payment_types").val() == 'lang->line('sales_cash'); ?>' && cash_rounding) { - $("#sale_total").html(""); - $("#sale_amount_due").html(""); - $("#amount_tendered_label").html("lang->line('sales_amount_tendered'); ?>"); + $("#sale_total").html(''); + $("#sale_amount_due").html(''); + $("#amount_tendered_label").html('lang->line('sales_amount_tendered'); ?>'); $("#amount_tendered:enabled").val(''); $(".giftcard-input").attr('disabled', true); $(".non-giftcard-input").attr('disabled', false); } else { - $("#sale_total").html(""); - $("#sale_amount_due").html(""); - $("#amount_tendered_label").html("lang->line('sales_amount_tendered'); ?>"); + $("#sale_total").html(''); + $("#sale_amount_due").html(''); + $("#amount_tendered_label").html('lang->line('sales_amount_tendered'); ?>'); $("#amount_tendered:enabled").val(''); $(".giftcard-input").attr('disabled', true); $(".non-giftcard-input").attr('disabled', false); From 957dc5de167d057a5021a68c2f6dd3fabaaae38c Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sat, 16 Jun 2018 20:21:19 +0100 Subject: [PATCH 132/568] Fix exception with PHP 7 --- application/controllers/Expenses.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/controllers/Expenses.php b/application/controllers/Expenses.php index e4c9639ca..f900649ac 100644 --- a/application/controllers/Expenses.php +++ b/application/controllers/Expenses.php @@ -161,7 +161,8 @@ class Expenses extends Secure_Controller public function ajax_check_amount() { - $parsed_value = parse_decimals(array_pop($this->input->post())); + $value = $this->input->post(); + $parsed_value = parse_decimals(array_pop($value)); echo json_encode(array('success' => $parsed_value !== FALSE, 'amount' => to_currency_no_money($parsed_value))); } From 683ef75162624e7e65e72827ed149343ac5cc4e1 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sat, 16 Jun 2018 21:05:15 +0100 Subject: [PATCH 133/568] Code refactoring --- application/views/configs/email_config.php | 22 +- application/views/configs/info_config.php | 6 +- application/views/configs/invoice_config.php | 2 +- application/views/configs/locale_config.php | 7 +- .../views/configs/mailchimp_config.php | 3 +- application/views/configs/tax_config.php | 308 ++++++++-------- application/views/customers/form.php | 21 +- .../views/customers/form_excel_import.php | 12 +- application/views/employees/form.php | 57 +-- application/views/expenses/form.php | 48 ++- .../views/expenses_categories/form.php | 34 +- application/views/giftcards/form.php | 57 ++- .../views/home/form_change_password.php | 11 +- application/views/item_kits/form.php | 331 +++++++++--------- application/views/items/form.php | 30 +- application/views/items/form_bulk.php | 37 +- application/views/items/form_excel_import.php | 10 +- application/views/items/form_inventory.php | 36 +- application/views/messages/form_sms.php | 30 +- application/views/partial/header_js.php | 8 +- application/views/receivings/form.php | 42 +-- application/views/sales/form.php | 43 ++- application/views/sales/register.php | 84 ++--- application/views/suppliers/form.php | 33 +- application/views/taxes/form.php | 217 ++++++------ 25 files changed, 745 insertions(+), 744 deletions(-) diff --git a/application/views/configs/email_config.php b/application/views/configs/email_config.php index a1519f4f8..a066e2466 100644 --- a/application/views/configs/email_config.php +++ b/application/views/configs/email_config.php @@ -116,29 +116,29 @@ $(document).ready(function() { var check_protocol = function() { - if($("#protocol").val() == 'sendmail') + if($('#protocol').val() == 'sendmail') { - $("#mailpath").prop('disabled', false); - $("#smtp_host, #smtp_user, #smtp_pass, #smtp_port, #smtp_timeout, #smtp_crypto").prop('disabled', true); + $('#mailpath').prop('disabled', false); + $('#smtp_host, #smtp_user, #smtp_pass, #smtp_port, #smtp_timeout, #smtp_crypto').prop('disabled', true); } - else if($("#protocol").val() == 'smtp') + else if($('#protocol').val() == 'smtp') { - $("#smtp_host, #smtp_user, #smtp_pass, #smtp_port, #smtp_timeout, #smtp_crypto").prop('disabled', false); - $("#mailpath").prop('disabled', true); + $('#smtp_host, #smtp_user, #smtp_pass, #smtp_port, #smtp_timeout, #smtp_crypto').prop('disabled', false); + $('#mailpath').prop('disabled', true); } else { - $("#mailpath, #smtp_host, #smtp_user, #smtp_pass, #smtp_port, #smtp_timeout, #smtp_crypto").prop('disabled', true); + $('#mailpath, #smtp_host, #smtp_user, #smtp_pass, #smtp_port, #smtp_timeout, #smtp_crypto').prop('disabled', true); } }; - $("#protocol").change(check_protocol).ready(check_protocol); + $('#protocol').change(check_protocol).ready(check_protocol); $('#email_config_form').validate($.extend(form_support.handler, { submitHandler: function(form) { $(form).ajaxSubmit({ beforeSerialize: function(arr, $form, options) { - $("#mailpath, #smtp_host, #smtp_user, #smtp_pass, #smtp_port, #smtp_timeout, #smtp_crypto").prop("disabled", false); + $('#mailpath, #smtp_host, #smtp_user, #smtp_pass, #smtp_port, #smtp_timeout, #smtp_crypto').prop('disabled', false); return true; }, success: function(response) { @@ -146,11 +146,11 @@ $(document).ready(function() // set back disabled state check_protocol(); }, - dataType:'json' + dataType: 'json' }); }, - errorLabelContainer: "#email_error_message_box" + errorLabelContainer: '#email_error_message_box' })); }); diff --git a/application/views/configs/info_config.php b/application/views/configs/info_config.php index 6b42fc667..016f14872 100644 --- a/application/views/configs/info_config.php +++ b/application/views/configs/info_config.php @@ -134,9 +134,9 @@ $(document).ready(function() { $("a.fileinput-exists").click(function() { $.ajax({ - type: "GET", - url: "", - dataType: "json" + type: 'GET', + url: '', + dataType: 'json' }) }); diff --git a/application/views/configs/invoice_config.php b/application/views/configs/invoice_config.php index 04ea971b6..3d719e217 100644 --- a/application/views/configs/invoice_config.php +++ b/application/views/configs/invoice_config.php @@ -207,7 +207,7 @@ $(document).ready(function() enable_disable_invoice_enable(); enable_disable_work_order_enable(); }, - dataType:'json' + dataType: 'json' }); } })); diff --git a/application/views/configs/locale_config.php b/application/views/configs/locale_config.php index 1e98d6829..a01bf07eb 100644 --- a/application/views/configs/locale_config.php +++ b/application/views/configs/locale_config.php @@ -243,7 +243,6 @@ $(document).ready(function() }); $('#locale_config_form').validate($.extend(form_support.handler, { - rules: { number_locale: @@ -271,12 +270,12 @@ $(document).ready(function() messages: { number_locale: { - required: 'lang->line('config_number_locale_required') ?>', - number_locale: 'lang->line('config_number_locale_invalid') ?>' + required: "lang->line('config_number_locale_required') ?>", + number_locale: "lang->line('config_number_locale_invalid') ?>" } }, - errorLabelContainer: "#locale_error_message_box" + errorLabelContainer: '#locale_error_message_box' })); }); diff --git a/application/views/configs/mailchimp_config.php b/application/views/configs/mailchimp_config.php index 6be5ebd6d..e7e1fdf08 100644 --- a/application/views/configs/mailchimp_config.php +++ b/application/views/configs/mailchimp_config.php @@ -60,7 +60,8 @@ $(document).ready(function() $('#mailchimp_list_id').append(new Option(text, val)); }); $('#mailchimp_list_id').prop('selectedIndex', 0); - }, 'json' + }, + 'json' ); }); diff --git a/application/views/configs/tax_config.php b/application/views/configs/tax_config.php index 86250aad1..39f87bf64 100644 --- a/application/views/configs/tax_config.php +++ b/application/views/configs/tax_config.php @@ -1,113 +1,113 @@ 'tax_config_form', 'class' => 'form-horizontal')); ?> -
-
-
lang->line('common_fields_required_message'); ?>
-
    +
    +
    +
    lang->line('common_fields_required_message'); ?>
    +
      -
      +
      lang->line('config_tax_included'), 'tax_included', array('class' => 'control-label col-xs-2')); ?> -
      +
      'tax_included', 'id' => 'tax_included', 'value' => 'tax_included', 'checked'=>$this->config->item('tax_included'))); ?> -
      -
      +
      +
      -
      +
      lang->line('config_default_tax_rate_1'), 'default_tax_1_rate', array('class' => 'control-label col-xs-2')); ?> -
      +
      'default_tax_1_name', 'id' => 'default_tax_1_name', 'class' => 'form-control input-sm', 'value'=>$this->config->item('default_tax_1_name')!==FALSE ? $this->config->item('default_tax_1_name') : $this->lang->line('items_sales_tax_1'))); ?> -
      -
      +
      +
      'default_tax_1_rate', 'id' => 'default_tax_1_rate', 'class' => 'form-control input-sm', 'value'=> to_tax_decimals($this->config->item('default_tax_1_rate')))); ?> - % -
      -
      + % +
      +
      -
      +
      lang->line('config_default_tax_rate_2'), 'default_tax_2_rate', array('class' => 'control-label col-xs-2')); ?> -
      +
      'default_tax_2_name', 'id' => 'default_tax_2_name', 'class' => 'form-control input-sm', 'value'=>$this->config->item('default_tax_2_name')!==FALSE ? $this->config->item('default_tax_2_name') : $this->lang->line('items_sales_tax_2'))); ?> -
      -
      +
      +
      'default_tax_2_rate', 'id' => 'default_tax_2_rate', 'class' => 'form-control input-sm', 'value'=> to_tax_decimals($this->config->item('default_tax_2_rate')))); ?> - % -
      -
      + % +
      +
      -
      +
      lang->line('config_customer_sales_tax_support'), 'customer_sales_tax_support', array('class' => 'control-label col-xs-2')); ?> -
      +
      'customer_sales_tax_support', 'id' => 'customer_sales_tax_support', 'value' => 'customer_sales_tax_support', 'checked'=>$this->config->item('customer_sales_tax_support'))); ?> -
      -
      +
      +
      -
      +
      lang->line('config_default_origin_tax_code'), 'default_origin_tax_code', array('class' => 'control-label col-xs-2')); ?> -
      +
      config->item('default_origin_tax_code'), array('class' => 'form-control input-sm')); ?> -
      -
      +
      +
      -
      +
      load->view('partial/tax_categories', array('tax_categories' => $tax_categories)); ?>
      - - 'submit_tax', - 'id' => 'submit_tax', - 'value' => $this->lang->line('common_submit'), - 'class' => 'btn btn-primary btn-sm pull-right')); ?> -
      -
      + + 'submit_tax', + 'id' => 'submit_tax', + 'value' => $this->lang->line('common_submit'), + 'class' => 'btn btn-primary btn-sm pull-right')); ?> +
      +
      diff --git a/application/views/customers/form.php b/application/views/customers/form.php index 43c3a1e3b..13600af9c 100644 --- a/application/views/customers/form.php +++ b/application/views/customers/form.php @@ -416,7 +416,7 @@ $(document).ready(function() { $("input[name='sales_tax_code_name']").change(function() { if( ! $("input[name='sales_tax_code_name']").val() ) { - $("input[name='sales_tax_code']").val(''); + $("input[name='sales_tax_code']").val(''); } }); @@ -426,8 +426,8 @@ $(document).ready(function() $("input[name='sales_tax_code_name']").val(ui.item.label); }; - $("#sales_tax_code_name").autocomplete({ - source: '', + $('#sales_tax_code_name').autocomplete({ + source: "", minChars: 0, delay: 15, cacheLength: 1, @@ -437,18 +437,19 @@ $(document).ready(function() }); $('#customer_form').validate($.extend({ - submitHandler: function(form) - { + submitHandler: function(form) { $(form).ajaxSubmit({ success: function(response) { dialog_support.hide(); - table_support.handle_submit('', response); + table_support.handle_submit("", response); }, dataType: 'json' }); }, + errorLabelContainer: '#error_message_box', + rules: { first_name: 'required', @@ -458,10 +459,10 @@ $(document).ready(function() { remote: { - url: "", + url: "", type: 'POST', data: { - 'person_id': 'person_id; ?>' + 'person_id': "person_id; ?>" // email is posted by default } } @@ -470,10 +471,10 @@ $(document).ready(function() { remote: { - url: "", + url: "", type: 'POST', data: { - 'person_id': 'person_id; ?>' + 'person_id': "person_id; ?>" // account_number is posted by default } } diff --git a/application/views/customers/form_excel_import.php b/application/views/customers/form_excel_import.php index 5cdad9b6a..7de76791b 100644 --- a/application/views/customers/form_excel_import.php +++ b/application/views/customers/form_excel_import.php @@ -25,9 +25,9 @@ $(document).ready(function() { $('#excel_form').validate($.extend({ - submitHandler:function(form) { + submitHandler: function(form) { $(form).ajaxSubmit({ - success:function(response) + success: function(response) { dialog_support.hide(); $.notify(response.message, { type: response.success ? 'success' : 'danger'} ); @@ -35,12 +35,14 @@ $(document).ready(function() dataType: 'json' }); }, - errorLabelContainer: "#error_message_box", - wrapper: "li", + + errorLabelContainer: '#error_message_box', + rules: { - file_path: "required" + file_path: 'required' }, + messages: { file_path: "lang->line('common_import_full_path'); ?>" diff --git a/application/views/employees/form.php b/application/views/employees/form.php index d7872f747..9a00fc5cf 100644 --- a/application/views/employees/form.php +++ b/application/views/employees/form.php @@ -157,67 +157,68 @@ $(document).ready(function() { $.validator.setDefaults({ ignore: [] }); - $.validator.addMethod("module", function (value, element) { - var result = $("#permission_list input").is(":checked"); - $(".module").each(function(index, element) + $.validator.addMethod('module', function (value, element) { + var result = $('#permission_list input').is(':checked'); + $('.module').each(function(index, element) { var parent = $(element).parent(); - var checked = $(element).is(":checked"); - if ($("ul", parent).length > 0 && result) + var checked = $(element).is(':checked'); + if($('ul', parent).length > 0 && result) { - result &= !checked || (checked && $("ul > li > input:checked", parent).length > 0); + result &= !checked || (checked && $('ul > li > input:checked', parent).length > 0); } }); return result; - }, 'lang->line('employees_subpermission_required'); ?>'); + }, "lang->line('employees_subpermission_required'); ?>"); - $("ul#permission_list > li > input.module").each(function() + $('ul#permission_list > li > input.module').each(function() { var $this = $(this); - $("ul > li > input,select", $this.parent()).each(function() + $('ul > li > input,select', $this.parent()).each(function() { var $that = $(this); var updateInputs = function (checked) { - $that.prop("disabled", !checked); - !checked && $that.prop("checked", false); + $that.prop('disabled', !checked); + !checked && $that.prop('checked', false); } $this.change(function() { - updateInputs($this.is(":checked")); + updateInputs($this.is(':checked')); }); - updateInputs($this.is(":checked")); + updateInputs($this.is(':checked')); }); }); $('#employee_form').validate($.extend({ - submitHandler:function(form) - { + submitHandler: function(form) { $(form).ajaxSubmit({ - success:function(response) + success: function(response) { dialog_support.hide(); - table_support.handle_submit('', response); + table_support.handle_submit("", response); }, - dataType:'json' + dataType: 'json' }); }, + + errorLabelContainer: '#error_message_box', + rules: { - first_name: "required", - last_name: "required", + first_name: 'required', + last_name: 'required', username: { - required:true, + required: true, minlength: 5 }, - password: { person_id == "") + if($person_info->person_id == '') { ?> - required:true, + required: true, @@ -225,10 +226,11 @@ $(document).ready(function() }, repeat_password: { - equalTo: "#password" + equalTo: '#password' }, - email: "email" + email: 'email' }, + messages: { first_name: "lang->line('common_first_name_required'); ?>", @@ -238,14 +240,13 @@ $(document).ready(function() required: "lang->line('employees_username_required'); ?>", minlength: "lang->line('employees_username_minlength'); ?>" }, - password: { person_id == "") { ?> - required:"lang->line('employees_password_required'); ?>", + required: "lang->line('employees_password_required'); ?>", diff --git a/application/views/expenses/form.php b/application/views/expenses/form.php index 248f9e871..0bf070e57 100644 --- a/application/views/expenses/form.php +++ b/application/views/expenses/form.php @@ -172,22 +172,9 @@ $(document).ready(function() todayBtn: true, todayHighlight: true, bootcssVer: 3, - language: '' + language: "" }); - var submit_form = function() - { - $(this).ajaxSubmit( - { - success: function(response) - { - dialog_support.hide(); - table_support.handle_submit('', response); - }, - dataType: 'json' - }); - }; - var amount_validator = function(field) { return { url: "", @@ -200,12 +187,20 @@ $(document).ready(function() } } - $('#expenses_edit_form').validate($.extend( - { - submitHandler: function(form) - { - submit_form.call(form); + $('#expenses_edit_form').validate($.extend({ + submitHandler: function(form) { + $(form).ajaxSubmit({ + success: function(response) + { + dialog_support.hide(); + table_support.handle_submit("", response); + }, + dataType: 'json' + }); }, + + errorLabelContainer: '#error_message_box', + rules: { category: 'required', @@ -216,29 +211,30 @@ $(document).ready(function() amount: { required: true, - remote: amount_validator("#amount") + remote: amount_validator('#amount') }, tax_amount: { - remote: amount_validator("#tax_amount") + remote: amount_validator('#tax_amount') } }, + messages: { - category: 'lang->line('expenses_category_required'); ?>', + category: "lang->line('expenses_category_required'); ?>", date: { - required: 'lang->line('expenses_date_required'); ?>' + required: "lang->line('expenses_date_required'); ?>" }, amount: { - required: 'lang->line('expenses_amount_required'); ?>', - remote: 'lang->line('expenses_amount_number'); ?>' + required: "lang->line('expenses_amount_required'); ?>", + remote: "lang->line('expenses_amount_number'); ?>" }, tax_amount: { - remote: 'lang->line('expenses_tax_amount_number'); ?>' + remote: "lang->line('expenses_tax_amount_number'); ?>" } } }, form_support.error)); diff --git a/application/views/expenses_categories/form.php b/application/views/expenses_categories/form.php index e9a777938..21997b94f 100644 --- a/application/views/expenses_categories/form.php +++ b/application/views/expenses_categories/form.php @@ -35,32 +35,28 @@ //validation and submit handling $(document).ready(function() { - var submit_form = function() - { - $(this).ajaxSubmit( - { - success: function(response) - { - dialog_support.hide(); - table_support.handle_submit('', response); - }, - dataType: 'json' - }); - }; - - $('#expense_category_edit_form').validate($.extend( - { - submitHandler: function(form) - { - submit_form.call(form); + $('#expense_category_edit_form').validate($.extend({ + submitHandler: function(form) { + $(form).ajaxSubmit({ + success: function(response) + { + dialog_support.hide(); + table_support.handle_submit("", response); + }, + dataType: 'json' + }); }, + + errorLabelContainer: '#error_message_box', + rules: { category_name: 'required' }, + messages: { - category_name: 'lang->line('category_name_required'); ?>' + category_name: "lang->line('category_name_required'); ?>" } }, form_support.error)); }); diff --git a/application/views/giftcards/form.php b/application/views/giftcards/form.php index dc9091918..22285ea3a 100644 --- a/application/views/giftcards/form.php +++ b/application/views/giftcards/form.php @@ -72,8 +72,8 @@ $(document).ready(function() $("input[name='person_name']").val(ui.item.label); }; - var autocompleter = $('#person_name').autocomplete({ - source: '', + $('#person_name').autocomplete({ + source: "", minChars: 0, delay: 15, cacheLength: 1, @@ -81,33 +81,29 @@ $(document).ready(function() select: fill_value, focus: fill_value }); - - // declare submitHandler as an object.. will be reused - var submit_form = function() { - $(this).ajaxSubmit({ - success: function(response) - { - dialog_support.hide(); - table_support.handle_submit('', response); - }, - error: function(jqXHR, textStatus, errorThrown) - { - table_support.handle_submit('', {message: errorThrown}); - }, - dataType: 'json' - }); - }; - $('#giftcard_form').validate($.extend(form_support.handler, - { - submitHandler:function(form) - { - submit_form.call(form) + $('#giftcard_form').validate($.extend({ + submitHandler: function(form) { + $(form).ajaxSubmit({ + success: function(response) + { + dialog_support.hide(); + table_support.handle_submit("", response); + }, + error: function(jqXHR, textStatus, errorThrown) + { + table_support.handle_submit("", {message: errorThrown}); + }, + dataType: 'json' + }); }, + + errorLabelContainer: '#error_message_box', + rules: { config->item('giftcard_number') == "series") + if($this->config->item('giftcard_number') == 'series') { ?> giftcard_number: @@ -136,17 +132,18 @@ $(document).ready(function() } } }, + messages: { config->item('giftcard_number') == "series") + if($this->config->item('giftcard_number') == 'series') { ?> - giftcard_number: - { - required: "lang->line('giftcards_number_required'); ?>", - number: "lang->line('giftcards_number'); ?>" - }, + giftcard_number: + { + required: "lang->line('giftcards_number_required'); ?>", + number: "lang->line('giftcards_number'); ?>" + }, diff --git a/application/views/home/form_change_password.php b/application/views/home/form_change_password.php index 44d51bc04..3602a1b74 100644 --- a/application/views/home/form_change_password.php +++ b/application/views/home/form_change_password.php @@ -81,17 +81,17 @@ $(document).ready(function() }, 'lang->line('employees_password_not_must_match'); ?>'); $('#employee_form').validate($.extend({ - submitHandler:function(form) - { + submitHandler: function(form) { $(form).ajaxSubmit({ - success:function(response) + success: function(response) { dialog_support.hide(); - $.notify(response.message, { type: response.success ? 'success' : 'danger'} ); + $.notify(response.message, {type: response.success ? 'success' : 'danger'}); }, - dataType:'json' + dataType: 'json' }); }, + rules: { current_password: @@ -110,6 +110,7 @@ $(document).ready(function() equalTo: "#password" } }, + messages: { password: diff --git a/application/views/item_kits/form.php b/application/views/item_kits/form.php index 9baebb5a4..a9289e2e9 100644 --- a/application/views/item_kits/form.php +++ b/application/views/item_kits/form.php @@ -16,107 +16,107 @@
      -
      - lang->line('item_kits_find_kit_item'), 'item_name', array('class'=>'control-label col-xs-3')); ?> -
      -
      - 'item_name', - 'id'=>'item_name', - 'class'=>'form-control input-sm', - 'size'=>'50', - 'value'=>$selected_kit_item) - ); ?> - +
      + lang->line('item_kits_find_kit_item'), 'item_name', array('class'=>'control-label col-xs-3')); ?> +
      +
      + 'item_name', + 'id'=>'item_name', + 'class'=>'form-control input-sm', + 'size'=>'50', + 'value'=>$selected_kit_item) + ); ?> + -
      -
      -
      +
      +
      +
      -
      - lang->line('item_kits_discount_percent'), 'kit_discount_percent', array('class' => 'control-label col-xs-3')); ?> -
      -
      - 'kit_discount_percent', - 'size'=>'5', - 'maxlength'=>'5', - 'id'=>'kit_discount_percent', - 'class'=>'form-control input-sm', - 'value'=>$item_kit_info->kit_discount_percent) - );?> - % -
      -
      -
      +
      + lang->line('item_kits_discount_percent'), 'kit_discount_percent', array('class' => 'control-label col-xs-3')); ?> +
      +
      + 'kit_discount_percent', + 'size'=>'5', + 'maxlength'=>'5', + 'id'=>'kit_discount_percent', + 'class'=>'form-control input-sm', + 'value'=>$item_kit_info->kit_discount_percent) + );?> + % +
      +
      +
      -
      - lang->line('item_kits_price_option'), 'price_option', !empty($basic_version) ? array('class'=>'required control-label col-xs-3') : array('class'=>'control-label col-xs-3')); ?> -
      - - - +
      + lang->line('item_kits_price_option'), 'price_option', !empty($basic_version) ? array('class'=>'required control-label col-xs-3') : array('class'=>'control-label col-xs-3')); ?> +
      + + + -
      -
      +
      +
      -
      - lang->line('item_kits_print_option'), 'print_option', !empty($basic_version) ? array('class'=>'required control-label col-xs-3') : array('class'=>'control-label col-xs-3')); ?> -
      - - - +
      + lang->line('item_kits_print_option'), 'print_option', !empty($basic_version) ? array('class'=>'required control-label col-xs-3') : array('class'=>'control-label col-xs-3')); ?> +
      + + + -
      -
      +
      +
      @@ -146,7 +146,7 @@ lang->line('common_delete'); ?> - lang->line('item_kits_sequence'); ?> + lang->line('item_kits_sequence'); ?> lang->line('item_kits_item'); ?> lang->line('item_kits_quantity'); ?> @@ -158,9 +158,9 @@ ?> - ' name=item_kit_seq[] value=''/> + " name=item_kit_seq[] value=""/> - ' name=item_kit_qty[] value=''/> + " name=item_kit_qty[] value=""/> ", + minChars:0, + autoFocus: false, + delay:10, + appendTo: ".modal-content", + select: function(e, ui) { + if ($("#item_kit_item_" + ui.item.value).length == 1) + { + $("#item_kit_item_" + ui.item.value).val(parseFloat( $("#item_kit_item_" + ui.item.value).val()) + 1); + } + else + { + $("#item_kit_items").append("" + + "" + + "" + + "" + ui.item.label + "" + + "" + + ""); + } + $("#item").val(""); + return false; + } + }); - $("#item").autocomplete({ - source: '', - minChars:0, - autoFocus: false, - delay:10, - appendTo: ".modal-content", - select: function(e, ui) { - if ($("#item_kit_item_" + ui.item.value).length == 1) - { - $("#item_kit_item_" + ui.item.value).val(parseFloat( $("#item_kit_item_" + ui.item.value).val()) + 1); - } - else - { - $("#item_kit_items").append("" + - "" + - "" + - "" + ui.item.label + "" + - "" + - ""); - } - $("#item").val(""); - return false; - } - }); + $("input[name='item_name']").change(function() { + if( ! $("input[name='item_name']").val() ) { + $("input[name='kit_item_id']").val(''); + } + }); - $("input[name='item_name']").change(function() { - if( ! $("input[name='item_name']").val() ) { - $("input[name='kit_item_id']").val(''); - } - }); - - var fill_value = function(event, ui) { - event.preventDefault(); - $("input[name='kit_item_id']").val(ui.item.value); - $("input[name='item_name']").val(ui.item.label); - }; + var fill_value = function(event, ui) { + event.preventDefault(); + $("input[name='kit_item_id']").val(ui.item.value); + $("input[name='item_name']").val(ui.item.label); + }; - $("#item_name").autocomplete({ - source: '', - minChars: 0, - delay: 15, - cacheLength: 1, - appendTo: '.modal-content', - select: fill_value, - focus: fill_value - }); + $('#item_name').autocomplete({ + source: "", + minChars: 0, + delay: 15, + cacheLength: 1, + appendTo: '.modal-content', + select: fill_value, + focus: fill_value + }); - $('#item_kit_form').validate($.extend({ - submitHandler:function(form) - { - $(form).ajaxSubmit({ - success:function(response) - { - dialog_support.hide(); - table_support.handle_submit('', response); - }, - dataType:'json' - }); - }, + $('#item_kit_form').validate($.extend({ + submitHandler: function(form) { + $(form).ajaxSubmit({ + success: function(response) + { + dialog_support.hide(); + table_support.handle_submit("", response); + }, + dataType: 'json' + }); + }, - rules: - { - name:"required", - category:"required" - }, + errorLabelContainer: '#error_message_box', - messages: - { - name:"lang->line('items_name_required'); ?>", - category:"lang->line('items_category_required'); ?>" - } - }, form_support.error)); + rules: + { + name: 'required', + category: 'required' + }, + + messages: + { + name: "lang->line('items_name_required'); ?>", + category: "lang->line('items_category_required'); ?>" + } + }, form_support.error)); }); function delete_item_kit_row(link) @@ -257,5 +257,4 @@ function delete_item_kit_row(link) $(link).parent().parent().remove(); return false; } - diff --git a/application/views/items/form.php b/application/views/items/form.php index 551b91ce9..a78aca067 100644 --- a/application/views/items/form.php +++ b/application/views/items/form.php @@ -372,26 +372,30 @@ //validation and submit handling $(document).ready(function() { - $("#new").click(function() { + $('#new').click(function() { stay_open = true; - $("#item_form").submit(); + $('#item_form').submit(); }); - $("#submit").click(function() { + $('#submit').click(function() { stay_open = false; }); var no_op = function(event, data, formatted){}; - $("#category").autocomplete({source: "", delay:10, appendTo: '.modal-content'}); + $('#category').autocomplete({ + source: "", + appendTo: '.modal-content', + delay: 10 + }); - $("#custom" + ).autocomplete({ + $('#custom' + ).autocomplete({ source:function (request, response) { $.ajax({ type: 'POST', - url: "", + url: "", dataType: 'json', data: $.extend(request, {field_no: }), success: function(data) { @@ -409,10 +413,10 @@ $(document).ready(function() } ?> - $("a.fileinput-exists").click(function() { + $('a.fileinput-exists').click(function() { $.ajax({ type: 'GET', - url: "item_id"); ?>", + url: "item_id); ?>", dataType: 'json' }) }); @@ -425,7 +429,7 @@ $(document).ready(function() if (stay_open) { // set action of item_form to url without item id, so a new one can be created - $("#item_form").attr("action", ""); + $('#item_form').attr('action', ""); // 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(''); @@ -436,16 +440,18 @@ $(document).ready(function() { dialog_support.hide(); } - table_support.handle_submit('', response, stay_open); + table_support.handle_submit("", response, stay_open); }, dataType: 'json' }); }, + errorLabelContainer: '#error_message_box', + rules: { - name: "required", - category: "required", + name: 'required', + category: 'required', item_number: { required: false, diff --git a/application/views/items/form_bulk.php b/application/views/items/form_bulk.php index 228eeeade..43bd99f10 100644 --- a/application/views/items/form_bulk.php +++ b/application/views/items/form_bulk.php @@ -162,53 +162,60 @@ //validation and submit handling $(document).ready(function() { - $("#category").autocomplete({source: "", appendTo:'.modal-content', delay:10}); + $('#category').autocomplete({ + source: "", + appendTo: '.modal-content', + delay: 10 + }); var confirm_message = false; - $("#tax_percent_name_2, #tax_name_2").prop('disabled', true), - $("#tax_percent_name_1, #tax_name_1").blur(function() { - var disabled = !($("#tax_percent_name_1").val() + $("#tax_name_1").val()); - $("#tax_percent_name_2, #tax_name_2").prop('disabled', disabled); - confirm_message = disabled ? "" : "lang->line('items_confirm_bulk_edit_wipe_taxes') ?>"; + $('#tax_percent_name_2, #tax_name_2').prop('disabled', true), + $('#tax_percent_name_1, #tax_name_1').blur(function() { + var disabled = !($('#tax_percent_name_1').val() + $('#tax_name_1').val()); + $('#tax_percent_name_2, #tax_name_2').prop('disabled', disabled); + confirm_message = disabled ? '' : "lang->line('items_confirm_bulk_edit_wipe_taxes') ?>"; }); $('#item_form').validate($.extend({ - submitHandler:function(form) - { + submitHandler: function(form) { if(!confirm_message || confirm(confirm_message)) { $(form).ajaxSubmit({ beforeSubmit: function(arr, $form, options) { arr.push({name: 'item_ids', value: table_support.selected_ids().join(": ")}); }, - success:function(response) + success: function(response) { dialog_support.hide(); - table_support.handle_submit('', response); + table_support.handle_submit("", response); }, - dataType:'json' + dataType: 'json' }); } }, + + errorLabelContainer: '#error_message_box', + rules: { unit_price: { - number:true + number: true }, tax_percent: { - number:true + number: true }, quantity: { - number:true + number: true }, reorder_level: { - number:true + number: true } }, + messages: { unit_price: diff --git a/application/views/items/form_excel_import.php b/application/views/items/form_excel_import.php index 32e03fa34..229b414b9 100644 --- a/application/views/items/form_excel_import.php +++ b/application/views/items/form_excel_import.php @@ -25,7 +25,7 @@ $(document).ready(function() { $('#excel_form').validate($.extend({ - submitHandler:function(form) { + submitHandler: function(form) { $(form).ajaxSubmit({ success:function(response) { @@ -35,12 +35,14 @@ $(document).ready(function() dataType: 'json' }); }, - errorLabelContainer: "#error_message_box", - wrapper: "li", + + errorLabelContainer: '#error_message_box', + rules: { - file_path: "required" + file_path: 'required' }, + messages: { file_path: "lang->line('common_import_full_path'); ?>" diff --git a/application/views/items/form_inventory.php b/application/views/items/form_inventory.php index 61172bc16..417ae19fa 100644 --- a/application/views/items/form_inventory.php +++ b/application/views/items/form_inventory.php @@ -97,29 +97,29 @@ //validation and submit handling $(document).ready(function() { - $('#item_form').validate({ - submitHandler:function(form) - { + $('#item_form').validate($.extend({ + submitHandler: function(form) { $(form).ajaxSubmit({ - success:function(response) - { - dialog_support.hide(); - table_support.handle_submit('', response); - }, - dataType: 'json' - }); - + success: function(response) + { + dialog_support.hide(); + table_support.handle_submit("", response); + }, + dataType: 'json' + }); }, - errorLabelContainer: "#error_message_box", - wrapper: "li", + + errorLabelContainer: '#error_message_box', + rules: { newquantity: { - required:true, - number:true + required: true, + number: true } }, + messages: { newquantity: @@ -128,12 +128,12 @@ $(document).ready(function() number: "lang->line('items_quantity_number'); ?>" } } - }); + }, form_support.error)); }); function fill_quantity(val) { - var item_quantities = ; - document.getElementById("quantity").value = parseFloat(item_quantities[val]).toFixed(); + var item_quantities = ; + document.getElementById('quantity').value = parseFloat(item_quantities[val]).toFixed(); } diff --git a/application/views/messages/form_sms.php b/application/views/messages/form_sms.php index 43615414d..653d0c400 100644 --- a/application/views/messages/form_sms.php +++ b/application/views/messages/form_sms.php @@ -35,45 +35,49 @@ \ No newline at end of file + diff --git a/application/views/partial/header_js.php b/application/views/partial/header_js.php index b075c2fa5..300c10b31 100644 --- a/application/views/partial/header_js.php +++ b/application/views/partial/header_js.php @@ -12,12 +12,12 @@ } $.notifyDefaults({ placement: { - align: 'config->item('notify_horizontal_position'); ?>', - from: 'config->item('notify_vertical_position'); ?>' + align: "config->item('notify_horizontal_position'); ?>", + from: "config->item('notify_vertical_position'); ?>" }}); var csrf_token = function() { - return Cookies.get('config->item('csrf_cookie_name'); ?>'); + return Cookies.get("config->item('csrf_cookie_name'); ?>"); }; var csrf_form_base = function() { @@ -27,7 +27,7 @@ var ajax = $.ajax; $.ajax = function() { - var args = arguments[0]; + var args = arguments[0]; if (args['type'] && args['type'].toLowerCase() == 'post' && csrf_token()) { if (typeof args['data'] === 'string') diff --git a/application/views/receivings/form.php b/application/views/receivings/form.php index 96bac4713..6c10ab591 100755 --- a/application/views/receivings/form.php +++ b/application/views/receivings/form.php @@ -80,51 +80,39 @@ $(document).ready(function() language: "" }); - var fill_value = function(event, ui) - { + var fill_value = function(event, ui) { event.preventDefault(); $("input[name='supplier_id']").val(ui.item.value); $("input[name='supplier_name']").val(ui.item.label); }; - var autocompleter = $("#supplier_name").autocomplete( - { - source: '', + $('#supplier_name').autocomplete({ + source: "", minChars: 0, delay: 15, cacheLength: 1, appendTo: '.modal-content', select: fill_value, focus: fill_value - }); + }); $('button#delete').click(function() { dialog_support.hide(); - table_support.do_delete('', ); + table_support.do_delete("", ); }); - // declare submitHandler as an object.. will be reused - var submit_form = function() - { - $(this).ajaxSubmit( - { - success:function(response) - { - dialog_support.hide(); - table_support.handle_submit('', response); - }, - dataType:'json' - }); - }; - - $('#receivings_edit_form').validate($.extend( - { - submitHandler : function(form) - { - submit_form.call(form); + $('#receivings_edit_form').validate($.extend({ + submitHandler: function(form) { + $(form).ajaxSubmit({ + success: function(response) + { + dialog_support.hide(); + table_support.handle_submit("", response); + }, + dataType: 'json' + }); } }, form_support.error)); - }); diff --git a/application/views/sales/form.php b/application/views/sales/form.php index 2c2048b60..b882a4e30 100755 --- a/application/views/sales/form.php +++ b/application/views/sales/form.php @@ -98,10 +98,10 @@ $(document).ready(function() $('#send_invoice').click(function(event) { if (confirm("lang->line('sales_invoice_confirm') . ' ' . $sale_info['email'] ?>")) { - $.get('', + $.get("", function(response) { dialog_support.hide(); - table_support.handle_submit('', response); + table_support.handle_submit("", response); }, 'json' ); } @@ -134,7 +134,7 @@ $(document).ready(function() todayBtn: true, todayHighlight: true, bootcssVer: 3, - language: '' + language: "" }); var fill_value = function(event, ui) { @@ -145,7 +145,7 @@ $(document).ready(function() $('#customer_name').autocomplete( { - source: '', + source: "", minChars: 0, delay: 15, cacheLength: 1, @@ -156,33 +156,29 @@ $(document).ready(function() $('button#delete').click(function() { dialog_support.hide(); - table_support.do_delete('', ); + table_support.do_delete("", ); }); $('button#restore').click(function() { dialog_support.hide(); - table_support.do_restore('', ); + table_support.do_restore("", ); }); - var submit_form = function() - { - $(this).ajaxSubmit( - { - success: function(response) - { - dialog_support.hide(); - table_support.handle_submit('', response); - }, - dataType: 'json' - }); - }; - $('#sales_edit_form').validate($.extend( { - submitHandler: function(form) - { - submit_form.call(form); + submitHandler: function(form) { + $(form).ajaxSubmit({ + success: function(response) + { + dialog_support.hide(); + table_support.handle_submit("", response); + }, + dataType: 'json' + }); }, + + errorLabelContainer: '#error_message_box', + rules: { invoice_number: @@ -200,9 +196,10 @@ $(document).ready(function() } } }, + messages: { - invoice_number: 'lang->line("sales_invoice_number_duplicate"); ?>' + invoice_number: "lang->line("sales_invoice_number_duplicate"); ?>" } }, form_support.error)); }); diff --git a/application/views/sales/register.php b/application/views/sales/register.php index da73240c8..7cde592a1 100644 --- a/application/views/sales/register.php +++ b/application/views/sales/register.php @@ -56,8 +56,8 @@ if(isset($success)) ?>
    • -
    • @@ -90,8 +90,8 @@ if(isset($success))
    • -
    • @@ -207,7 +207,7 @@ if(isset($success)) } ?> - lang->line('sales_update')?> > + ").submit();" title=lang->line('sales_update')?> > lang->line('sales_select_customer') . ' ' . $customer_required; ?> 'customer', 'id'=>'customer', 'class'=>'form-control input-sm', 'value'=>$this->lang->line('sales_start_typing_customer_name')));?> - @@ -468,7 +468,7 @@ if(isset($success)) if($pos_mode == '1') { ?> -
       lang->line('sales_complete_sale'); ?>
      +
       lang->line('sales_complete_sale'); ?>
      @@ -495,7 +495,7 @@ if(isset($success)) -
       lang->line('sales_add_payment'); ?>
      +
       lang->line('sales_add_payment'); ?>
      @@ -644,7 +644,7 @@ $(document).ready(function() var item_id = $(this).parents("tr").find("input[name='item_id']").val(); var item_number = $(this).val(); $.ajax({ - url: '', + url: "", method: 'post', data: { "item_id" : item_id, @@ -658,7 +658,7 @@ $(document).ready(function() var item_id = $(this).parents("tr").find("input[name='item_id']").val(); var item_name = $(this).val(); $.ajax({ - url: '', + url: "", method: 'post', data: { "item_id" : item_id, @@ -672,7 +672,7 @@ $(document).ready(function() var item_id = $(this).parents("tr").find("input[name='item_id']").val(); var item_description = $(this).val(); $.ajax({ - url: '', + url: "", method: 'post', data: { "item_id" : item_id, @@ -686,12 +686,12 @@ $(document).ready(function() $('#item').blur(function() { - $(this).val('lang->line('sales_start_typing_item_name'); ?>'); + $(this).val("lang->line('sales_start_typing_item_name'); ?>"); }); $('#item').autocomplete( { - source: '', + source: "", minChars: 0, autoFocus: false, delay: 500, @@ -711,7 +711,7 @@ $(document).ready(function() var clear_fields = function() { - if($(this).val().match('lang->line('sales_start_typing_item_name') . '|' . $this->lang->line('sales_start_typing_customer_name'); ?>')) + if($(this).val().match("lang->line('sales_start_typing_item_name') . '|' . $this->lang->line('sales_start_typing_customer_name'); ?>")) { $(this).val(''); } @@ -724,12 +724,12 @@ $(document).ready(function() $('#customer').blur(function() { - $(this).val('lang->line('sales_start_typing_customer_name'); ?>'); + $(this).val("lang->line('sales_start_typing_customer_name'); ?>"); }); $("#customer").autocomplete( { - source: '', + source: "", minChars: 0, delay: 10, select: function (a, ui) { @@ -747,7 +747,7 @@ $(document).ready(function() $(".giftcard-input").autocomplete( { - source: '', + source: "", minChars: 0, delay: 10, select: function (a, ui) { @@ -758,7 +758,7 @@ $(document).ready(function() $('#comment').keyup(function() { - $.post('', {comment: $('#comment').val()}); + $.post("", {comment: $('#comment').val()}); }); $('#sales_invoice_number').keyup(function() { - $.post('', {sales_invoice_number: $('#sales_invoice_number').val()}); + $.post("", {sales_invoice_number: $('#sales_invoice_number').val()}); }); var enable_invoice_number = function() @@ -782,7 +782,7 @@ $(document).ready(function() $("#sales_invoice_enable").change(function() { var enabled = enable_invoice_number(); - $.post('', {sales_invoice_number_enabled: enabled}); + $.post("", {sales_invoice_number_enabled: enabled}); }); ', {sales_print_after_sale: $(this).is(":checked")}); + $.post("", {sales_print_after_sale: $(this).is(":checked")}); }); $("#price_work_orders").change(function() { - $.post('', {price_work_orders: $(this).is(":checked")}); + $.post("", {price_work_orders: $(this).is(":checked")}); }); $('#email_receipt').change(function() { - $.post('', {email_receipt: $(this).is(":checked")}); + $.post("", {email_receipt: $(this).is(":checked")}); }); $("#finish_sale_button").click(function() { - $('#buttons_form').attr('action', ''); + $('#buttons_form').attr('action', ""); $('#buttons_form').submit(); }); $("#finish_invoice_quote_button").click(function() { - $('#buttons_form').attr('action', ''); + $('#buttons_form').attr('action', ""); $('#buttons_form').submit(); }); $("#suspend_sale_button").click(function() { - $('#buttons_form').attr('action', ''); + $('#buttons_form').attr('action', ""); $('#buttons_form').submit(); }); $("#cancel_sale_button").click(function() { - if(confirm('lang->line("sales_confirm_cancel_sale"); ?>')) + if(confirm("lang->line("sales_confirm_cancel_sale"); ?>")) { - $('#buttons_form').attr('action', ''); + $('#buttons_form').attr('action', ""); $('#buttons_form').submit(); } }); @@ -900,31 +900,31 @@ function check_payment_type() { var cash_rounding = ; - if($("#payment_types").val() == 'lang->line('sales_giftcard'); ?>') + if($("#payment_types").val() == "lang->line('sales_giftcard'); ?>") { - $("#sale_total").html(''); - $("#sale_amount_due").html(''); - $("#amount_tendered_label").html('lang->line('sales_giftcard_number'); ?>'); + $("#sale_total").html(""); + $("#sale_amount_due").html(""); + $("#amount_tendered_label").html("lang->line('sales_giftcard_number'); ?>"); $("#amount_tendered:enabled").val('').focus(); $(".giftcard-input").attr('disabled', false); $(".non-giftcard-input").attr('disabled', true); $(".giftcard-input:enabled").val('').focus(); } - else if($("#payment_types").val() == 'lang->line('sales_cash'); ?>' && cash_rounding) + else if($("#payment_types").val() == "lang->line('sales_cash'); ?>" && cash_rounding) { - $("#sale_total").html(''); - $("#sale_amount_due").html(''); - $("#amount_tendered_label").html('lang->line('sales_amount_tendered'); ?>'); - $("#amount_tendered:enabled").val(''); + $("#sale_total").html(""); + $("#sale_amount_due").html(""); + $("#amount_tendered_label").html("lang->line('sales_amount_tendered'); ?>"); + $("#amount_tendered:enabled").val(""); $(".giftcard-input").attr('disabled', true); $(".non-giftcard-input").attr('disabled', false); } else { - $("#sale_total").html(''); - $("#sale_amount_due").html(''); - $("#amount_tendered_label").html('lang->line('sales_amount_tendered'); ?>'); - $("#amount_tendered:enabled").val(''); + $("#sale_total").html(""); + $("#sale_amount_due").html(""); + $("#amount_tendered_label").html("lang->line('sales_amount_tendered'); ?>"); + $("#amount_tendered:enabled").val(""); $(".giftcard-input").attr('disabled', true); $(".non-giftcard-input").attr('disabled', false); } diff --git a/application/views/suppliers/form.php b/application/views/suppliers/form.php index 2c0206b06..ab610072d 100644 --- a/application/views/suppliers/form.php +++ b/application/views/suppliers/form.php @@ -49,25 +49,27 @@ $(document).ready(function() { $('#supplier_form').validate($.extend({ - submitHandler:function(form) - { + submitHandler: function(form) { $(form).ajaxSubmit({ - success:function(response) - { - dialog_support.hide(); - table_support.handle_submit('', response); - }, - dataType:'json' - }); - + success: function(response) + { + dialog_support.hide(); + table_support.handle_submit("", response); + }, + dataType: 'json' + }); }, + + errorLabelContainer: '#error_message_box', + rules: { - company_name: "required", - first_name: "required", - last_name: "required", - email: "email" + company_name: 'required', + first_name: 'required', + last_name: 'required', + email: 'email' }, + messages: { company_name: "lang->line('suppliers_company_name_required'); ?>", @@ -77,5 +79,4 @@ $(document).ready(function() } }, form_support.error)); }); - - \ No newline at end of file + diff --git a/application/views/taxes/form.php b/application/views/taxes/form.php index 894e5dd73..387157328 100644 --- a/application/views/taxes/form.php +++ b/application/views/taxes/form.php @@ -28,10 +28,10 @@
      -
      +
      lang->line('taxes_tax_code_type'), 'tax_code_type', !empty($basic_version) ? array('class'=>'required control-label col-xs-3') : array('class'=>'control-label col-xs-3')); ?> -
      -
      + +
      +
      -
      +
      lang->line('common_city'), 'city', array('class'=>'control-label col-xs-3')); ?> -
      +
      'city', 'id'=>'city', 'class'=>'form-control input-sm', 'value'=>$city) );?> -
      -
      +
      +
      -
      +
      lang->line('common_state'), 'name', array('class'=>'control-label col-xs-3')); ?> -
      +
      'state', 'id'=>'state', 'class'=>'form-control input-sm', 'value'=>$state) );?> -
      -
      +
      +
      -
      +
      lang->line('taxes_tax_rate'), 'tax_rate', array('class' => 'required control-label col-xs-3')); ?> -
      -
      +
      +
      'tax_rate', 'id'=>'tax_rate', 'class'=>'form-control input-sm', 'value'=>$tax_rate) );?> - % -
      -
      -
      + % +
      +
      +
      -
      +
      lang->line('taxes_rounding_code'), 'rounding_code', array('class' => 'control-label col-xs-3')); ?> -
      +
      'form-control input-sm')); ?> -
      -
      +
      +
      -
      +
      lang->line('taxes_add_exception'), 'add_tax_category', array('class'=>'control-label col-xs-3')); ?> -
      -
      - +
      +
      + 'add_tax_category', 'id'=>'add_tax_category', @@ -119,98 +119,103 @@ 'value'=>$add_tax_category) );?> -
      -
      -
      +
      +
      +
      - - - - - - - - - - +
      lang->line('common_delete'); ?>lang->line('taxes_tax_category'); ?>lang->line('taxes_tax_rate'); ?>lang->line('taxes_rounding_code'); ?>
      + + + + + + + + + - - - - - - + + + + + + - -
      lang->line('common_delete'); ?>lang->line('taxes_tax_category'); ?>lang->line('taxes_tax_rate'); ?>lang->line('taxes_rounding_code'); ?>
      ' name=exception_tax_rate[] value=''/> 'form-control input-sm'));?>
      ' name=exception_tax_rate[] value=""/> 'form-control input-sm'));?>
      + + - + From 8f172e172b125fac767f5a25b3da0b0709076e67 Mon Sep 17 00:00:00 2001 From: jekkos Date: Mon, 18 Jun 2018 19:06:55 +0200 Subject: [PATCH 134/568] Fix double submit issue --- application/views/partial/header_js.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/application/views/partial/header_js.php b/application/views/partial/header_js.php index 300c10b31..a8fc285f7 100644 --- a/application/views/partial/header_js.php +++ b/application/views/partial/header_js.php @@ -51,7 +51,9 @@ $('input[name="security->get_csrf_token_name(); ?>"]').val(csrf_token()); }; - var submit = $.fn.submit; + setup_csrf_token(); + + var submit = $.fn.submit; $.fn.submit = function() { setup_csrf_token(); From 732e1a028bf4f5ccfc9bdf26cbebe1bcbfc833fa Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Mon, 18 Jun 2018 21:33:44 +0100 Subject: [PATCH 135/568] Fix indentation issue --- application/views/partial/header_js.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/views/partial/header_js.php b/application/views/partial/header_js.php index a8fc285f7..5e3e0b2ee 100644 --- a/application/views/partial/header_js.php +++ b/application/views/partial/header_js.php @@ -51,9 +51,9 @@ $('input[name="security->get_csrf_token_name(); ?>"]').val(csrf_token()); }; - setup_csrf_token(); + setup_csrf_token(); - var submit = $.fn.submit; + var submit = $.fn.submit; $.fn.submit = function() { setup_csrf_token(); From d8f086a8403ce6a4f9b3a23aa53fc16e9b92f6a6 Mon Sep 17 00:00:00 2001 From: jekkos Date: Tue, 26 Jun 2018 20:46:52 +0200 Subject: [PATCH 136/568] Fix double submit issue (#2020) --- application/views/partial/header_js.php | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/application/views/partial/header_js.php b/application/views/partial/header_js.php index 5e3e0b2ee..bb9636bb8 100644 --- a/application/views/partial/header_js.php +++ b/application/views/partial/header_js.php @@ -24,6 +24,10 @@ return { security->get_csrf_token_name(); ?> : function () { return csrf_token(); } }; }; + var setup_csrf_token = function() { + $('input[name="security->get_csrf_token_name(); ?>"]').val(csrf_token()); + }; + var ajax = $.ajax; $.ajax = function() { @@ -40,18 +44,10 @@ } } - var result = ajax.apply(this, arguments); - - setup_csrf_token(); - - return result; + return ajax.apply(this, arguments); }; - var setup_csrf_token = function() { - $('input[name="security->get_csrf_token_name(); ?>"]').val(csrf_token()); - }; - - setup_csrf_token(); + $(document).ajaxComplete(setup_csrf_token); var submit = $.fn.submit; From 1026ebb0ebd632ef7a9c660f8c6f59fd448e8f73 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sun, 1 Jul 2018 10:46:40 +0100 Subject: [PATCH 137/568] Fix indentation issue --- application/views/partial/header_js.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/application/views/partial/header_js.php b/application/views/partial/header_js.php index bb9636bb8..e3c8d5c9b 100644 --- a/application/views/partial/header_js.php +++ b/application/views/partial/header_js.php @@ -24,9 +24,9 @@ return { security->get_csrf_token_name(); ?> : function () { return csrf_token(); } }; }; - var setup_csrf_token = function() { - $('input[name="security->get_csrf_token_name(); ?>"]').val(csrf_token()); - }; + var setup_csrf_token = function() { + $('input[name="security->get_csrf_token_name(); ?>"]').val(csrf_token()); + }; var ajax = $.ajax; @@ -55,5 +55,4 @@ setup_csrf_token(); submit.apply(this, arguments); }; - From a4e135eb92f6a23e65246879d285502fb48d89cb Mon Sep 17 00:00:00 2001 From: jekkos Date: Tue, 12 Jun 2018 14:06:39 +0200 Subject: [PATCH 138/568] Add support for multi-pack items. --- application/controllers/Config.php | 1 + application/controllers/Items.php | 34 ++- application/controllers/Receivings.php | 3 +- application/controllers/Reports.php | 1 + application/helpers/tabular_helper.php | 5 + application/language/en-GB/config_lang.php | 1 + application/language/en-GB/items_lang.php | 4 + .../language/en-GB/receivings_lang.php | 1 + application/language/en-GB/reports_lang.php | 2 + application/language/en-GB/sales_lang.php | 2 +- application/language/en-US/config_lang.php | 1 + application/language/en-US/items_lang.php | 4 + .../language/en-US/receivings_lang.php | 1 + application/language/en-US/reports_lang.php | 2 + application/language/en-US/sales_lang.php | 2 +- application/libraries/Receiving_lib.php | 36 ++- application/libraries/Sale_lib.php | 9 +- .../20180610100000_upgrade_to_3_3_0.php | 20 ++ .../migrations/sqlscripts/3.2.1_to_3.3.0.sql | 15 ++ application/models/Item.php | 216 +++++++++++++----- application/models/Sale.php | 16 +- application/models/reports/Inventory_low.php | 23 +- .../models/reports/Inventory_summary.php | 7 +- application/views/configs/general_config.php | 13 +- application/views/items/form.php | 64 +++++- application/views/receivings/receipt.php | 2 +- application/views/receivings/receiving.php | 88 +++---- application/views/sales/register.php | 1 + database/tables.sql | 6 +- 29 files changed, 431 insertions(+), 149 deletions(-) create mode 100644 application/migrations/20180610100000_upgrade_to_3_3_0.php create mode 100644 application/migrations/sqlscripts/3.2.1_to_3.3.0.sql diff --git a/application/controllers/Config.php b/application/controllers/Config.php index a16458559..9c08478be 100644 --- a/application/controllers/Config.php +++ b/application/controllers/Config.php @@ -299,6 +299,7 @@ class Config extends Secure_Controller '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, + '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'), diff --git a/application/controllers/Items.php b/application/controllers/Items.php index 2e6d2a3a8..6a5395fb8 100644 --- a/application/controllers/Items.php +++ b/application/controllers/Items.php @@ -128,6 +128,15 @@ class Items extends Secure_Controller echo json_encode($suggestions); } + + public function suggest_low_sell() + { + $suggestions = $this->xss_clean($this->Item->get_low_sell_suggestions($this->input->post_get('name'))); + + echo json_encode($suggestions); + } + + public function suggest_kits() { $suggestions = $this->xss_clean($this->Item->get_kit_search_suggestions($this->input->post_get('term'), @@ -181,9 +190,13 @@ class Items extends Secure_Controller public function view($item_id = -1) { + if($item_id == -1) + { + $data = array(); + } + // allow_temp_items is set in the index function of items.php or sales.php $data['allow_temp_item'] = $this->session->userdata('allow_temp_items'); - $data['item_tax_info'] = $this->xss_clean($this->Item_taxes->get_info($item_id)); $data['default_tax_1_rate'] = ''; $data['default_tax_2_rate'] = ''; @@ -224,6 +237,8 @@ class Items extends Secure_Controller $item_info->item_type = ITEM; // standard $item_info->stock_type = HAS_STOCK; $item_info->tax_category_id = 1; // Standard + $item_info->qty_per_pack = 1; + $item_info->pack_name = $this->lang->line('items_default_pack_name'); } $data['item_info'] = $item_info; @@ -279,6 +294,18 @@ class Items extends Secure_Controller $data['stock_locations'] = $location_array; } + $data['selected_low_sell_item_id'] = $item_info->low_sell_item_id; + + if($item_id != -1 && $item_info->item_id != $item_info->low_sell_item_id) + { + $low_sell_item_info = $this->Item->get_info($item_info->low_sell_item_id); + $data['selected_low_sell_item'] = implode(NAME_SEPARATOR, array($low_sell_item_info->name, $low_sell_item_info->pack_name)); + } + else + { + $data['selected_low_sell_item'] = ''; + } + $this->load->view('items/form', $data); } @@ -397,6 +424,8 @@ class Items extends Secure_Controller { $receiving_quantity = '1'; } + $default_pack_name = $this->lang->line('items_default_pack_name'); + //Save item data $item_data = array( 'name' => $this->input->post('name'), @@ -412,6 +441,9 @@ class Items extends Secure_Controller 'receiving_quantity' => $receiving_quantity, 'allow_alt_description' => $this->input->post('allow_alt_description') != NULL, 'is_serialized' => $this->input->post('is_serialized') != NULL, + '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'), diff --git a/application/controllers/Receivings.php b/application/controllers/Receivings.php index 5e4f0a1c2..8972b85ec 100644 --- a/application/controllers/Receivings.php +++ b/application/controllers/Receivings.php @@ -124,10 +124,11 @@ class Receivings extends Secure_Controller $quantity = parse_decimals($this->input->post('quantity')); $discount = parse_decimals($this->input->post('discount')); $item_location = $this->input->post('location'); + $receiving_quantity = $this->input->post('receiving_quantity'); if($this->form_validation->run() != FALSE) { - $this->receiving_lib->edit_item($item_id, $description, $serialnumber, $quantity, $discount, $price); + $this->receiving_lib->edit_item($item_id, $description, $serialnumber, $quantity, $discount, $price, $receiving_quantity); } else { diff --git a/application/controllers/Reports.php b/application/controllers/Reports.php index 8d05d4c88..82b4b9eff 100644 --- a/application/controllers/Reports.php +++ b/application/controllers/Reports.php @@ -1420,6 +1420,7 @@ class Reports extends Secure_Controller 'item_name' => $row['name'], 'item_number' => $row['item_number'], 'quantity' => to_quantity_decimals($row['quantity']), + 'low_sell_quantity' => to_quantity_decimals($row['low_sell_quantity']), 'reorder_level' => to_quantity_decimals($row['reorder_level']), 'location_name' => $row['location_name'], 'cost_price' => to_currency($row['cost_price']), diff --git a/application/helpers/tabular_helper.php b/application/helpers/tabular_helper.php index 9e1101983..f37befc91 100644 --- a/application/helpers/tabular_helper.php +++ b/application/helpers/tabular_helper.php @@ -374,6 +374,11 @@ function get_item_data_row($item) } } + if ($CI->config->item('multi_pack_enabled') == '1') + { + $item->name .= NAME_SEPARATOR . $item->pack_name; + } + return array ( 'items.item_id' => $item->item_id, 'item_number' => $item->item_number, diff --git a/application/language/en-GB/config_lang.php b/application/language/en-GB/config_lang.php index f581ce4e1..91c35af9f 100644 --- a/application/language/en-GB/config_lang.php +++ b/application/language/en-GB/config_lang.php @@ -181,6 +181,7 @@ $lang["config_msg_src"] = "SMS-API Sender ID"; $lang["config_msg_src_required"] = "SMS-API Sender ID is a required field"; $lang["config_msg_uid"] = "SMS-API Username"; $lang["config_msg_uid_required"] = "SMS-API Username is a required field"; +$lang["config_multi_pack_enabled"] = "Multiple Packages per Item"; $lang["config_none"] = "none"; $lang["config_notify_alignment"] = "Notification Popup Position"; $lang["config_number_format"] = "Number Format"; diff --git a/application/language/en-GB/items_lang.php b/application/language/en-GB/items_lang.php index f993612c0..8cdb10235 100644 --- a/application/language/en-GB/items_lang.php +++ b/application/language/en-GB/items_lang.php @@ -24,6 +24,7 @@ $lang["items_cost_price_number"] = "Cost Price must be a number"; $lang["items_cost_price_required"] = "Cost Price is a required field"; $lang["items_count"] = "Update Inventory"; $lang["items_current_quantity"] = "Current Quantity"; +$lang["items_default_pack_name"] = "Each"; $lang["items_description"] = "Description"; $lang["items_details_count"] = "Inventory count details"; $lang["items_do_nothing"] = "Do nothing"; @@ -55,6 +56,7 @@ $lang["items_item_number_duplicate"] = "Item Number is already present in the da $lang["items_kit"] = "Kit"; $lang["items_location"] = "Location"; $lang["items_low_inventory_items"] = "Out Of Stock Items"; +$lang["items_low_sell_item"] = "Low sell item"; $lang["items_manually_editing_of_quantity"] = "Manual Edit of Quantity"; $lang["items_name"] = "Item Name"; $lang["items_name_required"] = "Item Name is a required field"; @@ -67,6 +69,8 @@ $lang["items_nonstock"] = "Non-stocked"; $lang["items_number_information"] = "Item Number"; $lang["items_number_required"] = "Barcode is a required field"; $lang["items_one_or_multiple"] = "item(s)"; +$lang["items_pack_name"] = "Pack Name"; +$lang["items_qty_per_pack"] = "Quantity per pack"; $lang["items_quantity"] = "Quantity"; $lang["items_quantity_number"] = "Quantity must be a number"; $lang["items_quantity_required"] = "Quantity is a required field"; diff --git a/application/language/en-GB/receivings_lang.php b/application/language/en-GB/receivings_lang.php index a44ed6565..6237237da 100644 --- a/application/language/en-GB/receivings_lang.php +++ b/application/language/en-GB/receivings_lang.php @@ -35,6 +35,7 @@ $lang["receivings_register"] = "Items Receiving"; $lang["receivings_requisition"] = "Requisition"; $lang["receivings_return"] = "Return"; $lang["receivings_select_supplier"] = "Select Supplier (Optional)"; +$lang["receivings_ship_pack"] = "Ship Pack"; $lang["receivings_start_typing_supplier_name"] = "Start Typing Supplier's name..."; $lang["receivings_stock"] = "Stock"; $lang["receivings_stock_destination"] = "Stock Destination"; diff --git a/application/language/en-GB/reports_lang.php b/application/language/en-GB/reports_lang.php index 6f8148b31..cadad4315 100644 --- a/application/language/en-GB/reports_lang.php +++ b/application/language/en-GB/reports_lang.php @@ -63,6 +63,7 @@ $lang["reports_items_received"] = "Items Received"; $lang["reports_items_summary_report"] = "Items Summary Report"; $lang["reports_low_inventory"] = ""; $lang["reports_low_inventory_report"] = ""; +$lang["reports_low_sell_quantity"] = "Low Sell Qty"; $lang["reports_more_than_zero"] = "More than zero"; $lang["reports_name"] = "Name"; $lang["reports_no_reports_to_display"] = "No Items to display"; @@ -114,6 +115,7 @@ $lang["reports_taxes"] = "Taxes"; $lang["reports_taxes_summary_report"] = "Taxes Summary Report"; $lang["reports_total"] = "Total"; $lang["reports_total_inventory_value"] = "Total Inventory Value"; +$lang["reports_total_low_sell_quantity"] = "Total Low Sell Quantity"; $lang["reports_total_quantity"] = "Total Quantity"; $lang["reports_total_retail"] = "Total Inv. Retail Value"; $lang["reports_type"] = "Type"; diff --git a/application/language/en-GB/sales_lang.php b/application/language/en-GB/sales_lang.php index a106e54da..2802e1dcf 100644 --- a/application/language/en-GB/sales_lang.php +++ b/application/language/en-GB/sales_lang.php @@ -84,7 +84,7 @@ $lang["sales_must_enter_numeric"] = "Amount Tendered must be a number"; $lang["sales_must_enter_numeric_giftcard"] = "Gift Card Number must be a number"; $lang["sales_new_customer"] = "New Customer"; $lang["sales_new_item"] = "New Item"; -$lang["sales_no_description"] = "None"; +$lang["sales_no_description"] = "No description"; $lang["sales_no_filter"] = "All"; $lang["sales_no_items_in_cart"] = "There are no Items in the cart"; $lang["sales_no_sales_to_display"] = "No Sales to display"; diff --git a/application/language/en-US/config_lang.php b/application/language/en-US/config_lang.php index 00bf2e81b..a1ac16e7b 100644 --- a/application/language/en-US/config_lang.php +++ b/application/language/en-US/config_lang.php @@ -181,6 +181,7 @@ $lang["config_msg_src"] = "SMS-API Sender ID"; $lang["config_msg_src_required"] = "SMS-API Sender ID is a required field"; $lang["config_msg_uid"] = "SMS-API Username"; $lang["config_msg_uid_required"] = "SMS-API Username is a required field"; +$lang["config_multi_pack_enabled"] = "Multiple Packages per Item"; $lang["config_none"] = "none"; $lang["config_notify_alignment"] = "Notification Popup Position"; $lang["config_number_format"] = "Number Format"; diff --git a/application/language/en-US/items_lang.php b/application/language/en-US/items_lang.php index bf8527123..d44e7d7ed 100644 --- a/application/language/en-US/items_lang.php +++ b/application/language/en-US/items_lang.php @@ -24,6 +24,7 @@ $lang["items_cost_price_number"] = "Wholesale Price must be a number."; $lang["items_cost_price_required"] = "Wholesale Price is a required field."; $lang["items_count"] = "Update Inventory"; $lang["items_current_quantity"] = "Current Quantity"; +$lang["items_default_pack_name"] = "Each"; $lang["items_description"] = "Description"; $lang["items_details_count"] = "Inventory Count Details"; $lang["items_do_nothing"] = "Do Nothing"; @@ -55,6 +56,7 @@ $lang["items_item_number_duplicate"] = "Item Number is already present in the da $lang["items_kit"] = "Kit"; $lang["items_location"] = "Location"; $lang["items_low_inventory_items"] = "Out Of Stock Items"; +$lang["items_low_sell_item"] = "Low sell item"; $lang["items_manually_editing_of_quantity"] = "Manual Edit of Quantity"; $lang["items_name"] = "Item Name"; $lang["items_name_required"] = "Item Name is a required field."; @@ -67,6 +69,8 @@ $lang["items_nonstock"] = "Non-stocked"; $lang["items_number_information"] = "Item Number"; $lang["items_number_required"] = "Barcode is a required field."; $lang["items_one_or_multiple"] = "item(s)"; +$lang["items_pack_name"] = "Pack Name"; +$lang["items_qty_per_pack"] = "Quantity per pack"; $lang["items_quantity"] = "Quantity"; $lang["items_quantity_number"] = "Quantity must be a number."; $lang["items_quantity_required"] = "Quantity is a required field."; diff --git a/application/language/en-US/receivings_lang.php b/application/language/en-US/receivings_lang.php index d56372f33..0f4138555 100644 --- a/application/language/en-US/receivings_lang.php +++ b/application/language/en-US/receivings_lang.php @@ -35,6 +35,7 @@ $lang["receivings_register"] = "Items Receiving"; $lang["receivings_requisition"] = "Requisition"; $lang["receivings_return"] = "Return"; $lang["receivings_select_supplier"] = "Select Supplier (Optional)"; +$lang["receivings_ship_pack"] = "Ship Pack"; $lang["receivings_start_typing_supplier_name"] = "Start Typing Supplier's name..."; $lang["receivings_stock"] = "Stock"; $lang["receivings_stock_destination"] = "Stock Destination"; diff --git a/application/language/en-US/reports_lang.php b/application/language/en-US/reports_lang.php index e73037774..4563efcb4 100644 --- a/application/language/en-US/reports_lang.php +++ b/application/language/en-US/reports_lang.php @@ -63,6 +63,7 @@ $lang["reports_items_received"] = "Items Received"; $lang["reports_items_summary_report"] = "Items Summary Report"; $lang["reports_low_inventory"] = ""; $lang["reports_low_inventory_report"] = ""; +$lang["reports_low_sell_quantity"] = "Low Sell Qty"; $lang["reports_more_than_zero"] = "More than zero"; $lang["reports_name"] = "Name"; $lang["reports_no_reports_to_display"] = "No Items to display."; @@ -114,6 +115,7 @@ $lang["reports_taxes"] = "Taxes"; $lang["reports_taxes_summary_report"] = "Taxes Summary Report"; $lang["reports_total"] = "Total"; $lang["reports_total_inventory_value"] = "Total Inventory Value"; +$lang["reports_total_low_sell_quantity"] = "Total Low Sell Quantity"; $lang["reports_total_quantity"] = "Total Quantity"; $lang["reports_total_retail"] = "Total Inv. Retail Value"; $lang["reports_type"] = "Type"; diff --git a/application/language/en-US/sales_lang.php b/application/language/en-US/sales_lang.php index dbb549a52..7b1efb4df 100644 --- a/application/language/en-US/sales_lang.php +++ b/application/language/en-US/sales_lang.php @@ -84,7 +84,7 @@ $lang["sales_must_enter_numeric"] = "Amount Tendered must be a number."; $lang["sales_must_enter_numeric_giftcard"] = "Gift Card Number must be a number."; $lang["sales_new_customer"] = "New Customer"; $lang["sales_new_item"] = "New Item"; -$lang["sales_no_description"] = "None"; +$lang["sales_no_description"] = "No description"; $lang["sales_no_filter"] = "All"; $lang["sales_no_items_in_cart"] = "There are no Items in the cart."; $lang["sales_no_sales_to_display"] = "No Sales to display."; diff --git a/application/libraries/Receiving_lib.php b/application/libraries/Receiving_lib.php index 894474bc9..4c01e9bbc 100644 --- a/application/libraries/Receiving_lib.php +++ b/application/libraries/Receiving_lib.php @@ -209,6 +209,23 @@ class Receiving_lib $item_info = $this->CI->Item->get_info($item_id,$item_location); //array records are identified by $insertkey and item_id is just another field. $price = $price != NULL ? $price : $item_info->cost_price; + + if($this->CI->config->item('multi_pack_enabled') == '1') + { + $item_info->name .= NAME_SEPARATOR . $item_info->pack_name; + } + + if ($item_info->receiving_quantity == 0 || $item_info->receiving_quantity == 1) + { + $receiving_quantity_choices = array(1 => 'x1'); + } + else + { + $receiving_quantity_choices = array( + to_quantity_decimals($item_info->receiving_quantity) => 'x' . to_quantity_decimals($item_info->receiving_quantity), + 1 => 'x1'); + } + $item = array($insertkey => array( 'item_id' => $item_id, 'item_location' => $item_location, @@ -223,8 +240,9 @@ class Receiving_lib 'discount' => $discount, 'in_stock' => $this->CI->Item_quantity->get_item_quantity($item_id, $item_location)->quantity, 'price' => $price, - 'receiving_quantity' => $receiving_quantity!=NULL ? $receiving_quantity : $item_info->receiving_quantity, - 'total' => $this->get_item_total($quantity, $price, $discount, $receiving_quantity) + 'receiving_quantity' => $item_info->receiving_quantity, + 'receiving_quantity_choices' => $receiving_quantity_choices, + 'total' => $this->get_item_total($quantity, $price, $discount, $item_info->receiving_quantity) ) ); @@ -232,7 +250,7 @@ class Receiving_lib if($itemalreadyinsale) { $items[$updatekey]['quantity'] += $quantity; - $items[$updatekey]['total'] = $this->get_item_total($items[$updatekey]['quantity'], $price, $discount); + $items[$updatekey]['total'] = $this->get_item_total($items[$updatekey]['quantity'], $price, $discount, $items[$updatekey]['receiving_quantity']); } else { @@ -245,7 +263,7 @@ class Receiving_lib return TRUE; } - public function edit_item($line, $description, $serialnumber, $quantity, $discount, $price) + public function edit_item($line, $description, $serialnumber, $quantity, $discount, $price, $receiving_quantity) { $items = $this->get_cart(); if(isset($items[$line])) @@ -254,9 +272,10 @@ class Receiving_lib $line['description'] = $description; $line['serialnumber'] = $serialnumber; $line['quantity'] = $quantity; + $line['receiving_quantity'] = $receiving_quantity; $line['discount'] = $discount; $line['price'] = $price; - $line['total'] = $this->get_item_total($quantity, $price, $discount); + $line['total'] = $this->get_item_total($quantity, $price, $discount, $receiving_quantity); $this->set_cart($items); } @@ -330,9 +349,10 @@ class Receiving_lib $this->clear_reference(); } - public function get_item_total($quantity, $price, $discount_percentage) + public function get_item_total($quantity, $price, $discount_percentage, $receiving_quantity) { - $total = bcmul($quantity, $price); + $extended_quantity = bcmul($quantity, $receiving_quantity); + $total = bcmul($extended_quantity, $price); $discount_fraction = bcdiv($discount_percentage, 100); $discount_amount = bcmul($total, $discount_fraction); @@ -344,7 +364,7 @@ class Receiving_lib $total = 0; foreach($this->get_cart() as $item) { - $total = bcadd($total, $this->get_item_total(($item['quantity']* $item['receiving_quantity']), $item['price'], $item['discount'])); + $total = bcadd($total, $this->get_item_total(($item['quantity']), $item['price'], $item['discount'], $item['receiving_quantity'])); } return $total; diff --git a/application/libraries/Sale_lib.php b/application/libraries/Sale_lib.php index 7dfb3fed9..35d033c0c 100644 --- a/application/libraries/Sale_lib.php +++ b/application/libraries/Sale_lib.php @@ -827,7 +827,14 @@ class Sale_lib $total = $this->get_item_total($quantity, $price, $discount); $discounted_total = $this->get_item_total($quantity, $price, $discount, TRUE); - //Item already exists and is not serialized, add to quantity + + if($this->CI->config->item('multi_pack_enabled') == '1') + { + $item_info->name .= NAME_SEPARATOR . $item_info->pack_name; + } + + + //Item already exists and is not serialized, add to quantity if(!$itemalreadyinsale || $item_info->is_serialized) { $item = array($insertkey => array( diff --git a/application/migrations/20180610100000_upgrade_to_3_3_0.php b/application/migrations/20180610100000_upgrade_to_3_3_0.php new file mode 100644 index 000000000..fda74aa77 --- /dev/null +++ b/application/migrations/20180610100000_upgrade_to_3_3_0.php @@ -0,0 +1,20 @@ + diff --git a/application/migrations/sqlscripts/3.2.1_to_3.3.0.sql b/application/migrations/sqlscripts/3.2.1_to_3.3.0.sql new file mode 100644 index 000000000..0cc3bd68d --- /dev/null +++ b/application/migrations/sqlscripts/3.2.1_to_3.3.0.sql @@ -0,0 +1,15 @@ +-- +-- Add support for Multi-Package Items +-- + +INSERT INTO `ospos_app_config` (`key`, `value`) VALUES +('multi_pack_enabled', '0'); + +ALTER TABLE `ospos_items` + ADD COLUMN `qty_per_pack` decimal(15,3) NOT NULL DEFAULT 1, + ADD COLUMN `pack_name` varchar(8) DEFAULT 'Each', + ADD COLUMN `low_sell_item_id` int(10) DEFAULT 0; + +UPDATE `ospos_items` + SET `low_sell_item_id` = `item_id` + WHERE `low_sell_item_id` = 0; diff --git a/application/models/Item.php b/application/models/Item.php index fcb28c670..758ba2e86 100644 --- a/application/models/Item.php +++ b/application/models/Item.php @@ -23,6 +23,8 @@ define('PRICE_OPTION_ALL', 0); define('PRICE_OPTION_KIT', 1); define('PRICE_OPTION_KIT_STOCK', 2); +define('NAME_SEPARATOR', ' | '); + /** * Item class @@ -109,64 +111,65 @@ class Item extends CI_Model // get_found_rows case if($count_only == TRUE) { - $this->db->select('COUNT(DISTINCT items.item_id) as count'); + $this->db->select('COUNT(DISTINCT items.item_id) AS count'); } else { - $this->db->select('items.item_id as item_id'); - $this->db->select('MAX(items.name) as name'); - $this->db->select('MAX(items.category) as category'); - $this->db->select('MAX(items.supplier_id) as supplier_id'); - $this->db->select('MAX(items.item_number) as item_number'); - $this->db->select('MAX(items.description) as description'); - $this->db->select('MAX(items.cost_price) as cost_price'); - $this->db->select('MAX(items.unit_price) as unit_price'); - $this->db->select('MAX(items.reorder_level) as reorder_level'); - $this->db->select('MAX(items.receiving_quantity) as receiving_quantity'); - $this->db->select('MAX(items.pic_filename) as pic_filename'); - $this->db->select('MAX(items.allow_alt_description) as allow_alt_description'); - $this->db->select('MAX(items.is_serialized) as is_serialized'); - $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('items.item_id AS item_id'); + $this->db->select('MAX(items.name) AS name'); + $this->db->select('MAX(items.category) AS category'); + $this->db->select('MAX(items.supplier_id) AS supplier_id'); + $this->db->select('MAX(items.item_number) AS item_number'); + $this->db->select('MAX(items.description) AS description'); + $this->db->select('MAX(items.cost_price) AS cost_price'); + $this->db->select('MAX(items.unit_price) AS unit_price'); + $this->db->select('MAX(items.reorder_level) AS reorder_level'); + $this->db->select('MAX(items.receiving_quantity) AS receiving_quantity'); + $this->db->select('MAX(items.pic_filename) AS pic_filename'); + $this->db->select('MAX(items.allow_alt_description) AS allow_alt_description'); + $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'); - $this->db->select('MAX(suppliers.agency_name) as agency_name'); - $this->db->select('MAX(suppliers.account_number) as account_number'); - $this->db->select('MAX(suppliers.deleted) as deleted'); + $this->db->select('MAX(suppliers.person_id) AS person_id'); + $this->db->select('MAX(suppliers.company_name) AS company_name'); + $this->db->select('MAX(suppliers.agency_name) AS agency_name'); + $this->db->select('MAX(suppliers.account_number) AS account_number'); + $this->db->select('MAX(suppliers.deleted) AS deleted'); - $this->db->select('MAX(inventory.trans_id) as trans_id'); - $this->db->select('MAX(inventory.trans_items) as trans_items'); - $this->db->select('MAX(inventory.trans_user) as trans_user'); - $this->db->select('MAX(inventory.trans_date) as trans_date'); - $this->db->select('MAX(inventory.trans_comment) as trans_comment'); - $this->db->select('MAX(inventory.trans_location) as trans_location'); - $this->db->select('MAX(inventory.trans_inventory) as trans_inventory'); + $this->db->select('MAX(inventory.trans_id) AS trans_id'); + $this->db->select('MAX(inventory.trans_items) AS trans_items'); + $this->db->select('MAX(inventory.trans_user) AS trans_user'); + $this->db->select('MAX(inventory.trans_date) AS trans_date'); + $this->db->select('MAX(inventory.trans_comment) AS trans_comment'); + $this->db->select('MAX(inventory.trans_location) AS trans_location'); + $this->db->select('MAX(inventory.trans_inventory) AS trans_inventory'); if($filters['stock_location_id'] > -1) { - $this->db->select('MAX(item_quantities.item_id) as qty_item_id'); - $this->db->select('MAX(item_quantities.location_id) as location_id'); - $this->db->select('MAX(item_quantities.quantity) as quantity'); + $this->db->select('MAX(item_quantities.item_id) AS qty_item_id'); + $this->db->select('MAX(item_quantities.location_id) AS location_id'); + $this->db->select('MAX(item_quantities.quantity) AS quantity'); } } - $this->db->from('items as items'); - $this->db->join('suppliers as suppliers', 'suppliers.person_id = items.supplier_id', 'left'); - $this->db->join('inventory as inventory', 'inventory.trans_items = items.item_id'); + $this->db->from('items AS items'); + $this->db->join('suppliers AS suppliers', 'suppliers.person_id = items.supplier_id', 'left'); + $this->db->join('inventory AS inventory', 'inventory.trans_items = items.item_id'); if($filters['stock_location_id'] > -1) { - $this->db->join('item_quantities as item_quantities', 'item_quantities.item_id = items.item_id'); + $this->db->join('item_quantities AS item_quantities', 'item_quantities.item_id = items.item_id'); $this->db->where('location_id', $filters['stock_location_id']); } @@ -398,6 +401,11 @@ class Item extends CI_Model if($this->db->insert('items', $item_data)) { $item_data['item_id'] = $this->db->insert_id(); + if($item_data['low_sell_item_id'] == -1) + { + $this->db->where('item_id', $item_data['item_id']); + $this->db->update('items', array('low_sell_item_id'=>$item_data['item_id'])); + } return TRUE; } return FALSE; @@ -477,7 +485,7 @@ class Item extends CI_Model function get_search_suggestion_format($seed = NULL) { $seed .= ',' . $this->config->item('suggestions_first_column'); - + if($this->config->item('suggestions_second_column') !== '') { $seed .= ',' . $this->config->item('suggestions_second_column'); @@ -487,37 +495,77 @@ class Item extends CI_Model { $seed .= ',' . $this->config->item('suggestions_third_column'); } - + return $seed; } function get_search_suggestion_label($result_row) { + $label = ''; $label1 = $this->config->item('suggestions_first_column'); $label2 = $this->config->item('suggestions_second_column'); $label3 = $this->config->item('suggestions_third_column'); - $label = $result_row->$label1; - - if($label2 !== '') + // If multi_pack enabled then if "name" is part of the search suggestions then append pack + if($this->config->item('multi_pack_enabled') == '1') { - $label .= ' | '. $result_row->$label2; + $this->append_label($label, $label1, $result_row); + $this->append_label($label, $label2, $result_row); + $this->append_label($label, $label3, $result_row); } - - if($label3 !== '') + else { - $label .= ' | '. $result_row->$label3; - } - + $label = $result_row->$label1; + + if($label2 !== '') + { + $label .= NAME_SEPARATOR . $result_row->$label2; + } + + if($label3 !== '') + { + $label .= NAME_SEPARATOR . $result_row->$label3; + } + } + return $label; - } + } + + private function append_label(&$label, $item_field_name, $item_info) + { + if($item_field_name !== '') + { + if($label == "") + { + if($item_field_name == 'name') + { + $label .= implode(NAME_SEPARATOR, array($item_info->name, $item_info->pack_name)); + } + else + { + $label .= $item_info->$item_field_name; + } + } + else + { + if($item_field_name == 'name') + { + $label .= implode(NAME_SEPARATOR, array("", $item_info->name, $item_info->pack_name)); + } + else + { + $label .= NAME_SEPARATOR . $item_info->$item_field_name; + } + } + } + } public function get_search_suggestions($search, $filters = array('is_deleted' => FALSE, 'search_custom' => FALSE), $unique = FALSE, $limit = 25) { $suggestions = array(); $non_kit = array(ITEM, ITEM_AMOUNT_ENTRY); - $this->db->select($this->get_search_suggestion_format('item_id, name')); + $this->db->select($this->get_search_suggestion_format('item_id, name, pack_name')); $this->db->from('items'); $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 @@ -528,7 +576,7 @@ class Item extends CI_Model $suggestions[] = array('value' => $row->item_id, 'label' => $this->get_search_suggestion_label($row)); } - $this->db->select($this->get_search_suggestion_format('item_id, item_number')); + $this->db->select($this->get_search_suggestion_format('item_id, item_number, pack_name')); $this->db->from('items'); $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 @@ -569,7 +617,7 @@ class Item extends CI_Model } //Search by description - $this->db->select($this->get_search_suggestion_format('item_id, name, description')); + $this->db->select($this->get_search_suggestion_format('item_id, name, pack_name, description')); $this->db->from('items'); $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 @@ -624,7 +672,7 @@ class Item extends CI_Model $suggestions = array(); $non_kit = array(ITEM, ITEM_AMOUNT_ENTRY); - $this->db->select($this->get_search_suggestion_format('item_id, name')); + $this->db->select($this->get_search_suggestion_format('item_id, name, pack_name')); $this->db->from('items'); $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 @@ -636,7 +684,7 @@ class Item extends CI_Model $suggestions[] = array('value' => $row->item_id, 'label' => $this->get_search_suggestion_label($row)); } - $this->db->select($this->get_search_suggestion_format('item_id, item_number')); + $this->db->select($this->get_search_suggestion_format('item_id, item_number, pack_name')); $this->db->from('items'); $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 @@ -678,7 +726,7 @@ class Item extends CI_Model } //Search by description - $this->db->select($this->get_search_suggestion_format('item_id, name, description')); + $this->db->select($this->get_search_suggestion_format('item_id, name, pack_name, description')); $this->db->from('items'); $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 @@ -834,6 +882,24 @@ class Item extends CI_Model return $suggestions; } + public function get_low_sell_suggestions($search) + { + $suggestions = array(); + + $this->db->select($this->get_search_suggestion_format('item_id, pack_name')); + $this->db->from('items'); + $this->db->where('deleted', '0'); + $this->db->where("stock_type = '0'"); // stocked items only + $this->db->like('name', $search); + $this->db->order_by('name', 'asc'); + foreach($this->db->get()->result() as $row) + { + $suggestions[] = array('value' => $row->item_id, 'label' => $this->get_search_suggestion_label($row)); + } + + return $suggestions; + } + public function get_category_suggestions($search) { $suggestions = array(); @@ -950,5 +1016,31 @@ class Item extends CI_Model $this->db->update('items', array('description'=>$item_description)); } + /** + * Determine the item name to use taking into consideration that + * for a multipack environment then the item name should have the + * pack appended to it + */ + function get_item_name($as_name = NULL) + { + if($as_name == NULL) + { + $as_name = ''; + } + else + { + $as_name = ' AS ' . $as_name; + } + + if($this->config->item('multi_pack_enabled') == '1') + { + $item_name = "concat(items.name,'" . NAME_SEPARATOR . '\', items.pack_name)' . $as_name; + } + else + { + $item_name = 'items.name' . $as_name; + } + return $item_name; + } } ?> diff --git a/application/models/Sale.php b/application/models/Sale.php index 9c1cba3ce..a82e9be69 100644 --- a/application/models/Sale.php +++ b/application/models/Sale.php @@ -174,7 +174,7 @@ class Sale extends CI_Model SELECT sales_items_taxes.sale_id AS sale_id, sales_items_taxes.item_id AS item_id, sales_items_taxes.line AS line, - SUM(sales_items_taxes.item_tax_amount) as tax + SUM(sales_items_taxes.item_tax_amount) AS tax FROM ' . $this->db->dbprefix('sales_items_taxes') . ' AS sales_items_taxes INNER JOIN ' . $this->db->dbprefix('sales') . ' AS sales ON sales.sale_id = sales_items_taxes.sale_id @@ -188,7 +188,7 @@ class Sale extends CI_Model // get_found_rows case if($count_only == TRUE) { - $this->db->select('COUNT(DISTINCT sales.sale_id) as count'); + $this->db->select('COUNT(DISTINCT sales.sale_id) AS count'); } else { @@ -930,12 +930,12 @@ class Sale extends CI_Model discount_percent, item_location, print_option, - items.name as name, + ' . $this->Item->get_item_name('name') . ', category, 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->from('sales_items AS sales_items'); + $this->db->join('items AS items', 'sales_items.item_id = items.item_id'); $this->db->where('sales_items.sale_id', $sale_id); // Entry sequence (this will render kits in the expected sequence) @@ -949,6 +949,7 @@ class Sale extends CI_Model $this->db->order_by('stock_type', 'desc'); $this->db->order_by('sales_items.description', 'asc'); $this->db->order_by('items.name', 'asc'); + $this->db->order_by('items.qty_per_pack', 'asc'); } // Group by Item Category elseif($this->config->item('line_sequence') == '2') @@ -956,6 +957,7 @@ class Sale extends CI_Model $this->db->order_by('category', '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'); } // Group by entry sequence in descending sequence (the Standard) else @@ -1133,7 +1135,7 @@ class Sale extends CI_Model SELECT sales_items_taxes.sale_id AS sale_id, sales_items_taxes.item_id AS item_id, sales_items_taxes.line AS line, - SUM(sales_items_taxes.item_tax_amount) as tax + SUM(sales_items_taxes.item_tax_amount) AS tax FROM ' . $this->db->dbprefix('sales_items_taxes') . ' AS sales_items_taxes INNER JOIN ' . $this->db->dbprefix('sales') . ' AS sales ON sales.sale_id = sales_items_taxes.sale_id @@ -1181,7 +1183,7 @@ class Sale extends CI_Model MAX(sales.employee_id) AS employee_id, MAX(CONCAT(employee.first_name, " ", employee.last_name)) AS employee_name, items.item_id AS item_id, - MAX(items.name) AS name, + MAX(' . $this->Item->get_item_name() . ') AS name, MAX(items.item_number) AS item_number, MAX(items.category) AS category, MAX(items.supplier_id) AS supplier_id, diff --git a/application/models/reports/Inventory_low.php b/application/models/reports/Inventory_low.php index 2cca4519f..35842f700 100644 --- a/application/models/reports/Inventory_low.php +++ b/application/models/reports/Inventory_low.php @@ -16,17 +16,20 @@ class Inventory_low extends Report public function getData(array $inputs) { - $this->db->select('items.name, items.item_number, item_quantities.quantity, items.reorder_level, stock_locations.location_name'); - $this->db->from('items'); - $this->db->join('item_quantities', 'items.item_id = item_quantities.item_id'); - $this->db->join('stock_locations', 'item_quantities.location_id = stock_locations.location_id'); - $this->db->where('items.deleted', 0); - $this->db->where('stock_locations.deleted', 0); - $this->db->where('items.stock_type', 0); - $this->db->where('item_quantities.quantity <= items.reorder_level'); - $this->db->order_by('items.name'); + $query = $this->db->query("SELECT " . $this->Item->get_item_name('name') . ", + items.item_number, + item_quantities.quantity, + items.reorder_level, + stock_locations.location_name + FROM " . $this->db->dbprefix('items') . " AS items + JOIN " . $this->db->dbprefix('item_quantities') . " AS item_quantities ON items.item_id = item_quantities.item_id + JOIN " . $this->db->dbprefix('stock_locations') . " AS stock_locations ON item_quantities.location_id = stock_locations.location_id + WHERE items.deleted = 0 + AND items.stock_type = 0 + AND item_quantities.quantity <= items.reorder_level + ORDER BY items.name"); - return $this->db->get()->result_array(); + return $query->result_array(); } public function getSummaryData(array $inputs) diff --git a/application/models/reports/Inventory_summary.php b/application/models/reports/Inventory_summary.php index 51c4e2004..20215cd68 100644 --- a/application/models/reports/Inventory_summary.php +++ b/application/models/reports/Inventory_summary.php @@ -9,6 +9,7 @@ class Inventory_summary extends Report return array(array('item_name' => $this->lang->line('reports_item_name')), array('item_number' => $this->lang->line('reports_item_number')), array('quantity' => $this->lang->line('reports_quantity')), + array('low_sell_quantity' => $this->lang->line('reports_low_sell_quantity')), array('reorder_level' => $this->lang->line('reports_reorder_level')), array('location_name' => $this->lang->line('reports_stock_location')), array('cost_price' => $this->lang->line('reports_cost_price'), 'sorter' => 'number_sorter'), @@ -18,7 +19,7 @@ class Inventory_summary extends Report public function getData(array $inputs) { - $this->db->select('items.name, items.item_number, item_quantities.quantity, items.reorder_level, stock_locations.location_name, items.cost_price, items.unit_price, (items.cost_price * item_quantities.quantity) AS sub_total_value'); + $this->db->select($this->Item->get_item_name('item_name') . ', items.item_number, item_quantities.quantity, item_quantities.quantity, (item_quantities.quantity * items.qty_per_pack) as low_sell_quantity, items.reorder_level, stock_locations.location_name, items.cost_price, items.unit_price, (items.cost_price * item_quantities.quantity) AS sub_total_value'); $this->db->from('items AS items'); $this->db->join('item_quantities AS item_quantities', 'items.item_id = item_quantities.item_id'); $this->db->join('stock_locations AS stock_locations', 'item_quantities.location_id = stock_locations.location_id'); @@ -42,6 +43,7 @@ class Inventory_summary extends Report } $this->db->order_by('items.name'); + $this->db->order_by('items.qty_per_pack'); return $this->db->get()->result_array(); } @@ -54,12 +56,13 @@ class Inventory_summary extends Report */ public function getSummaryData(array $inputs) { - $return = array('total_inventory_value' => 0, 'total_quantity' => 0, 'total_retail' => 0); + $return = array('total_inventory_value' => 0, 'total_quantity' => 0, 'total_low_sell_quantity' => 0, 'total_retail' => 0); foreach($inputs as $input) { $return['total_inventory_value'] += $input['sub_total_value']; $return['total_quantity'] += $input['quantity']; + $return['total_low_sell_quantity'] += $input['low_sell_quantity']; $return['total_retail'] += $input['unit_price'] * $input['quantity']; } diff --git a/application/views/configs/general_config.php b/application/views/configs/general_config.php index cf910dfaf..0a470281c 100644 --- a/application/views/configs/general_config.php +++ b/application/views/configs/general_config.php @@ -160,7 +160,7 @@ 'name' => $this->lang->line('items_name'), 'item_number' => $this->lang->line('items_number_information'), 'unit_price' => $this->lang->line('items_unit_price') - ), + ), $this->config->item('suggestions_third_column'), array('class' => 'form-control input-sm')); ?> @@ -213,6 +213,17 @@ +
      + lang->line('config_multi_pack_enabled'), 'multi_pack_enabled', array('class' => 'control-label col-xs-2')); ?> +
      + 'multi_pack_enabled', + 'id' => 'multi_pack_enabled', + 'value' => 'multi_pack_enabled', + 'checked' => $this->config->item('multi_pack_enabled'))); ?> +
      +
      +
      lang->line('config_custom1'), 'config_custom1', array('class' => 'control-label col-xs-2')); ?>
      diff --git a/application/views/items/form.php b/application/views/items/form.php index a78aca067..f89c7ca55 100644 --- a/application/views/items/form.php +++ b/application/views/items/form.php @@ -93,7 +93,8 @@ ); ?> lang->line('items_kit'); ?> config->item('derive_sale_quantity') == '1') { + if($this->config->item('derive_sale_quantity') == '1') + { ?>
      + config->item('multi_pack_enabled') == '1') + { + ?> +
      + lang->line('items_qty_per_pack'), 'qty_per_pack', array('class'=>'control-label col-xs-3')); ?> +
      + 'qty_per_pack', + 'id'=>'qty_per_pack', + 'class'=>'form-control input-sm', + 'value'=>isset($item_info->item_id) ? to_quantity_decimals($item_info->qty_per_pack) : to_quantity_decimals(0)) + );?> +
      +
      +
      + lang->line('items_pack_name'), 'name', array('class'=>'control-label col-xs-3')); ?> +
      + 'pack_name', + 'id'=>'pack_name', + 'class'=>'form-control input-sm', + 'value'=>$item_info->pack_name) + );?> +
      +
      +
      + lang->line('items_low_sell_item'), 'low_sell_item_name', array('class'=>'control-label col-xs-3')); ?> +
      +
      + 'low_sell_item_name', + 'id'=>'low_sell_item_name', + 'class'=>'form-control input-sm', + 'size'=>'50', + 'value'=>$selected_low_sell_item) + ); ?> + +
      +
      +
      + +
      lang->line('items_is_deleted'), 'is_deleted', array('class'=>'control-label col-xs-3')); ?>
      @@ -381,6 +427,22 @@ $(document).ready(function() stay_open = false; }); + var fill_value = function(event, ui) { + event.preventDefault(); + $("input[name='low_sell_item_id']").val(ui.item.value); + $("input[name='low_sell_item_name']").val(ui.item.label); + }; + + $("#low_sell_item_name").autocomplete({ + source: '', + minChars: 0, + delay: 15, + cacheLength: 1, + appendTo: '.modal-content', + select: fill_value, + focus: fill_value + }); + var no_op = function(event, data, formatted){}; $('#category').autocomplete({ source: "", diff --git a/application/views/receivings/receipt.php b/application/views/receivings/receipt.php index 378fa7594..0d3d4bfde 100644 --- a/application/views/receivings/receipt.php +++ b/application/views/receivings/receipt.php @@ -82,7 +82,7 @@    x -
      +
      diff --git a/application/views/receivings/receiving.php b/application/views/receivings/receiving.php index fd9395bce..ae131f6bf 100644 --- a/application/views/receivings/receiving.php +++ b/application/views/receivings/receiving.php @@ -103,10 +103,10 @@ if (isset($success)) lang->line('common_delete'); ?> - lang->line('receivings_item_name'); ?> + lang->line('receivings_item_name'); ?> lang->line('receivings_cost'); ?> lang->line('receivings_quantity'); ?> - + lang->line('receivings_ship_pack'); ?> lang->line('receivings_discount'); ?> lang->line('receivings_total'); ?> lang->line('receivings_update'); ?> @@ -157,21 +157,8 @@ if (isset($success)) ?> 'quantity', 'class'=>'form-control input-sm', 'value'=>to_quantity_decimals($item['quantity']))); ?> - 1) - { - ?> - - - - - + 'form-control input-sm'));?> + lang->line('sales_no_description'); + echo "".$this->lang->line('sales_no_description').""; echo form_hidden('description',''); } } @@ -351,42 +338,41 @@ if (isset($success))
      'comment', 'id'=>'comment', 'class'=>'form-control input-sm', 'value'=>$comment, 'rows'=>'4'));?> - - - - - - - - +
      +
      lang->line('receivings_print_after_sale'); ?> - 'recv_print_after_sale', 'id'=>'recv_print_after_sale', 'class'=>'checkbox', 'value'=>1, 'checked'=>$print_after_sale)); ?> -
      - + - - - - - - - - - - -
      lang->line('receivings_reference');?>lang->line('receivings_print_after_sale'); ?> - 'recv_reference', 'id'=>'recv_reference', 'class'=>'form-control input-sm', 'value'=>$reference, 'size'=>5));?> + 'recv_print_after_sale', 'id'=>'recv_print_after_sale', 'class'=>'checkbox', 'value'=>1, 'checked'=>$print_after_sale)); ?>
      lang->line('sales_payment'); ?> - 'payment_types', 'class'=>'selectpicker show-menu-arrow', 'data-style'=>'btn-default btn-sm', 'data-width'=>'auto')); ?> -
      lang->line('sales_amount_tendered'); ?> - 'amount_tendered', 'value'=>'', 'class'=>'form-control input-sm', 'size'=>'5')); ?> -
      + + + lang->line('receivings_reference');?> + + 'recv_reference', 'id'=>'recv_reference', 'class'=>'form-control input-sm', 'value'=>$reference, 'size'=>5));?> + + + + + lang->line('sales_payment'); ?> + + 'payment_types', 'class'=>'selectpicker show-menu-arrow', 'data-style'=>'btn-default btn-sm', 'data-width'=>'auto')); ?> + + + + lang->line('sales_amount_tendered'); ?> + + 'amount_tendered', 'value'=>'', 'class'=>'form-control input-sm', 'size'=>'5')); ?> + + + +
       lang->line('receivings_cancel_receiving') ?>
      @@ -517,7 +503,7 @@ $(document).ready(function() } } - $('[name="price"],[name="quantity"],[name="discount"],[name="description"],[name="serialnumber"]').change(function() { + $('[name="price"],[name="quantity"],[name="receiving_quantity"],[name="discount"],[name="description"],[name="serialnumber"]').change(function() { $(this).parents("tr").prevAll("form:first").submit() }); diff --git a/application/views/sales/register.php b/application/views/sales/register.php index 7cde592a1..26852456a 100644 --- a/application/views/sales/register.php +++ b/application/views/sales/register.php @@ -133,6 +133,7 @@ if(isset($success)) foreach(array_reverse($cart, TRUE) as $line=>$item) { ?> + 'form-horizontal', 'id'=>'cart_'.$line)); ?> diff --git a/database/tables.sql b/database/tables.sql index 51bff19c3..6a63bfbbc 100644 --- a/database/tables.sql +++ b/database/tables.sql @@ -118,7 +118,8 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('suggestions_second_column', ''), ('suggestions_third_column', ''), ('allow_duplicate_barcodes', '0'), -('quote_default_comments', 'This is a default quote comment'); +('quote_default_comments', 'This is a default quote comment'), +('multi_pack_enabled', '0'); -- -------------------------------------------------------- @@ -243,6 +244,9 @@ CREATE TABLE `ospos_items` ( `stock_type` TINYINT(2) NOT NULL DEFAULT 0, `item_type` TINYINT(2) NOT NULL DEFAULT 0, `tax_category_id` int(10) NOT NULL DEFAULT 1, + `qty_per_pack` decimal(15,3) NOT NULL DEFAULT 1, + `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, From 463a56b1c41b25cb5e037a909974b170f7a60818 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sun, 8 Jul 2018 18:02:19 +0100 Subject: [PATCH 139/568] Fix item_kits form issue --- application/views/item_kits/form.php | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/application/views/item_kits/form.php b/application/views/item_kits/form.php index a9289e2e9..72dc17e87 100644 --- a/application/views/item_kits/form.php +++ b/application/views/item_kits/form.php @@ -158,9 +158,9 @@ ?> - " name=item_kit_seq[] value=""/> + ' name=item_kit_seq[] value=""/> - " name=item_kit_qty[] value=""/> + ' name=item_kit_qty[] value=""/> + @@ -72,10 +74,10 @@ - + - + diff --git a/application/views/receivings/receipt.php b/application/views/receivings/receipt.php index 0d3d4bfde..b14a71a50 100644 --- a/application/views/receivings/receipt.php +++ b/application/views/receivings/receipt.php @@ -97,6 +97,16 @@ + 0 ) + { + ?> + + lang->line("sales_discount")?> + + diff --git a/application/views/receivings/receiving.php b/application/views/receivings/receiving.php index ae131f6bf..7baf6cf7a 100644 --- a/application/views/receivings/receiving.php +++ b/application/views/receivings/receiving.php @@ -103,11 +103,11 @@ if (isset($success)) lang->line('common_delete'); ?> - lang->line('receivings_item_name'); ?> + lang->line('receivings_item_name'); ?> lang->line('receivings_cost'); ?> lang->line('receivings_quantity'); ?> lang->line('receivings_ship_pack'); ?> - lang->line('receivings_discount'); ?> + lang->line('receivings_discount'); ?> lang->line('receivings_total'); ?> lang->line('receivings_update'); ?> @@ -163,18 +163,46 @@ if (isset($success)) if ($items_module_allowed && $mode!='requisition') { ?> - 'discount', 'class'=>'form-control input-sm', 'value'=>$item['discount']));?> + +
      + 'discount_fixed', 'class'=>'form-control input-sm', 'value'=>to_decimals($item['discount_fixed'], 0), 'onClick'=>'this.select();')); + echo form_hidden('discount', $item['discount']); + } + else + { + echo form_input(array('name'=>'discount', 'class'=>'form-control input-sm', 'value'=>to_decimals($item['discount'], 0), 'onClick'=>'this.select();')); + echo form_hidden('discount_fixed', $item['discount_fixed']); + } + ?> + + 'discount_toggle', 'name'=>'discount_toggle', 'value'=>1, 'data-toggle'=>"toggle",'data-size'=>'small', 'data-onstyle'=>'success', 'data-on'=>''.$this->config->item('currency_symbol').'', 'data-off'=>'%', 'data-line'=>$line, 'checked'=>$item['discount_type'])); ?> + + + +
      + - + + - + lang->line('receivings_update')?> > @@ -503,10 +531,17 @@ $(document).ready(function() } } - $('[name="price"],[name="quantity"],[name="receiving_quantity"],[name="discount"],[name="description"],[name="serialnumber"]').change(function() { + $('[name="price"],[name="quantity"],[name="receiving_quantity"],[name="discount"],[name="discount_fixed"],[name="description"],[name="serialnumber"]').change(function() { $(this).parents("tr").prevAll("form:first").submit() }); + $('[name="discount_toggle"]').change(function() { + + var input = $("").attr("type", "hidden").attr("name", "discount_type").val(($(this).prop('checked'))?1:0); + $('#cart_'+ $(this).attr('data-line')).append($(input)); + $('#cart_'+ $(this).attr('data-line')).submit(); + }); + }); diff --git a/application/views/reports/date_input.php b/application/views/reports/date_input.php index ee70710bc..979375bb7 100644 --- a/application/views/reports/date_input.php +++ b/application/views/reports/date_input.php @@ -55,6 +55,20 @@ if(isset($error)) } ?> + +
      + lang->line('reports_discount_type'), 'reports_discount_type_label', array('class'=>'required control-label col-xs-2')); ?> +
      + config->item('default_sales_discount_type'), array('id'=>'discount_type_id', 'class'=>'form-control')); ?> +
      +
      + + 1) { @@ -88,7 +102,7 @@ $(document).ready(function() $("#generate_report").click(function() { - window.location = [window.location, start_date, end_date, $("#input_type").val() || 0, $("#location_id").val()].join("/"); + window.location = [window.location, start_date, end_date, $("#input_type").val() || 0, $("#location_id").val(), $("#discount_type_id").val() || 0 ].join("/"); }); }); diff --git a/application/views/reports/specific_input.php b/application/views/reports/specific_input.php index 1d368fa92..b31bfda1b 100644 --- a/application/views/reports/specific_input.php +++ b/application/views/reports/specific_input.php @@ -22,11 +22,42 @@ if(isset($error))
      + +
      + lang->line('reports_discount_type'), 'reports_discount_type_label', array('class'=>'required control-label col-xs-2')); ?> +
      + config->item('default_sales_discount_type'), array('id'=>'discount_type_id', 'class'=>'form-control')); ?> +
      +
      + +
      'required control-label col-xs-2')); ?> -
      +
      + + +
      + 'discount_fixed', + 'id' => 'discount_fixed', + 'class' => 'form-control input-sm required', + 'type' => 'number', + 'min' => 0, + 'value' => $this->config->item('default_sales_discount_fixed'))); ?> +
      +
      @@ -51,11 +82,38 @@ if(isset($error)) diff --git a/application/views/sales/invoice.php b/application/views/sales/invoice.php index 96642a7c6..c1a6018ba 100755 --- a/application/views/sales/invoice.php +++ b/application/views/sales/invoice.php @@ -133,7 +133,7 @@ $(document).ready(function() - + 0): ?> diff --git a/application/views/sales/invoice_email.php b/application/views/sales/invoice_email.php index 8c75369b7..72c0c6259 100644 --- a/application/views/sales/invoice_email.php +++ b/application/views/sales/invoice_email.php @@ -96,7 +96,7 @@ - + 0): ?> diff --git a/application/views/sales/quote.php b/application/views/sales/quote.php index 49d28e5c5..a37acd8bf 100644 --- a/application/views/sales/quote.php +++ b/application/views/sales/quote.php @@ -135,7 +135,7 @@ if (isset($error_message)) + cols="6"> 0): ?> diff --git a/application/views/sales/quote_email.php b/application/views/sales/quote_email.php index 164062c35..051801575 100644 --- a/application/views/sales/quote_email.php +++ b/application/views/sales/quote_email.php @@ -96,7 +96,7 @@ - + 0): ?> diff --git a/application/views/sales/receipt_default.php b/application/views/sales/receipt_default.php index f2cbc2407..9192f4f86 100644 --- a/application/views/sales/receipt_default.php +++ b/application/views/sales/receipt_default.php @@ -102,6 +102,17 @@ 0) + { + ?> + + lang->line("sales_discount") ?> + + + diff --git a/application/views/sales/receipt_email.php b/application/views/sales/receipt_email.php index a8e0c04b1..7cbef7fed 100644 --- a/application/views/sales/receipt_email.php +++ b/application/views/sales/receipt_email.php @@ -96,6 +96,17 @@ 0) + { + ?> + + lang->line("sales_discount") ?> + + + 0) + { ?> + + lang->line("sales_discount") ?> + + + + diff --git a/application/views/sales/register.php b/application/views/sales/register.php index 26852456a..71d9bdd5e 100644 --- a/application/views/sales/register.php +++ b/application/views/sales/register.php @@ -107,10 +107,10 @@ if(isset($success)) lang->line('common_delete'); ?> lang->line('sales_item_number'); ?> - lang->line('sales_item_name'); ?> + lang->line('sales_item_name'); ?> lang->line('sales_price'); ?> lang->line('sales_quantity'); ?> - lang->line('sales_discount'); ?> + lang->line('sales_discount'); ?> lang->line('sales_total'); ?> lang->line('sales_update'); ?> @@ -195,7 +195,27 @@ if(isset($success)) ?> - 'discount', 'class'=>'form-control input-sm', 'value'=>to_decimals($item['discount'], 0), 'tabindex'=>++$tabindex, 'onClick'=>'this.select();'));?> + +
      + 'discount_fixed', 'class'=>'form-control input-sm', 'value'=>to_decimals($item['discount_fixed'], 0), 'tabindex'=>++$tabindex, 'onClick'=>'this.select();')); + echo form_hidden('discount', $item['discount']); + } + else + { + echo form_input(array('name'=>'discount', 'class'=>'form-control input-sm', 'value'=>to_decimals($item['discount'], 0), 'tabindex'=>++$tabindex, 'onClick'=>'this.select();')); + echo form_hidden('discount_fixed', $item['discount_fixed']); + } + ?> + + 'discount_toggle', 'name'=>'discount_toggle', 'value'=>1, 'data-toggle'=>"toggle",'data-size'=>'small', 'data-onstyle'=>'success', 'data-on'=>''.$this->config->item('currency_symbol').'', 'data-off'=>'%', 'data-line'=>$line, 'checked'=>$item['discount_type'])); ?> + + + +
      + - ").submit();" title=lang->line('sales_update')?> > + lang->line('sales_update')?> > ").attr("type", "hidden").attr("name", "discount_type").val(($(this).prop('checked'))?1:0); + $('#cart_'+ $(this).attr('data-line')).append($(input)); + $('#cart_'+ $(this).attr('data-line')).submit(); + }); }); function check_payment_type() diff --git a/application/views/sales/work_order.php b/application/views/sales/work_order.php index 47d5de5a4..e4c2a01a1 100644 --- a/application/views/sales/work_order.php +++ b/application/views/sales/work_order.php @@ -123,7 +123,7 @@ if(isset($error_message)) - + diff --git a/application/views/sales/work_order_email.php b/application/views/sales/work_order_email.php index 29aac70b9..0e68305ce 100644 --- a/application/views/sales/work_order_email.php +++ b/application/views/sales/work_order_email.php @@ -87,7 +87,7 @@ - + Date: Mon, 20 Aug 2018 15:03:09 -0500 Subject: [PATCH 149/568] Change to 3.3.0 --- application/config/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/config/config.php b/application/config/config.php index 8e9161fe5..3a345c88d 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -8,7 +8,7 @@ | | */ -$config['application_version'] = '3.4.0'; +$config['application_version'] = '3.3.0'; /* |-------------------------------------------------------------------------- From 8b29fc7fea328ca9d3631245c15c6f95b274032e Mon Sep 17 00:00:00 2001 From: Erastus Date: Mon, 20 Aug 2018 23:42:47 -0500 Subject: [PATCH 150/568] reports graphical discount --- application/config/routes.php | 1 + application/controllers/Reports.php | 8 ++++---- application/libraries/Sale_lib.php | 11 +++++++---- application/views/sales/register.php | 2 -- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/application/config/routes.php b/application/config/routes.php index 125471bd8..70dfe3d41 100644 --- a/application/config/routes.php +++ b/application/config/routes.php @@ -65,6 +65,7 @@ $route['reports/summary_:any'] = 'reports/date_input'; $route['reports/(graphical_:any)/([^/]+)/([^/]+)'] = 'reports/$1/$2/$3/$4'; $route['reports/graphical_summary_expenses_categories'] = 'reports/date_input_only'; +$route['reports/graphical_summary_discounts'] = 'reports/summary_discounts_input'; $route['reports/graphical_:any'] = 'reports/date_input'; $route['reports/(inventory_:any)/([^/]+)'] = 'reports/$1/$2'; diff --git a/application/controllers/Reports.php b/application/controllers/Reports.php index daf0c0704..703a3f521 100644 --- a/application/controllers/Reports.php +++ b/application/controllers/Reports.php @@ -721,9 +721,9 @@ class Reports extends Secure_Controller } //Graphical summary discounts report - public function graphical_summary_discounts($start_date, $end_date, $sale_type, $location_id = 'all') + public function graphical_summary_discounts($start_date, $end_date, $sale_type, $location_id = 'all', $discount_type=0) { - $inputs = array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type, 'location_id' => $location_id); + $inputs = array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type, 'location_id' => $location_id,'discount_type'=>$discount_type); $this->load->model('reports/Summary_discounts'); $model = $this->Summary_discounts; @@ -737,7 +737,7 @@ class Reports extends Secure_Controller { $row = $this->xss_clean($row); - $labels[] = $row['discount_percent']; + $labels[] = $row['discount']; $series[] = $row['count']; } @@ -749,7 +749,7 @@ class Reports extends Secure_Controller 'series_data_1' => $series, 'summary_data_1' => $summary, 'yaxis_title' => $this->lang->line('reports_count'), - 'xaxis_title' => $this->lang->line('reports_discount_percent'), + 'xaxis_title' => $this->lang->line('reports_discount'), 'show_currency' => FALSE ); diff --git a/application/libraries/Sale_lib.php b/application/libraries/Sale_lib.php index cad4ce1f6..e1ee8a512 100644 --- a/application/libraries/Sale_lib.php +++ b/application/libraries/Sale_lib.php @@ -1214,6 +1214,12 @@ class Sale_lib $item_discount = $this->get_item_discount($item['quantity'], $item['price'], $item['discount'], $item['discount_fixed']); $discount = bcadd($discount, $item_discount); } + + if($item['discount_fixed'] > 0) + { + $item_discount = $this->get_item_discount($item['quantity'], $item['price'], $item['discount'], $item['discount_fixed']); + $discount = bcadd($discount, $item_discount); + } } return $discount; @@ -1290,10 +1296,7 @@ class Sale_lib $total = bcmul($quantity, $price); $discount_fraction = bcdiv($discount_percentage, 100); - $discount_amount=bcadd(bcmul($total, $discount_fraction), $discount_fixed); - - return round($discount_amount, totals_decimals(), PHP_ROUND_HALF_UP); - + return round(bcadd(bcmul($total, $discount_fraction),$discount_fixed), totals_decimals(), PHP_ROUND_HALF_UP); } public function get_item_tax($quantity, $price, $discount_percentage, $discount_fixed, $tax_percentage) diff --git a/application/views/sales/register.php b/application/views/sales/register.php index 71d9bdd5e..6ce1ca99d 100644 --- a/application/views/sales/register.php +++ b/application/views/sales/register.php @@ -211,8 +211,6 @@ if(isset($success)) ?> 'discount_toggle', 'name'=>'discount_toggle', 'value'=>1, 'data-toggle'=>"toggle",'data-size'=>'small', 'data-onstyle'=>'success', 'data-on'=>''.$this->config->item('currency_symbol').'', 'data-off'=>'%', 'data-line'=>$line, 'checked'=>$item['discount_type'])); ?> - -
      From 3b9f52de1843c2365ca89ea2c4c1452da6db7764 Mon Sep 17 00:00:00 2001 From: Erastus Date: Tue, 21 Aug 2018 01:09:57 -0500 Subject: [PATCH 151/568] update LICENSE --- LICENSE | 1 + public/license/LICENSE | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index dcea0bfc2..382f165e9 100644 --- a/LICENSE +++ b/LICENSE @@ -18,6 +18,7 @@ Copyright (c) 2017 Deep Shah (aka deepshah) Copyright (c) 2017 Joshua Fernandez (aka joshua1234511) Copyright (c) 2017 odiea Copyright (c) 2017 asadjaved63 +Copyright (c) 2018 Erasto Marroquin (aka Erastus) Copyright (c) 2018 WebShells/Shady Sh Permission is hereby granted, free of charge, to any person obtaining a copy of diff --git a/public/license/LICENSE b/public/license/LICENSE index be8743d59..382f165e9 100644 --- a/public/license/LICENSE +++ b/public/license/LICENSE @@ -18,7 +18,7 @@ Copyright (c) 2017 Deep Shah (aka deepshah) Copyright (c) 2017 Joshua Fernandez (aka joshua1234511) Copyright (c) 2017 odiea Copyright (c) 2017 asadjaved63 -Copyright (c) 2018 Erasto Marroquín (aka Erastus) +Copyright (c) 2018 Erasto Marroquin (aka Erastus) Copyright (c) 2018 WebShells/Shady Sh Permission is hereby granted, free of charge, to any person obtaining a copy of From a5f0c83e87523000f5a08b88d355983433eea0c3 Mon Sep 17 00:00:00 2001 From: Erastus Date: Tue, 21 Aug 2018 10:57:50 -0500 Subject: [PATCH 152/568] update Tax_lib --- application/libraries/Tax_lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/libraries/Tax_lib.php b/application/libraries/Tax_lib.php index 7713f62e4..6b1f987c7 100644 --- a/application/libraries/Tax_lib.php +++ b/application/libraries/Tax_lib.php @@ -31,12 +31,12 @@ class Tax_lib /* * Compute the tax basis and returns the tax amount */ - public function get_item_sales_tax($quantity, $price, $discount_percentage, $tax_percentage, $rounding_code) + public function get_item_sales_tax($quantity, $price, $discount_percentage, $discount_fixed, $tax_percentage, $rounding_code) { $decimals = tax_decimals(); // The tax basis should be returned at the currency scale - $tax_basis = $this->CI->sale_lib->get_item_total($quantity, $price, $discount_percentage, TRUE); + $tax_basis = $this->CI->sale_lib->get_item_total($quantity, $price, $discount_percentage, $discount_fixed, TRUE); return $this->get_sales_tax_for_amount($tax_basis, $tax_percentage, $rounding_code, $decimals); } @@ -223,7 +223,7 @@ class Tax_lib $decimals = tax_decimals(); // The tax basis should be returned at the currency scale - $tax_basis = $this->CI->sale_lib->get_item_total($item['quantity'], $item['price'], $item['discount'], TRUE); + $tax_basis = $this->CI->sale_lib->get_item_total($item['quantity'], $item['price'], $item['discount'], $item['discount_fixed'], TRUE); $tax_amount = $this->get_sales_tax_for_amount($tax_basis, $tax_rate, $rounding_code, $decimals); $tax_group = (float)$tax_rate . '% ' . $tax_category; From 26e33dddecfc52130815e5c8c35d64b2b9df2e48 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sat, 25 Aug 2018 16:03:07 +0100 Subject: [PATCH 153/568] Check FORCE_HTTPS env to be true, upgrade MariaDB vs in docker-compose --- application/config/config.php | 2 +- application/views/partial/header.php | 2 +- docker-compose.yml | 2 +- public/license/LICENSE | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/application/config/config.php b/application/config/config.php index 3a345c88d..bd72045ef 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -65,7 +65,7 @@ $config['db_log_enabled'] = FALSE; | a PHP script and you can easily do that on your own. | */ -$config['base_url'] = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || isset($_ENV['FORCE_HTTPS'])) ? 'https' : 'http'; +$config['base_url'] = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (isset($_ENV['FORCE_HTTPS']) && $_ENV['FORCE_HTTPS'] == 'true')) ? 'https' : 'http'; $config['base_url'] .= '://' . $_SERVER['HTTP_HOST']; $config['base_url'] .= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']); diff --git a/application/views/partial/header.php b/application/views/partial/header.php index dd8be8928..58fa5e7d2 100644 --- a/application/views/partial/header.php +++ b/application/views/partial/header.php @@ -75,7 +75,7 @@ - + diff --git a/docker-compose.yml b/docker-compose.yml index 8ebe12f8c..80421a0f6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -28,7 +28,7 @@ services: - MYSQL_HOST_NAME=mysql mysql: - image: mariadb:10.1.21 + image: mariadb:10.3.9 environment: - MYSQL_ROOT_PASSWORD=pointofsale - MYSQL_DATABASE=ospos diff --git a/public/license/LICENSE b/public/license/LICENSE index 882aae407..dcea0bfc2 100644 --- a/public/license/LICENSE +++ b/public/license/LICENSE @@ -18,6 +18,7 @@ Copyright (c) 2017 Deep Shah (aka deepshah) Copyright (c) 2017 Joshua Fernandez (aka joshua1234511) Copyright (c) 2017 odiea Copyright (c) 2017 asadjaved63 +Copyright (c) 2018 WebShells/Shady Sh Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in From a6b11e6f482bfb4641e14fb9e45bb484f71f15e1 Mon Sep 17 00:00:00 2001 From: Erastus Date: Fri, 31 Aug 2018 15:27:44 -0500 Subject: [PATCH 154/568] new discount on sales --- application/controllers/Config.php | 1 - application/controllers/Customers.php | 8 +- application/controllers/Receivings.php | 3 +- application/controllers/Reports.php | 10 +- application/controllers/Sales.php | 53 ++++------- application/language/en-US/config_lang.php | 2 +- application/language/en-US/customers_lang.php | 3 + .../language/en-US/receivings_lang.php | 2 +- application/language/en-US/reports_lang.php | 2 + application/language/es/config_lang.php | 3 +- application/language/es/customers_lang.php | 3 + application/language/es/receivings_lang.php | 2 +- application/libraries/Receiving_lib.php | 29 +++--- application/libraries/Sale_lib.php | 92 ++++++++----------- application/libraries/Tax_lib.php | 6 +- ...p => 20180820100000_discount_on_sales.php} | 4 +- .../migrations/sqlscripts/3.3.0_to_3.4.0.sql | 22 ----- .../sqlscripts/discount_on_sales.sql | 24 +++++ application/models/Customer.php | 5 +- application/models/Receiving.php | 13 ++- application/models/Sale.php | 24 ++--- .../models/reports/Detailed_receivings.php | 2 +- application/models/reports/Detailed_sales.php | 2 +- .../models/reports/Specific_discount.php | 17 ++-- .../models/reports/Specific_employee.php | 2 +- .../models/reports/Summary_discounts.php | 24 +++-- .../models/reports/Summary_payments.php | 2 +- application/models/reports/Summary_report.php | 2 +- application/models/reports/Summary_taxes.php | 8 +- application/views/configs/general_config.php | 37 +++----- application/views/customers/form.php | 48 ++++++---- application/views/receivings/receipt.php | 25 ++--- application/views/receivings/receiving.php | 30 +----- application/views/sales/invoice.php | 2 +- application/views/sales/invoice_email.php | 2 +- application/views/sales/quote.php | 2 +- application/views/sales/quote_email.php | 2 +- application/views/sales/receipt_default.php | 27 +++--- application/views/sales/receipt_email.php | 26 +++--- application/views/sales/receipt_short.php | 26 +++--- application/views/sales/register.php | 19 +--- application/views/sales/work_order.php | 2 +- application/views/sales/work_order_email.php | 2 +- import_customers.csv | 2 +- 44 files changed, 288 insertions(+), 334 deletions(-) rename application/migrations/{20180820100000_upgrade_to_3_4_0.php => 20180820100000_discount_on_sales.php} (61%) delete mode 100644 application/migrations/sqlscripts/3.3.0_to_3.4.0.sql create mode 100644 application/migrations/sqlscripts/discount_on_sales.sql diff --git a/application/controllers/Config.php b/application/controllers/Config.php index 673abf527..6bc838c7e 100644 --- a/application/controllers/Config.php +++ b/application/controllers/Config.php @@ -287,7 +287,6 @@ class Config extends Secure_Controller 'theme' => $this->input->post('theme'), 'default_sales_discount_type' => $this->input->post('default_sales_discount_type') != NULL, 'default_sales_discount' => $this->input->post('default_sales_discount'), - 'default_sales_discount_fixed' => $this->input->post('default_sales_discount_fixed'), 'enforce_privacy' => $this->input->post('enforce_privacy'), 'receiving_calculate_average_price' => $this->input->post('receiving_calculate_average_price') != NULL, 'lines_per_page' => $this->input->post('lines_per_page'), diff --git a/application/controllers/Customers.php b/application/controllers/Customers.php index 30b409c6d..68f0f5318 100644 --- a/application/controllers/Customers.php +++ b/application/controllers/Customers.php @@ -248,8 +248,8 @@ class Customers extends Persons 'consent' => $this->input->post('consent') != NULL, 'account_number' => $this->input->post('account_number') == '' ? NULL : $this->input->post('account_number'), 'company_name' => $this->input->post('company_name') == '' ? NULL : $this->input->post('company_name'), - 'discount_percent' => $this->input->post('discount_percent') == '' ? 0.00 : $this->input->post('discount_percent'), - 'discount_fixed' => $this->input->post('discount_fixed') == '' ? 0.00 : $this->input->post('discount_fixed'), + 'discount' => $this->input->post('discount') == '' ? 0.00 : $this->input->post('discount'), + 'discount_type' => $this->input->post('discount_type') == NULL ? PERCENT : $this->input->post('discount_type'), 'package_id' => $this->input->post('package_id') == '' ? NULL : $this->input->post('package_id'), 'taxable' => $this->input->post('taxable') != NULL, 'date' => $date_formatter->format('Y-m-d H:i:s'), @@ -404,8 +404,8 @@ class Customers extends Persons $customer_data = array( 'consent' => $consent, 'company_name' => $data[13], - 'discount_percent' => $data[15], - 'discount_fixed' => $data[16], + 'discount' => $data[15], + 'discount_type' => $data[16], 'taxable' => $data[17] == '' ? 0 : 1, 'date' => date('Y-m-d H:i:s'), 'employee_id' => $this->Employee->get_logged_in_employee_info()->person_id diff --git a/application/controllers/Receivings.php b/application/controllers/Receivings.php index ab77a5cfa..10eec315a 100644 --- a/application/controllers/Receivings.php +++ b/application/controllers/Receivings.php @@ -124,14 +124,13 @@ class Receivings extends Secure_Controller $price = parse_decimals($this->input->post('price')); $quantity = parse_decimals($this->input->post('quantity')); $discount = parse_decimals($this->input->post('discount')); - $discount_fixed = parse_decimals($this->input->post('discount_fixed')); $discount_type = parse_decimals($this->input->post('discount_type')); $item_location = $this->input->post('location'); $receiving_quantity = $this->input->post('receiving_quantity'); if($this->form_validation->run() != FALSE) { - $this->receiving_lib->edit_item($item_id, $description, $serialnumber, $quantity, $discount, $discount_fixed, $discount_type, $price, $receiving_quantity); + $this->receiving_lib->edit_item($item_id, $description, $serialnumber, $quantity, $discount, $discount_type, $price, $receiving_quantity); } else { diff --git a/application/controllers/Reports.php b/application/controllers/Reports.php index 703a3f521..3466d1ba3 100644 --- a/application/controllers/Reports.php +++ b/application/controllers/Reports.php @@ -884,7 +884,7 @@ class Reports extends Secure_Controller to_currency($drow['total']), to_currency($drow['cost']), to_currency($drow['profit']), - $drow['discount_percent'].'% | '.to_currency($drow['discount_fixed']))); + ($drow['discount_type'] == PERCENT)? $drow['discount'].'%':to_currency($drow['discount']))); } if(isset($report_data['rewards'][$key])) @@ -995,7 +995,7 @@ class Reports extends Secure_Controller to_currency($drow['total']), to_currency($drow['cost']), to_currency($drow['profit']), - $drow['discount_percent'].'% | '.to_currency($drow['discount_fixed']))); + ($drow['discount_type'] == PERCENT)? $drow['discount'].'%':to_currency($drow['discount']))); } if(isset($report_data['rewards'][$key])) @@ -1103,7 +1103,7 @@ class Reports extends Secure_Controller to_currency($drow['total']), to_currency($drow['cost']), to_currency($drow['profit']), - $drow['discount_percent'].'% | '.to_currency($drow['discount_fixed']))); + ($drow['discount_type'] == PERCENT)? $drow['discount'].'%':to_currency($drow['discount']))); } if(isset($report_data['rewards'][$key])) @@ -1256,7 +1256,7 @@ class Reports extends Secure_Controller to_currency($drow['total']), to_currency($drow['cost']), to_currency($drow['profit']), - $drow['discount_percent'].'% | '.to_currency($drow['discount_fixed']))); + ($drow['discount_type'] == PERCENT)? $drow['discount'].'%':to_currency($drow['discount']))); } if(isset($report_data['rewards'][$key])) @@ -1358,7 +1358,7 @@ class Reports extends Secure_Controller $drow['category'], $quantity_purchased, to_currency($drow['total']), - $drow['discount_percent'].'% | '.to_currency($drow['discount_fixed']))); + ($drow['discount_type'] == PERCENT)? $drow['discount'].'%':to_currency($drow['discount']))); } } diff --git a/application/controllers/Sales.php b/application/controllers/Sales.php index 32ea7350f..f157f45c0 100644 --- a/application/controllers/Sales.php +++ b/application/controllers/Sales.php @@ -136,13 +136,13 @@ class Sales extends Secure_Controller if($this->Customer->exists($customer_id)) { $this->sale_lib->set_customer($customer_id); - $discount_percent = $this->Customer->get_info($customer_id)->discount_percent; - $discount_fixed = $this->Customer->get_info($customer_id)->discount_fixed; + $discount = $this->Customer->get_info($customer_id)->discount; + $discount_type = $this->Customer->get_info($customer_id)->discount_type; // apply customer default discount to items that have 0 discount - if($discount_percent != '' OR $discount_fixed != '') + if($discount != '') { - $this->sale_lib->apply_customer_discount($discount_percent, $discount_fixed); + $this->sale_lib->apply_customer_discount($discount, $discount_type); } } @@ -368,7 +368,6 @@ class Sales extends Secure_Controller $data = array(); $discount = 0; - $discount_fixed = 0; $discount_type = $this->config->item('default_sales_discount_type'); // check if any discount is assigned to the selected customer @@ -376,18 +375,12 @@ class Sales extends Secure_Controller if($customer_id != -1) { // load the customer discount if any - $discount_percent = $this->Customer->get_info($customer_id)->discount_percent; - $discount_cash = $this->Customer->get_info($customer_id)->discount_fixed; - if($discount_percent != '') + $customer_discount = $this->Customer->get_info($customer_id)->discount; + $customer_discount_type = $this->Customer->get_info($customer_id)->discount_type; + if($customer_discount != '') { - $discount = $discount_percent; - $discount_type = 0; - } - - if($discount_cash != '') - { - $discount_fixed = $discount_cash; - $discount_type = 1; + $discount = $customer_discount; + $discount_type = $customer_discount_type; } } @@ -397,11 +390,6 @@ class Sales extends Secure_Controller $discount = $this->config->item('default_sales_discount'); } - if($discount_fixed == 0) - { - $discount_fixed = $this->config->item('default_sales_discount_fixed'); - } - $item_id_or_number_or_item_kit_or_receipt = $this->input->post('item'); $this->barcode_lib->parse_barcode_fields($quantity, $item_id_or_number_or_item_kit_or_receipt); $mode = $this->sale_lib->get_mode(); @@ -422,14 +410,10 @@ class Sales extends Secure_Controller $kit_price_option = $item_kit_info->price_option; $kit_print_option = $item_kit_info->print_option; // 0-all, 1-priced, 2-kit-only - if($item_kit_info->kit_discount_percent != 0 && $item_kit_info->kit_discount_percent > $discount) + if($item_kit_info->kit_discount != 0 && $item_kit_info->kit_discount > $discount) { - $discount = $item_kit_info->kit_discount_percent; - } - - if($item_kit_info->kit_discount_fixed != 0 && $item_kit_info->kit_discount_fixed > $discount_fixed) - { - $discount_fixed = $item_kit_info->kit_discount_fixed; + $discount = $item_kit_info->kit_discount; + $discount_type = $item_kit_info->discount_type; } $price = NULL; @@ -437,7 +421,7 @@ class Sales extends Secure_Controller if(!empty($kit_item_id)) { - if(!$this->sale_lib->add_item($kit_item_id, $quantity, $item_location, $discount, $discount_fixed, $discount_type, PRICE_MODE_STANDARD)) + if(!$this->sale_lib->add_item($kit_item_id, $quantity, $item_location, $discount, $discount_type, PRICE_MODE_STANDARD)) { $data['error'] = $this->lang->line('sales_unable_to_add_item'); } @@ -449,7 +433,7 @@ class Sales extends Secure_Controller // Add item kit items to order $stock_warning = NULL; - if(!$this->sale_lib->add_item_kit($item_id_or_number_or_item_kit_or_receipt, $item_location, $discount, $discount_fixed, $discount_type, $kit_price_option, $kit_print_option, $stock_warning)) + if(!$this->sale_lib->add_item_kit($item_id_or_number_or_item_kit_or_receipt, $item_location, $discount, $discount_type, $kit_price_option, $kit_print_option, $stock_warning)) { $data['error'] = $this->lang->line('sales_unable_to_add_item'); } @@ -460,7 +444,7 @@ class Sales extends Secure_Controller } else { - if(!$this->sale_lib->add_item($item_id_or_number_or_item_kit_or_receipt, $quantity, $item_location, $discount, $discount_fixed, $discount_type, PRICE_MODE_STANDARD)) + if(!$this->sale_lib->add_item($item_id_or_number_or_item_kit_or_receipt, $quantity, $item_location, $discount, $discount_type, PRICE_MODE_STANDARD)) { $data['error'] = $this->lang->line('sales_unable_to_add_item'); } @@ -479,14 +463,12 @@ class Sales extends Secure_Controller $this->form_validation->set_rules('price', 'lang:sales_price', 'required|callback_numeric'); $this->form_validation->set_rules('quantity', 'lang:sales_quantity', 'required|callback_numeric'); $this->form_validation->set_rules('discount', 'lang:sales_discount', 'required|callback_numeric'); - $this->form_validation->set_rules('discount_fixed', 'lang:sales_discount', 'required|callback_numeric'); $description = $this->input->post('description'); $serialnumber = $this->input->post('serialnumber'); $price = parse_decimals($this->input->post('price')); $quantity = parse_decimals($this->input->post('quantity')); $discount = parse_decimals($this->input->post('discount')); - $discount_fixed = parse_decimals($this->input->post('discount_fixed')); $discount_type = $this->input->post('discount_type'); $item_location = $this->input->post('location'); @@ -494,7 +476,7 @@ class Sales extends Secure_Controller if($this->form_validation->run() != FALSE) { - $this->sale_lib->edit_item($item_id, $description, $serialnumber, $quantity, $discount, $discount_fixed, $discount_type, $price, $discounted_total); + $this->sale_lib->edit_item($item_id, $description, $serialnumber, $quantity, $discount, $discount_type, $price, $discounted_total); } else { @@ -886,7 +868,8 @@ class Sales extends Secure_Controller $data['customer_location'] = ''; } $data['customer_account_number'] = $customer_info->account_number; - $data['customer_discount_percent'] = $customer_info->discount_percent; + $data['customer_discount'] = $customer_info->discount; + $data['customer_discount_type'] = $customer_info->discount_type; $package_id = $this->Customer->get_info($customer_id)->package_id; if($package_id != NULL) { diff --git a/application/language/en-US/config_lang.php b/application/language/en-US/config_lang.php index a1ac16e7b..c8ac08139 100644 --- a/application/language/en-US/config_lang.php +++ b/application/language/en-US/config_lang.php @@ -78,7 +78,7 @@ $lang["config_default_barcode_page_width_required"] = "Default Barcode Page Widt $lang["config_default_barcode_width_number"] = "Default Barcode Width must be a number."; $lang["config_default_barcode_width_required"] = "Default Barcode Width is a required field."; $lang["config_default_origin_tax_code"] = "Default Origin Tax Code"; -$lang["config_default_sales_discount"] = "Default Sales Discount %"; +$lang["config_default_sales_discount"] = "Default Sales Discount"; $lang["config_default_sales_discount_number"] = "Default Sales Discount must be a number."; $lang["config_default_sales_discount_required"] = "Default Sales Discount is a required field."; $lang["config_default_tax_name_number"] = "Default Tax Name must be a string."; diff --git a/application/language/en-US/customers_lang.php b/application/language/en-US/customers_lang.php index 8f3d9f26f..c98bbdcc6 100644 --- a/application/language/en-US/customers_lang.php +++ b/application/language/en-US/customers_lang.php @@ -48,3 +48,6 @@ $lang["customers_taxable"] = "Taxable"; $lang["customers_total"] = "Total spent"; $lang["customers_update"] = "Update Customer"; $lang["rewards_package"] = "Rewards Package"; +$lang["customers_discount_type"] = "Discount Type"; +$lang["customers_discount_fixed"] = "Fixed Discount"; +$lang["customers_discount_percent"] = "Percentage Discount"; \ No newline at end of file diff --git a/application/language/en-US/receivings_lang.php b/application/language/en-US/receivings_lang.php index 0f4138555..ee234e76a 100644 --- a/application/language/en-US/receivings_lang.php +++ b/application/language/en-US/receivings_lang.php @@ -12,7 +12,7 @@ $lang["receivings_date"] = "Receiving Date"; $lang["receivings_date_required"] = "A correct date must be entered."; $lang["receivings_date_type"] = "Date is a required field."; $lang["receivings_delete_entire_sale"] = "Delete Entire Sale"; -$lang["receivings_discount"] = "Discount %"; +$lang["receivings_discount"] = "Discount"; $lang["receivings_edit"] = "Edit"; $lang["receivings_edit_sale"] = "Edit Receiving"; $lang["receivings_employee"] = "Employee"; diff --git a/application/language/en-US/reports_lang.php b/application/language/en-US/reports_lang.php index 4563efcb4..8d03ffa46 100644 --- a/application/language/en-US/reports_lang.php +++ b/application/language/en-US/reports_lang.php @@ -123,3 +123,5 @@ $lang["reports_unit_price"] = "Retail Price"; $lang["reports_used"] = "Points Used"; $lang["reports_work_orders"] = "Work Orders"; $lang["reports_zero_and_less"] = "Zero and less"; +$lang["reports_discount_type"] = "Discount Type"; +$lang["reports_discount_fixed"] = "Fixed Discount"; \ No newline at end of file diff --git a/application/language/es/config_lang.php b/application/language/es/config_lang.php index f23f04eba..c16e03c01 100644 --- a/application/language/es/config_lang.php +++ b/application/language/es/config_lang.php @@ -78,7 +78,7 @@ $lang["config_default_barcode_page_width_required"] = "Ancho de página del cód $lang["config_default_barcode_width_number"] = "Ancho del código de barras debe ser número."; $lang["config_default_barcode_width_required"] = "Ancho del código de barras es requerido."; $lang["config_default_origin_tax_code"] = "Código de impuesto por defecto"; -$lang["config_default_sales_discount"] = "% de Descuento en Ventas predeterminado"; +$lang["config_default_sales_discount"] = "Descuento en Ventas predeterminado"; $lang["config_default_sales_discount_number"] = "Descuento en ventas predeterminado debe ser un número."; $lang["config_default_sales_discount_required"] = "Descuento en ventas predeterminado es requerido."; $lang["config_default_tax_name_number"] = "El nombre de el impuesto debe ser letras."; @@ -271,4 +271,3 @@ $lang["config_top"] = "Arriba"; $lang["config_website"] = "Sitio Web"; $lang["config_work_order_enable"] = "Soporte Ordenes de Trabajo"; $lang["config_work_order_format"] = "Formato Ordenes de trabajo"; -$lang["config_default_sales_discount_type"] = "Descuento Fijo en Ventas predeterminado"; \ No newline at end of file diff --git a/application/language/es/customers_lang.php b/application/language/es/customers_lang.php index b91aaeb99..86dd81f9c 100644 --- a/application/language/es/customers_lang.php +++ b/application/language/es/customers_lang.php @@ -48,3 +48,6 @@ $lang["customers_taxable"] = "Gravable"; $lang["customers_total"] = "Total"; $lang["customers_update"] = "Actualizar Cliente"; $lang["rewards_package"] = "Paquete de premios"; +$lang["customers_discount_type"] = "Tipo de Descuento"; +$lang["customers_discount_fixed"] = "Descuento Fijo"; +$lang["customers_discount_percent"] = "Descuento en Porcentaje"; diff --git a/application/language/es/receivings_lang.php b/application/language/es/receivings_lang.php index c64755aed..b9f5227d4 100644 --- a/application/language/es/receivings_lang.php +++ b/application/language/es/receivings_lang.php @@ -12,7 +12,7 @@ $lang["receivings_date"] = "Fecha de Recepción"; $lang["receivings_date_required"] = "Una fecha correcta debe ser ingresada."; $lang["receivings_date_type"] = "Campo Fecha es requerido."; $lang["receivings_delete_entire_sale"] = "Borrar venta completa"; -$lang["receivings_discount"] = "Descuento %"; +$lang["receivings_discount"] = "Descuento"; $lang["receivings_edit"] = "Editar"; $lang["receivings_edit_sale"] = "Editar Recepción"; $lang["receivings_employee"] = "Empleado"; diff --git a/application/libraries/Receiving_lib.php b/application/libraries/Receiving_lib.php index 5e78c9df3..218cc1242 100644 --- a/application/libraries/Receiving_lib.php +++ b/application/libraries/Receiving_lib.php @@ -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, $discount_fixed = 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, $include_deleted = FALSE) { //make sure item exists in database. if(!$this->CI->Item->exists($item_id, $include_deleted)) @@ -242,13 +242,12 @@ class Receiving_lib 'is_serialized' => $item_info->is_serialized, 'quantity' => $quantity, 'discount' => $discount, - 'discount_fixed' => $discount_fixed, 'discount_type' => $discount_type, 'in_stock' => $this->CI->Item_quantity->get_item_quantity($item_id, $item_location)->quantity, 'price' => $price, 'receiving_quantity' => $receiving_quantity, 'receiving_quantity_choices' => $receiving_quantity_choices, - 'total' => $this->get_item_total($quantity, $price, $discount, $discount_fixed, $receiving_quantity) + 'total' => $this->get_item_total($quantity, $price, $discount, $discount_type, $receiving_quantity) ) ); @@ -256,7 +255,7 @@ class Receiving_lib if($itemalreadyinsale) { $items[$updatekey]['quantity'] += $quantity; - $items[$updatekey]['total'] = $this->get_item_total($items[$updatekey]['quantity'], $price, $discount, $discount_fixed, $items[$updatekey]['receiving_quantity']); + $items[$updatekey]['total'] = $this->get_item_total($items[$updatekey]['quantity'], $price, $discount, $discount_type, $items[$updatekey]['receiving_quantity']); } else { @@ -269,7 +268,7 @@ class Receiving_lib return TRUE; } - public function edit_item($line, $description, $serialnumber, $quantity, $discount, $discount_fixed, $discount_type, $price, $receiving_quantity) + public function edit_item($line, $description, $serialnumber, $quantity, $discount, $discount_type, $price, $receiving_quantity) { $items = $this->get_cart(); if(isset($items[$line])) @@ -280,12 +279,11 @@ class Receiving_lib $line['quantity'] = $quantity; $line['receiving_quantity'] = $receiving_quantity; $line['discount'] = $discount; - $line['discount_fixed'] = $discount_fixed; if(!is_null($discount_type)){ $line['discount_type'] = $discount_type; } $line['price'] = $price; - $line['total'] = $this->get_item_total($quantity, $price, $discount, $discount_fixed, $receiving_quantity); + $line['total'] = $this->get_item_total($quantity, $price, $discount, $discount_type, $receiving_quantity); $this->set_cart($items); } @@ -318,7 +316,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_percent, $row->discount_fixed, $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, TRUE); } $this->set_supplier($this->CI->Receiving->get_supplier($receiving_id)->person_id); @@ -343,7 +341,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_percent, $row->discount_fixed, $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, TRUE); } $this->set_supplier($this->CI->Receiving->get_supplier($receiving_id)->person_id); @@ -359,12 +357,17 @@ class Receiving_lib $this->clear_reference(); } - public function get_item_total($quantity, $price, $discount_percentage, $discount_fixed, $receiving_quantity) + public function get_item_total($quantity, $price, $discount, $discount_type, $receiving_quantity) { $extended_quantity = bcmul($quantity, $receiving_quantity); $total = bcmul($extended_quantity, $price); - $discount_fraction = bcdiv($discount_percentage, 100); - $discount_amount = bcadd(bcmul($total, $discount_fraction), $discount_fixed); + $discount_amount = $discount; + if($discount_type == PERCENT) + { + $discount_fraction = bcdiv($discount, 100); + $discount_amount = bcmul($total, $discount_fraction); + } + return bcsub($total, $discount_amount); } @@ -374,7 +377,7 @@ class Receiving_lib $total = 0; foreach($this->get_cart() as $item) { - $total = bcadd($total, $this->get_item_total(($item['quantity']), $item['price'], $item['discount'], $item['discount_fixed'], $item['receiving_quantity'])); + $total = bcadd($total, $this->get_item_total(($item['quantity']), $item['price'], $item['discount'], $item['discount_type'], $item['receiving_quantity'])); } return $total; diff --git a/application/libraries/Sale_lib.php b/application/libraries/Sale_lib.php index e1ee8a512..528459fa6 100644 --- a/application/libraries/Sale_lib.php +++ b/application/libraries/Sale_lib.php @@ -450,7 +450,7 @@ class Sale_lib $item_count++; $total_units += $item['quantity']; } - $discount_amount = $this->get_item_discount($item['quantity'], $item['price'], $item['discount'], $item['discount_fixed']); + $discount_amount = $this->get_item_discount($item['quantity'], $item['price'], $item['discount'], $item['discount_type']); $total_discount = bcadd($total_discount, $discount_amount); $extended_amount = $this->get_extended_amount($item['quantity'], $item['price']); @@ -460,7 +460,7 @@ class Sale_lib if($this->CI->config->item('tax_included')) { - $subtotal = bcadd($subtotal, $this->get_extended_total_tax_exclusive($item['item_id'], $extended_discounted_amount, $item['quantity'], $item['price'], $item['discount'],$item['discount_fixed'])); + $subtotal = bcadd($subtotal, $this->get_extended_total_tax_exclusive($item['item_id'], $extended_discounted_amount, $item['quantity'], $item['price'], $item['discount'],$item['discount_type'])); } else { @@ -696,7 +696,7 @@ class Sale_lib $this->CI->session->unset_userdata('sales_rewards_remainder'); } - public function add_item(&$item_id, $quantity = 1, $item_location, $discount = 0, $discount_fixed = 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, $include_deleted = FALSE, $print_option = NULL ) { $item_info = $this->CI->Item->get_info_by_id_or_number($item_id); @@ -753,7 +753,6 @@ class Sale_lib if($price == 0.00) { $discount = 0.00; - $discount_fixed = 0.00; } // Serialization and Description @@ -826,8 +825,8 @@ class Sale_lib } } - $total = $this->get_item_total($quantity, $price, $discount, $discount_fixed); - $discounted_total = $this->get_item_total($quantity, $price, $discount, $discount_fixed, TRUE); + $total = $this->get_item_total($quantity, $price, $discount, $discount_type); + $discounted_total = $this->get_item_total($quantity, $price, $discount, $discount_type, TRUE); if($this->CI->config->item('multi_pack_enabled') == '1') { @@ -851,7 +850,6 @@ class Sale_lib 'is_serialized' => $item_info->is_serialized, 'quantity' => $quantity, 'discount' => $discount, - 'discount_fixed' => $discount_fixed, 'discount_type' => $discount_type, 'in_stock' => $this->CI->Item_quantity->get_item_quantity($item_id, $item_location)->quantity, 'price' => $price, @@ -936,7 +934,7 @@ class Sale_lib return -1; } - public function edit_item($line, $description, $serialnumber, $quantity, $discount, $discount_fixed, $discount_type, $price, $discounted_total=NULL) + public function edit_item($line, $description, $serialnumber, $quantity, $discount, $discount_type, $price, $discounted_total=NULL) { $items = $this->get_cart(); if(isset($items[$line])) @@ -951,13 +949,12 @@ class Sale_lib $line['serialnumber'] = $serialnumber; $line['quantity'] = $quantity; $line['discount'] = $discount; - $line['discount_fixed'] = $discount_fixed; if(!is_null($discount_type)){ $line['discount_type'] = $discount_type; } $line['price'] = $price; - $line['total'] = $this->get_item_total($quantity, $price, $discount, $discount_fixed); - $line['discounted_total'] = $this->get_item_total($quantity, $price, $discount, $discount_fixed, TRUE); + $line['total'] = $this->get_item_total($quantity, $price, $discount, $line['discount_type']); + $line['discounted_total'] = $this->get_item_total($quantity, $price, $discount, $line['discount_type'], TRUE); $this->set_cart($items); } @@ -988,13 +985,13 @@ 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_percent, $row->discount_fixed, $row->discount_type, PRICE_MODE_STANDARD, NULL, NULL, $row->item_unit_price, $row->description, $row->serialnumber, TRUE); + $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); } $this->set_customer($this->CI->Sale->get_customer($sale_id)->person_id); } - public function add_item_kit($external_item_kit_id, $item_location, $discount, $discount_fixed, $discount_type, $kit_price_option, $kit_print_option, &$stock_warning) + public function add_item_kit($external_item_kit_id, $item_location, $discount, $discount_type, $kit_price_option, $kit_print_option, &$stock_warning) { //KIT # $pieces = explode(' ', $external_item_kit_id); @@ -1003,7 +1000,7 @@ class Sale_lib foreach($this->CI->Item_kit_items->get_info($item_kit_id) as $item_kit_item) { - $result &= $this->add_item($item_kit_item['item_id'], $item_kit_item['quantity'], $item_location, $discount, $discount_fixed, $discount_type, PRICE_MODE_KIT, $kit_price_option, $kit_print_option, NULL, NULL, NULL, NULL); + $result &= $this->add_item($item_kit_item['item_id'], $item_kit_item['quantity'], $item_location, $discount, $discount_type, PRICE_MODE_KIT, $kit_price_option, $kit_print_option, NULL, NULL, NULL, NULL); if($stock_warning == NULL) { @@ -1021,7 +1018,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_percent, $row->discount_fixed, $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, TRUE, $row->print_option); } foreach($this->CI->Sale->get_sale_payments($sale_id)->result() as $row) @@ -1049,7 +1046,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_percent, $row->discount_fixed, $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, TRUE, $row->print_option); } return $this->CI->session->userdata('sales_cart'); @@ -1134,12 +1131,12 @@ class Sale_lib // This computes tax for each line item and adds it to the tax type total $tax_group = (float)$tax['percent'] . '% ' . $tax['name']; $tax_type = Tax_lib::TAX_TYPE_VAT; - $tax_basis = $this->get_item_total($item['quantity'], $item['price'], $item['discount'], $item['discount_fixed'], TRUE); + $tax_basis = $this->get_item_total($item['quantity'], $item['price'], $item['discount'], $item['discount_type'], TRUE); $tax_amount = 0; if($this->CI->config->item('tax_included')) { - $tax_amount = $this->get_item_tax($item['quantity'], $item['price'], $item['discount'], $item['discount_fixed'], $tax['percent']); + $tax_amount = $this->get_item_tax($item['quantity'], $item['price'], $item['discount'], $item['discount_type'], $tax['percent']); } elseif($this->CI->config->item('customer_sales_tax_support') == '0') { @@ -1173,7 +1170,7 @@ class Sale_lib return $sales_taxes; } - public function apply_customer_discount($discount_percent, $discount_fixed) + public function apply_customer_discount($discount, $discount_type) { // Get all items in the cart so far... $items = $this->get_cart(); @@ -1186,18 +1183,9 @@ class Sale_lib // set a new discount only if the current one is 0 if($item['discount'] == 0) { - $item['discount'] = $discount_percent; - $item['discount_fixed'] = $discount_fixed; - $item['total'] = $this->get_item_total($quantity, $price, $discount_percent, $discount_fixed); - $item['discounted_total'] = $this->get_item_total($quantity, $price, $discount_percent, $discount_fixed, TRUE); - } - - if($item['discount_fixed'] == 0) - { - $item['discount'] = $discount_percent; - $item['discount_fixed'] = $discount_fixed; - $item['total'] = $this->get_item_total($quantity, $price, $discount_percent, $discount_fixed); - $item['discounted_total'] = $this->get_item_total($quantity, $price, $discount_percent, $discount_fixed, TRUE); + $item['discount'] = $discount; + $item['total'] = $this->get_item_total($quantity, $price, $discount, $discount_type); + $item['discounted_total'] = $this->get_item_total($quantity, $price, $discount, $discount_type, TRUE); } } @@ -1211,13 +1199,7 @@ class Sale_lib { if($item['discount'] > 0) { - $item_discount = $this->get_item_discount($item['quantity'], $item['price'], $item['discount'], $item['discount_fixed']); - $discount = bcadd($discount, $item_discount); - } - - if($item['discount_fixed'] > 0) - { - $item_discount = $this->get_item_discount($item['quantity'], $item['price'], $item['discount'], $item['discount_fixed']); + $item_discount = $this->get_item_discount($item['quantity'], $item['price'], $item['discount'], $item['discount_type']); $discount = bcadd($discount, $item_discount); } } @@ -1230,39 +1212,39 @@ class Sale_lib return $this->calculate_subtotal($include_discount, $exclude_tax); } - public function get_item_total_tax_exclusive($item_id, $quantity, $price, $discount_percentage, $discount_fixed, $include_discount = FALSE) + public function get_item_total_tax_exclusive($item_id, $quantity, $price, $discount, $discount_type, $include_discount = FALSE) { $tax_info = $this->CI->Item_taxes->get_info($item_id); - $item_total = $this->get_item_total($quantity, $price, $discount_percentage, $discount_fixed, $include_discount); + $item_total = $this->get_item_total($quantity, $price, $discount, $discount_type, $include_discount); // only additive tax here foreach($tax_info as $tax) { $tax_percentage = $tax['percent']; - $item_total = bcsub($item_total, $this->get_item_tax($quantity, $price, $discount_percentage, $discount_fixed, $tax_percentage)); + $item_total = bcsub($item_total, $this->get_item_tax($quantity, $price, $discount, $discount_type, $tax_percentage)); } return $item_total; } - public function get_extended_total_tax_exclusive($item_id, $discounted_extended_amount, $quantity, $price, $discount_percentage = 0, $discount_fixed = 0) + public function get_extended_total_tax_exclusive($item_id, $discounted_extended_amount, $quantity, $price, $discount = 0, $discount_type = 0) { $tax_info = $this->CI->Item_taxes->get_info($item_id); // only additive tax here foreach($tax_info as $tax) { $tax_percentage = $tax['percent']; - $discounted_extended_amount = bcsub($discounted_extended_amount, $this->get_item_tax($quantity, $price, $discount_percentage, $discount_fixed, $tax_percentage)); + $discounted_extended_amount = bcsub($discounted_extended_amount, $this->get_item_tax($quantity, $price, $discount, $discount_type, $tax_percentage)); } return $discounted_extended_amount; } - public function get_item_total($quantity, $price, $discount_percentage, $discount_fixed, $include_discount = FALSE) + public function get_item_total($quantity, $price, $discount, $discount_type, $include_discount = FALSE) { $total = bcmul($quantity, $price); if($include_discount) { - $discount_amount = $this->get_item_discount($quantity, $price, $discount_percentage, $discount_fixed); + $discount_amount = $this->get_item_discount($quantity, $price, $discount, $discount_type); return bcsub($total, $discount_amount); } @@ -1291,17 +1273,21 @@ class Sale_lib return bcsub($extended_amount, $discount_amount); } - public function get_item_discount($quantity, $price, $discount_percentage, $discount_fixed) + public function get_item_discount($quantity, $price, $discount, $discount_type) { $total = bcmul($quantity, $price); - $discount_fraction = bcdiv($discount_percentage, 100); - - return round(bcadd(bcmul($total, $discount_fraction),$discount_fixed), totals_decimals(), PHP_ROUND_HALF_UP); + if($discount_type == PERCENT) + { + $discount_fraction = bcdiv($discount, 100); + $discount=bcmul($total,$discount_fraction); + } + + return round($discount, totals_decimals(), PHP_ROUND_HALF_UP); } - public function get_item_tax($quantity, $price, $discount_percentage, $discount_fixed, $tax_percentage) + public function get_item_tax($quantity, $price, $discount, $discount_type, $tax_percentage) { - $price = $this->get_item_total($quantity, $price, $discount_percentage, $discount_fixed, TRUE); + $price = $this->get_item_total($quantity, $price, $discount, $discount_type, TRUE); if($this->CI->config->item('tax_included')) { $tax_fraction = bcadd(100, $tax_percentage); @@ -1322,11 +1308,11 @@ class Sale_lib { if($exclude_tax && $this->CI->config->item('tax_included')) { - $subtotal = bcadd($subtotal, $this->get_item_total_tax_exclusive($item['item_id'], $item['quantity'], $item['price'], $item['discount'], $item['discount_fixed'], $include_discount)); + $subtotal = bcadd($subtotal, $this->get_item_total_tax_exclusive($item['item_id'], $item['quantity'], $item['price'], $item['discount'], $item['discount_type'], $include_discount)); } else { - $subtotal = bcadd($subtotal, $this->get_item_total($item['quantity'], $item['price'], $item['discount'], $item['discount_fixed'], $include_discount)); + $subtotal = bcadd($subtotal, $this->get_item_total($item['quantity'], $item['price'], $item['discount'], $item['discount_type'], $include_discount)); } } diff --git a/application/libraries/Tax_lib.php b/application/libraries/Tax_lib.php index 6b1f987c7..e36758b3a 100644 --- a/application/libraries/Tax_lib.php +++ b/application/libraries/Tax_lib.php @@ -31,12 +31,12 @@ class Tax_lib /* * Compute the tax basis and returns the tax amount */ - public function get_item_sales_tax($quantity, $price, $discount_percentage, $discount_fixed, $tax_percentage, $rounding_code) + public function get_item_sales_tax($quantity, $price, $discount, $discount_type, $tax_percentage, $rounding_code) { $decimals = tax_decimals(); // The tax basis should be returned at the currency scale - $tax_basis = $this->CI->sale_lib->get_item_total($quantity, $price, $discount_percentage, $discount_fixed, TRUE); + $tax_basis = $this->CI->sale_lib->get_item_total($quantity, $price, $discount, $discount_type, TRUE); return $this->get_sales_tax_for_amount($tax_basis, $tax_percentage, $rounding_code, $decimals); } @@ -223,7 +223,7 @@ class Tax_lib $decimals = tax_decimals(); // The tax basis should be returned at the currency scale - $tax_basis = $this->CI->sale_lib->get_item_total($item['quantity'], $item['price'], $item['discount'], $item['discount_fixed'], TRUE); + $tax_basis = $this->CI->sale_lib->get_item_total($item['quantity'], $item['price'], $item['discount'], $item['discount_type'], TRUE); $tax_amount = $this->get_sales_tax_for_amount($tax_basis, $tax_rate, $rounding_code, $decimals); $tax_group = (float)$tax_rate . '% ' . $tax_category; diff --git a/application/migrations/20180820100000_upgrade_to_3_4_0.php b/application/migrations/20180820100000_discount_on_sales.php similarity index 61% rename from application/migrations/20180820100000_upgrade_to_3_4_0.php rename to application/migrations/20180820100000_discount_on_sales.php index 677bad041..d0c6e401a 100644 --- a/application/migrations/20180820100000_upgrade_to_3_4_0.php +++ b/application/migrations/20180820100000_discount_on_sales.php @@ -1,6 +1,6 @@ db->dbprefix('sales') . ' AS sales INNER JOIN ' . $this->db->dbprefix('sales_items') . ' AS sales_items @@ -252,7 +252,8 @@ class Customer extends Person 'company_name' => NULL, 'account_number' => NULL, 'taxable' => 0, - 'discount_percent' => 0.00, + 'discount' => 0.00, + 'discount_type' => 0, 'package_id' => NULL, 'points' => NULL, 'sales_tax_code' => 1, diff --git a/application/models/Receiving.php b/application/models/Receiving.php index 4e1402e8c..b9c87047a 100644 --- a/application/models/Receiving.php +++ b/application/models/Receiving.php @@ -93,8 +93,7 @@ class Receiving extends CI_Model 'serialnumber' => $item['serialnumber'], 'quantity_purchased' => $item['quantity'], 'receiving_quantity' => $item['receiving_quantity'], - 'discount_percent' => $item['discount'], - 'discount_fixed' => $item['discount_fixed'], + 'discount' => $item['discount'], 'discount_type' => $item['discount_type'], 'item_cost_price' => $cur_item_info->cost_price, 'item_unit_price' => $item['price'], @@ -267,14 +266,14 @@ class Receiving extends CI_Model MAX(receivings_items.receiving_quantity) AS receiving_quantity, MAX(item_cost_price) AS item_cost_price, MAX(item_unit_price) AS item_unit_price, - MAX(discount_percent) AS discount_percent, - MAX(discount_fixed) AS discount_fixed, + MAX(discount) AS discount, + discount_type as discount_type, receivings_items.line, MAX(serialnumber) AS serialnumber, MAX(receivings_items.description) AS description, - MAX(item_unit_price * quantity_purchased * receivings_items.receiving_quantity - item_unit_price * quantity_purchased * receivings_items.receiving_quantity * discount_percent / 100) - discount_fixed AS subtotal, - MAX(item_unit_price * quantity_purchased * receivings_items.receiving_quantity - item_unit_price * quantity_purchased * receivings_items.receiving_quantity * discount_percent / 100) - discount_fixed AS total, - MAX((item_unit_price * quantity_purchased * receivings_items.receiving_quantity - item_unit_price * quantity_purchased * receivings_items.receiving_quantity * discount_percent / 100) - discount_fixed - (item_cost_price * quantity_purchased)) AS profit, + MAX(CASE WHEN receivings_items.discount_type = ' . PERCENT . ' THEN item_unit_price * quantity_purchased * receivings_items.receiving_quantity - item_unit_price * quantity_purchased * receivings_items.receiving_quantity * discount / 100 ELSE item_unit_price * quantity_purchased * receivings_items.receiving_quantity - discount END) AS subtotal, + MAX(CASE WHEN receivings_items.discount_type = ' . PERCENT . ' THEN item_unit_price * quantity_purchased * receivings_items.receiving_quantity - item_unit_price * quantity_purchased * receivings_items.receiving_quantity * discount / 100 ELSE item_unit_price * quantity_purchased * receivings_items.receiving_quantity - discount END) AS total, + MAX((CASE WHEN receivings_items.discount_type = ' . PERCENT . ' THEN item_unit_price * quantity_purchased * receivings_items.receiving_quantity - item_unit_price * quantity_purchased * receivings_items.receiving_quantity * discount / 100 ELSE item_unit_price * quantity_purchased * receivings_items.receiving_quantity - discount END) - (item_cost_price * quantity_purchased)) AS profit, MAX(item_cost_price * quantity_purchased * receivings_items.receiving_quantity ) AS cost FROM ' . $this->db->dbprefix('receivings_items') . ' AS receivings_items INNER JOIN ' . $this->db->dbprefix('receivings') . ' AS receivings diff --git a/application/models/Sale.php b/application/models/Sale.php index 65afec976..6a19f7fba 100644 --- a/application/models/Sale.php +++ b/application/models/Sale.php @@ -10,6 +10,8 @@ define('SALE_TYPE_WORK_ORDER', 2); define('SALE_TYPE_QUOTE', 3); define('SALE_TYPE_RETURN', 4); +define('PERCENT', 0); +define('FIXED', 1); /** * Sale class */ @@ -38,7 +40,7 @@ class Sale extends CI_Model $decimals = totals_decimals(); - $sale_price = 'sales_items.item_unit_price * sales_items.quantity_purchased * (1 - sales_items.discount_percent / 100)-sales_items.discount_fixed'; + $sale_price = 'CASE WHEN sales_items.discount_type = ' . PERCENT . ' THEN sales_items.item_unit_price * sales_items.quantity_purchased * (1 - sales_items.discount / 100) ELSE sales_items.item_unit_price * sales_items.quantity_purchased - sales_items.discount END'; $tax = 'ROUND(IFNULL(SUM(sales_items_taxes.tax), 0), ' . $decimals . ')'; if($this->config->item('tax_included')) @@ -152,7 +154,7 @@ class Sale extends CI_Model $decimals = totals_decimals(); - $sale_price = 'sales_items.item_unit_price * sales_items.quantity_purchased * (1 - sales_items.discount_percent / 100)-sales_items.discount_fixed'; + $sale_price = 'CASE WHEN sales_items.discount_type = ' . PERCENT . ' THEN sales_items.item_unit_price * sales_items.quantity_purchased * (1 - sales_items.discount / 100) ELSE sales_items.item_unit_price * sales_items.quantity_purchased - sales_items.discount END'; $sale_cost = 'SUM(sales_items.item_cost_price * sales_items.quantity_purchased)'; $tax = 'IFNULL(SUM(sales_items_taxes.tax), 0)'; @@ -652,8 +654,7 @@ class Sale extends CI_Model 'description' => character_limiter($item['description'], 255), 'serialnumber' => character_limiter($item['serialnumber'], 30), 'quantity_purchased'=> $item['quantity'], - 'discount_percent' => $item['discount'], - 'discount_fixed' => $item['discount_fixed'], + 'discount' => $item['discount'], 'discount_type' => $item['discount_type'], 'item_cost_price' => $item['cost_price'], 'item_unit_price' => $item['price'], @@ -705,7 +706,7 @@ class Sale extends CI_Model } $rounding_code = Rounding_mode::HALF_UP; // half adjust $tax_group_sequence = 0; - $item_total = $this->sale_lib->get_item_total($item['quantity'], $item['price'], $item['discount'], TRUE); + $item_total = $this->sale_lib->get_item_total($item['quantity'], $item['price'], $item['discount'], $item['discount_type'], TRUE); $tax_basis = $item_total; $item_tax_amount = 0; @@ -727,12 +728,12 @@ class Sale extends CI_Model // This computes tax for each line item and adds it to the tax type total $tax_group = (float)$row['percent'] . '% ' . $row['name']; - $tax_basis = $this->sale_lib->get_item_total($item['quantity'], $item['price'], $item['discount'], TRUE); + $tax_basis = $this->sale_lib->get_item_total($item['quantity'], $item['price'], $item['discount'], $item['discount_type'], TRUE); if($this->config->item('tax_included')) { $tax_type = Tax_lib::TAX_TYPE_VAT; - $item_tax_amount = $this->sale_lib->get_item_tax($item['quantity'], $item['price'], $item['discount'],$row['percent']); + $item_tax_amount = $this->sale_lib->get_item_tax($item['quantity'], $item['price'], $item['discount'], $item['discount_type'], $row['percent']); } elseif($this->config->item('customer_sales_tax_support') == '0') { @@ -929,8 +930,7 @@ class Sale extends CI_Model quantity_purchased, item_cost_price, item_unit_price, - discount_percent, - discount_fixed, + discount, discount_type, item_location, print_option, @@ -1117,7 +1117,7 @@ class Sale extends CI_Model $decimals = totals_decimals(); - $sale_price = 'sales_items.item_unit_price * sales_items.quantity_purchased * (1 - sales_items.discount_percent / 100)-sales_items.discount_fixed'; + $sale_price = 'CASE WHEN sales_items.discount_type = ' . PERCENT . ' THEN sales_items.item_unit_price * sales_items.quantity_purchased * (1 - sales_items.discount / 100) ELSE sales_items.item_unit_price * sales_items.quantity_purchased - sales_items.discount END'; $sale_cost = 'SUM(sales_items.item_cost_price * sales_items.quantity_purchased)'; $tax = 'IFNULL(SUM(sales_items_taxes.tax), 0)'; @@ -1194,8 +1194,8 @@ class Sale extends CI_Model MAX(sales_items.quantity_purchased) AS quantity_purchased, MAX(sales_items.item_cost_price) AS item_cost_price, MAX(sales_items.item_unit_price) AS item_unit_price, - MAX(sales_items.discount_percent) AS discount_percent, - MAX(sales_items.discount_fixed) AS discount_fixed, + MAX(sales_items.discount) AS discount, + sales_items.discount_type AS discount_type, sales_items.line AS line, MAX(sales_items.serialnumber) AS serialnumber, MAX(sales_items.item_location) AS item_location, diff --git a/application/models/reports/Detailed_receivings.php b/application/models/reports/Detailed_receivings.php index 88e0e4317..695eb7498 100644 --- a/application/models/reports/Detailed_receivings.php +++ b/application/models/reports/Detailed_receivings.php @@ -97,7 +97,7 @@ class Detailed_receivings extends Report foreach($data['summary'] as $key=>$value) { - $this->db->select('name, item_number, category, quantity_purchased, serialnumber,total, discount_percent, discount_fixed, 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']); diff --git a/application/models/reports/Detailed_sales.php b/application/models/reports/Detailed_sales.php index ab3579640..36ad0234c 100644 --- a/application/models/reports/Detailed_sales.php +++ b/application/models/reports/Detailed_sales.php @@ -144,7 +144,7 @@ class Detailed_sales extends Report foreach($data['summary'] as $key=>$value) { - $this->db->select('name, category, quantity_purchased, item_location, serialnumber, description, subtotal, tax, total, cost, profit, discount_percent, discount_fixed, sale_status'); + $this->db->select('name, category, quantity_purchased, item_location, serialnumber, description, subtotal, tax, total, cost, profit, discount, discount_type, sale_status'); $this->db->from('sales_items_temp'); $this->db->where('sale_id', $value['sale_id']); $data['details'][$key] = $this->db->get()->result_array(); diff --git a/application/models/reports/Specific_discount.php b/application/models/reports/Specific_discount.php index ab8a059e5..d46e6f037 100755 --- a/application/models/reports/Specific_discount.php +++ b/application/models/reports/Specific_discount.php @@ -71,11 +71,8 @@ class Specific_discount extends Report MAX(comment) AS comment'); $this->db->from('sales_items_temp'); - if($inputs['discount_type']==1){ - $this->db->where('discount_fixed >=', $inputs['discount']); - }else{ - $this->db->where('discount_percent >=', $inputs['discount']); - } + $this->db->where('discount >=', $inputs['discount']); + $this->db->where('discount_type',$inputs['discount_type']); if($inputs['sale_type'] == 'complete') { @@ -124,7 +121,7 @@ class Specific_discount extends Report foreach($data['summary'] as $key=>$value) { - $this->db->select('name, category, serialnumber, description, quantity_purchased, subtotal, tax, total, cost, profit, discount_percent, discount_fixed'); + $this->db->select('name, category, serialnumber, description, quantity_purchased, subtotal, tax, total, cost, profit, discount, discount_type'); $this->db->from('sales_items_temp'); $this->db->where('sale_id', $value['sale_id']); $data['details'][$key] = $this->db->get()->result_array(); @@ -142,11 +139,9 @@ class Specific_discount extends Report $this->db->select('SUM(subtotal) AS subtotal, SUM(tax) AS tax, SUM(total) AS total, SUM(cost) AS cost, SUM(profit) AS profit'); $this->db->from('sales_items_temp'); - if($inputs['discount_type']==1){ - $this->db->where('discount_fixed >=', $inputs['discount']); - }else{ - $this->db->where('discount_percent >=', $inputs['discount']); - } + $this->db->where('discount >=', $inputs['discount']); + $this->db->where('discount_type',$inputs['discount_type']); + if($inputs['sale_type'] == 'complete') { diff --git a/application/models/reports/Specific_employee.php b/application/models/reports/Specific_employee.php index 0243d7f1f..36bdc0957 100644 --- a/application/models/reports/Specific_employee.php +++ b/application/models/reports/Specific_employee.php @@ -117,7 +117,7 @@ class Specific_employee extends Report foreach($data['summary'] as $key=>$value) { - $this->db->select('name, category, serialnumber, description, quantity_purchased, subtotal, tax, total, cost, profit, discount_percent, discount_fixed'); + $this->db->select('name, category, serialnumber, description, quantity_purchased, subtotal, tax, total, cost, profit, discount, discount_type'); $this->db->from('sales_items_temp'); $this->db->where('sale_id', $value['sale_id']); $data['details'][$key] = $this->db->get()->result_array(); diff --git a/application/models/reports/Summary_discounts.php b/application/models/reports/Summary_discounts.php index 606f79f9c..3c94829fb 100644 --- a/application/models/reports/Summary_discounts.php +++ b/application/models/reports/Summary_discounts.php @@ -13,17 +13,21 @@ class Summary_discounts extends Summary_report public function getData(array $inputs) { - if($inputs['discount_type']==1){ - $this->db->select('MAX(CONCAT("'.$this->config->item('currency_symbol').'",sales_items.discount_fixed)) AS discount, count(*) AS count'); - $this->db->where('discount_fixed > 0'); - $this->db->group_by('sales_items.discount_fixed'); - $this->db->order_by('sales_items.discount_fixed'); - }else{ - $this->db->select('MAX(CONCAT(sales_items.discount_percent, "%")) AS discount, count(*) AS count'); - $this->db->where('discount_percent > 0'); - $this->db->group_by('sales_items.discount_percent'); - $this->db->order_by('sales_items.discount_percent'); + if($inputs['discount_type'] == FIXED) + { + $this->db->select('MAX(CONCAT("'.$this->config->item('currency_symbol').'",sales_items.discount)) AS discount, count(*) AS count'); + $this->db->where('discount_type',FIXED); } + elseif($inputs['discount_type'] == PERCENT) + { + $this->db->select('MAX(CONCAT(sales_items.discount, "%")) AS discount, count(*) AS count'); + $this->db->where('discount_type',PERCENT); + } + + $this->db->where('discount > 0'); + $this->db->group_by('sales_items.discount'); + $this->db->order_by('sales_items.discount'); + $this->db->from('sales_items AS sales_items'); $this->db->join('sales AS sales', 'sales_items.sale_id = sales.sale_id', 'inner'); diff --git a/application/models/reports/Summary_payments.php b/application/models/reports/Summary_payments.php index cbb842b4f..79e82a03c 100644 --- a/application/models/reports/Summary_payments.php +++ b/application/models/reports/Summary_payments.php @@ -14,7 +14,7 @@ class Summary_payments extends Summary_report public function getData(array $inputs) { - $this->db->select('sales_payments.payment_type, COUNT(DISTINCT sales_payments.sale_id) AS count, SUM(sales_items.item_unit_price * sales_items.quantity_purchased * (1 - sales_items.discount_percent / 100)-sales_items.discount_fixed) AS payment_amount'); + $this->db->select('sales_payments.payment_type, COUNT(DISTINCT sales_payments.sale_id) AS count, SUM(CASE WHEN sales_items.discount_type = ' . PERCENT . ' THEN sales_items.item_unit_price * sales_items.quantity_purchased * (1 - sales_items.discount / 100) ELSE sales_items.item_unit_price * sales_items.quantity_purchased - sales_items.discount END) AS payment_amount'); $this->db->from('sales_payments AS sales_payments'); $this->db->join('sales AS sales', 'sales.sale_id = sales_payments.sale_id'); $this->db->join('sales_items AS sales_items', 'sales_items.sale_id = sales_payments.sale_id', 'left'); diff --git a/application/models/reports/Summary_report.php b/application/models/reports/Summary_report.php index 9315361d0..2511f85bd 100644 --- a/application/models/reports/Summary_report.php +++ b/application/models/reports/Summary_report.php @@ -23,7 +23,7 @@ abstract class Summary_report extends Report $decimals = totals_decimals(); - $sale_price = 'sales_items.item_unit_price * sales_items.quantity_purchased * (1 - sales_items.discount_percent / 100)-sales_items.discount_fixed'; + $sale_price = 'CASE WHEN sales_items.discount_type = ' . PERCENT . ' THEN sales_items.item_unit_price * sales_items.quantity_purchased * (1 - sales_items.discount / 100) ELSE sales_items.item_unit_price * sales_items.quantity_purchased - sales_items.discount END'; $sale_cost = 'SUM(sales_items.item_cost_price * sales_items.quantity_purchased)'; $tax = 'IFNULL(SUM(sales_items_taxes.tax), 0)'; diff --git a/application/models/reports/Summary_taxes.php b/application/models/reports/Summary_taxes.php index d57a61510..11ab9f343 100644 --- a/application/models/reports/Summary_taxes.php +++ b/application/models/reports/Summary_taxes.php @@ -41,13 +41,13 @@ class Summary_taxes extends Summary_report if($this->config->item('tax_included')) { - $sale_total = '(sales_items.item_unit_price * sales_items.quantity_purchased * (1 - sales_items.discount_percent / 100))'; - $sale_subtotal = '(sales_items.item_unit_price * sales_items.quantity_purchased * (1 - sales_items.discount_percent / 100) * (100 / (100 + sales_items_taxes.percent)))'; + $sale_total = '(CASE WHEN sales_items.discount_type = ' . PERCENT . ' THEN sales_items.item_unit_price * sales_items.quantity_purchased * (1 - sales_items.discount / 100) ELSE sales_items.item_unit_price * sales_items.quantity_purchased - sales_items.discount END)'; + $sale_subtotal = '(CASE WHEN sales_items.discount_type = ' . PERCENT . ' THEN sales_items.item_unit_price * sales_items.quantity_purchased * (1 - sales_items.discount / 100) ELSE sales_items.item_unit_price * sales_items.quantity_purchased - sales_items.discount END * (100 / (100 + sales_items_taxes.percent)))'; } else { - $sale_total = '(sales_items.item_unit_price * sales_items.quantity_purchased * (1 - sales_items.discount_percent / 100) * (1 + (sales_items_taxes.percent / 100)))'; - $sale_subtotal = '(sales_items.item_unit_price * sales_items.quantity_purchased * (1 - sales_items.discount_percent / 100))'; + $sale_total = '(CASE WHEN sales_items.discount_type = ' . PERCENT . ' THEN sales_items.item_unit_price * sales_items.quantity_purchased * (1 - sales_items.discount / 100) ELSE sales_items.item_unit_price * sales_items.quantity_purchased - sales_items.discount END * (1 + (sales_items_taxes.percent / 100)))'; + $sale_subtotal = '(CASE WHEN sales_items.discount_type = ' . PERCENT . ' THEN sales_items.item_unit_price * sales_items.quantity_purchased * (1 - sales_items.discount / 100) ELSE sales_items.item_unit_price * sales_items.quantity_purchased - sales_items.discount END)'; } $decimals = totals_decimals(); diff --git a/application/views/configs/general_config.php b/application/views/configs/general_config.php index 2ea8a1029..304f521c1 100644 --- a/application/views/configs/general_config.php +++ b/application/views/configs/general_config.php @@ -11,17 +11,6 @@
      -
      - lang->line('config_default_sales_discount_type'), 'default_sales_discount_type', array('class' => 'control-label col-xs-2')); ?> -
      - 'default_sales_discount_type', - 'id' => 'default_sales_discount_type', - 'value' => 'default_sales_discount_type', - 'checked' => $this->config->item('default_sales_discount_type'))); ?> -
      -
      -
      lang->line('config_default_sales_discount'), 'default_sales_discount', array('class' => 'control-label col-xs-2 required')); ?>
      @@ -34,19 +23,19 @@ 'min' => 0, 'max' => 100, 'value' => $this->config->item('default_sales_discount'))); ?> - % -
      -
      -
      -
      - config->item('currency_symbol'); ?> - 'default_sales_discount_fixed', - 'id' => 'default_sales_discount_fixed', - 'class' => 'form-control input-sm required', - 'type' => 'number', - 'min' => 0, - 'value' => $this->config->item('default_sales_discount_fixed'))); ?> + + 'default_sales_discount_type', + 'name'=>'default_sales_discount_type', + 'value'=>1, + 'data-toggle'=>"toggle", + 'data-size'=>'small', + 'data-onstyle'=>'success', + 'data-on'=>''.$this->config->item('currency_symbol').'', + 'data-off'=>'%', + 'checked'=>$this->config->item('default_sales_discount_type')) + ); ?> +
      diff --git a/application/views/customers/form.php b/application/views/customers/form.php index 1b32fb78f..6583cbf1a 100644 --- a/application/views/customers/form.php +++ b/application/views/customers/form.php @@ -40,33 +40,41 @@ load->view("people/form_basic_info"); ?> + +
      + lang->line('customers_discount_type'), 'discount_type', array('class'=>'control-label col-xs-3')); ?> +
      + + +
      +
      - lang->line('customers_discount'), 'discount_percent', array('class' => 'control-label col-xs-3')); ?> + lang->line('customers_discount'), 'discount', array('class' => 'control-label col-xs-3')); ?>
      'discount_percent', - 'id'=>'discount_percent', + 'name'=>'discount', + 'id'=>'discount', 'class'=>'form-control input-sm', - 'value'=>$person_info->discount_percent) + 'value'=>$person_info->discount) ); ?> - % -
      -
      - -
      -
      - config->item('currency_symbol'); ?> - 'discount_fixed', - 'size'=>'5', - 'maxlength'=>'5', - 'id'=>'discount_fixed', - 'class'=>'form-control input-sm', - 'value'=>$person_info->discount_fixed) - );?> -
      diff --git a/application/views/receivings/receipt.php b/application/views/receivings/receipt.php index b14a71a50..f28296538 100644 --- a/application/views/receivings/receipt.php +++ b/application/views/receivings/receipt.php @@ -92,17 +92,20 @@ { ?> - lang->line("sales_discount_included")?> - - - 0 ) - { - ?> - - lang->line("sales_discount")?> + + lang->line("sales_discount") ?> + + lang->line("sales_discount_included") ?> +
      - 'discount_fixed', 'class'=>'form-control input-sm', 'value'=>to_decimals($item['discount_fixed'], 0), 'onClick'=>'this.select();')); - echo form_hidden('discount', $item['discount']); - } - else - { - echo form_input(array('name'=>'discount', 'class'=>'form-control input-sm', 'value'=>to_decimals($item['discount'], 0), 'onClick'=>'this.select();')); - echo form_hidden('discount_fixed', $item['discount_fixed']); - } - ?> + 'discount', 'class'=>'form-control input-sm', 'value'=>to_decimals($item['discount'], 0), 'onClick'=>'this.select();')); ?> 'discount_toggle', 'name'=>'discount_toggle', 'value'=>1, 'data-toggle'=>"toggle",'data-size'=>'small', 'data-onstyle'=>'success', 'data-on'=>''.$this->config->item('currency_symbol').'', 'data-off'=>'%', 'data-line'=>$line, 'checked'=>$item['discount_type'])); ?> - -
      @@ -189,20 +176,13 @@ if (isset($success)) else { ?> - + - - + + lang->line('receivings_update')?> > @@ -531,7 +511,7 @@ $(document).ready(function() } } - $('[name="price"],[name="quantity"],[name="receiving_quantity"],[name="discount"],[name="discount_fixed"],[name="description"],[name="serialnumber"]').change(function() { + $('[name="price"],[name="quantity"],[name="receiving_quantity"],[name="discount"],[name="description"],[name="serialnumber"]').change(function() { $(this).parents("tr").prevAll("form:first").submit() }); diff --git a/application/views/sales/invoice.php b/application/views/sales/invoice.php index c1a6018ba..85ac25149 100755 --- a/application/views/sales/invoice.php +++ b/application/views/sales/invoice.php @@ -133,7 +133,7 @@ $(document).ready(function() - + 0): ?> diff --git a/application/views/sales/invoice_email.php b/application/views/sales/invoice_email.php index 72c0c6259..c69ed99fb 100644 --- a/application/views/sales/invoice_email.php +++ b/application/views/sales/invoice_email.php @@ -96,7 +96,7 @@ - + 0): ?> diff --git a/application/views/sales/quote.php b/application/views/sales/quote.php index a37acd8bf..acf29976d 100644 --- a/application/views/sales/quote.php +++ b/application/views/sales/quote.php @@ -135,7 +135,7 @@ if (isset($error_message)) + cols="6"> 0): ?> diff --git a/application/views/sales/quote_email.php b/application/views/sales/quote_email.php index 051801575..cf6b211fb 100644 --- a/application/views/sales/quote_email.php +++ b/application/views/sales/quote_email.php @@ -96,7 +96,7 @@ - + 0): ?> diff --git a/application/views/sales/receipt_default.php b/application/views/sales/receipt_default.php index 9192f4f86..4197e4985 100644 --- a/application/views/sales/receipt_default.php +++ b/application/views/sales/receipt_default.php @@ -96,19 +96,20 @@ { ?> - lang->line("sales_discount_included") ?> - - - 0) - { - ?> - - lang->line("sales_discount") ?> + + lang->line("sales_discount") ?> + + lang->line("sales_discount_included") ?> + - lang->line("sales_discount_included") ?> - - - 0) - { - ?> - - lang->line("sales_discount") ?> + + lang->line("sales_discount") ?> + + lang->line("sales_discount_included") ?> + - lang->line("sales_discount_included")?> - - - 0) - { - ?> - - lang->line("sales_discount") ?> + + lang->line("sales_discount") ?> + + lang->line("sales_discount_included") ?> +
      - 'discount_fixed', 'class'=>'form-control input-sm', 'value'=>to_decimals($item['discount_fixed'], 0), 'tabindex'=>++$tabindex, 'onClick'=>'this.select();')); - echo form_hidden('discount', $item['discount']); - } - else - { - echo form_input(array('name'=>'discount', 'class'=>'form-control input-sm', 'value'=>to_decimals($item['discount'], 0), 'tabindex'=>++$tabindex, 'onClick'=>'this.select();')); - echo form_hidden('discount_fixed', $item['discount_fixed']); - } - ?> + 'discount', 'class'=>'form-control input-sm', 'value'=>to_decimals($item['discount'], 0), 'tabindex'=>++$tabindex, 'onClick'=>'this.select();')); ?> 'discount_toggle', 'name'=>'discount_toggle', 'value'=>1, 'data-toggle'=>"toggle",'data-size'=>'small', 'data-onstyle'=>'success', 'data-on'=>''.$this->config->item('currency_symbol').'', 'data-off'=>'%', 'data-line'=>$line, 'checked'=>$item['discount_type'])); ?>
      + + lang->line('sales_update')?> > @@ -358,7 +349,7 @@ if(isset($success)) ?> lang->line("sales_customer_discount"); ?> - + config->item('customer_reward_enable') == TRUE): ?> - + diff --git a/application/views/sales/work_order_email.php b/application/views/sales/work_order_email.php index 0e68305ce..cd71a1a1e 100644 --- a/application/views/sales/work_order_email.php +++ b/application/views/sales/work_order_email.php @@ -87,7 +87,7 @@ - + Date: Fri, 31 Aug 2018 16:01:34 -0500 Subject: [PATCH 155/568] default_sales_discount_fixed deleted --- application/migrations/sqlscripts/discount_on_sales.sql | 1 - 1 file changed, 1 deletion(-) diff --git a/application/migrations/sqlscripts/discount_on_sales.sql b/application/migrations/sqlscripts/discount_on_sales.sql index e0bf9dad4..05d61f922 100644 --- a/application/migrations/sqlscripts/discount_on_sales.sql +++ b/application/migrations/sqlscripts/discount_on_sales.sql @@ -3,7 +3,6 @@ -- INSERT INTO `ospos_app_config` (`key`, `value`) VALUES -('default_sales_discount_fixed', '0'), ('default_sales_discount_type', '0'); ALTER TABLE `ospos_item_kits` From 0248a50ae32b3f431a1c152e4f36550a4e572215 Mon Sep 17 00:00:00 2001 From: jekkos Date: Sun, 26 Aug 2018 14:22:50 +0200 Subject: [PATCH 156/568] Filter out duplicate results (#2038) --- application/models/Item.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/Item.php b/application/models/Item.php index 1d5f91315..ead25240e 100644 --- a/application/models/Item.php +++ b/application/models/Item.php @@ -879,7 +879,7 @@ class Item extends CI_Model $suggestions = array_slice($suggestions, 0, $limit); } - return $suggestions; + return array_unique($suggestions); } public function get_low_sell_suggestions($search) From 024565d67c6c8921f4b51a1592f9b1b13b9e6234 Mon Sep 17 00:00:00 2001 From: jekkos Date: Sun, 26 Aug 2018 14:36:42 +0200 Subject: [PATCH 157/568] Enable array filtering (#2030) --- application/models/Item.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/models/Item.php b/application/models/Item.php index ead25240e..b9e3bf18c 100644 --- a/application/models/Item.php +++ b/application/models/Item.php @@ -663,7 +663,7 @@ class Item extends CI_Model $suggestions = array_slice($suggestions, 0, $limit); } - return $suggestions; + return array_unique($suggestions, SORT_REGULAR); } @@ -774,7 +774,7 @@ class Item extends CI_Model $suggestions = array_slice($suggestions, 0, $limit); } - return $suggestions; + return array_unique($suggestions, SORT_REGULAR); } public function get_kit_search_suggestions($search, $filters = array('is_deleted' => FALSE, 'search_custom' => FALSE), $unique = FALSE, $limit = 25) @@ -879,7 +879,7 @@ class Item extends CI_Model $suggestions = array_slice($suggestions, 0, $limit); } - return array_unique($suggestions); + return array_unique($suggestions, SORT_REGULAR); } public function get_low_sell_suggestions($search) From 53efbdb3b778d35a3f8ac6d3cba4830a110f3c6b Mon Sep 17 00:00:00 2001 From: Erastus Date: Fri, 31 Aug 2018 23:05:32 -0500 Subject: [PATCH 158/568] reports discount fixed --- application/views/reports/specific_input.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/reports/specific_input.php b/application/views/reports/specific_input.php index b31bfda1b..d9f1c1c77 100644 --- a/application/views/reports/specific_input.php +++ b/application/views/reports/specific_input.php @@ -53,7 +53,7 @@ if(isset($error)) 'class' => 'form-control input-sm required', 'type' => 'number', 'min' => 0, - 'value' => $this->config->item('default_sales_discount_fixed'))); ?> + 'value' => $this->config->item('default_sales_discount'))); ?> Date: Sat, 1 Sep 2018 02:33:06 +0200 Subject: [PATCH 159/568] Add item_number to receivings view --- application/libraries/Receiving_lib.php | 1 + application/views/receivings/receiving.php | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/application/libraries/Receiving_lib.php b/application/libraries/Receiving_lib.php index 4c01e9bbc..c3e805533 100644 --- a/application/libraries/Receiving_lib.php +++ b/application/libraries/Receiving_lib.php @@ -229,6 +229,7 @@ class Receiving_lib $item = array($insertkey => array( 'item_id' => $item_id, 'item_location' => $item_location, + 'item_number' => $item_info->item_number, 'stock_name' => $this->CI->Stock_location->get_location_name($item_location), 'line' => $insertkey, 'name' => $item_info->name, diff --git a/application/views/receivings/receiving.php b/application/views/receivings/receiving.php index ae131f6bf..7ce3470ed 100644 --- a/application/views/receivings/receiving.php +++ b/application/views/receivings/receiving.php @@ -103,11 +103,12 @@ if (isset($success)) lang->line('common_delete'); ?> - lang->line('receivings_item_name'); ?> + lang->line('sales_item_number'); ?> + lang->line('receivings_item_name'); ?> lang->line('receivings_cost'); ?> lang->line('receivings_quantity'); ?> lang->line('receivings_ship_pack'); ?> - lang->line('receivings_discount'); ?> + lang->line('receivings_discount'); ?> lang->line('receivings_total'); ?> lang->line('receivings_update'); ?> @@ -133,6 +134,7 @@ if (isset($success)) 'form-horizontal', 'id'=>'cart_'.$line)); ?> ');?> +
      From a1ae343139f5222888347000403fbfac6901da81 Mon Sep 17 00:00:00 2001 From: jekkos Date: Sat, 1 Sep 2018 11:16:16 +0200 Subject: [PATCH 160/568] Add download badge to README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 76dadf863..c48e239eb 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +[ ![Download](https://api.bintray.com/packages/jekkos/opensourcepos/opensourcepos/images/download.svg?version=3.2.3) ](https://bintray.com/jekkos/opensourcepos/opensourcepos/3.2.3/link) [![Build Status](https://travis-ci.org/opensourcepos/opensourcepos.svg?branch=master)](https://travis-ci.org/opensourcepos/opensourcepos) [![Join the chat at https://gitter.im/jekkos/opensourcepos](https://badges.gitter.im/jekkos/opensourcepos.svg)](https://gitter.im/jekkos/opensourcepos?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![devDependency Status](https://david-dm.org/jekkos/opensourcepos/dev-status.svg)](https://david-dm.org/jekkos/opensourcepos#info=dev) From 7e855863135c75db63692f7966ceba8e2cb6652c Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sat, 1 Sep 2018 16:24:28 +0100 Subject: [PATCH 161/568] Fix Receivings colspan when cart is empty --- application/views/receivings/receiving.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/receivings/receiving.php b/application/views/receivings/receiving.php index 7ce3470ed..fdc224cca 100644 --- a/application/views/receivings/receiving.php +++ b/application/views/receivings/receiving.php @@ -120,7 +120,7 @@ if (isset($success)) { ?> - +
      lang->line('sales_no_items_in_cart'); ?>
      From 3b659526f39423be9201813e49157362c52c74c3 Mon Sep 17 00:00:00 2001 From: Erastus Date: Sun, 2 Sep 2018 17:58:41 -0500 Subject: [PATCH 162/568] cleaning spaces --- application/controllers/Sales.php | 2 +- application/libraries/Receiving_lib.php | 7 +++--- application/libraries/Sale_lib.php | 3 ++- .../20180820100000_discount_on_sales.php | 20 ---------------- ...hp => 20180830100000_upgrade_to_3_3_0.php} | 0 .../migrations/sqlscripts/3.2.1_to_3.3.0.sql | 23 ++++++++++++++++++- .../sqlscripts/discount_on_sales.sql | 23 ------------------- .../models/reports/Specific_discount.php | 1 - application/views/item_kits/form.php | 3 +-- application/views/receivings/receiving.php | 1 - application/views/sales/register.php | 1 - 11 files changed, 30 insertions(+), 54 deletions(-) delete mode 100644 application/migrations/20180820100000_discount_on_sales.php rename application/migrations/{20180610100000_upgrade_to_3_3_0.php => 20180830100000_upgrade_to_3_3_0.php} (100%) delete mode 100644 application/migrations/sqlscripts/discount_on_sales.sql diff --git a/application/controllers/Sales.php b/application/controllers/Sales.php index f157f45c0..dffb26d81 100644 --- a/application/controllers/Sales.php +++ b/application/controllers/Sales.php @@ -385,7 +385,7 @@ class Sales extends Secure_Controller } // if the customer discount is 0 or no customer is selected apply the default sales discount - if($discount == 0 ) + if($discount == 0) { $discount = $this->config->item('default_sales_discount'); } diff --git a/application/libraries/Receiving_lib.php b/application/libraries/Receiving_lib.php index 218cc1242..53ba67bfd 100644 --- a/application/libraries/Receiving_lib.php +++ b/application/libraries/Receiving_lib.php @@ -226,7 +226,8 @@ class Receiving_lib 1 => 'x1'); } - if(is_null($receiving_quantity)){ + if(is_null($receiving_quantity)) + { $receiving_quantity = $item_info->receiving_quantity; } @@ -279,7 +280,8 @@ class Receiving_lib $line['quantity'] = $quantity; $line['receiving_quantity'] = $receiving_quantity; $line['discount'] = $discount; - if(!is_null($discount_type)){ + if(!is_null($discount_type)) + { $line['discount_type'] = $discount_type; } $line['price'] = $price; @@ -367,7 +369,6 @@ class Receiving_lib $discount_fraction = bcdiv($discount, 100); $discount_amount = bcmul($total, $discount_fraction); } - return bcsub($total, $discount_amount); } diff --git a/application/libraries/Sale_lib.php b/application/libraries/Sale_lib.php index 528459fa6..6e98c0918 100644 --- a/application/libraries/Sale_lib.php +++ b/application/libraries/Sale_lib.php @@ -949,7 +949,8 @@ class Sale_lib $line['serialnumber'] = $serialnumber; $line['quantity'] = $quantity; $line['discount'] = $discount; - if(!is_null($discount_type)){ + if(!is_null($discount_type)) + { $line['discount_type'] = $discount_type; } $line['price'] = $price; diff --git a/application/migrations/20180820100000_discount_on_sales.php b/application/migrations/20180820100000_discount_on_sales.php deleted file mode 100644 index d0c6e401a..000000000 --- a/application/migrations/20180820100000_discount_on_sales.php +++ /dev/null @@ -1,20 +0,0 @@ - diff --git a/application/migrations/20180610100000_upgrade_to_3_3_0.php b/application/migrations/20180830100000_upgrade_to_3_3_0.php similarity index 100% rename from application/migrations/20180610100000_upgrade_to_3_3_0.php rename to application/migrations/20180830100000_upgrade_to_3_3_0.php diff --git a/application/migrations/sqlscripts/3.2.1_to_3.3.0.sql b/application/migrations/sqlscripts/3.2.1_to_3.3.0.sql index 0cc3bd68d..8f32dbb51 100644 --- a/application/migrations/sqlscripts/3.2.1_to_3.3.0.sql +++ b/application/migrations/sqlscripts/3.2.1_to_3.3.0.sql @@ -3,7 +3,8 @@ -- INSERT INTO `ospos_app_config` (`key`, `value`) VALUES -('multi_pack_enabled', '0'); +('multi_pack_enabled', '0'), +('default_sales_discount_type', '0'); ALTER TABLE `ospos_items` ADD COLUMN `qty_per_pack` decimal(15,3) NOT NULL DEFAULT 1, @@ -13,3 +14,23 @@ ALTER TABLE `ospos_items` UPDATE `ospos_items` SET `low_sell_item_id` = `item_id` WHERE `low_sell_item_id` = 0; + +-- +-- Add support for Discount on Sales Fixed +-- + +ALTER TABLE `ospos_item_kits` + CHANGE COLUMN `kit_discount_percent` `kit_discount` DECIMAL(15,2) NOT NULL DEFAULT 0 AFTER `item_id`, + ADD COLUMN `kit_discount_type` TINYINT(2) NOT NULL DEFAULT '0' AFTER `kit_discount`; + +ALTER TABLE `ospos_customers` + CHANGE COLUMN `discount_percent` `discount` DECIMAL(15,2) NOT NULL DEFAULT 0 AFTER `sales_tax_code`, + ADD COLUMN `discount_type` TINYINT(2) NOT NULL DEFAULT '0' AFTER `discount`; + +ALTER TABLE `ospos_sales_items` + CHANGE COLUMN `discount_percent` `discount` DECIMAL(15,2) NOT NULL DEFAULT 0 AFTER `item_unit_price`, + ADD COLUMN `discount_type` TINYINT(2) NOT NULL DEFAULT '0' AFTER `discount`; + +ALTER TABLE `ospos_receivings_items` + CHANGE COLUMN `discount_percent` `discount` DECIMAL(15,2) NOT NULL DEFAULT 0 AFTER `item_unit_price`, + ADD COLUMN `discount_type` TINYINT(2) NOT NULL DEFAULT '0' AFTER `discount`; diff --git a/application/migrations/sqlscripts/discount_on_sales.sql b/application/migrations/sqlscripts/discount_on_sales.sql deleted file mode 100644 index 05d61f922..000000000 --- a/application/migrations/sqlscripts/discount_on_sales.sql +++ /dev/null @@ -1,23 +0,0 @@ --- --- Add support for Discount on Sales Fixed --- - -INSERT INTO `ospos_app_config` (`key`, `value`) VALUES -('default_sales_discount_type', '0'); - -ALTER TABLE `ospos_item_kits` - CHANGE COLUMN `kit_discount_percent` `kit_discount` DECIMAL(15,2) NOT NULL DEFAULT '0.00' AFTER `item_id`, - ADD COLUMN `kit_discount_type` TINYINT(2) NOT NULL DEFAULT '0' AFTER `kit_discount`; - -ALTER TABLE `ospos_customers` - CHANGE COLUMN `discount_percent` `discount` DECIMAL(15,2) NOT NULL DEFAULT '0.00' AFTER `sales_tax_code`, - ADD COLUMN `discount_type` TINYINT(2) NOT NULL DEFAULT '0' AFTER `discount`; - - -ALTER TABLE `ospos_sales_items` - CHANGE COLUMN `discount_percent` `discount` DECIMAL(15,2) NOT NULL DEFAULT '0.00' AFTER `item_unit_price`, - ADD COLUMN `discount_type` TINYINT(2) NOT NULL DEFAULT '0' AFTER `discount`; - -ALTER TABLE `ospos_receivings_items` - CHANGE COLUMN `discount_percent` `discount` DECIMAL(15,2) NOT NULL DEFAULT '0.00' AFTER `item_unit_price`, - ADD COLUMN `discount_type` TINYINT(2) NOT NULL DEFAULT '0' AFTER `discount`; diff --git a/application/models/reports/Specific_discount.php b/application/models/reports/Specific_discount.php index d46e6f037..03f05623d 100755 --- a/application/models/reports/Specific_discount.php +++ b/application/models/reports/Specific_discount.php @@ -141,7 +141,6 @@ class Specific_discount extends Report $this->db->where('discount >=', $inputs['discount']); $this->db->where('discount_type',$inputs['discount_type']); - if($inputs['sale_type'] == 'complete') { diff --git a/application/views/item_kits/form.php b/application/views/item_kits/form.php index e767346a7..711c35350 100644 --- a/application/views/item_kits/form.php +++ b/application/views/item_kits/form.php @@ -59,8 +59,7 @@ 'id'=>'kit_discount_fixed', 'class'=>'form-control input-sm', 'value'=>$item_kit_info->kit_discount_fixed) - );?> - + );?> diff --git a/application/views/receivings/receiving.php b/application/views/receivings/receiving.php index f4d6946f7..5c2b934e7 100644 --- a/application/views/receivings/receiving.php +++ b/application/views/receivings/receiving.php @@ -516,7 +516,6 @@ $(document).ready(function() }); $('[name="discount_toggle"]').change(function() { - var input = $("").attr("type", "hidden").attr("name", "discount_type").val(($(this).prop('checked'))?1:0); $('#cart_'+ $(this).attr('data-line')).append($(input)); $('#cart_'+ $(this).attr('data-line')).submit(); diff --git a/application/views/sales/register.php b/application/views/sales/register.php index 8c20bd4d1..7fde2d58c 100644 --- a/application/views/sales/register.php +++ b/application/views/sales/register.php @@ -906,7 +906,6 @@ $(document).ready(function() }); $('[name="discount_toggle"]').change(function() { - var input = $("").attr("type", "hidden").attr("name", "discount_type").val(($(this).prop('checked'))?1:0); $('#cart_'+ $(this).attr('data-line')).append($(input)); $('#cart_'+ $(this).attr('data-line')).submit(); From c57d8ef536552821081f7c375d7cb359a0d9951a Mon Sep 17 00:00:00 2001 From: Erastus Date: Mon, 3 Sep 2018 00:51:34 -0500 Subject: [PATCH 163/568] discount in item_kits --- application/controllers/Item_kits.php | 9 ++-- application/controllers/Sales.php | 2 +- application/language/en-US/item_kits_lang.php | 4 ++ application/language/es/item_kits_lang.php | 4 ++ application/models/Item_kit.php | 4 +- application/views/item_kits/form.php | 47 +++++++++++-------- 6 files changed, 44 insertions(+), 26 deletions(-) diff --git a/application/controllers/Item_kits.php b/application/controllers/Item_kits.php index 31fdcf638..050689ae6 100644 --- a/application/controllers/Item_kits.php +++ b/application/controllers/Item_kits.php @@ -37,8 +37,9 @@ class Item_kits extends Secure_Controller } } - $discount_fraction = bcdiv($item_kit->kit_discount_percent, 100); - $item_kit->total_unit_price = $item_kit->total_unit_price - round(bcadd(bcmul($item_kit->total_unit_price, $discount_fraction),bcmul($item_kit->kit_discount_fixed,$total_quantity)), totals_decimals(), PHP_ROUND_HALF_UP); + $discount_fraction = bcdiv($item_kit->kit_discount, 100); + + $item_kit->total_unit_price = $item_kit->total_unit_price - round(($item_kit->kit_discount_type == PERCENT)?bcmul($item_kit->total_unit_price, $discount_fraction): $item_kit->kit_discount, totals_decimals(), PHP_ROUND_HALF_UP); return $item_kit; } @@ -131,8 +132,8 @@ class Item_kits extends Secure_Controller $item_kit_data = array( 'name' => $this->input->post('name'), 'item_id' => $this->input->post('kit_item_id'), - 'kit_discount_percent' => $this->input->post('kit_discount_percent'), - 'kit_discount_fixed' => $this->input->post('kit_discount_fixed'), + 'kit_discount' => $this->input->post('kit_discount'), + 'kit_discount_type' => $this->input->post('kit_discount_type') == NULL ? PERCENT : $this->input->post('kit_discount_type'), 'price_option' => $this->input->post('price_option'), 'print_option' => $this->input->post('print_option'), 'description' => $this->input->post('description') diff --git a/application/controllers/Sales.php b/application/controllers/Sales.php index dffb26d81..754e0861d 100644 --- a/application/controllers/Sales.php +++ b/application/controllers/Sales.php @@ -413,7 +413,7 @@ class Sales extends Secure_Controller if($item_kit_info->kit_discount != 0 && $item_kit_info->kit_discount > $discount) { $discount = $item_kit_info->kit_discount; - $discount_type = $item_kit_info->discount_type; + $discount_type = $item_kit_info->kit_discount_type; } $price = NULL; diff --git a/application/language/en-US/item_kits_lang.php b/application/language/en-US/item_kits_lang.php index ba6bae908..a6ef53155 100644 --- a/application/language/en-US/item_kits_lang.php +++ b/application/language/en-US/item_kits_lang.php @@ -30,3 +30,7 @@ $lang["item_kits_successful_adding"] = "You have successfully added Item Kit"; $lang["item_kits_successful_deleted"] = "You have successfully deleted"; $lang["item_kits_successful_updating"] = "You have successfully updated Item Kit"; $lang["item_kits_update"] = "Update Item Kit"; +$lang["item_kits_discount"] = "Discount"; +$lang["item_kits_discount_type"] = "Discount Type"; +$lang["item_kits_discount_fixed"] = "Fixed Discount"; +$lang["item_kits_discount_percent"] = "Percentage Discount"; diff --git a/application/language/es/item_kits_lang.php b/application/language/es/item_kits_lang.php index 9c7fa4b1f..fc2bb6a58 100644 --- a/application/language/es/item_kits_lang.php +++ b/application/language/es/item_kits_lang.php @@ -30,3 +30,7 @@ $lang["item_kits_successful_adding"] = "Has agregado satisfactoriamente un Kit d $lang["item_kits_successful_deleted"] = "Has borrado satisfactoriamente"; $lang["item_kits_successful_updating"] = "Has actualizado satisfactoriamente un Kit de Artículos"; $lang["item_kits_update"] = "Actualizar Kit de Artículos"; +$lang["item_kits_discount"] = "Descuento"; +$lang["item_kits_discount_type"] = "Tipo de Descuento"; +$lang["item_kits_discount_fixed"] = "Descuento Fijo"; +$lang["item_kits_discount_percent"] = "Descuento en Porcentaje"; diff --git a/application/models/Item_kit.php b/application/models/Item_kit.php index 96aca7b05..06c3ed9dc 100644 --- a/application/models/Item_kit.php +++ b/application/models/Item_kit.php @@ -58,8 +58,8 @@ class Item_kit extends CI_Model item_kits.description, items.description as item_description, item_kits.item_id as kit_item_id, - kit_discount_percent, - kit_discount_fixed, + kit_discount, + kit_discount_type, price_option, print_option, category, diff --git a/application/views/item_kits/form.php b/application/views/item_kits/form.php index 711c35350..bf7c80f3b 100644 --- a/application/views/item_kits/form.php +++ b/application/views/item_kits/form.php @@ -34,32 +34,41 @@
      - lang->line('item_kits_discount_percent'), 'kit_discount_percent', array('class' => 'control-label col-xs-3')); ?> -
      -
      - 'kit_discount_percent', - 'size'=>'5', - 'maxlength'=>'5', - 'id'=>'kit_discount_percent', - 'class'=>'form-control input-sm', - 'value'=>$item_kit_info->kit_discount_percent) - );?> - % -
      + lang->line('item_kits_discount_type'), 'kit_discount_type', array('class'=>'control-label col-xs-3')); ?> +
      + +
      - +
      + +
      + lang->line('item_kits_discount'), 'kit_discount', array('class' => 'control-label col-xs-3')); ?>
      - config->item('currency_symbol'); ?> 'kit_discount_fixed', + 'name'=>'kit_discount', 'size'=>'5', 'maxlength'=>'5', - 'id'=>'kit_discount_fixed', + 'id'=>'kit_discount', 'class'=>'form-control input-sm', - 'value'=>$item_kit_info->kit_discount_fixed) - );?> + 'value'=>$item_kit_info->kit_discount) + );?>
      From 561f6eb78470f8e66ca19112d83a95da84bbc6fd Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Mon, 3 Sep 2018 19:28:06 +0100 Subject: [PATCH 164/568] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c48e239eb..d97948295 100644 --- a/README.md +++ b/README.md @@ -133,7 +133,7 @@ FAQ * If you are seeing the message **system folder missing**, then you have cloned the source using git and you need to run a build *first*. Check [INSTALL.md](https://github.com/opensourcepos/opensourcepos/blob/master/INSTALL.md) for instructions or download latest zip file from [bintray](https://bintray.com/jekkos/opensourcepos/opensourcepos/view/files?sort=updated&order=desc#files) instead. -* If at login time you read "The installation is not correct, check your php.ini file.", please check the error_log in public folder to understand what's wrong and make sure you read the [INSTALL.md](https://github.com/opensourcepos/opensourcepos/blob/master/INSTALL.md). +* If at login time you read "The installation is not correct, check your php.ini file.", please check the error_log in public folder to understand what's wrong and make sure you read the [INSTALL.md](https://github.com/opensourcepos/opensourcepos/blob/master/INSTALL.md). To know how to enable error_log, please read the comment in [issue 1770](https://github.com/opensourcepos/opensourcepos/issues/1770#issuecomment-355177943). * If you installed your OSPOS under a web server subdir, please edit public/.htaccess and go to the lines with comment `if in web root` and `if in subdir comment above line, uncomment below one and replace with your path` and follow the instruction on the second comment line. If you face more issues please read [issue #920](https://github.com/opensourcepos/opensourcepos/issues/920) for more help. From 35c57e6cf2d28792c06967576bd6aafc46131994 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Mon, 3 Sep 2018 21:56:29 +0100 Subject: [PATCH 165/568] Add en-GB translations --- application/language/en-GB/config_lang.php | 2 +- application/language/en-GB/customers_lang.php | 3 +++ application/language/en-GB/item_kits_lang.php | 5 ++++- application/language/en-GB/receivings_lang.php | 2 +- application/language/en-GB/reports_lang.php | 2 ++ application/language/en-GB/sales_lang.php | 2 +- 6 files changed, 12 insertions(+), 4 deletions(-) diff --git a/application/language/en-GB/config_lang.php b/application/language/en-GB/config_lang.php index 91c35af9f..d98fc12cc 100644 --- a/application/language/en-GB/config_lang.php +++ b/application/language/en-GB/config_lang.php @@ -78,7 +78,7 @@ $lang["config_default_barcode_page_width_required"] = "Default Barcode Page Widt $lang["config_default_barcode_width_number"] = "Default Barcode Width must be a number"; $lang["config_default_barcode_width_required"] = "Default Barcode Width is a required field"; $lang["config_default_origin_tax_code"] = "Default Origin Tax Code"; -$lang["config_default_sales_discount"] = "Default Sales Discount %"; +$lang["config_default_sales_discount"] = "Default Sales Discount"; $lang["config_default_sales_discount_number"] = "Default Sales Discount must be a number"; $lang["config_default_sales_discount_required"] = "Default Sales Discount is a required field"; $lang["config_default_tax_name_number"] = "Default Tax Name must be a string"; diff --git a/application/language/en-GB/customers_lang.php b/application/language/en-GB/customers_lang.php index 19b692ff0..2552d344d 100644 --- a/application/language/en-GB/customers_lang.php +++ b/application/language/en-GB/customers_lang.php @@ -15,6 +15,9 @@ $lang["customers_consent_required"] = "Registration consent is a required field" $lang["customers_customer"] = "Customer"; $lang["customers_date"] = "Date"; $lang["customers_discount"] = "Discount"; +$lang["customers_discount_type"] = "Discount Type"; +$lang["customers_discount_fixed"] = "Fixed Discount"; +$lang["customers_discount_percent"] = "Percentage Discount"; $lang["customers_email_duplicate"] = "Email address is already present in the database"; $lang["customers_employee"] = "Employee"; $lang["customers_error_adding_updating"] = "Error adding/updating Customer"; diff --git a/application/language/en-GB/item_kits_lang.php b/application/language/en-GB/item_kits_lang.php index c0abda0f4..0701d117f 100644 --- a/application/language/en-GB/item_kits_lang.php +++ b/application/language/en-GB/item_kits_lang.php @@ -6,7 +6,10 @@ $lang["item_kits_cannot_be_deleted"] = "Item Kit(s) delete failed"; $lang["item_kits_confirm_delete"] = "Are you sure you want to delete the selected Item Kit(s)?"; $lang["item_kits_confirm_restore"] = "Are you sure you want to restore the selected Item Kit(s)?"; $lang["item_kits_description"] = "Item Kit Description"; -$lang["item_kits_discount_percent"] = "Discount Percent"; +$lang["item_kits_discount"] = "Discount"; +$lang["item_kits_discount_type"] = "Discount Type"; +$lang["item_kits_discount_fixed"] = "Fixed Discount"; +$lang["item_kits_discount_percent"] = "Percentage Discount"; $lang["item_kits_error_adding_updating"] = "Item Kit add or update failed"; $lang["item_kits_find_kit_item"] = "Kit Item"; $lang["item_kits_info"] = "Item Kit Info"; diff --git a/application/language/en-GB/receivings_lang.php b/application/language/en-GB/receivings_lang.php index 6237237da..54a756c9d 100644 --- a/application/language/en-GB/receivings_lang.php +++ b/application/language/en-GB/receivings_lang.php @@ -12,7 +12,7 @@ $lang["receivings_date"] = "Receiving Date"; $lang["receivings_date_required"] = "A correct date must be entered"; $lang["receivings_date_type"] = "Date is a required field"; $lang["receivings_delete_entire_sale"] = "Delete Entire Sale"; -$lang["receivings_discount"] = "Discount %"; +$lang["receivings_discount"] = "Discount"; $lang["receivings_edit"] = "Edit"; $lang["receivings_edit_sale"] = "Edit Receiving"; $lang["receivings_employee"] = "Employee"; diff --git a/application/language/en-GB/reports_lang.php b/application/language/en-GB/reports_lang.php index cadad4315..af14c623c 100644 --- a/application/language/en-GB/reports_lang.php +++ b/application/language/en-GB/reports_lang.php @@ -34,6 +34,8 @@ $lang["reports_discount"] = "Discount"; $lang["reports_discount_percent"] = "Discount Percent"; $lang["reports_discounts"] = "Discounts"; $lang["reports_discounts_summary_report"] = "Discounts Summary Report"; +$lang["reports_discount_type"] = "Discount Type"; +$lang["reports_discount_fixed"] = "Fixed Discount"; $lang["reports_earned"] = "Points Earned"; $lang["reports_employee"] = "Employee"; $lang["reports_employees"] = "Employees"; diff --git a/application/language/en-GB/sales_lang.php b/application/language/en-GB/sales_lang.php index 2802e1dcf..6a23a7f46 100644 --- a/application/language/en-GB/sales_lang.php +++ b/application/language/en-GB/sales_lang.php @@ -44,7 +44,7 @@ $lang["sales_delete_unsuccessful"] = "Sale delete failed"; $lang["sales_description_abbrv"] = "Desc"; $lang["sales_discard"] = "Discard"; $lang["sales_discard_quote"] = ""; -$lang["sales_discount"] = "Disc %"; +$lang["sales_discount"] = "Disc"; $lang["sales_discount_included"] = "% Discount"; $lang["sales_discount_short"] = "%"; $lang["sales_due"] = "Due"; From 4d11a550915bb4d2a26edfe35f01a95979599400 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Tue, 4 Sep 2018 22:16:57 +0100 Subject: [PATCH 166/568] Amend database upgrade script (#2061) --- application/migrations/sqlscripts/3.2.1_to_3.3.0.sql | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/application/migrations/sqlscripts/3.2.1_to_3.3.0.sql b/application/migrations/sqlscripts/3.2.1_to_3.3.0.sql index 8f32dbb51..5deeec224 100644 --- a/application/migrations/sqlscripts/3.2.1_to_3.3.0.sql +++ b/application/migrations/sqlscripts/3.2.1_to_3.3.0.sql @@ -3,8 +3,7 @@ -- INSERT INTO `ospos_app_config` (`key`, `value`) VALUES -('multi_pack_enabled', '0'), -('default_sales_discount_type', '0'); +('multi_pack_enabled', '0'); ALTER TABLE `ospos_items` ADD COLUMN `qty_per_pack` decimal(15,3) NOT NULL DEFAULT 1, @@ -19,6 +18,9 @@ UPDATE `ospos_items` -- Add support for Discount on Sales Fixed -- +INSERT INTO `ospos_app_config` (`key`, `value`) VALUES +('default_sales_discount_type', '0'); + ALTER TABLE `ospos_item_kits` CHANGE COLUMN `kit_discount_percent` `kit_discount` DECIMAL(15,2) NOT NULL DEFAULT 0 AFTER `item_id`, ADD COLUMN `kit_discount_type` TINYINT(2) NOT NULL DEFAULT '0' AFTER `kit_discount`; From 1bb46fa90524862535a1bea1563a38d3995b8a00 Mon Sep 17 00:00:00 2001 From: Songwut Kanchanakosai Date: Tue, 19 Jun 2018 06:17:43 +0000 Subject: [PATCH 167/568] Translated using Weblate (Thai) Currently translated at 100.0% (65 of 65 strings) --- application/language/th/common_lang.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/application/language/th/common_lang.php b/application/language/th/common_lang.php index 5d50d3948..78f49743d 100644 --- a/application/language/th/common_lang.php +++ b/application/language/th/common_lang.php @@ -1,5 +1,4 @@ - Date: Thu, 28 Jun 2018 01:55:25 +0000 Subject: [PATCH 168/568] Translated using Weblate (Vietnamese) Currently translated at 100.0% (104 of 104 strings) --- application/language/vi/items_lang.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/application/language/vi/items_lang.php b/application/language/vi/items_lang.php index 47cff1fd7..82962b48c 100644 --- a/application/language/vi/items_lang.php +++ b/application/language/vi/items_lang.php @@ -1,5 +1,4 @@ - Date: Sun, 29 Jul 2018 14:55:22 +0000 Subject: [PATCH 169/568] Added translation using Weblate (Greek) --- application/language/el/common_lang.php | 1 + 1 file changed, 1 insertion(+) create mode 100644 application/language/el/common_lang.php diff --git a/application/language/el/common_lang.php b/application/language/el/common_lang.php new file mode 100644 index 000000000..b3d9bbc7f --- /dev/null +++ b/application/language/el/common_lang.php @@ -0,0 +1 @@ + Date: Sun, 29 Jul 2018 15:27:35 +0000 Subject: [PATCH 170/568] Added translation using Weblate (Greek) --- application/language/el/customers_lang.php | 1 + 1 file changed, 1 insertion(+) create mode 100644 application/language/el/customers_lang.php diff --git a/application/language/el/customers_lang.php b/application/language/el/customers_lang.php new file mode 100644 index 000000000..b3d9bbc7f --- /dev/null +++ b/application/language/el/customers_lang.php @@ -0,0 +1 @@ + Date: Sat, 4 Aug 2018 15:04:37 +0000 Subject: [PATCH 171/568] Translated using Weblate (Arabic) Currently translated at 100.0% (104 of 104 strings) --- application/language/ar-EG/items_lang.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/application/language/ar-EG/items_lang.php b/application/language/ar-EG/items_lang.php index ac8254df6..5ad5e3571 100644 --- a/application/language/ar-EG/items_lang.php +++ b/application/language/ar-EG/items_lang.php @@ -1,5 +1,4 @@ - Date: Thu, 9 Aug 2018 20:54:52 +0000 Subject: [PATCH 172/568] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (48 of 48 strings) --- application/language/pt-BR/customers_lang.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/application/language/pt-BR/customers_lang.php b/application/language/pt-BR/customers_lang.php index 442d41b23..209ee920d 100644 --- a/application/language/pt-BR/customers_lang.php +++ b/application/language/pt-BR/customers_lang.php @@ -1,5 +1,4 @@ - Date: Thu, 9 Aug 2018 20:57:58 +0000 Subject: [PATCH 173/568] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (110 of 110 strings) --- application/language/pt-BR/reports_lang.php | 5 ++--- application/language/pt-BR/sales_lang.php | 9 ++++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/application/language/pt-BR/reports_lang.php b/application/language/pt-BR/reports_lang.php index e2767f4ab..5d146d56d 100644 --- a/application/language/pt-BR/reports_lang.php +++ b/application/language/pt-BR/reports_lang.php @@ -1,5 +1,4 @@ - Date: Thu, 9 Aug 2018 20:45:40 +0000 Subject: [PATCH 174/568] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (271 of 271 strings) --- application/language/pt-BR/config_lang.php | 37 +++++++++++----------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/application/language/pt-BR/config_lang.php b/application/language/pt-BR/config_lang.php index e7aa7ad0c..76f218e43 100644 --- a/application/language/pt-BR/config_lang.php +++ b/application/language/pt-BR/config_lang.php @@ -1,5 +1,4 @@ - Date: Thu, 9 Aug 2018 20:59:00 +0000 Subject: [PATCH 175/568] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (104 of 104 strings) --- application/language/pt-BR/items_lang.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/application/language/pt-BR/items_lang.php b/application/language/pt-BR/items_lang.php index 596ba44f9..13e518a85 100644 --- a/application/language/pt-BR/items_lang.php +++ b/application/language/pt-BR/items_lang.php @@ -1,5 +1,4 @@ - Date: Sat, 11 Aug 2018 00:19:12 +0000 Subject: [PATCH 176/568] Translated using Weblate (Indonesian) Currently translated at 100.0% (48 of 48 strings) --- application/language/id/customers_lang.php | 41 +++++++++++----------- application/language/pt-BR/enum_lang.php | 17 +++++---- 2 files changed, 28 insertions(+), 30 deletions(-) diff --git a/application/language/id/customers_lang.php b/application/language/id/customers_lang.php index c23ffecd5..00def20af 100644 --- a/application/language/id/customers_lang.php +++ b/application/language/id/customers_lang.php @@ -1,45 +1,44 @@ - Date: Tue, 14 Aug 2018 02:51:51 +0000 Subject: [PATCH 177/568] Translated using Weblate (Indonesian) Currently translated at 100.0% (68 of 68 strings) --- application/language/id/giftcards_lang.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/application/language/id/giftcards_lang.php b/application/language/id/giftcards_lang.php index 467ce611c..8017960aa 100644 --- a/application/language/id/giftcards_lang.php +++ b/application/language/id/giftcards_lang.php @@ -1,5 +1,4 @@ - Date: Fri, 17 Aug 2018 07:54:15 +0000 Subject: [PATCH 178/568] Translated using Weblate (Indonesian) Currently translated at 100.0% (18 of 18 strings) Translation: opensourcepos/expenses_categories Translate-URL: http://weblate.jpeelaer.net/projects/ospos/expenses_categories/id/ --- .../language/id/expenses_categories_lang.php | 39 ++++++------ application/language/id/taxes_lang.php | 63 +++++++++---------- 2 files changed, 50 insertions(+), 52 deletions(-) diff --git a/application/language/id/expenses_categories_lang.php b/application/language/id/expenses_categories_lang.php index 54b71323c..09030c4e8 100644 --- a/application/language/id/expenses_categories_lang.php +++ b/application/language/id/expenses_categories_lang.php @@ -1,20 +1,19 @@ - Date: Fri, 17 Aug 2018 08:12:26 +0000 Subject: [PATCH 179/568] Translated using Weblate (Indonesian) Currently translated at 100.0% (35 of 35 strings) --- application/language/el/common_lang.php | 53 ++++++++++++++++++++++ application/language/id/employees_lang.php | 21 ++++----- 2 files changed, 63 insertions(+), 11 deletions(-) diff --git a/application/language/el/common_lang.php b/application/language/el/common_lang.php index b3d9bbc7f..c09c5f7c9 100644 --- a/application/language/el/common_lang.php +++ b/application/language/el/common_lang.php @@ -1 +1,54 @@ Date: Fri, 17 Aug 2018 08:17:51 +0000 Subject: [PATCH 180/568] Translated using Weblate (Indonesian) Currently translated at 100.0% (104 of 104 strings) --- application/language/id/items_lang.php | 35 +++++++++++++------------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/application/language/id/items_lang.php b/application/language/id/items_lang.php index dfae51e13..6d77e0060 100644 --- a/application/language/id/items_lang.php +++ b/application/language/id/items_lang.php @@ -1,9 +1,8 @@ - Date: Sat, 18 Aug 2018 02:01:21 +0000 Subject: [PATCH 181/568] Translated using Weblate (Indonesian) Currently translated at 100.0% (17 of 17 strings) --- application/language/id/module_lang.php | 5 ++--- application/language/id/receivings_lang.php | 5 ++--- application/language/id/suppliers_lang.php | 5 ++--- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/application/language/id/module_lang.php b/application/language/id/module_lang.php index 3909364aa..189836fbd 100644 --- a/application/language/id/module_lang.php +++ b/application/language/id/module_lang.php @@ -1,5 +1,4 @@ - Date: Sat, 25 Aug 2018 10:12:24 +0000 Subject: [PATCH 182/568] Added translation using Weblate (Romanian) --- application/language/ro/bootstrap_tables_lang.php | 1 + 1 file changed, 1 insertion(+) create mode 100644 application/language/ro/bootstrap_tables_lang.php diff --git a/application/language/ro/bootstrap_tables_lang.php b/application/language/ro/bootstrap_tables_lang.php new file mode 100644 index 000000000..b3d9bbc7f --- /dev/null +++ b/application/language/ro/bootstrap_tables_lang.php @@ -0,0 +1 @@ + Date: Mon, 3 Sep 2018 11:53:53 +0000 Subject: [PATCH 183/568] Translated using Weblate (Romanian) Currently translated at 75.0% (6 of 8 strings) --- application/language/ro/bootstrap_tables_lang.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/application/language/ro/bootstrap_tables_lang.php b/application/language/ro/bootstrap_tables_lang.php index b3d9bbc7f..a917ff42f 100644 --- a/application/language/ro/bootstrap_tables_lang.php +++ b/application/language/ro/bootstrap_tables_lang.php @@ -1 +1,7 @@ Date: Mon, 3 Sep 2018 11:58:41 +0000 Subject: [PATCH 184/568] Translated using Weblate (Romanian) Currently translated at 100.0% (8 of 8 strings) Romanian people know what means Refresh, --- application/language/ro/bootstrap_tables_lang.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/application/language/ro/bootstrap_tables_lang.php b/application/language/ro/bootstrap_tables_lang.php index a917ff42f..74389defc 100644 --- a/application/language/ro/bootstrap_tables_lang.php +++ b/application/language/ro/bootstrap_tables_lang.php @@ -4,4 +4,6 @@ $lang["tables_columns"] = "Coloane"; $lang["tables_hide_show_pagination"] = "Ascunde/Arată paginare"; $lang["tables_loading"] = "Se încarcă, vă rugăm așteptați..."; $lang["tables_page_from_to"] = "Arată {0} până la {1} din {2} rânduri"; -$lang["tables_refresh"] = "Refresh"; +$lang["tables_refresh"] = "Reîmprospătare"; +$lang["tables_rows_per_page"] = "{0} rânduri per pagină"; +$lang["tables_toggle"] = "Comută"; From 6aff17a2127ed9b7ed05cf35347beeef43851100 Mon Sep 17 00:00:00 2001 From: Emanuel Ioan Cretu Date: Mon, 3 Sep 2018 12:01:47 +0000 Subject: [PATCH 185/568] Added translation using Weblate (Romanian) --- application/language/ro/common_lang.php | 1 + 1 file changed, 1 insertion(+) create mode 100644 application/language/ro/common_lang.php diff --git a/application/language/ro/common_lang.php b/application/language/ro/common_lang.php new file mode 100644 index 000000000..b3d9bbc7f --- /dev/null +++ b/application/language/ro/common_lang.php @@ -0,0 +1 @@ + Date: Mon, 3 Sep 2018 12:02:41 +0000 Subject: [PATCH 186/568] Translated using Weblate (Romanian) Currently translated at 100.0% (65 of 65 strings) --- application/language/ro/common_lang.php | 65 +++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/application/language/ro/common_lang.php b/application/language/ro/common_lang.php index b3d9bbc7f..1eee72d5e 100644 --- a/application/language/ro/common_lang.php +++ b/application/language/ro/common_lang.php @@ -1 +1,66 @@ Date: Mon, 3 Sep 2018 12:16:06 +0000 Subject: [PATCH 187/568] Added translation using Weblate (Romanian) --- application/language/ro/config_lang.php | 1 + 1 file changed, 1 insertion(+) create mode 100644 application/language/ro/config_lang.php diff --git a/application/language/ro/config_lang.php b/application/language/ro/config_lang.php new file mode 100644 index 000000000..b3d9bbc7f --- /dev/null +++ b/application/language/ro/config_lang.php @@ -0,0 +1 @@ + Date: Wed, 5 Sep 2018 08:46:54 +0200 Subject: [PATCH 188/568] Update thai translations --- application/language/th/common_lang.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/language/th/common_lang.php b/application/language/th/common_lang.php index 78f49743d..806ba1cbf 100644 --- a/application/language/th/common_lang.php +++ b/application/language/th/common_lang.php @@ -62,6 +62,6 @@ $lang["common_unknown"] = "ไม่ทราบ"; $lang["common_view_recent_sales"] = "การขายล่าสุด"; $lang["common_website"] = "website"; $lang["common_welcome"] = "ยินดีต้อนรับ"; -$lang["common_welcome_message"] = "OSPOS. กรุณาเลือกคำสั่งเมนูด้านล่าง "; +$lang["common_welcome_message"] = "OSPOS. กรุณาเลือกโมดูลด้านล่าง เพื่อเริ่ม"; $lang["common_you_are_using_ospos"] = "คุณกำลังใช้ Open Source Point Of Sale รุ่น"; $lang["common_zip"] = "รหัสไปรษณีย์"; From 9ca63e1b553c47c52b24c4d84332fba4e814f796 Mon Sep 17 00:00:00 2001 From: jekkos Date: Wed, 5 Sep 2018 21:10:12 +0200 Subject: [PATCH 189/568] Add credits --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index d97948295..d6b6ef721 100644 --- a/README.md +++ b/README.md @@ -144,3 +144,10 @@ FAQ * If you install ospos in docker behind a proxy that performs ssloffloading, you can enable the url generated to be https instead of http, by activating the environment variable FORCE_HTTPS = 1. * If you have suhosin installed and face an issue with CSRF, please make sure you read [issue #1492](https://github.com/opensourcepos/opensourcepos/issues/1492). + +Credits +------- +|JetBrains|Travis CI| +|:-:|:-:| +|![IntelliJ IDEA](https://raw.githubusercontent.com/wiki/j-easy/easy-batch/images/logo/intellijidea-logo.png)|[Travis CI](https://travis-ci.com/images/logos/TravisCI-Full-Color.png)| +|Many thanks to [JetBrains](https://www.jetbrains.com/) for providing a free license of [IntelliJ IDEA](https://www.jetbrains.com/idea/) to kindly support the development of OSPOS|Many thanks to [Travis CI](https://travis-ci.org) for providing a free continuous integration service for open source projects.| From d81ff114834bce3f2bff1432ff1192eecfbdbbc0 Mon Sep 17 00:00:00 2001 From: jekkos Date: Thu, 6 Sep 2018 09:37:09 +0200 Subject: [PATCH 190/568] Remove docker-cloud + stop pushing sqlscript (#2120, #1939) --- .travis.yml | 4 +--- docker-cloud.yml | 29 ----------------------------- 2 files changed, 1 insertion(+), 32 deletions(-) delete mode 100644 docker-cloud.yml diff --git a/.travis.yml b/.travis.yml index 602bc3d0f..d4fe152bd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,9 +23,7 @@ script: env: - TAG=$(echo ${TRAVIS_BRANCH} | sed s/feature\\///) after_success: '[ -n ${DOCKER_USERNAME} ] && docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" - && docker tag opensourcepos_php "jekkos/opensourcepos:$TAG" && docker tag opensourcepos_sqlscript - jekkos/opensourcepos:sqlscript && docker push "jekkos/opensourcepos:$TAG" && docker - push jekkos/opensourcepos:sqlscript' + && docker tag opensourcepos_php "jekkos/opensourcepos:$TAG" && docker push "jekkos/opensourcepos:$TAG"' deploy: edge: source: travis-ci/dpl diff --git a/docker-cloud.yml b/docker-cloud.yml deleted file mode 100644 index c0bff1208..000000000 --- a/docker-cloud.yml +++ /dev/null @@ -1,29 +0,0 @@ -sqlscript: - image: jekkos/opensourcepos:sqlscript -web: - image: jekkos/opensourcepos:master - links: - - mysql - ports: - - "80:80" - roles: - - global - volumes: - - /app/public/uploads - environment: - - PHP_TIMEZONE=UTC - - MYSQL_USERNAME=admin - - MYSQL_PASSWORD=pointofsale - - MYSQL_DB_NAME=ospos - - MYSQL_HOST_NAME=mysql -mysql: - image: mariadb:10.1.21 - environment: - - MYSQL_ROOT_PASSWORD=pointofsale - - MYSQL_DATABASE=ospos - - MYSQL_USER=admin - - MYSQL_PASSWORD=pointofsale - ports: - - 3306:3306 - volumes_from: - - sqlscript From f19147b2014032ef4145312bfda24e41c34f0cd8 Mon Sep 17 00:00:00 2001 From: jekkos Date: Thu, 6 Sep 2018 14:23:16 +0200 Subject: [PATCH 191/568] Fix employee name on receipt/invoice (#2108) --- application/controllers/Sales.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/application/controllers/Sales.php b/application/controllers/Sales.php index 754e0861d..cf1bd232c 100644 --- a/application/controllers/Sales.php +++ b/application/controllers/Sales.php @@ -514,13 +514,14 @@ class Sales extends Secure_Controller $data = array(); $data['dinner_table'] = $this->sale_lib->get_dinner_table(); $data['cart'] = $this->sale_lib->get_cart(); + $data['transaction_time'] = date($this->config->item('dateformat') . ' ' . $this->config->item('timeformat')); $data['transaction_date'] = date($this->config->item('dateformat')); $data['show_stock_locations'] = $this->Stock_location->show_locations('sales'); $data['comments'] = $this->sale_lib->get_comment(); $employee_id = $this->Employee->get_logged_in_employee_info()->person_id; $employee_info = $this->Employee->get_info($employee_id); - $data['employee'] = $employee_info->first_name . ' ' . $employee_info->last_name[0]; + $data['employee'] = $employee_info->first_name . ' ' . mb_substr($employee_info->last_name, 0, 1); $data['company_info'] = implode("\n", array( $this->config->item('address'), $this->config->item('phone'), @@ -941,7 +942,7 @@ class Sales extends Secure_Controller $data['amount_change'] = $data['amount_due'] * -1; $employee_info = $this->Employee->get_info($this->sale_lib->get_employee()); - $data['employee'] = $employee_info->first_name . ' ' . $employee_info->last_name[0]; + $data['employee'] = $employee_info->first_name . ' ' . mb_substr($employee_info->last_name, 0, 1); $this->_load_customer_data($this->sale_lib->get_customer(), $data); $data['sale_id_num'] = $sale_id; From 2605dff9b740d722d7bf308e32eb64998736e61e Mon Sep 17 00:00:00 2001 From: jekkos Date: Fri, 7 Sep 2018 00:38:11 +0200 Subject: [PATCH 192/568] Fix colspan in receivings --- application/views/receivings/receiving.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/receivings/receiving.php b/application/views/receivings/receiving.php index ea1b6aed4..516c472e3 100644 --- a/application/views/receivings/receiving.php +++ b/application/views/receivings/receiving.php @@ -217,7 +217,7 @@ if (isset($success)) } ?> - + Date: Fri, 7 Sep 2018 16:04:00 +0000 Subject: [PATCH 193/568] Translated using Weblate (Flemish) Currently translated at 100.0% (17 of 17 strings) --- application/language/nl-BE/suppliers_lang.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/application/language/nl-BE/suppliers_lang.php b/application/language/nl-BE/suppliers_lang.php index 83db5c931..5684f7e5b 100755 --- a/application/language/nl-BE/suppliers_lang.php +++ b/application/language/nl-BE/suppliers_lang.php @@ -1,12 +1,11 @@ - Date: Fri, 7 Sep 2018 16:05:26 +0000 Subject: [PATCH 194/568] Translated using Weblate (Flemish) Currently translated at 100.0% (271 of 271 strings) --- application/language/nl-BE/config_lang.php | 27 +++++++++++----------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/application/language/nl-BE/config_lang.php b/application/language/nl-BE/config_lang.php index 4b013d635..71deb436e 100755 --- a/application/language/nl-BE/config_lang.php +++ b/application/language/nl-BE/config_lang.php @@ -1,5 +1,4 @@ - Date: Fri, 7 Sep 2018 16:14:08 +0000 Subject: [PATCH 195/568] Translated using Weblate (Flemish) Currently translated at 100.0% (51 of 51 strings) --- application/language/nl-BE/receivings_lang.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/application/language/nl-BE/receivings_lang.php b/application/language/nl-BE/receivings_lang.php index f10f9241c..2211e526d 100755 --- a/application/language/nl-BE/receivings_lang.php +++ b/application/language/nl-BE/receivings_lang.php @@ -1,5 +1,4 @@ - Date: Fri, 7 Sep 2018 16:13:47 +0000 Subject: [PATCH 196/568] Translated using Weblate (Flemish) Currently translated at 100.0% (271 of 271 strings) --- application/language/nl-BE/config_lang.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/language/nl-BE/config_lang.php b/application/language/nl-BE/config_lang.php index 71deb436e..a7353e2f4 100755 --- a/application/language/nl-BE/config_lang.php +++ b/application/language/nl-BE/config_lang.php @@ -162,7 +162,7 @@ $lang["config_locale_info"] = "Locatie Configuratie Informatie"; $lang["config_location"] = "Voorraad"; $lang["config_location_configuration"] = "Stock Locaties"; $lang["config_location_info"] = "Instellingen Locatie"; -$lang["config_logout"] = "Wilt u een backup maken alvorens uit te loggen?"; +$lang["config_logout"] = "Wilt u een backup maken alvorens uit te loggen? Klik [OK] voor backup of [Annuleer] om uit te loggen."; $lang["config_mailchimp"] = "Mailchimp"; $lang["config_mailchimp_api_key"] = "Mailchimp API Sleutel"; $lang["config_mailchimp_configuration"] = "Mailchimp Configuratie"; From 11564228bf5e111a4643446e824bbb5f0b0cedce Mon Sep 17 00:00:00 2001 From: Aril Apria Susanto Date: Sat, 11 Aug 2018 00:06:14 +0000 Subject: [PATCH 197/568] Translated using Weblate (Indonesian) Currently translated at 97.7% (265 of 271 strings) --- application/language/id/config_lang.php | 175 ++++++++++++------------ 1 file changed, 87 insertions(+), 88 deletions(-) diff --git a/application/language/id/config_lang.php b/application/language/id/config_lang.php index 8e716bc3d..1f46bc1e7 100644 --- a/application/language/id/config_lang.php +++ b/application/language/id/config_lang.php @@ -1,7 +1,6 @@ - Date: Mon, 3 Sep 2018 12:16:54 +0000 Subject: [PATCH 198/568] Translated using Weblate (Romanian) Currently translated at 13.2% (36 of 271 strings) --- application/language/ro/config_lang.php | 39 +++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/application/language/ro/config_lang.php b/application/language/ro/config_lang.php index b3d9bbc7f..8fa4c2875 100644 --- a/application/language/ro/config_lang.php +++ b/application/language/ro/config_lang.php @@ -1 +1,40 @@ Date: Sat, 11 Aug 2018 00:25:01 +0000 Subject: [PATCH 199/568] Translated using Weblate (Indonesian) Currently translated at 100.0% (48 of 48 strings) --- application/language/id/customers_lang.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/application/language/id/customers_lang.php b/application/language/id/customers_lang.php index 00def20af..2843e25d9 100644 --- a/application/language/id/customers_lang.php +++ b/application/language/id/customers_lang.php @@ -1,6 +1,6 @@ Date: Fri, 7 Sep 2018 17:13:41 +0000 Subject: [PATCH 200/568] Translated using Weblate (Flemish) Currently translated at 100.0% (35 of 35 strings) --- application/language/nl-BE/employees_lang.php | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/application/language/nl-BE/employees_lang.php b/application/language/nl-BE/employees_lang.php index 4a041f4b2..e5c359256 100755 --- a/application/language/nl-BE/employees_lang.php +++ b/application/language/nl-BE/employees_lang.php @@ -1,5 +1,4 @@ - Date: Fri, 17 Aug 2018 08:15:17 +0000 Subject: [PATCH 201/568] Translated using Weblate (Indonesian) Currently translated at 100.0% (35 of 35 strings) --- application/language/id/employees_lang.php | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/application/language/id/employees_lang.php b/application/language/id/employees_lang.php index 047ee130f..01091f8b0 100644 --- a/application/language/id/employees_lang.php +++ b/application/language/id/employees_lang.php @@ -1,30 +1,30 @@ Date: Sat, 11 Aug 2018 00:33:25 +0000 Subject: [PATCH 202/568] Translated using Weblate (Indonesian) Currently translated at 57.1% (4 of 7 strings) Translation: opensourcepos/enum Translate-URL: http://weblate.jpeelaer.net/projects/ospos/enum/id/ --- application/language/id/enum_lang.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/application/language/id/enum_lang.php b/application/language/id/enum_lang.php index dde09937b..9ad0bec15 100644 --- a/application/language/id/enum_lang.php +++ b/application/language/id/enum_lang.php @@ -1,9 +1,8 @@ - Date: Thu, 9 Aug 2018 20:59:37 +0000 Subject: [PATCH 203/568] Translated using Weblate (Portuguese (Brazil)) Currently translated at 85.7% (6 of 7 strings) Translation: opensourcepos/enum Translate-URL: http://weblate.jpeelaer.net/projects/ospos/enum/pt_BR/ --- application/language/pt-BR/enum_lang.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/language/pt-BR/enum_lang.php b/application/language/pt-BR/enum_lang.php index b61fd63e3..593f5bd05 100644 --- a/application/language/pt-BR/enum_lang.php +++ b/application/language/pt-BR/enum_lang.php @@ -2,7 +2,7 @@ $lang["enum_half_down"] = "Metade para baixo"; $lang["enum_half_even"] = "Metade"; $lang["enum_half_five"] = "Metade cinco"; -$lang["enum_half_odd"] = "Meio estranho"; +$lang["enum_half_odd"] = "Meio"; $lang["enum_half_up"] = "Para cima"; $lang["enum_round_down"] = "Arredondar para baixo"; $lang["enum_round_up"] = "Arredondar para cima"; From 02890a528f39311faf01727d703b93d8d7fd43ee Mon Sep 17 00:00:00 2001 From: Songwut Kanchanakosai Date: Tue, 19 Jun 2018 06:12:56 +0000 Subject: [PATCH 204/568] Translated using Weblate (Thai) Currently translated at 71.4% (5 of 7 strings) Translation: opensourcepos/enum Translate-URL: http://weblate.jpeelaer.net/projects/ospos/enum/th/ --- application/language/th/enum_lang.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/application/language/th/enum_lang.php b/application/language/th/enum_lang.php index dde09937b..d0389bf21 100644 --- a/application/language/th/enum_lang.php +++ b/application/language/th/enum_lang.php @@ -1,9 +1,8 @@ - Date: Fri, 17 Aug 2018 07:26:17 +0000 Subject: [PATCH 205/568] Translated using Weblate (Indonesian) Currently translated at 95.3% (41 of 43 strings) Translation: opensourcepos/expenses Translate-URL: http://weblate.jpeelaer.net/projects/ospos/expenses/id/ --- application/language/id/expenses_lang.php | 85 +++++++++++------------ 1 file changed, 42 insertions(+), 43 deletions(-) diff --git a/application/language/id/expenses_lang.php b/application/language/id/expenses_lang.php index 5f57bc7dc..dfc4bb8cb 100644 --- a/application/language/id/expenses_lang.php +++ b/application/language/id/expenses_lang.php @@ -1,45 +1,44 @@ - Date: Tue, 19 Jun 2018 06:21:20 +0000 Subject: [PATCH 206/568] Translated using Weblate (Thai) Currently translated at 51.1% (22 of 43 strings) Translation: opensourcepos/expenses Translate-URL: http://weblate.jpeelaer.net/projects/ospos/expenses/th/ --- application/language/th/expenses_lang.php | 47 +++++++++++------------ 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/application/language/th/expenses_lang.php b/application/language/th/expenses_lang.php index 5f57bc7dc..1d892e4d3 100644 --- a/application/language/th/expenses_lang.php +++ b/application/language/th/expenses_lang.php @@ -1,44 +1,43 @@ - Date: Fri, 7 Sep 2018 17:07:50 +0000 Subject: [PATCH 207/568] Translated using Weblate (Flemish) Currently translated at 94.4% (17 of 18 strings) Translation: opensourcepos/expenses_categories Translate-URL: http://weblate.jpeelaer.net/projects/ospos/expenses_categories/nl_BE/ --- .../nl-BE/expenses_categories_lang.php | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/application/language/nl-BE/expenses_categories_lang.php b/application/language/nl-BE/expenses_categories_lang.php index ebbd9522b..dde7cadcd 100644 --- a/application/language/nl-BE/expenses_categories_lang.php +++ b/application/language/nl-BE/expenses_categories_lang.php @@ -1,20 +1,19 @@ - Date: Tue, 14 Aug 2018 02:53:35 +0000 Subject: [PATCH 208/568] Translated using Weblate (Indonesian) Currently translated at 100.0% (68 of 68 strings) --- application/language/id/giftcards_lang.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/application/language/id/giftcards_lang.php b/application/language/id/giftcards_lang.php index 8017960aa..d31a2e374 100644 --- a/application/language/id/giftcards_lang.php +++ b/application/language/id/giftcards_lang.php @@ -1,14 +1,14 @@ Date: Sat, 11 Aug 2018 00:27:04 +0000 Subject: [PATCH 209/568] Translated using Weblate (Indonesian) Currently translated at 96.6% (29 of 30 strings) --- application/language/id/item_kits_lang.php | 23 +++++++++++----------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/application/language/id/item_kits_lang.php b/application/language/id/item_kits_lang.php index de0a1987e..f06839673 100644 --- a/application/language/id/item_kits_lang.php +++ b/application/language/id/item_kits_lang.php @@ -1,31 +1,30 @@ - Date: Fri, 17 Aug 2018 08:25:35 +0000 Subject: [PATCH 210/568] Translated using Weblate (Indonesian) Currently translated at 100.0% (104 of 104 strings) --- application/language/id/items_lang.php | 48 +++++++++++++------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/application/language/id/items_lang.php b/application/language/id/items_lang.php index 6d77e0060..d89b90822 100644 --- a/application/language/id/items_lang.php +++ b/application/language/id/items_lang.php @@ -1,40 +1,40 @@ Date: Fri, 17 Aug 2018 08:41:20 +0000 Subject: [PATCH 211/568] Translated using Weblate (Indonesian) Currently translated at 100.0% (35 of 35 strings) Translation: opensourcepos/module Translate-URL: http://weblate.jpeelaer.net/projects/ospos/module/id/ --- application/language/id/module_lang.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/application/language/id/module_lang.php b/application/language/id/module_lang.php index 189836fbd..2289dd375 100644 --- a/application/language/id/module_lang.php +++ b/application/language/id/module_lang.php @@ -1,36 +1,36 @@ Date: Fri, 7 Sep 2018 16:14:25 +0000 Subject: [PATCH 212/568] Translated using Weblate (Flemish) Currently translated at 100.0% (51 of 51 strings) --- .../language/nl-BE/receivings_lang.php | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/application/language/nl-BE/receivings_lang.php b/application/language/nl-BE/receivings_lang.php index 2211e526d..57a1a4b57 100755 --- a/application/language/nl-BE/receivings_lang.php +++ b/application/language/nl-BE/receivings_lang.php @@ -1,22 +1,22 @@ Date: Fri, 7 Sep 2018 17:15:43 +0000 Subject: [PATCH 213/568] Translated using Weblate (Flemish) Currently translated at 99.0% (109 of 110 strings) --- application/language/nl-BE/reports_lang.php | 59 ++++++++++----------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/application/language/nl-BE/reports_lang.php b/application/language/nl-BE/reports_lang.php index 89261107a..036929159 100755 --- a/application/language/nl-BE/reports_lang.php +++ b/application/language/nl-BE/reports_lang.php @@ -1,22 +1,21 @@ - Date: Sat, 11 Aug 2018 00:36:40 +0000 Subject: [PATCH 214/568] Translated using Weblate (Indonesian) Currently translated at 94.5% (104 of 110 strings) --- application/language/id/reports_lang.php | 45 ++++++++++++------------ 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/application/language/id/reports_lang.php b/application/language/id/reports_lang.php index fb99652f3..32d6f9464 100644 --- a/application/language/id/reports_lang.php +++ b/application/language/id/reports_lang.php @@ -1,23 +1,22 @@ - Date: Fri, 7 Sep 2018 16:04:14 +0000 Subject: [PATCH 215/568] Translated using Weblate (Flemish) Currently translated at 100.0% (17 of 17 strings) --- application/language/nl-BE/suppliers_lang.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/language/nl-BE/suppliers_lang.php b/application/language/nl-BE/suppliers_lang.php index 5684f7e5b..1e74bc19c 100755 --- a/application/language/nl-BE/suppliers_lang.php +++ b/application/language/nl-BE/suppliers_lang.php @@ -3,12 +3,12 @@ $lang["suppliers_account_number"] = "Btw nummer"; $lang["suppliers_agency_name"] = "Agencynaam"; $lang["suppliers_cannot_be_deleted"] = "De geselecteeerde leveranciers konden niet worden verwijderd. Eén of meerdere leveranciers hebben ordergegevens in de database zitten."; $lang["suppliers_company_name"] = "Leverancier"; -$lang["suppliers_company_name_required"] = "Bedrijfsnaam moet ingevuld worden"; +$lang["suppliers_company_name_required"] = "Bedrijfsnaam moet ingevuld worden."; $lang["suppliers_confirm_delete"] = "Bent u zeker dat u de geselecteerde leveranciers wil verwijderen?"; $lang["suppliers_confirm_restore"] = "Bent u zeker dat u de geselecteerde leverancier(s) wil herstellen?"; -$lang["suppliers_error_adding_updating"] = "Fout bij het toevoegen/aanpassen van een leverancier"; +$lang["suppliers_error_adding_updating"] = "Fout bij het toevoegen/aanpassen van een leverancier."; $lang["suppliers_new"] = "N. Leverancier"; -$lang["suppliers_none_selected"] = "U hebt geen leveranciers geselecteerd"; +$lang["suppliers_none_selected"] = "U hebt geen leveranciers geselecteerd om te verwijderen."; $lang["suppliers_one_or_multiple"] = "leverancier(s) verwijderd"; $lang["suppliers_successful_adding"] = "Leverancier succesvol toegevoegd"; $lang["suppliers_successful_deleted"] = "Er werd(en)"; From 0bcee8eff2e381f53741ee346a1fbd7a36a2482f Mon Sep 17 00:00:00 2001 From: Aril Apria Susanto Date: Sat, 18 Aug 2018 02:01:36 +0000 Subject: [PATCH 216/568] Translated using Weblate (Indonesian) Currently translated at 100.0% (17 of 17 strings) --- application/language/id/suppliers_lang.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/language/id/suppliers_lang.php b/application/language/id/suppliers_lang.php index 7db81d285..f4528cae7 100644 --- a/application/language/id/suppliers_lang.php +++ b/application/language/id/suppliers_lang.php @@ -3,12 +3,12 @@ $lang["suppliers_account_number"] = "Nomor Akun Pemasok"; $lang["suppliers_agency_name"] = "Nama"; $lang["suppliers_cannot_be_deleted"] = "Tidak bisa dihapus pemasok yang dipilih, satu atau lebih dari pemasok yang dipilih memiliki penjualan."; $lang["suppliers_company_name"] = "Nama Perusahaan"; -$lang["suppliers_company_name_required"] = "Nama Perusahaan wajib diisi"; +$lang["suppliers_company_name_required"] = "Nama Perusahaan wajib diisi."; $lang["suppliers_confirm_delete"] = "Apakah Anda yakin ingin menghapus pemasok yang dipilih?"; $lang["suppliers_confirm_restore"] = "Anda yakin ingin mengembalikan Pemasok terpilih?"; -$lang["suppliers_error_adding_updating"] = "Kesalahan Menambah / memperbarui data pemasok"; +$lang["suppliers_error_adding_updating"] = "Kesalahan Menambah / memperbarui data pemasok."; $lang["suppliers_new"] = "Pemasok Baru"; -$lang["suppliers_none_selected"] = "Anda belum memilih pemasok untuk dihapus"; +$lang["suppliers_none_selected"] = "Anda belum memilih pemasok untuk dihapus."; $lang["suppliers_one_or_multiple"] = "Pemasok"; $lang["suppliers_successful_adding"] = "Anda telah berhasil menambahkan data pemasok"; $lang["suppliers_successful_deleted"] = "Anda telah berhasil menghapus data pemasok"; From e52634bd06546696fd37b24297c31c6e1f0ee472 Mon Sep 17 00:00:00 2001 From: Weblate Date: Fri, 7 Sep 2018 19:50:37 +0200 Subject: [PATCH 217/568] Update German + Flemish --- application/language/de/config_lang.php | 5 +- application/language/nl-BE/sales_lang.php | 89 +++++++++++------------ 2 files changed, 46 insertions(+), 48 deletions(-) diff --git a/application/language/de/config_lang.php b/application/language/de/config_lang.php index 00142f52b..0ba91190d 100644 --- a/application/language/de/config_lang.php +++ b/application/language/de/config_lang.php @@ -1,8 +1,7 @@ - Date: Fri, 7 Sep 2018 17:55:48 +0000 Subject: [PATCH 218/568] Translated using Weblate (Flemish) Currently translated at 99.3% (161 of 162 strings) --- application/language/nl-BE/sales_lang.php | 34 +++++++++++------------ 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/application/language/nl-BE/sales_lang.php b/application/language/nl-BE/sales_lang.php index 6f732d04d..2a99d7c90 100755 --- a/application/language/nl-BE/sales_lang.php +++ b/application/language/nl-BE/sales_lang.php @@ -32,13 +32,13 @@ $lang["sales_customer_required"] = "(Vereist)"; $lang["sales_customer_total"] = "Totaal"; $lang["sales_date"] = "Datum"; $lang["sales_date_range"] = "Periode"; -$lang["sales_date_required"] = "Gelieve een correcte datum in te vullen"; -$lang["sales_date_type"] = "Er moet een correcte datum ingevuld worden"; +$lang["sales_date_required"] = "Gelieve een correcte datum in te vullen."; +$lang["sales_date_type"] = "Er moet een correcte datum ingevuld worden."; $lang["sales_debit"] = "Bancontact"; $lang["sales_delete"] = "Verwijderen Toegestaan"; $lang["sales_delete_confirmation"] = "Bent u zeker dat u deze aankoop wil verwijderen?"; $lang["sales_delete_entire_sale"] = "Verwijder"; -$lang["sales_delete_successful"] = "De geselecteerde aanko(o)p(en) werden verwijderd"; +$lang["sales_delete_successful"] = "De geselecteerde verko(o)p(en) werden verwijderd."; $lang["sales_delete_unsuccessful"] = "De geselecteerde aankopen konden niet worden verwijderd."; $lang["sales_description_abbrv"] = "Omschr."; $lang["sales_discard"] = "Annuleer"; @@ -62,7 +62,7 @@ $lang["sales_giftcard_balance"] = "Cadeaubon Resterend"; $lang["sales_giftcard_number"] = "Cadeaubon nummer"; $lang["sales_group_by_category"] = "Per Categorie"; $lang["sales_group_by_type"] = "Per Type"; -$lang["sales_id"] = "Nummer Verkoop "; +$lang["sales_id"] = "Verkoop ID"; $lang["sales_include_prices"] = "Prijzen inclusief?"; $lang["sales_invoice"] = "Factuur"; $lang["sales_invoice_confirm"] = "Deze factuur zal verstuurd worden naar"; @@ -70,35 +70,35 @@ $lang["sales_invoice_enable"] = "Maak Factuur"; $lang["sales_invoice_filter"] = "Facturen"; $lang["sales_invoice_no_email"] = "Er werd geen email adres gevonden voor deze klant."; $lang["sales_invoice_number"] = "Factuur #"; -$lang["sales_invoice_number_duplicate"] = "Vul een unieke nummer in"; +$lang["sales_invoice_number_duplicate"] = "Vul een uniek factuurnummer in."; $lang["sales_invoice_sent"] = "Factuur verstuurd naar"; $lang["sales_invoice_unsent"] = "Fout bij het versturen van factuur naar"; $lang["sales_invoice_update"] = "Hernummer"; -$lang["sales_item_insufficient_of_stock"] = "Product is niet meer in voorraad"; +$lang["sales_item_insufficient_of_stock"] = "Product is niet meer in voorraad."; $lang["sales_item_name"] = "Naam"; $lang["sales_item_number"] = "Product #"; -$lang["sales_item_out_of_stock"] = "Product is niet meer in voorraad"; +$lang["sales_item_out_of_stock"] = "Product is niet meer in voorraad."; $lang["sales_mode"] = "Type Registratie"; -$lang["sales_must_enter_numeric"] = "Het ontvangen bedrag moet een numerieke waarde zijn"; -$lang["sales_must_enter_numeric_giftcard"] = "Er moet een geldige code worden ingevuld voor de cadeaubon"; +$lang["sales_must_enter_numeric"] = "Het ontvangen bedrag moet een numerieke waarde zijn."; +$lang["sales_must_enter_numeric_giftcard"] = "Er moet een geldige code worden ingevuld voor de cadeaubon."; $lang["sales_new_customer"] = "Nieuwe klant"; $lang["sales_new_item"] = "Nieuw Product"; $lang["sales_no_description"] = "Geen"; $lang["sales_no_filter"] = "Alle"; -$lang["sales_no_items_in_cart"] = "Er zijn geen aankopen geselecteerd"; -$lang["sales_no_sales_to_display"] = "Er werden geen aankopen gevonden"; -$lang["sales_none_selected"] = "U hebt geen aankopen geselecteerd"; +$lang["sales_no_items_in_cart"] = "Er zijn geen verkopen geselecteerd."; +$lang["sales_no_sales_to_display"] = "Er werden geen verkopen gevonden."; +$lang["sales_none_selected"] = "U hebt geen verkopen geselecteerd."; $lang["sales_not_authorized"] = "Deze actie is niet toegestaan."; -$lang["sales_one_or_multiple"] = "aankopen verwijderd"; +$lang["sales_one_or_multiple"] = "Verkopen verwijderd."; $lang["sales_payment"] = "Betaalmethode"; $lang["sales_payment_amount"] = "Bedrag"; -$lang["sales_payment_not_cover_total"] = "Betaalde hoeveelheid is onvoldoende"; +$lang["sales_payment_not_cover_total"] = "Betaalde hoeveelheid is onvoldoende."; $lang["sales_payment_type"] = "Type"; $lang["sales_payments_total"] = "Betaald bedrag"; $lang["sales_price"] = "Prijs"; $lang["sales_print_after_sale"] = "Print Ticket"; $lang["sales_quantity"] = "Aantal"; -$lang["sales_quantity_less_than_reorder_level"] = "Waarschuwing, de gewenste hoeveelheid stock is overgeschreden."; +$lang["sales_quantity_less_than_reorder_level"] = "Waarschuwing, de gewenste hoeveelheid stock is overschreden."; $lang["sales_quantity_less_than_zero"] = "Waarschuwing, de gewenste hoeveelheid is onvoldoende. U kunt deze aankoop verwerken, maar kijk toch even de voorraad na."; $lang["sales_quantity_of_items"] = "Hoeveelheid van 1% items"; $lang["sales_quote"] = "Offerte"; @@ -122,9 +122,9 @@ $lang["sales_sale_for_customer"] = "Klant:"; $lang["sales_sale_time"] = "Datum"; $lang["sales_sales_tax"] = "VAT"; $lang["sales_select_customer"] = "Selecteer Klant"; -$lang["sales_send_invoice"] = "Vestuur Factuur"; +$lang["sales_send_invoice"] = "Verstuur Factuur"; $lang["sales_send_quote"] = "Verstuur Offerte"; -$lang["sales_send_receipt"] = "Vestuur Ticket"; +$lang["sales_send_receipt"] = "Verstuur Ticket"; $lang["sales_send_work_order"] = "Verstuur Werkorder"; $lang["sales_serial"] = "Nummer"; $lang["sales_show_invoice"] = "Toon Factuur"; From 82a228fa999c9439405c452ea7fb7122597e3b46 Mon Sep 17 00:00:00 2001 From: Erastus Date: Fri, 7 Sep 2018 16:35:52 -0500 Subject: [PATCH 219/568] fixed in specific_customer change discount_fixed for discount_type --- application/models/reports/Specific_customer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/reports/Specific_customer.php b/application/models/reports/Specific_customer.php index ad7f57a2f..1184f351c 100644 --- a/application/models/reports/Specific_customer.php +++ b/application/models/reports/Specific_customer.php @@ -127,7 +127,7 @@ class Specific_customer extends Report foreach($data['summary'] as $key=>$value) { - $this->db->select('name, category, serialnumber, description, quantity_purchased, subtotal, tax, total, cost, profit, discount_percent, discount_fixed'); + $this->db->select('name, category, serialnumber, description, quantity_purchased, subtotal, tax, total, cost, profit, discount, discount_type'); $this->db->from('sales_items_temp'); $this->db->where('sale_id', $value['sale_id']); $data['details'][$key] = $this->db->get()->result_array(); From c7b32a5a0e359edcf9f634eebe7a4f426d8df905 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sat, 8 Sep 2018 15:48:21 +0100 Subject: [PATCH 220/568] Minor fixes --- application/views/configs/general_config.php | 36 +++++++++----------- composer.lock | 26 +++++++------- 2 files changed, 30 insertions(+), 32 deletions(-) diff --git a/application/views/configs/general_config.php b/application/views/configs/general_config.php index 304f521c1..129deabd7 100644 --- a/application/views/configs/general_config.php +++ b/application/views/configs/general_config.php @@ -25,16 +25,15 @@ 'value' => $this->config->item('default_sales_discount'))); ?> 'default_sales_discount_type', - 'name'=>'default_sales_discount_type', - 'value'=>1, - 'data-toggle'=>"toggle", - 'data-size'=>'small', - 'data-onstyle'=>'success', - 'data-on'=>''.$this->config->item('currency_symbol').'', - 'data-off'=>'%', - 'checked'=>$this->config->item('default_sales_discount_type')) - ); ?> + 'id' => 'default_sales_discount_type', + 'name' => 'default_sales_discount_type', + 'value' => 1, + 'data-toggle' => 'toggle', + 'data-size' => 'normal', + 'data-onstyle' => 'success', + 'data-on' => ''.$this->config->item('currency_symbol').'', + 'data-off' => '%', + 'checked' => $this->config->item('default_sales_discount_type'))); ?>
      @@ -86,17 +85,17 @@
      $this->lang->line('config_top'), - 'bottom' => $this->lang->line('config_bottom') - ), + 'top' => $this->lang->line('config_top'), + 'bottom' => $this->lang->line('config_bottom') + ), $this->config->item('notify_vertical_position'), array('class' => 'form-control input-sm')); ?>
      $this->lang->line('config_left'), - 'center' => $this->lang->line('config_center'), - 'right' => $this->lang->line('config_right') - ), + 'left' => $this->lang->line('config_left'), + 'center' => $this->lang->line('config_center'), + 'right' => $this->lang->line('config_right') + ), $this->config->item('notify_horizontal_position'), array('class' => 'form-control input-sm')); ?>
      @@ -390,7 +389,6 @@ $(document).ready(function() window.location=''; }); - $('#general_config_form').validate($.extend(form_support.handler, { errorLabelContainer: "#general_error_message_box", @@ -450,7 +448,7 @@ $(document).ready(function() // set back disabled state enable_disable_gcaptcha_enable(); }, - dataType:'json' + dataType: 'json' }); } })); diff --git a/composer.lock b/composer.lock index c187907ef..4c6900a23 100644 --- a/composer.lock +++ b/composer.lock @@ -103,16 +103,16 @@ }, { "name": "paragonie/random_compat", - "version": "v2.0.15", + "version": "v2.0.17", "source": { "type": "git", "url": "https://github.com/paragonie/random_compat.git", - "reference": "10bcb46e8f3d365170f6de9d05245aa066b81f09" + "reference": "29af24f25bab834fcbb38ad2a69fa93b867e070d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/10bcb46e8f3d365170f6de9d05245aa066b81f09", - "reference": "10bcb46e8f3d365170f6de9d05245aa066b81f09", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/29af24f25bab834fcbb38ad2a69fa93b867e070d", + "reference": "29af24f25bab834fcbb38ad2a69fa93b867e070d", "shasum": "" }, "require": { @@ -148,7 +148,7 @@ "pseudorandom", "random" ], - "time": "2018-06-08 15:26:40" + "time": "2018-07-04 16:31:37" }, { "name": "phenx/php-font-lib", @@ -309,28 +309,28 @@ }, { "name": "vlucas/phpdotenv", - "version": "v2.4.0", + "version": "v2.5.1", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c" + "reference": "8abb4f9aa89ddea9d52112c65bbe8d0125e2fa8e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c", - "reference": "3cc116adbe4b11be5ec557bf1d24dc5e3a21d18c", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/8abb4f9aa89ddea9d52112c65bbe8d0125e2fa8e", + "reference": "8abb4f9aa89ddea9d52112c65bbe8d0125e2fa8e", "shasum": "" }, "require": { "php": ">=5.3.9" }, "require-dev": { - "phpunit/phpunit": "^4.8 || ^5.0" + "phpunit/phpunit": "^4.8.35 || ^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.4-dev" + "dev-master": "2.5-dev" } }, "autoload": { @@ -340,7 +340,7 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause-Attribution" + "BSD-3-Clause" ], "authors": [ { @@ -355,7 +355,7 @@ "env", "environment" ], - "time": "2016-09-01 10:05:43" + "time": "2018-07-29 20:33:41" } ], "aliases": [], From 4420dccc6033a5ba3d1a9c586bced2594c890278 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sun, 9 Sep 2018 10:18:44 +0100 Subject: [PATCH 221/568] Add (commented out) phpmyadmin to docker-compose --- docker-compose.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 80421a0f6..d681097f2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,12 +3,13 @@ version: '2' volumes: uploads: driver: local - + services: sqlscript: build: context: database/ dockerfile: Dockerfile + php: build: context: . @@ -38,3 +39,15 @@ services: - "3306:3306" volumes_from: - sqlscript + +# phpmyadmin: +# image: phpmyadmin/phpmyadmin +# restart: always +# ports: +# - "8000:80" +# links: +# - mysql:mysql +# environment: +# - MYSQL_USERNAME=admin +# - MYSQL_ROOT_PASSWORD=pointofsale +# - PMA_HOST=mysql From b3bfc51ee84f29990eddfc8d4b1855971bdf9b96 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sat, 14 Jul 2018 09:39:52 +0100 Subject: [PATCH 222/568] Add cashup feature --- application/config/autoload.php | 2 +- application/controllers/Cashups.php | 240 +++++++++++++ application/helpers/tabular_helper.php | 51 ++- application/language/en-GB/cashups_lang.php | 38 ++ .../en-GB/expenses_categories_lang.php | 1 + application/language/en-GB/module_lang.php | 2 + application/language/en-GB/sales_lang.php | 6 +- application/language/en-US/cashups_lang.php | 38 ++ .../en-US/expenses_categories_lang.php | 1 + application/language/en-US/module_lang.php | 2 + .../migrations/sqlscripts/3.2.1_to_3.3.0.sql | 45 +++ application/models/Cashup.php | 210 +++++++++++ application/views/cashups/form.php | 340 ++++++++++++++++++ application/views/cashups/manage.php | 63 ++++ public/images/menubar/cashups.png | Bin 0 -> 1086 bytes 15 files changed, 1034 insertions(+), 5 deletions(-) create mode 100644 application/controllers/Cashups.php create mode 100644 application/language/en-GB/cashups_lang.php create mode 100644 application/language/en-US/cashups_lang.php create mode 100644 application/models/Cashup.php create mode 100644 application/views/cashups/form.php create mode 100644 application/views/cashups/manage.php create mode 100644 public/images/menubar/cashups.png diff --git a/application/config/autoload.php b/application/config/autoload.php index 457dc17c4..a7b554177 100644 --- a/application/config/autoload.php +++ b/application/config/autoload.php @@ -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' ); +$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'); diff --git a/application/controllers/Cashups.php b/application/controllers/Cashups.php new file mode 100644 index 000000000..b7f0d9e96 --- /dev/null +++ b/application/controllers/Cashups.php @@ -0,0 +1,240 @@ +xss_clean(get_cashups_manage_table_headers()); + + // filters that will be loaded in the multiselect dropdown + $data['filters'] = array('is_deleted' => $this->lang->line('cashups_is_deleted')); + + $this->load->view('cashups/manage', $data); + } + + public function search() + { + $cash_up = 0; + $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'); + $filters = array( + 'start_date' => $this->input->get('start_date'), + 'end_date' => $this->input->get('end_date'), + 'is_deleted' => FALSE); + + // check if any filter is set in the multiselect dropdown + $filledup = array_fill_keys($this->input->get('filters'), TRUE); + $filters = array_merge($filters, $filledup); + $cash_ups = $this->Cashup->search($search, $filters, $limit, $offset, $sort, $order); + $total_rows = $this->Cashup->get_found_rows($search, $filters); + $data_rows = array(); + foreach($cash_ups->result() as $cash_up) + { + $data_rows[] = $this->xss_clean(get_cash_up_data_row($cash_up)); + } + + echo json_encode(array('total' => $total_rows, 'rows' => $data_rows)); + } + + public function view($cashup_id = -1) + { + $data = array(); + + $data['employees'] = array(); + foreach($this->Employee->get_all()->result() as $employee) + { + foreach(get_object_vars($employee) as $property => $value) + { + $employee->$property = $this->xss_clean($value); + } + + $data['employees'][$employee->person_id] = $employee->first_name . ' ' . $employee->last_name; + } + + $cash_ups_info = $this->Cashup->get_info($cashup_id); + + foreach(get_object_vars($cash_ups_info) as $property => $value) + { + $cash_ups_info->$property = $this->xss_clean($value); + } + + // open cashup + if(empty($cash_ups_info->cashup_id)) + { + $cash_ups_info->open_date = date('Y-m-d H:i:s'); + $cash_ups_info->close_date = $cash_ups_info->open_date; + $cash_ups_info->open_employee_id = $this->Employee->get_logged_in_employee_info()->person_id; + $cash_ups_info->close_employee_id = $this->Employee->get_logged_in_employee_info()->person_id; + } + // if all the amounts are null or 0 that means it's a close cashup + elseif(floatval($cash_ups_info->closed_amount_cash) == 0 && + floatval($cash_ups_info->closed_amount_card) == 0 && + floatval($cash_ups_info->closed_amount_check) == 0) + { + // set the close date and time to the actual as this is a close session + $cash_ups_info->close_date = date('Y-m-d H:i:s'); + + // the closed amount starts with the open amount -/+ any trasferred amount + $cash_ups_info->closed_amount_cash = $cash_ups_info->open_amount_cash + $cash_ups_info->transfer_amount_cash; + + // if it's date mode only and not date & time truncate the open and end date to date only + if(empty($this->config->item('date_or_time_format'))) + { + // search for all the payments given the time range + $inputs = array('start_date' => substr($cash_ups_info->open_date, 0, 10), 'end_date' => substr($cash_ups_info->close_date, 0, 10), 'sale_type' => 'complete', 'location_id' => 'all'); + } + else + { + // search for all the payments given the time range + $inputs = array('start_date' => $cash_ups_info->open_date, 'end_date' => $cash_ups_info->close_date, 'sale_type' => 'complete', 'location_id' => 'all'); + } + + // get all the transactions payment summaries + $this->load->model('reports/Summary_payments'); + $reports_data = $this->Summary_payments->getData($inputs); + + foreach($reports_data as $row) + { + if($row['payment_type'] == $this->lang->line('sales_cash')) + { + $cash_ups_info->closed_amount_cash += $this->xss_clean($row['payment_amount']); + } + elseif($row['payment_type'] == $this->lang->line('sales_due')) + { + $cash_ups_info->closed_amount_cash -= $this->xss_clean($row['payment_amount']); + } + elseif($row['payment_type'] == $this->lang->line('sales_debit') || + $row['payment_type'] == $this->lang->line('sales_credit')) + { + $cash_ups_info->closed_amount_card += $this->xss_clean($row['payment_amount']); + } + elseif($row['payment_type'] == $this->lang->line('sales_check')) + { + $cash_ups_info->closed_amount_check += $this->xss_clean($row['payment_amount']); + } + } + + // lookup expenses paid in cash + $filters = array( + 'only_cash' => TRUE, + 'only_due' => FALSE, + 'only_check' => FALSE, + 'only_credit' => FALSE, + 'only_debit' => FALSE, + 'is_deleted' => FALSE); + $payments = $this->Expense->get_payments_summary('', array_merge($inputs, $filters)); + + foreach($payments as $row) + { + $cash_ups_info->closed_amount_cash -= $this->xss_clean($row['amount']); + } + + $cash_ups_info->closed_amount_total = $this->_calculate_total($cash_ups_info->open_amount_cash, $cash_ups_info->transfer_amount_cash, $cash_ups_info->closed_amount_cash, $cash_ups_info->closed_amount_card, $cash_ups_info->closed_amount_check); + } + + $data['cash_ups_info'] = $cash_ups_info; + + $this->load->view("cashups/form", $data); + } + + public function get_row($row_id) + { + $cash_ups_info = $this->Cashup->get_info($row_id); + $data_row = $this->xss_clean(get_cash_up_data_row($cash_ups_info)); + + echo json_encode($data_row); + } + + public function save($cashup_id = -1) + { + $open_date = $this->input->post('open_date'); + $open_date_formatter = date_create_from_format($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), $open_date); + + $close_date = $this->input->post('close_date'); + $close_date_formatter = date_create_from_format($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), $close_date); + + $cash_up_data = array( + 'open_date' => $open_date_formatter->format('Y-m-d H:i:s'), + 'close_date' => $close_date_formatter->format('Y-m-d H:i:s'), + 'open_amount_cash' => parse_decimals($this->input->post('open_amount_cash')), + 'transfer_amount_cash' => parse_decimals($this->input->post('transfer_amount_cash')), + 'closed_amount_cash' => parse_decimals($this->input->post('closed_amount_cash')), + 'closed_amount_card' => parse_decimals($this->input->post('closed_amount_card')), + 'closed_amount_check' => parse_decimals($this->input->post('closed_amount_check')), + 'closed_amount_total' => parse_decimals($this->input->post('closed_amount_total')), + 'note' => $this->input->post('note') != NULL, + 'description' => $this->input->post('description'), + 'open_employee_id' => $this->input->post('open_employee_id'), + 'close_employee_id' => $this->input->post('close_employee_id'), + 'deleted' => $this->input->post('deleted') != NULL + ); + + if($this->Cashup->save($cash_up_data, $cashup_id)) + { + $cash_up_data = $this->xss_clean($cash_up_data); + + //New cashup_id + if($cashup_id == -1) + { + echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('cashups_successful_adding'), 'id' => $cash_up_data['cashup_id'])); + } + else // Existing Cashup + { + echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('cashups_successful_updating'), 'id' => $cashup_id)); + } + } + else//failure + { + echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('cashups_error_adding_updating'), 'id' => -1)); + } + } + + public function delete() + { + $cash_ups_to_delete = $this->input->post('ids'); + + if($this->Cashup->delete_list($cash_ups_to_delete)) + { + echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('cashups_successful_deleted') . ' ' . count($cash_ups_to_delete) . ' ' . $this->lang->line('cashups_one_or_multiple'), 'ids' => $cash_ups_to_delete)); + } + else + { + echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('cashups_cannot_be_deleted'), 'ids' => $cash_ups_to_delete)); + } + } + + /* + AJAX call from cashup input form to calculate the total + */ + public function ajax_cashup_total() + { + $open_amount_cash = parse_decimals($this->input->post('open_amount_cash')); + $transfer_amount_cash = parse_decimals($this->input->post('transfer_amount_cash')); + $closed_amount_cash = parse_decimals($this->input->post('closed_amount_cash')); + $closed_amount_card = parse_decimals($this->input->post('closed_amount_card')); + $closed_amount_check = parse_decimals($this->input->post('closed_amount_check')); + + $total = $this->_calculate_total($open_amount_cash, $transfer_amount_cash, $closed_amount_cash, $closed_amount_card, $closed_amount_check); + + echo json_encode(array('total' => to_currency_no_money($total))); + } + + /* + Calculate total + */ + private function _calculate_total($open_amount_cash, $transfer_amount_cash, $closed_amount_cash, $closed_amount_card, $closed_amount_check) + { + return ($closed_amount_cash - $open_amount_cash - $transfer_amount_cash + $closed_amount_card + $closed_amount_check); + } +} +?> diff --git a/application/helpers/tabular_helper.php b/application/helpers/tabular_helper.php index f37befc91..0f1ee1949 100644 --- a/application/helpers/tabular_helper.php +++ b/application/helpers/tabular_helper.php @@ -579,7 +579,7 @@ function get_expenses_manage_table_headers() } /* -Gets the html data row for the expenses. +Gets the html data row for the expenses */ function get_expenses_data_row($expense) { @@ -643,4 +643,53 @@ function get_expenses_manage_payments_summary($payments, $expenses) return $table; } + +/* +Get the header for the cashup tabular view +*/ +function get_cashups_manage_table_headers() +{ + $CI =& get_instance(); + $headers = array( + array('cashup_id' => $CI->lang->line('cashups_id')), + array('open_date' => $CI->lang->line('cashups_opened_date')), + array('open_employee_id' => $CI->lang->line('cashups_open_employee')), + array('open_amount_cash' => $CI->lang->line('cashups_open_amount_cash')), + array('transfer_amount_cash' => $CI->lang->line('cashups_transfer_amount_cash')), + array('close_date' => $CI->lang->line('cashups_closed_date')), + array('close_employee_id' => $CI->lang->line('cashups_close_employee')), + array('closed_amount_cash' => $CI->lang->line('cashups_closed_amount_cash')), + array('note' => $CI->lang->line('cashups_note')), + array('closed_amount_card' => $CI->lang->line('cashups_closed_amount_card')), + array('closed_amount_check' => $CI->lang->line('cashups_closed_amount_check')), + array('closed_amount_total' => $CI->lang->line('cashups_closed_amount_total')) + ); + + return transform_headers($headers); +} + +/* +Gets the html data row for the cashups +*/ +function get_cash_up_data_row($cash_up) +{ + $CI =& get_instance(); + $controller_name = strtolower(get_class($CI)); + return array ( + 'cashup_id' => $cash_up->cashup_id, + 'open_date' => date($CI->config->item('dateformat') . ' ' . $CI->config->item('timeformat'), strtotime($cash_up->open_date)), + 'open_employee_id' => $cash_up->open_first_name . ' ' . $cash_up->open_last_name, + 'open_amount_cash' => to_currency($cash_up->open_amount_cash), + 'transfer_amount_cash' => to_currency($cash_up->transfer_amount_cash), + 'close_date' => date($CI->config->item('dateformat') . ' ' . $CI->config->item('timeformat'), strtotime($cash_up->close_date)), + 'close_employee_id' => $cash_up->close_first_name . ' ' . $cash_up->close_last_name, + 'closed_amount_cash' => to_currency($cash_up->closed_amount_cash), + 'note' => $cash_up->note ? '' : '', + 'closed_amount_card' => to_currency($cash_up->closed_amount_card), + 'closed_amount_check' => to_currency($cash_up->closed_amount_check), + 'closed_amount_total' => to_currency($cash_up->closed_amount_total), + 'edit' => anchor($controller_name."/view/$cash_up->cashup_id", '', + array('class'=>'modal-dlg', 'data-btn-submit' => $CI->lang->line('common_submit'), 'title'=>$CI->lang->line($controller_name.'_update')) + )); +} ?> diff --git a/application/language/en-GB/cashups_lang.php b/application/language/en-GB/cashups_lang.php new file mode 100644 index 000000000..38932c9f8 --- /dev/null +++ b/application/language/en-GB/cashups_lang.php @@ -0,0 +1,38 @@ +db->from('cash_up'); + $this->db->where('cashup_id', $cashup_id); + + return ($this->db->get()->num_rows() == 1); + } + + /* + Gets employee info + */ + public function get_employee($cashup_id) + { + $this->db->from('cash_up'); + $this->db->where('cashup_id', $cashup_id); + + return $this->Employee->get_info($this->db->get()->row()->employee_id); + } + + public function get_multiple_info($cash_up_ids) + { + $this->db->from('cash_up'); + $this->db->where_in('cashup_id', $cashup_ids); + $this->db->order_by('cashup_id', 'asc'); + + return $this->db->get(); + } + + /* + Gets rows + */ + public function get_found_rows($search, $filters) + { + return $this->search($search, $filters, 0, 0, 'cashup_id', 'asc', TRUE); + } + + /* + Searches cashups + */ + public function search($search, $filters, $rows = 0, $limit_from = 0, $sort = 'cashup_id', $order = 'asc', $count_only = FALSE) + { + // get_found_rows case + if($count_only == TRUE) + { + $this->db->select('COUNT(cash_up.cashup_id) as count'); + } + + $this->db->select(' + cash_up.cashup_id, + MAX(cash_up.open_date) AS open_date, + MAX(cash_up.close_date) AS close_date, + MAX(cash_up.open_amount_cash) AS open_amount_cash, + MAX(cash_up.transfer_amount_cash) AS transfer_amount_cash, + MAX(cash_up.closed_amount_cash) AS closed_amount_cash, + MAX(cash_up.closed_amount_card) AS closed_amount_card, + MAX(cash_up.closed_amount_check) AS closed_amount_check, + MAX(cash_up.closed_amount_total) AS closed_amount_total, + MAX(cash_up.description) AS description, + MAX(cash_up.note) AS note, + MAX(cash_up.open_employee_id) AS open_employee_id, + MAX(cash_up.close_employee_id) AS close_employee_id, + MAX(open_employees.first_name) AS open_first_name, + MAX(open_employees.last_name) AS open_last_name, + MAX(close_employees.first_name) AS close_first_name, + MAX(close_employees.last_name) AS close_last_name + '); + $this->db->from('cash_up AS cash_up'); + $this->db->join('people AS open_employees', 'open_employees.person_id = cash_up.open_employee_id', 'LEFT'); + $this->db->join('people AS close_employees', 'close_employees.person_id = cash_up.close_employee_id', 'LEFT'); + + $this->db->group_start(); + $this->db->like('cash_up.open_date', $search); + $this->db->or_like('open_employees.first_name', $search); + $this->db->or_like('open_employees.last_name', $search); + $this->db->or_like('close_employees.first_name', $search); + $this->db->or_like('close_employees.last_name', $search); + $this->db->or_like('cash_up.closed_amount_total', $search); + $this->db->or_like('CONCAT(open_employees.first_name, " ", open_employees.last_name)', $search); + $this->db->or_like('CONCAT(close_employees.first_name, " ", close_employees.last_name)', $search); + $this->db->group_end(); + + $this->db->where('cash_up.deleted', $filters['is_deleted']); + + if(empty($this->config->item('date_or_time_format'))) + { + $this->db->where('DATE_FORMAT(cash_up.open_date, "%Y-%m-%d") BETWEEN ' . $this->db->escape($filters['start_date']) . ' AND ' . $this->db->escape($filters['end_date'])); + } + else + { + $this->db->where('cash_up.open_date BETWEEN ' . $this->db->escape(rawurldecode($filters['start_date'])) . ' AND ' . $this->db->escape(rawurldecode($filters['end_date']))); + } + + $this->db->group_by('cashup_id'); + + // get_found_rows case + if($count_only == TRUE) + { + return $this->db->get()->row_array()['count']; + } + + $this->db->order_by($sort, $order); + + if($rows > 0) + { + $this->db->limit($rows, $limit_from); + } + + return $this->db->get(); + } + + /* + Gets information about a particular cashup + */ + public function get_info($cashup_id) + { + $this->db->select(' + cash_up.cashup_id AS cashup_id, + cash_up.open_date AS open_date, + cash_up.close_date AS close_date, + cash_up.open_amount_cash AS open_amount_cash, + cash_up.transfer_amount_cash AS transfer_amount_cash, + cash_up.closed_amount_cash AS closed_amount_cash, + cash_up.closed_amount_card AS closed_amount_card, + cash_up.closed_amount_check AS closed_amount_check, + cash_up.closed_amount_total AS closed_amount_total, + cash_up.description AS description, + cash_up.note AS note, + cash_up.open_employee_id AS open_employee_id, + cash_up.close_employee_id AS close_employee_id, + cash_up.deleted AS deleted, + open_employees.first_name AS open_first_name, + open_employees.last_name AS open_last_name, + close_employees.first_name AS close_first_name, + close_employees.last_name AS close_last_name + '); + $this->db->from('cash_up AS cash_up'); + $this->db->join('people AS open_employees', 'open_employees.person_id = cash_up.open_employee_id', 'LEFT'); + $this->db->join('people AS close_employees', 'close_employees.person_id = cash_up.close_employee_id', 'LEFT'); + $this->db->where('cashup_id', $cashup_id); + + $query = $this->db->get(); + if($query->num_rows() == 1) + { + return $query->row(); + } + else + { + //Get empty base parent object + $cash_up_obj = new stdClass(); + + //Get all the fields from cashup table + foreach($this->db->list_fields('cash_up') as $field) + { + $cash_up_obj->$field = ''; + } + + return $cash_up_obj; + } + } + + /* + Inserts or updates an cashup + */ + public function save(&$cash_up_data, $cashup_id = FALSE) + { + if(!$cashup_id == -1 || !$this->exists($cashup_id)) + { + if($this->db->insert('cash_up', $cash_up_data)) + { + $cash_up_data['cashup_id'] = $this->db->insert_id(); + + return TRUE; + } + + return FALSE; + } + + $this->db->where('cashup_id', $cashup_id); + + return $this->db->update('cash_up', $cash_up_data); + } + + /* + Deletes a list of cashups + */ + public function delete_list($cashup_ids) + { + $success = FALSE; + + //Run these queries as a transaction, we want to make sure we do all or nothing + $this->db->trans_start(); + $this->db->where_in('cashup_id', $cashup_ids); + $success = $this->db->update('cash_up', array('deleted'=>1)); + $this->db->trans_complete(); + + return $success; + } +} +?> diff --git a/application/views/cashups/form.php b/application/views/cashups/form.php new file mode 100644 index 000000000..5696e2d3a --- /dev/null +++ b/application/views/cashups/form.php @@ -0,0 +1,340 @@ +
      lang->line('common_fields_required_message'); ?>
      + +
        + +cashup_id, array('id'=>'cashups_edit_form', 'class'=>'form-horizontal')); ?> +
        +
        + lang->line('cashups_info'), 'cash_ups_info', array('class'=>'control-label col-xs-3')); ?> + cashup_id) ? $this->lang->line('cashups_id') . ' ' . $cash_ups_info->cashup_id : '', 'cashup_id', array('class'=>'control-label col-xs-8', 'style'=>'text-align:left')); ?> +
        + +
        + lang->line('cashups_open_date'), 'open_date', array('class'=>'required control-label col-xs-3')); ?> +
        +
        + + 'open_date', + 'id'=>'open_date', + 'class'=>'form-control input-sm datepicker', + 'value'=>date($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), strtotime($cash_ups_info->open_date))) + );?> +
        +
        +
        + +
        + lang->line('cashups_open_employee'), 'open_employee', array('class'=>'control-label col-xs-3')); ?> +
        + open_employee_id, 'id="open_employee_id" class="form-control"');?> +
        +
        + +
        + lang->line('cashups_open_amount_cash'), 'open_amount_cash', array('class'=>'control-label col-xs-3')); ?> +
        +
        + + config->item('currency_symbol'); ?> + + 'open_amount_cash', + 'id'=>'open_amount_cash', + 'class'=>'form-control input-sm', + 'value'=>to_currency_no_money($cash_ups_info->open_amount_cash)) + );?> + + config->item('currency_symbol'); ?> + +
        +
        +
        + +
        + lang->line('cashups_transfer_amount_cash'), 'transfer_amount_cash', array('class'=>'control-label col-xs-3')); ?> +
        +
        + + config->item('currency_symbol'); ?> + + 'transfer_amount_cash', + 'id'=>'transfer_amount_cash', + 'class'=>'form-control input-sm', + 'value'=>to_currency_no_money($cash_ups_info->transfer_amount_cash)) + );?> + + config->item('currency_symbol'); ?> + +
        +
        +
        + +
        + lang->line('cashups_close_date'), 'close_date', array('class'=>'required control-label col-xs-3')); ?> +
        +
        + + 'close_date', + 'id'=>'close_date', + 'class'=>'form-control input-sm datepicker', + 'value'=>date($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), strtotime($cash_ups_info->close_date))) + );?> +
        +
        +
        + +
        + lang->line('cashups_close_employee'), 'close_employee', array('class'=>'control-label col-xs-3')); ?> +
        + close_employee_id, 'id="close_employee_id" class="form-control"');?> +
        +
        + +
        + lang->line('cashups_closed_amount_cash'), 'closed_amount_cash', array('class'=>'control-label col-xs-3')); ?> +
        +
        + + config->item('currency_symbol'); ?> + + 'closed_amount_cash', + 'id'=>'closed_amount_cash', + 'class'=>'form-control input-sm', + 'value'=>to_currency_no_money($cash_ups_info->closed_amount_cash)) + );?> + + config->item('currency_symbol'); ?> + +
        +
        +
        + +
        + lang->line('cashups_note'), 'note', array('class'=>'control-label col-xs-3')); ?> +
        + 'note', + 'id'=>'note', + 'value'=>0, + 'checked'=>($cash_ups_info->note) ? 1 : 0) + );?> +
        +
        + +
        + lang->line('cashups_closed_amount_card'), 'closed_amount_card', array('class'=>'control-label col-xs-3')); ?> +
        +
        + + config->item('currency_symbol'); ?> + + 'closed_amount_card', + 'id'=>'closed_amount_card', + 'class'=>'form-control input-sm', + 'value'=>to_currency_no_money($cash_ups_info->closed_amount_card)) + );?> + + config->item('currency_symbol'); ?> + +
        +
        +
        + +
        + lang->line('cashups_closed_amount_check'), 'closed_amount_check', array('class'=>'control-label col-xs-3')); ?> +
        +
        + + config->item('currency_symbol'); ?> + + 'closed_amount_check', + 'id'=>'closed_amount_check', + 'class'=>'form-control input-sm', + 'value'=>to_currency_no_money($cash_ups_info->closed_amount_check)) + );?> + + config->item('currency_symbol'); ?> + +
        +
        +
        + +
        + lang->line('cashups_closed_amount_total'), 'closed_amount_total', array('class'=>'control-label col-xs-3')); ?> +
        +
        + + config->item('currency_symbol'); ?> + + 'closed_amount_total', + 'id'=>'closed_amount_total', + 'readonly'=>'true', + 'class'=>'form-control input-sm', + 'value'=>to_currency_no_money($cash_ups_info->closed_amount_total) + ));?> + + config->item('currency_symbol'); ?> + +
        +
        +
        + +
        + lang->line('cashups_description'), 'description', array('class'=>'control-label col-xs-3')); ?> +
        + 'description', + 'id'=>'description', + 'class'=>'form-control input-sm', + 'value'=>$cash_ups_info->description) + );?> +
        +
        + + cashup_id)) + { + ?> +
        + lang->line('cashups_is_deleted').':', 'deleted', array('class'=>'control-label col-xs-3')); ?> +
        + 'deleted', + 'id'=>'deleted', + 'value'=>1, + 'checked'=>($cash_ups_info->deleted) ? 1 : 0) + );?> +
        +
        + +
        + + + diff --git a/application/views/cashups/manage.php b/application/views/cashups/manage.php new file mode 100644 index 000000000..0cb3f7a7a --- /dev/null +++ b/application/views/cashups/manage.php @@ -0,0 +1,63 @@ +load->view("partial/header"); ?> + + + +load->view('partial/print_receipt', array('print_after_sale'=>false, 'selected_printer'=>'takings_printer')); ?> + + + +
        + +
        + +
        +
        +
        + +load->view("partial/footer"); ?> diff --git a/public/images/menubar/cashups.png b/public/images/menubar/cashups.png new file mode 100644 index 0000000000000000000000000000000000000000..11eb8a3194e529777e5434e00c2e5c084aa70d83 GIT binary patch literal 1086 zcmV-E1i|}>P)R|6G0TmAEhAvsI5j5!NfL!XpAuwqwxU78cpB0*z{rq9|=rxda}R!9X>XLsYoe5dH+%#e6%*N0ifs@K87)k3Wyc44F&>J4q;@K z1%Sd?4JR=@@Ug-ej2xyk!YC>MfP|+p-Gu$MDK9`s10Yw={s-Y!o4}Mo5bOH}0L3S% z*2AENl~})n5axXaK)rfSfm*k-6hg@O0szIwNqiL4wkd=#>L~ycpI6A`oos={9U}cg zpasPP#UFWUvho0$RQx{>qyd;Zyk-<%gMd1+Qhfk^Fz;n=zrFPbR_0#9kF`~9z9Xm4 zz}cbO(B9FxFQY@iM!e^dorrj5EDy`;u|1;Z>)=!>o z-v?j@7C=1l7qG{n{{1+4nX9s(od`T%LF{1PM!;1Eiq&g`a|!9?!YTe`jRSuc8=U zkgfrso?mMDs$=UHT%Uagr`DG1zJGT(0w3-^bp5^E-F?+(GB>BH$za+s+Arj63Wf-%jH7#89MIN(Y4F|1grEU z>jM&v6tw#We@4BzO79DxVl#*Z8U@hg7H0rrIs*togS$87S$;J3`5V0tsp|ncTSRvN zG2H<~bq4?k01g1?Z6)0S6mQp@5rtf=A*?Alyh zM!d8KSiB(tI$oT#0ioa3**YL%pyTCf8yL!8pZ_bs0GXhgOWYZXUjP6A07*qoM6N<$ Ef( Date: Sat, 8 Sep 2018 09:03:41 +0000 Subject: [PATCH 223/568] Translated using Weblate (Czech) Currently translated at 91.8% (101 of 110 strings) --- application/language/cs/reports_lang.php | 211 +++++++++++------------ 1 file changed, 105 insertions(+), 106 deletions(-) diff --git a/application/language/cs/reports_lang.php b/application/language/cs/reports_lang.php index 36a123e1e..601856d9a 100644 --- a/application/language/cs/reports_lang.php +++ b/application/language/cs/reports_lang.php @@ -1,86 +1,85 @@ - Date: Sat, 8 Sep 2018 08:53:03 +0000 Subject: [PATCH 224/568] Translated using Weblate (Czech) Currently translated at 86.4% (140 of 162 strings) --- application/language/cs/sales_lang.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/application/language/cs/sales_lang.php b/application/language/cs/sales_lang.php index 37d176c0e..6e40198c6 100644 --- a/application/language/cs/sales_lang.php +++ b/application/language/cs/sales_lang.php @@ -1,5 +1,4 @@ - Date: Sat, 8 Sep 2018 08:58:37 +0000 Subject: [PATCH 225/568] Translated using Weblate (Czech) Currently translated at 90.1% (46 of 51 strings) --- application/language/cs/receivings_lang.php | 35 ++++++++++----------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/application/language/cs/receivings_lang.php b/application/language/cs/receivings_lang.php index 0302789d4..b3ef04f9b 100644 --- a/application/language/cs/receivings_lang.php +++ b/application/language/cs/receivings_lang.php @@ -1,5 +1,4 @@ - Date: Sun, 9 Sep 2018 20:14:59 +0100 Subject: [PATCH 226/568] Fix migration scripts (#440) --- ...hp => 20180909120000_upgrade_to_3_3_0.php} | 0 .../migrations/sqlscripts/3.2.1_to_3.3.0.sql | 20 +++++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) rename application/migrations/{20180830100000_upgrade_to_3_3_0.php => 20180909120000_upgrade_to_3_3_0.php} (100%) diff --git a/application/migrations/20180830100000_upgrade_to_3_3_0.php b/application/migrations/20180909120000_upgrade_to_3_3_0.php similarity index 100% rename from application/migrations/20180830100000_upgrade_to_3_3_0.php rename to application/migrations/20180909120000_upgrade_to_3_3_0.php diff --git a/application/migrations/sqlscripts/3.2.1_to_3.3.0.sql b/application/migrations/sqlscripts/3.2.1_to_3.3.0.sql index 19e9e3d7c..98a610aeb 100644 --- a/application/migrations/sqlscripts/3.2.1_to_3.3.0.sql +++ b/application/migrations/sqlscripts/3.2.1_to_3.3.0.sql @@ -42,8 +42,16 @@ ALTER TABLE `ospos_receivings_items` -- Add support for module cashups -- +-- Set config module sort number to one of the latest + +UPDATE `ospos_modules` +SET `sort` = 900 +WHERE `name_lang_key` = 'module_config'; + +-- Add cashup module + INSERT INTO `ospos_modules` (`name_lang_key`, `desc_lang_key`, `sort`, `module_id`) VALUES -('module_cashups', 'module_cashups_desc', 107, 'cashups'); +('module_cashups', 'module_cashups_desc', 110, 'cashups'); INSERT INTO `ospos_permissions` (`permission_id`, `module_id`) VALUES ('cashups', 'cashups'); @@ -75,9 +83,17 @@ CREATE TABLE `ospos_cash_up` ( ALTER TABLE `ospos_cash_up` ADD PRIMARY KEY (`cashup_id`), ADD KEY `open_employee_id` (`open_employee_id`), - ADD KEY `close_employee_id` (`close_employee_id`); + ADD KEY `close_employee_id` (`close_employee_id`), + ADD CONSTRAINT `ospos_cash_up_ibfk_1` FOREIGN KEY (`open_employee_id`) REFERENCES `ospos_employees` (`person_id`), + ADD CONSTRAINT `ospos_cash_up_ibfk_2` FOREIGN KEY (`close_employee_id`) REFERENCES `ospos_employees` (`person_id`); -- AUTO_INCREMENT for table `ospos_cash_up` ALTER TABLE `ospos_cash_up` MODIFY `cashup_id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1; + +-- Change collation on columns to be utf8_general_ci + +ALTER TABLE ospos_cash_up CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; +ALTER TABLE ospos_expense_categories CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; +ALTER TABLE ospos_expenses CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; From d5c270b4dc164705dd80a091c73bada20962fc54 Mon Sep 17 00:00:00 2001 From: Weblate Date: Fri, 7 Sep 2018 18:26:56 +0000 Subject: [PATCH 227/568] Translated using Weblate (Flemish) Currently translated at 99.3% (161 of 162 strings) --- application/language/nl-BE/sales_lang.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/language/nl-BE/sales_lang.php b/application/language/nl-BE/sales_lang.php index 2a99d7c90..c5ca8f594 100755 --- a/application/language/nl-BE/sales_lang.php +++ b/application/language/nl-BE/sales_lang.php @@ -138,7 +138,7 @@ $lang["sales_successfully_deleted"] = "Uw aankoop werd verwijderd"; $lang["sales_successfully_restored"] = "U hebt hersteld"; $lang["sales_successfully_suspended_sale"] = "Wijzigingen bewaard voor verkoop."; $lang["sales_successfully_updated"] = "Wijzigingen bewaard voor ticket"; -$lang["sales_suspend_sale"] = "Bewaar verkoop"; +$lang["sales_suspend_sale"] = "Bewaar"; $lang["sales_suspended_doc_id"] = "Document"; $lang["sales_suspended_sale_id"] = "ID"; $lang["sales_suspended_sales"] = "Bewaarde Aankopen"; From 513f847f4d02f4ca6077ad9d14f9e526566f961a Mon Sep 17 00:00:00 2001 From: Weblate Date: Sun, 16 Sep 2018 15:39:16 +0200 Subject: [PATCH 228/568] Upade Czech translation --- application/language/cs/reports_lang.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/application/language/cs/reports_lang.php b/application/language/cs/reports_lang.php index 601856d9a..b0af36192 100644 --- a/application/language/cs/reports_lang.php +++ b/application/language/cs/reports_lang.php @@ -4,13 +4,13 @@ $lang["reports_canceled"] = "Zrušené"; $lang["reports_categories"] = "Kategorie"; $lang["reports_categories_summary_report"] = "Přehled dle kategorií"; $lang["reports_category"] = "Kategorie"; -$lang["reports_code_canceled"] = ""; -$lang["reports_code_invoice"] = ""; +$lang["reports_code_canceled"] = "CNL"; +$lang["reports_code_invoice"] = "FA"; $lang["reports_code_pos"] = "POS"; -$lang["reports_code_quote"] = ""; -$lang["reports_code_return"] = ""; +$lang["reports_code_quote"] = "Q"; +$lang["reports_code_return"] = "RET"; $lang["reports_code_type"] = "Typ"; -$lang["reports_code_work_order"] = ""; +$lang["reports_code_work_order"] = "ZAK"; $lang["reports_comments"] = "Poznámky"; $lang["reports_complete"] = "Dokončené prodeje a vratky"; $lang["reports_completed_sales"] = "Dokončené prodeje"; @@ -33,7 +33,7 @@ $lang["reports_discount"] = "Sleva"; $lang["reports_discount_percent"] = "Procentní sleva"; $lang["reports_discounts"] = "Slevy"; $lang["reports_discounts_summary_report"] = "Přehled podle slev"; -$lang["reports_earned"] = ""; +$lang["reports_earned"] = "Points Earned"; $lang["reports_employee"] = "Zaměstnanec"; $lang["reports_employees"] = "Zaměstnanci"; $lang["reports_employees_summary_report"] = "Přehled podle zaměstnanců"; @@ -75,7 +75,7 @@ $lang["reports_quotes"] = "Nabídky"; $lang["reports_received_by"] = "Přijato"; $lang["reports_receiving_id"] = "Číslo příjemky"; $lang["reports_receiving_type"] = "Typ příjmu"; -$lang["reports_receivings"] = "Příjemnky"; +$lang["reports_receivings"] = "Příjemky"; $lang["reports_reorder_level"] = "Množství pro doobjednání"; $lang["reports_report"] = "Sestava"; $lang["reports_report_input"] = "Parametry sestavy"; @@ -102,7 +102,7 @@ $lang["reports_sold_to"] = "Zákazník"; $lang["reports_stock_location"] = "Místo skladu"; $lang["reports_sub_total_value"] = "Mezisoučet (bez DPH)"; $lang["reports_subtotal"] = "Mezisoučet (bez DPH)"; -$lang["reports_summary_reports"] = "Souhrnné přehledy"; +$lang["reports_summary_reports"] = "Souhrnné sestavy"; $lang["reports_supplied_by"] = "Dodáno"; $lang["reports_supplier"] = "Dodavatel"; $lang["reports_suppliers"] = "Dodavatelé"; From ec5e016401d78d5ec8c45634ad1cfdad7c5f998c Mon Sep 17 00:00:00 2001 From: jekkos Date: Sun, 16 Sep 2018 17:00:43 +0200 Subject: [PATCH 229/568] Fix tax migration script --- application/migrations/20170502221506_sales_tax_data.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/migrations/20170502221506_sales_tax_data.php b/application/migrations/20170502221506_sales_tax_data.php index 921d5c63e..d98f25f3d 100644 --- a/application/migrations/20170502221506_sales_tax_data.php +++ b/application/migrations/20170502221506_sales_tax_data.php @@ -61,7 +61,7 @@ class Migration_Sales_Tax_Data extends CI_Migration $item_tax_amount = 0; if($tax_included) { - $item_tax_amount = $this->sale_lib->get_item_tax($item['quantity_purchased'], $item['item_unit_price'], $item['discount_percent'], $item['percent']); + $item_tax_amount = $this->sale_lib->get_item_tax($item['quantity_purchased'], $item['item_unit_price'], $item['discount_percent'], PERCENT, $item['percent']); } else { From 2181b0ebcee634b42dd6fb0c440d9e00f2850099 Mon Sep 17 00:00:00 2001 From: jekkos Date: Sun, 16 Sep 2018 17:08:02 +0200 Subject: [PATCH 230/568] Update second method --- application/migrations/20170502221506_sales_tax_data.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/migrations/20170502221506_sales_tax_data.php b/application/migrations/20170502221506_sales_tax_data.php index d98f25f3d..47fc17c5b 100644 --- a/application/migrations/20170502221506_sales_tax_data.php +++ b/application/migrations/20170502221506_sales_tax_data.php @@ -57,7 +57,7 @@ class Migration_Sales_Tax_Data extends CI_Migration { // This computes tax for each line item and adds it to the tax type total $tax_group = (float)$item['percent'] . '% ' . $item['name']; - $tax_basis = $this->sale_lib->get_item_total($item['quantity_purchased'], $item['item_unit_price'], $item['discount_percent'], TRUE); + $tax_basis = $this->sale_lib->get_item_total($item['quantity_purchased'], $item['item_unit_price'], $item['discount_percent'], PERCENT, TRUE); $item_tax_amount = 0; if($tax_included) { @@ -67,7 +67,7 @@ class Migration_Sales_Tax_Data extends CI_Migration { $item_tax_amount = $this->tax_lib->get_sales_tax_for_amount($tax_basis, $item['percent'], PHP_ROUND_HALF_UP, $tax_decimals); } - $this->update_sales_items_taxes_amount($sale_id, $item['line'], $item['name'], $item['percent'], $tax_type, $item_tax_amount); + $this->update_sales_items_taxes_amount($sale_id, $item['line'], $item['name'], $item['percentcustomer_sales_tax_support'], $tax_type, $item_tax_amount); $this->tax_lib->update_sales_taxes($sales_taxes, $tax_type, $tax_group, $item['percent'], $tax_basis, $item_tax_amount, $tax_group_sequence, PHP_ROUND_HALF_UP, $sale_id, $item['name']); $tax_group_sequence += 1; } From 9307ebbaa9bca2a5065868f719531a5bcd44a438 Mon Sep 17 00:00:00 2001 From: jekkos Date: Sun, 16 Sep 2018 17:19:10 +0200 Subject: [PATCH 231/568] Revert wrong change --- application/migrations/20170502221506_sales_tax_data.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/migrations/20170502221506_sales_tax_data.php b/application/migrations/20170502221506_sales_tax_data.php index 47fc17c5b..5b986fae0 100644 --- a/application/migrations/20170502221506_sales_tax_data.php +++ b/application/migrations/20170502221506_sales_tax_data.php @@ -67,7 +67,7 @@ class Migration_Sales_Tax_Data extends CI_Migration { $item_tax_amount = $this->tax_lib->get_sales_tax_for_amount($tax_basis, $item['percent'], PHP_ROUND_HALF_UP, $tax_decimals); } - $this->update_sales_items_taxes_amount($sale_id, $item['line'], $item['name'], $item['percentcustomer_sales_tax_support'], $tax_type, $item_tax_amount); + $this->update_sales_items_taxes_amount($sale_id, $item['line'], $item['name'], $item['percent'], $tax_type, $item_tax_amount); $this->tax_lib->update_sales_taxes($sales_taxes, $tax_type, $tax_group, $item['percent'], $tax_basis, $item_tax_amount, $tax_group_sequence, PHP_ROUND_HALF_UP, $sale_id, $item['name']); $tax_group_sequence += 1; } From dbfe9b7e55bc5cd85b76318ad1ca8314e8d1668b Mon Sep 17 00:00:00 2001 From: jekkos Date: Sun, 16 Sep 2018 23:43:55 +0200 Subject: [PATCH 232/568] Migration script fixes --- application/migrations/sqlscripts/3.0.2_to_3.1.1.sql | 6 +++++- database/2.4_to_3.0.sql | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/application/migrations/sqlscripts/3.0.2_to_3.1.1.sql b/application/migrations/sqlscripts/3.0.2_to_3.1.1.sql index a74b193d1..e366e071e 100644 --- a/application/migrations/sqlscripts/3.0.2_to_3.1.1.sql +++ b/application/migrations/sqlscripts/3.0.2_to_3.1.1.sql @@ -69,7 +69,8 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('last_used_invoice_number', '0'), ('last_used_quote_number', '0'), ('line_sequence', '0'), -('dinner_table_enable', '0'); +('dinner_table_enable', '0'), +('customer_sales_tax_support', '0'); -- -- Table structure for table `ospos_customer_packages` @@ -415,3 +416,6 @@ ALTER TABLE ospos_items -- Change language code en to be en-US UPDATE `ospos_app_config` SET `value` = 'en-US' WHERE `key` = 'language_code' AND `value` = 'en'; + +-- Delete any configured specific locale as folders were moved in this version +DELETE FROM `ospos_app_config` WHERE `key` = 'language_code' and `value` LIKE '%_%'; diff --git a/database/2.4_to_3.0.sql b/database/2.4_to_3.0.sql index 5369c7efa..02399fce0 100644 --- a/database/2.4_to_3.0.sql +++ b/database/2.4_to_3.0.sql @@ -51,6 +51,7 @@ UPDATE `ospos_app_config` SET `key` = 'receipt_show_total_discount' WHERE `key` DELETE FROM `ospos_app_config` WHERE `key` = 'use_invoice_template'; DELETE FROM `ospos_app_config` WHERE `key` = 'language'; +DELETE FROM `ospos_app_config` WHERE `key` = 'thousands_separator'; INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('receipt_show_description', '1'), From 0ffece7cb843b999246360b3d97f2cd61caf23bc Mon Sep 17 00:00:00 2001 From: objecttothis <17935339+objecttothis@users.noreply.github.com> Date: Tue, 18 Sep 2018 18:15:34 +0400 Subject: [PATCH 233/568] Correct errors in redirect with advanced install This should cover the following scenarios 1- Install is in the root folder (www.example.com) 2- Install is in a subfolder (www.example.com/pos/) 3- Install is in an subdomain or subdomain and subfolder (pos.example.com or pos.example.com/abc) 4- User attempts to navigate to other subfolders (www.example.com/vendor). In each case the expected behavior is to redirect to URI/public as an external redirect with no errors. When testing PLEASE clear your browser cache/history and restart your browser. Most browsers have a bad habit of caching errors and then you don't know if you are getting a cached error or the current results. --- .htaccess | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.htaccess b/.htaccess index 4d3aa7a80..75ce364c4 100755 --- a/.htaccess +++ b/.htaccess @@ -2,7 +2,7 @@ RewriteEngine On RewriteCond %{REQUEST_URI} !^public$ - RewriteRule ^(.*)$ %{REQUEST_URI}public/ [R=301,L] + RewriteRule "^(.*)$" "/public/" [R=301,L] # disable directory browsing From c3ba10f2e56009a2c03fe2def2d081d1b364f8ce Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 19 Sep 2018 18:58:00 +1000 Subject: [PATCH 234/568] update invoice_email.css typo (#2146) Correcting css html color code. --- public/css/invoice_email.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/css/invoice_email.css b/public/css/invoice_email.css index 7cc1189cc..befa3f31d 100644 --- a/public/css/invoice_email.css +++ b/public/css/invoice_email.css @@ -44,11 +44,11 @@ pre { font-family: Helvetica; font-size: 13px; } #items td.total-line { text-align: right; border-width: 1px 0 1px 1px; border-style: solid; } #items td.total-value { text-align: right; border-width: 1px 0px 1px 0; border-style: solid; } #items td.centered-value { text-align: center; } -#items td.balance { background: #eeeee; } +#items td.balance { background: #eeeeee; } #items td.blank { border: 0; } #terms { text-align: center; margin: 20px 0; } #terms h5 { border-bottom: 1px solid black; font: 13px Helvetica, Sans-Serif; padding: 8px 0; margin: 8px 0; line-height: 1.3em; } .delete-wpr { position: relative; } -.delete { display: block; color: #000; text-decoration: none; position: absolute; background: #EEEEEE; font-weight: bold; padding: 0px 3px; border: 1px solid; top: -6px; left: -22px; font-family: Verdana; font-size: 12px; } \ No newline at end of file +.delete { display: block; color: #000; text-decoration: none; position: absolute; background: #EEEEEE; font-weight: bold; padding: 0px 3px; border: 1px solid; top: -6px; left: -22px; font-family: Verdana; font-size: 12px; } From 2cc58ad5465230520ca04ac08d4d4852e3bf53b9 Mon Sep 17 00:00:00 2001 From: jekkos Date: Sun, 23 Sep 2018 02:01:39 +0200 Subject: [PATCH 235/568] Fix language fallback (#2148) --- application/hooks/load_config.php | 23 ++++++++----------- .../migrations/sqlscripts/3.0.2_to_3.1.1.sql | 2 -- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/application/hooks/load_config.php b/application/hooks/load_config.php index 972c42625..15b79fce0 100644 --- a/application/hooks/load_config.php +++ b/application/hooks/load_config.php @@ -11,21 +11,18 @@ function load_config() { $CI->config->set_item($CI->security->xss_clean($app_config->key), $CI->security->xss_clean($app_config->value)); } - - //Loads all the language files from the language directory - if(!empty(current_language())) - { - // fallback to English if language folder does not exist - if(!file_exists('../application/language/' . current_language_code())) - { - $CI->config->set_item('language', 'english'); - $CI->config->set_item('language_code', 'en-US'); - } - _load_language_files($CI, '../vendor/codeigniter/framework/system/language', current_language()); - _load_language_files($CI, '../application/language', current_language_code()); + // fallback to English if language settings are not correct + $file_exists = !file_exists('../application/language/' . current_language_code()); + if(current_language_code() == null || current_language() == null || $file_exists) + { + $CI->config->set_item('language', 'english'); + $CI->config->set_item('language_code', 'en-US'); } - + + _load_language_files($CI, '../vendor/codeigniter/framework/system/language', current_language()); + _load_language_files($CI, '../application/language', current_language_code()); + //Set timezone from config database if($CI->config->item('timezone')) { diff --git a/application/migrations/sqlscripts/3.0.2_to_3.1.1.sql b/application/migrations/sqlscripts/3.0.2_to_3.1.1.sql index e366e071e..ea2f721a0 100644 --- a/application/migrations/sqlscripts/3.0.2_to_3.1.1.sql +++ b/application/migrations/sqlscripts/3.0.2_to_3.1.1.sql @@ -417,5 +417,3 @@ ALTER TABLE ospos_items UPDATE `ospos_app_config` SET `value` = 'en-US' WHERE `key` = 'language_code' AND `value` = 'en'; --- Delete any configured specific locale as folders were moved in this version -DELETE FROM `ospos_app_config` WHERE `key` = 'language_code' and `value` LIKE '%_%'; From 9f71427feeb5e365141d0e44081affbede2ae198 Mon Sep 17 00:00:00 2001 From: jekkos Date: Sun, 23 Sep 2018 14:05:16 +0200 Subject: [PATCH 236/568] Check for employee language property first (#2148) --- application/helpers/locale_helper.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/helpers/locale_helper.php b/application/helpers/locale_helper.php index ea71786c1..70346ff82 100644 --- a/application/helpers/locale_helper.php +++ b/application/helpers/locale_helper.php @@ -28,10 +28,10 @@ function current_language($load_system_language = FALSE) // Returns the language of the employee if set or system language if not if($employee->is_logged_in() && $load_system_language != TRUE) { - $employee_language = $employee->get_logged_in_employee_info()->language; - if($employee_language != NULL && $employee_language != '') + $employee_info = $employee->get_logged_in_employee_info(); + if(property_exists($employee_info, 'language') && !empty($employee_info->language)) { - return $employee_language; + return $employee_info->language; } } From a6b5726cdc9d9ad332eff2f17b65c52dc3d77fd8 Mon Sep 17 00:00:00 2001 From: jekkos Date: Sun, 23 Sep 2018 14:28:23 +0200 Subject: [PATCH 237/568] Start migration after installation check (#2148) --- application/controllers/Login.php | 8 ++++---- application/helpers/locale_helper.php | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/application/controllers/Login.php b/application/controllers/Login.php index 3b39e9f95..6c9cf10f4 100644 --- a/application/controllers/Login.php +++ b/application/controllers/Login.php @@ -41,6 +41,10 @@ class Login extends CI_Controller return FALSE; } + // trigger any required upgrade before starting the application + $this->load->library('migration'); + $this->migration->latest(); + if(!$this->Employee->login($username, $password)) { $this->form_validation->set_message('login_check', $this->lang->line('login_invalid_username_and_password')); @@ -48,10 +52,6 @@ class Login extends CI_Controller return FALSE; } - // trigger any required upgrade before starting the application - $this->load->library('migration'); - $this->migration->latest(); - return TRUE; } diff --git a/application/helpers/locale_helper.php b/application/helpers/locale_helper.php index 70346ff82..856cae56c 100644 --- a/application/helpers/locale_helper.php +++ b/application/helpers/locale_helper.php @@ -11,10 +11,11 @@ function current_language_code($load_system_language = FALSE) // Returns the language code of the employee if set or system language code if not if($employee->is_logged_in() && $load_system_language != TRUE) { - $employee_language_code = $employee->get_logged_in_employee_info()->language_code; - if($employee_language_code != NULL && $employee_language_code != '') + $employee_info = $employee->get_logged_in_employee_info(); + + if(property_exists($employee_info, 'language_code') && !empty($employee_info->language_code)) { - return $employee_language_code; + return $employee_info->language_code; } } From 330ec999b5445a3869d55879c1b0b2aceaa635f9 Mon Sep 17 00:00:00 2001 From: Xyko Arteiro Date: Sun, 23 Sep 2018 18:23:22 +0000 Subject: [PATCH 238/568] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (7 of 7 strings) Translation: opensourcepos/enum Translate-URL: http://weblate.jpeelaer.net/projects/ospos/enum/pt_BR/ --- application/language/pt-BR/enum_lang.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/application/language/pt-BR/enum_lang.php b/application/language/pt-BR/enum_lang.php index 593f5bd05..49351a0e1 100644 --- a/application/language/pt-BR/enum_lang.php +++ b/application/language/pt-BR/enum_lang.php @@ -1,8 +1,8 @@ Date: Sun, 23 Sep 2018 18:36:55 +0000 Subject: [PATCH 239/568] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (33 of 33 strings) --- application/language/pt-BR/item_kits_lang.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/application/language/pt-BR/item_kits_lang.php b/application/language/pt-BR/item_kits_lang.php index c678870ef..b4ad79ad0 100644 --- a/application/language/pt-BR/item_kits_lang.php +++ b/application/language/pt-BR/item_kits_lang.php @@ -1,12 +1,11 @@ - Date: Sun, 23 Sep 2018 18:38:26 +0000 Subject: [PATCH 240/568] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (52 of 52 strings) --- application/language/pt-BR/receivings_lang.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/language/pt-BR/receivings_lang.php b/application/language/pt-BR/receivings_lang.php index 4f0f8074d..b0c72f631 100644 --- a/application/language/pt-BR/receivings_lang.php +++ b/application/language/pt-BR/receivings_lang.php @@ -1,5 +1,4 @@ - Date: Sun, 23 Sep 2018 18:40:43 +0000 Subject: [PATCH 241/568] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (51 of 51 strings) --- application/language/pt-BR/customers_lang.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/application/language/pt-BR/customers_lang.php b/application/language/pt-BR/customers_lang.php index 209ee920d..455fb12bb 100644 --- a/application/language/pt-BR/customers_lang.php +++ b/application/language/pt-BR/customers_lang.php @@ -47,3 +47,6 @@ $lang["customers_taxable"] = "Tributável"; $lang["customers_total"] = "Total"; $lang["customers_update"] = "Atualizar Cliente"; $lang["rewards_package"] = "Pacote de recompensas"; +$lang["customers_discount_type"] = "Tipo de desconto"; +$lang["customers_discount_fixed"] = "Desconto fixo"; +$lang["customers_discount_percent"] = "Percentual de desconto"; From 1ffbbefca446e1f4261adcd330de646d2929e642 Mon Sep 17 00:00:00 2001 From: Xyko Arteiro Date: Sun, 23 Sep 2018 18:41:37 +0000 Subject: [PATCH 242/568] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (19 of 19 strings) Translation: opensourcepos/expenses_categories Translate-URL: http://weblate.jpeelaer.net/projects/ospos/expenses_categories/pt_BR/ --- application/language/pt-BR/expenses_categories_lang.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/language/pt-BR/expenses_categories_lang.php b/application/language/pt-BR/expenses_categories_lang.php index afb424f62..a82da6d9a 100644 --- a/application/language/pt-BR/expenses_categories_lang.php +++ b/application/language/pt-BR/expenses_categories_lang.php @@ -1,5 +1,4 @@ - Date: Sun, 23 Sep 2018 18:42:08 +0000 Subject: [PATCH 243/568] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (108 of 108 strings) --- application/language/pt-BR/items_lang.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/language/pt-BR/items_lang.php b/application/language/pt-BR/items_lang.php index 13e518a85..424a771ed 100644 --- a/application/language/pt-BR/items_lang.php +++ b/application/language/pt-BR/items_lang.php @@ -104,3 +104,7 @@ $lang["items_unit_price_required"] = "Preço de varejo é um campo obrigatório. $lang["items_upc_database"] = "Base de dados UPC"; $lang["items_update"] = "Atualizar Item"; $lang["items_use_inventory_menu"] = "Usar Menu Inventário"; +$lang["items_default_pack_name"] = "Cada"; +$lang["items_low_sell_item"] = "Item de baixa venda"; +$lang["items_pack_name"] = "Nome do pacote"; +$lang["items_qty_per_pack"] = "Quantidade por embalagem"; From dd831397603fb2496497ab39ce241796490d2c50 Mon Sep 17 00:00:00 2001 From: Xyko Arteiro Date: Sun, 23 Sep 2018 18:45:17 +0000 Subject: [PATCH 244/568] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (37 of 37 strings) Translation: opensourcepos/module Translate-URL: http://weblate.jpeelaer.net/projects/ospos/module/pt_BR/ --- application/language/pt-BR/module_lang.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/application/language/pt-BR/module_lang.php b/application/language/pt-BR/module_lang.php index 7df7cb059..ab7eee6ee 100644 --- a/application/language/pt-BR/module_lang.php +++ b/application/language/pt-BR/module_lang.php @@ -1,5 +1,4 @@ - Date: Tue, 25 Sep 2018 20:18:08 -0400 Subject: [PATCH 245/568] Fix issue with deleted items not being included in reprinted receipts. --- application/models/Item.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/application/models/Item.php b/application/models/Item.php index b9e3bf18c..9bd51473c 100644 --- a/application/models/Item.php +++ b/application/models/Item.php @@ -338,9 +338,7 @@ class Item extends CI_Model $this->db->group_end(); - $this->db->where('items.deleted', 0); - - // limit to only 1 so there is a result in case two are returned + // limit to only 1 so there is a result in case two are returned // due to barcode and item_id clash $this->db->limit(1); From 6d5f518855c4fde46b20b4fd96ac2fa977db4997 Mon Sep 17 00:00:00 2001 From: Steve Ireland Date: Wed, 26 Sep 2018 21:36:04 -0400 Subject: [PATCH 246/568] Fix issue with deleted items not being included in reprinted receipts. --- application/libraries/Sale_lib.php | 6 +++--- application/models/Item.php | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/application/libraries/Sale_lib.php b/application/libraries/Sale_lib.php index 6e98c0918..8ecd6fcb3 100644 --- a/application/libraries/Sale_lib.php +++ b/application/libraries/Sale_lib.php @@ -698,7 +698,7 @@ class Sale_lib 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 ) { - $item_info = $this->CI->Item->get_info_by_id_or_number($item_id); + $item_info = $this->CI->Item->get_info_by_id_or_number($item_id, $include_deleted); //make sure item exists if(empty($item_info)) @@ -883,7 +883,7 @@ class Sale_lib //make sure item exists if($item_id != -1) { - $item_info = $this->CI->Item->get_info_by_id_or_number($item_id); + $item_info = $this->CI->Item->get_info_by_id_or_number($item_id, TRUE); if($item_info->stock_type == HAS_STOCK) { @@ -1001,7 +1001,7 @@ class Sale_lib foreach($this->CI->Item_kit_items->get_info($item_kit_id) as $item_kit_item) { - $result &= $this->add_item($item_kit_item['item_id'], $item_kit_item['quantity'], $item_location, $discount, $discount_type, PRICE_MODE_KIT, $kit_price_option, $kit_print_option, NULL, NULL, NULL, NULL); + $result &= $this->add_item($item_kit_item['item_id'], $item_kit_item['quantity'], $item_location, $discount, $discount_type, PRICE_MODE_KIT, $kit_price_option, $kit_print_option, NULL, NULL, NULL, FALSE); if($stock_warning == NULL) { diff --git a/application/models/Item.php b/application/models/Item.php index 9bd51473c..ac1df7f73 100644 --- a/application/models/Item.php +++ b/application/models/Item.php @@ -321,7 +321,7 @@ class Item extends CI_Model /* Gets information about a particular item by item id or number */ - public function get_info_by_id_or_number($item_id) + public function get_info_by_id_or_number($item_id, $include_deleted = TRUE) { $this->db->from('items'); @@ -338,6 +338,11 @@ class Item extends CI_Model $this->db->group_end(); + if(!$include_deleted) + { + $this->db->where("items.deleted = '0'"); + } + // limit to only 1 so there is a result in case two are returned // due to barcode and item_id clash $this->db->limit(1); From 68051bdcdb5f43b763c3b2b611acd378efeae3f9 Mon Sep 17 00:00:00 2001 From: jekkos Date: Mon, 24 Sep 2018 22:59:43 +0200 Subject: [PATCH 247/568] Add totals to discount report --- application/controllers/Reports.php | 1 + application/models/reports/Summary_discounts.php | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/application/controllers/Reports.php b/application/controllers/Reports.php index 3466d1ba3..9fe6945df 100644 --- a/application/controllers/Reports.php +++ b/application/controllers/Reports.php @@ -348,6 +348,7 @@ class Reports extends Secure_Controller foreach($report_data as $row) { $tabular_data[] = $this->xss_clean(array( + 'total' => to_currency($row['total']), 'discount' => $row['discount'], 'count' => $row['count'] )); diff --git a/application/models/reports/Summary_discounts.php b/application/models/reports/Summary_discounts.php index 3c94829fb..eaeb742c6 100644 --- a/application/models/reports/Summary_discounts.php +++ b/application/models/reports/Summary_discounts.php @@ -8,19 +8,20 @@ class Summary_discounts extends Summary_report { return array( array('discount' => $this->lang->line('reports_discount_percent'), 'sorter' => 'number_sorter'), - array('count' => $this->lang->line('reports_count'))); + array('count' => $this->lang->line('reports_count')), + array('total' => $this->lang->line('reports_total'))); } public function getData(array $inputs) { if($inputs['discount_type'] == FIXED) { - $this->db->select('MAX(CONCAT("'.$this->config->item('currency_symbol').'",sales_items.discount)) AS discount, count(*) AS count'); + $this->db->select('SUM(payment_amount) AS total, MAX(CONCAT("'.$this->config->item('currency_symbol').'",sales_items.discount)) AS discount, count(*) AS count'); $this->db->where('discount_type',FIXED); } elseif($inputs['discount_type'] == PERCENT) { - $this->db->select('MAX(CONCAT(sales_items.discount, "%")) AS discount, count(*) AS count'); + $this->db->select('SUM(payment_amount) AS total, MAX(CONCAT(sales_items.discount, "%")) AS discount, count(*) AS count'); $this->db->where('discount_type',PERCENT); } @@ -30,6 +31,7 @@ class Summary_discounts extends Summary_report $this->db->from('sales_items AS sales_items'); + $this->db->join('sales_payments', 'sales_payments.sale_id = sales_items.sale_id'); $this->db->join('sales AS sales', 'sales_items.sale_id = sales.sale_id', 'inner'); $this->_where($inputs); From 46b845ab0140d9c29b92767f90dc296c4426a0c9 Mon Sep 17 00:00:00 2001 From: jekkos Date: Mon, 24 Sep 2018 22:59:43 +0200 Subject: [PATCH 248/568] Add totals to discount repor --- application/models/reports/Summary_discounts.php | 1 + 1 file changed, 1 insertion(+) diff --git a/application/models/reports/Summary_discounts.php b/application/models/reports/Summary_discounts.php index eaeb742c6..41f28c5ac 100644 --- a/application/models/reports/Summary_discounts.php +++ b/application/models/reports/Summary_discounts.php @@ -33,6 +33,7 @@ class Summary_discounts extends Summary_report $this->db->from('sales_items AS sales_items'); $this->db->join('sales_payments', 'sales_payments.sale_id = sales_items.sale_id'); $this->db->join('sales AS sales', 'sales_items.sale_id = sales.sale_id', 'inner'); + $this->db->where('payment_type <>', 'Cash'); $this->_where($inputs); From 511f21931cb62ce1d681645fccf2c1b7cda18ea2 Mon Sep 17 00:00:00 2001 From: jekkos Date: Fri, 28 Sep 2018 20:52:42 +0200 Subject: [PATCH 249/568] Fix discount totals --- application/models/reports/Summary_discounts.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/application/models/reports/Summary_discounts.php b/application/models/reports/Summary_discounts.php index 41f28c5ac..2919bcb4d 100644 --- a/application/models/reports/Summary_discounts.php +++ b/application/models/reports/Summary_discounts.php @@ -7,7 +7,7 @@ class Summary_discounts extends Summary_report protected function _get_data_columns() { return array( - array('discount' => $this->lang->line('reports_discount_percent'), 'sorter' => 'number_sorter'), + array('discount' => $this->lang->line('reports_discount'), 'sorter' => 'number_sorter'), array('count' => $this->lang->line('reports_count')), array('total' => $this->lang->line('reports_total'))); } @@ -16,12 +16,12 @@ class Summary_discounts extends Summary_report { if($inputs['discount_type'] == FIXED) { - $this->db->select('SUM(payment_amount) AS total, MAX(CONCAT("'.$this->config->item('currency_symbol').'",sales_items.discount)) AS discount, count(*) AS count'); + $this->db->select('SUM(sales_items.discount) AS total, MAX(CONCAT("'.$this->config->item('currency_symbol').'",sales_items.discount)) AS discount, count(*) AS count'); $this->db->where('discount_type',FIXED); } elseif($inputs['discount_type'] == PERCENT) { - $this->db->select('SUM(payment_amount) AS total, MAX(CONCAT(sales_items.discount, "%")) AS discount, count(*) AS count'); + $this->db->select('SUM(payment_amount) * sales_items.discount / 100.0 AS total, MAX(CONCAT(sales_items.discount, "%")) AS discount, count(*) AS count'); $this->db->where('discount_type',PERCENT); } @@ -33,7 +33,6 @@ class Summary_discounts extends Summary_report $this->db->from('sales_items AS sales_items'); $this->db->join('sales_payments', 'sales_payments.sale_id = sales_items.sale_id'); $this->db->join('sales AS sales', 'sales_items.sale_id = sales.sale_id', 'inner'); - $this->db->where('payment_type <>', 'Cash'); $this->_where($inputs); From c57f063dc1831459e14ea3963ec9f47d88e8fba2 Mon Sep 17 00:00:00 2001 From: jekkos Date: Sat, 29 Sep 2018 16:47:28 +0200 Subject: [PATCH 250/568] Fix discount calculation --- application/models/reports/Summary_discounts.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/application/models/reports/Summary_discounts.php b/application/models/reports/Summary_discounts.php index 2919bcb4d..02b3970ff 100644 --- a/application/models/reports/Summary_discounts.php +++ b/application/models/reports/Summary_discounts.php @@ -21,7 +21,7 @@ class Summary_discounts extends Summary_report } elseif($inputs['discount_type'] == PERCENT) { - $this->db->select('SUM(payment_amount) * sales_items.discount / 100.0 AS total, MAX(CONCAT(sales_items.discount, "%")) AS discount, count(*) AS count'); + $this->db->select('SUM(item_unit_price) * sales_items.discount / 100.0 AS total, MAX(CONCAT(sales_items.discount, "%")) AS discount, count(*) AS count'); $this->db->where('discount_type',PERCENT); } @@ -31,7 +31,6 @@ class Summary_discounts extends Summary_report $this->db->from('sales_items AS sales_items'); - $this->db->join('sales_payments', 'sales_payments.sale_id = sales_items.sale_id'); $this->db->join('sales AS sales', 'sales_items.sale_id = sales.sale_id', 'inner'); $this->_where($inputs); From adc72571ba8aec600d37c14358620279edc2fc07 Mon Sep 17 00:00:00 2001 From: Xyko Arteiro Date: Sun, 23 Sep 2018 18:46:16 +0000 Subject: [PATCH 251/568] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (114 of 114 strings) --- application/language/pt-BR/reports_lang.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/language/pt-BR/reports_lang.php b/application/language/pt-BR/reports_lang.php index 5d146d56d..46946852e 100644 --- a/application/language/pt-BR/reports_lang.php +++ b/application/language/pt-BR/reports_lang.php @@ -120,3 +120,7 @@ $lang["reports_unit_price"] = "Preço Varejo"; $lang["reports_used"] = "Pontos usados"; $lang["reports_work_orders"] = "Ordens de trabalho"; $lang["reports_zero_and_less"] = "Zero e menor"; +$lang["reports_low_sell_quantity"] = "Qtd de baixa venda"; +$lang["reports_total_low_sell_quantity"] = "Quantidade Total de Venda Baixa"; +$lang["reports_discount_type"] = "Tipo de desconto"; +$lang["reports_discount_fixed"] = "Desconto fixo"; From 87f63c46552ab9f15856de1e043fc415cea35b0e Mon Sep 17 00:00:00 2001 From: Xyko Arteiro Date: Sun, 23 Sep 2018 18:47:28 +0000 Subject: [PATCH 252/568] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (162 of 162 strings) --- application/language/pt-BR/sales_lang.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/language/pt-BR/sales_lang.php b/application/language/pt-BR/sales_lang.php index 32dcce4b2..c2697e760 100644 --- a/application/language/pt-BR/sales_lang.php +++ b/application/language/pt-BR/sales_lang.php @@ -43,7 +43,7 @@ $lang["sales_delete_unsuccessful"] = "Foi excluído com sucesso uma venda."; $lang["sales_description_abbrv"] = "Descrição."; $lang["sales_discard"] = "Descartar"; $lang["sales_discard_quote"] = ""; -$lang["sales_discount"] = "Desc. %"; +$lang["sales_discount"] = "Desconto"; $lang["sales_discount_included"] = "% Desconto"; $lang["sales_discount_short"] = "%"; $lang["sales_due"] = "Vencimento"; @@ -83,7 +83,7 @@ $lang["sales_must_enter_numeric"] = "Deve entrar valor numérico para montante d $lang["sales_must_enter_numeric_giftcard"] = "Deve entrar valor numérico para o número de cartão presente."; $lang["sales_new_customer"] = "Novo Cliente"; $lang["sales_new_item"] = "Novo Item"; -$lang["sales_no_description"] = "Nenhum"; +$lang["sales_no_description"] = "Sem descrição"; $lang["sales_no_filter"] = "Todos"; $lang["sales_no_items_in_cart"] = "Não há itens na cesta."; $lang["sales_no_sales_to_display"] = "Sem vendas para mostrar."; From 710ab32b2ffd390ecbf581f17834022280e0e197 Mon Sep 17 00:00:00 2001 From: Xyko Arteiro Date: Sun, 23 Sep 2018 18:48:28 +0000 Subject: [PATCH 253/568] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (272 of 272 strings) --- application/language/pt-BR/config_lang.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/language/pt-BR/config_lang.php b/application/language/pt-BR/config_lang.php index 76f218e43..2bf3cb9ae 100644 --- a/application/language/pt-BR/config_lang.php +++ b/application/language/pt-BR/config_lang.php @@ -77,7 +77,7 @@ $lang["config_default_barcode_page_width_required"] = "A largura da página de c $lang["config_default_barcode_width_number"] = "A largura do código de barras padrão deve ser um número."; $lang["config_default_barcode_width_required"] = "A largura do código de barras padrão é um campo obrigatório."; $lang["config_default_origin_tax_code"] = "Código de imposto de origem padrão"; -$lang["config_default_sales_discount"] = "Desconto de vendas padrão %"; +$lang["config_default_sales_discount"] = "Desconto de vendas padrão"; $lang["config_default_sales_discount_number"] = "O desconto de vendas padrão deve ser um número."; $lang["config_default_sales_discount_required"] = "O desconto de vendas padrão é um campo obrigatório."; $lang["config_default_tax_name_number"] = "O nome do imposto padrão deve ser uma string."; @@ -270,3 +270,4 @@ $lang["config_top"] = "Topo"; $lang["config_website"] = "Site da internet"; $lang["config_work_order_enable"] = "Suporte para Ordem de Serviço"; $lang["config_work_order_format"] = "Formato Ordem de Serviço"; +$lang["config_multi_pack_enabled"] = "Vários pacotes por item"; From ef8dc97de999eaf7a9cb35bbc5c53c47db70dd6e Mon Sep 17 00:00:00 2001 From: Zhivko Vanev Date: Sun, 30 Sep 2018 06:16:41 +0000 Subject: [PATCH 254/568] Translated using Weblate (Bulgarian) Currently translated at 100.0% (17 of 17 strings) --- application/language/bg/suppliers_lang.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/application/language/bg/suppliers_lang.php b/application/language/bg/suppliers_lang.php index 6ff4d509d..0d3cc8aac 100644 --- a/application/language/bg/suppliers_lang.php +++ b/application/language/bg/suppliers_lang.php @@ -1,12 +1,11 @@ - Date: Sun, 30 Sep 2018 06:23:57 +0000 Subject: [PATCH 255/568] Translated using Weblate (Bulgarian) Currently translated at 100.0% (30 of 30 strings) Translation: opensourcepos/taxes Translate-URL: http://weblate.jpeelaer.net/projects/ospos/taxes/bg/ --- application/language/bg/taxes_lang.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/application/language/bg/taxes_lang.php b/application/language/bg/taxes_lang.php index 1b4b164a7..6ffc37ab5 100644 --- a/application/language/bg/taxes_lang.php +++ b/application/language/bg/taxes_lang.php @@ -1,8 +1,7 @@ - Date: Sun, 23 Sep 2018 18:51:23 +0000 Subject: [PATCH 256/568] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (272 of 272 strings) --- application/language/pt-BR/config_lang.php | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/application/language/pt-BR/config_lang.php b/application/language/pt-BR/config_lang.php index 2bf3cb9ae..46a17f68e 100644 --- a/application/language/pt-BR/config_lang.php +++ b/application/language/pt-BR/config_lang.php @@ -1,12 +1,12 @@ Date: Sun, 30 Sep 2018 06:17:19 +0000 Subject: [PATCH 257/568] Translated using Weblate (Bulgarian) Currently translated at 100.0% (17 of 17 strings) --- application/language/bg/suppliers_lang.php | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/application/language/bg/suppliers_lang.php b/application/language/bg/suppliers_lang.php index 0d3cc8aac..01bad7440 100644 --- a/application/language/bg/suppliers_lang.php +++ b/application/language/bg/suppliers_lang.php @@ -1,18 +1,18 @@ Date: Sun, 30 Sep 2018 07:09:35 +0000 Subject: [PATCH 258/568] Translated using Weblate (Bulgarian) Currently translated at 100.0% (30 of 30 strings) Translation: opensourcepos/taxes Translate-URL: http://weblate.jpeelaer.net/projects/ospos/taxes/bg/ --- application/language/bg/taxes_lang.php | 58 +++++++++++++------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/application/language/bg/taxes_lang.php b/application/language/bg/taxes_lang.php index 6ffc37ab5..853a62e06 100644 --- a/application/language/bg/taxes_lang.php +++ b/application/language/bg/taxes_lang.php @@ -1,31 +1,31 @@ Date: Sun, 30 Sep 2018 15:17:31 +0100 Subject: [PATCH 259/568] Add due payment to cashup (#440 #2131) --- application/controllers/Cashups.php | 13 +++++++---- application/helpers/tabular_helper.php | 2 ++ application/language/en-GB/cashups_lang.php | 1 + application/language/en-US/cashups_lang.php | 1 + ...hp => 20180930120000_upgrade_to_3_3_0.php} | 0 .../migrations/sqlscripts/3.2.1_to_3.3.0.sql | 1 + application/models/Cashup.php | 2 ++ application/views/cashups/form.php | 23 ++++++++++++++++++- 8 files changed, 37 insertions(+), 6 deletions(-) rename application/migrations/{20180909120000_upgrade_to_3_3_0.php => 20180930120000_upgrade_to_3_3_0.php} (100%) diff --git a/application/controllers/Cashups.php b/application/controllers/Cashups.php index b7f0d9e96..c8d137759 100644 --- a/application/controllers/Cashups.php +++ b/application/controllers/Cashups.php @@ -78,6 +78,7 @@ class Cashups extends Secure_Controller } // if all the amounts are null or 0 that means it's a close cashup elseif(floatval($cash_ups_info->closed_amount_cash) == 0 && + floatval($cash_ups_info->closed_amount_due) == 0 && floatval($cash_ups_info->closed_amount_card) == 0 && floatval($cash_ups_info->closed_amount_check) == 0) { @@ -111,7 +112,7 @@ class Cashups extends Secure_Controller } elseif($row['payment_type'] == $this->lang->line('sales_due')) { - $cash_ups_info->closed_amount_cash -= $this->xss_clean($row['payment_amount']); + $cash_ups_info->closed_amount_due += $this->xss_clean($row['payment_amount']); } elseif($row['payment_type'] == $this->lang->line('sales_debit') || $row['payment_type'] == $this->lang->line('sales_credit')) @@ -139,7 +140,7 @@ class Cashups extends Secure_Controller $cash_ups_info->closed_amount_cash -= $this->xss_clean($row['amount']); } - $cash_ups_info->closed_amount_total = $this->_calculate_total($cash_ups_info->open_amount_cash, $cash_ups_info->transfer_amount_cash, $cash_ups_info->closed_amount_cash, $cash_ups_info->closed_amount_card, $cash_ups_info->closed_amount_check); + $cash_ups_info->closed_amount_total = $this->_calculate_total($cash_ups_info->open_amount_cash, $cash_ups_info->transfer_amount_cash, $cash_ups_info->closed_amount_cash, $cash_ups_info->closed_amount_due, $cash_ups_info->closed_amount_card, $cash_ups_info->closed_amount_check); } $data['cash_ups_info'] = $cash_ups_info; @@ -169,6 +170,7 @@ class Cashups extends Secure_Controller 'open_amount_cash' => parse_decimals($this->input->post('open_amount_cash')), 'transfer_amount_cash' => parse_decimals($this->input->post('transfer_amount_cash')), 'closed_amount_cash' => parse_decimals($this->input->post('closed_amount_cash')), + 'closed_amount_due' => parse_decimals($this->input->post('closed_amount_due')), 'closed_amount_card' => parse_decimals($this->input->post('closed_amount_card')), 'closed_amount_check' => parse_decimals($this->input->post('closed_amount_check')), 'closed_amount_total' => parse_decimals($this->input->post('closed_amount_total')), @@ -221,10 +223,11 @@ class Cashups extends Secure_Controller $open_amount_cash = parse_decimals($this->input->post('open_amount_cash')); $transfer_amount_cash = parse_decimals($this->input->post('transfer_amount_cash')); $closed_amount_cash = parse_decimals($this->input->post('closed_amount_cash')); + $closed_amount_due = parse_decimals($this->input->post('closed_amount_due')); $closed_amount_card = parse_decimals($this->input->post('closed_amount_card')); $closed_amount_check = parse_decimals($this->input->post('closed_amount_check')); - $total = $this->_calculate_total($open_amount_cash, $transfer_amount_cash, $closed_amount_cash, $closed_amount_card, $closed_amount_check); + $total = $this->_calculate_total($open_amount_cash, $transfer_amount_cash, $closed_amount_due, $closed_amount_cash, $closed_amount_card, $closed_amount_check); echo json_encode(array('total' => to_currency_no_money($total))); } @@ -232,9 +235,9 @@ class Cashups extends Secure_Controller /* Calculate total */ - private function _calculate_total($open_amount_cash, $transfer_amount_cash, $closed_amount_cash, $closed_amount_card, $closed_amount_check) + private function _calculate_total($open_amount_cash, $transfer_amount_cash, $closed_amount_due, $closed_amount_cash, $closed_amount_card, $closed_amount_check) { - return ($closed_amount_cash - $open_amount_cash - $transfer_amount_cash + $closed_amount_card + $closed_amount_check); + return ($closed_amount_cash - $open_amount_cash - $transfer_amount_cash + $closed_amount_due + $closed_amount_card + $closed_amount_check); } } ?> diff --git a/application/helpers/tabular_helper.php b/application/helpers/tabular_helper.php index 0f1ee1949..1a791403a 100644 --- a/application/helpers/tabular_helper.php +++ b/application/helpers/tabular_helper.php @@ -660,6 +660,7 @@ function get_cashups_manage_table_headers() array('close_employee_id' => $CI->lang->line('cashups_close_employee')), array('closed_amount_cash' => $CI->lang->line('cashups_closed_amount_cash')), array('note' => $CI->lang->line('cashups_note')), + array('closed_amount_due' => $CI->lang->line('cashups_closed_amount_due')), array('closed_amount_card' => $CI->lang->line('cashups_closed_amount_card')), array('closed_amount_check' => $CI->lang->line('cashups_closed_amount_check')), array('closed_amount_total' => $CI->lang->line('cashups_closed_amount_total')) @@ -685,6 +686,7 @@ function get_cash_up_data_row($cash_up) 'close_employee_id' => $cash_up->close_first_name . ' ' . $cash_up->close_last_name, 'closed_amount_cash' => to_currency($cash_up->closed_amount_cash), 'note' => $cash_up->note ? '' : '', + 'closed_amount_due' => to_currency($cash_up->closed_amount_due), 'closed_amount_card' => to_currency($cash_up->closed_amount_card), 'closed_amount_check' => to_currency($cash_up->closed_amount_check), 'closed_amount_total' => to_currency($cash_up->closed_amount_total), diff --git a/application/language/en-GB/cashups_lang.php b/application/language/en-GB/cashups_lang.php index 38932c9f8..4d707fc1b 100644 --- a/application/language/en-GB/cashups_lang.php +++ b/application/language/en-GB/cashups_lang.php @@ -20,6 +20,7 @@ $lang['cashups_transfer_amount_cash'] = "In/Out Cash"; $lang['cashups_closed_amount_cash'] = "Closed Cash"; $lang['cashups_closed_amount_card'] = "Cards"; $lang['cashups_closed_amount_check'] = "Cheques"; +$lang['cashups_closed_amount_due'] = "Dues"; $lang["cashups_new"] = "New Cashup"; $lang["cashups_no_cashups_to_display"] = "There are no Cashups to display"; $lang["cashups_none_selected"] = "You have not selected any Cashups"; diff --git a/application/language/en-US/cashups_lang.php b/application/language/en-US/cashups_lang.php index 5688070f1..28c708fec 100644 --- a/application/language/en-US/cashups_lang.php +++ b/application/language/en-US/cashups_lang.php @@ -20,6 +20,7 @@ $lang['cashups_transfer_amount_cash'] = "In/Out Cash"; $lang['cashups_closed_amount_cash'] = "Closed Cash"; $lang['cashups_closed_amount_card'] = "Cards"; $lang['cashups_closed_amount_check'] = "Checks"; +$lang['cashups_closed_amount_due'] = "Dues"; $lang["cashups_new"] = "New Cashup"; $lang["cashups_no_cashups_to_display"] = "There are no Cashups to display"; $lang["cashups_none_selected"] = "You have not selected any Cashups"; diff --git a/application/migrations/20180909120000_upgrade_to_3_3_0.php b/application/migrations/20180930120000_upgrade_to_3_3_0.php similarity index 100% rename from application/migrations/20180909120000_upgrade_to_3_3_0.php rename to application/migrations/20180930120000_upgrade_to_3_3_0.php diff --git a/application/migrations/sqlscripts/3.2.1_to_3.3.0.sql b/application/migrations/sqlscripts/3.2.1_to_3.3.0.sql index 98a610aeb..90b96d668 100644 --- a/application/migrations/sqlscripts/3.2.1_to_3.3.0.sql +++ b/application/migrations/sqlscripts/3.2.1_to_3.3.0.sql @@ -69,6 +69,7 @@ CREATE TABLE `ospos_cash_up` ( `transfer_amount_cash` decimal(15,2) NOT NULL, `note` int(1) NOT NULL, `closed_amount_cash` decimal(15,2) NOT NULL, + `closed_amount_due` decimal(15,2) NOT NULL, `closed_amount_card` decimal(15,2) NOT NULL, `closed_amount_check` decimal(15,2) NOT NULL, `closed_amount_total` decimal(15,2) NOT NULL, diff --git a/application/models/Cashup.php b/application/models/Cashup.php index da938bc87..de03509b9 100644 --- a/application/models/Cashup.php +++ b/application/models/Cashup.php @@ -63,6 +63,7 @@ class Cashup extends CI_Model MAX(cash_up.open_amount_cash) AS open_amount_cash, MAX(cash_up.transfer_amount_cash) AS transfer_amount_cash, MAX(cash_up.closed_amount_cash) AS closed_amount_cash, + MAX(cash_up.closed_amount_due) AS closed_amount_due, MAX(cash_up.closed_amount_card) AS closed_amount_card, MAX(cash_up.closed_amount_check) AS closed_amount_check, MAX(cash_up.closed_amount_total) AS closed_amount_total, @@ -131,6 +132,7 @@ class Cashup extends CI_Model cash_up.open_amount_cash AS open_amount_cash, cash_up.transfer_amount_cash AS transfer_amount_cash, cash_up.closed_amount_cash AS closed_amount_cash, + cash_up.closed_amount_due AS closed_amount_due, cash_up.closed_amount_card AS closed_amount_card, cash_up.closed_amount_check AS closed_amount_check, cash_up.closed_amount_total AS closed_amount_total, diff --git a/application/views/cashups/form.php b/application/views/cashups/form.php index 5696e2d3a..ede1c42e8 100644 --- a/application/views/cashups/form.php +++ b/application/views/cashups/form.php @@ -125,6 +125,26 @@ +
        + lang->line('cashups_closed_amount_due'), 'closed_amount_due', array('class'=>'control-label col-xs-3')); ?> +
        +
        + + config->item('currency_symbol'); ?> + + 'closed_amount_due', + 'id'=>'closed_amount_due', + 'class'=>'form-control input-sm', + 'value'=>to_currency_no_money($cash_ups_info->closed_amount_due)) + );?> + + config->item('currency_symbol'); ?> + +
        +
        +
        +
        lang->line('cashups_closed_amount_card'), 'closed_amount_card', array('class'=>'control-label col-xs-3')); ?>
        @@ -279,10 +299,11 @@ $(document).ready(function() language: '' }); - $('#open_amount_cash, #transfer_amount_cash, #closed_amount_cash, #closed_amount_card, #closed_amount_check').keyup(function() { + $('#open_amount_cash, #transfer_amount_cash, #closed_amount_cash, #closed_amount_due, #closed_amount_card, #closed_amount_check').keyup(function() { $.post("", { 'open_amount_cash': $('#open_amount_cash').val(), 'transfer_amount_cash': $('#transfer_amount_cash').val(), + 'closed_amount_due': $('#closed_amount_due').val(), 'closed_amount_cash': $('#closed_amount_cash').val(), 'closed_amount_card': $('#closed_amount_card').val(), 'closed_amount_check': $('#closed_amount_check').val() From deed04cd46d64afa26cb49cbf39c2b3c2a203fd6 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Wed, 3 Oct 2018 21:10:20 +0100 Subject: [PATCH 260/568] Alter cashup db table (#440 #2131) --- ...ade_to_3_3_0.php => 20181003120000_upgrade_to_3_3_0.php} | 0 application/migrations/sqlscripts/3.2.1_to_3.3.0.sql | 6 +++++- 2 files changed, 5 insertions(+), 1 deletion(-) rename application/migrations/{20180930120000_upgrade_to_3_3_0.php => 20181003120000_upgrade_to_3_3_0.php} (100%) diff --git a/application/migrations/20180930120000_upgrade_to_3_3_0.php b/application/migrations/20181003120000_upgrade_to_3_3_0.php similarity index 100% rename from application/migrations/20180930120000_upgrade_to_3_3_0.php rename to application/migrations/20181003120000_upgrade_to_3_3_0.php diff --git a/application/migrations/sqlscripts/3.2.1_to_3.3.0.sql b/application/migrations/sqlscripts/3.2.1_to_3.3.0.sql index 90b96d668..1a1591e16 100644 --- a/application/migrations/sqlscripts/3.2.1_to_3.3.0.sql +++ b/application/migrations/sqlscripts/3.2.1_to_3.3.0.sql @@ -69,7 +69,6 @@ CREATE TABLE `ospos_cash_up` ( `transfer_amount_cash` decimal(15,2) NOT NULL, `note` int(1) NOT NULL, `closed_amount_cash` decimal(15,2) NOT NULL, - `closed_amount_due` decimal(15,2) NOT NULL, `closed_amount_card` decimal(15,2) NOT NULL, `closed_amount_check` decimal(15,2) NOT NULL, `closed_amount_total` decimal(15,2) NOT NULL, @@ -98,3 +97,8 @@ ALTER TABLE `ospos_cash_up` ALTER TABLE ospos_cash_up CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE ospos_expense_categories CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; ALTER TABLE ospos_expenses CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; + +-- Add amount due + +ALTER TABLE `ospos_cash_up` + ADD `closed_amount_due` decimal(15,2) NOT NULL; From 006ee224352bbf6a2b71fe3037bc3c20935c5e51 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sun, 7 Oct 2018 15:45:20 +0100 Subject: [PATCH 261/568] Add Supplier Category (#2088) --- application/controllers/Suppliers.php | 6 +++- application/helpers/tabular_helper.php | 2 ++ application/language/en-GB/suppliers_lang.php | 3 ++ application/language/en-US/suppliers_lang.php | 3 ++ ...hp => 20181007120000_upgrade_to_3_3_0.php} | 0 .../migrations/sqlscripts/3.2.1_to_3.3.0.sql | 11 +++++- application/models/Supplier.php | 36 +++++++++++++++++-- application/views/suppliers/form.php | 7 ++++ 8 files changed, 63 insertions(+), 5 deletions(-) rename application/migrations/{20181003120000_upgrade_to_3_3_0.php => 20181007120000_upgrade_to_3_3_0.php} (100%) diff --git a/application/controllers/Suppliers.php b/application/controllers/Suppliers.php index b07218866..44ba50821 100644 --- a/application/controllers/Suppliers.php +++ b/application/controllers/Suppliers.php @@ -43,7 +43,9 @@ class Suppliers extends Persons $data_rows = array(); foreach($suppliers->result() as $supplier) { - $data_rows[] = $this->xss_clean(get_supplier_data_row($supplier)); + $row = $this->xss_clean(get_supplier_data_row($supplier)); + $row['category'] = $this->Supplier->get_category_name($row['category']); + $data_rows[] = $row; } echo json_encode(array('total' => $total_rows, 'rows' => $data_rows)); @@ -77,6 +79,7 @@ class Suppliers extends Persons $info->$property = $this->xss_clean($value); } $data['person_info'] = $info; + $data['categories'] = $this->Supplier->get_categories(); $this->load->view("suppliers/form", $data); } @@ -112,6 +115,7 @@ class Suppliers extends Persons $supplier_data = array( 'company_name' => $this->input->post('company_name'), 'agency_name' => $this->input->post('agency_name'), + 'category' => $this->input->post('category'), 'account_number' => $this->input->post('account_number') == '' ? NULL : $this->input->post('account_number') ); diff --git a/application/helpers/tabular_helper.php b/application/helpers/tabular_helper.php index 1a791403a..770037081 100644 --- a/application/helpers/tabular_helper.php +++ b/application/helpers/tabular_helper.php @@ -274,6 +274,7 @@ function get_suppliers_manage_table_headers() array('people.person_id' => $CI->lang->line('common_id')), array('company_name' => $CI->lang->line('suppliers_company_name')), array('agency_name' => $CI->lang->line('suppliers_agency_name')), + array('category' => $CI->lang->line('suppliers_category')), array('last_name' => $CI->lang->line('common_last_name')), array('first_name' => $CI->lang->line('common_first_name')), array('email' => $CI->lang->line('common_email')), @@ -300,6 +301,7 @@ function get_supplier_data_row($supplier) 'people.person_id' => $supplier->person_id, 'company_name' => $supplier->company_name, 'agency_name' => $supplier->agency_name, + 'category' => $supplier->category, 'last_name' => $supplier->last_name, 'first_name' => $supplier->first_name, 'email' => empty($supplier->email) ? '' : mailto($supplier->email, $supplier->email), diff --git a/application/language/en-GB/suppliers_lang.php b/application/language/en-GB/suppliers_lang.php index 1c9a1f051..c44c09b81 100644 --- a/application/language/en-GB/suppliers_lang.php +++ b/application/language/en-GB/suppliers_lang.php @@ -3,11 +3,14 @@ $lang["suppliers_account_number"] = "Account #"; $lang["suppliers_agency_name"] = "Agency Name"; $lang["suppliers_cannot_be_deleted"] = "Could not delete the selected Supplier(s). One or more have Sales"; +$lang["suppliers_category"] = "Category"; +$lang["suppliers_cost"] = "Cost Supplier"; $lang["suppliers_company_name"] = "Company Name"; $lang["suppliers_company_name_required"] = "Company Name is a required field"; $lang["suppliers_confirm_delete"] = "Are you sure you want to delete the selected Supplier(s)?"; $lang["suppliers_confirm_restore"] = "Are you sure you want to restore the selected Supplier(s)?"; $lang["suppliers_error_adding_updating"] = "Supplier update or add failed"; +$lang["suppliers_goods"] = "Goods Supplier"; $lang["suppliers_new"] = "New Supplier"; $lang["suppliers_none_selected"] = "You have not selected any Supplier(s) to delete"; $lang["suppliers_one_or_multiple"] = "Supplier(s)"; diff --git a/application/language/en-US/suppliers_lang.php b/application/language/en-US/suppliers_lang.php index 8e62cf7ca..58c3ab55d 100644 --- a/application/language/en-US/suppliers_lang.php +++ b/application/language/en-US/suppliers_lang.php @@ -3,11 +3,14 @@ $lang["suppliers_account_number"] = "Account Number"; $lang["suppliers_agency_name"] = "Agency Name"; $lang["suppliers_cannot_be_deleted"] = "Could not delete selected Supplier(s). One or more have Sales."; +$lang["suppliers_category"] = "Category"; +$lang["suppliers_cost"] = "Cost Supplier"; $lang["suppliers_company_name"] = "Company Name"; $lang["suppliers_company_name_required"] = "Company Name is a required field."; $lang["suppliers_confirm_delete"] = "Are you sure you want to delete the selected Supplier(s)?"; $lang["suppliers_confirm_restore"] = "Are you sure you want to restore selected Supplier(s)?"; $lang["suppliers_error_adding_updating"] = "Supplier update or add failed."; +$lang["suppliers_goods"] = "Goods Supplier"; $lang["suppliers_new"] = "New Supplier"; $lang["suppliers_none_selected"] = "You have not selected Supplier(s) to delete."; $lang["suppliers_one_or_multiple"] = "Supplier(s)"; diff --git a/application/migrations/20181003120000_upgrade_to_3_3_0.php b/application/migrations/20181007120000_upgrade_to_3_3_0.php similarity index 100% rename from application/migrations/20181003120000_upgrade_to_3_3_0.php rename to application/migrations/20181007120000_upgrade_to_3_3_0.php diff --git a/application/migrations/sqlscripts/3.2.1_to_3.3.0.sql b/application/migrations/sqlscripts/3.2.1_to_3.3.0.sql index 1a1591e16..4f4b01154 100644 --- a/application/migrations/sqlscripts/3.2.1_to_3.3.0.sql +++ b/application/migrations/sqlscripts/3.2.1_to_3.3.0.sql @@ -37,7 +37,6 @@ ALTER TABLE `ospos_receivings_items` CHANGE COLUMN `discount_percent` `discount` DECIMAL(15,2) NOT NULL DEFAULT 0 AFTER `item_unit_price`, ADD COLUMN `discount_type` TINYINT(2) NOT NULL DEFAULT '0' AFTER `discount`; - -- -- Add support for module cashups -- @@ -102,3 +101,13 @@ ALTER TABLE ospos_expenses CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci ALTER TABLE `ospos_cash_up` ADD `closed_amount_due` decimal(15,2) NOT NULL; + +-- +-- Add Suppliers category +-- + +ALTER TABLE `ospos_suppliers` + ADD COLUMN `category` TINYINT NOT NULL; + +UPDATE `ospos_suppliers` + SET `category` = 0; diff --git a/application/models/Supplier.php b/application/models/Supplier.php index 5d9b728fe..05ef4d458 100644 --- a/application/models/Supplier.php +++ b/application/models/Supplier.php @@ -5,7 +5,10 @@ */ class Supplier extends Person -{ +{ + const GOODS_SUPPLIER = 0; + const COST_SUPPLIER = 1; + /* Determines if a given person_id is a customer */ @@ -32,10 +35,11 @@ class Supplier extends Person /* Returns all the suppliers */ - public function get_all($limit_from = 0, $rows = 0) + public function get_all($category = self::GOODS_SUPPLIER, $limit_from = 0, $rows = 0) { $this->db->from('suppliers'); - $this->db->join('people', 'suppliers.person_id = people.person_id'); + $this->db->join('people', 'suppliers.person_id = people.person_id'); + $this->db->where('category', $category); $this->db->where('deleted', 0); $this->db->order_by('company_name', 'asc'); if($rows > 0) @@ -273,5 +277,31 @@ class Supplier extends Person return $this->db->get(); } + + /* + Return supplier categories + */ + public function get_categories() + { + return array( + self::GOODS_SUPPLIER => $this->lang->line('suppliers_goods'), + self::COST_SUPPLIER => $this->lang->line('suppliers_cost') + ); + } + + /* + Return a category name given its id + */ + public function get_category_name($id) + { + if($id == self::GOODS_SUPPLIER) + { + return $this->lang->line('suppliers_goods'); + } + elseif($id == self::COST_SUPPLIER) + { + return $this->lang->line('suppliers_cost'); + } + } } ?> diff --git a/application/views/suppliers/form.php b/application/views/suppliers/form.php index ab610072d..b38697efb 100644 --- a/application/views/suppliers/form.php +++ b/application/views/suppliers/form.php @@ -16,6 +16,13 @@
        +
        + lang->line('suppliers_category'), 'category', array('class'=>'required control-label col-xs-3')); ?> +
        + category, array('class'=>'form-control', 'id'=>'category'));?> +
        +
        +
        lang->line('suppliers_agency_name'), 'agency_name', array('class'=>'control-label col-xs-3')); ?>
        From 44712e7efeac093664db4b13c36733b7da6c58cd Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sun, 7 Oct 2018 16:01:06 +0100 Subject: [PATCH 262/568] Add recent code contributors to LICENSE files --- LICENSE | 2 ++ public/license/LICENSE | 2 ++ 2 files changed, 4 insertions(+) diff --git a/LICENSE b/LICENSE index 382f165e9..e0c8fd7a9 100644 --- a/LICENSE +++ b/LICENSE @@ -20,6 +20,8 @@ Copyright (c) 2017 odiea Copyright (c) 2017 asadjaved63 Copyright (c) 2018 Erasto Marroquin (aka Erastus) Copyright (c) 2018 WebShells/Shady Sh +Copyright (c) 2018 Nathan Sas (aka nathanzky) +Copyright (c) 2018 Emilio Silva (aka emi-silva) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/public/license/LICENSE b/public/license/LICENSE index 382f165e9..e0c8fd7a9 100644 --- a/public/license/LICENSE +++ b/public/license/LICENSE @@ -20,6 +20,8 @@ Copyright (c) 2017 odiea Copyright (c) 2017 asadjaved63 Copyright (c) 2018 Erasto Marroquin (aka Erastus) Copyright (c) 2018 WebShells/Shady Sh +Copyright (c) 2018 Nathan Sas (aka nathanzky) +Copyright (c) 2018 Emilio Silva (aka emi-silva) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in From 6342f5e4b81c2849c13759f0a0a7c281873b146b Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sun, 7 Oct 2018 16:43:41 +0100 Subject: [PATCH 263/568] Fix chartist broken dependency, upgrade composer dependencies --- application/views/partial/header.php | 2 +- bower.json | 12 ++++++------ composer.lock | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/application/views/partial/header.php b/application/views/partial/header.php index f9b66606c..01767b8bd 100644 --- a/application/views/partial/header.php +++ b/application/views/partial/header.php @@ -77,7 +77,7 @@ - + diff --git a/bower.json b/bower.json index be8f24d3e..a8924473a 100644 --- a/bower.json +++ b/bower.json @@ -36,11 +36,11 @@ "bootstrap-table": "~1.12.1", "bootstrap-daterangepicker": "~2.1.27", "tableExport.jquery.plugin": "1.5.1", - "chartist": "~0.9.8", - "chartist-plugin-axistitle": "~0.0.5", - "chartist-plugin-pointlabels": "~0.0.4", - "chartist-plugin-tooltip": "https://github.com/tmmdata/chartist-plugin-tooltip.git#~0.0.18", - "chartist-plugin-barlabels": "https://github.com/mtgibbs/chartist-plugin-barlabels.git#~0.0.5", + "chartist": "0.9.8", + "chartist-plugin-axistitle": "0.0.5", + "chartist-plugin-pointlabels": "0.0.4", + "chartist-plugin-tooltip": "https://github.com/tmmdata/chartist-plugin-tooltip.git#0.0.18", + "chartist-plugin-barlabels": "https://github.com/mtgibbs/chartist-plugin-barlabels.git#0.0.5", "remarkable-bootstrap-notify": "~3.1.3", "js-cookie": "~2.1.4", "bootstrap-tagsinput": "~0.8.0", @@ -70,6 +70,6 @@ } }, "resolutions": { - "chartist": "~0.9.8" + "chartist": "0.9.8" } } diff --git a/composer.lock b/composer.lock index 4c6900a23..19fc31318 100644 --- a/composer.lock +++ b/composer.lock @@ -220,16 +220,16 @@ }, { "name": "tamtamchik/namecase", - "version": "1.0.2", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/tamtamchik/namecase.git", - "reference": "b4facc6022420bd1575d0c1d188c2ef870ef176b" + "reference": "a0d83e8c39141fc27898993c9339cfc4cf4680de" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tamtamchik/namecase/zipball/b4facc6022420bd1575d0c1d188c2ef870ef176b", - "reference": "b4facc6022420bd1575d0c1d188c2ef870ef176b", + "url": "https://api.github.com/repos/tamtamchik/namecase/zipball/a0d83e8c39141fc27898993c9339cfc4cf4680de", + "reference": "a0d83e8c39141fc27898993c9339cfc4cf4680de", "shasum": "" }, "require": { @@ -273,7 +273,7 @@ "strings", "tamtamchik" ], - "time": "2016-02-06 10:46:26" + "time": "2018-09-12 10:40:55" } ], "packages-dev": [ From e8f85ef27fec361185f371edc882181b3c39b3b7 Mon Sep 17 00:00:00 2001 From: Zhivko Vanev Date: Sun, 30 Sep 2018 07:45:28 +0000 Subject: [PATCH 264/568] Translated using Weblate (Bulgarian) Currently translated at 100.0% (51 of 51 strings) --- application/language/bg/customers_lang.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/application/language/bg/customers_lang.php b/application/language/bg/customers_lang.php index 8cc41c294..4d75a4920 100644 --- a/application/language/bg/customers_lang.php +++ b/application/language/bg/customers_lang.php @@ -1,5 +1,4 @@ - Date: Sun, 30 Sep 2018 07:48:42 +0000 Subject: [PATCH 265/568] Translated using Weblate (Bulgarian) Currently translated at 100.0% (162 of 162 strings) --- application/language/bg/sales_lang.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/application/language/bg/sales_lang.php b/application/language/bg/sales_lang.php index a4acda3a2..21c8cc9a8 100644 --- a/application/language/bg/sales_lang.php +++ b/application/language/bg/sales_lang.php @@ -1,5 +1,4 @@ - Date: Sun, 30 Sep 2018 07:53:42 +0000 Subject: [PATCH 266/568] Translated using Weblate (Bulgarian) Currently translated at 100.0% (2 of 2 strings) --- application/language/bg/error_lang.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/application/language/bg/error_lang.php b/application/language/bg/error_lang.php index 7418825f8..bffb3d602 100644 --- a/application/language/bg/error_lang.php +++ b/application/language/bg/error_lang.php @@ -1,4 +1,3 @@ - Date: Sat, 13 Oct 2018 14:10:12 +0200 Subject: [PATCH 267/568] Fix bstables sorting (#2159) --- public/js/manage_tables.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/js/manage_tables.js b/public/js/manage_tables.js index a5c5a8738..a6f5daf0b 100644 --- a/public/js/manage_tables.js +++ b/public/js/manage_tables.js @@ -383,7 +383,7 @@ })(window.form_support = window.form_support || {}, jQuery); function number_sorter(a, b) { - a = +a.replace(/[^\-0-9\.]+/g, ''); - b = +b.replace(/[^\-0-9\.]+/g, ''); + a = +a.replace(/[^\-0-9]+/g, ''); + b = +b.replace(/[^\-0-9]+/g, ''); return a - b; } From f5212575706364042faec4b4f8c736156a2e7df2 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sat, 13 Oct 2018 17:23:28 +0100 Subject: [PATCH 268/568] Fix Items search category issue (#2179) --- application/models/Item.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/Item.php b/application/models/Item.php index ac1df7f73..ca324bdc3 100644 --- a/application/models/Item.php +++ b/application/models/Item.php @@ -191,7 +191,7 @@ class Item extends CI_Model $this->db->or_like('item_number', $search); $this->db->or_like('items.item_id', $search); $this->db->or_like('company_name', $search); - $this->db->or_like('category', $search); + $this->db->or_like('items.category', $search); $this->db->group_end(); } else From df61ee09bb8fef8189ed85b10c94e832e45000c0 Mon Sep 17 00:00:00 2001 From: jekkos Date: Fri, 22 Sep 2017 22:12:58 +0200 Subject: [PATCH 269/568] Add item attributes functionality (#68) --- application/config/autoload.php | 2 +- application/controllers/Attributes.php | 195 +++++++++ application/controllers/Config.php | 12 +- application/controllers/Items.php | 55 +-- application/helpers/tabular_helper.php | 30 ++ .../language/ar-EG/attributes_lang.php | 25 ++ application/language/ar-EG/config_lang.php | 10 - application/language/ar-EG/items_lang.php | 1 - application/language/ar-EG/module_lang.php | 2 + .../language/az-AZ/attributes_lang.php | 25 ++ application/language/az-AZ/config_lang.php | 8 - application/language/az-AZ/items_lang.php | 1 - application/language/az-AZ/module_lang.php | 2 + .../language/de-CH/attributes_lang.php | 25 ++ application/language/de-CH/config_lang.php | 10 - application/language/de-CH/items_lang.php | 1 - application/language/de-CH/module_lang.php | 2 + application/language/de/attributes_lang.php | 25 ++ application/language/de/module_lang.php | 2 + .../language/en-GB/attributes_lang.php | 25 ++ application/language/en-GB/config_lang.php | 10 - application/language/en-GB/items_lang.php | 1 - .../language/en-US/attributes_lang.php | 25 ++ application/language/en-US/config_lang.php | 10 - application/language/en-US/items_lang.php | 1 - application/language/en/attributes_lang.php | 25 ++ application/language/es/attributes_lang.php | 25 ++ application/language/es/config_lang.php | 10 - application/language/es/items_lang.php | 1 - application/language/es/module_lang.php | 2 + application/language/fr/attributes_lang.php | 25 ++ application/language/fr/config_lang.php | 10 - application/language/fr/items_lang.php | 1 - application/language/fr/module_lang.php | 1 + .../language/hr-HR/attributes_lang.php | 25 ++ application/language/hr-HR/config_lang.php | 10 - application/language/hr-HR/items_lang.php | 3 +- application/language/hr-HR/module_lang.php | 2 + .../language/hu-HU/attributes_lang.php | 25 ++ application/language/hu-HU/config_lang.php | 10 - application/language/hu-HU/items_lang.php | 3 +- application/language/hu-HU/module_lang.php | 2 + application/language/id/attributes_lang.php | 25 ++ application/language/id/datepicker_lang.php | 1 + .../language/nl-BE/attributes_lang.php | 25 ++ application/language/nl-BE/items_lang.php | 1 - application/language/nl-BE/module_lang.php | 1 + .../language/pt-BR/attributes_lang.php | 25 ++ application/language/ru/attributes_lang.php | 25 ++ application/language/ru/config_lang.php | 10 - application/language/ru/items_lang.php | 1 - application/language/ru/module_lang.php | 2 + application/language/sv/attributes_lang.php | 25 ++ application/language/sv/config_lang.php | 10 - application/language/sv/items_lang.php | 1 - application/language/sv/module_lang.php | 2 + application/language/th/attributes_lang.php | 25 ++ application/language/th/config_lang.php | 10 - application/language/th/items_lang.php | 3 +- application/language/th/module_lang.php | 2 + application/language/tr/attributes_lang.php | 25 ++ application/language/tr/config_lang.php | 10 - application/language/tr/items_lang.php | 3 +- application/language/tr/module_lang.php | 2 + application/language/zh/attributes_lang.php | 25 ++ application/language/zh/config_lang.php | 10 - application/language/zh/items_lang.php | 3 +- application/language/zh/module_lang.php | 2 + application/libraries/Receiving_lib.php | 7 +- application/libraries/Sale_lib.php | 8 +- .../migrations/20180220100000_attributes.php | 20 + .../migrations/sqlscripts/attributes.sql | 184 ++++++++ application/models/Attribute.php | 408 ++++++++++++++++++ application/models/Item.php | 104 ++--- application/models/Item_kit.php | 14 +- application/models/Receiving.php | 4 +- application/models/Sale.php | 18 +- .../models/reports/Detailed_receivings.php | 6 +- application/views/attributes/form.php | 173 ++++++++ application/views/attributes/item.php | 69 +++ application/views/attributes/manage.php | 37 ++ application/views/configs/general_config.php | 110 ----- application/views/items/form.php | 361 ++++++++-------- application/views/partial/header.php | 6 +- application/views/receivings/receipt.php | 2 +- application/views/receivings/receiving.php | 2 +- application/views/sales/invoice.php | 2 +- application/views/sales/receipt_default.php | 2 +- application/views/sales/receipt_email.php | 2 +- application/views/sales/receipt_short.php | 2 +- application/views/sales/register.php | 2 +- bower.json | 3 + database/3.0_to_attributes.sql | 191 ++++++++ database/3.1.0_to_attributes.sql | 191 ++++++++ database/constraints.sql | 18 +- database/tables.sql | 82 +++- design/ospos_categories.mwb | Bin 29876 -> 30219 bytes design/ospos_categories.mwb.bak | Bin 0 -> 30114 bytes import_items.csv | 4 +- license/.licenses | 28 ++ public/images/menubar/attributes.png | Bin 0 -> 1529 bytes 101 files changed, 2397 insertions(+), 622 deletions(-) create mode 100644 application/controllers/Attributes.php create mode 100644 application/language/ar-EG/attributes_lang.php create mode 100644 application/language/az-AZ/attributes_lang.php create mode 100644 application/language/de-CH/attributes_lang.php create mode 100644 application/language/de/attributes_lang.php create mode 100644 application/language/en-GB/attributes_lang.php create mode 100644 application/language/en-US/attributes_lang.php create mode 100644 application/language/en/attributes_lang.php create mode 100644 application/language/es/attributes_lang.php create mode 100644 application/language/fr/attributes_lang.php create mode 100644 application/language/hr-HR/attributes_lang.php create mode 100644 application/language/hu-HU/attributes_lang.php create mode 100644 application/language/id/attributes_lang.php create mode 100644 application/language/nl-BE/attributes_lang.php create mode 100644 application/language/pt-BR/attributes_lang.php create mode 100644 application/language/ru/attributes_lang.php create mode 100644 application/language/sv/attributes_lang.php create mode 100644 application/language/th/attributes_lang.php create mode 100644 application/language/tr/attributes_lang.php create mode 100644 application/language/zh/attributes_lang.php create mode 100644 application/migrations/20180220100000_attributes.php create mode 100644 application/migrations/sqlscripts/attributes.sql create mode 100644 application/models/Attribute.php create mode 100644 application/views/attributes/form.php create mode 100644 application/views/attributes/item.php create mode 100644 application/views/attributes/manage.php create mode 100644 database/3.0_to_attributes.sql create mode 100644 database/3.1.0_to_attributes.sql create mode 100644 design/ospos_categories.mwb.bak create mode 100644 license/.licenses create mode 100644 public/images/menubar/attributes.png diff --git a/application/config/autoload.php b/application/config/autoload.php index a7b554177..d6a82548b 100644 --- a/application/config/autoload.php +++ b/application/config/autoload.php @@ -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'); diff --git a/application/controllers/Attributes.php b/application/controllers/Attributes.php new file mode 100644 index 000000000..e7557cd55 --- /dev/null +++ b/application/controllers/Attributes.php @@ -0,0 +1,195 @@ +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'))); + } + } + +} \ No newline at end of file diff --git a/application/controllers/Config.php b/application/controllers/Config.php index 6bc838c7e..72855b6a1 100644 --- a/application/controllers/Config.php +++ b/application/controllers/Config.php @@ -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); diff --git a/application/controllers/Items.php b/application/controllers/Items.php index 6a5395fb8..b445eedf7 100644 --- a/application/controllers/Items.php +++ b/application/controllers/Items.php @@ -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=''; diff --git a/application/helpers/tabular_helper.php b/application/helpers/tabular_helper.php index 770037081..041115e5e 100644 --- a/application/helpers/tabular_helper.php +++ b/application/helpers/tabular_helper.php @@ -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", '', + 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 diff --git a/application/language/ar-EG/attributes_lang.php b/application/language/ar-EG/attributes_lang.php new file mode 100644 index 000000000..00229b05e --- /dev/null +++ b/application/language/ar-EG/attributes_lang.php @@ -0,0 +1,25 @@ +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); diff --git a/application/libraries/Sale_lib.php b/application/libraries/Sale_lib.php index 8ecd6fcb3..5db5b995d 100644 --- a/application/libraries/Sale_lib.php +++ b/application/libraries/Sale_lib.php @@ -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'); diff --git a/application/migrations/20180220100000_attributes.php b/application/migrations/20180220100000_attributes.php new file mode 100644 index 000000000..521e7b15d --- /dev/null +++ b/application/migrations/20180220100000_attributes.php @@ -0,0 +1,20 @@ + diff --git a/application/migrations/sqlscripts/attributes.sql b/application/migrations/sqlscripts/attributes.sql new file mode 100644 index 000000000..35e8d6ba1 --- /dev/null +++ b/application/migrations/sqlscripts/attributes.sql @@ -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`; \ No newline at end of file diff --git a/application/models/Attribute.php b/application/models/Attribute.php new file mode 100644 index 000000000..a8975a1a8 --- /dev/null +++ b/application/models/Attribute.php @@ -0,0 +1,408 @@ +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)); + } + + +} \ No newline at end of file diff --git a/application/models/Item.php b/application/models/Item.php index ca324bdc3..e074dd75d 100644 --- a/application/models/Item.php +++ b/application/models/Item.php @@ -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'); diff --git a/application/models/Item_kit.php b/application/models/Item_kit.php index 06c3ed9dc..15e100cb1 100644 --- a/application/models/Item_kit.php +++ b/application/models/Item_kit.php @@ -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(); diff --git a/application/models/Receiving.php b/application/models/Receiving.php index b9c87047a..02f87455c 100644 --- a/application/models/Receiving.php +++ b/application/models/Receiving.php @@ -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); } diff --git a/application/models/Sale.php b/application/models/Sale.php index 6a19f7fba..d23e45860 100644 --- a/application/models/Sale.php +++ b/application/models/Sale.php @@ -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 diff --git a/application/models/reports/Detailed_receivings.php b/application/models/reports/Detailed_receivings.php index 695eb7498..c034e6962 100644 --- a/application/models/reports/Detailed_receivings.php +++ b/application/models/reports/Detailed_receivings.php @@ -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(); } diff --git a/application/views/attributes/form.php b/application/views/attributes/form.php new file mode 100644 index 000000000..14a902089 --- /dev/null +++ b/application/views/attributes/form.php @@ -0,0 +1,173 @@ +
        lang->line('common_fields_required_message'); ?>
        + +
          + +'attribute_form', 'class'=>'form-horizontal')); ?> +
          + +
          + lang->line('attributes_definition_name'), 'definition_name', array('class' => 'control-label col-xs-3')); ?> +
          + 'definition_name', + 'class'=>'form-control input-sm', + 'value'=>$definition_info->definition_name) + );?> +
          +
          + +
          + lang->line('attributes_definition_type'), 'definition_type', array('class'=>'control-label col-xs-3')); ?> +
          + definition_type == CATEGORY; ?> + definition_type, DEFINITION_TYPES), 'id="definition_type" class="form-control" ' . ($disable_definition_type ? 'disabled="disabled"' : ''));?> +
          +
          + +
          + lang->line('attributes_category'), 'definition_parent', array('class' => 'control-label col-xs-3')); ?> +
          + definition_fk, 'id="definition_parent" class="form-control" ' . (empty($definition_parent) ? 'disabled="disabled"' : ''));?> +
          +
          + + + + + + + +
          + + + \ No newline at end of file diff --git a/application/views/attributes/item.php b/application/views/attributes/item.php new file mode 100644 index 000000000..a3dad96e5 --- /dev/null +++ b/application/views/attributes/item.php @@ -0,0 +1,69 @@ + + +
          + 'control-label col-xs-3')); ?> +
          +
          + + $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'"); + } + ?> +
          +
          +
          + + + + diff --git a/application/views/attributes/manage.php b/application/views/attributes/manage.php new file mode 100644 index 000000000..d36f32bda --- /dev/null +++ b/application/views/attributes/manage.php @@ -0,0 +1,37 @@ +load->view("partial/header"); ?> + + + + + +
          + +
          + +
          +
          +
          + +load->view("partial/footer"); ?> diff --git a/application/views/configs/general_config.php b/application/views/configs/general_config.php index 129deabd7..a20fa2759 100644 --- a/application/views/configs/general_config.php +++ b/application/views/configs/general_config.php @@ -235,116 +235,6 @@
          -
          - lang->line('config_custom1'), 'config_custom1', array('class' => 'control-label col-xs-2')); ?> -
          - 'custom1_name', - 'id' => 'custom1_name', - 'class' => 'form-control input-sm', - 'value' => $this->config->item('custom1_name'))); ?> -
          -
          - -
          - lang->line('config_custom2'), 'config_custom2', array('class' => 'control-label col-xs-2')); ?> -
          - 'custom2_name', - 'id' => 'custom2_name', - 'class' => 'form-control input-sm', - 'value' => $this->config->item('custom2_name'))); ?> -
          -
          - -
          - lang->line('config_custom3'), 'config_custom3', array('class' => 'control-label col-xs-2')); ?> -
          - 'custom3_name', - 'id' => 'custom3_name', - 'class' => 'form-control input-sm', - 'value' => $this->config->item('custom3_name'))); ?> -
          -
          - -
          - lang->line('config_custom4'), 'config_custom4', array('class' => 'control-label col-xs-2')); ?> -
          - 'custom4_name', - 'id' => 'custom4_name', - 'class' => 'form-control input-sm', - 'value' => $this->config->item('custom4_name'))); ?> -
          -
          - -
          - lang->line('config_custom5'), 'config_custom5', array('class' => 'control-label col-xs-2')); ?> -
          - 'custom5_name', - 'id' => 'custom5_name', - 'class' => 'form-control input-sm', - 'value' => $this->config->item('custom5_name'))); ?> -
          -
          - -
          - lang->line('config_custom6'), 'config_custom6', array('class' => 'control-label col-xs-2')); ?> -
          - 'custom6_name', - 'id' => 'custom6_name', - 'class' => 'form-control input-sm', - 'value' => $this->config->item('custom6_name'))); ?> -
          -
          - -
          - lang->line('config_custom7'), 'config_custom7', array('class' => 'control-label col-xs-2')); ?> -
          - 'custom7_name', - 'id' => 'custom7_name', - 'class' => 'form-control input-sm', - 'value' => $this->config->item('custom7_name'))); ?> -
          -
          - -
          - lang->line('config_custom8'), 'config_custom8', array('class' => 'control-label col-xs-2')); ?> -
          - 'custom8_name', - 'id' => 'custom8_name', - 'class' => 'form-control input-sm', - 'value' => $this->config->item('custom8_name'))); ?> -
          -
          - -
          - lang->line('config_custom9'), 'config_custom9', array('class' => 'control-label col-xs-2')); ?> -
          - 'custom9_name', - 'id' => 'custom9_name', - 'class' => 'form-control input-sm', - 'value' => $this->config->item('custom9_name'))); ?> -
          -
          - -
          - lang->line('config_custom10'), 'config_custom10', array('class' => 'control-label col-xs-2')); ?> -
          - 'custom10_name', - 'id' => 'custom10_name', - 'class' => 'form-control input-sm', - 'value' => $this->config->item('custom10_name'))); ?> -
          -
          -
          lang->line('config_backup_database'), 'config_backup_database', array('class' => 'control-label col-xs-2')); ?>
          diff --git a/application/views/items/form.php b/application/views/items/form.php index 66303fb80..eaa360773 100644 --- a/application/views/items/form.php +++ b/application/views/items/form.php @@ -46,6 +46,10 @@
          +
          + load->view('attributes/item', array('item_id' => $item_info->item_id)); ?> +
          +
          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 @@
          - - config->item('custom'.$i.'_name') != NULL) - { - $item_arr = (array)$item_info; - ?> -
          - config->item('custom'.$i.'_name'), 'custom'.$i, array('class'=>'control-label col-xs-3')); ?> -
          - 'custom'.$i, - 'id'=>'custom'.$i, - 'class'=>'form-control input-sm', - 'value'=>$item_arr['custom'.$i]) - );?> -
          -
          - + diff --git a/application/views/partial/header.php b/application/views/partial/header.php index 01767b8bd..b7533f8fb 100644 --- a/application/views/partial/header.php +++ b/application/views/partial/header.php @@ -77,7 +77,7 @@ - + @@ -120,7 +120,7 @@ - + @@ -141,4 +141,4 @@
          - + diff --git a/application/views/receivings/receipt.php b/application/views/receivings/receipt.php index f28296538..6a87be2e6 100644 --- a/application/views/receivings/receipt.php +++ b/application/views/receivings/receipt.php @@ -78,7 +78,7 @@ { ?> - +    x diff --git a/application/views/receivings/receiving.php b/application/views/receivings/receiving.php index 516c472e3..9aa96cd6f 100644 --- a/application/views/receivings/receiving.php +++ b/application/views/receivings/receiving.php @@ -136,7 +136,7 @@ if (isset($success)) ');?> -
          +
          diff --git a/application/views/sales/invoice.php b/application/views/sales/invoice.php index 85ac25149..10c966700 100755 --- a/application/views/sales/invoice.php +++ b/application/views/sales/invoice.php @@ -129,7 +129,7 @@ $(document).ready(function() ?> - + diff --git a/application/views/sales/receipt_default.php b/application/views/sales/receipt_default.php index 4197e4985..9dca474ef 100644 --- a/application/views/sales/receipt_default.php +++ b/application/views/sales/receipt_default.php @@ -69,7 +69,7 @@ { ?> - + config->item('receipt_show_total_discount') ? 'total' : 'discounted_total')]); ?> diff --git a/application/views/sales/receipt_email.php b/application/views/sales/receipt_email.php index a3391193d..b1e1f67e0 100644 --- a/application/views/sales/receipt_email.php +++ b/application/views/sales/receipt_email.php @@ -64,7 +64,7 @@ { ?> - + config->item('receipt_show_total_discount') ? 'total' : 'discounted_total')]); ?> diff --git a/application/views/sales/receipt_short.php b/application/views/sales/receipt_short.php index 199bc894c..488ec532b 100644 --- a/application/views/sales/receipt_short.php +++ b/application/views/sales/receipt_short.php @@ -66,7 +66,7 @@ { ?> - + config->item('receipt_show_total_discount') ? 'total' : 'discounted_total')]); ?> diff --git a/application/views/sales/register.php b/application/views/sales/register.php index 7fde2d58c..760e1199f 100644 --- a/application/views/sales/register.php +++ b/application/views/sales/register.php @@ -156,7 +156,7 @@ if(isset($success)) ?> - +

          diff --git a/bower.json b/bower.json index a8924473a..e6ab56739 100644 --- a/bower.json +++ b/bower.json @@ -46,6 +46,9 @@ "bootstrap-tagsinput": "~0.8.0", "bootstrap-toggle": "^2.2.2" }, + "resolutions": { + "jquery": "~1.12.4" + }, "overrides": { "jquery-ui": { "main": [ diff --git a/database/3.0_to_attributes.sql b/database/3.0_to_attributes.sql new file mode 100644 index 000000000..1af1970ff --- /dev/null +++ b/database/3.0_to_attributes.sql @@ -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`; \ No newline at end of file diff --git a/database/3.1.0_to_attributes.sql b/database/3.1.0_to_attributes.sql new file mode 100644 index 000000000..95e4dfbdb --- /dev/null +++ b/database/3.1.0_to_attributes.sql @@ -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`; diff --git a/database/constraints.sql b/database/constraints.sql index a293fc690..65d7f51fe 100644 --- a/database/constraints.sql +++ b/database/constraints.sql @@ -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`); diff --git a/database/tables.sql b/database/tables.sql index 6a63bfbbc..32d304fb0 100644 --- a/database/tables.sql +++ b/database/tables.sql @@ -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` +-- + -- -------------------------------------------------------- -- diff --git a/design/ospos_categories.mwb b/design/ospos_categories.mwb index d13a13b715160cf6363bdd34b1192e4c388f40d7..755f934310d504f17f5a12b239488136a6231a2f 100644 GIT binary patch literal 30219 zcmb5VWmH?;yY7u^fZ*;ePH`#jQrz9$-Q8VU+}+)w6e(If5S-$LqQzbMhUfq6v(MP) zoDc69$y_sQS#g4xW9Mvq~~uBi5JM#*w|z4`l`8E+I|wnCMs@b`9A zfWz=_LC4>VrOf^71%vdYFFM>s51WQ5I~WZ+I<2{lHbUcPzfYVRHa9n4ch_rzrkWcl zbEJ$6dkTi_pMBRd11$RjpU4{wUv7v=SypOpmMpjbHqr&X*nYN}pbO$COW7Gb!_b`m zz=P=X!jSOymaoXr9-i9=`@a5Wgfr_Yk|wp6vi&z9o=aXdQBrv^3)ACQZN=By)%)$N zbV3@@M!vuv4uY9KbJ2-2+)FJUM2e?i8GA9n1mo*{+WOzqo003)%g0Hw83)dp7L^Cm z31^1_93!2AQ(gm{-$Ya8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Dt^kg%UB!BTL_*XCu!R4WHPCl?o@D)?@8YRTUMCHCl zMFDEG>GFD5ds7zsqT@Rx$V7ku65Kx;y=lI25TI}Tne}B6tFU?97i>@2TPsE_jyB?9 z&|qcEKv@!QVdLGPU!G)Kd}Y;yW=qY=!~eNr?hl7G(qmC4jO~JPI9|GYC*+IBTT+6@ zpjwfumG@`Ds=^Uj;c9loB4Tb?;IkcVWjNoq6a;)@f_9IYP9pGu1$D-ilaZ9ZG~ANs zMU5x%6b_aD`c+v}W=iV^QFM)l9EspYC8AOuO|+XZ1U3Q1^(Ksy>x85c$XbvY!YNPVC{4_w^TU zo!dOM)hgyJ9Spfl?h5pP=cts#su)eL{_k{Vsyyc;b&VLCOw3{xi)KjYbU?i|eQ&kj z%fWFYzGoBgm_iqeW#S@0cD3~M=`6$pBr3uE*D(eeXC^@PO|XvCbL?vN{p=I;J$pRo zP8-4tk9gj8GvUQ|4J|2@0QH*^ykig+B$Up7Gs;T3y0#*|b0#W-eeWVXaq}&TF0$}_ z9y$Kp<0vW?7HhT8e7(e40b!ZDm4ll{f<9icWDQ($_sJgPBCZkf| zF!s(Hb4l*Sbxf)a&I_uJNwbu`Z}5kiee9eDb>*#jJAonMRj(g#BZo!DI%Z^>F89rt z?)&#yV?Z}q?D@%&Hk|9+bPt1k>pa}bu(zb5^E zdi?hj{y#kc&>sI~`m4yl`MY?)z(fCK(7M$X21Xc0(OX?rffDHGVrydVU}{CF=xAnc sM``S0YGv(VPRYT_j$;4!3X7|$mASpKs{p0Fx0wkurK78pqbth)02dcjaR2}S diff --git a/design/ospos_categories.mwb.bak b/design/ospos_categories.mwb.bak new file mode 100644 index 0000000000000000000000000000000000000000..50d274a08293cef2d748011b13089a228bfa57df GIT binary patch literal 30114 zcmb5V1yEewv-UfRLX>fS19P4Bg5kSccf)4zU}k}MoNJ^%nf1}Mk`NO!_I*z`F90A>vs0PN>oQwI|l zJ2QJ{7CSd%7I!<_;|@KyCEmJguPz~Rjd5`y3n4mkT<_m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LHPV(KSlL9qep5u402b=S06gv`BA$q*h7bV+ zJmzhta&(l+gZT;DOm# zWj6bd0Mb#GO-f9-T!M8W>lO)`2hUejfltmPXj51hTq8ku=|oA`N8?er{Y@4UnKSUM zy%y|z-+*4brz9QNG@LI2SVdKm^EV#M{sSHbKjSr3HDTQ7pp6;ll}vDA(*~r!7>-K3 zhTkcY0>k7^0Lz(@DoZ}TKO^*=1SvVy1E&Zmsw#S;ydO{$m<-!!0@%W)a1q`QC<+P; zEF>`vFD45Jt`B{hZ1rEstjvN5PUk3hWW^3=+oXooOK;c+cF|H=+6B5UfKB zj$Z$zf`HP1fQO8AO;k;dOcybGp^Y+;;?ElQQHTVE)K;Cm+esz_GW!S*mQ-*U0&1>V9 zibLb`y-etLK{yL;4hhJ5{q@1CqtFwu&u3#+<5~0XzHEk`fZzFST;SRkfBWMeysrNl zTJUHa+Q=hZ1SF$T_^GlJN)pf}v<+?K5uNA9(}n@VIo4Dh}PxJVLYfgg+lb-yH_Awi7}GQlHuB%tB9 zmjMZ{YJ18FKpm36qco5JDQ9iapc}VR$_YRnlE9}!FF-`-*Ycwe%vic|s;Gl{?mkfiHh0@yK660edu2UjA#IsIDX1cxW!jt3>#fuePu-uH|y+$+q(gc%jZpGbVn!;9#4y+L35Ln&>;q+k#3>xdGSN~#pUl+LM)OS<0G^VF3&!_9F|V8 zO_R%bSUN|%-*DR!b6Yavlrigf>nvbFTeEK9JrQ6dA%96o;Cf+#`<)@tiBdo^vfBHK zfOFA+3RYN-g(=@xc)<%1z(}aDx=;>-*IB*`?P+{?aZ=)|vpF``4&v3>lB~_#4=+#u f-(R2qTYv!o1#esRC)FG(00000NkvXXu0mjfWNXE? literal 0 HcmV?d00001 From 500a8d7a8fbdd6cbc8123d745c16afe8f07fea6d Mon Sep 17 00:00:00 2001 From: jekkos Date: Thu, 31 May 2018 19:38:18 +0200 Subject: [PATCH 270/568] Work in progress, still testing items form (#68) --- .travis.yml | 3 - application/controllers/Attributes.php | 31 +-- application/controllers/Items.php | 27 ++- application/helpers/tabular_helper.php | 4 +- .../language/ar-EG/attributes_lang.php | 2 +- .../language/az-AZ/attributes_lang.php | 2 +- .../language/de-CH/attributes_lang.php | 2 +- application/language/de/attributes_lang.php | 2 +- .../language/en-GB/attributes_lang.php | 2 +- .../language/en-US/attributes_lang.php | 4 +- application/language/en/attributes_lang.php | 2 +- application/language/es/attributes_lang.php | 2 +- application/language/fr/attributes_lang.php | 2 +- .../language/hr-HR/attributes_lang.php | 2 +- .../language/hu-HU/attributes_lang.php | 2 +- application/language/id/attributes_lang.php | 2 +- .../language/nl-BE/attributes_lang.php | 2 +- .../language/pt-BR/attributes_lang.php | 2 +- application/language/ru/attributes_lang.php | 2 +- application/language/sv/attributes_lang.php | 2 +- application/language/th/attributes_lang.php | 2 +- application/language/tr/attributes_lang.php | 2 +- application/language/zh/attributes_lang.php | 2 +- application/models/Attribute.php | 82 ++++---- application/models/Item.php | 2 +- application/models/Item_kit.php | 4 +- application/models/Receiving.php | 2 +- application/models/Sale.php | 12 +- .../models/reports/Detailed_receivings.php | 4 +- application/views/attributes/form.php | 9 +- application/views/attributes/item.php | 151 ++++++++------ application/views/items/form.php | 46 +---- application/views/partial/header.php | 2 +- database/3.0_to_attributes.sql | 191 ------------------ database/3.1.0_to_attributes.sql | 191 ------------------ database/tables.sql | 1 + 36 files changed, 192 insertions(+), 610 deletions(-) delete mode 100644 database/3.0_to_attributes.sql delete mode 100644 database/3.1.0_to_attributes.sql diff --git a/.travis.yml b/.travis.yml index d4fe152bd..8eb3f1d8b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,9 +25,6 @@ env: after_success: '[ -n ${DOCKER_USERNAME} ] && docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" && docker tag opensourcepos_php "jekkos/opensourcepos:$TAG" && docker push "jekkos/opensourcepos:$TAG"' deploy: - edge: - source: travis-ci/dpl - branch: master file: deployment.json provider: bintray skip_cleanup: true diff --git a/application/controllers/Attributes.php b/application/controllers/Attributes.php index e7557cd55..6eff28f28 100644 --- a/application/controllers/Attributes.php +++ b/application/controllers/Attributes.php @@ -42,37 +42,16 @@ class Attributes extends Secure_Controller 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')); + $success = $this->Attribute->save_value(urldecode($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')); + $success = $this->Attribute->delete_value($attribute_value, $this->input->post('definition_id')); echo json_encode(array('success' => $success)); } @@ -90,7 +69,7 @@ class Attributes extends Secure_Controller '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_fk' => $this->input->post('definition_group') != '' ? $this->input->post('definition_group') : NULL ); $definition_name = $this->xss_clean($definition_data['definition_name']); @@ -162,8 +141,8 @@ class Attributes extends Secure_Controller $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_group'] = $this->Attribute->get_definitions_by_type(GROUP, $definition_id); + $data['definition_group'][''] = $this->lang->line('common_none_selected_text'); $data['definition_info'] = $info; $data['definition_flags'] = $this->_get_attributes(); diff --git a/application/controllers/Items.php b/application/controllers/Items.php index b445eedf7..4ba260807 100644 --- a/application/controllers/Items.php +++ b/application/controllers/Items.php @@ -192,11 +192,9 @@ class Items extends Secure_Controller $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; + $definition_names = array(-1 => $this->lang->line('common_none_selected_text')); + + $data['definition_names'] = $definition_names + $this->Attribute->get_definition_names(); $item_info = $this->Item->get_info($item_id); foreach(get_object_vars($item_info) as $property => $value) @@ -386,10 +384,18 @@ class Items extends Secure_Controller $this->load->view('barcodes/barcode_sheet', $data); } - public function attributes($item_id, $definition_id) + public function attributes($item_id) { $data['item_id'] = $item_id; - $data['definition_values'] = $this->Attribute->get_values_by_parent($definition_id); + $definition_ids = json_decode($this->input->post('definition_ids'), TRUE); + $data['definition_values'] = $this->Attribute->get_attributes_by_item($item_id) + $this->Attribute->get_values_by_definitions($definition_ids); + $data['definition_names'] = $this->Attribute->get_definition_names(); + + foreach($data['definition_values'] as $definition_value) + { + unset($data['definition_names'][$definition_value['definition_id']]); + } + $this->load->view('attributes/item', $data); } @@ -536,6 +542,13 @@ class Items extends Secure_Controller } } + // Save item attributes + $definition_values = json_decode($this->input->post('definition_values'), TRUE); + $this->Attribute->delete_link($item_id); + foreach ($definition_values as $definition_id => $attribute_id) { + $success &= $this->Attribute->save_link($item_id, $definition_id, $attribute_id); + } + if($success && $upload_success) { $message = $this->xss_clean($this->lang->line('items_successful_' . ($new_item ? 'adding' : 'updating')) . ' ' . $item_data['name']); diff --git a/application/helpers/tabular_helper.php b/application/helpers/tabular_helper.php index 041115e5e..c6a5f69fe 100644 --- a/application/helpers/tabular_helper.php +++ b/application/helpers/tabular_helper.php @@ -532,7 +532,7 @@ function get_attribute_definition_manage_table_headers() 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')), + array('definition_group' => $CI->lang->line('attributes_definition_group')), ); return transform_headers($headers); @@ -547,7 +547,7 @@ function get_attribute_definition_data_row($attribute) 'definition_id' => $attribute->definition_id, 'definition_name' => $attribute->definition_name, 'definition_type' => $attribute->definition_type, - 'category' => $attribute->parent_name, + 'definition_group' => $attribute->definition_group, '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", '', array('class'=>'modal-dlg', 'data-btn-submit' => $CI->lang->line('common_submit'), 'title'=>$CI->lang->line($controller_name.'_update')) diff --git a/application/language/ar-EG/attributes_lang.php b/application/language/ar-EG/attributes_lang.php index 00229b05e..9008114b6 100644 --- a/application/language/ar-EG/attributes_lang.php +++ b/application/language/ar-EG/attributes_lang.php @@ -1,6 +1,6 @@ db->select('parent_definition.definition_name AS parent_name, definition.*'); + $this->db->select('definition_group.definition_name AS definition_group, 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->join('attribute_definitions AS definition_group', 'definition_group.definition_id = definition.definition_fk', 'left'); $this->db->group_start(); $this->db->like('definition.definition_name', $search); @@ -115,20 +115,23 @@ class Attribute extends CI_Model return $this->db->get()->result_array(); } - public function get_values_by_parent($definition_fk) + public function get_values_by_definitions($definition_ids) { - $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); + if (count($definition_ids) > 0) { + $this->db->from('attribute_definitions'); - return $this->db->get()->result_array(); + $this->db->group_start(); + $this->db->where_in('definition_fk', array_keys($definition_ids)); + $this->db->or_where_in('definition_id', array_keys($definition_ids)); + $this->db->where('definition_type !=', GROUP); + $this->db->group_end(); + + $this->db->where('deleted', 0); + + return $this->db->get()->result_array(); + } + + return array(); } public function get_definitions_by_type($attribute_type, $definition_id = -1) @@ -153,6 +156,19 @@ class Attribute extends CI_Model return $attribute_definitions; } + public function get_definition_names() + { + $this->db->from('attribute_definitions'); + $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 = []; @@ -257,37 +273,7 @@ class Attribute extends CI_Model 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) + public function get_link_value($item_id, $definition_id) { $this->db->where('item_id', $item_id); $this->db->where('definition_id', $definition_id); @@ -302,7 +288,7 @@ class Attribute extends CI_Model $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); + $this->db->where('definition_type <>', GROUP); if (!empty($id)) { $this->db->where($sale_receiving_fk, $id); diff --git a/application/models/Item.php b/application/models/Item.php index e074dd75d..b0ebb854f 100644 --- a/application/models/Item.php +++ b/application/models/Item.php @@ -370,7 +370,7 @@ class Item extends CI_Model 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\' + ON attribute_definitions.definition_id = attribute_links.definition_id AND definition_type = \'GROUP\' WHERE sale_id IS NULL AND receiving_id IS NULL )' ); diff --git a/application/models/Item_kit.php b/application/models/Item_kit.php index 15e100cb1..e2d4b9ac7 100644 --- a/application/models/Item_kit.php +++ b/application/models/Item_kit.php @@ -62,7 +62,7 @@ class Item_kit extends CI_Model kit_discount_type, price_option, print_option, - definition_name, + category, supplier_id, item_number, cost_price, @@ -78,8 +78,6 @@ class Item_kit extends CI_Model $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(); diff --git a/application/models/Receiving.php b/application/models/Receiving.php index 02f87455c..29958d52f 100644 --- a/application/models/Receiving.php +++ b/application/models/Receiving.php @@ -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) + public function save($items, $supplier_id, $employee_id, $comment, $reference, $payment_type, $receiving_id = FALSE) { if(count($items) == 0) { diff --git a/application/models/Sale.php b/application/models/Sale.php index d23e45860..fd44d2891 100644 --- a/application/models/Sale.php +++ b/application/models/Sale.php @@ -937,7 +937,8 @@ class Sale extends CI_Model item_location, print_option, ' . $this->Item->get_item_name('name') . ', - definition_name, + category, + definition_name, item_type, stock_type'); $this->db->from('sales_items AS sales_items'); @@ -946,7 +947,7 @@ class Sale extends CI_Model $this->db->join('attribute_definitions', 'attribute_definitions.definition_id = attribute_links.definition_id', 'left'); $this->db->where('sales_items.sale_id', $sale_id); - // Entry sequenate (this will render kits in the expected sequence) + // Entry sequence (this will render kits in the expected sequence) if($this->config->item('line_sequence') == '0') { $this->db->order_by('line', 'asc'); @@ -962,7 +963,7 @@ class Sale extends CI_Model // Group by Item Category elseif($this->config->item('line_sequence') == '2') { - $this->db->order_by('definition_name', 'asc'); + $this->db->order_by('category', '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'); @@ -1193,7 +1194,8 @@ 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(definition_name) AS category, + MAX(items.category) AS category, + MAX(definition_name) AS definition_name, 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, @@ -1221,7 +1223,7 @@ class Sale extends CI_Model 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\' + ON attribute_definitions.definition_id = attribute_links.definition_id AND definition_type = \'GROUP\' 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 diff --git a/application/models/reports/Detailed_receivings.php b/application/models/reports/Detailed_receivings.php index c034e6962..da25d0283 100644 --- a/application/models/reports/Detailed_receivings.php +++ b/application/models/reports/Detailed_receivings.php @@ -97,11 +97,11 @@ 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, definition_name, quantity_purchased, serialnumber, total, discount_percent, 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->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->join('attribute_definitions', 'attribute_definitions.definition_id = attribute_links.definition_id AND definition_type = \'GROUP\'', 'left'); $this->db->where('receivings_items_temp.receiving_id', $value['receiving_id']); $data['details'][$key] = $this->db->get()->result_array(); } diff --git a/application/views/attributes/form.php b/application/views/attributes/form.php index 14a902089..cef04002e 100644 --- a/application/views/attributes/form.php +++ b/application/views/attributes/form.php @@ -19,15 +19,14 @@

          lang->line('attributes_definition_type'), 'definition_type', array('class'=>'control-label col-xs-3')); ?>
          - definition_type == CATEGORY; ?> - definition_type, DEFINITION_TYPES), 'id="definition_type" class="form-control" ' . ($disable_definition_type ? 'disabled="disabled"' : ''));?> + definition_type, DEFINITION_TYPES), 'id="definition_type" class="form-control" ');?>
          - lang->line('attributes_category'), 'definition_parent', array('class' => 'control-label col-xs-3')); ?> + lang->line('attributes_definition_group'), 'definition_group', array('class' => 'control-label col-xs-3')); ?>
          - definition_fk, 'id="definition_parent" class="form-control" ' . (empty($definition_parent) ? 'disabled="disabled"' : ''));?> + definition_fk, 'id="definition_group" class="form-control" ' . (empty($definition_group) ? 'disabled="disabled"' : ''));?>
          @@ -170,4 +169,4 @@ } }, form_support.error)); }); - \ No newline at end of file + diff --git a/application/views/attributes/item.php b/application/views/attributes/item.php index a3dad96e5..ec158c2e2 100644 --- a/application/views/attributes/item.php +++ b/application/views/attributes/item.php @@ -1,69 +1,98 @@ + ?> -
          - 'control-label col-xs-3')); ?> -
          -
          - - $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'"); - } - ?> -
          -
          -
          +
          + 'control-label col-xs-3')); ?> +
          +
          + + - (function() { - $('input[name=""]').autocomplete({ - source: '', - appendTo: '.modal-content', - select: function (a, ui) { - $(this).data('attribute_id', ui.item.value); - $(this).val(ui.item.label); - }, - delay:10 - }); + 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'"); + } + ?> +
          +
          +
          - $("input[name*='definition'][type='text']").change(function() { - $.post('' + $(this).val(), { - item_id: , - definition_id: , - attribute_id: $(this).data('attribute-id') - }); - }); - })(); - - - + + +
          + lang->line("attributes_definition_name"), "definition_name_label", array('class' => 'control-label col-xs-3')); ?> +
          + 'definition_name', 'class' => 'form-control')); ?> +
          + +
          + + + + diff --git a/application/views/items/form.php b/application/views/items/form.php index eaa360773..673f52876 100644 --- a/application/views/items/form.php +++ b/application/views/items/form.php @@ -423,47 +423,7 @@ focus: fill_value }); - $("#category").autocomplete({source: "",delay:10,appendTo: '.modal-content'}); - - 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('' + item_id, {definition_id : definition_attr_id, attribute_id : $(this).val()}); - } - else if (definition_id && definition_id != -1) - { - $.post('' + item_id, {definition_id : definition_id}); - } - }; - - var delete_link = function() - { - $.get('' + item_id); - }; - - save_link.call(this); - - $("#attributes").load('/' + [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); + $("#category").autocomplete({source: "", delay:10, appendTo: '.modal-content'}); $("a.fileinput-exists").click(function() { $.ajax({ @@ -510,13 +470,13 @@ { url: "", type: 'POST', - data: { + data: { "item_id" : "item_id; ?>", "item_number" : function() { return $("#item_number").val(); }, - }) + } } }, cost_price: diff --git a/application/views/partial/header.php b/application/views/partial/header.php index b7533f8fb..e4a776263 100644 --- a/application/views/partial/header.php +++ b/application/views/partial/header.php @@ -77,7 +77,7 @@ - + diff --git a/database/3.0_to_attributes.sql b/database/3.0_to_attributes.sql deleted file mode 100644 index 1af1970ff..000000000 --- a/database/3.0_to_attributes.sql +++ /dev/null @@ -1,191 +0,0 @@ - -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`; \ No newline at end of file diff --git a/database/3.1.0_to_attributes.sql b/database/3.1.0_to_attributes.sql deleted file mode 100644 index 95e4dfbdb..000000000 --- a/database/3.1.0_to_attributes.sql +++ /dev/null @@ -1,191 +0,0 @@ - -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`; diff --git a/database/tables.sql b/database/tables.sql index 32d304fb0..6e6e83f69 100644 --- a/database/tables.sql +++ b/database/tables.sql @@ -229,6 +229,7 @@ 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, From a8d73d5f994ca7091e7340b6cdab9ccaa5499f3b Mon Sep 17 00:00:00 2001 From: jekkos Date: Thu, 16 Aug 2018 03:21:35 +0200 Subject: [PATCH 271/568] Add attributes to items (#68) --- application/controllers/Attributes.php | 2 +- application/controllers/Items.php | 23 ++++-- application/helpers/locale_helper.php | 11 ++- application/models/Attribute.php | 44 ++++++------ application/views/attributes/form.php | 5 +- application/views/attributes/item.php | 95 ++++++++++++------------- application/views/partial/header_js.php | 5 +- 7 files changed, 100 insertions(+), 85 deletions(-) diff --git a/application/controllers/Attributes.php b/application/controllers/Attributes.php index 6eff28f28..209209517 100644 --- a/application/controllers/Attributes.php +++ b/application/controllers/Attributes.php @@ -46,7 +46,7 @@ class Attributes extends Secure_Controller { $success = $this->Attribute->save_value(urldecode($attribute_value), $this->input->post('definition_id'), $this->input->post('item_id'), $this->input->post('attribute_id')); - echo json_encode(array('success' => $success)); + echo json_encode(array('success' => $success != 0)); } public function delete_attribute_value($attribute_value) diff --git a/application/controllers/Items.php b/application/controllers/Items.php index 4ba260807..0701da955 100644 --- a/application/controllers/Items.php +++ b/application/controllers/Items.php @@ -192,9 +192,12 @@ class Items extends Secure_Controller $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); - $definition_names = array(-1 => $this->lang->line('common_none_selected_text')); + $data['definition_names'] = $this->Attribute->get_definition_names(); - $data['definition_names'] = $definition_names + $this->Attribute->get_definition_names(); + foreach($data['definition_values'] as $definition_id => $definition) + { + unset($data['definition_names'][$definition_id]); + } $item_info = $this->Item->get_info($item_id); foreach(get_object_vars($item_info) as $property => $value) @@ -391,9 +394,9 @@ class Items extends Secure_Controller $data['definition_values'] = $this->Attribute->get_attributes_by_item($item_id) + $this->Attribute->get_values_by_definitions($definition_ids); $data['definition_names'] = $this->Attribute->get_definition_names(); - foreach($data['definition_values'] as $definition_value) + foreach($data['definition_values'] as $definition_id => $attribute_value) { - unset($data['definition_names'][$definition_value['definition_id']]); + unset($data['definition_names'][$definition_id]); } $this->load->view('attributes/item', $data); @@ -543,10 +546,16 @@ class Items extends Secure_Controller } // Save item attributes - $definition_values = json_decode($this->input->post('definition_values'), TRUE); + $attribute_links = $this->input->post('attribute_links'); + $attribute_ids = $this->input->post('attribute_ids'); $this->Attribute->delete_link($item_id); - foreach ($definition_values as $definition_id => $attribute_id) { - $success &= $this->Attribute->save_link($item_id, $definition_id, $attribute_id); + foreach ($attribute_links as $definition_id => $attribute_id) { + $definition_type = $this->Attribute->get_info($definition_id)->definition_type; + if ($definition_type != DROPDOWN) + { + $attribute_id = $this->Attribute->save_value($attribute_id, $definition_id, $item_id, $attribute_ids[$definition_id]); + } + $this->Attribute->save_link($item_id, $definition_id, $attribute_id); } if($success && $upload_success) diff --git a/application/helpers/locale_helper.php b/application/helpers/locale_helper.php index 856cae56c..dc0b837b1 100644 --- a/application/helpers/locale_helper.php +++ b/application/helpers/locale_helper.php @@ -1,5 +1,8 @@ config->item('language_code'); + $language_code = get_instance()->config->item('language_code'); + return empty($language_code) ? DEFAULT_LANGUAGE_CODE : $language_code; } function current_language($load_system_language = FALSE) @@ -36,7 +40,8 @@ function current_language($load_system_language = FALSE) } } - return get_instance()->config->item('language'); + $language = get_instance()->config->item('language'); + return empty($language) ? DEFAULT_LANGUAGE : $language; } function get_languages() @@ -207,6 +212,7 @@ function get_timeformats() ); } + /* Gets the payment options */ @@ -217,6 +223,7 @@ function get_payment_options() $payments = array(); + if($config->item('payment_options_order') == 'debitcreditcash') { $payments[$lang->line('sales_debit')] = $lang->line('sales_debit'); diff --git a/application/models/Attribute.php b/application/models/Attribute.php index fe919e327..ae54443d3 100644 --- a/application/models/Attribute.php +++ b/application/models/Attribute.php @@ -112,7 +112,9 @@ class Attribute extends CI_Model $this->db->where('item_id', $item_id); $this->db->where('deleted', 0); - return $this->db->get()->result_array(); + $results = $this->db->get()->result_array(); + + return $this->_to_array($results, 'definition_id'); } public function get_values_by_definitions($definition_ids) @@ -128,7 +130,9 @@ class Attribute extends CI_Model $this->db->where('deleted', 0); - return $this->db->get()->result_array(); + $results = $this->db->get()->result_array(); + + return $this->_to_array($results, 'definition_id'); } return array(); @@ -148,12 +152,7 @@ class Attribute extends CI_Model $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; + return $this->_to_array($results, 'definition_id', 'definition_name'); } public function get_definition_names() @@ -161,12 +160,8 @@ class Attribute extends CI_Model $this->db->from('attribute_definitions'); $results = $this->db->get()->result_array(); - $attribute_definitions = array(); - foreach($results as $result) - { - $attribute_definitions[$result['definition_id']] = $result['definition_name']; - } - return $attribute_definitions; + $definition_name = array(-1 => $this->lang->line('common_none_selected_text')); + return $definition_name + $this->_to_array($results, 'definition_id', 'definition_name'); } public function get_definition_values($definition_id) @@ -182,16 +177,18 @@ class Attribute extends CI_Model $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 $this->_to_array($results, 'attribute_id', 'attribute_value'); } return $attribute_values; } + private function _to_array($results, $key, $value = '') + { + return array_column(array_map(function($result) use ($key, $value) { + return [$result[$key], empty($value) ? $result : $result[$value]]; + }, $results), 1, 0); + } + /* Gets total of rows */ @@ -328,7 +325,7 @@ class Attribute extends CI_Model { $suggestions = array(); $this->db->distinct(); - $this->db->select('attribute_value'); + $this->db->select('attribute_value, attribute_values.attribute_id'); $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'); @@ -339,7 +336,7 @@ class Attribute extends CI_Model foreach($this->db->get()->result() as $row) { $row_array = (array) $row; - $suggestions[] = array('label' => $row_array['attribute_value']); + $suggestions[] = array('value' => $row_array['attribute_id'], 'label' => $row_array['attribute_value']); } return $suggestions; @@ -358,6 +355,7 @@ class Attribute extends CI_Model 'attribute_id' => empty($attribute_id) ? NULL : $attribute_id, 'item_id' => empty($item_id) ? NULL : $item_id, 'definition_id' => $definition_id)); + } else { @@ -367,7 +365,7 @@ class Attribute extends CI_Model $this->db->trans_complete(); - return $this->db->trans_status(); + return $attribute_id; } public function delete_value($attribute_value, $definition_id) diff --git a/application/views/attributes/form.php b/application/views/attributes/form.php index cef04002e..50b6e7cf5 100644 --- a/application/views/attributes/form.php +++ b/application/views/attributes/form.php @@ -44,8 +44,8 @@
          'definition_value', 'class'=>'form-control input-sm', 'id' => 'definition_value'));?> - - + +
          @@ -147,6 +147,7 @@ { $(form).ajaxSubmit({ beforeSerialize: function($form, options) { + is_new && $('').attr({ id: 'definition_values', type: 'hidden', diff --git a/application/views/attributes/item.php b/application/views/attributes/item.php index ec158c2e2..454526a0a 100644 --- a/application/views/attributes/item.php +++ b/application/views/attributes/item.php @@ -1,5 +1,15 @@ + +
          + lang->line("attributes_definition_name"), "definition_name_label", array('class' => 'control-label col-xs-3')); ?> +
          + 'definition_name', 'class' => 'form-control')); ?> +
          + +
          + $definition_value) { ?> @@ -7,33 +17,34 @@ foreach($definition_values as $definition_value) 'control-label col-xs-3')); ?>
          - + Attribute->get_attribute_value($item_id, $definition_id); + $attribute_id = (empty($attribute_value) || empty($attribute_value->attribute_id)) ? NULL : $attribute_value->attribute_id; + echo form_hidden("attribute_ids[$definition_id]", $attribute_id); if ($definition_value['definition_type'] == DATE) { echo form_input(array( - 'name' => 'definition_name[]', + 'name' => 'attribute_links[$definition_id]', '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'], + 'data-definition-id' => $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'"); + echo form_dropdown("attribute_links[$definition_id]", $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'"); + echo form_input("attribute_links[$definition_id]", $value, "class='form-control' data-definition-id='$definition_id'"); } ?> +
          @@ -42,56 +53,44 @@ foreach($definition_values as $definition_value) } ?> - -
          - lang->line("attributes_definition_name"), "definition_name_label", array('class' => 'control-label col-xs-3')); ?> -
          - 'definition_name', 'class' => 'form-control')); ?> -
          - -
          - diff --git a/application/views/partial/header_js.php b/application/views/partial/header_js.php index e3c8d5c9b..09a27a2b8 100644 --- a/application/views/partial/header_js.php +++ b/application/views/partial/header_js.php @@ -16,8 +16,10 @@ from: "config->item('notify_vertical_position'); ?>" }}); + var cookie_name = "config->item('csrf_cookie_name'); ?>"; + var csrf_token = function() { - return Cookies.get("config->item('csrf_cookie_name'); ?>"); + return Cookies.get(cookie_name); }; var csrf_form_base = function() { @@ -32,7 +34,6 @@ $.ajax = function() { var args = arguments[0]; - if (args['type'] && args['type'].toLowerCase() == 'post' && csrf_token()) { if (typeof args['data'] === 'string') { From 1e0063e574ee2ffb974a4b7eb2f4827409061982 Mon Sep 17 00:00:00 2001 From: jekkos Date: Thu, 16 Aug 2018 03:31:45 +0200 Subject: [PATCH 272/568] Fix attribute table refresh (#68) --- application/models/Attribute.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/Attribute.php b/application/models/Attribute.php index ae54443d3..cb9fcd821 100644 --- a/application/models/Attribute.php +++ b/application/models/Attribute.php @@ -55,7 +55,7 @@ class Attribute extends CI_Model */ public function get_info($definition_id) { - $this->db->select('parent_definition.definition_name AS parent_name, definition.*'); + $this->db->select('parent_definition.definition_name AS definition_group, 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); From 98022f3b96d4bb5ad4c5ad3ab0c919cd949a7a56 Mon Sep 17 00:00:00 2001 From: jekkos Date: Thu, 16 Aug 2018 03:45:41 +0200 Subject: [PATCH 273/568] Cleanup + enable item attribute delete (#68) --- application/models/Item.php | 18 ------------------ application/views/attributes/form.php | 4 ++-- application/views/attributes/item.php | 5 ++++- 3 files changed, 6 insertions(+), 21 deletions(-) diff --git a/application/models/Item.php b/application/models/Item.php index b0ebb854f..a86e24831 100644 --- a/application/models/Item.php +++ b/application/models/Item.php @@ -361,28 +361,11 @@ 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 = \'GROUP\' - 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'); @@ -390,7 +373,6 @@ class Item extends CI_Model $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); diff --git a/application/views/attributes/form.php b/application/views/attributes/form.php index 50b6e7cf5..c14f7f63f 100644 --- a/application/views/attributes/form.php +++ b/application/views/attributes/form.php @@ -44,7 +44,7 @@
          'definition_value', 'class'=>'form-control input-sm', 'id' => 'definition_value'));?> - +
          @@ -128,7 +128,7 @@ $("#definition_value").val(""); }; - $("#definition_value_add").click(add_attribute_value); + $("#add_attribute_value").click(add_attribute_value); $("#definition_value").keypress(function (e) { if (e.which == 13) { diff --git a/application/views/attributes/item.php b/application/views/attributes/item.php index 454526a0a..c5b2a3e38 100644 --- a/application/views/attributes/item.php +++ b/application/views/attributes/item.php @@ -44,7 +44,7 @@ foreach($definition_values as $definition_id => $definition_value) echo form_input("attribute_links[$definition_id]", $value, "class='form-control' data-definition-id='$definition_id'"); } ?> - +
          @@ -55,6 +55,9 @@ foreach($definition_values as $definition_id => $definition_value) + diff --git a/application/views/receivings/form.php b/application/views/receivings/form.php index 6c10ab591..46bbf4b02 100755 --- a/application/views/receivings/form.php +++ b/application/views/receivings/form.php @@ -51,34 +51,8 @@ $(document).ready(function() { load->view('partial/datepicker_locale'); ?> - - $('#datetime').datetimepicker( - { - format: "config->item("dateformat")) . ' ' . dateformat_bootstrap($this->config->item("timeformat"));?>", - startDate: "config->item('dateformat') . ' ' . $this->config->item('timeformat'), mktime(0, 0, 0, 1, 1, 2010));?>", - config->item('timeformat'); - $m = $t[strlen($t)-1]; - if( strpos($this->config->item('timeformat'), 'a') !== false || strpos($this->config->item('timeformat'), 'A') !== false ) - { - ?> - showMeridian: true, - - showMeridian: false, - - minuteStep: 1, - autoclose: true, - todayBtn: true, - todayHighlight: true, - bootcssVer: 3, - language: "" - }); + + $('#datetime').datetimepicker(pickerconfig); var fill_value = function(event, ui) { event.preventDefault(); diff --git a/application/views/sales/form.php b/application/views/sales/form.php index b882a4e30..eca343ab6 100755 --- a/application/views/sales/form.php +++ b/application/views/sales/form.php @@ -12,7 +12,7 @@
          lang->line('sales_date'), 'date', array('class'=>'control-label col-xs-3')); ?>
          - 'date','value'=>date($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), strtotime($sale_info['sale_time'])), 'id'=>'datetime', 'class'=>'form-control input-sm'));?> + 'date','value'=>to_datetime(strtotime($sale_info['sale_time'])), 'id'=>'datetime', 'class'=>'form-control input-sm'));?>
          @@ -110,32 +110,7 @@ $(document).ready(function() load->view('partial/datepicker_locale'); ?> - $('#datetime').datetimepicker({ - format: "config->item('dateformat')) . ' ' . dateformat_bootstrap($this->config->item('timeformat'));?>", - startDate: "config->item('dateformat') . ' ' . $this->config->item('timeformat'), mktime(0, 0, 0, 1, 1, 2010));?>", - config->item('timeformat'); - $m = $t[strlen($t)-1]; - if( strpos($this->config->item('timeformat'), 'a') !== false || strpos($this->config->item('timeformat'), 'A') !== false ) - { - ?> - showMeridian: true, - - showMeridian: false, - - minuteStep: 1, - autoclose: true, - todayBtn: true, - todayHighlight: true, - bootcssVer: 3, - language: "" - }); + $('#datetime').datetimepicker(pickerconfig); var fill_value = function(event, ui) { event.preventDefault(); diff --git a/database/tables.sql b/database/tables.sql index 6e6e83f69..ae75574c3 100644 --- a/database/tables.sql +++ b/database/tables.sql @@ -832,6 +832,7 @@ CREATE TABLE IF NOT EXISTS `ospos_attribute_definitions` ( CREATE TABLE IF NOT EXISTS `ospos_attribute_values` ( `attribute_id` INT NOT NULL AUTO_INCREMENT, `attribute_value` VARCHAR(45) NULL, + `attribute_datetime` DATETIME NULL, PRIMARY KEY (`attribute_id`) ) ENGINE = InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; diff --git a/import_items.csv b/import_items.csv index 8e083f017..ffe1b84a5 100644 --- a/import_items.csv +++ b/import_items.csv @@ -1,2 +1,3 @@ -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 +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,item_image,location_id,quantity +33333334,Apple iMac,Computers,,800,1200,Tax 1,8,Tax 2,10,1,Best Computer ever,y,,item.jpg,1,100 +ma \ No newline at end of file diff --git a/public/js/manage_tables.js b/public/js/manage_tables.js index a6f5daf0b..f7bfcafb8 100644 --- a/public/js/manage_tables.js +++ b/public/js/manage_tables.js @@ -142,16 +142,17 @@ }); }; - var do_delete = function (url, ids) { - if (confirm($.fn.bootstrapTable.defaults.formatConfirmDelete())) { - $.post((url || options.resource) + '/delete', {'ids[]': ids || selected_ids()}, function (response) { - //delete was successful, remove checkbox rows - if (response.success) { - var selector = ids ? row_selector(ids) : selected_rows(); - table().collapseAllRows(); - $(selector).each(function (index, element) { - $(this).find("td").animate({backgroundColor: "green"}, 1200, "linear") - .end().animate({opacity: 0}, 1200, "linear", function () { + var do_action = function(action) { + return function (url, ids) { + if (confirm($.fn.bootstrapTable.defaults.formatConfirmDelete())) { + $.post((url || options.resource) + '/' + action, {'ids[]': ids || selected_ids()}, function (response) { + //delete was successful, remove checkbox rows + if (response.success) { + var selector = ids ? row_selector(ids) : selected_rows(); + table().collapseAllRows(); + $(selector).each(function (index, element) { + $(this).find("td").animate({backgroundColor: "green"}, 1200, "linear") + .end().animate({opacity: 0}, 1200, "linear", function () { table().remove({ field: options.uniqueId, values: selected_ids() @@ -161,46 +162,17 @@ enable_actions(); } }); - }); - $.notify(response.message, { type: 'success' }); - } else { - $.notify(response.message, { type: 'danger' }); - } - }, "json"); - } else { - return false; - } - }; - - var do_restore = function (url, ids) { - if (confirm($.fn.bootstrapTable.defaults.formatConfirmRestore())) { - $.post((url || options.resource) + '/restore', {'ids[]': ids || selected_ids()}, function (response) { - //restore was successful, remove checkbox rows - if (response.success) { - var selector = ids ? row_selector(ids) : selected_rows(); - table().collapseAllRows(); - $(selector).each(function (index, element) { - $(this).find("td").animate({backgroundColor: "green"}, 1200, "linear") - .end().animate({opacity: 0}, 1200, "linear", function () { - table().remove({ - field: options.uniqueId, - values: selected_ids() - }); - if (index == $(selector).length - 1) { - refresh(); - enable_actions(); - } }); - }); - $.notify(response.message, { type: 'success' }); - } else { - $.notify(response.message, { type: 'danger' }); - } - }, "json"); - } else { - return false; - } - }; + $.notify(response.message, {type: 'success'}); + } else { + $.notify(response.message, {type: 'danger'}); + } + }, "json"); + } else { + return false; + } + }; + }; var load_success = function(callback) { return function(response) { @@ -279,15 +251,11 @@ }; var init_delete = function (confirmMessage) { - $("#delete").click(function (event) { - do_delete(); - }); + $("#delete").click(do_action("delete")); }; var init_restore = function (confirmMessage) { - $("#restore").click(function (event) { - do_restore(); - }); + $("#restore").click(do_action("restore")); }; var refresh = function() { @@ -335,8 +303,8 @@ }, handle_submit: handle_submit, init: init, - do_delete: do_delete, - do_restore: do_restore, + do_delete: do_action("delete"), + do_restore: do_action("restore"), refresh : refresh, selected_ids : selected_ids, }); From 8b212a8dd0bca7c15ea2135b6631dc707f7e8f46 Mon Sep 17 00:00:00 2001 From: jekkos Date: Fri, 17 Aug 2018 01:27:46 +0200 Subject: [PATCH 275/568] Fix some final bugs (#68) --- application/controllers/Attributes.php | 8 +------- application/models/Attribute.php | 1 + application/views/attributes/form.php | 2 +- application/views/attributes/item.php | 8 ++++---- 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/application/controllers/Attributes.php b/application/controllers/Attributes.php index ac07bb637..44f078e77 100644 --- a/application/controllers/Attributes.php +++ b/application/controllers/Attributes.php @@ -68,16 +68,10 @@ class Attributes extends Secure_Controller $definition_data = array( 'definition_name' => $this->input->post('definition_name'), 'definition_flags' => $definition_flags, + 'definition_type' => DEFINITION_TYPES[$this->input->post('definition_type')], 'definition_fk' => $this->input->post('definition_group') != '' ? $this->input->post('definition_group') : NULL ); - $definition_type = empty($this->input->post('definition_type')) ? NULL : $this->input->post('definition_type'); - - if ($definition_type) - { - $definition_data['definition_type'] = DEFINITION_TYPES[$definition_type]; - } - $definition_name = $this->xss_clean($definition_data['definition_name']); if($this->Attribute->save_definition($definition_data, $definition_id)) diff --git a/application/models/Attribute.php b/application/models/Attribute.php index c773a655f..21fe25cc4 100644 --- a/application/models/Attribute.php +++ b/application/models/Attribute.php @@ -160,6 +160,7 @@ class Attribute extends CI_Model public function get_definition_names() { $this->db->from('attribute_definitions'); + $this->db->where('deleted', 0); $results = $this->db->get()->result_array(); $definition_name = array(-1 => $this->lang->line('common_none_selected_text')); diff --git a/application/views/attributes/form.php b/application/views/attributes/form.php index e1d4539b5..db7b0b68d 100644 --- a/application/views/attributes/form.php +++ b/application/views/attributes/form.php @@ -147,7 +147,7 @@ { $(form).ajaxSubmit({ beforeSerialize: function($form, options) { - + $("select[disabled='disabled'").removeAttr("disabled"); is_new && $('').attr({ id: 'definition_values', type: 'hidden', diff --git a/application/views/attributes/item.php b/application/views/attributes/item.php index 2d9e71f63..e9b98519a 100644 --- a/application/views/attributes/item.php +++ b/application/views/attributes/item.php @@ -45,7 +45,7 @@ foreach($definition_values as $definition_id => $definition_value) echo form_input("attribute_links[$definition_id]", $value, "class='form-control' data-definition-id='$definition_id'"); } ?> - + @@ -58,11 +58,11 @@ foreach($definition_values as $definition_id => $definition_value) (function() { load->view('partial/datepicker_locale'); ?> - $(".datetime").datetimepicker(pickerconfig); + $(".datetime").datetimepicker(pickerconfig()); var enable_delete = function() { - $("#remove_attribute_link").click(function() { - var parents = $(this).parents(".form-group").remove(); + $(".remove_attribute_btn").click(function() { + $(this).parents(".form-group").remove(); }); }; From 085d24447c20391e5208b4b9d9e28d3f76f8c932 Mon Sep 17 00:00:00 2001 From: jekkos Date: Fri, 17 Aug 2018 02:18:38 +0200 Subject: [PATCH 276/568] Disablel SHOW_IN_ITEMS (#68) --- application/helpers/tabular_helper.php | 15 ++++++++++++++- application/models/Attribute.php | 2 +- application/models/Item.php | 1 + application/views/attributes/form.php | 6 ++++-- application/views/partial/header.php | 2 +- application/views/sales/register.php | 2 +- import_items.csv | 1 - 7 files changed, 22 insertions(+), 7 deletions(-) diff --git a/application/helpers/tabular_helper.php b/application/helpers/tabular_helper.php index c6a5f69fe..a89a449d9 100644 --- a/application/helpers/tabular_helper.php +++ b/application/helpers/tabular_helper.php @@ -543,12 +543,25 @@ function get_attribute_definition_data_row($attribute) $CI =& get_instance(); $controller_name=strtolower(get_class($CI)); + if (count($attribute->definition_flags) == 0) + { + $definition_flags = $CI->lang->line('common_none_selected_text'); + } + else if ($attribute->definition_type == GROUP) + { + $definition_flags = "-"; + } + else + { + $definition_flags = implode(', ', $attribute->definition_flags); + } + return array ( 'definition_id' => $attribute->definition_id, 'definition_name' => $attribute->definition_name, 'definition_type' => $attribute->definition_type, 'definition_group' => $attribute->definition_group, - 'definition_flags' => count($attribute->definition_flags) == 0 ? $CI->lang->line('common_none_selected_text') : implode(', ', $attribute->definition_flags), + 'definition_flags' => $definition_flags, 'edit' => anchor("$controller_name/view/$attribute->definition_id", '', array('class'=>'modal-dlg', 'data-btn-submit' => $CI->lang->line('common_submit'), 'title'=>$CI->lang->line($controller_name.'_update')) )); diff --git a/application/models/Attribute.php b/application/models/Attribute.php index 21fe25cc4..8d997062c 100644 --- a/application/models/Attribute.php +++ b/application/models/Attribute.php @@ -9,7 +9,7 @@ const DEFINITION_TYPES = [GROUP, DROPDOWN, TEXT, DATETIME]; class Attribute extends CI_Model { - const SHOW_IN_ITEMS = 1; + //const SHOW_IN_ITEMS = 1; const SHOW_IN_SALES = 2; const SHOW_IN_RECEIVINGS = 4; diff --git a/application/models/Item.php b/application/models/Item.php index a86e24831..f0126ec9d 100644 --- a/application/models/Item.php +++ b/application/models/Item.php @@ -187,6 +187,7 @@ class Item extends CI_Model } else { + $this->db->join('attribute_links', 'attribute_links.item_id = items.item_id'); $this->db->join('attribute_values', 'attribute_links.attribute_id = attribute_values.attribute_id'); $this->db->like('attribute_value', $search); } diff --git a/application/views/attributes/form.php b/application/views/attributes/form.php index db7b0b68d..b9dbe0860 100644 --- a/application/views/attributes/form.php +++ b/application/views/attributes/form.php @@ -73,8 +73,10 @@ 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"); + var is_dropdown = $("#definition_type").val() !== "1"; + var is_no_group = $("#definition_type").val() !== "0"; + $("#definition_value, #definition_list_group").parents(".form-group").toggleClass("hidden", is_dropdown); + $("#definition_flags").parents(".form-group").toggleClass("hidden", !is_no_group); }; $('#definition_type').change(show_hide_fields); diff --git a/application/views/partial/header.php b/application/views/partial/header.php index 42a77dc4f..7264c94e3 100644 --- a/application/views/partial/header.php +++ b/application/views/partial/header.php @@ -77,7 +77,7 @@ - + diff --git a/application/views/sales/register.php b/application/views/sales/register.php index 760e1199f..2dbc9e032 100644 --- a/application/views/sales/register.php +++ b/application/views/sales/register.php @@ -156,7 +156,7 @@ if(isset($success)) ?> -
          +
          diff --git a/import_items.csv b/import_items.csv index ffe1b84a5..a0bac1be0 100644 --- a/import_items.csv +++ b/import_items.csv @@ -1,3 +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,item_image,location_id,quantity 33333334,Apple iMac,Computers,,800,1200,Tax 1,8,Tax 2,10,1,Best Computer ever,y,,item.jpg,1,100 -ma \ No newline at end of file From 3be57ffb66e4aea7b5d723bf35de0c72863e529b Mon Sep 17 00:00:00 2001 From: jekkos Date: Sat, 18 Aug 2018 00:08:26 +0200 Subject: [PATCH 277/568] Fix config screen (#68) --- application/controllers/Config.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/controllers/Config.php b/application/controllers/Config.php index 72855b6a1..30543ce8c 100644 --- a/application/controllers/Config.php +++ b/application/controllers/Config.php @@ -299,8 +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 - 'multi_pack_enabled' => $this->input->post('multi_pack_enabled') != NULL, + 'derive_sale_quantity' => $this->input->post('derive_sale_quantity') != NULL, + 'multi_pack_enabled' => $this->input->post('multi_pack_enabled') != NULL ); $this->Module->set_show_office_group($this->input->post('show_office_group') != NULL); From a0727a8ea53af52cc1359b84261dd36b4b9795bd Mon Sep 17 00:00:00 2001 From: jekkos Date: Sat, 18 Aug 2018 00:23:20 +0200 Subject: [PATCH 278/568] Fix bug in sales receipt (#68) --- application/models/Sale.php | 7 ------- 1 file changed, 7 deletions(-) diff --git a/application/models/Sale.php b/application/models/Sale.php index fd44d2891..95f320094 100644 --- a/application/models/Sale.php +++ b/application/models/Sale.php @@ -938,13 +938,10 @@ class Sale extends CI_Model 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) @@ -1220,10 +1217,6 @@ 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 = \'GROUP\' 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 From 744854726c7c16fd3d1fe3c37e7eef3a0431112f Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sat, 18 Aug 2018 16:50:11 +0100 Subject: [PATCH 279/568] Update module_lang.php --- application/language/fr/module_lang.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/language/fr/module_lang.php b/application/language/fr/module_lang.php index 338b33e4a..85e522798 100644 --- a/application/language/fr/module_lang.php +++ b/application/language/fr/module_lang.php @@ -1,7 +1,8 @@ Date: Sat, 18 Aug 2018 16:51:03 +0100 Subject: [PATCH 280/568] Update module_lang.php --- application/language/nl-BE/module_lang.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/language/nl-BE/module_lang.php b/application/language/nl-BE/module_lang.php index f719015a0..7804eed6a 100755 --- a/application/language/nl-BE/module_lang.php +++ b/application/language/nl-BE/module_lang.php @@ -1,7 +1,8 @@ Date: Sat, 18 Aug 2018 16:52:22 +0100 Subject: [PATCH 281/568] Update Item_kit.php --- application/models/Item_kit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/Item_kit.php b/application/models/Item_kit.php index e2d4b9ac7..c0e76212f 100644 --- a/application/models/Item_kit.php +++ b/application/models/Item_kit.php @@ -62,7 +62,7 @@ class Item_kit extends CI_Model kit_discount_type, price_option, print_option, - category, + category, supplier_id, item_number, cost_price, From 3c876d7f6f880fe5fa35721ed61cc296e54042c0 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sat, 18 Aug 2018 17:06:59 +0100 Subject: [PATCH 282/568] Update Items.php --- application/controllers/Items.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/application/controllers/Items.php b/application/controllers/Items.php index c8afb50c5..5eab7920a 100644 --- a/application/controllers/Items.php +++ b/application/controllers/Items.php @@ -503,7 +503,7 @@ class Items extends Secure_Controller $tax_names = $this->input->post('tax_names'); $tax_percents = $this->input->post('tax_percents'); $count = count($tax_percents); - for ($k = 0; $k < $count; ++$k) + for($k = 0; $k < $count; ++$k) { $tax_percentage = parse_decimals($tax_percents[$k]); if(is_numeric($tax_percentage)) @@ -546,12 +546,13 @@ class Items extends Secure_Controller } // Save item attributes - $attribute_links = $this->input->post('attribute_links') != null ? $this->input->post('attribute_links') : array(); + $attribute_links = $this->input->post('attribute_links') != NULL ? $this->input->post('attribute_links') : array(); $attribute_ids = $this->input->post('attribute_ids'); $this->Attribute->delete_link($item_id); - foreach ($attribute_links as $definition_id => $attribute_id) { + foreach($attribute_links as $definition_id => $attribute_id) + { $definition_type = $this->Attribute->get_info($definition_id)->definition_type; - if ($definition_type != DROPDOWN) + if($definition_type != DROPDOWN) { $attribute_id = $this->Attribute->save_value($attribute_id, $definition_id, $item_id, $attribute_ids[$definition_id], $definition_type); } @@ -690,7 +691,7 @@ class Items extends Secure_Controller $tax_percents = $this->input->post('tax_percents'); $tax_updated = FALSE; $count = count($tax_percents); - for ($k = 0; $k < $count; ++$k) + for($k = 0; $k < $count; ++$k) { if(!empty($tax_names[$k]) && is_numeric($tax_percents[$k])) { From 27122a8578b183922cef4cb4fae10e1a562cab3a Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sat, 18 Aug 2018 17:19:18 +0100 Subject: [PATCH 283/568] Update form.php --- application/views/items/form.php | 281 ++++++++++++++++--------------- 1 file changed, 143 insertions(+), 138 deletions(-) diff --git a/application/views/items/form.php b/application/views/items/form.php index 673f52876..50fa4e648 100644 --- a/application/views/items/form.php +++ b/application/views/items/form.php @@ -395,16 +395,16 @@ From 75097e948557f45e0251536befad9db2e6fdeb63 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sat, 18 Aug 2018 18:21:52 +0100 Subject: [PATCH 284/568] Update Item.php --- application/models/Item.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/Item.php b/application/models/Item.php index f0126ec9d..d0042f643 100644 --- a/application/models/Item.php +++ b/application/models/Item.php @@ -377,7 +377,7 @@ class Item extends CI_Model $this->db->where('location_id', $location_id); $this->db->where_in('items.item_id', $item_ids); - return $this->db->get(); + return $this->db->get(); } /* From 042c81a6b4edc66e8aa05684653d3722b03ef30c Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sat, 18 Aug 2018 18:27:36 +0100 Subject: [PATCH 285/568] Update form.php --- application/views/attributes/form.php | 187 +++++++++++++------------- 1 file changed, 93 insertions(+), 94 deletions(-) diff --git a/application/views/attributes/form.php b/application/views/attributes/form.php index b9dbe0860..5532d25d2 100644 --- a/application/views/attributes/form.php +++ b/application/views/attributes/form.php @@ -62,114 +62,113 @@ From be3d0fe8e1f4dcf98961ce7e37c872349fc2d3f7 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sat, 18 Aug 2018 18:35:07 +0100 Subject: [PATCH 286/568] Update item.php --- application/views/attributes/item.php | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/application/views/attributes/item.php b/application/views/attributes/item.php index e9b98519a..59c5743ef 100644 --- a/application/views/attributes/item.php +++ b/application/views/attributes/item.php @@ -8,10 +8,9 @@ $definition_value) { - ?> +?>
          'control-label col-xs-3')); ?> @@ -50,7 +49,7 @@ foreach($definition_values as $definition_id => $definition_value)
          - @@ -58,11 +57,11 @@ foreach($definition_values as $definition_id => $definition_value) (function() { load->view('partial/datepicker_locale'); ?> - $(".datetime").datetimepicker(pickerconfig()); + $('.datetime').datetimepicker(pickerconfig()); var enable_delete = function() { - $(".remove_attribute_btn").click(function() { - $(this).parents(".form-group").remove(); + $('.remove_attribute_btn').click(function() { + $(this).parents('.form-group').remove(); }); }; @@ -70,7 +69,7 @@ foreach($definition_values as $definition_id => $definition_value) $("input[name*='attribute_links']").change(function() { var definition_id = $(this).data('definition-id'); - $("input[name='attribute_ids[" + definition_id + "]").val(""); + $("input[name='attribute_ids[" + definition_id + "]']").val(''); }).autocomplete({ source: function(request, response) { $.get('' + this.element.data('definition-id') + '?term=' + request.term, function(data) { @@ -82,7 +81,7 @@ foreach($definition_values as $definition_id => $definition_value) event.preventDefault(); $(this).val(ui.item.label); }, - delay:10 + delay: 10 }); var definition_values = function() { @@ -94,16 +93,13 @@ foreach($definition_values as $definition_id => $definition_value) return result; } - $("#definition_name").change(function() { + $('#definition_name').change(function() { var attribute_values = definition_values(); var definition_id = $("option:selected", this).val(); - attribute_values[definition_id] = ""; - $("#attributes").load('', { + attribute_values[definition_id] = ''; + $('#attributes').load('', { 'definition_ids': JSON.stringify(attribute_values) }, enable_delete); }); - })(); - - From 6bbf927d8115585a57c7e5ed19283f9a00cbc905 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sun, 19 Aug 2018 09:54:59 +0100 Subject: [PATCH 287/568] Update Attribute.php --- application/models/Attribute.php | 44 +++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/application/models/Attribute.php b/application/models/Attribute.php index 8d997062c..796e075d1 100644 --- a/application/models/Attribute.php +++ b/application/models/Attribute.php @@ -1,4 +1,4 @@ -getConstants()); } @@ -36,7 +41,7 @@ class Attribute extends CI_Model $this->db->where('sale_id'); $this->db->where('receiving_id'); $this->db->from('attribute_links'); - if (empty($definition_id)) + if(empty($definition_id)) { $this->db->where('definition_id <>'); $this->db->where('attribute_id'); @@ -47,7 +52,8 @@ class Attribute extends CI_Model } $this->db->where('item_id', $item_id); - return $this->db->get()->num_rows() > 0; + + return ($this->db->get()->num_rows() > 0); } /* @@ -121,7 +127,8 @@ class Attribute extends CI_Model public function get_values_by_definitions($definition_ids) { - if (count($definition_ids) > 0) { + if (count($definition_ids) > 0) + { $this->db->from('attribute_definitions'); $this->db->group_start(); @@ -146,7 +153,7 @@ class Attribute extends CI_Model $this->db->where('definition_type', $attribute_type); $this->db->where('deleted', 0); - if ($definition_id != -1) + if($definition_id != -1) { $this->db->where('definition_id != ', $definition_id); } @@ -164,6 +171,7 @@ class Attribute extends CI_Model $results = $this->db->get()->result_array(); $definition_name = array(-1 => $this->lang->line('common_none_selected_text')); + return $definition_name + $this->_to_array($results, 'definition_id', 'definition_name'); } @@ -171,7 +179,7 @@ class Attribute extends CI_Model { $attribute_values = []; - if ($definition_id > -1) + if($definition_id > -1) { $this->db->from('attribute_links'); $this->db->join('attribute_values', 'attribute_values.attribute_id = attribute_links.attribute_id'); @@ -182,6 +190,7 @@ class Attribute extends CI_Model return $this->_to_array($results, 'attribute_id', 'attribute_value'); } + return $attribute_values; } @@ -243,13 +252,15 @@ class Attribute extends CI_Model $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)) + + if($this->link_exists($item_id, $definition_id)) { $this->db->where('definition_id', $definition_id); $this->db->where('item_id', $item_id); @@ -263,6 +274,7 @@ class Attribute extends CI_Model } $this->db->trans_complete(); + return $this->db->trans_status(); } @@ -270,6 +282,7 @@ class Attribute extends CI_Model { $this->db->where('sale_id'); $this->db->where('receiving_id'); + return $this->db->delete('attribute_links', array('item_id' => $item_id)); } @@ -279,6 +292,7 @@ class Attribute extends CI_Model $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(); } @@ -289,7 +303,7 @@ class Attribute extends CI_Model $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 <>', GROUP); - if (!empty($id)) + if(!empty($id)) { $this->db->where($sale_receiving_fk, $id); } @@ -300,6 +314,7 @@ class Attribute extends CI_Model } $this->db->where('item_id', (int) $item_id); $this->db->where('definition_flags & ', $definition_flags); + return $this->db->get()->row_object(); } @@ -311,6 +326,7 @@ class Attribute extends CI_Model $this->db->where('sale_id'); $this->db->where('receiving_id'); $this->db->where('item_id', (int) $item_id); + return $this->db->get()->row_object(); } @@ -349,12 +365,13 @@ class Attribute extends CI_Model { $this->db->trans_start(); - if (empty($attribute_id) || empty($item_id)) + if(empty($attribute_id) || empty($item_id)) { - if ($definition_type != DATETIME) + if($definition_type != DATETIME) { $this->db->insert('attribute_values', array('attribute_value' => $attribute_value)); - } else + } + else { $this->db->insert('attribute_values', array('attribute_datetime' => date('Y-m-d H:i:s', strtotime($attribute_value)))); } @@ -364,7 +381,6 @@ class Attribute extends CI_Model 'attribute_id' => empty($attribute_id) ? NULL : $attribute_id, 'item_id' => empty($item_id) ? NULL : $item_id, 'definition_id' => $definition_id)); - } else { @@ -396,6 +412,4 @@ class Attribute extends CI_Model return $this->db->update('attribute_definitions', array('deleted' => 1)); } - - -} \ No newline at end of file +} From f86eaa78a25c9fe38058b1f256af82bd22f7f87f Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sun, 19 Aug 2018 09:59:19 +0100 Subject: [PATCH 288/568] Update form.php --- application/views/attributes/form.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/attributes/form.php b/application/views/attributes/form.php index 5532d25d2..f2e5a9d1c 100644 --- a/application/views/attributes/form.php +++ b/application/views/attributes/form.php @@ -148,7 +148,7 @@ $(document).ready(function() { $(form).ajaxSubmit({ beforeSerialize: function($form, options) { - $("select[disabled='disabled'").removeAttr('disabled'); + $("select[disabled='disabled']").removeAttr('disabled'); is_new && $('').attr({ id: 'definition_values', type: 'hidden', From b2da8f5e9d1011b24bf000347b4854e9cd5fc1dc Mon Sep 17 00:00:00 2001 From: jekkos Date: Mon, 27 Aug 2018 22:37:10 +0200 Subject: [PATCH 289/568] Fix attribute delete (#68) --- application/controllers/Expenses.php | 2 +- application/views/attributes/item.php | 2 -- application/views/expenses/form.php | 8 +++----- application/views/partial/bootstrap_tables_locale.php | 7 ++++--- application/views/partial/datepicker_locale.php | 4 +++- application/views/sales/form.php | 4 +--- public/js/manage_tables.js | 8 ++++++-- 7 files changed, 18 insertions(+), 17 deletions(-) diff --git a/application/controllers/Expenses.php b/application/controllers/Expenses.php index f900649ac..6fc3f5d55 100644 --- a/application/controllers/Expenses.php +++ b/application/controllers/Expenses.php @@ -80,7 +80,7 @@ class Expenses extends Secure_Controller $data['expenses_info'] = $this->Expense->get_info($expense_id); - $data['expense_categories'] = array(); + $expense_categories = array(); foreach($this->Expense_category->get_all(0, 0, TRUE)->result_array() as $row) { $expense_categories[$row['expense_category_id']] = $row['category_name']; diff --git a/application/views/attributes/item.php b/application/views/attributes/item.php index 59c5743ef..7b8e90484 100644 --- a/application/views/attributes/item.php +++ b/application/views/attributes/item.php @@ -57,8 +57,6 @@ foreach($definition_values as $definition_id => $definition_value) (function() { load->view('partial/datepicker_locale'); ?> - $('.datetime').datetimepicker(pickerconfig()); - var enable_delete = function() { $('.remove_attribute_btn').click(function() { $(this).parents('.form-group').remove(); diff --git a/application/views/expenses/form.php b/application/views/expenses/form.php index 3d0b4f229..1a6ed1df0 100644 --- a/application/views/expenses/form.php +++ b/application/views/expenses/form.php @@ -16,9 +16,9 @@ 'date', - 'id'=>'datetime', - 'class'=>'form-control input-sm datepicker', - 'value'=>date($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), strtotime($expenses_info->date))) + 'class'=>'form-control input-sm datetime', + 'value'=>to_datetime(strtotime($expenses_info->date)), + 'readonly'=>'readonly') );?> @@ -148,8 +148,6 @@ $(document).ready(function() { load->view('partial/datepicker_locale'); ?> - $('#datetime').datetimepicker(pickerconfig) - var amount_validator = function(field) { return { url: "", diff --git a/application/views/partial/bootstrap_tables_locale.php b/application/views/partial/bootstrap_tables_locale.php index 612c2bd7e..c9f4c9908 100644 --- a/application/views/partial/bootstrap_tables_locale.php +++ b/application/views/partial/bootstrap_tables_locale.php @@ -33,11 +33,12 @@ formatAllRows: function () { return "lang->line('tables_all'); ?>"; }, - formatConfirmDelete : function() { - return "lang->line((isset($editable) ? $editable : $controller_name). "_confirm_delete")?>"; + formatConfirmDelete: function(action) { + + return "lang->line((isset($editable) ? $editable : $controller_name). "_confirm_delete")?>" + action; }, formatConfirmRestore : function() { - return "lang->line((isset($editable) ? $editable : $controller_name). "_confirm_restore")?>"; + return "lang->line((isset($editable) ? $editable : $controller_name). "_confirm_restore")?>"; } }; diff --git a/application/views/partial/datepicker_locale.php b/application/views/partial/datepicker_locale.php index a76c244bd..78b391aad 100644 --- a/application/views/partial/datepicker_locale.php +++ b/application/views/partial/datepicker_locale.php @@ -108,4 +108,6 @@ $.fn.datetimepicker.dates['config->item("language"); ?>'] = { } ?> weekStart: lang->line("datepicker_weekstart"); ?> -}; \ No newline at end of file +}; + +$(".datetime").datetimepicker(pickerconfig()); \ No newline at end of file diff --git a/application/views/sales/form.php b/application/views/sales/form.php index eca343ab6..5892a2687 100755 --- a/application/views/sales/form.php +++ b/application/views/sales/form.php @@ -12,7 +12,7 @@
          lang->line('sales_date'), 'date', array('class'=>'control-label col-xs-3')); ?>
          - 'date','value'=>to_datetime(strtotime($sale_info['sale_time'])), 'id'=>'datetime', 'class'=>'form-control input-sm'));?> + 'date','value'=>to_datetime(strtotime($sale_info['sale_time'])), 'class'=>'datetime form-control input-sm'));?>
          @@ -109,8 +109,6 @@ $(document).ready(function() load->view('partial/datepicker_locale'); ?> - - $('#datetime').datetimepicker(pickerconfig); var fill_value = function(event, ui) { event.preventDefault(); diff --git a/public/js/manage_tables.js b/public/js/manage_tables.js index f7bfcafb8..060284e72 100644 --- a/public/js/manage_tables.js +++ b/public/js/manage_tables.js @@ -251,11 +251,15 @@ }; var init_delete = function (confirmMessage) { - $("#delete").click(do_action("delete")); + $("#delete").click(function(event) { + do_action("delete")(); + }); }; var init_restore = function (confirmMessage) { - $("#restore").click(do_action("restore")); + $("#restore").click(function(event) { + do_action("restore")(); + }); }; var refresh = function() { From 0fc702627ed7ed03967411b58909ce3d08049155 Mon Sep 17 00:00:00 2001 From: jekkos Date: Mon, 27 Aug 2018 23:52:58 +0200 Subject: [PATCH 290/568] Fix detailed reports (#68) --- application/models/Sale.php | 1 - application/models/reports/Detailed_receivings.php | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/application/models/Sale.php b/application/models/Sale.php index 95f320094..244050924 100644 --- a/application/models/Sale.php +++ b/application/models/Sale.php @@ -1192,7 +1192,6 @@ class Sale extends CI_Model MAX(' . $this->Item->get_item_name() . ') AS name, MAX(items.item_number) AS item_number, MAX(items.category) AS category, - MAX(definition_name) AS definition_name, 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, diff --git a/application/models/reports/Detailed_receivings.php b/application/models/reports/Detailed_receivings.php index da25d0283..2b1eee10f 100644 --- a/application/models/reports/Detailed_receivings.php +++ b/application/models/reports/Detailed_receivings.php @@ -97,11 +97,9 @@ class Detailed_receivings extends Report foreach($data['summary'] as $key=>$value) { - $this->db->select('name, item_number, category, definition_name, quantity_purchased, serialnumber, total, discount_percent, item_location, receivings_items_temp.receiving_quantity'); + $this->db->select('name, item_number, category, quantity_purchased, serialnumber, total, discount_percent, 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->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 = \'GROUP\'', 'left'); $this->db->where('receivings_items_temp.receiving_id', $value['receiving_id']); $data['details'][$key] = $this->db->get()->result_array(); } From 288b4029d7ace49cc74c24ee1f3efceb46c5ed6a Mon Sep 17 00:00:00 2001 From: jekkos Date: Sat, 1 Sep 2018 01:09:43 +0200 Subject: [PATCH 291/568] Add attributes to detailed sales/receiving reports (#68) --- application/controllers/Attributes.php | 5 ++- application/controllers/Reports.php | 24 ++++++++++---- application/libraries/Receiving_lib.php | 2 +- application/libraries/Sale_lib.php | 2 +- application/models/Attribute.php | 33 +++++++++++++++++-- application/models/Receiving.php | 2 +- .../models/reports/Detailed_receivings.php | 7 ++++ application/models/reports/Detailed_sales.php | 9 ++++- .../views/partial/bootstrap_tables_locale.php | 17 ++++++---- application/views/partial/header.php | 2 +- public/js/manage_tables.js | 2 +- 11 files changed, 83 insertions(+), 22 deletions(-) diff --git a/application/controllers/Attributes.php b/application/controllers/Attributes.php index 44f078e77..394ccd8b9 100644 --- a/application/controllers/Attributes.php +++ b/application/controllers/Attributes.php @@ -59,7 +59,10 @@ class Attributes extends Secure_Controller public function save_definition($definition_id = -1) { $definition_flags = 0; - foreach($this->input->post('definition_flags') as $flag) + + $flags = (empty($this->input->post('definition_flags'))) ? array() : $this->input->post('definition_flags'); + + foreach($flags as $flag) { $definition_flags |= $flag; } diff --git a/application/controllers/Reports.php b/application/controllers/Reports.php index 9fe6945df..b9515757d 100644 --- a/application/controllers/Reports.php +++ b/application/controllers/Reports.php @@ -1191,14 +1191,19 @@ class Reports extends Secure_Controller public function detailed_sales($start_date, $end_date, $sale_type, $location_id = 'all') { - $inputs = array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type, 'location_id' => $location_id); + $definition_names = $this->Attribute->get_definitions_by_flags(Attribute::SHOW_IN_SALES); + + $inputs = array('start_date' => $start_date, 'end_date' => $end_date, 'sale_type' => $sale_type, 'location_id' => $location_id, 'definition_ids' => array_keys($definition_names)); $this->load->model('reports/Detailed_sales'); $model = $this->Detailed_sales; $model->create($inputs); - $headers = $this->xss_clean($model->getDataColumns()); + $columns = $model->getDataColumns(); + $columns['details'] = array_merge($columns['details'], $definition_names); + + $headers = $this->xss_clean($columns); $report_data = $model->getData($inputs); @@ -1313,14 +1318,19 @@ class Reports extends Secure_Controller public function detailed_receivings($start_date, $end_date, $receiving_type, $location_id = 'all') { - $inputs = array('start_date' => $start_date, 'end_date' => $end_date, 'receiving_type' => $receiving_type, 'location_id' => $location_id); + $definition_names = $this->Attribute->get_definitions_by_flags(Attribute::SHOW_IN_RECEIVINGS); + + $inputs = array('start_date' => $start_date, 'end_date' => $end_date, 'receiving_type' => $receiving_type, 'location_id' => $location_id, 'definition_ids' => array_keys($definition_names)); $this->load->model('reports/Detailed_receivings'); $model = $this->Detailed_receivings; $model->create($inputs); - $headers = $this->xss_clean($model->getDataColumns()); + $columns = $model->getDataColumns(); + $columns['details'] = array_merge($columns['details'], $definition_names); + + $headers = $this->xss_clean($columns); $report_data = $model->getData($inputs); $summary_data = array(); @@ -1353,13 +1363,15 @@ class Reports extends Secure_Controller { $quantity_purchased .= ' [' . $this->Stock_location->get_location_name($drow['item_location']) . ']'; } - $details_data[$row['receiving_id']][] = $this->xss_clean(array( + $details_data[$row['receiving_id']][] = $this->xss_clean(array_merge(array( $drow['item_number'], $drow['name'], $drow['category'], $quantity_purchased, to_currency($drow['total']), - ($drow['discount_type'] == PERCENT)? $drow['discount'].'%':to_currency($drow['discount']))); + ($drow['discount_type'] == PERCENT)? $drow['discount'].'%':to_currency($drow['discount'])), + explode(',', $drow['attribute_values']) + )); } } diff --git a/application/libraries/Receiving_lib.php b/application/libraries/Receiving_lib.php index 4311d7d96..132bb6d35 100644 --- a/application/libraries/Receiving_lib.php +++ b/application/libraries/Receiving_lib.php @@ -240,7 +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, + 'attribute_values' => $this->CI->Attribute->get_link_values($item_id, 'receiving_id', $receiving_id, Attribute::SHOW_IN_RECEIVINGS), 'allow_alt_description' => $item_info->allow_alt_description, 'is_serialized' => $item_info->is_serialized, 'quantity' => $quantity, diff --git a/application/libraries/Sale_lib.php b/application/libraries/Sale_lib.php index 5db5b995d..6b90ac0a4 100644 --- a/application/libraries/Sale_lib.php +++ b/application/libraries/Sale_lib.php @@ -843,7 +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, + 'attribute_values' => $this->CI->Attribute->get_link_values($item_id, 'sale_id', $sale_id, Attribute::SHOW_IN_SALES), 'description' => $description != NULL ? $description : $item_info->description, 'serialnumber' => $serialnumber != NULL ? $serialnumber : '', 'allow_alt_description' => $item_info->allow_alt_description, diff --git a/application/models/Attribute.php b/application/models/Attribute.php index 796e075d1..d2d38fe5f 100644 --- a/application/models/Attribute.php +++ b/application/models/Attribute.php @@ -164,6 +164,17 @@ class Attribute extends CI_Model return $this->_to_array($results, 'definition_id', 'definition_name'); } + public function get_definitions_by_flags($definition_flags) + { + $this->db->from('attribute_definitions'); + $this->db->where('definition_flags &', $definition_flags); + $this->db->where('deleted', 0); + $this->db->order_by('definition_id'); + $results = $this->db->get()->result_array(); + + return $this->_to_array($results, 'definition_id', 'definition_name'); + } + public function get_definition_names() { $this->db->from('attribute_definitions'); @@ -298,11 +309,13 @@ class Attribute extends CI_Model 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->select('GROUP_CONCAT(attribute_value SEPARATOR ", ") AS attribute_values, GROUP_CONCAT(attribute_datetime SEPARATOR ", ") AS attribute_datetimevalues'); $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 <>', GROUP); + $this->db->where('deleted', 0); + if(!empty($id)) { $this->db->where($sale_receiving_fk, $id); @@ -315,7 +328,23 @@ class Attribute extends CI_Model $this->db->where('item_id', (int) $item_id); $this->db->where('definition_flags & ', $definition_flags); - return $this->db->get()->row_object(); + $results = $this->db->get(); + + if ($results->num_rows() > 0) + { + $row_object = $results->row_object(); + + $datetime_values = explode(', ', $row_object->attribute_datetimevalues); + $attribute_values = array(); + + foreach (array_filter($datetime_values) as $datetime_value) + { + $attribute_values[] = to_datetime(strtotime($datetime_value)); + } + + return implode(',', $attribute_values) . $row_object->attribute_values; + } + return ""; } public function get_attribute_value($item_id, $definition_id) diff --git a/application/models/Receiving.php b/application/models/Receiving.php index 29958d52f..22a813a14 100644 --- a/application/models/Receiving.php +++ b/application/models/Receiving.php @@ -88,7 +88,7 @@ class Receiving extends CI_Model $receivings_items_data = array( 'receiving_id' => $receiving_id, 'item_id' => $item['item_id'], - 'line' => $item['line'], + 'linae' => $item['line'], 'description' => $item['description'], 'serialnumber' => $item['serialnumber'], 'quantity_purchased' => $item['quantity'], diff --git a/application/models/reports/Detailed_receivings.php b/application/models/reports/Detailed_receivings.php index 2b1eee10f..dc8eeb9dc 100644 --- a/application/models/reports/Detailed_receivings.php +++ b/application/models/reports/Detailed_receivings.php @@ -100,6 +100,13 @@ class Detailed_receivings extends Report $this->db->select('name, item_number, category, quantity_purchased, serialnumber, total, discount_percent, 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'); + if (count($inputs['definition_ids']) > 0) + { + $this->db->select('GROUP_CONCAT(attribute_value) AS attribute_values'); + $this->db->join('attribute_links', 'attribute_links.item_id = items.item_id AND attribute_links.receiving_id = receivings_items_temp.receiving_id AND definition_id IN (' . implode(',', $inputs['definition_ids']) . ')', 'left'); + $this->db->join('attribute_values', 'attribute_values.attribute_id = attribute_links.attribute_id', 'left'); + $this->db->order_by('definition_id'); + } $this->db->where('receivings_items_temp.receiving_id', $value['receiving_id']); $data['details'][$key] = $this->db->get()->result_array(); } diff --git a/application/models/reports/Detailed_sales.php b/application/models/reports/Detailed_sales.php index 36ad0234c..fda7a80bf 100644 --- a/application/models/reports/Detailed_sales.php +++ b/application/models/reports/Detailed_sales.php @@ -146,7 +146,14 @@ class Detailed_sales extends Report { $this->db->select('name, category, quantity_purchased, item_location, serialnumber, description, subtotal, tax, total, cost, profit, discount, discount_type, sale_status'); $this->db->from('sales_items_temp'); - $this->db->where('sale_id', $value['sale_id']); + if (count($inputs['definition_ids']) > 0) + { + $this->db->select('GROUP_CONCAT(attribute_value) AS attribute_values'); + $this->db->join('attribute_links', 'attribute_links.item_id = sales_items_temp.item_id AND attribute_links.sale_id = sales_items_temp.sale_id AND definition_id IN (' . implode(',', $inputs['definition_ids']) . ')', 'left'); + $this->db->join('attribute_values', 'attribute_values.attribute_id = attribute_links.attribute_id', 'left'); + $this->db->order_by('definition_id'); + } + $this->db->where('sales_items_temp.sale_id', $value['sale_id']); $data['details'][$key] = $this->db->get()->result_array(); $this->db->select('used, earned'); $this->db->from('sales_reward_points'); diff --git a/application/views/partial/bootstrap_tables_locale.php b/application/views/partial/bootstrap_tables_locale.php index c9f4c9908..3aef29dd1 100644 --- a/application/views/partial/bootstrap_tables_locale.php +++ b/application/views/partial/bootstrap_tables_locale.php @@ -33,13 +33,16 @@ formatAllRows: function () { return "lang->line('tables_all'); ?>"; }, - formatConfirmDelete: function(action) { - - return "lang->line((isset($editable) ? $editable : $controller_name). "_confirm_delete")?>" + action; - }, - formatConfirmRestore : function() { - return "lang->line((isset($editable) ? $editable : $controller_name). "_confirm_restore")?>"; - } + formatConfirmAction: function(action) { + if (action == "delete") + { + return "lang->line((isset($editable) ? $editable : $controller_name). "_confirm_delete")?>"; + } + else + { + return "lang->line((isset($editable) ? $editable : $controller_name). "_confirm_restore")?>"; + } + } }; $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales[""]); diff --git a/application/views/partial/header.php b/application/views/partial/header.php index 7264c94e3..2392af6b6 100644 --- a/application/views/partial/header.php +++ b/application/views/partial/header.php @@ -77,7 +77,7 @@ - + diff --git a/public/js/manage_tables.js b/public/js/manage_tables.js index 060284e72..d3272db87 100644 --- a/public/js/manage_tables.js +++ b/public/js/manage_tables.js @@ -144,7 +144,7 @@ var do_action = function(action) { return function (url, ids) { - if (confirm($.fn.bootstrapTable.defaults.formatConfirmDelete())) { + if (confirm($.fn.bootstrapTable.defaults.formatConfirmAction(action))) { $.post((url || options.resource) + '/' + action, {'ids[]': ids || selected_ids()}, function (response) { //delete was successful, remove checkbox rows if (response.success) { From 77682973a0587ca56b8c4bce2c534aa6513aff89 Mon Sep 17 00:00:00 2001 From: jekkos Date: Wed, 5 Sep 2018 18:57:45 +0200 Subject: [PATCH 292/568] Enable attributes in items table (#68) --- application/controllers/Items.php | 5 ++++- application/helpers/tabular_helper.php | 11 +++++++++-- application/models/Attribute.php | 2 +- application/models/Item.php | 10 ++++++++-- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/application/controllers/Items.php b/application/controllers/Items.php index 5eab7920a..be843fc00 100644 --- a/application/controllers/Items.php +++ b/application/controllers/Items.php @@ -45,6 +45,8 @@ class Items extends Secure_Controller $this->item_lib->set_item_location($this->input->get('stock_location')); + $definition_names = $this->Attribute->get_definitions_by_flags(Attribute::SHOW_IN_ITEMS); + $filters = array('start_date' => $this->input->get('start_date'), 'end_date' => $this->input->get('end_date'), 'stock_location_id' => $this->item_lib->get_item_location(), @@ -54,7 +56,8 @@ class Items extends Secure_Controller 'no_description' => FALSE, 'search_custom' => FALSE, 'is_deleted' => FALSE, - 'temporary' => FALSE); + 'temporary' => FALSE, + 'definition_ids' => array_keys($definition_names)); // check if any filter is set in the multiselect dropdown $filledup = array_fill_keys($this->input->get('filters'), TRUE); diff --git a/application/helpers/tabular_helper.php b/application/helpers/tabular_helper.php index a89a449d9..3fb7044a0 100644 --- a/application/helpers/tabular_helper.php +++ b/application/helpers/tabular_helper.php @@ -321,6 +321,8 @@ function get_items_manage_table_headers() { $CI =& get_instance(); + $definition_names = $CI->Attribute->get_definitions_by_flags(Attribute::SHOW_IN_ITEMS); + $headers = array( array('items.item_id' => $CI->lang->line('common_id')), array('item_number' => $CI->lang->line('items_item_number')), @@ -336,6 +338,11 @@ function get_items_manage_table_headers() array('stock' => '') ); + foreach($definition_names as $definition_id => $definition_name) + { + $headers[] = array($definition_name => $definition_name); + } + return transform_headers($headers); } @@ -381,7 +388,7 @@ function get_item_data_row($item) $item->name .= NAME_SEPARATOR . $item->pack_name; } - return array ( + return array_merge(array ( 'items.item_id' => $item->item_id, 'item_number' => $item->item_number, 'name' => $item->name, @@ -400,7 +407,7 @@ function get_item_data_row($item) ), 'edit' => anchor($controller_name."/view/$item->item_id", '', array('class' => 'modal-dlg', 'data-btn-submit' => $CI->lang->line('common_submit'), 'title' => $CI->lang->line($controller_name.'_update')) - )); + ), explode(',', $item->attribute_values))); } diff --git a/application/models/Attribute.php b/application/models/Attribute.php index d2d38fe5f..12b98fbe8 100644 --- a/application/models/Attribute.php +++ b/application/models/Attribute.php @@ -13,7 +13,7 @@ const DEFINITION_TYPES = [GROUP, DROPDOWN, TEXT, DATETIME]; class Attribute extends CI_Model { - //const SHOW_IN_ITEMS = 1; + const SHOW_IN_ITEMS = 1; const SHOW_IN_SALES = 2; const SHOW_IN_RECEIVINGS = 4; diff --git a/application/models/Item.php b/application/models/Item.php index d0042f643..deedb74f6 100644 --- a/application/models/Item.php +++ b/application/models/Item.php @@ -180,18 +180,24 @@ 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->like('attribute_value', $search); $this->db->join('attribute_links', 'attribute_links.item_id = items.item_id'); $this->db->join('attribute_values', 'attribute_links.attribute_id = attribute_values.attribute_id'); - $this->db->like('attribute_value', $search); } } + else if (count($filters['definition_ids']) > 0) + { + $this->db->select('GROUP_CONCAT(attribute_value) AS attribute_values'); + $this->db->join('attribute_links', 'attribute_links.item_id = items.item_id AND attribute_links.receiving_id IS NULL AND attribute_links.sale_id IS NULL AND definition_id IN (' . implode(',', $filters['definition_ids']) . ')', 'left'); + $this->db->join('attribute_values', 'attribute_values.attribute_id = attribute_links.attribute_id', 'left'); + $this->db->order_by('definition_id'); + } $this->db->where('items.deleted', $filters['is_deleted']); From 5d088f02831097c245d2719986a128e1a7d0eb2d Mon Sep 17 00:00:00 2001 From: jekkos Date: Wed, 5 Sep 2018 18:59:03 +0200 Subject: [PATCH 293/568] Revert tables.sql to original 3.0 (#68) --- database/constraints.sql | 18 +-------- database/tables.sql | 82 +++++++--------------------------------- 2 files changed, 14 insertions(+), 86 deletions(-) diff --git a/database/constraints.sql b/database/constraints.sql index 65d7f51fe..a293fc690 100644 --- a/database/constraints.sql +++ b/database/constraints.sql @@ -118,22 +118,6 @@ 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` -- @@ -146,4 +130,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_items` (`sale_id`); + ADD CONSTRAINT `ospos_sales_reward_points_ibfk_1` FOREIGN KEY (`sale_id`) REFERENCES `ospos_sales` (`sale_id`); diff --git a/database/tables.sql b/database/tables.sql index ae75574c3..6a63bfbbc 100644 --- a/database/tables.sql +++ b/database/tables.sql @@ -248,6 +248,16 @@ 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`) @@ -353,7 +363,7 @@ CREATE TABLE `ospos_modules` ( -- INSERT INTO `ospos_modules` (`name_lang_key`, `desc_lang_key`, `sort`, `module_id`) VALUES -('module_config', 'module_config_desc', 120, 'config'), +('module_config', 'module_config_desc', 110, 'config'), ('module_customers', 'module_customers_desc', 10, 'customers'), ('module_employees', 'module_employees_desc', 80, 'employees'), ('module_giftcards', 'module_giftcards_desc', 90, 'giftcards'), @@ -366,8 +376,7 @@ 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_attributes', 'module_attributes_desc', 110, 'attributes'); +('module_taxes', 'module_taxes_desc', 105, 'taxes'); -- -------------------------------------------------------- @@ -443,8 +452,7 @@ INSERT INTO `ospos_permissions` (`permission_id`, `module_id`) VALUES ('sales', 'sales'), ('config', 'config'), ('suppliers', 'suppliers'), -('taxes', 'taxes'), -('attributes', 'attributes'); +('taxes', 'taxes'); @@ -499,7 +507,6 @@ 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'); -- @@ -802,69 +809,6 @@ 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, - `attribute_datetime` DATETIME 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` --- - -- -------------------------------------------------------- -- From 1ed56e388b5facdf6f3ad2e1c35b4cee5dd4376f Mon Sep 17 00:00:00 2001 From: jekkos Date: Thu, 6 Sep 2018 00:26:18 +0200 Subject: [PATCH 294/568] Rename migration script (#68) --- application/helpers/tabular_helper.php | 2 +- ...80220100000_attributes.php => 20180905100000_attributes.php} | 0 application/models/Item.php | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename application/migrations/{20180220100000_attributes.php => 20180905100000_attributes.php} (100%) diff --git a/application/helpers/tabular_helper.php b/application/helpers/tabular_helper.php index 3fb7044a0..90902f91e 100644 --- a/application/helpers/tabular_helper.php +++ b/application/helpers/tabular_helper.php @@ -407,7 +407,7 @@ function get_item_data_row($item) ), 'edit' => anchor($controller_name."/view/$item->item_id", '', array('class' => 'modal-dlg', 'data-btn-submit' => $CI->lang->line('common_submit'), 'title' => $CI->lang->line($controller_name.'_update')) - ), explode(',', $item->attribute_values))); + ), explode(',', (property_exists($item, 'attribute_values')) ? $item->attribute_values : ""))); } diff --git a/application/migrations/20180220100000_attributes.php b/application/migrations/20180905100000_attributes.php similarity index 100% rename from application/migrations/20180220100000_attributes.php rename to application/migrations/20180905100000_attributes.php diff --git a/application/models/Item.php b/application/models/Item.php index deedb74f6..91d24e980 100644 --- a/application/models/Item.php +++ b/application/models/Item.php @@ -193,7 +193,7 @@ class Item extends CI_Model } else if (count($filters['definition_ids']) > 0) { - $this->db->select('GROUP_CONCAT(attribute_value) AS attribute_values'); + $this->db->select('GROUP_CONCAT(attribute_value) AS attribute_values'); $this->db->join('attribute_links', 'attribute_links.item_id = items.item_id AND attribute_links.receiving_id IS NULL AND attribute_links.sale_id IS NULL AND definition_id IN (' . implode(',', $filters['definition_ids']) . ')', 'left'); $this->db->join('attribute_values', 'attribute_values.attribute_id = attribute_links.attribute_id', 'left'); $this->db->order_by('definition_id'); From 83dc1de6d6b65bb000e0e126463f35939add3ae3 Mon Sep 17 00:00:00 2001 From: jekkos Date: Thu, 6 Sep 2018 00:43:40 +0200 Subject: [PATCH 295/568] Don't create attributes if custom fields were empty (#68) --- .../migrations/sqlscripts/attributes.sql | 20 +++++++++---------- application/views/partial/header.php | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/application/migrations/sqlscripts/attributes.sql b/application/migrations/sqlscripts/attributes.sql index b1f93780c..a92813b08 100644 --- a/application/migrations/sqlscripts/attributes.sql +++ b/application/migrations/sqlscripts/attributes.sql @@ -59,16 +59,16 @@ INSERT INTO `ospos_grants` (`permission_id`, `person_id`, `menu_group`) VALUES -- 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_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom1_name' AND `value` <> ''; +INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom2_name' AND `value` <> ''; +INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom3_name' AND `value` <> ''; +INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom4_name' AND `value` <> ''; +INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom5_name' AND `value` <> ''; +INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom6_name' AND `value` <> ''; +INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom7_name' AND `value` <> ''; +INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom8_name' AND `value` <> ''; +INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom9_name' AND `value` <> ''; +INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom10_name' AND `value` <> ''; 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; diff --git a/application/views/partial/header.php b/application/views/partial/header.php index 2392af6b6..293cbb094 100644 --- a/application/views/partial/header.php +++ b/application/views/partial/header.php @@ -77,7 +77,7 @@ - + From 9d0da3e6b8d11587654bb96334085e798d89a9c8 Mon Sep 17 00:00:00 2001 From: jekkos Date: Thu, 6 Sep 2018 01:12:47 +0200 Subject: [PATCH 296/568] Fix detailed receivings/sales report issues (#68) --- application/controllers/Reports.php | 8 ++++---- application/models/Receiving.php | 2 +- application/models/reports/Detailed_receivings.php | 4 ++-- application/models/reports/Detailed_sales.php | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/application/controllers/Reports.php b/application/controllers/Reports.php index b9515757d..3e41b13d9 100644 --- a/application/controllers/Reports.php +++ b/application/controllers/Reports.php @@ -1251,7 +1251,7 @@ class Reports extends Secure_Controller { $quantity_purchased .= ' [' . $this->Stock_location->get_location_name($drow['item_location']) . ']'; } - $details_data[$row['sale_id']][] = $this->xss_clean(array( + $details_data[$row['sale_id']][] = $this->xss_clean(array_merge(array( $drow['name'], $drow['category'], $drow['serialnumber'], @@ -1262,7 +1262,8 @@ class Reports extends Secure_Controller to_currency($drow['total']), to_currency($drow['cost']), to_currency($drow['profit']), - ($drow['discount_type'] == PERCENT)? $drow['discount'].'%':to_currency($drow['discount']))); + ($drow['discount_type'] == PERCENT)? $drow['discount'].'%':to_currency($drow['discount']), + explode('|', (isset($drow['attribute_values'])) ? $drow['attribute_values'] : "")))); } if(isset($report_data['rewards'][$key])) @@ -1370,8 +1371,7 @@ class Reports extends Secure_Controller $quantity_purchased, to_currency($drow['total']), ($drow['discount_type'] == PERCENT)? $drow['discount'].'%':to_currency($drow['discount'])), - explode(',', $drow['attribute_values']) - )); + explode('|', (isset($drow['attribute_values'])) ? $drow['attribute_values'] : ""))); } } diff --git a/application/models/Receiving.php b/application/models/Receiving.php index 22a813a14..29958d52f 100644 --- a/application/models/Receiving.php +++ b/application/models/Receiving.php @@ -88,7 +88,7 @@ class Receiving extends CI_Model $receivings_items_data = array( 'receiving_id' => $receiving_id, 'item_id' => $item['item_id'], - 'linae' => $item['line'], + 'line' => $item['line'], 'description' => $item['description'], 'serialnumber' => $item['serialnumber'], 'quantity_purchased' => $item['quantity'], diff --git a/application/models/reports/Detailed_receivings.php b/application/models/reports/Detailed_receivings.php index dc8eeb9dc..b5eb1bdd7 100644 --- a/application/models/reports/Detailed_receivings.php +++ b/application/models/reports/Detailed_receivings.php @@ -97,12 +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_percent, 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'); if (count($inputs['definition_ids']) > 0) { - $this->db->select('GROUP_CONCAT(attribute_value) AS attribute_values'); + $this->db->select('GROUP_CONCAT(attribute_value SEPARATOR \'|\') AS attribute_values'); $this->db->join('attribute_links', 'attribute_links.item_id = items.item_id AND attribute_links.receiving_id = receivings_items_temp.receiving_id AND definition_id IN (' . implode(',', $inputs['definition_ids']) . ')', 'left'); $this->db->join('attribute_values', 'attribute_values.attribute_id = attribute_links.attribute_id', 'left'); $this->db->order_by('definition_id'); diff --git a/application/models/reports/Detailed_sales.php b/application/models/reports/Detailed_sales.php index fda7a80bf..209cca4f8 100644 --- a/application/models/reports/Detailed_sales.php +++ b/application/models/reports/Detailed_sales.php @@ -148,7 +148,7 @@ class Detailed_sales extends Report $this->db->from('sales_items_temp'); if (count($inputs['definition_ids']) > 0) { - $this->db->select('GROUP_CONCAT(attribute_value) AS attribute_values'); + $this->db->select('GROUP_CONCAT(attribute_value SEPARATOR \'|\') AS attribute_values'); $this->db->join('attribute_links', 'attribute_links.item_id = sales_items_temp.item_id AND attribute_links.sale_id = sales_items_temp.sale_id AND definition_id IN (' . implode(',', $inputs['definition_ids']) . ')', 'left'); $this->db->join('attribute_values', 'attribute_values.attribute_id = attribute_links.attribute_id', 'left'); $this->db->order_by('definition_id'); From 2fc353cd145e48c09d732024b6e6823e47b9655a Mon Sep 17 00:00:00 2001 From: jekkos Date: Thu, 6 Sep 2018 01:16:05 +0200 Subject: [PATCH 297/568] Don't show GROUP attribute as column (#68) --- application/models/Attribute.php | 1 + 1 file changed, 1 insertion(+) diff --git a/application/models/Attribute.php b/application/models/Attribute.php index 12b98fbe8..09c726e85 100644 --- a/application/models/Attribute.php +++ b/application/models/Attribute.php @@ -169,6 +169,7 @@ class Attribute extends CI_Model $this->db->from('attribute_definitions'); $this->db->where('definition_flags &', $definition_flags); $this->db->where('deleted', 0); + $this->db->where('definition_type <>', GROUP); $this->db->order_by('definition_id'); $results = $this->db->get()->result_array(); From 3c21b8ff5a0e05b1987c1b7813f6843a1a1adc96 Mon Sep 17 00:00:00 2001 From: jekkos Date: Sun, 9 Sep 2018 21:40:35 +0200 Subject: [PATCH 298/568] Minor db script review remarks --- ...0000_attributes.php => 20180910100000_attributes.php} | 0 application/migrations/sqlscripts/attributes.sql | 9 +++------ 2 files changed, 3 insertions(+), 6 deletions(-) rename application/migrations/{20180905100000_attributes.php => 20180910100000_attributes.php} (100%) diff --git a/application/migrations/20180905100000_attributes.php b/application/migrations/20180910100000_attributes.php similarity index 100% rename from application/migrations/20180905100000_attributes.php rename to application/migrations/20180910100000_attributes.php diff --git a/application/migrations/sqlscripts/attributes.sql b/application/migrations/sqlscripts/attributes.sql index a92813b08..499aa3acc 100644 --- a/application/migrations/sqlscripts/attributes.sql +++ b/application/migrations/sqlscripts/attributes.sql @@ -16,7 +16,7 @@ CREATE TABLE IF NOT EXISTS `ospos_attribute_values` ( `attribute_value` VARCHAR(45) NULL, `attribute_datetime` DATETIME NULL, PRIMARY KEY (`attribute_id`) -) ENGINE = InnoDB DEFAULT CHARSET=utf8; +) ENGINE = InnoDB DEFAULT CHARSET=utf8_general_ci; CREATE TABLE IF NOT EXISTS `ospos_attribute_links` ( @@ -31,7 +31,7 @@ CREATE TABLE IF NOT EXISTS `ospos_attribute_links` ( 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; +) ENGINE=InnoDB DEFAULT CHARSET=utf8_general_ci; ALTER TABLE `ospos_attribute_definitions` @@ -45,11 +45,8 @@ ALTER TABLE `ospos_attribute_links` 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'); + ('module_attributes', 'module_attributes_desc', 107, 'attributes'); INSERT INTO `ospos_permissions` (`permission_id`, `module_id`) VALUES ('attributes', 'attributes'); From 9e7543a41a567d32da2be5e52522be29d9781e65 Mon Sep 17 00:00:00 2001 From: jekkos Date: Sun, 9 Sep 2018 22:23:34 +0200 Subject: [PATCH 299/568] Fix attribute values in items (#68) --- application/helpers/tabular_helper.php | 16 ++++++++++++++-- application/migrations/sqlscripts/attributes.sql | 4 ++-- application/models/Item.php | 9 ++++++++- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/application/helpers/tabular_helper.php b/application/helpers/tabular_helper.php index 90902f91e..36ab83302 100644 --- a/application/helpers/tabular_helper.php +++ b/application/helpers/tabular_helper.php @@ -388,7 +388,9 @@ function get_item_data_row($item) $item->name .= NAME_SEPARATOR . $item->pack_name; } - return array_merge(array ( + $definition_names = $CI->Attribute->get_definitions_by_flags(Attribute::SHOW_IN_ITEMS); + + $result = array ( 'items.item_id' => $item->item_id, 'item_number' => $item->item_number, 'name' => $item->name, @@ -407,7 +409,17 @@ function get_item_data_row($item) ), 'edit' => anchor($controller_name."/view/$item->item_id", '', array('class' => 'modal-dlg', 'data-btn-submit' => $CI->lang->line('common_submit'), 'title' => $CI->lang->line($controller_name.'_update')) - ), explode(',', (property_exists($item, 'attribute_values')) ? $item->attribute_values : ""))); + )); + + $attribute_values = explode(',', (property_exists($item, 'attribute_values')) ? $item->attribute_values : ""); + + foreach($definition_names as $definition_id => $definition_name) + { + $result[$definition_name] = array_shift($attribute_values); + + } + + return $result; } diff --git a/application/migrations/sqlscripts/attributes.sql b/application/migrations/sqlscripts/attributes.sql index 499aa3acc..0a5471985 100644 --- a/application/migrations/sqlscripts/attributes.sql +++ b/application/migrations/sqlscripts/attributes.sql @@ -16,7 +16,7 @@ CREATE TABLE IF NOT EXISTS `ospos_attribute_values` ( `attribute_value` VARCHAR(45) NULL, `attribute_datetime` DATETIME NULL, PRIMARY KEY (`attribute_id`) -) ENGINE = InnoDB DEFAULT CHARSET=utf8_general_ci; +) ENGINE = InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `ospos_attribute_links` ( @@ -31,7 +31,7 @@ CREATE TABLE IF NOT EXISTS `ospos_attribute_links` ( 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_general_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; ALTER TABLE `ospos_attribute_definitions` diff --git a/application/models/Item.php b/application/models/Item.php index 91d24e980..7d95bd3f7 100644 --- a/application/models/Item.php +++ b/application/models/Item.php @@ -280,10 +280,13 @@ class Item extends CI_Model public function get_info($item_id) { $this->db->select('items.*'); + $this->db->select('GROUP_CONCAT(attribute_value SEPARATOR \'|\') AS attribute_values'); $this->db->select('suppliers.company_name'); $this->db->from('items'); $this->db->join('suppliers', 'suppliers.person_id = items.supplier_id', 'left'); - $this->db->where('item_id', $item_id); + $this->db->join('attribute_links', 'attribute_links.item_id = items.item_id', 'left'); + $this->db->join('attribute_values', 'attribute_links.attribute_id = attribute_values.attribute_id', 'left'); + $this->db->where('items.item_id', $item_id); $query = $this->db->get(); @@ -375,13 +378,17 @@ class Item extends CI_Model { $this->db->select('items.*'); $this->db->select('company_name'); + $this->db->select('GROUP_CONCAT(attribute_value SEPARATOR \'|\') AS attribute_values'); $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('attribute_links', 'attribute_links.item_id = items.item_id', 'left'); + $this->db->join('attribute_values', 'attribute_links.attribute_id = attribute_values.attribute_id', 'left'); $this->db->where('location_id', $location_id); $this->db->where_in('items.item_id', $item_ids); + $this->db->group_by('items.item_id'); return $this->db->get(); } From fc01e35a4344ca52f6446712f4916f373112fae3 Mon Sep 17 00:00:00 2001 From: jekkos Date: Sun, 9 Sep 2018 23:40:26 +0200 Subject: [PATCH 300/568] Add collation to tables --- application/migrations/sqlscripts/attributes.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/application/migrations/sqlscripts/attributes.sql b/application/migrations/sqlscripts/attributes.sql index 0a5471985..d213e2acc 100644 --- a/application/migrations/sqlscripts/attributes.sql +++ b/application/migrations/sqlscripts/attributes.sql @@ -8,7 +8,7 @@ CREATE TABLE IF NOT EXISTS `ospos_attribute_definitions` ( `deleted` TINYINT(1) NOT NULL DEFAULT 0, PRIMARY KEY (`definition_id`), KEY `definition_fk` (`definition_fk`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; CREATE TABLE IF NOT EXISTS `ospos_attribute_values` ( @@ -16,7 +16,7 @@ CREATE TABLE IF NOT EXISTS `ospos_attribute_values` ( `attribute_value` VARCHAR(45) NULL, `attribute_datetime` DATETIME NULL, PRIMARY KEY (`attribute_id`) -) ENGINE = InnoDB DEFAULT CHARSET=utf8; +) ENGINE = InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; CREATE TABLE IF NOT EXISTS `ospos_attribute_links` ( @@ -31,7 +31,7 @@ CREATE TABLE IF NOT EXISTS `ospos_attribute_links` ( 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; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; ALTER TABLE `ospos_attribute_definitions` @@ -179,4 +179,4 @@ ALTER TABLE `ospos_items` DROP COLUMN `custom7`, DROP COLUMN `custom8`, DROP COLUMN `custom9`, - DROP COLUMN `custom10`; \ No newline at end of file + DROP COLUMN `custom10`; From 093b2d96afbe2738d1f0c66d5dbb0996e54b8877 Mon Sep 17 00:00:00 2001 From: jekkos Date: Mon, 10 Sep 2018 20:03:54 +0200 Subject: [PATCH 301/568] Correct language files (#68) --- application/language/en-GB/attributes_lang.php | 4 ++-- application/language/{ => en-US}/en/attributes_lang.php | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename application/language/{ => en-US}/en/attributes_lang.php (100%) diff --git a/application/language/en-GB/attributes_lang.php b/application/language/en-GB/attributes_lang.php index 6886fd679..eb47ff6c0 100644 --- a/application/language/en-GB/attributes_lang.php +++ b/application/language/en-GB/attributes_lang.php @@ -1,11 +1,11 @@ Date: Mon, 10 Sep 2018 20:15:28 +0100 Subject: [PATCH 302/568] Fix language files --- application/language/en-GB/module_lang.php | 2 ++ .../language/en-US/en/attributes_lang.php | 25 ------------------- application/language/en-US/module_lang.php | 2 ++ 3 files changed, 4 insertions(+), 25 deletions(-) delete mode 100644 application/language/en-US/en/attributes_lang.php diff --git a/application/language/en-GB/module_lang.php b/application/language/en-GB/module_lang.php index 6a0d920e5..52b490cf5 100644 --- a/application/language/en-GB/module_lang.php +++ b/application/language/en-GB/module_lang.php @@ -1,5 +1,7 @@ Date: Mon, 10 Sep 2018 22:26:55 +0200 Subject: [PATCH 303/568] Update language files (#68) --- .../language/ar-EG/attributes_lang.php | 2 +- application/language/ar-EG/cashups_lang.php | 37 +++ application/language/ar-EG/config_lang.php | 11 + application/language/ar-EG/customers_lang.php | 3 + .../language/ar-EG/datepicker_lang.php | 1 + .../ar-EG/expenses_categories_lang.php | 1 + application/language/ar-EG/item_kits_lang.php | 3 + application/language/ar-EG/items_lang.php | 8 +- application/language/ar-EG/module_lang.php | 2 + .../language/ar-EG/receivings_lang.php | 1 + application/language/ar-EG/reports_lang.php | 4 + .../language/az-AZ/attributes_lang.php | 2 +- application/language/az-AZ/cashups_lang.php | 37 +++ application/language/az-AZ/config_lang.php | 9 + application/language/az-AZ/customers_lang.php | 3 + .../language/az-AZ/datepicker_lang.php | 1 + .../az-AZ/expenses_categories_lang.php | 1 + application/language/az-AZ/item_kits_lang.php | 3 + application/language/az-AZ/items_lang.php | 5 + application/language/az-AZ/module_lang.php | 4 +- .../language/az-AZ/receivings_lang.php | 1 + application/language/az-AZ/reports_lang.php | 4 + application/language/bg/attributes_lang.php | 25 ++ application/language/bg/cashups_lang.php | 37 +++ application/language/bg/config_lang.php | 1 + application/language/bg/customers_lang.php | 3 + application/language/bg/datepicker_lang.php | 1 + .../language/bg/expenses_categories_lang.php | 1 + application/language/bg/item_kits_lang.php | 3 + application/language/bg/items_lang.php | 4 + application/language/bg/module_lang.php | 4 + application/language/bg/receivings_lang.php | 1 + application/language/bg/reports_lang.php | 4 + application/language/cs/attributes_lang.php | 25 ++ application/language/cs/cashups_lang.php | 37 +++ application/language/cs/config_lang.php | 1 + application/language/cs/customers_lang.php | 3 + application/language/cs/datepicker_lang.php | 1 + .../language/cs/expenses_categories_lang.php | 1 + application/language/cs/item_kits_lang.php | 3 + application/language/cs/items_lang.php | 4 + application/language/cs/module_lang.php | 4 + application/language/cs/receivings_lang.php | 4 +- application/language/cs/sales_lang.php | 3 +- .../language/de-CH/attributes_lang.php | 2 +- application/language/de-CH/cashups_lang.php | 37 +++ application/language/de-CH/config_lang.php | 11 + application/language/de-CH/customers_lang.php | 3 + .../language/de-CH/datepicker_lang.php | 1 + .../de-CH/expenses_categories_lang.php | 1 + application/language/de-CH/item_kits_lang.php | 3 + application/language/de-CH/items_lang.php | 5 + application/language/de-CH/module_lang.php | 2 + .../language/de-CH/receivings_lang.php | 1 + application/language/de-CH/reports_lang.php | 4 + application/language/de/attributes_lang.php | 2 +- application/language/de/cashups_lang.php | 37 +++ application/language/de/config_lang.php | 4 +- application/language/de/customers_lang.php | 3 + application/language/de/datepicker_lang.php | 1 + .../language/de/expenses_categories_lang.php | 1 + application/language/de/item_kits_lang.php | 3 + application/language/de/items_lang.php | 4 + application/language/de/module_lang.php | 2 + application/language/de/receivings_lang.php | 1 + application/language/de/reports_lang.php | 4 + application/language/el/attributes_lang.php | 25 ++ .../language/el/bootstrap_tables_lang.php | 10 + application/language/el/cashups_lang.php | 37 +++ application/language/el/common_lang.php | 16 +- application/language/el/config_lang.php | 274 ++++++++++++++++++ application/language/el/customers_lang.php | 54 +++- application/language/el/datepicker_lang.php | 23 ++ application/language/el/employees_lang.php | 37 +++ application/language/el/enum_lang.php | 9 + application/language/el/error_lang.php | 4 + .../language/el/expenses_categories_lang.php | 21 ++ application/language/el/expenses_lang.php | 45 +++ application/language/el/giftcards_lang.php | 70 +++++ application/language/el/item_kits_lang.php | 35 +++ application/language/el/items_lang.php | 111 +++++++ application/language/el/login_lang.php | 10 + application/language/el/messages_lang.php | 14 + application/language/el/module_lang.php | 41 +++ application/language/el/receivings_lang.php | 54 ++++ application/language/el/reports_lang.php | 127 ++++++++ application/language/el/sales_lang.php | 165 +++++++++++ application/language/el/suppliers_lang.php | 19 ++ application/language/el/taxes_lang.php | 32 ++ .../language/en-GB/attributes_lang.php | 2 +- application/language/en-GB/config_lang.php | 10 + application/language/en-GB/customers_lang.php | 2 +- .../language/en-GB/datepicker_lang.php | 1 + application/language/en-GB/item_kits_lang.php | 2 +- application/language/en-GB/items_lang.php | 1 + application/language/en-GB/reports_lang.php | 4 +- .../language/en-US/attributes_lang.php | 2 +- application/language/en-US/config_lang.php | 10 + application/language/en-US/customers_lang.php | 6 +- .../language/en-US/datepicker_lang.php | 1 + application/language/en-US/item_kits_lang.php | 7 +- application/language/en-US/items_lang.php | 1 + application/language/en-US/reports_lang.php | 4 +- application/language/es/attributes_lang.php | 2 +- application/language/es/cashups_lang.php | 37 +++ application/language/es/config_lang.php | 11 + application/language/es/customers_lang.php | 6 +- application/language/es/datepicker_lang.php | 1 + .../language/es/expenses_categories_lang.php | 1 + application/language/es/item_kits_lang.php | 7 +- application/language/es/items_lang.php | 5 + application/language/es/module_lang.php | 2 + application/language/es/receivings_lang.php | 1 + application/language/es/reports_lang.php | 6 +- application/language/fr/attributes_lang.php | 2 +- application/language/fr/cashups_lang.php | 37 +++ application/language/fr/config_lang.php | 11 + application/language/fr/customers_lang.php | 3 + application/language/fr/datepicker_lang.php | 1 + .../language/fr/expenses_categories_lang.php | 1 + application/language/fr/item_kits_lang.php | 3 + application/language/fr/items_lang.php | 5 + application/language/fr/module_lang.php | 2 + application/language/fr/receivings_lang.php | 1 + application/language/fr/reports_lang.php | 4 + .../language/hr-HR/attributes_lang.php | 2 +- application/language/hr-HR/cashups_lang.php | 37 +++ application/language/hr-HR/config_lang.php | 11 + application/language/hr-HR/customers_lang.php | 3 + .../language/hr-HR/datepicker_lang.php | 1 + .../hr-HR/expenses_categories_lang.php | 1 + application/language/hr-HR/item_kits_lang.php | 3 + application/language/hr-HR/items_lang.php | 5 + application/language/hr-HR/module_lang.php | 2 + .../language/hr-HR/receivings_lang.php | 1 + application/language/hr-HR/reports_lang.php | 4 + .../language/hu-HU/attributes_lang.php | 2 +- application/language/hu-HU/cashups_lang.php | 37 +++ application/language/hu-HU/config_lang.php | 11 + application/language/hu-HU/customers_lang.php | 3 + .../language/hu-HU/datepicker_lang.php | 1 + .../hu-HU/expenses_categories_lang.php | 1 + application/language/hu-HU/item_kits_lang.php | 3 + application/language/hu-HU/items_lang.php | 5 + application/language/hu-HU/module_lang.php | 2 + .../language/hu-HU/receivings_lang.php | 1 + application/language/hu-HU/reports_lang.php | 4 + application/language/id/attributes_lang.php | 2 +- application/language/id/cashups_lang.php | 37 +++ application/language/id/config_lang.php | 4 +- application/language/id/customers_lang.php | 6 +- application/language/id/employees_lang.php | 3 +- application/language/id/enum_lang.php | 3 +- .../language/id/expenses_categories_lang.php | 4 +- application/language/id/expenses_lang.php | 3 +- application/language/id/giftcards_lang.php | 3 +- application/language/id/item_kits_lang.php | 6 +- application/language/id/items_lang.php | 7 +- application/language/id/module_lang.php | 7 +- application/language/id/receivings_lang.php | 4 +- application/language/id/reports_lang.php | 7 +- application/language/id/suppliers_lang.php | 3 +- application/language/id/taxes_lang.php | 3 +- application/language/it/attributes_lang.php | 25 ++ application/language/it/cashups_lang.php | 37 +++ application/language/it/config_lang.php | 1 + application/language/it/customers_lang.php | 3 + application/language/it/datepicker_lang.php | 1 + .../language/it/expenses_categories_lang.php | 1 + application/language/it/item_kits_lang.php | 3 + application/language/it/items_lang.php | 4 + application/language/it/module_lang.php | 4 + application/language/it/receivings_lang.php | 1 + application/language/it/reports_lang.php | 4 + application/language/km/attributes_lang.php | 25 ++ application/language/km/cashups_lang.php | 37 +++ application/language/km/config_lang.php | 1 + application/language/km/customers_lang.php | 3 + application/language/km/datepicker_lang.php | 1 + .../language/km/expenses_categories_lang.php | 1 + application/language/km/item_kits_lang.php | 3 + application/language/km/items_lang.php | 4 + application/language/km/module_lang.php | 4 + application/language/km/receivings_lang.php | 1 + application/language/km/reports_lang.php | 4 + application/language/lo/attributes_lang.php | 25 ++ application/language/lo/cashups_lang.php | 37 +++ application/language/lo/config_lang.php | 1 + application/language/lo/customers_lang.php | 3 + application/language/lo/datepicker_lang.php | 1 + .../language/lo/expenses_categories_lang.php | 1 + application/language/lo/item_kits_lang.php | 3 + application/language/lo/items_lang.php | 4 + application/language/lo/module_lang.php | 4 + application/language/lo/receivings_lang.php | 1 + application/language/lo/reports_lang.php | 4 + .../language/nl-BE/attributes_lang.php | 46 +-- application/language/nl-BE/cashups_lang.php | 37 +++ application/language/nl-BE/config_lang.php | 4 +- application/language/nl-BE/customers_lang.php | 5 +- .../language/nl-BE/datepicker_lang.php | 1 + application/language/nl-BE/employees_lang.php | 3 +- .../nl-BE/expenses_categories_lang.php | 32 +- application/language/nl-BE/item_kits_lang.php | 3 + application/language/nl-BE/items_lang.php | 5 + application/language/nl-BE/module_lang.php | 2 + .../language/nl-BE/receivings_lang.php | 4 +- application/language/nl-BE/reports_lang.php | 9 +- application/language/nl-BE/suppliers_lang.php | 3 +- application/language/nl/attributes_lang.php | 25 ++ application/language/nl/cashups_lang.php | 37 +++ application/language/nl/config_lang.php | 1 + application/language/nl/customers_lang.php | 3 + application/language/nl/datepicker_lang.php | 1 + .../language/nl/expenses_categories_lang.php | 1 + application/language/nl/item_kits_lang.php | 3 + application/language/nl/items_lang.php | 4 + application/language/nl/module_lang.php | 4 + application/language/nl/receivings_lang.php | 1 + application/language/nl/reports_lang.php | 4 + .../language/pt-BR/attributes_lang.php | 2 +- application/language/pt-BR/cashups_lang.php | 37 +++ .../language/pt-BR/datepicker_lang.php | 1 + application/language/ro/attributes_lang.php | 25 ++ .../language/ro/bootstrap_tables_lang.php | 3 +- application/language/ro/cashups_lang.php | 37 +++ application/language/ro/common_lang.php | 4 +- application/language/ro/config_lang.php | 236 ++++++++++++++- application/language/ro/customers_lang.php | 53 ++++ application/language/ro/datepicker_lang.php | 23 ++ application/language/ro/employees_lang.php | 37 +++ application/language/ro/enum_lang.php | 9 + application/language/ro/error_lang.php | 4 + .../language/ro/expenses_categories_lang.php | 21 ++ application/language/ro/expenses_lang.php | 45 +++ application/language/ro/giftcards_lang.php | 70 +++++ application/language/ro/item_kits_lang.php | 35 +++ application/language/ro/items_lang.php | 111 +++++++ application/language/ro/login_lang.php | 10 + application/language/ro/messages_lang.php | 14 + application/language/ro/module_lang.php | 41 +++ application/language/ro/receivings_lang.php | 54 ++++ application/language/ro/reports_lang.php | 127 ++++++++ application/language/ro/sales_lang.php | 165 +++++++++++ application/language/ro/suppliers_lang.php | 19 ++ application/language/ro/taxes_lang.php | 32 ++ application/language/ru/attributes_lang.php | 2 +- application/language/ru/cashups_lang.php | 37 +++ application/language/ru/config_lang.php | 11 + application/language/ru/customers_lang.php | 3 + application/language/ru/datepicker_lang.php | 1 + .../language/ru/expenses_categories_lang.php | 1 + application/language/ru/item_kits_lang.php | 3 + application/language/ru/items_lang.php | 5 + application/language/ru/module_lang.php | 2 + application/language/ru/receivings_lang.php | 1 + application/language/ru/reports_lang.php | 4 + application/language/sv/attributes_lang.php | 2 +- application/language/sv/cashups_lang.php | 37 +++ application/language/sv/config_lang.php | 11 + application/language/sv/customers_lang.php | 3 + application/language/sv/datepicker_lang.php | 1 + .../language/sv/expenses_categories_lang.php | 1 + application/language/sv/item_kits_lang.php | 3 + application/language/sv/items_lang.php | 5 + application/language/sv/module_lang.php | 2 + application/language/sv/receivings_lang.php | 1 + application/language/sv/reports_lang.php | 4 + application/language/th/attributes_lang.php | 2 +- application/language/th/cashups_lang.php | 37 +++ application/language/th/common_lang.php | 3 +- application/language/th/config_lang.php | 11 + application/language/th/customers_lang.php | 3 + application/language/th/datepicker_lang.php | 1 + application/language/th/enum_lang.php | 3 +- .../language/th/expenses_categories_lang.php | 1 + application/language/th/expenses_lang.php | 3 +- application/language/th/item_kits_lang.php | 3 + application/language/th/items_lang.php | 5 + application/language/th/module_lang.php | 2 + application/language/th/receivings_lang.php | 1 + application/language/th/reports_lang.php | 4 + application/language/tr/attributes_lang.php | 2 +- application/language/tr/cashups_lang.php | 37 +++ application/language/tr/config_lang.php | 11 + application/language/tr/customers_lang.php | 3 + application/language/tr/datepicker_lang.php | 1 + .../language/tr/expenses_categories_lang.php | 1 + application/language/tr/item_kits_lang.php | 3 + application/language/tr/items_lang.php | 5 + application/language/tr/module_lang.php | 2 + application/language/tr/receivings_lang.php | 1 + application/language/tr/reports_lang.php | 4 + application/language/vi/attributes_lang.php | 25 ++ application/language/vi/cashups_lang.php | 37 +++ application/language/vi/config_lang.php | 1 + application/language/vi/customers_lang.php | 3 + application/language/vi/datepicker_lang.php | 1 + .../language/vi/expenses_categories_lang.php | 1 + application/language/vi/item_kits_lang.php | 3 + application/language/vi/items_lang.php | 7 +- application/language/vi/module_lang.php | 4 + application/language/vi/receivings_lang.php | 1 + application/language/vi/reports_lang.php | 4 + application/language/zh/attributes_lang.php | 2 +- application/language/zh/cashups_lang.php | 37 +++ application/language/zh/config_lang.php | 11 + application/language/zh/customers_lang.php | 3 + application/language/zh/datepicker_lang.php | 1 + .../language/zh/expenses_categories_lang.php | 1 + application/language/zh/item_kits_lang.php | 3 + application/language/zh/items_lang.php | 5 + application/language/zh/module_lang.php | 2 + application/language/zh/receivings_lang.php | 1 + application/language/zh/reports_lang.php | 4 + application/views/items/form.php | 1 - 316 files changed, 4161 insertions(+), 113 deletions(-) create mode 100644 application/language/ar-EG/cashups_lang.php create mode 100644 application/language/az-AZ/cashups_lang.php create mode 100644 application/language/bg/attributes_lang.php create mode 100644 application/language/bg/cashups_lang.php create mode 100644 application/language/cs/attributes_lang.php create mode 100644 application/language/cs/cashups_lang.php create mode 100644 application/language/de-CH/cashups_lang.php create mode 100644 application/language/de/cashups_lang.php create mode 100644 application/language/el/attributes_lang.php create mode 100644 application/language/el/bootstrap_tables_lang.php create mode 100644 application/language/el/cashups_lang.php create mode 100644 application/language/el/config_lang.php create mode 100644 application/language/el/datepicker_lang.php create mode 100644 application/language/el/employees_lang.php create mode 100644 application/language/el/enum_lang.php create mode 100644 application/language/el/error_lang.php create mode 100644 application/language/el/expenses_categories_lang.php create mode 100644 application/language/el/expenses_lang.php create mode 100644 application/language/el/giftcards_lang.php create mode 100644 application/language/el/item_kits_lang.php create mode 100644 application/language/el/items_lang.php create mode 100644 application/language/el/login_lang.php create mode 100644 application/language/el/messages_lang.php create mode 100644 application/language/el/module_lang.php create mode 100644 application/language/el/receivings_lang.php create mode 100644 application/language/el/reports_lang.php create mode 100644 application/language/el/sales_lang.php create mode 100644 application/language/el/suppliers_lang.php create mode 100644 application/language/el/taxes_lang.php create mode 100644 application/language/es/cashups_lang.php create mode 100644 application/language/fr/cashups_lang.php create mode 100644 application/language/hr-HR/cashups_lang.php create mode 100644 application/language/hu-HU/cashups_lang.php create mode 100644 application/language/id/cashups_lang.php create mode 100644 application/language/it/attributes_lang.php create mode 100644 application/language/it/cashups_lang.php create mode 100644 application/language/km/attributes_lang.php create mode 100644 application/language/km/cashups_lang.php create mode 100644 application/language/lo/attributes_lang.php create mode 100644 application/language/lo/cashups_lang.php create mode 100644 application/language/nl-BE/cashups_lang.php create mode 100644 application/language/nl/attributes_lang.php create mode 100644 application/language/nl/cashups_lang.php create mode 100644 application/language/pt-BR/cashups_lang.php create mode 100644 application/language/ro/attributes_lang.php create mode 100644 application/language/ro/cashups_lang.php create mode 100644 application/language/ro/customers_lang.php create mode 100644 application/language/ro/datepicker_lang.php create mode 100644 application/language/ro/employees_lang.php create mode 100644 application/language/ro/enum_lang.php create mode 100644 application/language/ro/error_lang.php create mode 100644 application/language/ro/expenses_categories_lang.php create mode 100644 application/language/ro/expenses_lang.php create mode 100644 application/language/ro/giftcards_lang.php create mode 100644 application/language/ro/item_kits_lang.php create mode 100644 application/language/ro/items_lang.php create mode 100644 application/language/ro/login_lang.php create mode 100644 application/language/ro/messages_lang.php create mode 100644 application/language/ro/module_lang.php create mode 100644 application/language/ro/receivings_lang.php create mode 100644 application/language/ro/reports_lang.php create mode 100644 application/language/ro/sales_lang.php create mode 100644 application/language/ro/suppliers_lang.php create mode 100644 application/language/ro/taxes_lang.php create mode 100644 application/language/ru/cashups_lang.php create mode 100644 application/language/sv/cashups_lang.php create mode 100644 application/language/th/cashups_lang.php create mode 100644 application/language/tr/cashups_lang.php create mode 100644 application/language/vi/attributes_lang.php create mode 100644 application/language/vi/cashups_lang.php create mode 100644 application/language/zh/cashups_lang.php diff --git a/application/language/ar-EG/attributes_lang.php b/application/language/ar-EG/attributes_lang.php index 9008114b6..30bdd17e8 100644 --- a/application/language/ar-EG/attributes_lang.php +++ b/application/language/ar-EG/attributes_lang.php @@ -1,9 +1,9 @@ 'low_sell_item_name', 'id'=>'low_sell_item_name', 'class'=>'form-control input-sm', - 'size'=>'50', 'value'=>$selected_low_sell_item) ); ?> From 667c4e2afed2ca5d295079754e49dc2cbe620b1c Mon Sep 17 00:00:00 2001 From: jekkos Date: Thu, 20 Sep 2018 00:35:20 +0200 Subject: [PATCH 304/568] Fix values when using multiple attribute columns (#68) --- application/controllers/Reports.php | 4 ++-- application/models/reports/Detailed_receivings.php | 1 + application/models/reports/Detailed_sales.php | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/application/controllers/Reports.php b/application/controllers/Reports.php index 3e41b13d9..807ce314e 100644 --- a/application/controllers/Reports.php +++ b/application/controllers/Reports.php @@ -1262,8 +1262,8 @@ class Reports extends Secure_Controller to_currency($drow['total']), to_currency($drow['cost']), to_currency($drow['profit']), - ($drow['discount_type'] == PERCENT)? $drow['discount'].'%':to_currency($drow['discount']), - explode('|', (isset($drow['attribute_values'])) ? $drow['attribute_values'] : "")))); + ($drow['discount_type'] == PERCENT)? $drow['discount'].'%':to_currency($drow['discount'])), + explode('|', (isset($drow['attribute_values'])) ? $drow['attribute_values'] : ""))); } if(isset($report_data['rewards'][$key])) diff --git a/application/models/reports/Detailed_receivings.php b/application/models/reports/Detailed_receivings.php index b5eb1bdd7..748d88042 100644 --- a/application/models/reports/Detailed_receivings.php +++ b/application/models/reports/Detailed_receivings.php @@ -106,6 +106,7 @@ class Detailed_receivings extends Report $this->db->join('attribute_links', 'attribute_links.item_id = items.item_id AND attribute_links.receiving_id = receivings_items_temp.receiving_id AND definition_id IN (' . implode(',', $inputs['definition_ids']) . ')', 'left'); $this->db->join('attribute_values', 'attribute_values.attribute_id = attribute_links.attribute_id', 'left'); $this->db->order_by('definition_id'); + $this->db->group_by('receivings_items_temp.receiving_id'); } $this->db->where('receivings_items_temp.receiving_id', $value['receiving_id']); $data['details'][$key] = $this->db->get()->result_array(); diff --git a/application/models/reports/Detailed_sales.php b/application/models/reports/Detailed_sales.php index 209cca4f8..3c929b46f 100644 --- a/application/models/reports/Detailed_sales.php +++ b/application/models/reports/Detailed_sales.php @@ -152,9 +152,11 @@ class Detailed_sales extends Report $this->db->join('attribute_links', 'attribute_links.item_id = sales_items_temp.item_id AND attribute_links.sale_id = sales_items_temp.sale_id AND definition_id IN (' . implode(',', $inputs['definition_ids']) . ')', 'left'); $this->db->join('attribute_values', 'attribute_values.attribute_id = attribute_links.attribute_id', 'left'); $this->db->order_by('definition_id'); + $this->db->group_by('sales_items_temp.sale_id'); } $this->db->where('sales_items_temp.sale_id', $value['sale_id']); $data['details'][$key] = $this->db->get()->result_array(); + $this->db->select('used, earned'); $this->db->from('sales_reward_points'); $this->db->where('sale_id', $value['sale_id']); From 9cdfc0ce8a5c8a272161c3db28ff19a73623b631 Mon Sep 17 00:00:00 2001 From: jekkos Date: Sun, 23 Sep 2018 01:47:14 +0200 Subject: [PATCH 305/568] Fix css overflow + form refresh --- application/controllers/Items.php | 19 ++++++++++++++++++- application/helpers/tabular_helper.php | 14 ++++++++++---- application/models/Item.php | 3 +-- .../models/reports/Detailed_receivings.php | 5 ++--- application/models/reports/Detailed_sales.php | 5 ++--- application/views/attributes/form.php | 1 - application/views/attributes/item.php | 12 +++++------- application/views/items/form.php | 4 +++- 8 files changed, 41 insertions(+), 22 deletions(-) diff --git a/application/controllers/Items.php b/application/controllers/Items.php index be843fc00..c3a50ae09 100644 --- a/application/controllers/Items.php +++ b/application/controllers/Items.php @@ -397,8 +397,25 @@ class Items extends Secure_Controller $data['definition_values'] = $this->Attribute->get_attributes_by_item($item_id) + $this->Attribute->get_values_by_definitions($definition_ids); $data['definition_names'] = $this->Attribute->get_definition_names(); - foreach($data['definition_values'] as $definition_id => $attribute_value) + foreach($data['definition_values'] as $definition_id => $definition_value) { + $attribute_value = $this->Attribute->get_attribute_value($item_id, $definition_id); + $attribute_id = (empty($attribute_value) || empty($attribute_value->attribute_id)) ? NULL : $attribute_value->attribute_id; + $values = &$data['definition_values'][$definition_id]; + $values['attribute_id'] = $attribute_id; + $values['attribute_value'] = $attribute_value; + + if ($definition_value['definition_type'] == DROPDOWN) + { + $values['values'] = $this->Attribute->get_definition_values($definition_id); + $values['selected_value'] = $this->Attribute->get_link_value($item_id, $definition_id); + } + + if (!empty($definition_ids[$definition_id])) + { + $values['selected_value'] = $definition_ids[$definition_id]; + } + unset($data['definition_names'][$definition_id]); } diff --git a/application/helpers/tabular_helper.php b/application/helpers/tabular_helper.php index 36ab83302..c61fb9205 100644 --- a/application/helpers/tabular_helper.php +++ b/application/helpers/tabular_helper.php @@ -340,7 +340,7 @@ function get_items_manage_table_headers() foreach($definition_names as $definition_id => $definition_name) { - $headers[] = array($definition_name => $definition_name); + $headers[] = array($definition_id => $definition_name); } return transform_headers($headers); @@ -411,12 +411,18 @@ function get_item_data_row($item) array('class' => 'modal-dlg', 'data-btn-submit' => $CI->lang->line('common_submit'), 'title' => $CI->lang->line($controller_name.'_update')) )); - $attribute_values = explode(',', (property_exists($item, 'attribute_values')) ? $item->attribute_values : ""); + $attribute_values = explode('|', (property_exists($item, 'attribute_values')) ? $item->attribute_values : ""); + + $indexed_values = array(); + foreach($attribute_values as $attribute_value) + { + $exploded_value = explode(':', $attribute_value); + $indexed_values[$exploded_value[0]] = $exploded_value[1]; + } foreach($definition_names as $definition_id => $definition_name) { - $result[$definition_name] = array_shift($attribute_values); - + $result[$definition_id] = $indexed_values[$definition_id]; } return $result; diff --git a/application/models/Item.php b/application/models/Item.php index 7d95bd3f7..d66bcb6f0 100644 --- a/application/models/Item.php +++ b/application/models/Item.php @@ -193,10 +193,9 @@ class Item extends CI_Model } else if (count($filters['definition_ids']) > 0) { - $this->db->select('GROUP_CONCAT(attribute_value) AS attribute_values'); + $this->db->select('GROUP_CONCAT(DISTINCT CONCAT_WS(\':\', definition_id, attribute_value) ORDER BY definition_id SEPARATOR \'|\') AS attribute_values'); $this->db->join('attribute_links', 'attribute_links.item_id = items.item_id AND attribute_links.receiving_id IS NULL AND attribute_links.sale_id IS NULL AND definition_id IN (' . implode(',', $filters['definition_ids']) . ')', 'left'); $this->db->join('attribute_values', 'attribute_values.attribute_id = attribute_links.attribute_id', 'left'); - $this->db->order_by('definition_id'); } $this->db->where('items.deleted', $filters['is_deleted']); diff --git a/application/models/reports/Detailed_receivings.php b/application/models/reports/Detailed_receivings.php index 748d88042..0a3038115 100644 --- a/application/models/reports/Detailed_receivings.php +++ b/application/models/reports/Detailed_receivings.php @@ -102,10 +102,9 @@ class Detailed_receivings extends Report $this->db->join('items', 'receivings_items_temp.item_id = items.item_id'); if (count($inputs['definition_ids']) > 0) { - $this->db->select('GROUP_CONCAT(attribute_value SEPARATOR \'|\') AS attribute_values'); + $this->db->select('GROUP_CONCAT(DISTINCT attribute_value ORDER BY definition_id SEPARATOR \'|\') AS attribute_values'); $this->db->join('attribute_links', 'attribute_links.item_id = items.item_id AND attribute_links.receiving_id = receivings_items_temp.receiving_id AND definition_id IN (' . implode(',', $inputs['definition_ids']) . ')', 'left'); - $this->db->join('attribute_values', 'attribute_values.attribute_id = attribute_links.attribute_id', 'left'); - $this->db->order_by('definition_id'); + $this->db->join('attribute_values', 'attribute_values.attribute_id = attribute_links.attribute_id'); $this->db->group_by('receivings_items_temp.receiving_id'); } $this->db->where('receivings_items_temp.receiving_id', $value['receiving_id']); diff --git a/application/models/reports/Detailed_sales.php b/application/models/reports/Detailed_sales.php index 3c929b46f..efcf2ed1b 100644 --- a/application/models/reports/Detailed_sales.php +++ b/application/models/reports/Detailed_sales.php @@ -148,10 +148,9 @@ class Detailed_sales extends Report $this->db->from('sales_items_temp'); if (count($inputs['definition_ids']) > 0) { - $this->db->select('GROUP_CONCAT(attribute_value SEPARATOR \'|\') AS attribute_values'); + $this->db->select('GROUP_CONCAT(DISTINCT attribute_value ORDER BY definition_id SEPARATOR \'|\') AS attribute_values'); $this->db->join('attribute_links', 'attribute_links.item_id = sales_items_temp.item_id AND attribute_links.sale_id = sales_items_temp.sale_id AND definition_id IN (' . implode(',', $inputs['definition_ids']) . ')', 'left'); - $this->db->join('attribute_values', 'attribute_values.attribute_id = attribute_links.attribute_id', 'left'); - $this->db->order_by('definition_id'); + $this->db->join('attribute_values', 'attribute_values.attribute_id = attribute_links.attribute_id'); $this->db->group_by('sales_items_temp.sale_id'); } $this->db->where('sales_items_temp.sale_id', $value['sale_id']); diff --git a/application/views/attributes/form.php b/application/views/attributes/form.php index f2e5a9d1c..0562e8b77 100644 --- a/application/views/attributes/form.php +++ b/application/views/attributes/form.php @@ -65,7 +65,6 @@ //validation and submit handling $(document).ready(function() { - $('.modal-body').css('overflow-y', 'visible'); var values = []; var definition_id = ; var is_new = definition_id == -1; diff --git a/application/views/attributes/item.php b/application/views/attributes/item.php index 7b8e90484..42748f160 100644 --- a/application/views/attributes/item.php +++ b/application/views/attributes/item.php @@ -18,10 +18,9 @@ foreach($definition_values as $definition_id => $definition_value)
          Attribute->get_attribute_value($item_id, $definition_id); - $attribute_id = (empty($attribute_value) || empty($attribute_value->attribute_id)) ? NULL : $attribute_value->attribute_id; - echo form_hidden("attribute_ids[$definition_id]", $attribute_id); + echo form_hidden("attribute_ids[$definition_id]", $definition_value['attribute_id']); + $attribute_value = $definition_value['attribute_value']; if ($definition_value['definition_type'] == DATETIME) { $value = (empty($attribute_value) || empty($attribute_value->attribute_datetime)) ? DEFAULT_DATETIME : strtotime($attribute_value->attribute_datetime); @@ -34,13 +33,12 @@ foreach($definition_values as $definition_id => $definition_value) } 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("attribute_links[$definition_id]", $values, (empty($selected_value) ? NULL : $selected_value->attribute_id), "class='form-control' data-definition-id='$definition_id'"); + $selected_value = empty($selected_value) ? $definition_value['selected_value'] : $selected_value->attribute_id; + echo form_dropdown("attribute_links[$definition_id]", $definition_value['values'], $selected_value, "class='form-control' data-definition-id='$definition_id'"); } else if ($definition_value['definition_type'] == TEXT) { - $value = (empty($attribute_value) || empty($attribute_value->attribute_value)) ? NULL : $attribute_value->attribute_value; + $value = (empty($attribute_value) || empty($attribute_value->attribute_value)) ? $definition_value['selected_value'] : $attribute_value->attribute_value; echo form_input("attribute_links[$definition_id]", $value, "class='form-control' data-definition-id='$definition_id'"); } ?> diff --git a/application/views/items/form.php b/application/views/items/form.php index 9cd9c634e..fd16a9a97 100644 --- a/application/views/items/form.php +++ b/application/views/items/form.php @@ -47,7 +47,9 @@
          - load->view('attributes/item', array('item_id' => $item_info->item_id)); ?> +
          From b9cba20d84ce50b6d3b761443db612a2bb0bccf8 Mon Sep 17 00:00:00 2001 From: jekkos Date: Tue, 25 Sep 2018 00:07:43 +0200 Subject: [PATCH 306/568] Fix items row refresh (#68) --- application/models/Item.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/Item.php b/application/models/Item.php index d66bcb6f0..f1eab15b8 100644 --- a/application/models/Item.php +++ b/application/models/Item.php @@ -377,7 +377,7 @@ class Item extends CI_Model { $this->db->select('items.*'); $this->db->select('company_name'); - $this->db->select('GROUP_CONCAT(attribute_value SEPARATOR \'|\') AS attribute_values'); + $this->db->select('GROUP_CONCAT(DISTINCT CONCAT_WS(\':\', definition_id, attribute_value) ORDER BY definition_id SEPARATOR \'|\') AS attribute_values'); $this->db->select('category'); $this->db->select('quantity'); $this->db->from('items'); From 74f31dbaf9f6c80d60cdef7e2fee5f10d31d1884 Mon Sep 17 00:00:00 2001 From: jekkos Date: Tue, 25 Sep 2018 00:15:38 +0200 Subject: [PATCH 307/568] Keep unsaved attributes when adding multiple (#68) --- application/views/attributes/item.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/application/views/attributes/item.php b/application/views/attributes/item.php index 42748f160..7c580207a 100644 --- a/application/views/attributes/item.php +++ b/application/views/attributes/item.php @@ -58,6 +58,7 @@ foreach($definition_values as $definition_id => $definition_value) var enable_delete = function() { $('.remove_attribute_btn').click(function() { $(this).parents('.form-group').remove(); + refresh(); }); }; @@ -82,20 +83,25 @@ foreach($definition_values as $definition_id => $definition_value) var definition_values = function() { var result = {}; - $("input[name*='attribute_links'").each(function(index, element) { + $("[name*='attribute_links'").each(function() { var definition_id = $(this).data('definition-id'); - result[definition_id] = $(element).val(); + result[definition_id] = $(this).val(); + }); return result; - } + }; - $('#definition_name').change(function() { + var refresh = function() { + var definition_id = $("#definition_name option:selected").val(); var attribute_values = definition_values(); - var definition_id = $("option:selected", this).val(); attribute_values[definition_id] = ''; $('#attributes').load('', { 'definition_ids': JSON.stringify(attribute_values) }, enable_delete); + }; + + $('#definition_name').change(function() { + refresh(); }); })(); From 43e3400468ff1a6ef2318b753287fbf12b3fdfae Mon Sep 17 00:00:00 2001 From: jekkos Date: Fri, 28 Sep 2018 20:26:52 +0200 Subject: [PATCH 308/568] Fix item row refresh (#68) --- application/models/Item.php | 2 +- application/views/attributes/item.php | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/application/models/Item.php b/application/models/Item.php index f1eab15b8..f3953026b 100644 --- a/application/models/Item.php +++ b/application/models/Item.php @@ -383,7 +383,7 @@ class Item extends CI_Model $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('attribute_links', 'attribute_links.item_id = items.item_id', 'left'); + $this->db->join('attribute_links', 'attribute_links.item_id = items.item_id AND sale_id IS NULL AND receiving_id IS NULL', 'left'); $this->db->join('attribute_values', 'attribute_links.attribute_id = attribute_values.attribute_id', 'left'); $this->db->where('location_id', $location_id); $this->db->where_in('items.item_id', $item_ids); diff --git a/application/views/attributes/item.php b/application/views/attributes/item.php index 7c580207a..fdc3bad3d 100644 --- a/application/views/attributes/item.php +++ b/application/views/attributes/item.php @@ -58,7 +58,6 @@ foreach($definition_values as $definition_id => $definition_value) var enable_delete = function() { $('.remove_attribute_btn').click(function() { $(this).parents('.form-group').remove(); - refresh(); }); }; From 7683cfe5c9d2990e35ae161ffb20dc3b824df5e1 Mon Sep 17 00:00:00 2001 From: jekkos Date: Fri, 28 Sep 2018 20:35:38 +0200 Subject: [PATCH 309/568] Fix dropdown preselection on edit (#68) --- application/controllers/Items.php | 2 +- application/views/attributes/item.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/controllers/Items.php b/application/controllers/Items.php index c3a50ae09..c89d713a8 100644 --- a/application/controllers/Items.php +++ b/application/controllers/Items.php @@ -408,7 +408,7 @@ class Items extends Secure_Controller if ($definition_value['definition_type'] == DROPDOWN) { $values['values'] = $this->Attribute->get_definition_values($definition_id); - $values['selected_value'] = $this->Attribute->get_link_value($item_id, $definition_id); + $values['selected_value'] = $this->Attribute->get_link_value($item_id, $definition_id)->attribute_id; } if (!empty($definition_ids[$definition_id])) diff --git a/application/views/attributes/item.php b/application/views/attributes/item.php index fdc3bad3d..7be6db019 100644 --- a/application/views/attributes/item.php +++ b/application/views/attributes/item.php @@ -33,7 +33,7 @@ foreach($definition_values as $definition_id => $definition_value) } else if ($definition_value['definition_type'] == DROPDOWN) { - $selected_value = empty($selected_value) ? $definition_value['selected_value'] : $selected_value->attribute_id; + $selected_value = $definition_value['selected_value']; echo form_dropdown("attribute_links[$definition_id]", $definition_value['values'], $selected_value, "class='form-control' data-definition-id='$definition_id'"); } else if ($definition_value['definition_type'] == TEXT) From 8e58d57ab3ffb21ffc0f84ddb424ad6e19576206 Mon Sep 17 00:00:00 2001 From: jekkos Date: Fri, 28 Sep 2018 22:01:50 +0200 Subject: [PATCH 310/568] Fix line count in detailed sales/receivings reports (#68) --- application/models/reports/Detailed_receivings.php | 2 +- application/models/reports/Detailed_sales.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/models/reports/Detailed_receivings.php b/application/models/reports/Detailed_receivings.php index 0a3038115..83aa611bc 100644 --- a/application/models/reports/Detailed_receivings.php +++ b/application/models/reports/Detailed_receivings.php @@ -105,7 +105,7 @@ class Detailed_receivings extends Report $this->db->select('GROUP_CONCAT(DISTINCT attribute_value ORDER BY definition_id SEPARATOR \'|\') AS attribute_values'); $this->db->join('attribute_links', 'attribute_links.item_id = items.item_id AND attribute_links.receiving_id = receivings_items_temp.receiving_id AND definition_id IN (' . implode(',', $inputs['definition_ids']) . ')', 'left'); $this->db->join('attribute_values', 'attribute_values.attribute_id = attribute_links.attribute_id'); - $this->db->group_by('receivings_items_temp.receiving_id'); + $this->db->group_by('receivings_items_temp.receiving_id, receivings_items_temp.item_id'); } $this->db->where('receivings_items_temp.receiving_id', $value['receiving_id']); $data['details'][$key] = $this->db->get()->result_array(); diff --git a/application/models/reports/Detailed_sales.php b/application/models/reports/Detailed_sales.php index efcf2ed1b..2fbb6316e 100644 --- a/application/models/reports/Detailed_sales.php +++ b/application/models/reports/Detailed_sales.php @@ -151,7 +151,7 @@ class Detailed_sales extends Report $this->db->select('GROUP_CONCAT(DISTINCT attribute_value ORDER BY definition_id SEPARATOR \'|\') AS attribute_values'); $this->db->join('attribute_links', 'attribute_links.item_id = sales_items_temp.item_id AND attribute_links.sale_id = sales_items_temp.sale_id AND definition_id IN (' . implode(',', $inputs['definition_ids']) . ')', 'left'); $this->db->join('attribute_values', 'attribute_values.attribute_id = attribute_links.attribute_id'); - $this->db->group_by('sales_items_temp.sale_id'); + $this->db->group_by('sales_items_temp.sale_id, sales_items_temp.item_id'); } $this->db->where('sales_items_temp.sale_id', $value['sale_id']); $data['details'][$key] = $this->db->get()->result_array(); From 9570cb8b28f9e73b3522d1498835a14d2cd60e87 Mon Sep 17 00:00:00 2001 From: jekkos Date: Sat, 29 Sep 2018 16:52:59 +0200 Subject: [PATCH 311/568] Fix offset warning (#68) --- application/helpers/tabular_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/helpers/tabular_helper.php b/application/helpers/tabular_helper.php index c61fb9205..827c4bcff 100644 --- a/application/helpers/tabular_helper.php +++ b/application/helpers/tabular_helper.php @@ -422,7 +422,7 @@ function get_item_data_row($item) foreach($definition_names as $definition_id => $definition_name) { - $result[$definition_id] = $indexed_values[$definition_id]; + $result[$definition_id] = isset($indexed_values[$definition_id]) ? $indexed_values[$definition_id] : ''; } return $result; From 6fc2072967f0a903129fcb582b36f71531d51ca0 Mon Sep 17 00:00:00 2001 From: jekkos Date: Sat, 29 Sep 2018 17:26:45 +0200 Subject: [PATCH 312/568] Fix attribute search (#68) --- application/models/Item.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/models/Item.php b/application/models/Item.php index f3953026b..cd87a9459 100644 --- a/application/models/Item.php +++ b/application/models/Item.php @@ -186,8 +186,9 @@ class Item extends CI_Model } else { + $this->db->select('GROUP_CONCAT(DISTINCT CONCAT_WS(\':\', definition_id, attribute_value) ORDER BY definition_id SEPARATOR \'|\') AS attribute_values'); $this->db->like('attribute_value', $search); - $this->db->join('attribute_links', 'attribute_links.item_id = items.item_id'); + $this->db->join('attribute_links', 'attribute_links.item_id = items.item_id AND sale_id IS NULL AND receiving_id IS NULL'); $this->db->join('attribute_values', 'attribute_links.attribute_id = attribute_values.attribute_id'); } } From abc067a10b94070a8083873089447fa46b4b9952 Mon Sep 17 00:00:00 2001 From: jekkos Date: Sat, 29 Sep 2018 17:57:12 +0200 Subject: [PATCH 313/568] Fix development mode warning (#68) --- application/controllers/Items.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/controllers/Items.php b/application/controllers/Items.php index c89d713a8..d557b3cef 100644 --- a/application/controllers/Items.php +++ b/application/controllers/Items.php @@ -408,7 +408,8 @@ class Items extends Secure_Controller if ($definition_value['definition_type'] == DROPDOWN) { $values['values'] = $this->Attribute->get_definition_values($definition_id); - $values['selected_value'] = $this->Attribute->get_link_value($item_id, $definition_id)->attribute_id; + $link_value = $this->Attribute->get_link_value($item_id, $definition_id); + $values['selected_value'] = (empty($link_value)) ? '' : $link_value->attribute_id; } if (!empty($definition_ids[$definition_id])) From 9c863e7795ec3202944a0bcf7397b791c97e1eda Mon Sep 17 00:00:00 2001 From: jekkos Date: Sat, 29 Sep 2018 20:11:16 +0200 Subject: [PATCH 314/568] Fix undefined offset error in devmode (#68) --- application/helpers/tabular_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/helpers/tabular_helper.php b/application/helpers/tabular_helper.php index 827c4bcff..eb98d15e4 100644 --- a/application/helpers/tabular_helper.php +++ b/application/helpers/tabular_helper.php @@ -417,7 +417,7 @@ function get_item_data_row($item) foreach($attribute_values as $attribute_value) { $exploded_value = explode(':', $attribute_value); - $indexed_values[$exploded_value[0]] = $exploded_value[1]; + $indexed_values[$exploded_value[0]] = isset($exploded_value[1]) ? $exploded_value[1] : ''; } foreach($definition_names as $definition_id => $definition_name) From a7bc09312d7f3e441c50a7cfab9f5a3fb0744e9e Mon Sep 17 00:00:00 2001 From: jekkos Date: Sat, 29 Sep 2018 22:10:15 +0200 Subject: [PATCH 315/568] Update migration script (#68) --- .../migrations/sqlscripts/attributes.sql | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/application/migrations/sqlscripts/attributes.sql b/application/migrations/sqlscripts/attributes.sql index d213e2acc..8d475c34d 100644 --- a/application/migrations/sqlscripts/attributes.sql +++ b/application/migrations/sqlscripts/attributes.sql @@ -88,86 +88,86 @@ INSERT INTO ospos_attribute_links (definition_id, item_id) SELECT definition_id, 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; +INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom1 FROM ospos_items WHERE custom1 <> '' AND '' <> (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom1_name'); +INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom2 FROM ospos_items WHERE custom2 <> '' AND '' <> (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom2_name'); +INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom3 FROM ospos_items WHERE custom3 <> '' AND '' <> (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom3_name'); +INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom4 FROM ospos_items WHERE custom4 <> '' AND '' <> (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom4_name'); +INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom5 FROM ospos_items WHERE custom5 <> '' AND '' <> (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom5_name'); +INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom6 FROM ospos_items WHERE custom6 <> '' AND '' <> (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom6_name'); +INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom7 FROM ospos_items WHERE custom7 <> '' AND '' <> (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom7_name'); +INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom8 FROM ospos_items WHERE custom8 <> '' AND '' <> (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom8_name'); +INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom9 FROM ospos_items WHERE custom9 <> '' AND '' <> (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom9_name'); +INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom10 FROM ospos_items WHERE custom10 <> '' AND '' <> (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom10_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 = 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')); + WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom1_name' AND `value` IS NOT NULL)); 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')); + WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom2_name' AND `value` IS NOT NULL)); 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')); + WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom3_name' AND `value` IS NOT NULL)); 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')); + WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom4_name' AND `value` IS NOT NULL)); 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')); + WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom5_name' AND `value` IS NOT NULL)); 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')); + WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom6_name' AND `value` IS NOT NULL)); 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')); + WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom7_name' AND `value` IS NOT NULL)); 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')); + WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom8_name' AND `value` IS NOT NULL)); 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')); + WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom9_name' AND `value` IS NOT NULL)); 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')); + WHERE definition_name = (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom10_name' AND `value` IS NOT NULL)); ALTER TABLE `ospos_items` DROP COLUMN `custom1`, From 9c5ec71c19c4c9bb94fc20b64e387027861cdac5 Mon Sep 17 00:00:00 2001 From: jekkos Date: Mon, 1 Oct 2018 23:30:00 +0200 Subject: [PATCH 316/568] Show line in detailed reports if no attribute value (#68) --- application/models/reports/Detailed_receivings.php | 4 ++-- application/models/reports/Detailed_sales.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/application/models/reports/Detailed_receivings.php b/application/models/reports/Detailed_receivings.php index 83aa611bc..261cbff61 100644 --- a/application/models/reports/Detailed_receivings.php +++ b/application/models/reports/Detailed_receivings.php @@ -102,9 +102,9 @@ class Detailed_receivings extends Report $this->db->join('items', 'receivings_items_temp.item_id = items.item_id'); if (count($inputs['definition_ids']) > 0) { - $this->db->select('GROUP_CONCAT(DISTINCT attribute_value ORDER BY definition_id SEPARATOR \'|\') AS attribute_values'); + $this->db->select('GROUP_CONCAT(DISTINCT IFNULL(attribute_value, \'-\') ORDER BY definition_id SEPARATOR \'|\') AS attribute_values'); $this->db->join('attribute_links', 'attribute_links.item_id = items.item_id AND attribute_links.receiving_id = receivings_items_temp.receiving_id AND definition_id IN (' . implode(',', $inputs['definition_ids']) . ')', 'left'); - $this->db->join('attribute_values', 'attribute_values.attribute_id = attribute_links.attribute_id'); + $this->db->join('attribute_values', 'attribute_values.attribute_id = attribute_links.attribute_id', 'left'); $this->db->group_by('receivings_items_temp.receiving_id, receivings_items_temp.item_id'); } $this->db->where('receivings_items_temp.receiving_id', $value['receiving_id']); diff --git a/application/models/reports/Detailed_sales.php b/application/models/reports/Detailed_sales.php index 2fbb6316e..e3caff0b2 100644 --- a/application/models/reports/Detailed_sales.php +++ b/application/models/reports/Detailed_sales.php @@ -148,9 +148,9 @@ class Detailed_sales extends Report $this->db->from('sales_items_temp'); if (count($inputs['definition_ids']) > 0) { - $this->db->select('GROUP_CONCAT(DISTINCT attribute_value ORDER BY definition_id SEPARATOR \'|\') AS attribute_values'); + $this->db->select('GROUP_CONCAT(DISTINCT IFNULL(attribute_value, \'-\') ORDER BY definition_id SEPARATOR \'|\') AS attribute_values'); $this->db->join('attribute_links', 'attribute_links.item_id = sales_items_temp.item_id AND attribute_links.sale_id = sales_items_temp.sale_id AND definition_id IN (' . implode(',', $inputs['definition_ids']) . ')', 'left'); - $this->db->join('attribute_values', 'attribute_values.attribute_id = attribute_links.attribute_id'); + $this->db->join('attribute_values', 'attribute_values.attribute_id = attribute_links.attribute_id', 'left'); $this->db->group_by('sales_items_temp.sale_id, sales_items_temp.item_id'); } $this->db->where('sales_items_temp.sale_id', $value['sale_id']); From fd00a7422570efcd15fd154c44666e739bdcf33a Mon Sep 17 00:00:00 2001 From: jekkos Date: Tue, 9 Oct 2018 08:54:49 +0200 Subject: [PATCH 317/568] Refactor + fix detailed reports (#68) --- application/controllers/Items.php | 4 +++ application/controllers/Reports.php | 18 ++++++---- application/helpers/tabular_helper.php | 33 +++++++++++-------- .../language/en-GB/attributes_lang.php | 5 ++- .../language/en-US/attributes_lang.php | 5 ++- .../models/reports/Detailed_receivings.php | 2 +- application/models/reports/Detailed_sales.php | 2 +- application/views/attributes/form.php | 19 +++++++++-- application/views/attributes/item.php | 2 +- application/views/items/form.php | 4 +++ 10 files changed, 68 insertions(+), 26 deletions(-) diff --git a/application/controllers/Items.php b/application/controllers/Items.php index d557b3cef..51bdf61db 100644 --- a/application/controllers/Items.php +++ b/application/controllers/Items.php @@ -416,6 +416,10 @@ class Items extends Secure_Controller { $values['selected_value'] = $definition_ids[$definition_id]; } + else + { + $values['selected_value'] = ''; + } unset($data['definition_names'][$definition_id]); } diff --git a/application/controllers/Reports.php b/application/controllers/Reports.php index 807ce314e..7fe7760a7 100644 --- a/application/controllers/Reports.php +++ b/application/controllers/Reports.php @@ -1251,7 +1251,7 @@ class Reports extends Secure_Controller { $quantity_purchased .= ' [' . $this->Stock_location->get_location_name($drow['item_location']) . ']'; } - $details_data[$row['sale_id']][] = $this->xss_clean(array_merge(array( + $details_data[$row['sale_id']][] = $this->xss_clean(array( $drow['name'], $drow['category'], $drow['serialnumber'], @@ -1262,8 +1262,11 @@ class Reports extends Secure_Controller to_currency($drow['total']), to_currency($drow['cost']), to_currency($drow['profit']), - ($drow['discount_type'] == PERCENT)? $drow['discount'].'%':to_currency($drow['discount'])), - explode('|', (isset($drow['attribute_values'])) ? $drow['attribute_values'] : ""))); + ($drow['discount_type'] == PERCENT)? $drow['discount'].'%':to_currency($drow['discount']))); + + $attribute_values = (isset($drow['attribute_values'])) ? $drow['attribute_values'] : ''; + append_attribute_values($details_data[$row['sale_id']][0], $definition_names, $attribute_values); + $details_data[$row['sale_id']][0] = array_values($details_data[$row['sale_id']][0]); } if(isset($report_data['rewards'][$key])) @@ -1364,14 +1367,17 @@ class Reports extends Secure_Controller { $quantity_purchased .= ' [' . $this->Stock_location->get_location_name($drow['item_location']) . ']'; } - $details_data[$row['receiving_id']][] = $this->xss_clean(array_merge(array( + $details_data[$row['receiving_id']][] = $this->xss_clean(array( $drow['item_number'], $drow['name'], $drow['category'], $quantity_purchased, to_currency($drow['total']), - ($drow['discount_type'] == PERCENT)? $drow['discount'].'%':to_currency($drow['discount'])), - explode('|', (isset($drow['attribute_values'])) ? $drow['attribute_values'] : ""))); + ($drow['discount_type'] == PERCENT)? $drow['discount'].'%':to_currency($drow['discount']))); + + $attribute_values = (isset($drow['attribute_values'])) ? $drow['attribute_values'] : ''; + append_attribute_values($details_data[$row['receiving_id']][0], $definition_names, $attribute_values); + $details_data[$row['receiving_id']][0] = array_values($details_data[$row['receiving_id']][0]); } } diff --git a/application/helpers/tabular_helper.php b/application/helpers/tabular_helper.php index eb98d15e4..ebd24ced8 100644 --- a/application/helpers/tabular_helper.php +++ b/application/helpers/tabular_helper.php @@ -411,19 +411,8 @@ function get_item_data_row($item) array('class' => 'modal-dlg', 'data-btn-submit' => $CI->lang->line('common_submit'), 'title' => $CI->lang->line($controller_name.'_update')) )); - $attribute_values = explode('|', (property_exists($item, 'attribute_values')) ? $item->attribute_values : ""); - - $indexed_values = array(); - foreach($attribute_values as $attribute_value) - { - $exploded_value = explode(':', $attribute_value); - $indexed_values[$exploded_value[0]] = isset($exploded_value[1]) ? $exploded_value[1] : ''; - } - - foreach($definition_names as $definition_id => $definition_name) - { - $result[$definition_id] = isset($indexed_values[$definition_id]) ? $indexed_values[$definition_id] : ''; - } + $attribute_values = (property_exists($item, 'attribute_values')) ? $item->attribute_values : ""; + append_attribute_values($result, $definition_names, $attribute_values); return $result; } @@ -548,6 +537,24 @@ function get_item_kit_data_row($item_kit) )); } +function append_attribute_values(&$result, $definition_names, $attribute_values) +{ + $values = explode('|', $attribute_values); + + $indexed_values = array(); + foreach($values as $attribute_value) + { + $exploded_value = explode(':', $attribute_value); + $indexed_values[$exploded_value[0]] = isset($exploded_value[1]) ? $exploded_value[1] : '-'; + } + + foreach($definition_names as $definition_id => $definition_name) + { + $attribute_value = isset($indexed_values[$definition_id]) ? $indexed_values[$definition_id] : '-'; + $result[$definition_id] = $attribute_value; + } +} + function get_attribute_definition_manage_table_headers() { $CI =& get_instance(); diff --git a/application/language/en-GB/attributes_lang.php b/application/language/en-GB/attributes_lang.php index 59cc84a02..0da58a38f 100644 --- a/application/language/en-GB/attributes_lang.php +++ b/application/language/en-GB/attributes_lang.php @@ -5,7 +5,7 @@ $lang["attributes_definition_cannot_be_deleted"] = "Could not delete selected at $lang["attributes_definition_flags"] = "Attribute Visibility"; $lang["attributes_definition_group"] = "Group"; $lang["attributes_definition_id"] = "Id"; -$lang["attributes_definition_name"] = "Add Attribute"; +$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"; @@ -23,3 +23,6 @@ $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"; +$lang["attributes_definition_name_required"] = "Attribute name is a required field"; +$lang["attributes_definition_type_required"] = "Attriubte type is a required field"; +$lang["attributes_attribute_value_invalid_chars"] = "Attribute value cannot contain ':' or '|'"; diff --git a/application/language/en-US/attributes_lang.php b/application/language/en-US/attributes_lang.php index 59cc84a02..2d3c4bf84 100644 --- a/application/language/en-US/attributes_lang.php +++ b/application/language/en-US/attributes_lang.php @@ -5,7 +5,7 @@ $lang["attributes_definition_cannot_be_deleted"] = "Could not delete selected at $lang["attributes_definition_flags"] = "Attribute Visibility"; $lang["attributes_definition_group"] = "Group"; $lang["attributes_definition_id"] = "Id"; -$lang["attributes_definition_name"] = "Add Attribute"; +$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"; @@ -23,3 +23,6 @@ $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"; +$lang["attributes_definition_name_required"] = "Attribute name is a required field"; +$lang["attributes_definition_type_required"] = "Attriubte type is a required field"; +$lang["attributes_attribute_value_invalid_chars"] = "Attribute value cannot contain ':' or '|'"; \ No newline at end of file diff --git a/application/models/reports/Detailed_receivings.php b/application/models/reports/Detailed_receivings.php index 261cbff61..c2f3f795b 100644 --- a/application/models/reports/Detailed_receivings.php +++ b/application/models/reports/Detailed_receivings.php @@ -102,7 +102,7 @@ class Detailed_receivings extends Report $this->db->join('items', 'receivings_items_temp.item_id = items.item_id'); if (count($inputs['definition_ids']) > 0) { - $this->db->select('GROUP_CONCAT(DISTINCT IFNULL(attribute_value, \'-\') ORDER BY definition_id SEPARATOR \'|\') AS attribute_values'); + $this->db->select('GROUP_CONCAT(DISTINCT CONCAT_WS(\':\', definition_id, attribute_value) ORDER BY definition_id SEPARATOR \'|\') AS attribute_values'); $this->db->join('attribute_links', 'attribute_links.item_id = items.item_id AND attribute_links.receiving_id = receivings_items_temp.receiving_id AND definition_id IN (' . implode(',', $inputs['definition_ids']) . ')', 'left'); $this->db->join('attribute_values', 'attribute_values.attribute_id = attribute_links.attribute_id', 'left'); $this->db->group_by('receivings_items_temp.receiving_id, receivings_items_temp.item_id'); diff --git a/application/models/reports/Detailed_sales.php b/application/models/reports/Detailed_sales.php index e3caff0b2..a63655fa1 100644 --- a/application/models/reports/Detailed_sales.php +++ b/application/models/reports/Detailed_sales.php @@ -148,7 +148,7 @@ class Detailed_sales extends Report $this->db->from('sales_items_temp'); if (count($inputs['definition_ids']) > 0) { - $this->db->select('GROUP_CONCAT(DISTINCT IFNULL(attribute_value, \'-\') ORDER BY definition_id SEPARATOR \'|\') AS attribute_values'); + $this->db->select('GROUP_CONCAT(DISTINCT CONCAT_WS(\':\', definition_id, attribute_value) ORDER BY definition_id SEPARATOR \'|\') AS attribute_values'); $this->db->join('attribute_links', 'attribute_links.item_id = sales_items_temp.item_id AND attribute_links.sale_id = sales_items_temp.sale_id AND definition_id IN (' . implode(',', $inputs['definition_ids']) . ')', 'left'); $this->db->join('attribute_values', 'attribute_values.attribute_id = attribute_links.attribute_id', 'left'); $this->db->group_by('sales_items_temp.sale_id, sales_items_temp.item_id'); diff --git a/application/views/attributes/form.php b/application/views/attributes/form.php index 0562e8b77..e092d3143 100644 --- a/application/views/attributes/form.php +++ b/application/views/attributes/form.php @@ -104,6 +104,11 @@ $(document).ready(function() { var is_event = typeof(value) !== 'string'; + if (!$('#attribute_form').valid()) + { + return; + } + if (is_event) { value = $('#definition_value').val(); @@ -142,12 +147,16 @@ $(document).ready(function() add_attribute_value(element); }); + $.validator.addMethod('valid_chars', function(value, element) { + return value.match(/(\||:)/g) == null; + }, "lang->line('attributes_attribute_value_invalid_chars'); ?>"); + $('#attribute_form').validate($.extend({ submitHandler: function(form) { $(form).ajaxSubmit({ beforeSerialize: function($form, options) { - $("select[disabled='disabled']").removeAttr('disabled'); + $("select").removeAttr('disabled'); is_new && $('').attr({ id: 'definition_values', type: 'hidden', @@ -166,8 +175,14 @@ $(document).ready(function() rules: { definition_name: 'required', + definition_value: 'valid_chars', definition_type: 'required' - } + }, + messages: + { + definition_name: "lang->line('attributes_definition_name_required'); ?>", + definition_type: "lang->line('attributes_definition_type_required'); ?>" + } }, form_support.error)); }); diff --git a/application/views/attributes/item.php b/application/views/attributes/item.php index 7be6db019..7d42fff7f 100644 --- a/application/views/attributes/item.php +++ b/application/views/attributes/item.php @@ -39,7 +39,7 @@ foreach($definition_values as $definition_id => $definition_value) else if ($definition_value['definition_type'] == TEXT) { $value = (empty($attribute_value) || empty($attribute_value->attribute_value)) ? $definition_value['selected_value'] : $attribute_value->attribute_value; - echo form_input("attribute_links[$definition_id]", $value, "class='form-control' data-definition-id='$definition_id'"); + echo form_input("attribute_links[$definition_id]", $value, "class='form-control valid_chars' data-definition-id='$definition_id'"); } ?> diff --git a/application/views/items/form.php b/application/views/items/form.php index fd16a9a97..ca7bf739b 100644 --- a/application/views/items/form.php +++ b/application/views/items/form.php @@ -438,6 +438,10 @@ $(document).ready(function() }) }); + $.validator.addMethod('valid_chars', function(value, element) { + return value.match(/(\||:)/g) == null; + }, "lang->line('attributes_attribute_value_invalid_chars'); ?>"); + $('#item_form').validate($.extend({ submitHandler: function(form, event) { $(form).ajaxSubmit({ From 504f9cf85364db8ef28b774f84b6b7f7b459745c Mon Sep 17 00:00:00 2001 From: jekkos Date: Wed, 10 Oct 2018 18:46:39 +0200 Subject: [PATCH 318/568] Align items + sales and receivings reports (#68) --- application/controllers/Reports.php | 22 ++++++++++++---------- application/helpers/tabular_helper.php | 10 +++++----- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/application/controllers/Reports.php b/application/controllers/Reports.php index 7fe7760a7..e5e65482e 100644 --- a/application/controllers/Reports.php +++ b/application/controllers/Reports.php @@ -1251,7 +1251,11 @@ class Reports extends Secure_Controller { $quantity_purchased .= ' [' . $this->Stock_location->get_location_name($drow['item_location']) . ']'; } - $details_data[$row['sale_id']][] = $this->xss_clean(array( + + $attribute_values = (isset($drow['attribute_values'])) ? $drow['attribute_values'] : ''; + $attribute_values = expand_attribute_values($definition_names, $attribute_values); + + $details_data[$row['sale_id']][] = $this->xss_clean(array_merge(array( $drow['name'], $drow['category'], $drow['serialnumber'], @@ -1262,11 +1266,8 @@ class Reports extends Secure_Controller to_currency($drow['total']), to_currency($drow['cost']), to_currency($drow['profit']), - ($drow['discount_type'] == PERCENT)? $drow['discount'].'%':to_currency($drow['discount']))); + ($drow['discount_type'] == PERCENT)? $drow['discount'].'%':to_currency($drow['discount'])), $attribute_values)); - $attribute_values = (isset($drow['attribute_values'])) ? $drow['attribute_values'] : ''; - append_attribute_values($details_data[$row['sale_id']][0], $definition_names, $attribute_values); - $details_data[$row['sale_id']][0] = array_values($details_data[$row['sale_id']][0]); } if(isset($report_data['rewards'][$key])) @@ -1367,17 +1368,18 @@ class Reports extends Secure_Controller { $quantity_purchased .= ' [' . $this->Stock_location->get_location_name($drow['item_location']) . ']'; } - $details_data[$row['receiving_id']][] = $this->xss_clean(array( + + $attribute_values = (isset($drow['attribute_values'])) ? $drow['attribute_values'] : ''; + $attribute_values = expand_attribute_values($definition_names, $attribute_values); + + $details_data[$row['receiving_id']][] = $this->xss_clean(array_merge(array( $drow['item_number'], $drow['name'], $drow['category'], $quantity_purchased, to_currency($drow['total']), - ($drow['discount_type'] == PERCENT)? $drow['discount'].'%':to_currency($drow['discount']))); + ($drow['discount_type'] == PERCENT)? $drow['discount'].'%':to_currency($drow['discount'])), $attribute_values)); - $attribute_values = (isset($drow['attribute_values'])) ? $drow['attribute_values'] : ''; - append_attribute_values($details_data[$row['receiving_id']][0], $definition_names, $attribute_values); - $details_data[$row['receiving_id']][0] = array_values($details_data[$row['receiving_id']][0]); } } diff --git a/application/helpers/tabular_helper.php b/application/helpers/tabular_helper.php index ebd24ced8..5f301cd7e 100644 --- a/application/helpers/tabular_helper.php +++ b/application/helpers/tabular_helper.php @@ -412,9 +412,7 @@ function get_item_data_row($item) )); $attribute_values = (property_exists($item, 'attribute_values')) ? $item->attribute_values : ""; - append_attribute_values($result, $definition_names, $attribute_values); - - return $result; + return $result + expand_attribute_values($definition_names, $attribute_values); } @@ -537,7 +535,7 @@ function get_item_kit_data_row($item_kit) )); } -function append_attribute_values(&$result, $definition_names, $attribute_values) +function expand_attribute_values($definition_names, $attribute_values) { $values = explode('|', $attribute_values); @@ -548,11 +546,13 @@ function append_attribute_values(&$result, $definition_names, $attribute_values) $indexed_values[$exploded_value[0]] = isset($exploded_value[1]) ? $exploded_value[1] : '-'; } + $attribute_values = array(); foreach($definition_names as $definition_id => $definition_name) { $attribute_value = isset($indexed_values[$definition_id]) ? $indexed_values[$definition_id] : '-'; - $result[$definition_id] = $attribute_value; + $attribute_values["$definition_id"] = $attribute_value; } + return $attribute_values; } function get_attribute_definition_manage_table_headers() From 3c6f7dd9c1a860c20868ea6cc18c22720a275544 Mon Sep 17 00:00:00 2001 From: jekkos Date: Thu, 11 Oct 2018 00:42:56 +0200 Subject: [PATCH 319/568] Fix item update query (#68) --- application/models/Item.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/Item.php b/application/models/Item.php index cd87a9459..2efe8085e 100644 --- a/application/models/Item.php +++ b/application/models/Item.php @@ -379,7 +379,7 @@ class Item extends CI_Model $this->db->select('items.*'); $this->db->select('company_name'); $this->db->select('GROUP_CONCAT(DISTINCT CONCAT_WS(\':\', definition_id, attribute_value) ORDER BY definition_id SEPARATOR \'|\') AS attribute_values'); - $this->db->select('category'); + $this->db->select('items.category'); $this->db->select('quantity'); $this->db->from('items'); $this->db->join('suppliers', 'suppliers.person_id = items.supplier_id', 'left'); From 612d23fa63c1a686bb2d6f438737864a5edfe933 Mon Sep 17 00:00:00 2001 From: jekkos Date: Thu, 11 Oct 2018 00:47:24 +0200 Subject: [PATCH 320/568] Fix attribute selection for update (#68) --- application/controllers/Items.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/application/controllers/Items.php b/application/controllers/Items.php index 51bdf61db..79c820c51 100644 --- a/application/controllers/Items.php +++ b/application/controllers/Items.php @@ -404,7 +404,8 @@ class Items extends Secure_Controller $values = &$data['definition_values'][$definition_id]; $values['attribute_id'] = $attribute_id; $values['attribute_value'] = $attribute_value; - + $values['selected_value'] = ''; + if ($definition_value['definition_type'] == DROPDOWN) { $values['values'] = $this->Attribute->get_definition_values($definition_id); @@ -416,10 +417,6 @@ class Items extends Secure_Controller { $values['selected_value'] = $definition_ids[$definition_id]; } - else - { - $values['selected_value'] = ''; - } unset($data['definition_names'][$definition_id]); } From 21ed53aa6d778810473d7d0aa0ad8f583691816f Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Mon, 15 Oct 2018 21:11:28 +0100 Subject: [PATCH 321/568] Minor fixes (#68) --- application/language/en-GB/attributes_lang.php | 2 +- application/language/en-US/attributes_lang.php | 4 ++-- ...910100000_attributes.php => 20181015100000_attributes.php} | 0 3 files changed, 3 insertions(+), 3 deletions(-) rename application/migrations/{20180910100000_attributes.php => 20181015100000_attributes.php} (100%) diff --git a/application/language/en-GB/attributes_lang.php b/application/language/en-GB/attributes_lang.php index 0da58a38f..91c614194 100644 --- a/application/language/en-GB/attributes_lang.php +++ b/application/language/en-GB/attributes_lang.php @@ -24,5 +24,5 @@ $lang["attributes_show_in_sales"] = "Show in sales"; $lang["attributes_show_in_sales_visibility"] = "Sales"; $lang["attributes_update"] = "Update Attribute"; $lang["attributes_definition_name_required"] = "Attribute name is a required field"; -$lang["attributes_definition_type_required"] = "Attriubte type is a required field"; +$lang["attributes_definition_type_required"] = "Attribute type is a required field"; $lang["attributes_attribute_value_invalid_chars"] = "Attribute value cannot contain ':' or '|'"; diff --git a/application/language/en-US/attributes_lang.php b/application/language/en-US/attributes_lang.php index 2d3c4bf84..91c614194 100644 --- a/application/language/en-US/attributes_lang.php +++ b/application/language/en-US/attributes_lang.php @@ -24,5 +24,5 @@ $lang["attributes_show_in_sales"] = "Show in sales"; $lang["attributes_show_in_sales_visibility"] = "Sales"; $lang["attributes_update"] = "Update Attribute"; $lang["attributes_definition_name_required"] = "Attribute name is a required field"; -$lang["attributes_definition_type_required"] = "Attriubte type is a required field"; -$lang["attributes_attribute_value_invalid_chars"] = "Attribute value cannot contain ':' or '|'"; \ No newline at end of file +$lang["attributes_definition_type_required"] = "Attribute type is a required field"; +$lang["attributes_attribute_value_invalid_chars"] = "Attribute value cannot contain ':' or '|'"; diff --git a/application/migrations/20180910100000_attributes.php b/application/migrations/20181015100000_attributes.php similarity index 100% rename from application/migrations/20180910100000_attributes.php rename to application/migrations/20181015100000_attributes.php From 1627a26bf60fa71d66898f9d1b91dc9ab97176f0 Mon Sep 17 00:00:00 2001 From: Steve Ireland Date: Wed, 17 Oct 2018 21:44:16 -0400 Subject: [PATCH 322/568] Remove license folder and .license file --- license/.licenses | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 license/.licenses diff --git a/license/.licenses b/license/.licenses deleted file mode 100644 index 3fc01c60a..000000000 --- a/license/.licenses +++ /dev/null @@ -1,28 +0,0 @@ - - -=== [ 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 \ No newline at end of file From 18db2e5c824073fca85f61693be77c32781be5bf Mon Sep 17 00:00:00 2001 From: Emilio Silva Schlenker Date: Sun, 19 Aug 2018 19:49:47 -0500 Subject: [PATCH 323/568] linked expenses with suppliers --- application/controllers/Expenses.php | 2 +- application/language/en-US/expenses_lang.php | 2 + application/language/es/expenses_lang.php | 2 + .../20180819195000_expenses_supplier_id.php | 97 +++++++++++++++++++ application/models/Expense.php | 9 +- application/views/expenses/form.php | 58 ++++++++++- public/css/bootstrap.autocomplete.css | 4 +- 7 files changed, 167 insertions(+), 7 deletions(-) create mode 100644 application/migrations/20180819195000_expenses_supplier_id.php diff --git a/application/controllers/Expenses.php b/application/controllers/Expenses.php index 6fc3f5d55..272814737 100644 --- a/application/controllers/Expenses.php +++ b/application/controllers/Expenses.php @@ -128,7 +128,7 @@ class Expenses extends Secure_Controller $expense_data = array( 'date' => $date_formatter->format('Y-m-d H:i:s'), - 'supplier_name' => $this->input->post('supplier_name'), + 'supplier_id' => $this->input->post('supplier_id'), 'supplier_tax_code' => $this->input->post('supplier_tax_code'), 'amount' => parse_decimals($this->input->post('amount')), 'tax_amount' => parse_decimals($this->input->post('tax_amount')), diff --git a/application/language/en-US/expenses_lang.php b/application/language/en-US/expenses_lang.php index 939a76705..7bb3b54f2 100644 --- a/application/language/en-US/expenses_lang.php +++ b/application/language/en-US/expenses_lang.php @@ -43,3 +43,5 @@ $lang["expenses_supplier_name"] = "Supplier"; $lang["expenses_supplier_tax_code"] = "Tax Code"; $lang["expenses_tax_amount"] = "Tax"; $lang["expenses_update"] = "Update Expense"; +$lang["expenses_start_typing_supplier_name"] = "Start Typing Supplier's name..."; +$lang["expenses_supplier_required"] = "Please select a valid Supplier"; diff --git a/application/language/es/expenses_lang.php b/application/language/es/expenses_lang.php index ef80582a4..d2f3c2201 100644 --- a/application/language/es/expenses_lang.php +++ b/application/language/es/expenses_lang.php @@ -43,3 +43,5 @@ $lang["expenses_supplier_name"] = "Proveedor"; $lang["expenses_supplier_tax_code"] = "Codigo Imp"; $lang["expenses_tax_amount"] = "Imp"; $lang["expenses_update"] = "Actualizar Gasto"; +$lang["expenses_start_typing_supplier_name"] = "Empieza a escribir el nombre del proveedor..."; +$lang["expenses_supplier_required"] = "Selecciona un Proveedor válido"; diff --git a/application/migrations/20180819195000_expenses_supplier_id.php b/application/migrations/20180819195000_expenses_supplier_id.php new file mode 100644 index 000000000..5a3338a65 --- /dev/null +++ b/application/migrations/20180819195000_expenses_supplier_id.php @@ -0,0 +1,97 @@ +add_supplier_id(); + $this->link_suppliers(); + if($this->there_are_unknown_suppliers()) { + $this->save_name_in_description(); + $unknown_supplier_id = $this->create_unknown_supplier(); + $this->link_unknown_supplier($unknown_supplier_id); + } + $this->create_foreign_key(); + $this->delete_supplier_name(); + } + + public function down() + { + + } + + private function add_supplier_id() + { + $query = "ALTER TABLE `ospos_expenses` "; + $query .= "ADD COLUMN `supplier_id` int(10) NOT NULL;"; + $this->db->query($query); + } + + private function link_suppliers() + { + $query = "UPDATE `ospos_expenses` "; + $query .= "INNER JOIN `ospos_suppliers` "; + $query .= "ON `ospos_expenses`.`supplier_name` = `ospos_suppliers`.`company_name` "; + $query .= "SET `ospos_expenses`.`supplier_id` = `ospos_suppliers`.`person_id`;"; + $this->db->query($query); + } + + private function there_are_unknown_suppliers() + { + $query = "SELECT COUNT(*) AS amount "; + $query .= "FROM `ospos_expenses` "; + $query .= "WHERE `supplier_id` = 0;"; + $result = $this->db->query($query); + $amount = $result->row()->amount; + return $amount > 0; + } + + private function save_name_in_description() + { + $query = "UPDATE `ospos_expenses` "; + $query .= "SET `description` = CONCAT(`description`, CONCAT('\nSupplier name: ', `supplier_name`)) "; + $query .= "WHERE `supplier_id` = 0;"; + $this->db->query($query); + } + + private function create_unknown_supplier() + { + $query = "INSERT INTO `ospos_people` (`first_name`, `last_name`, `comments`) "; + $query .= "VALUES ('Unknown', 'Supplier', 'This supplier was added automatically by OSPOS. It is associated with expenses whose supplier is unknown. Before deleting this supplier, correct the expenses associated with it by heading to the Expenses section and selecting the appropriate supplier for each expense. In order to determine the original supplier, you can look at the supplier\'s name in each expense\'s description field.');"; + $this->db->query($query); + $id = $this->db->insert_id(); + $query = "INSERT INTO `ospos_suppliers` (`person_id`, `company_name`) "; + $query .= "VALUES (" . $id . ", 'Unknown Supplier');"; + $this->db->query($query); + return $id; + } + + private function link_unknown_supplier($unknown_supplier_id) + { + $query = "UPDATE `ospos_expenses` "; + $query .= "SET `supplier_id` = " . $unknown_supplier_id . " "; + $query .= "WHERE `supplier_id`= 0;"; + $this->db->query($query); + } + + private function create_foreign_key() + { + $query = "ALTER TABLE `ospos_expenses` "; + $query .= "ADD CONSTRAINT `ospos_expenses_ibfk_3` FOREIGN KEY (`supplier_id`) REFERENCES `ospos_suppliers` (`person_id`);"; + $this->db->query($query); + } + + private function delete_supplier_name() + { + $query = "ALTER TABLE `ospos_expenses` "; + $query .= "DROP COLUMN `supplier_name`;"; + $this->db->query($query); + } + +} +?> diff --git a/application/models/Expense.php b/application/models/Expense.php index 73a750952..4e543231c 100644 --- a/application/models/Expense.php +++ b/application/models/Expense.php @@ -71,7 +71,7 @@ class Expense extends CI_Model $this->db->select(' expenses.expense_id, MAX(expenses.date) AS date, - MAX(expenses.supplier_name) AS supplier_name, + MAX(suppliers.company_name) AS supplier_name, MAX(expenses.supplier_tax_code) AS supplier_tax_code, MAX(expenses.amount) AS amount, MAX(expenses.tax_amount) AS tax_amount, @@ -86,6 +86,7 @@ class Expense extends CI_Model $this->db->from('expenses AS expenses'); $this->db->join('people AS employees', 'employees.person_id = expenses.employee_id', 'LEFT'); $this->db->join('expense_categories AS expense_categories', 'expense_categories.expense_category_id = expenses.expense_category_id', 'LEFT'); + $this->db->join('suppliers AS suppliers', 'suppliers.person_id = expenses.supplier_id', 'INNER'); $this->db->group_start(); $this->db->like('employees.first_name', $search); @@ -162,7 +163,8 @@ class Expense extends CI_Model $this->db->select(' expenses.expense_id AS expense_id, expenses.date AS date, - expenses.supplier_name AS supplier_name, + suppliers.company_name AS supplier_name, + expenses.supplier_id AS supplier_id, expenses.supplier_tax_code AS supplier_tax_code, expenses.amount AS amount, expenses.tax_amount AS tax_amount, @@ -178,6 +180,7 @@ class Expense extends CI_Model $this->db->from('expenses AS expenses'); $this->db->join('people AS employees', 'employees.person_id = expenses.employee_id', 'LEFT'); $this->db->join('expense_categories AS expense_categories', 'expense_categories.expense_category_id = expenses.expense_category_id', 'LEFT'); + $this->db->join('suppliers AS suppliers', 'suppliers.person_id = expenses.supplier_id', 'INNER'); $this->db->where('expense_id', $expense_id); $query = $this->db->get(); @@ -196,6 +199,8 @@ class Expense extends CI_Model $expenses_obj->$field = ''; } + $expenses_obj->supplier_name = ''; + return $expenses_obj; } } diff --git a/application/views/expenses/form.php b/application/views/expenses/form.php index 1a6ed1df0..d0b0be5d1 100644 --- a/application/views/expenses/form.php +++ b/application/views/expenses/form.php @@ -25,15 +25,25 @@
          @@ -160,6 +170,46 @@ $(document).ready(function() } } + $('#supplier_name').click(function() { + $(this).attr('value',''); + }); + + $('#supplier_name').autocomplete({ + source: '', + minChars:0, + delay:10, + select: function (event, ui) { + $('#supplier_id').val(ui.item.value); + $(this).val(ui.item.label); + $(this).attr('readonly', 'readonly'); + $('#remove_supplier_button').css('display', 'inline-block'); + return false; + } + }); + + $('#supplier_name').blur(function() { + $(this).attr('value',"lang->line('expenses_start_typing_supplier_name'); ?>"); + }); + + $('#remove_supplier_button').css('display', 'none'); + + $('#remove_supplier_button').click(function() { + $('#supplier_id').val(''); + $('#supplier_name').removeAttr('readonly'); + $('#supplier_name').val(''); + $(this).css('display', 'none'); + }); + + expense_id)) { + ?> + $('#supplier_id').val('supplier_id ?>'); + $('#supplier_name').val('supplier_name ?>'); + $('#supplier_name').attr('readonly', 'readonly'); + $('#remove_supplier_button').css('display', 'inline-block'); + $('#expenses_edit_form').validate($.extend({ submitHandler: function(form) { $(form).ajaxSubmit({ @@ -174,6 +224,8 @@ $(document).ready(function() errorLabelContainer: '#error_message_box', + ignore: '', + rules: { category: 'required', @@ -181,6 +233,7 @@ $(document).ready(function() { required: true }, + supplier_id: 'required', amount: { required: true, @@ -200,6 +253,7 @@ $(document).ready(function() required: "lang->line('expenses_date_required'); ?>" }, + supplier_id: "lang->line('expenses_supplier_required'); ?>", amount: { required: "lang->line('expenses_amount_required'); ?>", diff --git a/public/css/bootstrap.autocomplete.css b/public/css/bootstrap.autocomplete.css index 02ce097c3..5a7dcc6d9 100644 --- a/public/css/bootstrap.autocomplete.css +++ b/public/css/bootstrap.autocomplete.css @@ -3,7 +3,7 @@ position: absolute; top: 100%; left: 0; - z-index: 1000; + z-index: 1050; float: left; display: none; min-width: 160px; @@ -50,4 +50,4 @@ -webkit-border-radius: 0px; -moz-border-radius: 0px; background-image: none; -} \ No newline at end of file +} From 2122866b50e0728ffef374e5b2138c7c95f5f1e7 Mon Sep 17 00:00:00 2001 From: Emilio Silva Schlenker Date: Sun, 14 Oct 2018 18:03:21 -0500 Subject: [PATCH 324/568] Supplier field optional, SQL script, removed extra tab --- application/controllers/Expenses.php | 4 + application/language/en-US/expenses_lang.php | 1 - application/language/es/expenses_lang.php | 1 - .../20180819195000_expenses_supplier_id.php | 97 ------------------- ...hp => 20181014170000_upgrade_to_3_3_0.php} | 0 .../migrations/sqlscripts/3.2.1_to_3.3.0.sql | 33 +++++++ application/models/Expense.php | 4 +- application/views/expenses/form.php | 16 ++- 8 files changed, 46 insertions(+), 110 deletions(-) delete mode 100644 application/migrations/20180819195000_expenses_supplier_id.php rename application/migrations/{20181007120000_upgrade_to_3_3_0.php => 20181014170000_upgrade_to_3_3_0.php} (100%) diff --git a/application/controllers/Expenses.php b/application/controllers/Expenses.php index 272814737..ef4b5da69 100644 --- a/application/controllers/Expenses.php +++ b/application/controllers/Expenses.php @@ -139,6 +139,10 @@ class Expenses extends Secure_Controller 'deleted' => $this->input->post('deleted') != NULL ); + if($expense_data['supplier_id'] == '') { + $expense_data['supplier_id'] = NULL; + } + if($this->Expense->save($expense_data, $expense_id)) { $expense_data = $this->xss_clean($expense_data); diff --git a/application/language/en-US/expenses_lang.php b/application/language/en-US/expenses_lang.php index 7bb3b54f2..2d6a36d8a 100644 --- a/application/language/en-US/expenses_lang.php +++ b/application/language/en-US/expenses_lang.php @@ -44,4 +44,3 @@ $lang["expenses_supplier_tax_code"] = "Tax Code"; $lang["expenses_tax_amount"] = "Tax"; $lang["expenses_update"] = "Update Expense"; $lang["expenses_start_typing_supplier_name"] = "Start Typing Supplier's name..."; -$lang["expenses_supplier_required"] = "Please select a valid Supplier"; diff --git a/application/language/es/expenses_lang.php b/application/language/es/expenses_lang.php index d2f3c2201..2f196adf9 100644 --- a/application/language/es/expenses_lang.php +++ b/application/language/es/expenses_lang.php @@ -44,4 +44,3 @@ $lang["expenses_supplier_tax_code"] = "Codigo Imp"; $lang["expenses_tax_amount"] = "Imp"; $lang["expenses_update"] = "Actualizar Gasto"; $lang["expenses_start_typing_supplier_name"] = "Empieza a escribir el nombre del proveedor..."; -$lang["expenses_supplier_required"] = "Selecciona un Proveedor válido"; diff --git a/application/migrations/20180819195000_expenses_supplier_id.php b/application/migrations/20180819195000_expenses_supplier_id.php deleted file mode 100644 index 5a3338a65..000000000 --- a/application/migrations/20180819195000_expenses_supplier_id.php +++ /dev/null @@ -1,97 +0,0 @@ -add_supplier_id(); - $this->link_suppliers(); - if($this->there_are_unknown_suppliers()) { - $this->save_name_in_description(); - $unknown_supplier_id = $this->create_unknown_supplier(); - $this->link_unknown_supplier($unknown_supplier_id); - } - $this->create_foreign_key(); - $this->delete_supplier_name(); - } - - public function down() - { - - } - - private function add_supplier_id() - { - $query = "ALTER TABLE `ospos_expenses` "; - $query .= "ADD COLUMN `supplier_id` int(10) NOT NULL;"; - $this->db->query($query); - } - - private function link_suppliers() - { - $query = "UPDATE `ospos_expenses` "; - $query .= "INNER JOIN `ospos_suppliers` "; - $query .= "ON `ospos_expenses`.`supplier_name` = `ospos_suppliers`.`company_name` "; - $query .= "SET `ospos_expenses`.`supplier_id` = `ospos_suppliers`.`person_id`;"; - $this->db->query($query); - } - - private function there_are_unknown_suppliers() - { - $query = "SELECT COUNT(*) AS amount "; - $query .= "FROM `ospos_expenses` "; - $query .= "WHERE `supplier_id` = 0;"; - $result = $this->db->query($query); - $amount = $result->row()->amount; - return $amount > 0; - } - - private function save_name_in_description() - { - $query = "UPDATE `ospos_expenses` "; - $query .= "SET `description` = CONCAT(`description`, CONCAT('\nSupplier name: ', `supplier_name`)) "; - $query .= "WHERE `supplier_id` = 0;"; - $this->db->query($query); - } - - private function create_unknown_supplier() - { - $query = "INSERT INTO `ospos_people` (`first_name`, `last_name`, `comments`) "; - $query .= "VALUES ('Unknown', 'Supplier', 'This supplier was added automatically by OSPOS. It is associated with expenses whose supplier is unknown. Before deleting this supplier, correct the expenses associated with it by heading to the Expenses section and selecting the appropriate supplier for each expense. In order to determine the original supplier, you can look at the supplier\'s name in each expense\'s description field.');"; - $this->db->query($query); - $id = $this->db->insert_id(); - $query = "INSERT INTO `ospos_suppliers` (`person_id`, `company_name`) "; - $query .= "VALUES (" . $id . ", 'Unknown Supplier');"; - $this->db->query($query); - return $id; - } - - private function link_unknown_supplier($unknown_supplier_id) - { - $query = "UPDATE `ospos_expenses` "; - $query .= "SET `supplier_id` = " . $unknown_supplier_id . " "; - $query .= "WHERE `supplier_id`= 0;"; - $this->db->query($query); - } - - private function create_foreign_key() - { - $query = "ALTER TABLE `ospos_expenses` "; - $query .= "ADD CONSTRAINT `ospos_expenses_ibfk_3` FOREIGN KEY (`supplier_id`) REFERENCES `ospos_suppliers` (`person_id`);"; - $this->db->query($query); - } - - private function delete_supplier_name() - { - $query = "ALTER TABLE `ospos_expenses` "; - $query .= "DROP COLUMN `supplier_name`;"; - $this->db->query($query); - } - -} -?> diff --git a/application/migrations/20181007120000_upgrade_to_3_3_0.php b/application/migrations/20181014170000_upgrade_to_3_3_0.php similarity index 100% rename from application/migrations/20181007120000_upgrade_to_3_3_0.php rename to application/migrations/20181014170000_upgrade_to_3_3_0.php diff --git a/application/migrations/sqlscripts/3.2.1_to_3.3.0.sql b/application/migrations/sqlscripts/3.2.1_to_3.3.0.sql index 4f4b01154..7f03f3bb8 100644 --- a/application/migrations/sqlscripts/3.2.1_to_3.3.0.sql +++ b/application/migrations/sqlscripts/3.2.1_to_3.3.0.sql @@ -111,3 +111,36 @@ ALTER TABLE `ospos_suppliers` UPDATE `ospos_suppliers` SET `category` = 0; + + +-- +-- Link Expenses with Suppliers +-- + +-- Add supplier id + +ALTER TABLE `ospos_expenses` + ADD COLUMN `supplier_id` int(10) NULL; + +-- Link suppliers + +UPDATE `ospos_expenses` + INNER JOIN `ospos_suppliers` + ON `ospos_expenses`.`supplier_name` = `ospos_suppliers`.`company_name` +SET `ospos_expenses`.`supplier_id` = `ospos_suppliers`.`person_id`; + +-- Save name in description for those expenses whose supplier isn't registered + +UPDATE `ospos_expenses` +SET `description` = CONCAT(`description`, CONCAT('\nSupplier name: ', `supplier_name`)) +WHERE `supplier_id` is NULL; + +-- Add foreign key + +ALTER TABLE `ospos_expenses` +ADD CONSTRAINT `ospos_expenses_ibfk_3` FOREIGN KEY (`supplier_id`) REFERENCES `ospos_suppliers` (`person_id`); + +-- Delete supplier name + +ALTER TABLE `ospos_expenses` +DROP COLUMN `supplier_name`; diff --git a/application/models/Expense.php b/application/models/Expense.php index 4e543231c..035e256c5 100644 --- a/application/models/Expense.php +++ b/application/models/Expense.php @@ -86,7 +86,7 @@ class Expense extends CI_Model $this->db->from('expenses AS expenses'); $this->db->join('people AS employees', 'employees.person_id = expenses.employee_id', 'LEFT'); $this->db->join('expense_categories AS expense_categories', 'expense_categories.expense_category_id = expenses.expense_category_id', 'LEFT'); - $this->db->join('suppliers AS suppliers', 'suppliers.person_id = expenses.supplier_id', 'INNER'); + $this->db->join('suppliers AS suppliers', 'suppliers.person_id = expenses.supplier_id', 'LEFT'); $this->db->group_start(); $this->db->like('employees.first_name', $search); @@ -180,7 +180,7 @@ class Expense extends CI_Model $this->db->from('expenses AS expenses'); $this->db->join('people AS employees', 'employees.person_id = expenses.employee_id', 'LEFT'); $this->db->join('expense_categories AS expense_categories', 'expense_categories.expense_category_id = expenses.expense_category_id', 'LEFT'); - $this->db->join('suppliers AS suppliers', 'suppliers.person_id = expenses.supplier_id', 'INNER'); + $this->db->join('suppliers AS suppliers', 'suppliers.person_id = expenses.supplier_id', 'LEFT'); $this->db->where('expense_id', $expense_id); $query = $this->db->get(); diff --git a/application/views/expenses/form.php b/application/views/expenses/form.php index d0b0be5d1..92b5c7041 100644 --- a/application/views/expenses/form.php +++ b/application/views/expenses/form.php @@ -25,7 +25,7 @@
          - lang->line('expenses_supplier_name'), 'supplier_name', array('class'=>'control-label col-xs-3 required')); ?> + lang->line('expenses_supplier_name'), 'supplier_name', array('class'=>'control-label col-xs-3')); ?>
          'supplier_name', @@ -201,14 +201,14 @@ $(document).ready(function() }); expense_id)) { + if(!empty($expenses_info->expense_id)) { ?> - $('#supplier_id').val('supplier_id ?>'); - $('#supplier_name').val('supplier_name ?>'); - $('#supplier_name').attr('readonly', 'readonly'); - $('#remove_supplier_button').css('display', 'inline-block'); + $('#supplier_id').val('supplier_id ?>'); + $('#supplier_name').val('supplier_name ?>'); + $('#supplier_name').attr('readonly', 'readonly'); + $('#remove_supplier_button').css('display', 'inline-block'); $('#expenses_edit_form').validate($.extend({ submitHandler: function(form) { @@ -233,7 +233,6 @@ $(document).ready(function() { required: true }, - supplier_id: 'required', amount: { required: true, @@ -253,7 +252,6 @@ $(document).ready(function() required: "lang->line('expenses_date_required'); ?>" }, - supplier_id: "lang->line('expenses_supplier_required'); ?>", amount: { required: "lang->line('expenses_amount_required'); ?>", From 5650a263815980e46ff22b9386c7424541d4070f Mon Sep 17 00:00:00 2001 From: Emilio Silva Schlenker Date: Mon, 15 Oct 2018 07:42:30 -0500 Subject: [PATCH 325/568] Corrected indentation, chained some frontend calls --- application/controllers/Expenses.php | 6 +++--- application/views/expenses/form.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/application/controllers/Expenses.php b/application/controllers/Expenses.php index ef4b5da69..2de02ee00 100644 --- a/application/controllers/Expenses.php +++ b/application/controllers/Expenses.php @@ -139,9 +139,9 @@ class Expenses extends Secure_Controller 'deleted' => $this->input->post('deleted') != NULL ); - if($expense_data['supplier_id'] == '') { - $expense_data['supplier_id'] = NULL; - } + if($expense_data['supplier_id'] == '') { + $expense_data['supplier_id'] = NULL; + } if($this->Expense->save($expense_data, $expense_id)) { diff --git a/application/views/expenses/form.php b/application/views/expenses/form.php index 92b5c7041..4e49367cd 100644 --- a/application/views/expenses/form.php +++ b/application/views/expenses/form.php @@ -204,8 +204,8 @@ $(document).ready(function() if(!empty($expenses_info->expense_id)) { ?> $('#supplier_id').val('supplier_id ?>'); - $('#supplier_name').val('supplier_name ?>'); - $('#supplier_name').attr('readonly', 'readonly'); + $('#supplier_name').val('supplier_name ?>') + .attr('readonly', 'readonly'); $('#remove_supplier_button').css('display', 'inline-block'); Date: Mon, 15 Oct 2018 18:50:48 -0500 Subject: [PATCH 326/568] Ternary operator instead of if clause to keep consistency --- application/controllers/Expenses.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/application/controllers/Expenses.php b/application/controllers/Expenses.php index 2de02ee00..76eeb89f1 100644 --- a/application/controllers/Expenses.php +++ b/application/controllers/Expenses.php @@ -128,7 +128,7 @@ class Expenses extends Secure_Controller $expense_data = array( 'date' => $date_formatter->format('Y-m-d H:i:s'), - 'supplier_id' => $this->input->post('supplier_id'), + 'supplier_id' => $this->input->post('supplier_id') == '' ? NULL : $this->input->post('supplier_id'), 'supplier_tax_code' => $this->input->post('supplier_tax_code'), 'amount' => parse_decimals($this->input->post('amount')), 'tax_amount' => parse_decimals($this->input->post('tax_amount')), @@ -139,10 +139,6 @@ class Expenses extends Secure_Controller 'deleted' => $this->input->post('deleted') != NULL ); - if($expense_data['supplier_id'] == '') { - $expense_data['supplier_id'] = NULL; - } - if($this->Expense->save($expense_data, $expense_id)) { $expense_data = $this->xss_clean($expense_data); From 12ca6125fbd5b9d57c712f4f5ff32027902291f3 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sun, 21 Oct 2018 17:21:05 +0100 Subject: [PATCH 327/568] Minor fixes --- application/language/en-GB/expenses_lang.php | 1 + application/language/en-US/expenses_lang.php | 2 +- application/language/es/expenses_lang.php | 2 +- application/views/expenses/form.php | 9 +++++---- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/application/language/en-GB/expenses_lang.php b/application/language/en-GB/expenses_lang.php index 1bfdbf8f7..29753a387 100644 --- a/application/language/en-GB/expenses_lang.php +++ b/application/language/en-GB/expenses_lang.php @@ -36,6 +36,7 @@ $lang["expenses_no_expenses_to_display"] = "There are no Expenses to display"; $lang["expenses_none_selected"] = "You have not selected any Expense"; $lang["expenses_one_or_multiple"] = "Expense(s)"; $lang["expenses_payment"] = "Payment Type"; +$lang["expenses_start_typing_supplier_name"] = "Start Typing Supplier's name..."; $lang["expenses_successful_adding"] = "Expense add successful"; $lang["expenses_successful_deleted"] = "Expense delete successful"; $lang["expenses_successful_updating"] = "Expense update successful"; diff --git a/application/language/en-US/expenses_lang.php b/application/language/en-US/expenses_lang.php index 2d6a36d8a..ce1332368 100644 --- a/application/language/en-US/expenses_lang.php +++ b/application/language/en-US/expenses_lang.php @@ -36,6 +36,7 @@ $lang["expenses_no_expenses_to_display"] = "There are no Expenses to display"; $lang["expenses_none_selected"] = "You have not selected any Expense"; $lang["expenses_one_or_multiple"] = "Expense(s)"; $lang["expenses_payment"] = "Payment Type"; +$lang["expenses_start_typing_supplier_name"] = "Start Typing Supplier's name..."; $lang["expenses_successful_adding"] = "Expense add successful"; $lang["expenses_successful_deleted"] = "Expense delete successful"; $lang["expenses_successful_updating"] = "Expense update successful"; @@ -43,4 +44,3 @@ $lang["expenses_supplier_name"] = "Supplier"; $lang["expenses_supplier_tax_code"] = "Tax Code"; $lang["expenses_tax_amount"] = "Tax"; $lang["expenses_update"] = "Update Expense"; -$lang["expenses_start_typing_supplier_name"] = "Start Typing Supplier's name..."; diff --git a/application/language/es/expenses_lang.php b/application/language/es/expenses_lang.php index 2f196adf9..10f9ebe32 100644 --- a/application/language/es/expenses_lang.php +++ b/application/language/es/expenses_lang.php @@ -36,6 +36,7 @@ $lang["expenses_no_expenses_to_display"] = "No hay gastos para mostrar"; $lang["expenses_none_selected"] = "No ha seleccionado ningun gasto"; $lang["expenses_one_or_multiple"] = "Gasto(s)"; $lang["expenses_payment"] = "Tipo de pago"; +$lang["expenses_start_typing_supplier_name"] = "Empieza a escribir el nombre del proveedor..."; $lang["expenses_successful_adding"] = "Gasto añadido"; $lang["expenses_successful_deleted"] = "Gasto borrado"; $lang["expenses_successful_updating"] = "Gasto actualizado"; @@ -43,4 +44,3 @@ $lang["expenses_supplier_name"] = "Proveedor"; $lang["expenses_supplier_tax_code"] = "Codigo Imp"; $lang["expenses_tax_amount"] = "Imp"; $lang["expenses_update"] = "Actualizar Gasto"; -$lang["expenses_start_typing_supplier_name"] = "Empieza a escribir el nombre del proveedor..."; diff --git a/application/views/expenses/form.php b/application/views/expenses/form.php index 4e49367cd..6c468dd12 100644 --- a/application/views/expenses/form.php +++ b/application/views/expenses/form.php @@ -171,7 +171,7 @@ $(document).ready(function() } $('#supplier_name').click(function() { - $(this).attr('value',''); + $(this).attr('value', ''); }); $('#supplier_name').autocomplete({ @@ -201,15 +201,16 @@ $(document).ready(function() }); expense_id)) { + if(!empty($expenses_info->expense_id)) + { ?> $('#supplier_id').val('supplier_id ?>'); - $('#supplier_name').val('supplier_name ?>') - .attr('readonly', 'readonly'); + $('#supplier_name').val('supplier_name ?>').attr('readonly', 'readonly'); $('#remove_supplier_button').css('display', 'inline-block'); + $('#expenses_edit_form').validate($.extend({ submitHandler: function(form) { $(form).ajaxSubmit({ From 9d1d57d42b59c4975c3a75e9a26976ccd3a1ae40 Mon Sep 17 00:00:00 2001 From: WIbi Date: Mon, 22 Oct 2018 06:14:46 +0000 Subject: [PATCH 328/568] Translated using Weblate (Indonesian) Currently translated at 100.0% (37 of 37 strings) Translation: opensourcepos/module Translate-URL: http://weblate.jpeelaer.net/projects/ospos/module/id/ --- application/language/id/module_lang.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/application/language/id/module_lang.php b/application/language/id/module_lang.php index 0c74bbbf9..9c00a99b4 100644 --- a/application/language/id/module_lang.php +++ b/application/language/id/module_lang.php @@ -39,3 +39,5 @@ $lang["module_suppliers"] = "Pemasok"; $lang["module_suppliers_desc"] = "Tambah, ubah, hapus dan cari Pemasok."; $lang["module_taxes"] = "Pajak"; $lang["module_taxes_desc"] = "Konfigurasi Pajak Penjualan."; +$lang["module_cashups"] = "Uang Tunai"; +$lang["module_cashups_desc"] = "Tambah, Ubah, Hapus, dan Cari Uang Tunai"; From 76684f69f5f5d0615f93543920370b70a91c90d9 Mon Sep 17 00:00:00 2001 From: Eugen Sclavone Date: Tue, 9 Oct 2018 21:32:29 +0000 Subject: [PATCH 329/568] Translated using Weblate (Romanian) Currently translated at 23.6% (64 of 271 strings) --- application/language/ro/config_lang.php | 264 +++--------------------- 1 file changed, 28 insertions(+), 236 deletions(-) diff --git a/application/language/ro/config_lang.php b/application/language/ro/config_lang.php index 0e7599fd7..71e44f200 100644 --- a/application/language/ro/config_lang.php +++ b/application/language/ro/config_lang.php @@ -32,243 +32,35 @@ $lang["config_barcode_width"] = "Lățime (px)"; $lang["config_bottom"] = "Subsol"; $lang["config_cash_decimals"] = "Decimale de numerar"; $lang["config_cash_decimals_tooltip"] = "Dacă decimalele în numerar și decimalele monetare sunt aceleași, atunci nu va avea loc nicio rotunjire a numerarului."; -$lang["config_cash_rounding"] = "Numerotarea în numerar"; +$lang["config_cash_rounding"] = "Rotunjire numerar"; $lang["config_center"] = "Centru"; -$lang["config_comma"] = "subsecțiune"; +$lang["config_comma"] = "virgula"; $lang["config_company"] = "Numele Companiei"; $lang["config_company_change_image"] = "Schimbați imaginea"; -$lang["config_company_logo"] = "Logoul companiei"; +$lang["config_company_logo"] = "Sigla companiei"; $lang["config_company_remove_image"] = "Eliminați imaginea"; -$lang["config_company_required"] = ""; -$lang["config_company_select_image"] = ""; -$lang["config_company_website_url"] = ""; -$lang["config_country_codes"] = ""; -$lang["config_country_codes_tooltip"] = ""; -$lang["config_currency_decimals"] = ""; -$lang["config_currency_symbol"] = ""; -$lang["config_custom1"] = ""; -$lang["config_custom10"] = ""; -$lang["config_custom2"] = ""; -$lang["config_custom3"] = ""; -$lang["config_custom4"] = ""; -$lang["config_custom5"] = ""; -$lang["config_custom6"] = ""; -$lang["config_custom7"] = ""; -$lang["config_custom8"] = ""; -$lang["config_custom9"] = ""; -$lang["config_customer_reward"] = ""; -$lang["config_customer_reward_duplicate"] = ""; -$lang["config_customer_reward_enable"] = ""; -$lang["config_customer_reward_invalid_chars"] = ""; -$lang["config_customer_reward_required"] = ""; -$lang["config_customer_sales_tax_support"] = ""; -$lang["config_date_or_time_format"] = ""; -$lang["config_datetimeformat"] = ""; -$lang["config_decimal_point"] = ""; -$lang["config_default_barcode_font_size_number"] = ""; -$lang["config_default_barcode_font_size_required"] = ""; -$lang["config_default_barcode_height_number"] = ""; -$lang["config_default_barcode_height_required"] = ""; -$lang["config_default_barcode_num_in_row_number"] = ""; -$lang["config_default_barcode_num_in_row_required"] = ""; -$lang["config_default_barcode_page_cellspacing_number"] = ""; -$lang["config_default_barcode_page_cellspacing_required"] = ""; -$lang["config_default_barcode_page_width_number"] = ""; -$lang["config_default_barcode_page_width_required"] = ""; -$lang["config_default_barcode_width_number"] = ""; -$lang["config_default_barcode_width_required"] = ""; -$lang["config_default_origin_tax_code"] = ""; -$lang["config_default_sales_discount"] = ""; -$lang["config_default_sales_discount_number"] = ""; -$lang["config_default_sales_discount_required"] = ""; -$lang["config_default_tax_name_number"] = ""; -$lang["config_default_tax_name_required"] = ""; -$lang["config_default_tax_rate"] = ""; -$lang["config_default_tax_rate_1"] = ""; -$lang["config_default_tax_rate_2"] = ""; -$lang["config_default_tax_rate_number"] = ""; -$lang["config_default_tax_rate_required"] = ""; -$lang["config_derive_sale_quantity"] = ""; -$lang["config_derive_sale_quantity_tooltip"] = ""; -$lang["config_dinner_table"] = ""; -$lang["config_dinner_table_duplicate"] = ""; -$lang["config_dinner_table_enable"] = ""; -$lang["config_dinner_table_invalid_chars"] = ""; -$lang["config_dinner_table_required"] = ""; -$lang["config_dot"] = ""; -$lang["config_email"] = ""; -$lang["config_email_configuration"] = ""; -$lang["config_email_mailpath"] = ""; -$lang["config_email_protocol"] = ""; -$lang["config_email_receipt_check_behaviour"] = ""; -$lang["config_email_receipt_check_behaviour_always"] = ""; -$lang["config_email_receipt_check_behaviour_last"] = ""; -$lang["config_email_receipt_check_behaviour_never"] = ""; -$lang["config_email_smtp_crypto"] = ""; -$lang["config_email_smtp_host"] = ""; -$lang["config_email_smtp_pass"] = ""; -$lang["config_email_smtp_port"] = ""; -$lang["config_email_smtp_timeout"] = ""; -$lang["config_email_smtp_user"] = ""; -$lang["config_enforce_privacy"] = ""; -$lang["config_enforce_privacy_tooltip"] = ""; -$lang["config_fax"] = ""; -$lang["config_financial_year"] = ""; -$lang["config_financial_year_apr"] = ""; -$lang["config_financial_year_aug"] = ""; -$lang["config_financial_year_dec"] = ""; -$lang["config_financial_year_feb"] = ""; -$lang["config_financial_year_jan"] = ""; -$lang["config_financial_year_jul"] = ""; -$lang["config_financial_year_jun"] = ""; -$lang["config_financial_year_mar"] = ""; -$lang["config_financial_year_may"] = ""; -$lang["config_financial_year_nov"] = ""; -$lang["config_financial_year_oct"] = ""; -$lang["config_financial_year_sep"] = ""; -$lang["config_gcaptcha_enable"] = ""; -$lang["config_gcaptcha_secret_key"] = ""; -$lang["config_gcaptcha_secret_key_required"] = ""; -$lang["config_gcaptcha_site_key"] = ""; -$lang["config_gcaptcha_site_key_required"] = ""; -$lang["config_gcaptcha_tooltip"] = ""; -$lang["config_general"] = ""; -$lang["config_general_configuration"] = ""; -$lang["config_giftcard_number"] = ""; -$lang["config_giftcard_random"] = ""; -$lang["config_giftcard_series"] = ""; -$lang["config_info"] = ""; -$lang["config_info_configuration"] = ""; -$lang["config_invoice"] = ""; -$lang["config_invoice_configuration"] = ""; -$lang["config_invoice_default_comments"] = ""; -$lang["config_invoice_email_message"] = ""; -$lang["config_invoice_enable"] = ""; -$lang["config_invoice_printer"] = ""; -$lang["config_jsprintsetup_required"] = ""; -$lang["config_language"] = ""; -$lang["config_last_used_invoice_number"] = ""; -$lang["config_last_used_quote_number"] = ""; -$lang["config_last_used_work_order_number"] = ""; -$lang["config_left"] = ""; -$lang["config_license"] = ""; -$lang["config_license_configuration"] = ""; -$lang["config_line_sequence"] = ""; -$lang["config_lines_per_page"] = ""; -$lang["config_lines_per_page_number"] = ""; -$lang["config_lines_per_page_required"] = ""; -$lang["config_locale"] = ""; -$lang["config_locale_configuration"] = ""; -$lang["config_locale_info"] = ""; -$lang["config_location"] = ""; -$lang["config_location_configuration"] = ""; -$lang["config_location_info"] = ""; -$lang["config_logout"] = ""; -$lang["config_mailchimp"] = ""; -$lang["config_mailchimp_api_key"] = ""; -$lang["config_mailchimp_configuration"] = ""; -$lang["config_mailchimp_key_successfully"] = ""; -$lang["config_mailchimp_key_unsuccessfully"] = ""; -$lang["config_mailchimp_lists"] = ""; -$lang["config_mailchimp_tooltip"] = ""; -$lang["config_message"] = ""; -$lang["config_message_configuration"] = ""; -$lang["config_msg_msg"] = ""; -$lang["config_msg_msg_placeholder"] = ""; -$lang["config_msg_pwd"] = ""; -$lang["config_msg_pwd_required"] = ""; -$lang["config_msg_src"] = ""; -$lang["config_msg_src_required"] = ""; -$lang["config_msg_uid"] = ""; -$lang["config_msg_uid_required"] = ""; -$lang["config_multi_pack_enabled"] = ""; -$lang["config_none"] = ""; -$lang["config_notify_alignment"] = ""; -$lang["config_number_format"] = ""; -$lang["config_number_locale"] = ""; -$lang["config_number_locale_invalid"] = ""; -$lang["config_number_locale_required"] = ""; -$lang["config_number_locale_tooltip"] = ""; -$lang["config_payment_options_order"] = ""; -$lang["config_phone"] = ""; -$lang["config_phone_required"] = ""; -$lang["config_print_bottom_margin"] = ""; -$lang["config_print_bottom_margin_number"] = ""; -$lang["config_print_bottom_margin_required"] = ""; -$lang["config_print_delay_autoreturn"] = ""; -$lang["config_print_delay_autoreturn_number"] = ""; -$lang["config_print_delay_autoreturn_required"] = ""; -$lang["config_print_footer"] = ""; -$lang["config_print_header"] = ""; -$lang["config_print_left_margin"] = ""; -$lang["config_print_left_margin_number"] = ""; -$lang["config_print_left_margin_required"] = ""; -$lang["config_print_receipt_check_behaviour"] = ""; -$lang["config_print_receipt_check_behaviour_always"] = ""; -$lang["config_print_receipt_check_behaviour_last"] = ""; -$lang["config_print_receipt_check_behaviour_never"] = ""; -$lang["config_print_right_margin"] = ""; -$lang["config_print_right_margin_number"] = ""; -$lang["config_print_right_margin_required"] = ""; -$lang["config_print_silently"] = ""; -$lang["config_print_top_margin"] = ""; -$lang["config_print_top_margin_number"] = ""; -$lang["config_print_top_margin_required"] = ""; -$lang["config_quantity_decimals"] = ""; -$lang["config_quote_default_comments"] = ""; -$lang["config_receipt"] = ""; -$lang["config_receipt_configuration"] = ""; -$lang["config_receipt_default"] = ""; -$lang["config_receipt_font_size"] = ""; -$lang["config_receipt_font_size_number"] = ""; -$lang["config_receipt_font_size_required"] = ""; -$lang["config_receipt_info"] = ""; -$lang["config_receipt_printer"] = ""; -$lang["config_receipt_short"] = ""; -$lang["config_receipt_show_company_name"] = ""; -$lang["config_receipt_show_description"] = ""; -$lang["config_receipt_show_serialnumber"] = ""; -$lang["config_receipt_show_taxes"] = ""; -$lang["config_receipt_show_total_discount"] = ""; -$lang["config_receipt_template"] = ""; -$lang["config_receiving_calculate_average_price"] = ""; -$lang["config_recv_invoice_format"] = ""; -$lang["config_register_mode_default"] = ""; -$lang["config_return_policy_required"] = ""; -$lang["config_reward"] = ""; -$lang["config_reward_configuration"] = ""; -$lang["config_right"] = ""; -$lang["config_sales_invoice_format"] = ""; -$lang["config_sales_quote_format"] = ""; -$lang["config_saved_successfully"] = ""; -$lang["config_saved_unsuccessfully"] = ""; -$lang["config_show_office_group"] = ""; -$lang["config_statistics"] = ""; -$lang["config_statistics_tooltip"] = ""; -$lang["config_stock_location"] = ""; -$lang["config_stock_location_duplicate"] = ""; -$lang["config_stock_location_invalid_chars"] = ""; -$lang["config_stock_location_required"] = ""; -$lang["config_suggestions_first_column"] = ""; -$lang["config_suggestions_layout"] = ""; -$lang["config_suggestions_second_column"] = ""; -$lang["config_suggestions_third_column"] = ""; -$lang["config_table"] = ""; -$lang["config_table_configuration"] = ""; -$lang["config_takings_printer"] = ""; -$lang["config_tax"] = ""; -$lang["config_tax_category"] = ""; -$lang["config_tax_category_duplicate"] = ""; -$lang["config_tax_category_invalid_chars"] = ""; -$lang["config_tax_category_required"] = ""; -$lang["config_tax_category_used"] = ""; -$lang["config_tax_configuration"] = ""; -$lang["config_tax_decimals"] = ""; -$lang["config_tax_included"] = ""; -$lang["config_theme"] = ""; -$lang["config_thousands_separator"] = ""; -$lang["config_timezone"] = ""; -$lang["config_top"] = ""; -$lang["config_website"] = ""; -$lang["config_work_order_enable"] = ""; -$lang["config_work_order_format"] = ""; +$lang["config_company_required"] = "Numele companiei este obligatoriu"; +$lang["config_company_select_image"] = "Selectati imaginea"; +$lang["config_company_website_url"] = "Site-ul Web al companie nu este un URL valid (http://...)."; +$lang["config_country_codes"] = "Cod tara"; +$lang["config_country_codes_tooltip"] = "Lista separata prin virgula a codurilor tarilor pentru cautarea adresei."; +$lang["config_currency_decimals"] = "Zecimale Valuta"; +$lang["config_currency_symbol"] = "Simbol Valuta"; +$lang["config_custom1"] = "Camp Personalizat 1"; +$lang["config_custom10"] = "Camp Personalizat 10"; +$lang["config_custom2"] = "Camp Personalizat 2"; +$lang["config_custom3"] = "Camp Personalizat 3"; +$lang["config_custom4"] = "Camp Personalizat 4"; +$lang["config_custom5"] = "Camp Personalizat 5"; +$lang["config_custom6"] = "Camp Personalizat 6"; +$lang["config_custom7"] = "Camp Personalizat 7"; +$lang["config_custom8"] = "Camp Personalizat 8"; +$lang["config_custom9"] = "Camp Personalizat 9"; +$lang["config_customer_reward"] = "Recompensa"; +$lang["config_customer_reward_duplicate"] = "Recompensa trebuie sa fie unica"; +$lang["config_customer_reward_enable"] = "Activatie Recompensare Client"; +$lang["config_customer_reward_invalid_chars"] = "Recompensa nu poate contine '_'"; +$lang["config_customer_reward_required"] = "Recompensa este un camp obligatoriu"; +$lang["config_customer_sales_tax_support"] = "Suport Clienti privind Taxele pe Vanzari"; +$lang["config_date_or_time_format"] = "Filtru Data si Timp"; +$lang["config_datetimeformat"] = "Format Data si Timp"; From 5d2f49e95017ae20a9a1ef5146d49d2f16f96789 Mon Sep 17 00:00:00 2001 From: Zhivko Vanev Date: Sun, 30 Sep 2018 07:44:25 +0000 Subject: [PATCH 330/568] Translated using Weblate (Bulgarian) Currently translated at 100.0% (35 of 35 strings) --- application/language/bg/employees_lang.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/application/language/bg/employees_lang.php b/application/language/bg/employees_lang.php index 28a774596..2fb09122c 100644 --- a/application/language/bg/employees_lang.php +++ b/application/language/bg/employees_lang.php @@ -1,5 +1,4 @@ - Date: Mon, 22 Oct 2018 06:18:05 +0000 Subject: [PATCH 331/568] Translated using Weblate (Indonesian) Currently translated at 100.0% (52 of 52 strings) --- application/language/id/receivings_lang.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/application/language/id/receivings_lang.php b/application/language/id/receivings_lang.php index 3a0e50416..06758d663 100644 --- a/application/language/id/receivings_lang.php +++ b/application/language/id/receivings_lang.php @@ -5,26 +5,26 @@ $lang["receivings_cannot_be_deleted"] = "Tidak bisa dihapus"; $lang["receivings_comments"] = "Keterangan"; $lang["receivings_complete_receiving"] = "Selesai"; $lang["receivings_confirm_cancel_receiving"] = "Apakah anda yakin untuk menghapus Penerimaan Barang masuk ini? Semua item Akan dihapus."; -$lang["receivings_confirm_delete"] = "Konfirmasi Hapus"; +$lang["receivings_confirm_delete"] = "Apakah Anda yakin akan hapus penerimaan ini? Tindakan ini tidak bisa dibatalkan."; $lang["receivings_confirm_finish_receiving"] = "Apakah anda yakin untuk memproses Penerimaan Barang masuk ini? Proses ini tidak dapat dibatalkan."; $lang["receivings_cost"] = "Harga"; $lang["receivings_date"] = "Tanggal"; -$lang["receivings_date_required"] = "Tanngalnya harus diisi"; -$lang["receivings_date_type"] = "Model Tanggal"; +$lang["receivings_date_required"] = "Tanggal harus diisi."; +$lang["receivings_date_type"] = "Kolom tanggal harus diisi."; $lang["receivings_delete_entire_sale"] = "Hapus Semua Penjualan"; -$lang["receivings_discount"] = "Diskon %"; +$lang["receivings_discount"] = "Diskon"; $lang["receivings_edit"] = "Ubah"; $lang["receivings_edit_sale"] = "Ubah Penerimaan"; $lang["receivings_employee"] = "Karyawan"; -$lang["receivings_error_editing_item"] = "Pengubahan Item Salah"; -$lang["receivings_error_requisition"] = "Kesalahan Daftar Permintaan"; +$lang["receivings_error_editing_item"] = "Ubah Item barang gagal."; +$lang["receivings_error_requisition"] = "Tidak dapat memindahkan Persediaan dari atau ke Lokasi yang Sama."; $lang["receivings_find_or_scan_item"] = "Cari/Scan Item"; -$lang["receivings_find_or_scan_item_or_receipt"] = "Cari/Scan Item ATAU Faktur"; +$lang["receivings_find_or_scan_item_or_receipt"] = "Cari/Scan Item atau Faktur"; $lang["receivings_id"] = "ID Penerimaan"; $lang["receivings_item_name"] = "Nama Item"; $lang["receivings_mode"] = "Jenis Penerimaan"; $lang["receivings_new_supplier"] = "Pemasok Baru"; -$lang["receivings_one_or_multiple"] = "Satu Atau Double"; +$lang["receivings_one_or_multiple"] = "penerimaan"; $lang["receivings_print_after_sale"] = "Cetak Faktur setelah penjualan"; $lang["receivings_quantity"] = "Jumlah"; $lang["receivings_receipt"] = "Faktur Penerimaan"; @@ -32,7 +32,7 @@ $lang["receivings_receipt_number"] = "No. Faktur Penerimaan"; $lang["receivings_receiving"] = "Barang Masuk"; $lang["receivings_reference"] = "Referensi"; $lang["receivings_register"] = "Penerimaan Barang Masuk"; -$lang["receivings_requisition"] = "Mutasi Antar Gudang"; +$lang["receivings_requisition"] = "Daftar Permintaan"; $lang["receivings_return"] = "Retur"; $lang["receivings_select_supplier"] = "Pilih Pemasok (Opsional)"; $lang["receivings_ship_pack"] = ""; @@ -52,3 +52,4 @@ $lang["receivings_transaction_failed"] = "Transaksi Penerimaan Salah"; $lang["receivings_unable_to_add_item"] = "Item tidak dapat ditambahkan ke penerimaan barang masuk"; $lang["receivings_unsuccessfully_updated"] = "Tidak Berhasil Diperbaharui"; $lang["receivings_update"] = "Ubah"; +$lang["receivings_ship_pack"] = "Pengiriman Kapal"; From a8d6ee6b43c3b124dfb012179cc9392824ba5f75 Mon Sep 17 00:00:00 2001 From: WIbi Date: Mon, 22 Oct 2018 06:34:48 +0000 Subject: [PATCH 332/568] Translated using Weblate (Indonesian) Currently translated at 100.0% (162 of 162 strings) --- application/language/id/sales_lang.php | 27 +++++++++++++------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/application/language/id/sales_lang.php b/application/language/id/sales_lang.php index 3684028d0..4e6b112e9 100644 --- a/application/language/id/sales_lang.php +++ b/application/language/id/sales_lang.php @@ -1,5 +1,4 @@ - Date: Mon, 22 Oct 2018 07:26:17 +0000 Subject: [PATCH 333/568] Translated using Weblate (Indonesian) Currently translated at 100.0% (30 of 30 strings) --- application/language/id/item_kits_lang.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/language/id/item_kits_lang.php b/application/language/id/item_kits_lang.php index aca1d8882..a8ef0f59a 100644 --- a/application/language/id/item_kits_lang.php +++ b/application/language/id/item_kits_lang.php @@ -25,7 +25,7 @@ $lang["item_kits_no_item_kits_to_display"] = "Tidak ada Item Paket yang ditampil $lang["item_kits_none_selected"] = "Anda belum memilih satupun Item Paket"; $lang["item_kits_one_or_multiple"] = "Item Paket"; $lang["item_kits_price_option"] = "Opsi Harga"; -$lang["item_kits_priced_only"] = ""; +$lang["item_kits_priced_only"] = "Hanya Harga"; $lang["item_kits_print_option"] = "Opsi Cetak"; $lang["item_kits_quantity"] = "Jumlah"; $lang["item_kits_sequence"] = "Urutan"; From 6e84469aa2710e6a7ae538c5279534b15f3b3a52 Mon Sep 17 00:00:00 2001 From: WIbi Date: Mon, 22 Oct 2018 07:31:43 +0000 Subject: [PATCH 334/568] Translated using Weblate (Indonesian) Currently translated at 100.0% (110 of 110 strings) --- application/language/id/reports_lang.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/application/language/id/reports_lang.php b/application/language/id/reports_lang.php index dbd20bba4..893a221f8 100644 --- a/application/language/id/reports_lang.php +++ b/application/language/id/reports_lang.php @@ -13,8 +13,8 @@ $lang["reports_code_return"] = "RET"; $lang["reports_code_type"] = "Tipe"; $lang["reports_code_work_order"] = "W/O"; $lang["reports_comments"] = "Catatan"; -$lang["reports_complete"] = ""; -$lang["reports_completed_sales"] = ""; +$lang["reports_complete"] = "Penjualan dan Retur yang sukses"; +$lang["reports_completed_sales"] = "Penjualan yang Sukses"; $lang["reports_confirm_delete"] = "Anda yakin ingin menghapus masukan terpilih?"; $lang["reports_confirm_restore"] = "Anda yakin ingin mengembalikan entri terpilih?"; $lang["reports_cost"] = "Grosir"; @@ -56,7 +56,7 @@ $lang["reports_inventory_reports"] = "Laporan Persediaan"; $lang["reports_inventory_summary"] = "Laporan Ringkasan Persediaan"; $lang["reports_inventory_summary_report"] = "Laporan Ringkasan Persediaan"; $lang["reports_item"] = "Produk/Item"; -$lang["reports_item_count"] = ""; +$lang["reports_item_count"] = "Filter Jumlah Item"; $lang["reports_item_name"] = "Nama Barang"; $lang["reports_item_number"] = "Kode batang"; $lang["reports_items"] = "Produk/Item"; @@ -75,7 +75,7 @@ $lang["reports_payments_summary_report"] = "Laporan Ringkasan Pembayaran"; $lang["reports_profit"] = "Keuntungan/Laba"; $lang["reports_quantity"] = "Jumlah"; $lang["reports_quantity_purchased"] = "Jumlah Dibeli"; -$lang["reports_quotes"] = ""; +$lang["reports_quotes"] = "Penawaran"; $lang["reports_received_by"] = "Diterima Oleh"; $lang["reports_receiving_id"] = "Id Penerima"; $lang["reports_receiving_type"] = "Type Diterima"; @@ -122,6 +122,6 @@ $lang["reports_total_quantity"] = "Total Quantity"; $lang["reports_total_retail"] = "Total Inv. Retail Value"; $lang["reports_type"] = "Tipe"; $lang["reports_unit_price"] = "Harga Jual"; -$lang["reports_used"] = ""; -$lang["reports_work_orders"] = ""; +$lang["reports_used"] = "Poin yang telah digunakan"; +$lang["reports_work_orders"] = "Perintah Kerja"; $lang["reports_zero_and_less"] = "Stok habis dan minus"; From 440cacade125a4ada83ae1fad6b9a7f2bf3678d7 Mon Sep 17 00:00:00 2001 From: WIbi Date: Mon, 22 Oct 2018 07:48:47 +0000 Subject: [PATCH 335/568] Translated using Weblate (Indonesian) Currently translated at 100.0% (7 of 7 strings) Translation: opensourcepos/enum Translate-URL: http://weblate.jpeelaer.net/projects/ospos/enum/id/ --- application/language/id/enum_lang.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/language/id/enum_lang.php b/application/language/id/enum_lang.php index f7e5adfdb..a04eb2a18 100644 --- a/application/language/id/enum_lang.php +++ b/application/language/id/enum_lang.php @@ -1,9 +1,9 @@ Date: Mon, 22 Oct 2018 07:29:12 +0000 Subject: [PATCH 336/568] Translated using Weblate (Indonesian) Currently translated at 100.0% (65 of 65 strings) --- application/language/id/common_lang.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/application/language/id/common_lang.php b/application/language/id/common_lang.php index a6de9ab2d..90ed3a191 100644 --- a/application/language/id/common_lang.php +++ b/application/language/id/common_lang.php @@ -1,5 +1,4 @@ - Date: Mon, 22 Oct 2018 07:06:31 +0000 Subject: [PATCH 337/568] Translated using Weblate (Indonesian) Currently translated at 99.6% (270 of 271 strings) --- application/language/id/config_lang.php | 72 ++++++++++++------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/application/language/id/config_lang.php b/application/language/id/config_lang.php index d84f45675..fc02447d0 100644 --- a/application/language/id/config_lang.php +++ b/application/language/id/config_lang.php @@ -87,14 +87,14 @@ $lang["config_default_tax_rate"] = "Tarif Pajak %"; $lang["config_default_tax_rate_1"] = "Tarif Pajak 1"; $lang["config_default_tax_rate_2"] = "Tarif Pajak 2"; $lang["config_default_tax_rate_number"] = "Tarif Pajak harus berupa angkat."; -$lang["config_default_tax_rate_required"] = "Tarif Pajak Biasa harus diisi"; -$lang["config_derive_sale_quantity"] = ""; +$lang["config_default_tax_rate_required"] = "Tarif Pajak Biasa harus diisi."; +$lang["config_derive_sale_quantity"] = "Ijinkan Kuantitas Penjulan Diturunkan"; $lang["config_derive_sale_quantity_tooltip"] = "Jika dicentang maka jenis barang baru akan disediakan untuk barang yang dipesan dengan jumlah yang diperpanjang"; $lang["config_dinner_table"] = "Meja"; -$lang["config_dinner_table_duplicate"] = "Masukkan nama meja (harus unik)"; +$lang["config_dinner_table_duplicate"] = "Masukkan nama meja (harus unik)."; $lang["config_dinner_table_enable"] = "Aktifkan meja"; -$lang["config_dinner_table_invalid_chars"] = "Nama meja tidak dapat berisi karater '_'"; -$lang["config_dinner_table_required"] = "Meja adalah kolom yang harus diisi"; +$lang["config_dinner_table_invalid_chars"] = "Nama meja tidak dapat berisi karater '_'."; +$lang["config_dinner_table_required"] = "Meja adalah kolom yang harus diisi."; $lang["config_dot"] = "titik"; $lang["config_email"] = "Email"; $lang["config_email_configuration"] = "Konfigurasi Email"; @@ -155,8 +155,8 @@ $lang["config_license"] = "Lisensi"; $lang["config_license_configuration"] = "Pernyataan Lisensi"; $lang["config_line_sequence"] = "Urutan baris"; $lang["config_lines_per_page"] = "Baris per halaman"; -$lang["config_lines_per_page_number"] = "Baris per halaman harus berupa angka"; -$lang["config_lines_per_page_required"] = "Baris per halaman tidak boleh kosong"; +$lang["config_lines_per_page_number"] = "Baris per halaman harus berupa angka."; +$lang["config_lines_per_page_required"] = "Baris per halaman tidak boleh kosong."; $lang["config_locale"] = "Terjemahan"; $lang["config_locale_configuration"] = "Konfigurasi Terjemahan"; $lang["config_locale_info"] = "Informasi Konfigurasi Terjemahan"; @@ -186,42 +186,42 @@ $lang["config_none"] = "none"; $lang["config_notify_alignment"] = "Posisi notifikasi Popup"; $lang["config_number_format"] = "Format Nomor"; $lang["config_number_locale"] = "Terjemahan"; -$lang["config_number_locale_invalid"] = "Terjemahan bahasa salah. Check the link in the tooltip to find a sensible value"; -$lang["config_number_locale_required"] = "Kode Lokal wajib diisi"; -$lang["config_number_locale_tooltip"] = "Menemukan kode lokal melalui link ini"; +$lang["config_number_locale_invalid"] = "Kode bahasa salah. Cek tautan pada tooltip untuk mendapatkan kode bahasa yang benar."; +$lang["config_number_locale_required"] = "Kode Lokal wajib diisi."; +$lang["config_number_locale_tooltip"] = "Menemukan kode lokal melalui link ini."; $lang["config_payment_options_order"] = "Urutan pilihan pembayaran"; $lang["config_phone"] = "Telepon Perusahaan"; -$lang["config_phone_required"] = "Telepon Perusahaan wajib diisi"; +$lang["config_phone_required"] = "Telepon Perusahaan wajib diisi."; $lang["config_print_bottom_margin"] = "Margin Bawah"; -$lang["config_print_bottom_margin_number"] = "Default margin bawah harus angka"; -$lang["config_print_bottom_margin_required"] = "Default margin Bawah harus di isi"; -$lang["config_print_delay_autoreturn"] = ""; -$lang["config_print_delay_autoreturn_number"] = ""; +$lang["config_print_bottom_margin_number"] = "Default margin bawah harus angka."; +$lang["config_print_bottom_margin_required"] = "Default margin Bawah harus di isi."; +$lang["config_print_delay_autoreturn"] = "Otomatis Retur pada penundaan Penjualan"; +$lang["config_print_delay_autoreturn_number"] = "Kolom Otomatis Retur pada Penundaan Penjualan harus diisi."; $lang["config_print_delay_autoreturn_required"] = ""; $lang["config_print_footer"] = "Mencetak Footer Browser"; $lang["config_print_header"] = "Mencetak Browser Header"; -$lang["config_print_left_margin"] = "Marjin Kiri"; -$lang["config_print_left_margin_number"] = "Marjin kiri harus berupa angka"; -$lang["config_print_left_margin_required"] = "Margin kiri wajib di isi"; -$lang["config_print_receipt_check_behaviour"] = ""; +$lang["config_print_left_margin"] = "Margin Kiri"; +$lang["config_print_left_margin_number"] = "Margin kiri harus berupa angka."; +$lang["config_print_left_margin_required"] = "Margin kiri wajib di isi."; +$lang["config_print_receipt_check_behaviour"] = "Centang Cetak Struk"; $lang["config_print_receipt_check_behaviour_always"] = "Selalu dicentang"; $lang["config_print_receipt_check_behaviour_last"] = "Ingat pilihan terakhir"; $lang["config_print_receipt_check_behaviour_never"] = "Selalu tidak dicentang"; -$lang["config_print_right_margin"] = "Marjin kanan"; -$lang["config_print_right_margin_number"] = "Margin kiri harus berupa angka"; -$lang["config_print_right_margin_required"] = "Margin kanan wajib di isi"; +$lang["config_print_right_margin"] = "Margin kanan"; +$lang["config_print_right_margin_number"] = "Margin kiri harus berupa angka."; +$lang["config_print_right_margin_required"] = "Margin kanan wajib di isi."; $lang["config_print_silently"] = "Tampilkan Print Dialog"; -$lang["config_print_top_margin"] = "Marjin atas"; -$lang["config_print_top_margin_number"] = "Nilai margin atas harus di isi angka"; -$lang["config_print_top_margin_required"] = "Margin atas wajib di isi"; +$lang["config_print_top_margin"] = "Margin atas"; +$lang["config_print_top_margin_number"] = "Nilai margin atas harus di isi angka."; +$lang["config_print_top_margin_required"] = "Margin atas wajib di isi."; $lang["config_quantity_decimals"] = "Desimal untuk Jumlah"; $lang["config_quote_default_comments"] = "Komentar faktur"; $lang["config_receipt"] = "Struk Penerimaan"; $lang["config_receipt_configuration"] = "Struk Print Settings"; $lang["config_receipt_default"] = "Default"; -$lang["config_receipt_font_size"] = "Ukuran Fonta"; -$lang["config_receipt_font_size_number"] = "Ukuran fonta harus berupa angka."; -$lang["config_receipt_font_size_required"] = "Ukuran fonta harus diisi."; +$lang["config_receipt_font_size"] = "Ukuran Font"; +$lang["config_receipt_font_size_number"] = "Ukuran font harus berupa angka."; +$lang["config_receipt_font_size_required"] = "Ukuran font harus diisi."; $lang["config_receipt_info"] = "Struk Konfigurasi Informasi"; $lang["config_receipt_printer"] = "Tiket Printer"; $lang["config_receipt_short"] = "Ringkas"; @@ -234,28 +234,28 @@ $lang["config_receipt_template"] = "Template struk"; $lang["config_receiving_calculate_average_price"] = "Menghitung harga rata-rata (Penerimaan)"; $lang["config_recv_invoice_format"] = "Format Faktur"; $lang["config_register_mode_default"] = "Default register mode"; -$lang["config_return_policy_required"] = "Kebijakan retur wajib diisi"; +$lang["config_return_policy_required"] = "Kebijakan retur wajib diisi."; $lang["config_reward"] = "Hadiah"; $lang["config_reward_configuration"] = "Konfigurasi Hadiah"; $lang["config_right"] = "Kanan"; $lang["config_sales_invoice_format"] = "Format Faktur Penjualan"; $lang["config_sales_quote_format"] = "Format Penawaran Penjualan"; -$lang["config_saved_successfully"] = "Konfigurasi berhasil disimpan"; -$lang["config_saved_unsuccessfully"] = "Konfigurasi tidak berhasil disimpan"; +$lang["config_saved_successfully"] = "Konfigurasi berhasil disimpan."; +$lang["config_saved_unsuccessfully"] = "Konfigurasi tidak berhasil disimpan."; $lang["config_show_office_group"] = "Tampilkan ikon kantor"; $lang["config_statistics"] = "Kirim statistik"; $lang["config_statistics_tooltip"] = "Kirim statistik untuk pengembangan dan peningkatan fitur."; $lang["config_stock_location"] = "Lokasi Stock"; -$lang["config_stock_location_duplicate"] = "Gunakan nama yang unik untuk lokasi stock"; -$lang["config_stock_location_invalid_chars"] = "Nama lokasi tidak boleh berisi karakter '_'"; -$lang["config_stock_location_required"] = "Nomor lokasi stock harus diisi"; +$lang["config_stock_location_duplicate"] = "Gunakan nama yang unik untuk lokasi stock."; +$lang["config_stock_location_invalid_chars"] = "Nama lokasi tidak boleh berisi karakter '_'."; +$lang["config_stock_location_required"] = "Nomor lokasi stock harus diisi."; $lang["config_suggestions_first_column"] = "Kolom 1"; -$lang["config_suggestions_layout"] = ""; +$lang["config_suggestions_layout"] = "Tampilan Saran Pencarian"; $lang["config_suggestions_second_column"] = "Kolom 2"; $lang["config_suggestions_third_column"] = "Kolom 3"; $lang["config_table"] = "Meja"; $lang["config_table_configuration"] = "Konfigurasi Meja"; -$lang["config_takings_printer"] = "Pengambilalihan Printer"; +$lang["config_takings_printer"] = "Struk Printer"; $lang["config_tax"] = "Pajak"; $lang["config_tax_category"] = "Kategori Pajak"; $lang["config_tax_category_duplicate"] = "Kategori pajak yang dimasukkan sudah ada."; From 64c259697903b7b988f4e3aa1eacf4c272328ebb Mon Sep 17 00:00:00 2001 From: WIbi Date: Mon, 22 Oct 2018 06:53:23 +0000 Subject: [PATCH 338/568] Translated using Weblate (Indonesian) Currently translated at 100.0% (68 of 68 strings) --- application/language/id/giftcards_lang.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/application/language/id/giftcards_lang.php b/application/language/id/giftcards_lang.php index 5ec681e50..df4d076e8 100644 --- a/application/language/id/giftcards_lang.php +++ b/application/language/id/giftcards_lang.php @@ -5,7 +5,7 @@ $lang["giftcards_allow_alt_description"] = "Deskripsi Alternatif dimungkinkan"; $lang["giftcards_bulk_edit"] = "Ubah Massal"; $lang["giftcards_cannot_be_deleted"] = "Tidak dapat menghapus GiftCard terpilih, Satu atau lebih GiftCard yang dipilih memiliki Penjualan."; $lang["giftcards_cannot_find_giftcard"] = "Informasi GiftCard tidak ditemukan."; -$lang["giftcards_cannot_use"] = "Giftcard %1 tidak dapat digunakan: Pelanggan tidak valid!"; +$lang["giftcards_cannot_use"] = "Giftcard %1 tidak dapat digunakan: Pelanggan tidak valid."; $lang["giftcards_card_value"] = "Nilai"; $lang["giftcards_category"] = "Kategori"; $lang["giftcards_change_all_to_allow_alt_desc"] = "Diijinkan deskripsi alternatif untuk semua."; @@ -25,7 +25,7 @@ $lang["giftcards_edit_fields_you_want_to_update"] = "Ubah bagian yang ingin Anda $lang["giftcards_edit_multiple_giftcards"] = "Ubah beberapa GiftCard."; $lang["giftcards_error_adding_updating"] = "Kesalahan ketika menambahkan/memperbaharui GiftCard."; $lang["giftcards_error_updating_multiple"] = "Gagal memperbaharui Giftcard."; -$lang["giftcards_excel_import_failed"] = "Impor dari Excel import tidak berhasil"; +$lang["giftcards_excel_import_failed"] = "Impor dari Excel gagal."; $lang["giftcards_generate_barcodes"] = "Buat Barcode"; $lang["giftcards_giftcard"] = "GiftCard"; $lang["giftcards_giftcard_number"] = "Nomor GiftCard"; @@ -34,24 +34,24 @@ $lang["giftcards_inventory_comments"] = "Keterangan"; $lang["giftcards_is_serialized"] = "GiftCard Memiliki Nomor Serial"; $lang["giftcards_low_inventory_giftcards"] = "GiftCard Inventori Rendah"; $lang["giftcards_manually_editing_of_quantity"] = "Perubahan jumlah Stok secara manual"; -$lang["giftcards_must_select_giftcard_for_barcode"] = "Anda harus memilih minimal 1 GiftCard untuk membuat Barcode"; +$lang["giftcards_must_select_giftcard_for_barcode"] = "Anda harus memilih minimal satu (1) GiftCard untuk membuat Barcode."; $lang["giftcards_new"] = "GiftCard Baru"; $lang["giftcards_no_description_giftcards"] = "Tidak ada Deskripsi Gift Card"; -$lang["giftcards_no_giftcards_to_display"] = "Tidak ada GiftCard yang ditampilkan"; +$lang["giftcards_no_giftcards_to_display"] = "Tidak ada GiftCard yang ditampilkan."; $lang["giftcards_none"] = "Tidak Ada"; -$lang["giftcards_none_selected"] = "Anda belum memilih GiftCard untuk diubah"; -$lang["giftcards_number"] = "Nomor GiftCard harus angka"; +$lang["giftcards_none_selected"] = "Anda belum memilih GiftCard untuk diubah."; +$lang["giftcards_number"] = "Nomor GiftCard harus angka."; $lang["giftcards_number_information"] = "Nomor GiftCard"; -$lang["giftcards_number_required"] = "Nomor GiftCard wajib diisi"; +$lang["giftcards_number_required"] = "Nomor GiftCard wajib diisi."; $lang["giftcards_one_or_multiple"] = "GiftCard"; $lang["giftcards_person_id"] = "Nomor Pelanggan"; $lang["giftcards_quantity"] = "Jumlah"; -$lang["giftcards_quantity_required"] = "Jumlah wajib diisi. Silahkan tutup ( X ) untuk batal"; +$lang["giftcards_quantity_required"] = "Jumlah wajib diisi. Silahkan tutup ( X ) untuk batal."; $lang["giftcards_remaining_balance"] = "Giftcard %1 tersisa %2!"; $lang["giftcards_reorder_level"] = "Level Pesan Ulang"; $lang["giftcards_retrive_giftcard_info"] = "Informasi GiftCard"; $lang["giftcards_sales_tax_1"] = "Pajak Penjualan"; -$lang["giftcards_sales_tax_2"] = "Pajak Penjualan"; +$lang["giftcards_sales_tax_2"] = "Pajak Penjualan 2"; $lang["giftcards_serialized_giftcards"] = "Serial GiftCard"; $lang["giftcards_successful_adding"] = "GiftCard telah berhasil ditambahkan"; $lang["giftcards_successful_bulk_edit"] = "Anda telah berhasil memperbarui GiftCard yang dipilih"; @@ -66,5 +66,5 @@ $lang["giftcards_unit_price"] = "Harga Jual"; $lang["giftcards_upc_database"] = "Database UPC"; $lang["giftcards_update"] = "Ubah GiftCard"; $lang["giftcards_use_inventory_menu"] = "Gunakan Inv. Menu"; -$lang["giftcards_value"] = "Nilai GiftCard harus angka"; -$lang["giftcards_value_required"] = "Nilai GiftCard wajib diisi"; +$lang["giftcards_value"] = "Nilai GiftCard harus angka."; +$lang["giftcards_value_required"] = "Nilai GiftCard wajib diisi."; From 04346da7efd7f0c9ce52794cbddad62c15dd5337 Mon Sep 17 00:00:00 2001 From: WIbi Date: Mon, 22 Oct 2018 07:27:04 +0000 Subject: [PATCH 339/568] Translated using Weblate (Indonesian) Currently translated at 100.0% (30 of 30 strings) --- application/language/id/item_kits_lang.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/application/language/id/item_kits_lang.php b/application/language/id/item_kits_lang.php index a8ef0f59a..21ef08c76 100644 --- a/application/language/id/item_kits_lang.php +++ b/application/language/id/item_kits_lang.php @@ -2,16 +2,15 @@ $lang["item_kits_add_item"] = "Tambah Item Barang"; $lang["item_kits_all"] = "Semua"; -$lang["item_kits_cannot_be_deleted"] = "Item Paket tidak dapat dihapus"; +$lang["item_kits_cannot_be_deleted"] = "Item Paket tidak dapat dihapus."; $lang["item_kits_confirm_delete"] = "Apakah Anda yakin ingin menghapus Item Paket dipilih?"; $lang["item_kits_confirm_restore"] = "Apakah Anda yakin untuk mengembalikan Kit Item yang terpilih?"; $lang["item_kits_description"] = "Deskripsi Item Paket"; $lang["item_kits_discount"] = ""; $lang["item_kits_discount_fixed"] = ""; $lang["item_kits_discount_percent"] = "Persen Diskon"; -$lang["item_kits_discount_type"] = ""; -$lang["item_kits_error_adding_updating"] = "Tambah/Ubah Item Paket tidak berhasil"; -$lang["item_kits_find_kit_item"] = "Kit Item"; +$lang["item_kits_error_adding_updating"] = "Tambah/Ubah Item Paket tidak berhasil."; +$lang["item_kits_find_kit_item"] = "Paket Item"; $lang["item_kits_info"] = "Item Paket Info"; $lang["item_kits_item"] = "Item Barang"; $lang["item_kits_items"] = "Item Barang"; @@ -21,8 +20,8 @@ $lang["item_kits_kit_and_stock"] = "Kit dan Stok"; $lang["item_kits_kit_only"] = "Hanya Kit"; $lang["item_kits_name"] = "Nama Item Paket"; $lang["item_kits_new"] = "Item Paket Baru"; -$lang["item_kits_no_item_kits_to_display"] = "Tidak ada Item Paket yang ditampilkan"; -$lang["item_kits_none_selected"] = "Anda belum memilih satupun Item Paket"; +$lang["item_kits_no_item_kits_to_display"] = "Tidak ada Item Paket yang ditampilkan."; +$lang["item_kits_none_selected"] = "Anda belum memilih satupun Item Paket."; $lang["item_kits_one_or_multiple"] = "Item Paket"; $lang["item_kits_price_option"] = "Opsi Harga"; $lang["item_kits_priced_only"] = "Hanya Harga"; From d4f449697ff937cc3052d5dab2605d066e38165c Mon Sep 17 00:00:00 2001 From: WIbi Date: Mon, 22 Oct 2018 06:16:35 +0000 Subject: [PATCH 340/568] Translated using Weblate (Indonesian) Currently translated at 100.0% (37 of 37 strings) Translation: opensourcepos/module Translate-URL: http://weblate.jpeelaer.net/projects/ospos/module/id/ --- application/language/id/module_lang.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/language/id/module_lang.php b/application/language/id/module_lang.php index 9c00a99b4..73bf7bff2 100644 --- a/application/language/id/module_lang.php +++ b/application/language/id/module_lang.php @@ -40,4 +40,4 @@ $lang["module_suppliers_desc"] = "Tambah, ubah, hapus dan cari Pemasok."; $lang["module_taxes"] = "Pajak"; $lang["module_taxes_desc"] = "Konfigurasi Pajak Penjualan."; $lang["module_cashups"] = "Uang Tunai"; -$lang["module_cashups_desc"] = "Tambah, Ubah, Hapus, dan Cari Uang Tunai"; +$lang["module_cashups_desc"] = "Tambah, Ubah, Hapus, dan Cari Uang Tunai."; From bf658af8d07ef72f243bfcf6332d88baf6bf8ab1 Mon Sep 17 00:00:00 2001 From: WIbi Date: Mon, 22 Oct 2018 06:32:29 +0000 Subject: [PATCH 341/568] Translated using Weblate (Indonesian) Currently translated at 100.0% (52 of 52 strings) --- application/language/id/receivings_lang.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/application/language/id/receivings_lang.php b/application/language/id/receivings_lang.php index 06758d663..e7671dc6b 100644 --- a/application/language/id/receivings_lang.php +++ b/application/language/id/receivings_lang.php @@ -1,7 +1,7 @@ Date: Mon, 22 Oct 2018 07:33:29 +0000 Subject: [PATCH 342/568] Translated using Weblate (Indonesian) Currently translated at 100.0% (110 of 110 strings) --- application/language/id/reports_lang.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/language/id/reports_lang.php b/application/language/id/reports_lang.php index 893a221f8..1f43879be 100644 --- a/application/language/id/reports_lang.php +++ b/application/language/id/reports_lang.php @@ -68,7 +68,7 @@ $lang["reports_low_inventory_report"] = "Laporan Persediaan Kurang"; $lang["reports_low_sell_quantity"] = ""; $lang["reports_more_than_zero"] = "Stok belum habis"; $lang["reports_name"] = "Nama"; -$lang["reports_no_reports_to_display"] = "Tidak ada item untuk ditampilkan"; +$lang["reports_no_reports_to_display"] = "Tidak ada item untuk ditampilkan."; $lang["reports_payment_type"] = "Tipe Pembayaran"; $lang["reports_payments"] = "Pembayaran"; $lang["reports_payments_summary_report"] = "Laporan Ringkasan Pembayaran"; @@ -118,8 +118,8 @@ $lang["reports_taxes_summary_report"] = "Laporan Ringkasan Pajak"; $lang["reports_total"] = "Total"; $lang["reports_total_inventory_value"] = "Total Nilai Persediaan"; $lang["reports_total_low_sell_quantity"] = ""; -$lang["reports_total_quantity"] = "Total Quantity"; -$lang["reports_total_retail"] = "Total Inv. Retail Value"; +$lang["reports_total_quantity"] = "Total Kuantitas"; +$lang["reports_total_retail"] = "Total Faktur Eceran Nilai"; $lang["reports_type"] = "Tipe"; $lang["reports_unit_price"] = "Harga Jual"; $lang["reports_used"] = "Poin yang telah digunakan"; From dfd32d1b0e2bd6a4eeae6ab0da4ad15ed4309ad9 Mon Sep 17 00:00:00 2001 From: WIbi Date: Mon, 22 Oct 2018 06:48:20 +0000 Subject: [PATCH 343/568] Translated using Weblate (Indonesian) Currently translated at 100.0% (162 of 162 strings) --- application/language/id/sales_lang.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/language/id/sales_lang.php b/application/language/id/sales_lang.php index 4e6b112e9..ea46cbe45 100644 --- a/application/language/id/sales_lang.php +++ b/application/language/id/sales_lang.php @@ -40,7 +40,7 @@ $lang["sales_delete_confirmation"] = "Apakah anda yakin ingin menghapus transaks $lang["sales_delete_entire_sale"] = "Hapus Transaksi Penjualan"; $lang["sales_delete_successful"] = "Transaksi Penjualan berhasil dihapus."; $lang["sales_delete_unsuccessful"] = "Transaksi Penjualan gagal dihapus."; -$lang["sales_description_abbrv"] = "Deskripsi"; +$lang["sales_description_abbrv"] = "Deskripsi."; $lang["sales_discard"] = "Buang"; $lang["sales_discard_quote"] = ""; $lang["sales_discount"] = "Diskon"; From d99aba0bcccd65dfce1cf46a57f1c858e30a8d85 Mon Sep 17 00:00:00 2001 From: WIbi Date: Mon, 22 Oct 2018 07:51:17 +0000 Subject: [PATCH 344/568] Translated using Weblate (Indonesian) Currently translated at 100.0% (20 of 20 strings) --- application/language/id/suppliers_lang.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/application/language/id/suppliers_lang.php b/application/language/id/suppliers_lang.php index a02a77d00..944a87aec 100644 --- a/application/language/id/suppliers_lang.php +++ b/application/language/id/suppliers_lang.php @@ -17,3 +17,6 @@ $lang["suppliers_successful_updating"] = "Anda telah berhasil memperbarui data p $lang["suppliers_supplier"] = "Pemasok"; $lang["suppliers_supplier_id"] = "ID"; $lang["suppliers_update"] = "Ubah data Pemasok"; +$lang["suppliers_category"] = "Kategori"; +$lang["suppliers_cost"] = "Biaya Pemasok"; +$lang["suppliers_goods"] = "Pemasok Barang"; From 7aa50530c006e9d726dbc6de64f7eea1090fa6a6 Mon Sep 17 00:00:00 2001 From: WIbi Date: Mon, 22 Oct 2018 07:52:21 +0000 Subject: [PATCH 345/568] Translated using Weblate (Indonesian) Currently translated at 100.0% (43 of 43 strings) Translation: opensourcepos/expenses Translate-URL: http://weblate.jpeelaer.net/projects/ospos/expenses/id/ --- application/language/id/expenses_lang.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/language/id/expenses_lang.php b/application/language/id/expenses_lang.php index 04128c538..ee6af3c9d 100644 --- a/application/language/id/expenses_lang.php +++ b/application/language/id/expenses_lang.php @@ -22,8 +22,8 @@ $lang["expenses_date_required"] = "tanggal harus diisi"; $lang["expenses_debit"] = "Kartu Debit"; $lang["expenses_debit_filter"] = "Kartu Debit"; $lang["expenses_description"] = "Deskripsi"; -$lang["expenses_due"] = ""; -$lang["expenses_due_filter"] = ""; +$lang["expenses_due"] = "Jatuh Tempo"; +$lang["expenses_due_filter"] = "Jatuh Tempo"; $lang["expenses_employee"] = "Dibuat oleh"; $lang["expenses_error_adding_updating"] = "Galat menambahkan / memperbaharui Biaya"; $lang["expenses_expense_id"] = "Id"; From 9b6276411fd9d131fb37c910055ba2811c327922 Mon Sep 17 00:00:00 2001 From: WIbi Date: Mon, 22 Oct 2018 07:54:35 +0000 Subject: [PATCH 346/568] Translated using Weblate (Indonesian) Currently translated at 100.0% (19 of 19 strings) Translation: opensourcepos/expenses_categories Translate-URL: http://weblate.jpeelaer.net/projects/ospos/expenses_categories/id/ --- application/language/id/expenses_categories_lang.php | 1 + 1 file changed, 1 insertion(+) diff --git a/application/language/id/expenses_categories_lang.php b/application/language/id/expenses_categories_lang.php index 74780570c..6f5288ee0 100644 --- a/application/language/id/expenses_categories_lang.php +++ b/application/language/id/expenses_categories_lang.php @@ -19,3 +19,4 @@ $lang["expenses_categories_successful_adding"] = "Berhasil menambahkan Kategori $lang["expenses_categories_successful_deleted"] = "Berhasil menghapus Kategori Biaya"; $lang["expenses_categories_successful_updating"] = "Berhasil memperbaharui Kategori Biaya"; $lang["expenses_categories_update"] = "Perbaharui Kategori"; +$lang["expenses_categories_confirm_restore"] = "Apakah Anda yakin mengembalikan Kategori Biaya yang sedang dipilih?"; From 8dbed47a87cb387f858f61bda14cc8b054e5a2b5 Mon Sep 17 00:00:00 2001 From: Khaled Saad Date: Wed, 24 Oct 2018 06:19:40 +0000 Subject: [PATCH 347/568] Translated using Weblate (Arabic) Currently translated at 100.0% (272 of 272 strings) --- application/language/ar-EG/config_lang.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/application/language/ar-EG/config_lang.php b/application/language/ar-EG/config_lang.php index cd8c51a2a..84d7a2d92 100644 --- a/application/language/ar-EG/config_lang.php +++ b/application/language/ar-EG/config_lang.php @@ -1,5 +1,4 @@ - Date: Wed, 24 Oct 2018 06:25:46 +0000 Subject: [PATCH 348/568] Translated using Weblate (Arabic) Currently translated at 100.0% (162 of 162 strings) --- application/language/ar-EG/sales_lang.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/application/language/ar-EG/sales_lang.php b/application/language/ar-EG/sales_lang.php index 57e46c90e..b6499a1b1 100644 --- a/application/language/ar-EG/sales_lang.php +++ b/application/language/ar-EG/sales_lang.php @@ -1,5 +1,4 @@ - Date: Wed, 24 Oct 2018 06:30:16 +0000 Subject: [PATCH 349/568] Translated using Weblate (Arabic) Currently translated at 100.0% (33 of 33 strings) --- application/language/ar-EG/item_kits_lang.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/application/language/ar-EG/item_kits_lang.php b/application/language/ar-EG/item_kits_lang.php index d9c450a24..7d7a27656 100644 --- a/application/language/ar-EG/item_kits_lang.php +++ b/application/language/ar-EG/item_kits_lang.php @@ -1,15 +1,14 @@ - Date: Tue, 30 Oct 2018 20:50:01 -0400 Subject: [PATCH 350/568] Split Chinese language options into Simplified and Traditional --- application/helpers/locale_helper.php | 3 +- application/language/Language code definition | 2 + .../{zh => zh-Hans}/attributes_lang.php | 0 .../{zh => zh-Hans}/bootstrap_tables_lang.php | 0 .../language/{zh => zh-Hans}/cashups_lang.php | 0 .../language/{zh => zh-Hans}/common_lang.php | 0 .../language/{zh => zh-Hans}/config_lang.php | 0 .../{zh => zh-Hans}/customers_lang.php | 0 .../{zh => zh-Hans}/datepicker_lang.php | 0 .../{zh => zh-Hans}/employees_lang.php | 0 .../language/{zh => zh-Hans}/enum_lang.php | 0 .../language/{zh => zh-Hans}/error_lang.php | 0 .../expenses_categories_lang.php | 0 .../{zh => zh-Hans}/expenses_lang.php | 0 .../{zh => zh-Hans}/giftcards_lang.php | 0 .../language/{zh => zh-Hans}/index.html | 20 +- .../{zh => zh-Hans}/item_kits_lang.php | 0 .../language/{zh => zh-Hans}/items_lang.php | 0 .../language/{zh => zh-Hans}/login_lang.php | 0 .../{zh => zh-Hans}/messages_lang.php | 0 .../language/{zh => zh-Hans}/module_lang.php | 0 .../{zh => zh-Hans}/receivings_lang.php | 0 .../language/{zh => zh-Hans}/reports_lang.php | 0 .../language/{zh => zh-Hans}/sales_lang.php | 0 .../{zh => zh-Hans}/suppliers_lang.php | 0 .../language/{zh => zh-Hans}/taxes_lang.php | 0 .../language/zh-Hant/attributes_lang.php | 25 ++ .../zh-Hant/bootstrap_tables_lang.php | 10 + application/language/zh-Hant/cashups_lang.php | 37 +++ application/language/zh-Hant/common_lang.php | 68 +++++ application/language/zh-Hant/config_lang.php | 274 ++++++++++++++++++ .../language/zh-Hant/customers_lang.php | 53 ++++ .../language/zh-Hant/datepicker_lang.php | 23 ++ .../language/zh-Hant/employees_lang.php | 37 +++ application/language/zh-Hant/enum_lang.php | 9 + application/language/zh-Hant/error_lang.php | 4 + .../zh-Hant/expenses_categories_lang.php | 21 ++ .../language/zh-Hant/expenses_lang.php | 45 +++ .../language/zh-Hant/giftcards_lang.php | 70 +++++ application/language/zh-Hant/index.html | 11 + .../language/zh-Hant/item_kits_lang.php | 35 +++ application/language/zh-Hant/items_lang.php | 111 +++++++ application/language/zh-Hant/login_lang.php | 10 + .../language/zh-Hant/messages_lang.php | 14 + application/language/zh-Hant/module_lang.php | 41 +++ .../language/zh-Hant/receivings_lang.php | 54 ++++ application/language/zh-Hant/reports_lang.php | 127 ++++++++ application/language/zh-Hant/sales_lang.php | 165 +++++++++++ .../language/zh-Hant/suppliers_lang.php | 19 ++ application/language/zh-Hant/taxes_lang.php | 32 ++ 50 files changed, 1309 insertions(+), 11 deletions(-) rename application/language/{zh => zh-Hans}/attributes_lang.php (100%) rename application/language/{zh => zh-Hans}/bootstrap_tables_lang.php (100%) rename application/language/{zh => zh-Hans}/cashups_lang.php (100%) rename application/language/{zh => zh-Hans}/common_lang.php (100%) mode change 100755 => 100644 rename application/language/{zh => zh-Hans}/config_lang.php (100%) mode change 100755 => 100644 rename application/language/{zh => zh-Hans}/customers_lang.php (100%) mode change 100755 => 100644 rename application/language/{zh => zh-Hans}/datepicker_lang.php (100%) rename application/language/{zh => zh-Hans}/employees_lang.php (100%) mode change 100755 => 100644 rename application/language/{zh => zh-Hans}/enum_lang.php (100%) rename application/language/{zh => zh-Hans}/error_lang.php (100%) mode change 100755 => 100644 rename application/language/{zh => zh-Hans}/expenses_categories_lang.php (100%) rename application/language/{zh => zh-Hans}/expenses_lang.php (100%) rename application/language/{zh => zh-Hans}/giftcards_lang.php (100%) mode change 100755 => 100644 rename application/language/{zh => zh-Hans}/index.html (92%) mode change 100755 => 100644 rename application/language/{zh => zh-Hans}/item_kits_lang.php (100%) mode change 100755 => 100644 rename application/language/{zh => zh-Hans}/items_lang.php (100%) mode change 100755 => 100644 rename application/language/{zh => zh-Hans}/login_lang.php (100%) mode change 100755 => 100644 rename application/language/{zh => zh-Hans}/messages_lang.php (100%) rename application/language/{zh => zh-Hans}/module_lang.php (100%) mode change 100755 => 100644 rename application/language/{zh => zh-Hans}/receivings_lang.php (100%) mode change 100755 => 100644 rename application/language/{zh => zh-Hans}/reports_lang.php (100%) mode change 100755 => 100644 rename application/language/{zh => zh-Hans}/sales_lang.php (100%) mode change 100755 => 100644 rename application/language/{zh => zh-Hans}/suppliers_lang.php (100%) mode change 100755 => 100644 rename application/language/{zh => zh-Hans}/taxes_lang.php (100%) create mode 100644 application/language/zh-Hant/attributes_lang.php create mode 100644 application/language/zh-Hant/bootstrap_tables_lang.php create mode 100644 application/language/zh-Hant/cashups_lang.php create mode 100644 application/language/zh-Hant/common_lang.php create mode 100644 application/language/zh-Hant/config_lang.php create mode 100644 application/language/zh-Hant/customers_lang.php create mode 100644 application/language/zh-Hant/datepicker_lang.php create mode 100644 application/language/zh-Hant/employees_lang.php create mode 100644 application/language/zh-Hant/enum_lang.php create mode 100644 application/language/zh-Hant/error_lang.php create mode 100644 application/language/zh-Hant/expenses_categories_lang.php create mode 100644 application/language/zh-Hant/expenses_lang.php create mode 100644 application/language/zh-Hant/giftcards_lang.php create mode 100644 application/language/zh-Hant/index.html create mode 100644 application/language/zh-Hant/item_kits_lang.php create mode 100644 application/language/zh-Hant/items_lang.php create mode 100644 application/language/zh-Hant/login_lang.php create mode 100644 application/language/zh-Hant/messages_lang.php create mode 100644 application/language/zh-Hant/module_lang.php create mode 100644 application/language/zh-Hant/receivings_lang.php create mode 100644 application/language/zh-Hant/reports_lang.php create mode 100644 application/language/zh-Hant/sales_lang.php create mode 100644 application/language/zh-Hant/suppliers_lang.php create mode 100644 application/language/zh-Hant/taxes_lang.php diff --git a/application/helpers/locale_helper.php b/application/helpers/locale_helper.php index ed3c1c50d..0ee1ea2a2 100644 --- a/application/helpers/locale_helper.php +++ b/application/helpers/locale_helper.php @@ -71,7 +71,8 @@ function get_languages() 'th:thai' => 'Thai', 'tr:turkish' => 'Turkish', 'vi:vietnamese' => 'Vietnamese', - 'zh:simplified-chinese' => 'Chinese' + 'zh-Hans:simplified-chinese' => 'Chinese Simplified Script', + 'zh-Hant:traditional-chinese' => 'Chinese Traditional Script' ); } diff --git a/application/language/Language code definition b/application/language/Language code definition index be122151f..fb6d86c0b 100644 --- a/application/language/Language code definition +++ b/application/language/Language code definition @@ -235,6 +235,8 @@ xh Xhosa xh-ZA Xhosa (South Africa) zh Chinese zh-CN Chinese (S) +zh-Hans Chinese in the simplified scrip +zh-Hant Chinese in the traditional script zh-HK Chinese (Hong Kong) zh-MO Chinese (Macau) zh-SG Chinese (Singapore) diff --git a/application/language/zh/attributes_lang.php b/application/language/zh-Hans/attributes_lang.php similarity index 100% rename from application/language/zh/attributes_lang.php rename to application/language/zh-Hans/attributes_lang.php diff --git a/application/language/zh/bootstrap_tables_lang.php b/application/language/zh-Hans/bootstrap_tables_lang.php similarity index 100% rename from application/language/zh/bootstrap_tables_lang.php rename to application/language/zh-Hans/bootstrap_tables_lang.php diff --git a/application/language/zh/cashups_lang.php b/application/language/zh-Hans/cashups_lang.php similarity index 100% rename from application/language/zh/cashups_lang.php rename to application/language/zh-Hans/cashups_lang.php diff --git a/application/language/zh/common_lang.php b/application/language/zh-Hans/common_lang.php old mode 100755 new mode 100644 similarity index 100% rename from application/language/zh/common_lang.php rename to application/language/zh-Hans/common_lang.php diff --git a/application/language/zh/config_lang.php b/application/language/zh-Hans/config_lang.php old mode 100755 new mode 100644 similarity index 100% rename from application/language/zh/config_lang.php rename to application/language/zh-Hans/config_lang.php diff --git a/application/language/zh/customers_lang.php b/application/language/zh-Hans/customers_lang.php old mode 100755 new mode 100644 similarity index 100% rename from application/language/zh/customers_lang.php rename to application/language/zh-Hans/customers_lang.php diff --git a/application/language/zh/datepicker_lang.php b/application/language/zh-Hans/datepicker_lang.php similarity index 100% rename from application/language/zh/datepicker_lang.php rename to application/language/zh-Hans/datepicker_lang.php diff --git a/application/language/zh/employees_lang.php b/application/language/zh-Hans/employees_lang.php old mode 100755 new mode 100644 similarity index 100% rename from application/language/zh/employees_lang.php rename to application/language/zh-Hans/employees_lang.php diff --git a/application/language/zh/enum_lang.php b/application/language/zh-Hans/enum_lang.php similarity index 100% rename from application/language/zh/enum_lang.php rename to application/language/zh-Hans/enum_lang.php diff --git a/application/language/zh/error_lang.php b/application/language/zh-Hans/error_lang.php old mode 100755 new mode 100644 similarity index 100% rename from application/language/zh/error_lang.php rename to application/language/zh-Hans/error_lang.php diff --git a/application/language/zh/expenses_categories_lang.php b/application/language/zh-Hans/expenses_categories_lang.php similarity index 100% rename from application/language/zh/expenses_categories_lang.php rename to application/language/zh-Hans/expenses_categories_lang.php diff --git a/application/language/zh/expenses_lang.php b/application/language/zh-Hans/expenses_lang.php similarity index 100% rename from application/language/zh/expenses_lang.php rename to application/language/zh-Hans/expenses_lang.php diff --git a/application/language/zh/giftcards_lang.php b/application/language/zh-Hans/giftcards_lang.php old mode 100755 new mode 100644 similarity index 100% rename from application/language/zh/giftcards_lang.php rename to application/language/zh-Hans/giftcards_lang.php diff --git a/application/language/zh/index.html b/application/language/zh-Hans/index.html old mode 100755 new mode 100644 similarity index 92% rename from application/language/zh/index.html rename to application/language/zh-Hans/index.html index 0dcbf067f..b702fbc39 --- a/application/language/zh/index.html +++ b/application/language/zh-Hans/index.html @@ -1,11 +1,11 @@ - - - - 403 Forbidden - - - -

          Directory access is forbidden.

          - - + + + + 403 Forbidden + + + +

          Directory access is forbidden.

          + + diff --git a/application/language/zh/item_kits_lang.php b/application/language/zh-Hans/item_kits_lang.php old mode 100755 new mode 100644 similarity index 100% rename from application/language/zh/item_kits_lang.php rename to application/language/zh-Hans/item_kits_lang.php diff --git a/application/language/zh/items_lang.php b/application/language/zh-Hans/items_lang.php old mode 100755 new mode 100644 similarity index 100% rename from application/language/zh/items_lang.php rename to application/language/zh-Hans/items_lang.php diff --git a/application/language/zh/login_lang.php b/application/language/zh-Hans/login_lang.php old mode 100755 new mode 100644 similarity index 100% rename from application/language/zh/login_lang.php rename to application/language/zh-Hans/login_lang.php diff --git a/application/language/zh/messages_lang.php b/application/language/zh-Hans/messages_lang.php similarity index 100% rename from application/language/zh/messages_lang.php rename to application/language/zh-Hans/messages_lang.php diff --git a/application/language/zh/module_lang.php b/application/language/zh-Hans/module_lang.php old mode 100755 new mode 100644 similarity index 100% rename from application/language/zh/module_lang.php rename to application/language/zh-Hans/module_lang.php diff --git a/application/language/zh/receivings_lang.php b/application/language/zh-Hans/receivings_lang.php old mode 100755 new mode 100644 similarity index 100% rename from application/language/zh/receivings_lang.php rename to application/language/zh-Hans/receivings_lang.php diff --git a/application/language/zh/reports_lang.php b/application/language/zh-Hans/reports_lang.php old mode 100755 new mode 100644 similarity index 100% rename from application/language/zh/reports_lang.php rename to application/language/zh-Hans/reports_lang.php diff --git a/application/language/zh/sales_lang.php b/application/language/zh-Hans/sales_lang.php old mode 100755 new mode 100644 similarity index 100% rename from application/language/zh/sales_lang.php rename to application/language/zh-Hans/sales_lang.php diff --git a/application/language/zh/suppliers_lang.php b/application/language/zh-Hans/suppliers_lang.php old mode 100755 new mode 100644 similarity index 100% rename from application/language/zh/suppliers_lang.php rename to application/language/zh-Hans/suppliers_lang.php diff --git a/application/language/zh/taxes_lang.php b/application/language/zh-Hans/taxes_lang.php similarity index 100% rename from application/language/zh/taxes_lang.php rename to application/language/zh-Hans/taxes_lang.php diff --git a/application/language/zh-Hant/attributes_lang.php b/application/language/zh-Hant/attributes_lang.php new file mode 100644 index 000000000..30bdd17e8 --- /dev/null +++ b/application/language/zh-Hant/attributes_lang.php @@ -0,0 +1,25 @@ + + + + 403 Forbidden + + + +

          Directory access is forbidden.

          + + + diff --git a/application/language/zh-Hant/item_kits_lang.php b/application/language/zh-Hant/item_kits_lang.php new file mode 100644 index 000000000..042b77e35 --- /dev/null +++ b/application/language/zh-Hant/item_kits_lang.php @@ -0,0 +1,35 @@ + Date: Sat, 3 Nov 2018 20:19:19 +0100 Subject: [PATCH 351/568] Fix issue with PHP7.2 (#2190) --- application/models/Attribute.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/Attribute.php b/application/models/Attribute.php index 09c726e85..9dd597b76 100644 --- a/application/models/Attribute.php +++ b/application/models/Attribute.php @@ -127,7 +127,7 @@ class Attribute extends CI_Model public function get_values_by_definitions($definition_ids) { - if (count($definition_ids) > 0) + if(count($definition_ids ? : [])) { $this->db->from('attribute_definitions'); From db6963a8a637ceebb23195c880d7f92d5c4d6230 Mon Sep 17 00:00:00 2001 From: jekkos Date: Sat, 3 Nov 2018 23:23:42 +0100 Subject: [PATCH 352/568] Fix blank screen after update (#2201) --- application/controllers/Attributes.php | 7 ++++++- application/views/attributes/form.php | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/application/controllers/Attributes.php b/application/controllers/Attributes.php index 394ccd8b9..ee2fd3e90 100644 --- a/application/controllers/Attributes.php +++ b/application/controllers/Attributes.php @@ -58,6 +58,7 @@ class Attributes extends Secure_Controller public function save_definition($definition_id = -1) { + $definition_flags = 0; $flags = (empty($this->input->post('definition_flags'))) ? array() : $this->input->post('definition_flags'); @@ -71,10 +72,14 @@ class Attributes extends Secure_Controller $definition_data = array( 'definition_name' => $this->input->post('definition_name'), 'definition_flags' => $definition_flags, - 'definition_type' => DEFINITION_TYPES[$this->input->post('definition_type')], 'definition_fk' => $this->input->post('definition_group') != '' ? $this->input->post('definition_group') : NULL ); + if ($this->input->post('definition_type') != null) + { + $definition_data['definition_type'] = DEFINITION_TYPES[$this->input->post('definition_type')]; + } + $definition_name = $this->xss_clean($definition_data['definition_name']); if($this->Attribute->save_definition($definition_data, $definition_id)) diff --git a/application/views/attributes/form.php b/application/views/attributes/form.php index e092d3143..d41655c31 100644 --- a/application/views/attributes/form.php +++ b/application/views/attributes/form.php @@ -156,7 +156,6 @@ $(document).ready(function() { $(form).ajaxSubmit({ beforeSerialize: function($form, options) { - $("select").removeAttr('disabled'); is_new && $('').attr({ id: 'definition_values', type: 'hidden', From 465a2c29d5490baec1fbdac819dc652de5849f63 Mon Sep 17 00:00:00 2001 From: jekkos Date: Sun, 4 Nov 2018 18:53:25 +0100 Subject: [PATCH 353/568] Fix temporal dependency in migration --- application/migrations/20170502221506_sales_tax_data.php | 6 +++--- application/models/Appconfig.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/application/migrations/20170502221506_sales_tax_data.php b/application/migrations/20170502221506_sales_tax_data.php index 5b986fae0..f75f09ab3 100644 --- a/application/migrations/20170502221506_sales_tax_data.php +++ b/application/migrations/20170502221506_sales_tax_data.php @@ -36,9 +36,9 @@ class Migration_Sales_Tax_Data extends CI_Migration private function upgrade_tax_history_for_sale($sale_id) { $CI =& get_instance(); - $tax_decimals = $CI->config->config['tax_decimals']; - $tax_included = $CI->config->config['tax_included']; - $customer_sales_tax_support = $CI->config->config['customer_sales_tax_support']; + $tax_decimals = $CI->Appconfig->get('tax_decimals', 2); + $tax_included = $CI->Appconfig->get('tax_included', 0); + $customer_sales_tax_support = $CI->Appconfig->get('customer_sales_tax_support', 0); if($tax_included) { diff --git a/application/models/Appconfig.php b/application/models/Appconfig.php index 09cfef6ef..373c4a842 100644 --- a/application/models/Appconfig.php +++ b/application/models/Appconfig.php @@ -22,7 +22,7 @@ class Appconfig extends CI_Model return $this->db->get(); } - public function get($key) + public function get($key, $default = '') { $query = $this->db->get_where('app_config', array('key' => $key), 1); @@ -31,7 +31,7 @@ class Appconfig extends CI_Model return $query->row()->value; } - return ''; + return $default; } public function save($key, $value) From 2e67007c69877c5ce47d93d508f89af260f269d3 Mon Sep 17 00:00:00 2001 From: jekkos Date: Thu, 15 Nov 2018 21:54:35 +0100 Subject: [PATCH 354/568] Fix attributes submit error (#2201) --- application/views/attributes/form.php | 2 +- bower.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/views/attributes/form.php b/application/views/attributes/form.php index d41655c31..8cda67c92 100644 --- a/application/views/attributes/form.php +++ b/application/views/attributes/form.php @@ -104,7 +104,7 @@ $(document).ready(function() { var is_event = typeof(value) !== 'string'; - if (!$('#attribute_form').valid()) + if ($("#definition_value").val().match(/(\||:)/g) != null) { return; } diff --git a/bower.json b/bower.json index e6ab56739..d38b6e401 100644 --- a/bower.json +++ b/bower.json @@ -25,7 +25,7 @@ ], "dependencies": { "jquery-form": "~4.2.2", - "jquery-validate": "~1.14.0", + "jquery-validate": "~1.17.0", "jquery": "~2.1.4", "jquery-ui": "~1.11.4", "bootstrap3-dialog": "https://github.com/nakupanda/bootstrap3-dialog.git#master", From c93b057ba1ce5b458802844bff61f70b139d768f Mon Sep 17 00:00:00 2001 From: jekkos Date: Thu, 15 Nov 2018 22:08:54 +0100 Subject: [PATCH 355/568] Fix items column sorting order (#2224) --- application/helpers/tabular_helper.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/application/helpers/tabular_helper.php b/application/helpers/tabular_helper.php index 5f301cd7e..926a501c3 100644 --- a/application/helpers/tabular_helper.php +++ b/application/helpers/tabular_helper.php @@ -333,9 +333,7 @@ function get_items_manage_table_headers() array('unit_price' => $CI->lang->line('items_unit_price')), array('quantity' => $CI->lang->line('items_quantity')), array('tax_percents' => $CI->lang->line('items_tax_percents'), 'sortable' => FALSE), - array('item_pic' => $CI->lang->line('items_image'), 'sortable' => FALSE), - array('inventory' => ''), - array('stock' => '') + array('item_pic' => $CI->lang->line('items_image'), 'sortable' => FALSE) ); foreach($definition_names as $definition_id => $definition_name) @@ -343,6 +341,9 @@ function get_items_manage_table_headers() $headers[] = array($definition_id => $definition_name); } + $headers[] = array('inventory' => ''); + $headers[] = array('stock' => ''); + return transform_headers($headers); } @@ -390,7 +391,7 @@ function get_item_data_row($item) $definition_names = $CI->Attribute->get_definitions_by_flags(Attribute::SHOW_IN_ITEMS); - $result = array ( + $columns = array ( 'items.item_id' => $item->item_id, 'item_number' => $item->item_number, 'name' => $item->name, @@ -400,7 +401,10 @@ function get_item_data_row($item) 'unit_price' => to_currency($item->unit_price), 'quantity' => to_quantity_decimals($item->quantity), 'tax_percents' => !$tax_percents ? '-' : $tax_percents, - 'item_pic' => $image, + 'item_pic' => $image + ); + + $icons = array( 'inventory' => anchor($controller_name."/inventory/$item->item_id", '', array('class' => 'modal-dlg', 'data-btn-submit' => $CI->lang->line('common_submit'), 'title' => $CI->lang->line($controller_name.'_count')) ), @@ -409,10 +413,11 @@ function get_item_data_row($item) ), 'edit' => anchor($controller_name."/view/$item->item_id", '', array('class' => 'modal-dlg', 'data-btn-submit' => $CI->lang->line('common_submit'), 'title' => $CI->lang->line($controller_name.'_update')) - )); + ) + ); $attribute_values = (property_exists($item, 'attribute_values')) ? $item->attribute_values : ""; - return $result + expand_attribute_values($definition_names, $attribute_values); + return $columns + expand_attribute_values($definition_names, $attribute_values) + $icons; } From e8aa12a2968da834f5c62f38fda3124b93f20928 Mon Sep 17 00:00:00 2001 From: jekkos Date: Thu, 15 Nov 2018 23:23:20 +0100 Subject: [PATCH 356/568] Add default attribute visiblity (#2224) --- .../migrations/sqlscripts/attributes.sql | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/application/migrations/sqlscripts/attributes.sql b/application/migrations/sqlscripts/attributes.sql index 8d475c34d..b41ccf720 100644 --- a/application/migrations/sqlscripts/attributes.sql +++ b/application/migrations/sqlscripts/attributes.sql @@ -56,16 +56,16 @@ INSERT INTO `ospos_grants` (`permission_id`, `person_id`, `menu_group`) VALUES -- 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' AND `value` <> ''; -INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom2_name' AND `value` <> ''; -INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom3_name' AND `value` <> ''; -INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom4_name' AND `value` <> ''; -INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom5_name' AND `value` <> ''; -INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom6_name' AND `value` <> ''; -INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom7_name' AND `value` <> ''; -INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom8_name' AND `value` <> ''; -INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom9_name' AND `value` <> ''; -INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type) SELECT `value`, 'TEXT' FROM ospos_app_config WHERE `key` = 'custom10_name' AND `value` <> ''; +INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type, definition_flags) SELECT `value`, 'TEXT', 7 FROM ospos_app_config WHERE `key` = 'custom1_name' AND `value` <> ''; +INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type, definition_flags) SELECT `value`, 'TEXT', 7 FROM ospos_app_config WHERE `key` = 'custom2_name' AND `value` <> ''; +INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type, definition_flags) SELECT `value`, 'TEXT', 7 FROM ospos_app_config WHERE `key` = 'custom3_name' AND `value` <> ''; +INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type, definition_flags) SELECT `value`, 'TEXT', 7 FROM ospos_app_config WHERE `key` = 'custom4_name' AND `value` <> ''; +INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type, definition_flags) SELECT `value`, 'TEXT', 7 FROM ospos_app_config WHERE `key` = 'custom5_name' AND `value` <> ''; +INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type, definition_flags) SELECT `value`, 'TEXT', 7 FROM ospos_app_config WHERE `key` = 'custom6_name' AND `value` <> ''; +INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type, definition_flags) SELECT `value`, 'TEXT', 7 FROM ospos_app_config WHERE `key` = 'custom7_name' AND `value` <> ''; +INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type, definition_flags) SELECT `value`, 'TEXT', 7 FROM ospos_app_config WHERE `key` = 'custom8_name' AND `value` <> ''; +INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type, definition_flags) SELECT `value`, 'TEXT', 7 FROM ospos_app_config WHERE `key` = 'custom9_name' AND `value` <> ''; +INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type, definition_flags) SELECT `value`, 'TEXT', 7 FROM ospos_app_config WHERE `key` = 'custom10_name' AND `value` <> ''; 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; From bbac4c58478d4c67452431ea717c6cd014abc3a7 Mon Sep 17 00:00:00 2001 From: jekkos Date: Thu, 15 Nov 2018 23:31:36 +0100 Subject: [PATCH 357/568] Set migrated attribute visiblity to items only (#2224) --- .../migrations/sqlscripts/attributes.sql | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/application/migrations/sqlscripts/attributes.sql b/application/migrations/sqlscripts/attributes.sql index b41ccf720..6eed72aa8 100644 --- a/application/migrations/sqlscripts/attributes.sql +++ b/application/migrations/sqlscripts/attributes.sql @@ -56,16 +56,16 @@ INSERT INTO `ospos_grants` (`permission_id`, `person_id`, `menu_group`) VALUES -- 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, definition_flags) SELECT `value`, 'TEXT', 7 FROM ospos_app_config WHERE `key` = 'custom1_name' AND `value` <> ''; -INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type, definition_flags) SELECT `value`, 'TEXT', 7 FROM ospos_app_config WHERE `key` = 'custom2_name' AND `value` <> ''; -INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type, definition_flags) SELECT `value`, 'TEXT', 7 FROM ospos_app_config WHERE `key` = 'custom3_name' AND `value` <> ''; -INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type, definition_flags) SELECT `value`, 'TEXT', 7 FROM ospos_app_config WHERE `key` = 'custom4_name' AND `value` <> ''; -INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type, definition_flags) SELECT `value`, 'TEXT', 7 FROM ospos_app_config WHERE `key` = 'custom5_name' AND `value` <> ''; -INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type, definition_flags) SELECT `value`, 'TEXT', 7 FROM ospos_app_config WHERE `key` = 'custom6_name' AND `value` <> ''; -INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type, definition_flags) SELECT `value`, 'TEXT', 7 FROM ospos_app_config WHERE `key` = 'custom7_name' AND `value` <> ''; -INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type, definition_flags) SELECT `value`, 'TEXT', 7 FROM ospos_app_config WHERE `key` = 'custom8_name' AND `value` <> ''; -INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type, definition_flags) SELECT `value`, 'TEXT', 7 FROM ospos_app_config WHERE `key` = 'custom9_name' AND `value` <> ''; -INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type, definition_flags) SELECT `value`, 'TEXT', 7 FROM ospos_app_config WHERE `key` = 'custom10_name' AND `value` <> ''; +INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type, definition_flags) SELECT `value`, 'TEXT', 1 FROM ospos_app_config WHERE `key` = 'custom1_name' AND `value` <> ''; +INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type, definition_flags) SELECT `value`, 'TEXT', 1 FROM ospos_app_config WHERE `key` = 'custom2_name' AND `value` <> ''; +INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type, definition_flags) SELECT `value`, 'TEXT', 1 FROM ospos_app_config WHERE `key` = 'custom3_name' AND `value` <> ''; +INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type, definition_flags) SELECT `value`, 'TEXT', 1 FROM ospos_app_config WHERE `key` = 'custom4_name' AND `value` <> ''; +INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type, definition_flags) SELECT `value`, 'TEXT', 1 FROM ospos_app_config WHERE `key` = 'custom5_name' AND `value` <> ''; +INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type, definition_flags) SELECT `value`, 'TEXT', 1 FROM ospos_app_config WHERE `key` = 'custom6_name' AND `value` <> ''; +INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type, definition_flags) SELECT `value`, 'TEXT', 1 FROM ospos_app_config WHERE `key` = 'custom7_name' AND `value` <> ''; +INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type, definition_flags) SELECT `value`, 'TEXT', 1 FROM ospos_app_config WHERE `key` = 'custom8_name' AND `value` <> ''; +INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type, definition_flags) SELECT `value`, 'TEXT', 1 FROM ospos_app_config WHERE `key` = 'custom9_name' AND `value` <> ''; +INSERT INTO `ospos_attribute_definitions` (definition_name, definition_type, definition_flags) SELECT `value`, 'TEXT', 1 FROM ospos_app_config WHERE `key` = 'custom10_name' AND `value` <> ''; 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; From ceeebfcc62990e8437ab5676cfc76911f38da668 Mon Sep 17 00:00:00 2001 From: jekkos Date: Fri, 16 Nov 2018 09:02:08 +0100 Subject: [PATCH 358/568] Bump minimum PHP version in composer --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 122db3aba..a27685a2b 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ ], "homepage": "https://github.com/opensourcepos/opensourcepos", "require": { - "php": "^5.5 || ^7.0", + "php": "^5.6 || ^7.0", "codeigniter/framework": "^3.1", "dompdf/dompdf": "^0.7", "tamtamchik/namecase": "^1.0", From 3a66646e09a3fab02d930d523512947fd47034f2 Mon Sep 17 00:00:00 2001 From: jekkos Date: Fri, 16 Nov 2018 09:04:28 +0100 Subject: [PATCH 359/568] Update minimum supported PHP version --- INSTALL.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index ae6bb766f..73c2e0b90 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,7 +1,7 @@ Server Requirements ------------------- -* PHP version 5.6 to 7.2 is recommended. Please note that PHP needs to have `php-gd`, `php-bcmath`, `php-intl`, `php-openssl`, `php-mbstring` and `php-curl` installed and enabled. +* PHP version 5.6 to 7.2 are supported. Please note that PHP needs to have `php-gd`, `php-bcmath`, `php-intl`, `php-openssl`, `php-mbstring` and `php-curl` installed and enabled. * MySQL 5.5, 5.6 and 5.7 are supported, also MariaDB replacement is supported and apparently offering better performance. diff --git a/README.md b/README.md index d6b6ef721..d8f11514f 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ Bug reports must follow this schema: 2. OS name and version running your Web Server (e.g. CentOS 6.9, Ubuntu 16.4, Windows 10) 3. Web Server name and version (e.g. Apache 2.2, Apache 2.4, Nginx 1.12, Nginx 1.13) 4. Database name and version (e.g. MySQL 5.5, MySQL 5.6, MySQL 5.7, MariaDB 10.0, MariaDB 10.1, MariaDB 10.2) -5. PHP version (e.g. 5.5, 5.6, 7.0, 7.1) +5. PHP version (e.g. 5.6, 7.0, 7.1, 7.2) 6. Language selected in OSPOS (e.g. English, Spanish) 7. Any configuration of OSPOS that you changed 8. Exact steps to reproduce the issue (test case) From 383a2d05201726f6b12f82703f2f81bace28b17f Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sat, 17 Nov 2018 20:32:26 +0000 Subject: [PATCH 360/568] Update composer.lock --- composer.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.lock b/composer.lock index 19fc31318..a7785e39d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "b2409bf432f1299f214a189451e901bc", - "content-hash": "f6ad939a9d4ea5cb3f83d213ea2a299b", + "hash": "056be8f6f16ffaf669d0c02563435c06", + "content-hash": "785d1198446c034f8ab3482fbfeac2e2", "packages": [ { "name": "codeigniter/framework", @@ -364,7 +364,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^5.5 || ^7.0" + "php": "^5.6 || ^7.0" }, "platform-dev": [] } From 9f386b003bcfaf6bf0d9572c01fa825e8e532e8c Mon Sep 17 00:00:00 2001 From: jekkos Date: Fri, 23 Nov 2018 09:15:42 +0100 Subject: [PATCH 361/568] Keep attributes selected when creating new items (#2221) --- application/views/items/form.php | 6 +++--- application/views/receivings/receiving.php | 6 +++--- public/js/manage_tables.js | 3 +++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/application/views/items/form.php b/application/views/items/form.php index ca7bf739b..8e9759456 100644 --- a/application/views/items/form.php +++ b/application/views/items/form.php @@ -452,10 +452,10 @@ $(document).ready(function() // set action of item_form to url without item id, so a new one can be created $('#item_form').attr('action', ""); // 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(''); + $(':text, :password, :file, #description, #item_form').not('.quantity, #reorder_level, #tax_name_1, #receiving_quantity, ' + + '#tax_percent_name_1, #category, #reference_number, #name, #cost_price, #unit_price, #taxed_cost_price, #taxed_unit_price, #definition_name, [name^="attribute_links"]').val(''); // de-select any checkboxes, radios and drop-down menus - $(':input', '#item_form').not('#category').removeAttr('checked').removeAttr('selected'); + $(':input', '#item_form').removeAttr('checked').removeAttr('selected'); } else { diff --git a/application/views/receivings/receiving.php b/application/views/receivings/receiving.php index 9aa96cd6f..43726dd0f 100644 --- a/application/views/receivings/receiving.php +++ b/application/views/receivings/receiving.php @@ -86,8 +86,8 @@ if (isset($success))
        • +
          + lang->line('config_include_hsn'), 'include_hsn', array('class' => 'control-label col-xs-2')); ?> +
          + 'include_hsn', + 'id' => 'include_hsn', + 'value' => 'include_hsn', + 'checked' => $this->config->item('include_hsn'))); ?> +
          +
          +
          lang->line('config_backup_database'), 'config_backup_database', array('class' => 'control-label col-xs-2')); ?>
          diff --git a/application/views/configs/invoice_config.php b/application/views/configs/invoice_config.php index 3d719e217..3e95273a0 100644 --- a/application/views/configs/invoice_config.php +++ b/application/views/configs/invoice_config.php @@ -15,6 +15,13 @@
          +
          + lang->line('config_invoice_type'), 'invoice_type', array('class' => 'control-label col-xs-2')); ?> +
          + config->item('invoice_type'), array('class' => 'form-control input-sm')); ?> +
          +
          +
          lang->line('config_register_mode_default'), 'default_register_mode', array('class' => 'control-label col-xs-2')); ?>
          @@ -169,7 +176,7 @@ $(document).ready(function() var enable_disable_invoice_enable = (function() { var invoice_enabled = $("#invoice_enable").is(":checked"); var work_order_enabled = $("#work_order_enable").is(":checked"); - $("#sales_invoice_format, #recv_invoice_format, #invoice_default_comments, #invoice_email_message, select[name='default_register_mode'], #sales_quote_format, select[name='line_sequence'], #last_used_invoice_number, #last_used_quote_number, #quote_default_comments, #work_order_enable, #work_order_format, #last_used_work_order_number").prop("disabled", !invoice_enabled); + $("#sales_invoice_format, #recv_invoice_format, #invoice_default_comments, #invoice_email_message, select[name='default_register_mode'], select[name='invoice_type'], #sales_quote_format, select[name='line_sequence'], #last_used_invoice_number, #last_used_quote_number, #quote_default_comments, #work_order_enable, #work_order_format, #last_used_work_order_number").prop("disabled", !invoice_enabled); if(invoice_enabled) { $("#work_order_format, #last_used_work_order_number").prop("disabled", !work_order_enabled); } else { diff --git a/application/views/configs/reward_config.php b/application/views/configs/reward_config.php index 7d6db5450..bc4922679 100644 --- a/application/views/configs/reward_config.php +++ b/application/views/configs/reward_config.php @@ -69,7 +69,6 @@ $(document).ready(function() var previous_id = 'customer_reward_' + id; var previous_id_next = 'reward_points_' + id; var block = $(this).parent().clone(true); - console.log(block); var new_block = block.insertAfter($(this).parent()); var new_block_id = 'customer_reward_' + ++id; var new_block_id_next = 'reward_points_' + id; diff --git a/application/views/configs/tax_config.php b/application/views/configs/tax_config.php index 39f87bf64..d10e662d3 100644 --- a/application/views/configs/tax_config.php +++ b/application/views/configs/tax_config.php @@ -4,6 +4,17 @@
          lang->line('common_fields_required_message'); ?>
            +
            + lang->line('config_tax_id'), 'tax_id', array('class' => 'control-label col-xs-2')); ?> +
            + 'tax_id', + 'id' => 'tax_id', + 'class' => 'form-control input-sm', + 'value' => $this->config->item('tax_id'))); ?> +
            +
            +
            lang->line('config_tax_included'), 'tax_included', array('class' => 'control-label col-xs-2')); ?>
            @@ -54,28 +65,37 @@
            - lang->line('config_customer_sales_tax_support'), 'customer_sales_tax_support', array('class' => 'control-label col-xs-2')); ?> + lang->line('config_use_destination_based_tax'), 'use_destination_based_tax', array('class' => 'control-label col-xs-2')); ?>
            'customer_sales_tax_support', - 'id' => 'customer_sales_tax_support', - 'value' => 'customer_sales_tax_support', - 'checked'=>$this->config->item('customer_sales_tax_support'))); ?> + 'name' => 'use_destination_based_tax', + 'id' => 'use_destination_based_tax', + 'value' => 'use_destination_based_tax', + 'checked'=>$this->config->item('use_destination_based_tax'))); ?>
            - lang->line('config_default_origin_tax_code'), 'default_origin_tax_code', array('class' => 'control-label col-xs-2')); ?> + lang->line('config_default_tax_code'), 'default_tax_code', array('class' => 'control-label col-xs-2')); ?>
            - config->item('default_origin_tax_code'), array('class' => 'form-control input-sm')); ?> + config->item('default_tax_code'), array('class' => 'form-control input-sm')); ?>
            - -
            - load->view('partial/tax_categories', array('tax_categories' => $tax_categories)); ?> +
            + lang->line('config_default_tax_category'), 'default_tax_category', array('class' => 'control-label col-xs-2')); ?> +
            + config->item('default_tax_category'), array('class' => 'form-control input-sm')); ?> +
            - + +
            + lang->line('config_default_tax_jurisdiction'), 'default_tax_jurisdiction', array('class' => 'control-label col-xs-2')); ?> +
            + config->item('default_tax_jurisdiction'), array('class' => 'form-control input-sm')); ?> +
            +
            + 'submit_tax', 'id' => 'submit_tax', @@ -83,108 +103,43 @@ 'class' => 'btn btn-primary btn-sm pull-right')); ?>
            + -load->view('partial/print_receipt', array('print_after_sale'=>$print_after_sale, 'selected_printer'=>'invoice_printer')); - - // Temporarily loads the system language for _lang to print invoice in the system language rather than user defined. - load_language(TRUE,array('sales','common')); -?> -
            diff --git a/application/views/sales/quote_email.php b/application/views/sales/quote_email.php index cf6b211fb..f30350df8 100644 --- a/application/views/sales/quote_email.php +++ b/application/views/sales/quote_email.php @@ -12,9 +12,6 @@ echo "
            ".$error_message."
            "; exit; } - - // Temporarily loads the system language for _lang to print invoice in the system language rather than user defined. - load_language(TRUE, array('sales', 'common')); ?>
            @@ -118,13 +115,13 @@ $sales_tax) + foreach($taxes as $tax_group_index=>$tax) { ?> - - + +
            @@ -143,12 +139,12 @@ $sales_tax) + foreach($taxes as $tax_group_index=>$tax) { ?> - : - + : + -
            $sales_tax) + foreach($taxes as $tax_group_index=>$tax) { ?> - : - + : + -
            $sales_tax) + foreach($taxes as $tax_group_index=>$tax) { ?> - : - + : + $sales_tax) + foreach($taxes as $tax_group_index=>$tax) { ?> - - + + load->view("partial/header"); ?> + +".$error_message."
            "; + exit; +} +?> + + + + + +load->view('partial/print_receipt', array('print_after_sale'=>$print_after_sale, 'selected_printer'=>'invoice_printer')); ?> + + + +
            + +
            +
            + + + +
            + + +
            + +
            + + + + + + + + + + + + + + +
            lang->line('sales_invoice_number');?>
            lang->line('common_date'); ?>
            lang->line('sales_amount_due'); ?>
            +
            + + + + + + + + + + + + 0) + { + $invoice_columns += 1; + ?> + + + + + + $item) + { + if($item['print_option'] == PRINT_YES) + { + ?> + + + + + + + + + + 0): ?> + + + + + + + + + + + + + + + + + + + + + + + $tax) + { + ?> + + + + + + + + + + + + + + $payment) + { + $only_sale_check |= $payment['payment_type'] == $this->lang->line('sales_check'); + $splitpayment = explode(':', $payment['payment_type']); + $show_giftcard_remainder |= $splitpayment[0] == $this->lang->line('sales_giftcard'); + ?> + + + + + + + + + + + + + + + + + + +
            lang->line('sales_item_number'); ?>lang->line('sales_hsn'); ?>lang->line('sales_item_name'); ?>lang->line('sales_quantity'); ?>lang->line('sales_price'); ?>lang->line('sales_discount'); ?>lang->line('sales_customer_discount'); ?>lang->line('sales_total'); ?>
            +
            + + + +
            +
            +
            lang->line('sales_authorized_signature');?>:
            + +
            +
            +
            + + + +
            + config->item('return_policy')); ?> +
            +
            +
            + +
            +
            +
            + + + +load->view("partial/footer"); ?> diff --git a/application/views/sales/work_order.php b/application/views/sales/work_order.php index c8d71b545..597959129 100644 --- a/application/views/sales/work_order.php +++ b/application/views/sales/work_order.php @@ -151,13 +151,13 @@ if(isset($error_message)) $sales_tax) + foreach($taxes as $tax_group_index=>$tax) { ?> - - + + ".$error_message."
            "; exit; } - - // Temporarily loads the system language for _lang to print invoice in the system language rather than user defined. - load_language(TRUE, array('sales', 'common')); ?>
            diff --git a/application/views/suppliers/form.php b/application/views/suppliers/form.php index b38697efb..e38aad396 100644 --- a/application/views/suppliers/form.php +++ b/application/views/suppliers/form.php @@ -48,6 +48,18 @@ );?>
            + +
            + lang->line('suppliers_tax_id'), 'tax_id', array('class'=>'control-label col-xs-3')); ?> +
            + 'tax_id', + 'id'=>'tax_id', + 'class'=>'form-control input-sm', + 'value'=>$person_info->tax_id) + );?> +
            +
            diff --git a/application/views/taxes/form.php b/application/views/taxes/form.php deleted file mode 100644 index 387157328..000000000 --- a/application/views/taxes/form.php +++ /dev/null @@ -1,221 +0,0 @@ -
            lang->line('common_fields_required_message'); ?>
            - -
              - -'tax_code_form', 'class'=>'form-horizontal')); ?> -
              -
              - lang->line('taxes_tax_code'), 'name', array('class'=>'required control-label col-xs-3')); ?> -
              - 'tax_code', - 'id'=>'tax_code', - 'class'=>'form-control input-sm text-uppercase', - 'value'=>$tax_code) - );?> -
              -
              - -
              - lang->line('taxes_tax_code_name'), 'name', array('class'=>'required control-label col-xs-3')); ?> -
              - 'tax_code_name', - 'id'=>'tax_code_name', - 'class'=>'form-control input-sm', - 'value'=>$tax_code_name) - );?> -
              -
              - -
              - lang->line('taxes_tax_code_type'), 'tax_code_type', !empty($basic_version) ? array('class'=>'required control-label col-xs-3') : array('class'=>'control-label col-xs-3')); ?> -
              - - - -
              -
              - -
              - lang->line('common_city'), 'city', array('class'=>'control-label col-xs-3')); ?> -
              - 'city', - 'id'=>'city', - 'class'=>'form-control input-sm', - 'value'=>$city) - );?> -
              -
              - -
              - lang->line('common_state'), 'name', array('class'=>'control-label col-xs-3')); ?> -
              - 'state', - 'id'=>'state', - 'class'=>'form-control input-sm', - 'value'=>$state) - );?> -
              -
              - -
              - lang->line('taxes_tax_rate'), 'tax_rate', array('class' => 'required control-label col-xs-3')); ?> -
              -
              - 'tax_rate', - 'id'=>'tax_rate', - 'class'=>'form-control input-sm', - 'value'=>$tax_rate) - );?> - % -
              -
              -
              - -
              - lang->line('taxes_rounding_code'), 'rounding_code', array('class' => 'control-label col-xs-3')); ?> -
              - 'form-control input-sm')); ?> -
              -
              - -
              - lang->line('taxes_add_exception'), 'add_tax_category', array('class'=>'control-label col-xs-3')); ?> -
              -
              - - 'add_tax_category', - 'id'=>'add_tax_category', - 'class'=>'form-control input-sm', - 'value'=>$add_tax_category) - );?> - -
              -
              -
              - - - - - - - - - - - - - - - - - - - - -
              lang->line('common_delete'); ?>lang->line('taxes_tax_category'); ?>lang->line('taxes_tax_rate'); ?>lang->line('taxes_rounding_code'); ?>
              ' name=exception_tax_rate[] value=""/> 'form-control input-sm'));?>
              - -
              - - - - diff --git a/application/views/taxes/manage.php b/application/views/taxes/manage.php index fa71dbb66..ffddc3c2e 100644 --- a/application/views/taxes/manage.php +++ b/application/views/taxes/manage.php @@ -1,34 +1,37 @@ load->view("partial/header"); ?> + -
              - -
              + -
              -
              - +
              +
              + load->view("taxes/tax_codes"); ?> +
              +
              + load->view("taxes/tax_jurisdictions"); ?> +
              +
              + load->view("taxes/tax_categories"); ?> +
              +
              + load->view("taxes/tax_rates"); ?>
              -
              -
              -
              - load->view("partial/footer"); ?> diff --git a/application/views/taxes/tax_categories.php b/application/views/taxes/tax_categories.php new file mode 100644 index 000000000..ce5c6b9af --- /dev/null +++ b/application/views/taxes/tax_categories.php @@ -0,0 +1,136 @@ + 'tax_categories_form', 'class' => 'form-horizontal')); ?> +
              +
              +
              lang->line('common_fields_required_message'); ?>
              +
                + +
                + load->view('partial/tax_categories'); ?> +
                + + 'submit_tax_categories', + 'id' => 'submit_tax_categories', + 'value' => $this->lang->line('common_submit'), + 'class' => 'btn btn-primary btn-sm pull-right')); ?> +
                +
                + + + diff --git a/application/views/taxes/tax_codes.php b/application/views/taxes/tax_codes.php new file mode 100644 index 000000000..ad2bd7220 --- /dev/null +++ b/application/views/taxes/tax_codes.php @@ -0,0 +1,139 @@ + 'tax_codes_form', 'class' => 'form-horizontal')); ?> +
                +
                +
                lang->line('common_fields_required_message'); ?>
                +
                  + +
                  + load->view('partial/tax_codes', array('tax_codes' => $tax_codes)); ?> +
                  + + 'submit_tax_codes', + 'id' => 'submit_tax_codes', + 'value' => $this->lang->line('common_submit'), + 'class' => 'btn btn-primary btn-sm pull-right')); ?> +
                  +
                  + + + diff --git a/application/views/taxes/tax_jurisdictions.php b/application/views/taxes/tax_jurisdictions.php new file mode 100644 index 000000000..e72c98dd0 --- /dev/null +++ b/application/views/taxes/tax_jurisdictions.php @@ -0,0 +1,147 @@ + 'tax_jurisdictions_form', 'class' => 'form-horizontal')); ?> +
                  +
                  +
                  lang->line('common_fields_required_message'); ?>
                  +
                    + +
                    + load->view('partial/tax_jurisdictions'); ?> +
                    + + 'submit_tax_jurisdictions', + 'id' => 'submit_tax_jurisdictions', + 'value' => $this->lang->line('common_submit'), + 'class' => 'btn btn-primary btn-sm pull-right')); ?> +
                    +
                    + + + diff --git a/application/views/taxes/tax_rates.php b/application/views/taxes/tax_rates.php new file mode 100644 index 000000000..b31bdfd18 --- /dev/null +++ b/application/views/taxes/tax_rates.php @@ -0,0 +1,31 @@ + + +
                    + +
                    + +
                    +
                    + +
                    +
                    + +
                    +
                    +
                    diff --git a/application/views/taxes/tax_rates_form.php b/application/views/taxes/tax_rates_form.php new file mode 100644 index 000000000..7ce3c2fee --- /dev/null +++ b/application/views/taxes/tax_rates_form.php @@ -0,0 +1,80 @@ + +
                      + +'tax_code_form', 'class'=>'form-horizontal')); ?> +
                      +
                      + lang->line('taxes_tax_code'), 'rate_tax_code_id', array('class' => 'control-label col-xs-3')); ?> +
                      + 'form-control input-sm')); ?> +
                      +
                      + +
                      + lang->line('taxes_tax_category'), 'rate_tax_category_id', array('class' => 'control-label col-xs-3')); ?> +
                      + 'form-control input-sm')); ?> +
                      +
                      + +
                      + lang->line('taxes_tax_jurisdiction'), 'rate_jurisdiction_id', array('class' => 'control-label col-xs-3')); ?> +
                      + 'form-control input-sm')); ?> +
                      +
                      + +
                      + lang->line('taxes_tax_rate'), 'tax_rate', array('class'=>'control-label col-xs-3')); ?> +
                      + 'tax_rate', + 'id'=>'tax_rate', + 'class'=>'form-control input-sm text-uppercase', + 'value'=>$tax_rate) + );?> + % +
                      + +
                      + +
                      + lang->line('taxes_tax_rounding'), 'tax_rounding_code', array('class' => 'control-label col-xs-3')); ?> +
                      + 'form-control input-sm')); + ?> +
                      +
                      +
                      + + + + diff --git a/database/tables.sql b/database/tables.sql index 6a63bfbbc..9d7068fdb 100644 --- a/database/tables.sql +++ b/database/tables.sql @@ -118,8 +118,7 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('suggestions_second_column', ''), ('suggestions_third_column', ''), ('allow_duplicate_barcodes', '0'), -('quote_default_comments', 'This is a default quote comment'), -('multi_pack_enabled', '0'); +('quote_default_comments', 'This is a default quote comment'); -- -------------------------------------------------------- @@ -243,10 +242,6 @@ CREATE TABLE `ospos_items` ( `is_serialized` tinyint(1) NOT NULL, `stock_type` TINYINT(2) NOT NULL DEFAULT 0, `item_type` TINYINT(2) NOT NULL DEFAULT 0, - `tax_category_id` int(10) NOT NULL DEFAULT 1, - `qty_per_pack` decimal(15,3) NOT NULL DEFAULT 1, - `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, @@ -760,15 +755,6 @@ CREATE TABLE IF NOT EXISTS `ospos_tax_categories` ( PRIMARY KEY (`tax_category_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; --- --- Dumping data for table `ospos_stock_locations` --- - -INSERT INTO `ospos_tax_categories` (`tax_category`, `tax_group_sequence` ) VALUES - ('Standard', 10), - ('Service', 12), - ('Alcohol', 11); - -- -------------------------------------------------------- diff --git a/import_items.csv b/import_items.csv index a0bac1be0..cd38d8cd0 100644 --- a/import_items.csv +++ b/import_items.csv @@ -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,item_image,location_id,quantity -33333334,Apple iMac,Computers,,800,1200,Tax 1,8,Tax 2,10,1,Best Computer ever,y,,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,item_image,HSN,location_id,quantity +33333334,Apple iMac,Computers,,800,1200,Tax 1,8,Tax 2,10,1,Best Computer ever,y,,item.jpg,,1,100 diff --git a/public/css/popupbox.css b/public/css/popupbox.css index 44b7f9686..5716e4392 100644 --- a/public/css/popupbox.css +++ b/public/css/popupbox.css @@ -63,23 +63,23 @@ font-size: 80%; } -#item_kit_items, #items_count_details, #tax_code_rates +#item_kit_items, #items_count_details, #tax_rates { width: 100%; } -#item_kit_items thead tr, #items_count_details thead tr, #tax_code_rates thead tr +#item_kit_items thead tr, #items_count_details thead tr, #tax_rates thead tr { background-color: #CCC; } -#item_kit_items th, #items_count_details th, #tax_code_rates th +#item_kit_items th, #items_count_details th, #tax_rates th { text-align: center; font-weight: bold; } -#item_kit_items td, #items_count_details td, #tax_code_rates td +#item_kit_items td, #items_count_details td, #tax_rates td { text-align: center; } From 804942cff553d11a4c9ac11495fb6698aecf7752 Mon Sep 17 00:00:00 2001 From: jekkos Date: Mon, 24 Dec 2018 20:18:13 +0100 Subject: [PATCH 427/568] Add warning if migration is needed (#2247) --- application/controllers/Login.php | 3 ++- application/hooks/load_config.php | 6 ++++++ application/language/en-US/common_lang.php | 1 + application/libraries/MY_Migration.php | 8 ++++++-- application/models/Employee.php | 2 +- application/views/login.php | 4 ++++ 6 files changed, 20 insertions(+), 4 deletions(-) diff --git a/application/controllers/Login.php b/application/controllers/Login.php index 44c4debdf..2c8fb8dd4 100644 --- a/application/controllers/Login.php +++ b/application/controllers/Login.php @@ -4,6 +4,7 @@ class Login extends CI_Controller { public function index() { + $this->load->library('migration'); if($this->Employee->is_logged_in()) { redirect('home'); @@ -14,6 +15,7 @@ class Login extends CI_Controller $this->form_validation->set_rules('username', 'lang:login_username', 'required|callback_login_check'); + if($this->config->item('gcaptcha_enable')) { $this->form_validation->set_rules('g-recaptcha-response', 'lang:login_gcaptcha', 'required|callback_gcaptcha_check'); @@ -41,7 +43,6 @@ class Login extends CI_Controller return FALSE; } - $this->load->library('migration'); if (!$this->migration->is_latest()) { set_time_limit(1200); diff --git a/application/hooks/load_config.php b/application/hooks/load_config.php index 15b79fce0..1cb4b0ec5 100644 --- a/application/hooks/load_config.php +++ b/application/hooks/load_config.php @@ -7,6 +7,12 @@ function load_config() { $CI =& get_instance(); + $migration = $CI->load->library('migration'); + if (!$CI->migration->is_latest()) + { + $CI->session->sess_destroy(); + } + foreach($CI->Appconfig->get_all()->result() as $app_config) { $CI->config->set_item($CI->security->xss_clean($app_config->key), $CI->security->xss_clean($app_config->value)); diff --git a/application/language/en-US/common_lang.php b/application/language/en-US/common_lang.php index fbee47eb4..d87433794 100644 --- a/application/language/en-US/common_lang.php +++ b/application/language/en-US/common_lang.php @@ -38,6 +38,7 @@ $lang["common_last_page"] = "Last"; $lang["common_learn_about_project"] = "to learn the latest information about the project."; $lang["common_list_of"] = "List of"; $lang["common_logout"] = "Logout"; +$lang["common_migration_needed"] = "A database migration to %1 will start after login."; $lang["common_new"] = "New"; $lang["common_no_persons_to_display"] = "There are no people to display."; $lang["common_none_selected_text"] = "[Select]"; diff --git a/application/libraries/MY_Migration.php b/application/libraries/MY_Migration.php index 175fe4c4a..b2f7a9969 100644 --- a/application/libraries/MY_Migration.php +++ b/application/libraries/MY_Migration.php @@ -4,11 +4,15 @@ defined('BASEPATH') OR exit('No direct script access allowed'); class MY_Migration extends CI_Migration { - public function is_latest() + public function get_last_migration() { $migrations = $this->find_migrations(); - $last_migration = basename(end($migrations)); + return basename(end($migrations)); + } + public function is_latest() + { + $last_migration = $this->get_last_migration(); $last_version = $this->_get_migration_number($last_migration); $current_version = $this->_get_version(); diff --git a/application/models/Employee.php b/application/models/Employee.php index aa4dd9f07..c9d5f5582 100644 --- a/application/models/Employee.php +++ b/application/models/Employee.php @@ -97,7 +97,7 @@ class Employee extends Person //Run these queries as a transaction, we want to make sure we do all or nothing $this->db->trans_start(); - if(parent::save($person_data, $employee_id)) + if(ENVIRONMENT != 'testing' && parent::save($person_data, $employee_id)) { if(!$employee_id || !$this->exists($employee_id)) { diff --git a/application/views/login.php b/application/views/login.php index aae7977fa..37d7c6041 100644 --- a/application/views/login.php +++ b/application/views/login.php @@ -19,6 +19,10 @@
                      + migration->is_latest()): ?> +
                      lang->line('common_migration_needed'); ?>
                      + +
                      From a5a0aa0e1be305e560c858f09d1f81c1bad943df Mon Sep 17 00:00:00 2001 From: jekkos Date: Mon, 24 Dec 2018 20:46:33 +0100 Subject: [PATCH 428/568] Refresh langauge files --- .../language/ar-EG/attributes_lang.php | 3 +- .../language/ar-EG/bootstrap_tables_lang.php | 3 +- application/language/ar-EG/cashups_lang.php | 3 +- application/language/ar-EG/common_lang.php | 4 +- application/language/ar-EG/config_lang.php | 10 +- application/language/ar-EG/customers_lang.php | 4 +- .../language/ar-EG/datepicker_lang.php | 3 +- .../ar-EG/expenses_categories_lang.php | 3 +- application/language/ar-EG/expenses_lang.php | 3 +- application/language/ar-EG/items_lang.php | 5 +- application/language/ar-EG/login_lang.php | 3 +- application/language/ar-EG/messages_lang.php | 3 +- application/language/ar-EG/module_lang.php | 3 +- .../language/ar-EG/receivings_lang.php | 3 +- application/language/ar-EG/reports_lang.php | 9 +- application/language/ar-EG/sales_lang.php | 11 + application/language/ar-EG/suppliers_lang.php | 4 +- application/language/ar-EG/taxes_lang.php | 38 ++ application/language/az-AZ/common_lang.php | 1 + application/language/az-AZ/config_lang.php | 7 + application/language/az-AZ/customers_lang.php | 1 + application/language/az-AZ/items_lang.php | 2 + application/language/az-AZ/reports_lang.php | 6 + application/language/az-AZ/sales_lang.php | 11 + application/language/az-AZ/suppliers_lang.php | 1 + application/language/az-AZ/taxes_lang.php | 38 ++ application/language/bg/common_lang.php | 1 + application/language/bg/config_lang.php | 7 + application/language/bg/customers_lang.php | 1 + application/language/bg/items_lang.php | 2 + application/language/bg/reports_lang.php | 6 + application/language/bg/sales_lang.php | 11 + application/language/bg/suppliers_lang.php | 1 + application/language/bg/taxes_lang.php | 38 ++ application/language/cs/common_lang.php | 1 + application/language/cs/config_lang.php | 7 + application/language/cs/customers_lang.php | 1 + application/language/cs/items_lang.php | 2 + application/language/cs/reports_lang.php | 6 + application/language/cs/sales_lang.php | 11 + application/language/cs/suppliers_lang.php | 1 + application/language/cs/taxes_lang.php | 38 ++ application/language/de-CH/common_lang.php | 1 + application/language/de-CH/config_lang.php | 7 + application/language/de-CH/customers_lang.php | 1 + application/language/de-CH/items_lang.php | 2 + application/language/de-CH/reports_lang.php | 6 + application/language/de-CH/sales_lang.php | 11 + application/language/de-CH/suppliers_lang.php | 1 + application/language/de-CH/taxes_lang.php | 38 ++ application/language/de/attributes_lang.php | 5 +- application/language/de/common_lang.php | 4 +- application/language/de/config_lang.php | 7 + application/language/de/customers_lang.php | 1 + application/language/de/items_lang.php | 2 + application/language/de/reports_lang.php | 6 + application/language/de/sales_lang.php | 14 +- application/language/de/suppliers_lang.php | 1 + application/language/de/taxes_lang.php | 38 ++ application/language/el/common_lang.php | 1 + application/language/el/config_lang.php | 7 + application/language/el/customers_lang.php | 1 + application/language/el/items_lang.php | 2 + application/language/el/reports_lang.php | 6 + application/language/el/sales_lang.php | 11 + application/language/el/suppliers_lang.php | 1 + application/language/el/taxes_lang.php | 38 ++ application/language/en-GB/common_lang.php | 1 + application/language/en-GB/config_lang.php | 3 +- application/language/en-GB/sales_lang.php | 8 +- application/language/en-GB/taxes_lang.php | 14 +- .../language/en-US/attributes_lang.php | 3 +- application/language/en-US/common_lang.php | 3 +- application/language/en-US/config_lang.php | 4 +- application/language/en-US/items_lang.php | 2 +- application/language/en-US/sales_lang.php | 14 +- application/language/en-US/taxes_lang.php | 17 +- application/language/es/common_lang.php | 1 + application/language/es/config_lang.php | 7 + application/language/es/customers_lang.php | 1 + application/language/es/items_lang.php | 2 + application/language/es/reports_lang.php | 6 + application/language/es/sales_lang.php | 11 + application/language/es/suppliers_lang.php | 1 + application/language/es/taxes_lang.php | 38 ++ application/language/fr/common_lang.php | 1 + application/language/fr/config_lang.php | 7 + application/language/fr/customers_lang.php | 1 + application/language/fr/items_lang.php | 2 + application/language/fr/reports_lang.php | 6 + application/language/fr/sales_lang.php | 11 + application/language/fr/suppliers_lang.php | 1 + application/language/fr/taxes_lang.php | 38 ++ application/language/hr-HR/common_lang.php | 1 + application/language/hr-HR/config_lang.php | 7 + application/language/hr-HR/customers_lang.php | 1 + application/language/hr-HR/items_lang.php | 2 + application/language/hr-HR/reports_lang.php | 6 + application/language/hr-HR/sales_lang.php | 11 + application/language/hr-HR/suppliers_lang.php | 1 + application/language/hr-HR/taxes_lang.php | 38 ++ application/language/hu-HU/common_lang.php | 1 + application/language/hu-HU/config_lang.php | 7 + application/language/hu-HU/customers_lang.php | 1 + application/language/hu-HU/items_lang.php | 2 + application/language/hu-HU/reports_lang.php | 6 + application/language/hu-HU/sales_lang.php | 11 + application/language/hu-HU/suppliers_lang.php | 1 + application/language/hu-HU/taxes_lang.php | 38 ++ application/language/id/cashups_lang.php | 3 +- application/language/id/common_lang.php | 1 + application/language/id/config_lang.php | 7 + application/language/id/customers_lang.php | 1 + application/language/id/items_lang.php | 50 +-- application/language/id/reports_lang.php | 6 + application/language/id/sales_lang.php | 11 + application/language/id/suppliers_lang.php | 1 + application/language/id/taxes_lang.php | 38 ++ application/language/it/common_lang.php | 1 + application/language/it/config_lang.php | 7 + application/language/it/customers_lang.php | 1 + application/language/it/items_lang.php | 2 + application/language/it/reports_lang.php | 6 + application/language/it/sales_lang.php | 11 + application/language/it/suppliers_lang.php | 1 + application/language/it/taxes_lang.php | 38 ++ application/language/km/common_lang.php | 1 + application/language/km/config_lang.php | 7 + application/language/km/customers_lang.php | 1 + application/language/km/items_lang.php | 2 + application/language/km/reports_lang.php | 6 + application/language/km/sales_lang.php | 11 + application/language/km/suppliers_lang.php | 1 + application/language/km/taxes_lang.php | 38 ++ application/language/lo/common_lang.php | 1 + application/language/lo/config_lang.php | 7 + application/language/lo/customers_lang.php | 1 + application/language/lo/items_lang.php | 2 + application/language/lo/reports_lang.php | 6 + application/language/lo/sales_lang.php | 11 + application/language/lo/suppliers_lang.php | 1 + application/language/lo/taxes_lang.php | 38 ++ application/language/ml/common_lang.php | 1 + application/language/ml/config_lang.php | 7 + application/language/ml/customers_lang.php | 1 + application/language/ml/items_lang.php | 2 + application/language/ml/reports_lang.php | 6 + application/language/ml/sales_lang.php | 11 + application/language/ml/suppliers_lang.php | 1 + application/language/ml/taxes_lang.php | 38 ++ application/language/nl-BE/common_lang.php | 1 + application/language/nl-BE/config_lang.php | 7 + application/language/nl-BE/customers_lang.php | 1 + application/language/nl-BE/items_lang.php | 56 +-- application/language/nl-BE/reports_lang.php | 6 + application/language/nl-BE/sales_lang.php | 11 + application/language/nl-BE/suppliers_lang.php | 1 + application/language/nl-BE/taxes_lang.php | 38 ++ application/language/nl/common_lang.php | 1 + application/language/nl/config_lang.php | 7 + application/language/nl/customers_lang.php | 1 + application/language/nl/items_lang.php | 2 + application/language/nl/reports_lang.php | 6 + application/language/nl/sales_lang.php | 11 + application/language/nl/suppliers_lang.php | 1 + application/language/nl/taxes_lang.php | 38 ++ application/language/pt-BR/common_lang.php | 1 + application/language/pt-BR/config_lang.php | 10 +- application/language/pt-BR/customers_lang.php | 1 + application/language/pt-BR/items_lang.php | 2 + application/language/pt-BR/reports_lang.php | 6 + application/language/pt-BR/sales_lang.php | 11 + application/language/pt-BR/suppliers_lang.php | 1 + application/language/pt-BR/taxes_lang.php | 38 ++ application/language/ro/common_lang.php | 1 + application/language/ro/config_lang.php | 7 + application/language/ro/customers_lang.php | 1 + application/language/ro/items_lang.php | 2 + application/language/ro/reports_lang.php | 6 + application/language/ro/sales_lang.php | 11 + application/language/ro/suppliers_lang.php | 1 + application/language/ro/taxes_lang.php | 38 ++ application/language/ru/common_lang.php | 1 + application/language/ru/config_lang.php | 325 +++++++++--------- application/language/ru/customers_lang.php | 1 + application/language/ru/items_lang.php | 56 +-- application/language/ru/reports_lang.php | 6 + application/language/ru/sales_lang.php | 11 + application/language/ru/suppliers_lang.php | 1 + application/language/ru/taxes_lang.php | 38 ++ application/language/sv/common_lang.php | 1 + application/language/sv/config_lang.php | 7 + application/language/sv/customers_lang.php | 1 + application/language/sv/items_lang.php | 2 + application/language/sv/reports_lang.php | 6 + application/language/sv/sales_lang.php | 11 + application/language/sv/suppliers_lang.php | 1 + application/language/sv/taxes_lang.php | 38 ++ application/language/th/common_lang.php | 1 + application/language/th/config_lang.php | 7 + application/language/th/customers_lang.php | 1 + application/language/th/items_lang.php | 2 + application/language/th/reports_lang.php | 6 + application/language/th/sales_lang.php | 11 + application/language/th/suppliers_lang.php | 1 + application/language/th/taxes_lang.php | 38 ++ application/language/tr/common_lang.php | 1 + application/language/tr/config_lang.php | 7 + application/language/tr/customers_lang.php | 1 + application/language/tr/items_lang.php | 2 + application/language/tr/reports_lang.php | 6 + application/language/tr/sales_lang.php | 11 + application/language/tr/suppliers_lang.php | 1 + application/language/tr/taxes_lang.php | 38 ++ application/language/vi/common_lang.php | 1 + application/language/vi/config_lang.php | 7 + application/language/vi/customers_lang.php | 1 + application/language/vi/items_lang.php | 2 + application/language/vi/reports_lang.php | 6 + application/language/vi/sales_lang.php | 11 + application/language/vi/suppliers_lang.php | 1 + application/language/vi/taxes_lang.php | 38 ++ application/language/zh-Hans/common_lang.php | 1 + application/language/zh-Hans/config_lang.php | 7 + .../language/zh-Hans/customers_lang.php | 1 + application/language/zh-Hans/items_lang.php | 2 + application/language/zh-Hans/reports_lang.php | 6 + application/language/zh-Hans/sales_lang.php | 11 + .../language/zh-Hans/suppliers_lang.php | 1 + application/language/zh-Hans/taxes_lang.php | 38 ++ application/language/zh-Hant/common_lang.php | 1 + application/language/zh-Hant/config_lang.php | 7 + .../language/zh-Hant/customers_lang.php | 1 + application/language/zh-Hant/items_lang.php | 2 + application/language/zh-Hant/reports_lang.php | 6 + application/language/zh-Hant/sales_lang.php | 11 + .../language/zh-Hant/suppliers_lang.php | 1 + application/language/zh-Hant/taxes_lang.php | 38 ++ 238 files changed, 2126 insertions(+), 291 deletions(-) diff --git a/application/language/ar-EG/attributes_lang.php b/application/language/ar-EG/attributes_lang.php index 14c6ef4f2..ab7a1c61a 100644 --- a/application/language/ar-EG/attributes_lang.php +++ b/application/language/ar-EG/attributes_lang.php @@ -1,4 +1,5 @@ -"; +$lang["sales_invoice_total"] = ""; +$lang["sales_invoice_type_custom_invoice"] = ""; +$lang["sales_invoice_type_custom_tax_invoice"] = ""; +$lang["sales_invoice_type_invoice"] = ""; +$lang["sales_invoice_type_tax_invoice"] = ""; $lang["sales_invoice_unsent"] = "Fatura şuna gönderilemedi"; $lang["sales_invoice_update"] = ""; $lang["sales_item_insufficient_of_stock"] = "Ürün Stoğu Yetersiz"; @@ -146,6 +154,8 @@ $lang["sales_suspended_sales"] = "Askıdaki Satışlar"; $lang["sales_table"] = "Masa"; $lang["sales_takings"] = "Günlük Satış"; $lang["sales_tax"] = "Vergi"; +$lang["sales_tax_id"] = ""; +$lang["sales_tax_invoice"] = ""; $lang["sales_tax_percent"] = "Vergi %"; $lang["sales_total"] = "Toplam"; $lang["sales_total_tax_exclusive"] = "Vergi hariç"; @@ -158,6 +168,7 @@ $lang["sales_unsuccessfully_updated"] = "Satış düzenlenemedi"; $lang["sales_unsuspend"] = "Satışa Al"; $lang["sales_unsuspend_and_delete"] = "Hareket"; $lang["sales_update"] = "Güncelle"; +$lang["sales_upi"] = ""; $lang["sales_work_order"] = "İş Emri"; $lang["sales_work_order_number"] = "İş Emri Numarası"; $lang["sales_work_order_number_duplicate"] = "İş Emri Numarası diğerinden farklı olmalı"; diff --git a/application/language/tr/suppliers_lang.php b/application/language/tr/suppliers_lang.php index e5f88be51..5c0117c08 100644 --- a/application/language/tr/suppliers_lang.php +++ b/application/language/tr/suppliers_lang.php @@ -19,4 +19,5 @@ $lang["suppliers_successful_deleted"] = "Sağlayıcı silindi"; $lang["suppliers_successful_updating"] = "Sağlayıcı güncellendi"; $lang["suppliers_supplier"] = "Sağlayıcı"; $lang["suppliers_supplier_id"] = "Kimlik"; +$lang["suppliers_tax_id"] = ""; $lang["suppliers_update"] = "Sağlayıcıyı Düzenle"; diff --git a/application/language/tr/taxes_lang.php b/application/language/tr/taxes_lang.php index a8a67eeb6..7b10841f0 100644 --- a/application/language/tr/taxes_lang.php +++ b/application/language/tr/taxes_lang.php @@ -1,12 +1,21 @@ Date: Tue, 25 Dec 2018 23:34:26 +0000 Subject: [PATCH 429/568] Added translation using Weblate (Spanish (Mexico)) --- .../language/es_MX/attributes_lang.php | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 application/language/es_MX/attributes_lang.php diff --git a/application/language/es_MX/attributes_lang.php b/application/language/es_MX/attributes_lang.php new file mode 100644 index 000000000..567de9bdd --- /dev/null +++ b/application/language/es_MX/attributes_lang.php @@ -0,0 +1,27 @@ + Date: Tue, 25 Dec 2018 23:52:16 +0000 Subject: [PATCH 430/568] Added translation using Weblate (Spanish (Mexico)) --- application/language/es_MX/bootstrap_tables_lang.php | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 application/language/es_MX/bootstrap_tables_lang.php diff --git a/application/language/es_MX/bootstrap_tables_lang.php b/application/language/es_MX/bootstrap_tables_lang.php new file mode 100644 index 000000000..8cedaec71 --- /dev/null +++ b/application/language/es_MX/bootstrap_tables_lang.php @@ -0,0 +1,9 @@ + Date: Tue, 25 Dec 2018 23:57:05 +0000 Subject: [PATCH 431/568] Added translation using Weblate (Spanish (Mexico)) --- application/language/es_MX/cashups_lang.php | 37 +++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 application/language/es_MX/cashups_lang.php diff --git a/application/language/es_MX/cashups_lang.php b/application/language/es_MX/cashups_lang.php new file mode 100644 index 000000000..931b2c31c --- /dev/null +++ b/application/language/es_MX/cashups_lang.php @@ -0,0 +1,37 @@ + Date: Wed, 26 Dec 2018 00:11:06 +0000 Subject: [PATCH 432/568] Added translation using Weblate (Spanish (Mexico)) --- application/language/es_MX/common_lang.php | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 application/language/es_MX/common_lang.php diff --git a/application/language/es_MX/common_lang.php b/application/language/es_MX/common_lang.php new file mode 100644 index 000000000..d87433794 --- /dev/null +++ b/application/language/es_MX/common_lang.php @@ -0,0 +1,68 @@ + Date: Wed, 26 Dec 2018 00:55:37 +0000 Subject: [PATCH 433/568] Added translation using Weblate (Spanish (Mexico)) --- application/language/es_MX/config_lang.php | 271 +++++++++++++++++++++ 1 file changed, 271 insertions(+) create mode 100644 application/language/es_MX/config_lang.php diff --git a/application/language/es_MX/config_lang.php b/application/language/es_MX/config_lang.php new file mode 100644 index 000000000..80dcf5168 --- /dev/null +++ b/application/language/es_MX/config_lang.php @@ -0,0 +1,271 @@ + Date: Wed, 26 Dec 2018 10:24:33 +0000 Subject: [PATCH 434/568] Translated using Weblate (German) Currently translated at 80.7% (21 of 26 strings) Translation: ospos/attributes Translate-URL: http://weblate.jpeelaer.net/projects/ospos/attributes/de/ --- application/language/de/attributes_lang.php | 25 ++++++++++----------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/application/language/de/attributes_lang.php b/application/language/de/attributes_lang.php index 670573e0f..c83fbfaab 100644 --- a/application/language/de/attributes_lang.php +++ b/application/language/de/attributes_lang.php @@ -1,8 +1,7 @@ - Date: Wed, 26 Dec 2018 12:27:42 +0000 Subject: [PATCH 435/568] Translated using Weblate (German) Currently translated at 100.0% (36 of 36 strings) Translation: ospos/cashups Translate-URL: http://weblate.jpeelaer.net/projects/ospos/cashups/de/ --- application/language/de/cashups_lang.php | 75 ++++++++++++------------ 1 file changed, 37 insertions(+), 38 deletions(-) diff --git a/application/language/de/cashups_lang.php b/application/language/de/cashups_lang.php index 47655e3ba..176796d83 100644 --- a/application/language/de/cashups_lang.php +++ b/application/language/de/cashups_lang.php @@ -1,38 +1,37 @@ - Date: Wed, 26 Dec 2018 12:49:13 +0000 Subject: [PATCH 436/568] Translated using Weblate (German) Currently translated at 100.0% (66 of 66 strings) Translation: ospos/common Translate-URL: http://weblate.jpeelaer.net/projects/ospos/common/de/ --- application/language/de/common_lang.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/application/language/de/common_lang.php b/application/language/de/common_lang.php index d86659a36..1a0f9f503 100644 --- a/application/language/de/common_lang.php +++ b/application/language/de/common_lang.php @@ -1,5 +1,4 @@ - Date: Wed, 26 Dec 2018 12:55:19 +0000 Subject: [PATCH 437/568] Translated using Weblate (German) Currently translated at 91.8% (247 of 269 strings) Translation: ospos/config Translate-URL: http://weblate.jpeelaer.net/projects/ospos/config/de/ --- application/language/de/config_lang.php | 41 ++++++++++++------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/application/language/de/config_lang.php b/application/language/de/config_lang.php index d09cf9b09..16b53f17b 100644 --- a/application/language/de/config_lang.php +++ b/application/language/de/config_lang.php @@ -1,5 +1,4 @@ - Date: Wed, 26 Dec 2018 10:57:44 +0000 Subject: [PATCH 438/568] Translated using Weblate (German) Currently translated at 98.1% (106 of 108 strings) Translation: ospos/items Translate-URL: http://weblate.jpeelaer.net/projects/ospos/items/de/ --- application/language/de/items_lang.php | 95 +++++++++++++------------- 1 file changed, 47 insertions(+), 48 deletions(-) diff --git a/application/language/de/items_lang.php b/application/language/de/items_lang.php index a0591610d..1afffe764 100644 --- a/application/language/de/items_lang.php +++ b/application/language/de/items_lang.php @@ -1,45 +1,44 @@ - Date: Wed, 26 Dec 2018 11:41:38 +0000 Subject: [PATCH 439/568] Translated using Weblate (German) Currently translated at 100.0% (8 of 8 strings) Translation: ospos/login Translate-URL: http://weblate.jpeelaer.net/projects/ospos/login/de/ --- application/language/de/login_lang.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/application/language/de/login_lang.php b/application/language/de/login_lang.php index 33ffd4192..4438dc884 100644 --- a/application/language/de/login_lang.php +++ b/application/language/de/login_lang.php @@ -1,10 +1,9 @@ - Date: Wed, 26 Dec 2018 10:37:26 +0000 Subject: [PATCH 440/568] Translated using Weblate (German) Currently translated at 100.0% (39 of 39 strings) Translation: ospos/module Translate-URL: http://weblate.jpeelaer.net/projects/ospos/module/de/ --- application/language/de/module_lang.php | 57 ++++++++++++------------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/application/language/de/module_lang.php b/application/language/de/module_lang.php index 2fdce5ad3..32fa0950e 100644 --- a/application/language/de/module_lang.php +++ b/application/language/de/module_lang.php @@ -1,41 +1,40 @@ - Date: Wed, 26 Dec 2018 10:21:47 +0000 Subject: [PATCH 441/568] Translated using Weblate (German) Currently translated at 86.5% (58 of 67 strings) Translation: ospos/taxes Translate-URL: http://weblate.jpeelaer.net/projects/ospos/taxes/de/ --- application/language/de/taxes_lang.php | 117 ++++++++++++------------- 1 file changed, 58 insertions(+), 59 deletions(-) diff --git a/application/language/de/taxes_lang.php b/application/language/de/taxes_lang.php index 574bfc6a3..a41ff3d94 100644 --- a/application/language/de/taxes_lang.php +++ b/application/language/de/taxes_lang.php @@ -1,70 +1,69 @@ - Date: Wed, 26 Dec 2018 13:16:11 +0000 Subject: [PATCH 442/568] Translated using Weblate (German) Currently translated at 100.0% (108 of 108 strings) Translation: ospos/items Translate-URL: http://weblate.jpeelaer.net/projects/ospos/items/de/ --- application/language/de/items_lang.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/language/de/items_lang.php b/application/language/de/items_lang.php index 1afffe764..28cfd3fc8 100644 --- a/application/language/de/items_lang.php +++ b/application/language/de/items_lang.php @@ -29,7 +29,7 @@ $lang["items_details_count"] = "Lagerbestandsdetails"; $lang["items_do_nothing"] = "Tue nichts"; $lang["items_edit_fields_you_want_to_update"] = "Ändern Sie die Felder für die ausgewählten Artikel."; $lang["items_edit_multiple_items"] = "Mehrere Artikel bearbeiten"; -$lang["items_empty_upc_items"] = "Leere UPC Artikel"; +$lang["items_empty_upc_items"] = "Artikel ohne Barcode"; $lang["items_error_adding_updating"] = "Fehler beim Hinzufügen/Ändern"; $lang["items_error_updating_multiple"] = "Fehler beim Ändern"; $lang["items_excel_import_failed"] = "Excel Import fehlgeschlagen"; @@ -37,7 +37,7 @@ $lang["items_excel_import_nodata_wrongformat"] = "Die hochgeladene Datei enthäl $lang["items_excel_import_partially_failed"] = "Der Import von Artikeln ist mit einigen Fehlern erfolgreich:"; $lang["items_excel_import_success"] = "Artikelimport erfolgreich."; $lang["items_generate_barcodes"] = "Generiere Barcodes"; -$lang["items_hsn_code"] = ""; +$lang["items_hsn_code"] = "Harmonisierte System Nomenklatur"; $lang["items_image"] = "Avatar"; $lang["items_import_items_excel"] = "Importiere Artikel mit Excel Datei"; $lang["items_info_provided_by"] = "Informationen bereitgestellt von"; @@ -56,7 +56,7 @@ $lang["items_item_number_duplicate"] = "Die Artikelnummer existiert bereits in d $lang["items_kit"] = "Satz"; $lang["items_location"] = "Ort"; $lang["items_low_inventory_items"] = "Nicht vorrätige Artikel"; -$lang["items_low_sell_item"] = ""; +$lang["items_low_sell_item"] = "Wenig verkaufter Artikel"; $lang["items_manually_editing_of_quantity"] = "Manuelle Bestandesänderung"; $lang["items_name"] = "Artikelname"; $lang["items_name_required"] = "Der Artikelname ist ein Pflichtfeld."; From 4f69b961dc8e2b98fb46113c2daa589e09da7afc Mon Sep 17 00:00:00 2001 From: Johannes Roesch Date: Wed, 26 Dec 2018 13:20:18 +0000 Subject: [PATCH 443/568] Translated using Weblate (German) Currently translated at 98.5% (265 of 269 strings) Translation: ospos/config Translate-URL: http://weblate.jpeelaer.net/projects/ospos/config/de/ --- application/language/de/config_lang.php | 42 ++++++++++++------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/application/language/de/config_lang.php b/application/language/de/config_lang.php index 16b53f17b..c57e7c2ab 100644 --- a/application/language/de/config_lang.php +++ b/application/language/de/config_lang.php @@ -98,10 +98,10 @@ $lang["config_email_receipt_check_behaviour_always"] = "Immer ausgewählt"; $lang["config_email_receipt_check_behaviour_last"] = "Letzte Auswahl speichern"; $lang["config_email_receipt_check_behaviour_never"] = "Nie ausgewählt"; $lang["config_email_smtp_crypto"] = "SMTP Verschlüsselung"; -$lang["config_email_smtp_host"] = "SMTP Server"; +$lang["config_email_smtp_host"] = "SMTP-Server"; $lang["config_email_smtp_pass"] = "SMTP Passwort"; -$lang["config_email_smtp_port"] = "SMTP Port"; -$lang["config_email_smtp_timeout"] = "SMTP Timeout (s)"; +$lang["config_email_smtp_port"] = "SMTP-Port"; +$lang["config_email_smtp_timeout"] = "SMTP-Timeout"; $lang["config_email_smtp_user"] = "SMTP Benutzername"; $lang["config_enforce_privacy"] = "Datenschutz durchsetzen"; $lang["config_enforce_privacy_tooltip"] = "Schützen Sie die Privatsphäre Ihrer Kunden und erzwingen Sie die Verschlüsselung von Daten im Falle der Löschung ihrer Daten"; @@ -144,7 +144,7 @@ $lang["config_jsprintsetup_required"] = "Warnung: Diese Funktion benötigt das F $lang["config_language"] = "Sprache"; $lang["config_last_used_invoice_number"] = "Zuletzt verwendete Rechnungsnummer"; $lang["config_last_used_quote_number"] = "Zuletzt verwendete Angebotsnummer"; -$lang["config_last_used_work_order_number"] = ""; +$lang["config_last_used_work_order_number"] = "Zuletzt verwendete Arbeitsauftragsnummer"; $lang["config_left"] = "Links"; $lang["config_license"] = "Lizenz"; $lang["config_license_configuration"] = "Lizenzvereinbarung"; @@ -198,10 +198,10 @@ $lang["config_print_header"] = "Drucke Browser Kopfzeile"; $lang["config_print_left_margin"] = "Rand links"; $lang["config_print_left_margin_number"] = "Rand links muss eine Zahl sein."; $lang["config_print_left_margin_required"] = "Rand links ist erforderlich."; -$lang["config_print_receipt_check_behaviour"] = ""; -$lang["config_print_receipt_check_behaviour_always"] = ""; -$lang["config_print_receipt_check_behaviour_last"] = ""; -$lang["config_print_receipt_check_behaviour_never"] = ""; +$lang["config_print_receipt_check_behaviour"] = "Quittung drucken"; +$lang["config_print_receipt_check_behaviour_always"] = "Immer ausgewählt"; +$lang["config_print_receipt_check_behaviour_last"] = "Letzte Auswahl speichern"; +$lang["config_print_receipt_check_behaviour_never"] = "Nie ausgewählt"; $lang["config_print_right_margin"] = "Rand rechts"; $lang["config_print_right_margin_number"] = "Rand rechts muss eine Zahl sein."; $lang["config_print_right_margin_required"] = "Rand rechts ist erforderlich."; @@ -210,7 +210,7 @@ $lang["config_print_top_margin"] = "Rand oben"; $lang["config_print_top_margin_number"] = "Rand oben muss eine Zahl sein."; $lang["config_print_top_margin_required"] = "Rand oben ist erforderlich."; $lang["config_quantity_decimals"] = "Mengendezimalstellen"; -$lang["config_quote_default_comments"] = ""; +$lang["config_quote_default_comments"] = "Angebot Standard-Kommentare"; $lang["config_receipt"] = "Eingang"; $lang["config_receipt_configuration"] = "Druckereinstellungen"; $lang["config_receipt_default"] = "Default"; @@ -237,35 +237,35 @@ $lang["config_sales_invoice_format"] = "Format Verkaufsrechnung"; $lang["config_sales_quote_format"] = "Angebotsformat"; $lang["config_saved_successfully"] = "Einstellungen erfolgreich gesichert."; $lang["config_saved_unsuccessfully"] = "Einstellungen konnten nicht gesichert werden."; -$lang["config_show_office_group"] = ""; +$lang["config_show_office_group"] = "Verwaltungssymbol anzeigen"; $lang["config_statistics"] = "Statistiken Senden"; $lang["config_statistics_tooltip"] = "Statistiken Senden für programierung und verbesserungen."; $lang["config_stock_location"] = "Lagerort"; $lang["config_stock_location_duplicate"] = "Bitte verwenden Sie einen eindeutigen Lagerort."; $lang["config_stock_location_invalid_chars"] = "Der Lagerort kann keine Unterstriche enthalten."; $lang["config_stock_location_required"] = "Lagerort Nummer ist erforderlich."; -$lang["config_suggestions_first_column"] = ""; -$lang["config_suggestions_layout"] = ""; -$lang["config_suggestions_second_column"] = ""; -$lang["config_suggestions_third_column"] = ""; +$lang["config_suggestions_first_column"] = "Spalte 1"; +$lang["config_suggestions_layout"] = "Vorschläge Layout"; +$lang["config_suggestions_second_column"] = "Spalte 2"; +$lang["config_suggestions_third_column"] = "Spalte 3"; $lang["config_table"] = "Tabelle"; $lang["config_table_configuration"] = "Tabelle konfigurieren"; $lang["config_takings_printer"] = "Einnahmendrucker"; $lang["config_tax"] = "Steuer"; $lang["config_tax_category"] = "Steuerkategorie"; -$lang["config_tax_category_duplicate"] = ""; -$lang["config_tax_category_invalid_chars"] = ""; -$lang["config_tax_category_required"] = ""; +$lang["config_tax_category_duplicate"] = "Die eingegebene Steuerkategorie existiert bereits."; +$lang["config_tax_category_invalid_chars"] = "Die eingegebene Steuerkategorie ist ungültig."; +$lang["config_tax_category_required"] = "Die Steuerkategorie ist erforderlich."; $lang["config_tax_category_used"] = "Die Steuerkategorie kann nicht gelöscht werden, da sie in Benutzung ist."; $lang["config_tax_configuration"] = "Steuer-Konfiguration"; $lang["config_tax_decimals"] = "Steuer Dezimalstellen"; -$lang["config_tax_id"] = ""; +$lang["config_tax_id"] = "Steuer ID"; $lang["config_tax_included"] = "MWSt inbegriffen"; $lang["config_theme"] = "Design"; $lang["config_thousands_separator"] = "Tausendertrennzeichen"; $lang["config_timezone"] = "Zeitzone"; $lang["config_top"] = "Oben"; -$lang["config_use_destination_based_tax"] = ""; +$lang["config_use_destination_based_tax"] = "Zielabhängige Steuer verwenden"; $lang["config_website"] = "Website"; -$lang["config_work_order_enable"] = ""; -$lang["config_work_order_format"] = ""; +$lang["config_work_order_enable"] = "Unterstützung von Arbeitsaufträgen"; +$lang["config_work_order_format"] = "Arbeitsauftragsformat"; From d00fd6a90a8d811816ca4212eaec1de26c9b81b6 Mon Sep 17 00:00:00 2001 From: Johannes Roesch Date: Wed, 26 Dec 2018 13:48:15 +0000 Subject: [PATCH 444/568] Translated using Weblate (German) Currently translated at 97.7% (43 of 44 strings) Translation: ospos/expenses Translate-URL: http://weblate.jpeelaer.net/projects/ospos/expenses/de/ --- application/language/de/expenses_lang.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/application/language/de/expenses_lang.php b/application/language/de/expenses_lang.php index 6209e96f8..897372487 100644 --- a/application/language/de/expenses_lang.php +++ b/application/language/de/expenses_lang.php @@ -1,11 +1,10 @@ - Date: Wed, 26 Dec 2018 13:45:56 +0000 Subject: [PATCH 445/568] Translated using Weblate (German) Currently translated at 100.0% (19 of 19 strings) Translation: ospos/expenses_categories Translate-URL: http://weblate.jpeelaer.net/projects/ospos/expenses_categories/de/ --- .../language/de/expenses_categories_lang.php | 41 +++++++++---------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/application/language/de/expenses_categories_lang.php b/application/language/de/expenses_categories_lang.php index 7e4c654f7..4d66a86ca 100644 --- a/application/language/de/expenses_categories_lang.php +++ b/application/language/de/expenses_categories_lang.php @@ -1,21 +1,20 @@ - Date: Wed, 26 Dec 2018 13:59:23 +0000 Subject: [PATCH 446/568] Translated using Weblate (German) Currently translated at 100.0% (33 of 33 strings) Translation: ospos/item_kits Translate-URL: http://weblate.jpeelaer.net/projects/ospos/item_kits/de/ --- application/language/de/item_kits_lang.php | 31 +++++++++++----------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/application/language/de/item_kits_lang.php b/application/language/de/item_kits_lang.php index e9e8678fe..4bb3d9f4d 100644 --- a/application/language/de/item_kits_lang.php +++ b/application/language/de/item_kits_lang.php @@ -1,34 +1,33 @@ - Date: Wed, 26 Dec 2018 14:14:12 +0000 Subject: [PATCH 447/568] Translated using Weblate (German) Currently translated at 100.0% (173 of 173 strings) Translation: ospos/sales Translate-URL: http://weblate.jpeelaer.net/projects/ospos/sales/de/ --- application/language/de/sales_lang.php | 97 +++++++++++++------------- 1 file changed, 48 insertions(+), 49 deletions(-) diff --git a/application/language/de/sales_lang.php b/application/language/de/sales_lang.php index aa23dfa43..0881ab2e6 100644 --- a/application/language/de/sales_lang.php +++ b/application/language/de/sales_lang.php @@ -1,16 +1,15 @@ - Aussetzen"; -$lang["sales_suspended_doc_id"] = ""; +$lang["sales_suspended_doc_id"] = "Dokument"; $lang["sales_suspended_sale_id"] = "ID"; $lang["sales_suspended_sales"] = "Ausgesetzte Aufträge"; $lang["sales_table"] = "Tisch"; $lang["sales_takings"] = "Einnahmen"; -$lang["sales_tax"] = "MWSt"; -$lang["sales_tax_id"] = ""; -$lang["sales_tax_invoice"] = ""; -$lang["sales_tax_percent"] = "MWSt %"; -$lang["sales_total"] = "Total"; -$lang["sales_total_tax_exclusive"] = "Total exkl. MWSt."; -$lang["sales_transaction_failed"] = "Verarbeitung fehlerhaft"; +$lang["sales_tax"] = "Steuer"; +$lang["sales_tax_id"] = "Steuer ID"; +$lang["sales_tax_invoice"] = "Steuerrechnung"; +$lang["sales_tax_percent"] = "Steuer %"; +$lang["sales_total"] = "Gesamtbetrag"; +$lang["sales_total_tax_exclusive"] = "exkl. Steuer"; +$lang["sales_transaction_failed"] = "Verarbeitung fehlerhaft."; $lang["sales_unable_to_add_item"] = "Kann Artikel nicht zum Auftrag hinzufügen"; -$lang["sales_unsuccessfully_deleted"] = "Löschung nicht erfolgreich"; -$lang["sales_unsuccessfully_restored"] = ""; -$lang["sales_unsuccessfully_suspended_sale"] = "Auftrag wurde erfolgreich pendent gehalten"; -$lang["sales_unsuccessfully_updated"] = "Änderung nicht erfolgreich"; +$lang["sales_unsuccessfully_deleted"] = "Löschen des Verkaufs fehlgeschlagen."; +$lang["sales_unsuccessfully_restored"] = "Wiederherstellung fehlgeschlagen."; +$lang["sales_unsuccessfully_suspended_sale"] = "Verkaufsstopp fehlgeschlagen."; +$lang["sales_unsuccessfully_updated"] = "Änderung fehlgeschlagen."; $lang["sales_unsuspend"] = "Aktivieren"; $lang["sales_unsuspend_and_delete"] = "Aktivieren und löschen"; $lang["sales_update"] = "Ändern"; -$lang["sales_upi"] = ""; -$lang["sales_work_order"] = ""; -$lang["sales_work_order_number"] = ""; -$lang["sales_work_order_number_duplicate"] = ""; -$lang["sales_work_order_sent"] = ""; -$lang["sales_work_order_unsent"] = ""; +$lang["sales_upi"] = "UPI"; +$lang["sales_work_order"] = "Arbeitsauftrag"; +$lang["sales_work_order_number"] = "Arbeitsauftragsnummer"; +$lang["sales_work_order_number_duplicate"] = "Arbeitsauftragsnummer muss eindeutig sein."; +$lang["sales_work_order_sent"] = "Arbeitsauftrag gesendet an"; +$lang["sales_work_order_unsent"] = "Der Arbeitsauftrag konnte nicht gesendet werden an"; From 8bc375f2e7d6e48b81fc4563bcd5f13d5532f4cb Mon Sep 17 00:00:00 2001 From: Johannes Roesch Date: Wed, 26 Dec 2018 14:42:09 +0000 Subject: [PATCH 448/568] Translated using Weblate (German) Currently translated at 94.1% (113 of 120 strings) Translation: ospos/reports Translate-URL: http://weblate.jpeelaer.net/projects/ospos/reports/de/ --- application/language/de/reports_lang.php | 57 ++++++++++++------------ 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/application/language/de/reports_lang.php b/application/language/de/reports_lang.php index 828e09be8..7b7884ef7 100644 --- a/application/language/de/reports_lang.php +++ b/application/language/de/reports_lang.php @@ -1,23 +1,22 @@ - Date: Wed, 26 Dec 2018 20:03:09 +0000 Subject: [PATCH 449/568] Translated using Weblate (German) Currently translated at 100.0% (26 of 26 strings) Translation: ospos/attributes Translate-URL: http://weblate.jpeelaer.net/projects/ospos/attributes/de/ --- application/language/de/attributes_lang.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/application/language/de/attributes_lang.php b/application/language/de/attributes_lang.php index c83fbfaab..5037ba306 100644 --- a/application/language/de/attributes_lang.php +++ b/application/language/de/attributes_lang.php @@ -2,10 +2,10 @@ $lang["attributes_attribute_value_invalid_chars"] = "Attributwert darf nicht ':' oder '|' enthalten"; $lang["attributes_confirm_delete"] = "Sind Sie sicher, dass Sie die ausgewählten Attribute löschen möchten?"; $lang["attributes_definition_cannot_be_deleted"] = "Ausgewählte Attribute konnten nicht gelöscht werden"; -$lang["attributes_definition_flags"] = ""; +$lang["attributes_definition_flags"] = "Attribut Sichtbarkeit"; $lang["attributes_definition_group"] = "Gruppe"; $lang["attributes_definition_id"] = "ID"; -$lang["attributes_definition_name"] = "Attributname"; +$lang["attributes_definition_name"] = "Attribut hinzufügen"; $lang["attributes_definition_name_required"] = "Attributname ist ein Pflichtfeld"; $lang["attributes_definition_one_or_multiple"] = "Attribut(e)"; $lang["attributes_definition_successful_adding"] = "Artikel erfolgreich hinzugefügt"; @@ -19,9 +19,9 @@ $lang["attributes_no_attributes_to_display"] = "Keine Elemente zum Anzeigen"; $lang["attributes_receipt_visibility"] = "Quittung"; $lang["attributes_show_in_items"] = "In Artikeln anzeigen"; $lang["attributes_show_in_items_visibility"] = "Artikel"; -$lang["attributes_show_in_receipt"] = ""; -$lang["attributes_show_in_receivings"] = ""; +$lang["attributes_show_in_receipt"] = "In Quittung anzeigen"; +$lang["attributes_show_in_receivings"] = "In Eingängen anzeigen"; $lang["attributes_show_in_receivings_visibility"] = "Eingänge"; -$lang["attributes_show_in_sales"] = ""; +$lang["attributes_show_in_sales"] = "In Verkäufen anzeigen"; $lang["attributes_show_in_sales_visibility"] = "Verkauf"; $lang["attributes_update"] = "Attribut aktualisieren"; From 41c58b04fccab6367ac8935a123b89d6ddd1b091 Mon Sep 17 00:00:00 2001 From: Johannes Roesch Date: Wed, 26 Dec 2018 20:09:23 +0000 Subject: [PATCH 450/568] Translated using Weblate (German) Currently translated at 100.0% (52 of 52 strings) Translation: ospos/customers Translate-URL: http://weblate.jpeelaer.net/projects/ospos/customers/de/ --- application/language/de/customers_lang.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/application/language/de/customers_lang.php b/application/language/de/customers_lang.php index 869d48afd..2ab984958 100644 --- a/application/language/de/customers_lang.php +++ b/application/language/de/customers_lang.php @@ -1,5 +1,4 @@ - Date: Wed, 26 Dec 2018 20:13:31 +0000 Subject: [PATCH 451/568] Translated using Weblate (German) Currently translated at 100.0% (21 of 21 strings) Translation: ospos/suppliers Translate-URL: http://weblate.jpeelaer.net/projects/ospos/suppliers/de/ --- application/language/de/suppliers_lang.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/application/language/de/suppliers_lang.php b/application/language/de/suppliers_lang.php index ab1bfbe39..0d0bc8066 100644 --- a/application/language/de/suppliers_lang.php +++ b/application/language/de/suppliers_lang.php @@ -1,16 +1,15 @@ - Date: Wed, 26 Dec 2018 20:17:46 +0000 Subject: [PATCH 452/568] Translated using Weblate (German) Currently translated at 100.0% (20 of 20 strings) Translation: ospos/datepicker Translate-URL: http://weblate.jpeelaer.net/projects/ospos/datepicker/de/ --- application/language/de/datepicker_lang.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/application/language/de/datepicker_lang.php b/application/language/de/datepicker_lang.php index 89a3392a7..750adaeab 100644 --- a/application/language/de/datepicker_lang.php +++ b/application/language/de/datepicker_lang.php @@ -1,5 +1,4 @@ - Date: Wed, 26 Dec 2018 20:19:43 +0000 Subject: [PATCH 453/568] Translated using Weblate (German) Currently translated at 100.0% (68 of 68 strings) Translation: ospos/giftcards Translate-URL: http://weblate.jpeelaer.net/projects/ospos/giftcards/de/ --- application/language/de/giftcards_lang.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/application/language/de/giftcards_lang.php b/application/language/de/giftcards_lang.php index 3e3210c40..703b5b83c 100644 --- a/application/language/de/giftcards_lang.php +++ b/application/language/de/giftcards_lang.php @@ -1,5 +1,4 @@ - Date: Wed, 26 Dec 2018 20:23:02 +0000 Subject: [PATCH 454/568] Translated using Weblate (German) Currently translated at 100.0% (52 of 52 strings) Translation: ospos/receivings Translate-URL: http://weblate.jpeelaer.net/projects/ospos/receivings/de/ --- application/language/de/receivings_lang.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/application/language/de/receivings_lang.php b/application/language/de/receivings_lang.php index 800e41b30..4fdc62406 100644 --- a/application/language/de/receivings_lang.php +++ b/application/language/de/receivings_lang.php @@ -1,5 +1,4 @@ - Date: Wed, 26 Dec 2018 20:29:11 +0000 Subject: [PATCH 455/568] Translated using Weblate (German) Currently translated at 100.0% (120 of 120 strings) Translation: ospos/reports Translate-URL: http://weblate.jpeelaer.net/projects/ospos/reports/de/ --- application/language/de/reports_lang.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/application/language/de/reports_lang.php b/application/language/de/reports_lang.php index 7b7884ef7..d725a614f 100644 --- a/application/language/de/reports_lang.php +++ b/application/language/de/reports_lang.php @@ -1,6 +1,6 @@ Date: Wed, 26 Dec 2018 19:07:54 +0000 Subject: [PATCH 456/568] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (66 of 66 strings) Translation: ospos/common Translate-URL: http://weblate.jpeelaer.net/projects/ospos/common/pt_BR/ --- application/language/pt-BR/common_lang.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/application/language/pt-BR/common_lang.php b/application/language/pt-BR/common_lang.php index 7face3b9a..5234af166 100644 --- a/application/language/pt-BR/common_lang.php +++ b/application/language/pt-BR/common_lang.php @@ -1,5 +1,4 @@ - Date: Wed, 26 Dec 2018 00:11:41 +0000 Subject: [PATCH 457/568] Translated using Weblate (Spanish (Mexico)) Currently translated at 100.0% (66 of 66 strings) Translation: ospos/common Translate-URL: http://weblate.jpeelaer.net/projects/ospos/common/es_MX/ --- application/language/es_MX/common_lang.php | 126 ++++++++++----------- 1 file changed, 63 insertions(+), 63 deletions(-) diff --git a/application/language/es_MX/common_lang.php b/application/language/es_MX/common_lang.php index d87433794..318ea0392 100644 --- a/application/language/es_MX/common_lang.php +++ b/application/language/es_MX/common_lang.php @@ -1,68 +1,68 @@ Date: Wed, 26 Dec 2018 19:06:59 +0000 Subject: [PATCH 458/568] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (26 of 26 strings) Translation: ospos/attributes Translate-URL: http://weblate.jpeelaer.net/projects/ospos/attributes/pt_BR/ --- application/language/pt-BR/attributes_lang.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/application/language/pt-BR/attributes_lang.php b/application/language/pt-BR/attributes_lang.php index a1aefda73..4fde3ff98 100644 --- a/application/language/pt-BR/attributes_lang.php +++ b/application/language/pt-BR/attributes_lang.php @@ -1,12 +1,11 @@ - Date: Tue, 25 Dec 2018 23:36:24 +0000 Subject: [PATCH 459/568] Translated using Weblate (Spanish (Mexico)) Currently translated at 100.0% (26 of 26 strings) Translation: ospos/attributes Translate-URL: http://weblate.jpeelaer.net/projects/ospos/attributes/es_MX/ --- .../language/es_MX/attributes_lang.php | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/application/language/es_MX/attributes_lang.php b/application/language/es_MX/attributes_lang.php index 567de9bdd..369cb2075 100644 --- a/application/language/es_MX/attributes_lang.php +++ b/application/language/es_MX/attributes_lang.php @@ -1,27 +1,27 @@ Date: Tue, 25 Dec 2018 23:52:41 +0000 Subject: [PATCH 460/568] Translated using Weblate (Spanish (Mexico)) Currently translated at 100.0% (8 of 8 strings) Translation: ospos/bootstrap_tables Translate-URL: http://weblate.jpeelaer.net/projects/ospos/bootstrap_tables/es_MX/ --- .../language/es_MX/bootstrap_tables_lang.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/application/language/es_MX/bootstrap_tables_lang.php b/application/language/es_MX/bootstrap_tables_lang.php index 8cedaec71..34da58493 100644 --- a/application/language/es_MX/bootstrap_tables_lang.php +++ b/application/language/es_MX/bootstrap_tables_lang.php @@ -1,9 +1,9 @@ Date: Tue, 25 Dec 2018 23:57:39 +0000 Subject: [PATCH 461/568] Translated using Weblate (Spanish (Mexico)) Currently translated at 100.0% (36 of 36 strings) Translation: ospos/cashups Translate-URL: http://weblate.jpeelaer.net/projects/ospos/cashups/es_MX/ --- application/language/es_MX/cashups_lang.php | 66 ++++++++++----------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/application/language/es_MX/cashups_lang.php b/application/language/es_MX/cashups_lang.php index 931b2c31c..5c6f3d237 100644 --- a/application/language/es_MX/cashups_lang.php +++ b/application/language/es_MX/cashups_lang.php @@ -1,37 +1,37 @@ Date: Wed, 26 Dec 2018 19:37:08 +0000 Subject: [PATCH 462/568] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (269 of 269 strings) Translation: ospos/config Translate-URL: http://weblate.jpeelaer.net/projects/ospos/config/pt_BR/ --- application/language/pt-BR/config_lang.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/application/language/pt-BR/config_lang.php b/application/language/pt-BR/config_lang.php index 9d92f5ec8..479a619d4 100644 --- a/application/language/pt-BR/config_lang.php +++ b/application/language/pt-BR/config_lang.php @@ -1,5 +1,4 @@ - Date: Wed, 26 Dec 2018 01:27:59 +0000 Subject: [PATCH 463/568] Translated using Weblate (Spanish (Mexico)) Currently translated at 100.0% (269 of 269 strings) Translation: ospos/config Translate-URL: http://weblate.jpeelaer.net/projects/ospos/config/es_MX/ --- application/language/es_MX/config_lang.php | 52 +++++++++++----------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/application/language/es_MX/config_lang.php b/application/language/es_MX/config_lang.php index 80dcf5168..68fa2e9da 100644 --- a/application/language/es_MX/config_lang.php +++ b/application/language/es_MX/config_lang.php @@ -1,30 +1,30 @@ Date: Wed, 26 Dec 2018 19:30:46 +0000 Subject: [PATCH 464/568] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (52 of 52 strings) Translation: ospos/customers Translate-URL: http://weblate.jpeelaer.net/projects/ospos/customers/pt_BR/ --- application/language/pt-BR/customers_lang.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/application/language/pt-BR/customers_lang.php b/application/language/pt-BR/customers_lang.php index b8081c58a..4cbde9328 100644 --- a/application/language/pt-BR/customers_lang.php +++ b/application/language/pt-BR/customers_lang.php @@ -1,5 +1,4 @@ - Date: Wed, 26 Dec 2018 19:29:36 +0000 Subject: [PATCH 465/568] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (108 of 108 strings) Translation: ospos/items Translate-URL: http://weblate.jpeelaer.net/projects/ospos/items/pt_BR/ --- application/language/pt-BR/items_lang.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/application/language/pt-BR/items_lang.php b/application/language/pt-BR/items_lang.php index 95d1a2ad7..942b9009b 100644 --- a/application/language/pt-BR/items_lang.php +++ b/application/language/pt-BR/items_lang.php @@ -1,5 +1,4 @@ - Date: Wed, 26 Dec 2018 20:28:28 +0000 Subject: [PATCH 466/568] Translated using Weblate (German) Currently translated at 100.0% (12 of 12 strings) Translation: ospos/messages Translate-URL: http://weblate.jpeelaer.net/projects/ospos/messages/de/ --- application/language/de/messages_lang.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/application/language/de/messages_lang.php b/application/language/de/messages_lang.php index 422b8172f..3df9a805e 100644 --- a/application/language/de/messages_lang.php +++ b/application/language/de/messages_lang.php @@ -1,5 +1,4 @@ - Date: Wed, 26 Dec 2018 19:40:39 +0000 Subject: [PATCH 467/568] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (120 of 120 strings) Translation: ospos/reports Translate-URL: http://weblate.jpeelaer.net/projects/ospos/reports/pt_BR/ --- application/language/pt-BR/reports_lang.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/application/language/pt-BR/reports_lang.php b/application/language/pt-BR/reports_lang.php index d626d76a9..6a8616bff 100644 --- a/application/language/pt-BR/reports_lang.php +++ b/application/language/pt-BR/reports_lang.php @@ -1,7 +1,6 @@ - Date: Wed, 26 Dec 2018 19:31:47 +0000 Subject: [PATCH 468/568] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (173 of 173 strings) Translation: ospos/sales Translate-URL: http://weblate.jpeelaer.net/projects/ospos/sales/pt_BR/ --- application/language/pt-BR/sales_lang.php | 25 +++++++++++------------ 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/application/language/pt-BR/sales_lang.php b/application/language/pt-BR/sales_lang.php index 16d5f50c6..7408f3489 100644 --- a/application/language/pt-BR/sales_lang.php +++ b/application/language/pt-BR/sales_lang.php @@ -1,13 +1,12 @@ - Date: Wed, 26 Dec 2018 19:36:26 +0000 Subject: [PATCH 469/568] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (21 of 21 strings) Translation: ospos/suppliers Translate-URL: http://weblate.jpeelaer.net/projects/ospos/suppliers/pt_BR/ --- application/language/pt-BR/suppliers_lang.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/application/language/pt-BR/suppliers_lang.php b/application/language/pt-BR/suppliers_lang.php index 68bfbbd24..b89b8d6d2 100644 --- a/application/language/pt-BR/suppliers_lang.php +++ b/application/language/pt-BR/suppliers_lang.php @@ -1,5 +1,4 @@ - Date: Wed, 26 Dec 2018 19:09:34 +0000 Subject: [PATCH 470/568] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (67 of 67 strings) Translation: ospos/taxes Translate-URL: http://weblate.jpeelaer.net/projects/ospos/taxes/pt_BR/ --- application/language/pt-BR/taxes_lang.php | 97 +++++++++++------------ 1 file changed, 48 insertions(+), 49 deletions(-) diff --git a/application/language/pt-BR/taxes_lang.php b/application/language/pt-BR/taxes_lang.php index 89156cb11..7a79abcdf 100644 --- a/application/language/pt-BR/taxes_lang.php +++ b/application/language/pt-BR/taxes_lang.php @@ -1,21 +1,20 @@ - Date: Thu, 27 Dec 2018 21:04:58 +0000 Subject: [PATCH 471/568] Translated using Weblate (Turkish) Currently translated at 44.7% (30 of 67 strings) Translation: ospos/taxes Translate-URL: http://weblate.jpeelaer.net/projects/ospos/taxes/tr/ --- application/language/tr/taxes_lang.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/application/language/tr/taxes_lang.php b/application/language/tr/taxes_lang.php index 7b10841f0..a688211b0 100644 --- a/application/language/tr/taxes_lang.php +++ b/application/language/tr/taxes_lang.php @@ -1,5 +1,4 @@ - Date: Sun, 30 Dec 2018 14:23:45 +0000 Subject: [PATCH 472/568] Translated using Weblate (English (United Kingdom)) Currently translated at 100.0% (269 of 269 strings) Translation: ospos/config Translate-URL: http://weblate.jpeelaer.net/projects/ospos/config/en_GB/ --- application/language/en-GB/config_lang.php | 23 +++++++++++----------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/application/language/en-GB/config_lang.php b/application/language/en-GB/config_lang.php index cc63c9cef..165403301 100644 --- a/application/language/en-GB/config_lang.php +++ b/application/language/en-GB/config_lang.php @@ -1,7 +1,6 @@ - Date: Sun, 30 Dec 2018 18:25:45 +0100 Subject: [PATCH 473/568] Fix migration message, add UK translation (#2247) --- application/helpers/tabular_helper.php | 4 ++-- application/language/en-GB/common_lang.php | 2 +- application/views/items/form_bulk.php | 2 +- application/views/login.php | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/application/helpers/tabular_helper.php b/application/helpers/tabular_helper.php index 1f6aef24f..ef8e298f8 100644 --- a/application/helpers/tabular_helper.php +++ b/application/helpers/tabular_helper.php @@ -636,7 +636,7 @@ function get_expenses_manage_table_headers() array('payment_type' => $CI->lang->line('expenses_payment')), array('category_name' => $CI->lang->line('expenses_categories_name')), array('description' => $CI->lang->line('expenses_description')), - array('createdBy' => $CI->lang->line('expenses_employee')) + array('created_by' => $CI->lang->line('expenses_employee')) ); return transform_headers($headers); @@ -659,7 +659,7 @@ function get_expenses_data_row($expense) 'payment_type' => $expense->payment_type, 'category_name' => $expense->category_name, 'description' => $expense->description, - 'createdBy' => $expense->first_name.' '. $expense->last_name, + 'created_by' => $expense->first_name.' '. $expense->last_name, 'edit' => anchor($controller_name."/view/$expense->expense_id", '', array('class'=>'modal-dlg', 'data-btn-submit' => $CI->lang->line('common_submit'), 'title'=>$CI->lang->line($controller_name.'_update')) )); diff --git a/application/language/en-GB/common_lang.php b/application/language/en-GB/common_lang.php index 321f9aa21..bc55c5eb7 100644 --- a/application/language/en-GB/common_lang.php +++ b/application/language/en-GB/common_lang.php @@ -39,7 +39,7 @@ $lang["common_last_page"] = "Last"; $lang["common_learn_about_project"] = "to learn the latest information about the project"; $lang["common_list_of"] = "List of"; $lang["common_logout"] = "Logout"; -$lang["common_migration_needed"] = ""; +$lang["common_migration_needed"] = "A database migration to %1 will start after login."; $lang["common_new"] = "New"; $lang["common_no_persons_to_display"] = "There are no people to display"; $lang["common_none_selected_text"] = "[Select]"; diff --git a/application/views/items/form_bulk.php b/application/views/items/form_bulk.php index 43bd99f10..eceb13ca8 100644 --- a/application/views/items/form_bulk.php +++ b/application/views/items/form_bulk.php @@ -182,7 +182,7 @@ $(document).ready(function() { $(form).ajaxSubmit({ beforeSubmit: function(arr, $form, options) { - arr.push({name: 'item_ids', value: table_support.selected_ids().join(": ")}); + arr.push({name: 'item_ids', value: table_support.selected_ids().join(":")}); }, success: function(response) { diff --git a/application/views/login.php b/application/views/login.php index 37d7c6041..dbd7d7a25 100644 --- a/application/views/login.php +++ b/application/views/login.php @@ -19,8 +19,8 @@
                      - migration->is_latest()): ?> -
                      lang->line('common_migration_needed'); ?>
                      + migration->is_latest()): ?> +
                      lang->line('common_migration_needed', $this->config->item('application_version ')); ?>
                      From 6c685f89b89223d91cb4036a8037669d9357c555 Mon Sep 17 00:00:00 2001 From: jekkos Date: Sun, 30 Dec 2018 18:27:08 +0100 Subject: [PATCH 474/568] Fix amount formatting in expenses (#2085) --- application/controllers/Expenses.php | 2 +- application/views/expenses/form.php | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/application/controllers/Expenses.php b/application/controllers/Expenses.php index 76eeb89f1..f419bf622 100644 --- a/application/controllers/Expenses.php +++ b/application/controllers/Expenses.php @@ -163,7 +163,7 @@ class Expenses extends Secure_Controller { $value = $this->input->post(); $parsed_value = parse_decimals(array_pop($value)); - echo json_encode(array('success' => $parsed_value !== FALSE, 'amount' => to_currency_no_money($parsed_value))); + echo json_encode(array('success' => $parsed_value !== FALSE)); } public function delete() diff --git a/application/views/expenses/form.php b/application/views/expenses/form.php index 6c468dd12..6340355ba 100644 --- a/application/views/expenses/form.php +++ b/application/views/expenses/form.php @@ -164,7 +164,6 @@ $(document).ready(function() type: 'POST', dataFilter: function(data) { var response = JSON.parse(data); - $(field).val(response.amount); return response.success; } } From 205cd2fce79d6d7be8dbd8e6750c2b29d4c3f644 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Wed, 2 Jan 2019 20:20:21 +0000 Subject: [PATCH 475/568] Fix en-GB translations --- application/language/en-GB/common_lang.php | 6 +++--- application/language/en-GB/config_lang.php | 20 ++++++++++---------- application/language/en-GB/taxes_lang.php | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/application/language/en-GB/common_lang.php b/application/language/en-GB/common_lang.php index bc55c5eb7..048e0de7f 100644 --- a/application/language/en-GB/common_lang.php +++ b/application/language/en-GB/common_lang.php @@ -39,13 +39,13 @@ $lang["common_last_page"] = "Last"; $lang["common_learn_about_project"] = "to learn the latest information about the project"; $lang["common_list_of"] = "List of"; $lang["common_logout"] = "Logout"; -$lang["common_migration_needed"] = "A database migration to %1 will start after login."; +$lang["common_migration_needed"] = "A database migration to %1 will start after login"; $lang["common_new"] = "New"; $lang["common_no_persons_to_display"] = "There are no people to display"; $lang["common_none_selected_text"] = "[Select]"; $lang["common_or"] = "OR"; $lang["common_phone_number"] = "Phone Number"; -$lang["common_phone_number_required"] = ""; +$lang["common_phone_number_required"] = "Phone Number is a required field"; $lang["common_please_visit_my"] = "Please visit the"; $lang["common_powered_by"] = "Powered by"; $lang["common_price"] = "Price"; @@ -64,6 +64,6 @@ $lang["common_unknown"] = "Unknown"; $lang["common_view_recent_sales"] = "View Recent Sales"; $lang["common_website"] = "website"; $lang["common_welcome"] = "Welcome"; -$lang["common_welcome_message"] = "Welcome to OSPOS, click a module below to get started."; +$lang["common_welcome_message"] = "Welcome to OSPOS, click a module below to get started"; $lang["common_you_are_using_ospos"] = "You are using Open Source Point Of Sale version"; $lang["common_zip"] = "Post Code"; diff --git a/application/language/en-GB/config_lang.php b/application/language/en-GB/config_lang.php index 165403301..d367425cc 100644 --- a/application/language/en-GB/config_lang.php +++ b/application/language/en-GB/config_lang.php @@ -1,6 +1,6 @@ Date: Thu, 3 Jan 2019 23:53:54 +0100 Subject: [PATCH 476/568] Fix flemish discount translation --- application/language/nl-BE/sales_lang.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/language/nl-BE/sales_lang.php b/application/language/nl-BE/sales_lang.php index da918003f..9fde643b5 100755 --- a/application/language/nl-BE/sales_lang.php +++ b/application/language/nl-BE/sales_lang.php @@ -46,7 +46,7 @@ $lang["sales_delete_unsuccessful"] = "De geselecteerde aankopen konden niet word $lang["sales_description_abbrv"] = "Omschr."; $lang["sales_discard"] = "Annuleer"; $lang["sales_discard_quote"] = ""; -$lang["sales_discount"] = "%"; +$lang["sales_discount"] = "Korting"; $lang["sales_discount_included"] = "% Korting"; $lang["sales_discount_short"] = "%"; $lang["sales_due"] = "Tegoed"; From 489ed6c23f5f416f83d698b7aaa62850ca89a036 Mon Sep 17 00:00:00 2001 From: jekkos Date: Sun, 30 Dec 2018 16:13:39 +0000 Subject: [PATCH 477/568] Translated using Weblate (Flemish) Currently translated at 99.6% (268 of 269 strings) Translation: ospos/config Translate-URL: http://weblate.jpeelaer.net/projects/ospos/config/nl_BE/ --- application/language/nl-BE/config_lang.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/application/language/nl-BE/config_lang.php b/application/language/nl-BE/config_lang.php index 8633655c0..8c211347c 100755 --- a/application/language/nl-BE/config_lang.php +++ b/application/language/nl-BE/config_lang.php @@ -1,5 +1,4 @@ - Date: Sun, 6 Jan 2019 17:21:21 +0000 Subject: [PATCH 478/568] Fix login missing version issue --- application/views/login.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/login.php b/application/views/login.php index dbd7d7a25..d3c5a7228 100644 --- a/application/views/login.php +++ b/application/views/login.php @@ -20,7 +20,7 @@
                      migration->is_latest()): ?> -
                      lang->line('common_migration_needed', $this->config->item('application_version ')); ?>
                      +
                      lang->line('common_migration_needed', $this->config->item('application_version')); ?>
                      From 6792c829b22199e53ef1f2957cac7f1e4cf85c4e Mon Sep 17 00:00:00 2001 From: jekkos Date: Sun, 30 Dec 2018 22:45:58 +0100 Subject: [PATCH 479/568] Cleanup duplicated field --- application/models/reports/Inventory_summary.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/reports/Inventory_summary.php b/application/models/reports/Inventory_summary.php index 35e808ca1..37736df9d 100644 --- a/application/models/reports/Inventory_summary.php +++ b/application/models/reports/Inventory_summary.php @@ -19,7 +19,7 @@ class Inventory_summary extends Report public function getData(array $inputs) { - $this->db->select($this->Item->get_item_name('name') . ', items.item_number, item_quantities.quantity, item_quantities.quantity, (item_quantities.quantity * items.qty_per_pack) as low_sell_quantity, items.reorder_level, stock_locations.location_name, items.cost_price, items.unit_price, (items.cost_price * item_quantities.quantity) AS sub_total_value'); + $this->db->select($this->Item->get_item_name('name') . ', items.item_number, item_quantities.quantity, (item_quantities.quantity * items.qty_per_pack) as low_sell_quantity, items.reorder_level, stock_locations.location_name, items.cost_price, items.unit_price, (items.cost_price * item_quantities.quantity) AS sub_total_value'); $this->db->from('items AS items'); $this->db->join('item_quantities AS item_quantities', 'items.item_id = item_quantities.item_id'); $this->db->join('stock_locations AS stock_locations', 'item_quantities.location_id = stock_locations.location_id'); From acba94baf2f1231a864ad6837d321764be148c1c Mon Sep 17 00:00:00 2001 From: jekkos Date: Mon, 7 Jan 2019 18:40:25 +0100 Subject: [PATCH 480/568] Fix broken dialogs after column visiblity toggle (#2132) --- public/js/manage_tables.js | 1 + 1 file changed, 1 insertion(+) diff --git a/public/js/manage_tables.js b/public/js/manage_tables.js index 871858050..b951335c6 100644 --- a/public/js/manage_tables.js +++ b/public/js/manage_tables.js @@ -239,6 +239,7 @@ user_settings[options.resource] = user_settings[options.resource] || {}; user_settings[options.resource][field] = checked; localStorage[options.employee_id] = JSON.stringify(user_settings); + dialog_support.init("a.modal-dlg"); }, queryParamsType: 'limit', iconSize: 'sm', From 74f5bb17bba4c1195a393aaf9a9c2e70e0814526 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Mon, 7 Jan 2019 21:51:36 +0000 Subject: [PATCH 481/568] Update to Bootswatch and Bootstrap 3.4.0 --- application/views/partial/header.php | 4 ++-- bower.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/application/views/partial/header.php b/application/views/partial/header.php index 293cbb094..5d6288ccd 100644 --- a/application/views/partial/header.php +++ b/application/views/partial/header.php @@ -74,10 +74,10 @@ - + - + diff --git a/bower.json b/bower.json index d38b6e401..1769fa2f4 100644 --- a/bower.json +++ b/bower.json @@ -30,10 +30,10 @@ "jquery-ui": "~1.11.4", "bootstrap3-dialog": "https://github.com/nakupanda/bootstrap3-dialog.git#master", "jasny-bootstrap": "~3.1.3", - "bootswatch": "^3.3.7", + "bootswatch": "^3.4.0", "smalot-bootstrap-datetimepicker": "~2.4.4", "bootstrap-select": "~1.12.4", - "bootstrap-table": "~1.12.1", + "bootstrap-table": "~1.12.2", "bootstrap-daterangepicker": "~2.1.27", "tableExport.jquery.plugin": "1.5.1", "chartist": "0.9.8", From 20cb007f3c95dbb05f81f3e6310e688bba22dda4 Mon Sep 17 00:00:00 2001 From: Steve Ireland Date: Mon, 24 Dec 2018 09:33:13 -0500 Subject: [PATCH 482/568] Refactor Tax Configuration --- application/controllers/Taxes.php | 152 ++++++------------ application/language/en-GB/common_lang.php | 1 + application/language/en-GB/taxes_lang.php | 9 ++ application/language/en-US/common_lang.php | 1 + application/language/en-US/taxes_lang.php | 11 +- .../migrations/sqlscripts/3.3.0_indiagst.sql | 4 +- application/models/Tax_category.php | 8 + application/models/Tax_code.php | 10 ++ application/models/Tax_jurisdiction.php | 14 ++ application/views/partial/tax_categories.php | 45 +----- application/views/partial/tax_codes.php | 74 +-------- .../views/partial/tax_jurisdictions.php | 92 ++--------- application/views/taxes/tax_categories.php | 98 ++++++----- application/views/taxes/tax_codes.php | 105 ++++++------ application/views/taxes/tax_jurisdictions.php | 109 ++++++------- 15 files changed, 265 insertions(+), 468 deletions(-) diff --git a/application/controllers/Taxes.php b/application/controllers/Taxes.php index c85ced7ba..873bb7b95 100644 --- a/application/controllers/Taxes.php +++ b/application/controllers/Taxes.php @@ -15,9 +15,21 @@ class Taxes extends Secure_Controller public function index() { - $data['tax_codes'] = $this->Tax_code->get_all()->result_array(); - $data['tax_categories'] = $this->Tax_category->get_all()->result_array(); - $data['tax_jurisdictions'] = $this->Tax_jurisdiction->get_all()->result_array(); + $data['tax_codes'] = $this->xss_clean($this->Tax_code->get_all()->result_array()); + if (count($data['tax_codes']) == 0) + { + $data['tax_codes'] = $this->Tax_code->get_empty_row(); + } + $data['tax_categories'] = $this->xss_clean($this->Tax_category->get_all()->result_array()); + if (count($data['tax_categories']) == 0) + { + $data['tax_categories'] = $this->Tax_category->get_empty_row(); + } + $data['tax_jurisdictions'] = $this->xss_clean($this->Tax_jurisdiction->get_all()->result_array()); + if (count($data['tax_jurisdictions']) == 0) + { + $data['tax_jurisdictions'] = $this->Tax_jurisdiction->get_empty_row(); + } $data['tax_rate_table_headers'] = $this->xss_clean(get_tax_rates_manage_table_headers()); $data['tax_categories_table_headers'] = $this->xss_clean(get_tax_categories_table_headers()); $data['tax_types'] = $this->tax_lib->get_tax_types(); @@ -396,39 +408,19 @@ class Taxes extends Secure_Controller public function save_tax_codes() { - $array_save= array(); + $tax_code_id = $this->input->post('tax_code_id'); + $tax_code = $this->input->post('tax_code'); + $tax_code_name = $this->input->post('tax_code_name'); + $tax_code_id = $this->input->post('tax_code_id'); + $city = $this->input->post('city'); + $state = $this->input->post('state'); - foreach($this->input->post() as $key => $value) + $array_save = array(); + foreach($tax_code_id as $key=>$val) { - if(!(strstr($key, 'tax_code_name_')=== FALSE)) - { - $tax_code_id = preg_replace("/.*?_(\d+)$/", "$1", $key); - $array_save[$tax_code_id]['tax_code_name'] = $value; - } - elseif(!(strstr($key, 'tax_code_id_') === FALSE)) - { - $tax_code_id = preg_replace("/.*?_(\d+)$/", "$1", $key); - $value = isset($value) ? $value : ''; - $array_save[$tax_code_id]['tax_code_id'] = strtoupper($value); - } - elseif(!(strstr($key, 'tax_code_') === FALSE)) - { - $tax_code_id = preg_replace("/.*?_(\d+)$/", "$1", $key); - $value = isset($value) ? $value : ''; - $array_save[$tax_code_id]['tax_code'] = strtoupper($value); - } - elseif(!(strstr($key, 'city_') === FALSE)) - { - $tax_code_id = preg_replace("/.*?_(\d+)$/", "$1", $key); - $value = isset($value) ? $value : ''; - $array_save[$tax_code_id]['city'] = $value; - } - elseif(!(strstr($key, 'state_') === FALSE)) - { - $tax_code_id = preg_replace("/.*?_(\d+)$/", "$1", $key); - $value = isset($value) ? $value : ''; - $array_save[$tax_code_id]['state'] = $value; - } + $array_save[] = array('tax_code_id'=>$this->xss_clean($val), 'tax_code'=>$this->xss_clean($tax_code[$key]), + 'tax_code_name'=>$this->xss_clean($tax_code_name[$key]), 'tax_code_id'=>$this->xss_clean($tax_code_id[$key]), + 'city'=>$this->xss_clean($city[$key]), 'state'=>$this->xss_clean($state[$key])); } $success = $this->Tax_code->save_tax_codes($array_save); @@ -441,60 +433,30 @@ class Taxes extends Secure_Controller public function save_tax_jurisdictions() { + $jurisdiction_id = $this->input->post('jurisdiction_id'); + $jurisdiction_name = $this->input->post('jurisdiction_name'); + $tax_group = $this->input->post('tax_group'); + $tax_type = $this->input->post('tax_type'); + $reporting_authority = $this->input->post('reporting_authority'); + $tax_group_sequence = $this->input->post('tax_group_sequence'); + $cascade_sequence = $this->input->post('cascade_sequence'); + $array_save = array(); - foreach($this->input->post() as $key => $value) + foreach($jurisdiction_id as $key => $val) { - - if(!(strstr($key, 'jurisdiction_id_')=== FALSE)) - { - $id = preg_replace("/.*?_(\d+)$/", "$1", $key); - $array_save[$id]['jurisdiction_id'] = $value; - } - elseif(!(strstr($key, 'jurisdiction_name_') === FALSE)) - { - $id = preg_replace("/.*?_(\d+)$/", "$1", $key); - $value = isset($value) ? $value : ''; - $array_save[$id]['jurisdiction_name'] = $value; - } - elseif(!(strstr($key, 'tax_type_') === FALSE)) - { - $id = preg_replace("/.*?_(\d+)$/", "$1", $key); - $value = isset($value) ? $value : ''; - $array_save[$id]['tax_type'] = $value; - } - elseif(!(strstr($key, 'reporting_authority_') === FALSE)) - { - $id = preg_replace("/.*?_(\d+)$/", "$1", $key); - $value = isset($value) ? $value : ''; - $array_save[$id]['reporting_authority'] = $value; - } - elseif(!(strstr($key, 'tax_group_sequence_') === FALSE)) - { - $id = preg_replace("/.*?_(\d+)$/", "$1", $key); - $value = isset($value) ? $value : ''; - $array_save[$id]['tax_group_sequence'] = $value; - } - elseif(!(strstr($key, 'tax_group_') === FALSE)) - { - $id = preg_replace("/.*?_(\d+)$/", "$1", $key); - $value = isset($value) ? $value : ''; - $array_save[$id]['tax_group'] = $value; - } - elseif(!(strstr($key, 'cascade_sequence_') === FALSE)) - { - $id = preg_replace("/.*?_(\d+)$/", "$1", $key); - $value = isset($value) ? $value : ''; - $array_save[$id]['cascade_sequence'] = $value; - } + $array_save[] = array( + 'jurisdiction_id'=>$this->xss_clean($val), + 'jurisdiction_name'=>$this->xss_clean($jurisdiction_name[$key]), + 'tax_group'=>$this->xss_clean($tax_group[$key]), + 'tax_type'=>$this->xss_clean($tax_type[$key]), + 'reporting_authority'=>$this->xss_clean($reporting_authority[$key]), + 'tax_group_sequence'=>$this->xss_clean($tax_group_sequence[$key]), + 'cascade_sequence'=>$this->xss_clean($cascade_sequence[$key])); } $success = $this->Tax_jurisdiction->save_jurisdictions($array_save); -// if(!empty($array_save)) -// { -// } - echo json_encode(array( 'success' => $success, 'message' => $this->lang->line('taxes_tax_jurisdictions_saved_' . ($success ? '' : 'un') . 'successfully') @@ -503,28 +465,18 @@ class Taxes extends Secure_Controller public function save_tax_categories() { + $tax_category_id = $this->input->post('tax_category_id'); + $tax_category = $this->input->post('tax_category'); + $tax_group_sequence = $this->input->post('tax_group_sequence'); + $array_save= array(); - foreach($this->input->post() as $key => $value) + foreach($tax_category_id as $key => $val) { - // Note that for proper select tax_category_id and tax_category_code must precede tax_category - if(!(strstr($key, 'tax_category_id_')=== FALSE)) - { - $id = preg_replace("/.*?_(\d+)$/", "$1", $key); - $array_save[$id]['tax_category_id'] = $value; - } - elseif(!(strstr($key, 'tax_category_') === FALSE)) - { - $id = preg_replace("/.*?_(\d+)$/", "$1", $key); - $value = isset($value) ? $value : ''; - $array_save[$id]['tax_category'] = $value; - } - elseif(!(strstr($key, 'tax_group_sequence_') === FALSE)) - { - $id = preg_replace("/.*?_(\d+)$/", "$1", $key); - $value = isset($value) ? $value : ''; - $array_save[$id]['tax_group_sequence'] = $value; - } + $array_save[] = array( + 'tax_category_id'=>$this->xss_clean($val), + 'tax_category'=>$this->xss_clean($tax_category[$key]), + 'tax_group_sequence'=>$this->xss_clean($tax_group_sequence[$key])); } $success = $this->Tax_category->save_categories($array_save); diff --git a/application/language/en-GB/common_lang.php b/application/language/en-GB/common_lang.php index 048e0de7f..5bc48eb03 100644 --- a/application/language/en-GB/common_lang.php +++ b/application/language/en-GB/common_lang.php @@ -6,6 +6,7 @@ $lang["common_city"] = "City"; $lang["common_close"] = "Close"; $lang["common_comments"] = "Comments"; $lang["common_common"] = "common"; +$lang["common_correct_errors"] = "Please correct identified errors before saving"; $lang["common_confirm_search"] = "You have selected one or more rows, these will no longer be selected after your search. Are you sure you want to submit this search?"; $lang["common_country"] = "Country"; $lang["common_date"] = "Date"; diff --git a/application/language/en-GB/taxes_lang.php b/application/language/en-GB/taxes_lang.php index ac6fc750f..c15469d9b 100644 --- a/application/language/en-GB/taxes_lang.php +++ b/application/language/en-GB/taxes_lang.php @@ -32,10 +32,15 @@ $lang["taxes_tax_categories_saved_successfully"] = "Tax Categories changes saved $lang["taxes_tax_categories_saved_unsuccessfully"] = "Tax Categories changes not saved"; $lang["taxes_tax_category"] = "Tax Category"; $lang["taxes_tax_category_code"] = "Tax Category Code"; +$lang["taxes_tax_category_duplicate"] = "Duplicate tax category"; +$lang["taxes_tax_category_invalid_chars"] = "Invalid characters in tax category name"; $lang["taxes_tax_category_name"] = "Tax Category Name"; $lang["taxes_tax_category_new"] = "New Tax Category"; +$lang["taxes_tax_category_required"] = "Tax category is required"; $lang["taxes_tax_code"] = "Tax Code"; $lang["taxes_tax_code_cannot_be_deleted"] = "Tax Code delete failed"; +$lang["taxes_tax_code_duplicate"] = "Duplicate tax code"; +$lang["taxes_tax_code_invalid_chars"] = "Invalid characters in tax code"; $lang["taxes_tax_code_name"] = "Tax Code Name"; $lang["taxes_tax_code_required"] = "Tax Code is a required field"; $lang["taxes_tax_code_successful_deleted"] = "You have successfully deleted Tax Code"; @@ -52,11 +57,15 @@ $lang["taxes_tax_group"] = "Tax Group"; $lang["taxes_tax_group_sequence"] = "Tax Group Sequence"; $lang["taxes_tax_included"] = "Tax included"; $lang["taxes_tax_jurisdiction"] = "Tax Jurisdiction"; +$lang["taxes_tax_jurisdiction_duplicate"] = "Duplicate tax jurisdiction"; +$lang["taxes_tax_jurisdiction_invalid_chars"] = "Invalid characters in jurisdiction name"; +$lang["taxes_tax_jurisdiction_required"] = "Tax jurisdiction is required"; $lang["taxes_tax_jurisdictions"] = "Tax Jurisdictions"; $lang["taxes_tax_jurisdictions_configuration"] = "Tax Jurisdictions Configuration"; $lang["taxes_tax_jurisdictions_saved_successfully"] = "Tax Jurisdiction changes saved"; $lang["taxes_tax_jurisdictions_saved_unsuccessfully"] = "Tax Jurisdiction changes not saved"; $lang["taxes_tax_rate"] = "Tax Rate"; +$lang["taxes_tax_rate_configuration"] = "Tax Rate Configuration"; $lang["taxes_tax_rate_error_adding_updating"] = "Tax Rate add or update failed"; $lang["taxes_tax_rate_numeric"] = "Tax Rate must be a number"; $lang["taxes_tax_rate_required"] = "Tax Rate is a required field"; diff --git a/application/language/en-US/common_lang.php b/application/language/en-US/common_lang.php index d88c26d58..e4ce3b0b4 100644 --- a/application/language/en-US/common_lang.php +++ b/application/language/en-US/common_lang.php @@ -6,6 +6,7 @@ $lang["common_city"] = "City"; $lang["common_close"] = "Close"; $lang["common_comments"] = "Comments"; $lang["common_common"] = "common"; +$lang["common_correct_errors"] = "Please correct identified errors before saving"; $lang["common_confirm_search"] = "You have selected one or more rows, these will no longer be selected after your search. Are you sure you want to submit this search?"; $lang["common_country"] = "Country"; $lang["common_date"] = "Date"; diff --git a/application/language/en-US/taxes_lang.php b/application/language/en-US/taxes_lang.php index a2aeb0d96..c15469d9b 100644 --- a/application/language/en-US/taxes_lang.php +++ b/application/language/en-US/taxes_lang.php @@ -22,7 +22,7 @@ $lang["taxes_round_half_odd"] = "Half Odd"; $lang["taxes_round_half_up"] = "Half Up"; $lang["taxes_rounding_code"] = "Rounding Code"; $lang["taxes_sales_tax"] = "Sales Tax"; -$lang["taxes_sales_tax_by_invoice"] = ""; +$lang["taxes_sales_tax_by_invoice"] = "Sales Tax by Invoice"; $lang["taxes_sequence"] = "Seq."; $lang["taxes_state"] = "State"; $lang["taxes_successful_deleted"] = "You have successfully deleted"; @@ -32,10 +32,15 @@ $lang["taxes_tax_categories_saved_successfully"] = "Tax Categories changes saved $lang["taxes_tax_categories_saved_unsuccessfully"] = "Tax Categories changes not saved"; $lang["taxes_tax_category"] = "Tax Category"; $lang["taxes_tax_category_code"] = "Tax Category Code"; +$lang["taxes_tax_category_duplicate"] = "Duplicate tax category"; +$lang["taxes_tax_category_invalid_chars"] = "Invalid characters in tax category name"; $lang["taxes_tax_category_name"] = "Tax Category Name"; $lang["taxes_tax_category_new"] = "New Tax Category"; +$lang["taxes_tax_category_required"] = "Tax category is required"; $lang["taxes_tax_code"] = "Tax Code"; $lang["taxes_tax_code_cannot_be_deleted"] = "Tax Code delete failed"; +$lang["taxes_tax_code_duplicate"] = "Duplicate tax code"; +$lang["taxes_tax_code_invalid_chars"] = "Invalid characters in tax code"; $lang["taxes_tax_code_name"] = "Tax Code Name"; $lang["taxes_tax_code_required"] = "Tax Code is a required field"; $lang["taxes_tax_code_successful_deleted"] = "You have successfully deleted Tax Code"; @@ -52,11 +57,15 @@ $lang["taxes_tax_group"] = "Tax Group"; $lang["taxes_tax_group_sequence"] = "Tax Group Sequence"; $lang["taxes_tax_included"] = "Tax included"; $lang["taxes_tax_jurisdiction"] = "Tax Jurisdiction"; +$lang["taxes_tax_jurisdiction_duplicate"] = "Duplicate tax jurisdiction"; +$lang["taxes_tax_jurisdiction_invalid_chars"] = "Invalid characters in jurisdiction name"; +$lang["taxes_tax_jurisdiction_required"] = "Tax jurisdiction is required"; $lang["taxes_tax_jurisdictions"] = "Tax Jurisdictions"; $lang["taxes_tax_jurisdictions_configuration"] = "Tax Jurisdictions Configuration"; $lang["taxes_tax_jurisdictions_saved_successfully"] = "Tax Jurisdiction changes saved"; $lang["taxes_tax_jurisdictions_saved_unsuccessfully"] = "Tax Jurisdiction changes not saved"; $lang["taxes_tax_rate"] = "Tax Rate"; +$lang["taxes_tax_rate_configuration"] = "Tax Rate Configuration"; $lang["taxes_tax_rate_error_adding_updating"] = "Tax Rate add or update failed"; $lang["taxes_tax_rate_numeric"] = "Tax Rate must be a number"; $lang["taxes_tax_rate_required"] = "Tax Rate is a required field"; diff --git a/application/migrations/sqlscripts/3.3.0_indiagst.sql b/application/migrations/sqlscripts/3.3.0_indiagst.sql index fe9c68ee4..f17bb2ea8 100644 --- a/application/migrations/sqlscripts/3.3.0_indiagst.sql +++ b/application/migrations/sqlscripts/3.3.0_indiagst.sql @@ -29,9 +29,7 @@ CREATE TABLE IF NOT EXISTS `ospos_tax_codes` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; ALTER TABLE `ospos_customers` - ADD COLUMN `tax_id` varchar(32) NOT NULL DEFAULT '' AFTER `taxable`; - -ALTER TABLE `ospos_customers` + ADD COLUMN `tax_id` varchar(32) NOT NULL DEFAULT '' AFTER `taxable`, ADD COLUMN `sales_tax_code_id` int(11) DEFAULT NULL AFTER `tax_id`; ALTER TABLE `ospos_items` diff --git a/application/models/Tax_category.php b/application/models/Tax_category.php index e18817630..76939609b 100644 --- a/application/models/Tax_category.php +++ b/application/models/Tax_category.php @@ -230,6 +230,14 @@ class Tax_category extends CI_Model return $suggestions; } + public function get_empty_row() + { + return array('0' => array( + 'tax_category_id' => -1, + 'tax_category' => '', + 'tax_group_sequence' => 0, + 'deleted' => 0)); + } } ?> diff --git a/application/models/Tax_code.php b/application/models/Tax_code.php index 81d8e7975..16b09b025 100644 --- a/application/models/Tax_code.php +++ b/application/models/Tax_code.php @@ -269,5 +269,15 @@ class Tax_code extends CI_Model return $suggestions; } + public function get_empty_row() + { + return array('0' => array( + 'tax_code_id' => -1, + 'tax_code' => '', + 'tax_code_name' => '', + 'city' => '', + 'state' => '', + 'deleted' => 0)); + } } ?> diff --git a/application/models/Tax_jurisdiction.php b/application/models/Tax_jurisdiction.php index 7f3e38cf2..e27ba46b4 100644 --- a/application/models/Tax_jurisdiction.php +++ b/application/models/Tax_jurisdiction.php @@ -210,5 +210,19 @@ class Tax_jurisdiction extends CI_Model return $this->db->get(); } + + public function get_empty_row() + { + return array('0' => array( + 'jurisdiction_id' => -1, + 'jurisdiction_name' => '', + 'tax_group' => '', + 'tax_type' => '1', + 'reporting_authority' => '', + 'tax_group_sequence' => 0, + 'cascade_sequence' => 0, + 'deleted' => 0)); + } + } ?> diff --git a/application/views/partial/tax_categories.php b/application/views/partial/tax_categories.php index ee6b586cb..a1ee13352 100644 --- a/application/views/partial/tax_categories.php +++ b/application/views/partial/tax_categories.php @@ -12,9 +12,9 @@ foreach($tax_categories as $key => $category) lang->line('taxes_tax_category') . ' ' . $i, 'tax_category_' . $i, array('class' => 'control-label col-xs-2')); ?>
                      'tax_category_' . $i, + 'name' => 'tax_category[]', 'id' => 'tax_category_' . $i, - 'class' => 'valid_chars form-control input-sm required', + 'class' => 'valid_chars form-control input-sm', 'placeholder' => $this->lang->line('taxes_tax_category_name'), 'value' => $tax_category ); @@ -23,8 +23,7 @@ foreach($tax_categories as $key => $category)
                      'tax_group_sequence_' . $i, - 'id' => 'tax_group_sequence_' . $i, + 'name' => 'tax_group_sequence[]', 'class' => 'valid_chars form-control input-sm', 'placeholder' => $this->lang->line('taxes_sequence'), 'value' => $tax_group_sequence @@ -35,42 +34,8 @@ foreach($tax_categories as $key => $category)    - +
                      - -
                      - lang->line('taxes_tax_category') . ' 1', 'tax_category_1', array('class' => 'control-label col-xs-2')); ?> -
                      - 'tax_category_1', - 'id' => 'tax_category_1', - 'class' => 'valid_chars form-control input-sm required', - 'placeholder' => $this->lang->line('taxes_tax_category_name'), - 'value' => '' - ); - echo form_input($form_data); - ?> -
                      -
                      - 'tax_group_sequence_1', - 'id' => 'tax_group_sequence_1', - 'class' => 'valid_chars form-control input-sm', - 'placeholder' => $this->lang->line('taxes_sequence'), - 'value' => '' - ); - echo form_input($form_data); - ?> -
                      - -    - - -
                      - diff --git a/application/views/partial/tax_codes.php b/application/views/partial/tax_codes.php index 3db8fcce0..fa37117a5 100644 --- a/application/views/partial/tax_codes.php +++ b/application/views/partial/tax_codes.php @@ -14,9 +14,9 @@ foreach($tax_codes as $tax_code => $tax_code_data) lang->line('taxes_tax_code') . ' ' . $i, 'tax_code_' . $i, array('class'=>'control-label col-xs-2')); ?>
                      'tax_code_' . $i, + 'name'=>'tax_code[]', 'id'=>'tax_code_' . $i, - 'class'=>'valid_chars text-uppercase form-control input-sm required', + 'class'=>'valid_chars text-uppercase form-control input-sm', 'placeholder'=>$this->lang->line('taxes_code'), 'value'=>$tax_code ); @@ -25,9 +25,8 @@ foreach($tax_codes as $tax_code => $tax_code_data)
                      'tax_code_name_' . $i, - 'id'=>'tax_code_name_' . $i, - 'class'=>'valid_chars form-control input-sm required', + 'name'=>'tax_code_name[]', + 'class'=>'valid_chars form-control input-sm', 'placeholder'=>$this->lang->line('taxes_name'), 'value'=>$tax_code_name ); @@ -36,8 +35,7 @@ foreach($tax_codes as $tax_code => $tax_code_data)
                      'city_' . $i, - 'id'=>'city_' . $i, + 'name'=>'city[]', 'class'=>'valid_chars form-control input-sm', 'placeholder'=>$this->lang->line('taxes_city'), 'value'=>$city @@ -47,8 +45,7 @@ foreach($tax_codes as $tax_code => $tax_code_data)
                      'state_' . $i, - 'id'=>'state_' . $i, + 'name'=>'state[]', 'class'=>'valid_chars form-control input-sm', 'placeholder'=>$this->lang->line('taxes_state'), 'value'=>$state @@ -60,64 +57,7 @@ foreach($tax_codes as $tax_code => $tax_code_data)    - -
                      - -
                      - lang->line('taxes_tax_code') . ' 1', 'tax_code_1', array('class'=>'control-label col-xs-2')); ?> -
                      - 'tax_code_1', - 'id'=>'tax_code_1', - 'class'=>'valid_chars text-uppercase form-control input-sm required', - 'placeholder'=>$this->lang->line('taxes_code'), - 'value'=>'' - ); - echo form_input($form_data); - ?> -
                      -
                      - 'tax_code_name_1', - 'id'=>'tax_code_name_1', - 'class'=>'valid_chars form-control input-sm required', - 'placeholder'=>$this->lang->line('taxes_name'), - 'value'=>'' - ); - echo form_input($form_data); - ?> -
                      -
                      - 'city_1', - 'id'=>'city_1', - 'class'=>'valid_chars form-control input-sm', - 'placeholder'=>$this->lang->line('taxes_city'), - 'value'=>'' - ); - echo form_input($form_data); - ?> -
                      -
                      - 'state_1', - 'id'=>'state_1', - 'class'=>'valid_chars form-control input-sm', - 'placeholder'=>$this->lang->line('taxes_state'), - 'value'=>'' - ); - echo form_input($form_data); - ?> -
                      - - -    - - +
                      $jurisdiction) lang->line('taxes_tax_jurisdiction') . ' ' . $i, 'jurisdiction_name_' . $i, array('class'=>'control-label col-xs-2')); ?>
                      'jurisdiction_name_' . $i, + 'name'=>'jurisdiction_name[]', 'id'=>'jurisdiction_name_' . $i, - 'class'=>'valid_chars form-control input-sm required', + 'class'=>'valid_chars form-control input-sm', 'placeholder'=>$this->lang->line('taxes_jurisdiction_name'), 'value'=>$jurisdiction_name ); @@ -28,9 +28,8 @@ foreach($tax_jurisdictions as $tax_jurisdiction => $jurisdiction)
                      'tax_group_' . $i, - 'id'=>'tax_group_' . $i, - 'class'=>'valid_chars form-control input-sm required', + 'name'=>'tax_group[]', + 'class'=>'valid_chars form-control input-sm', 'placeholder'=>$this->lang->line('taxes_tax_group'), 'value'=>$tax_group ); @@ -39,13 +38,12 @@ foreach($tax_jurisdictions as $tax_jurisdiction => $jurisdiction)
                      - 'form-control')); ?> + 'form-control')); ?>
                      'reporting_authority_' . $i, - 'id'=>'reporting_authority_' . $i, + 'name'=>'reporting_authority[]', 'class'=>'valid_chars form-control input-sm', 'placeholder'=>$this->lang->line('taxes_reporting_authority'), 'value'=>$reporting_authority @@ -56,8 +54,7 @@ foreach($tax_jurisdictions as $tax_jurisdiction => $jurisdiction)
                      'tax_group_sequence_' . $i, - 'id'=>'tax_group_sequence_' . $i, + 'name'=>'tax_group_sequence[]', 'class'=>'valid_chars form-control input-sm', 'placeholder' => $this->lang->line('taxes_sequence'), 'value'=>$tax_group_sequence @@ -68,8 +65,7 @@ foreach($tax_jurisdictions as $tax_jurisdiction => $jurisdiction)
                      'cascade_sequence_' . $i, - 'id'=>'cascade_sequence_' . $i, + 'name'=>'cascade_sequence[]', 'class'=>'valid_chars form-control input-sm', 'placeholder'=>$this->lang->line('taxes_cascade_sequence'), 'value'=>$cascade_sequence @@ -80,77 +76,7 @@ foreach($tax_jurisdictions as $tax_jurisdiction => $jurisdiction)    - -
                      - -
                      - lang->line('taxes_tax_jurisdiction') . ' 1', 'jurisdiction_name_1', array('class'=>'control-label col-xs-2')); ?> -
                      - 'jurisdiction_name_1', - 'id'=>'jurisdiction_name_1', - 'class'=>'valid_chars form-control input-sm required', - 'placeholder'=>$this->lang->line('taxes_jurisdiction_name'), - 'value'=>'' - ); - echo form_input($form_data); - ?> -
                      -
                      - 'tax_group_1', - 'id'=>'tax_group_1', - 'class'=>'valid_chars form-control input-sm required', - 'placeholder'=>$this->lang->line('taxes_tax_group'), - 'value'=>'' - ); - echo form_input($form_data); - ?> -
                      -
                      - 'form-control')); ?> -
                      -
                      - 'reporting_authority_1', - 'id'=>'reporting_authority_1', - 'class'=>'valid_chars form-control input-sm', - 'placeholder'=>$this->lang->line('taxes_reporting_authority'), - 'value'=>'' - ); - echo form_input($form_data); - ?> -
                      -
                      - 'tax_group_sequence_1', - 'id'=>'tax_group_sequence_1', - 'class'=>'valid_chars form-control input-sm', - 'placeholder' => $this->lang->line('taxes_sequence'), - 'value'=>'' - ); - echo form_input($form_data); - ?> -
                      -
                      - 'cascade_sequence_1', - 'id'=>'cascade_sequence_1', - 'class'=>'valid_chars form-control input-sm', - 'placeholder'=>$this->lang->line('taxes_cascade_sequence'), - 'value'=>'' - ); - echo form_input($form_data); - ?> -
                      - -    - - +
                      1) { $(".remove_tax_category").show(); @@ -41,51 +41,59 @@ var id = $(this).parent().find('input').attr('id'); id = id.replace(/.*?_(\d+)$/g, "$1"); - var previous_tax_category_id_id = 'tax_category_id_' + id; var previous_tax_category_id = 'tax_category_' + id; - var previous_default_tax_rate_id = 'default_tax_rate_' + id; - var previous_tax_group_sequence_id = 'tax_group_sequence_' + id; var block = $(this).parent().clone(true); var new_block = block.insertAfter($(this).parent()); - var new_tax_category_id_id = 'tax_category_id_' + ++tax_categories_count; + ++tax_categories_count; var new_tax_category_id = 'tax_category_' + tax_categories_count; - var new_default_tax_rate_id = 'default_tax_rate_' + tax_categories_count; - var new_tax_group_sequence_id = 'tax_group_sequence_' + tax_categories_count; $(new_block).find('label').html("lang->line('taxes_tax_category'); ?> " + tax_categories_count).attr('for', new_tax_category_id).attr('class', 'control-label col-xs-2'); - $(new_block).find("input[name='"+previous_tax_category_id_id+"']").attr('name', new_tax_category_id_id).val('-1'); - $(new_block).find("input[id='"+previous_tax_category_id+"']").attr('id', new_tax_category_id).removeAttr('disabled').attr('name', new_tax_category_id).attr('class', 'form-control input-sm').val(''); - $(new_block).find("input[id='"+previous_default_tax_rate_id+"']").attr('id', new_default_tax_rate_id).removeAttr('disabled').attr('name', new_default_tax_rate_id).attr('class', 'form-control input-sm').val(''); - $(new_block).find("input[id='"+previous_tax_group_sequence_id+"']").attr('id', new_tax_group_sequence_id).removeAttr('disabled').attr('name', new_tax_group_sequence_id).attr('class', 'form-control input-sm').val(''); - hide_show_remove(); + $(new_block).find("input[name='tax_category[]']").attr('id', new_tax_category_id).removeAttr('disabled').attr('class', 'form-control input-sm required').val(''); + $(new_block).find("input[name='tax_group_sequence[]']").removeAttr('disabled').attr('class', 'form-control input-sm').val(''); + $(new_block).find("input[name='tax_category_id[]']").val('-1'); + hide_show_remove_tax_category(); }; var remove_tax_category = function() { $(this).parent().remove(); - hide_show_remove(); + hide_show_remove_tax_category(); }; var init_add_remove_tax_categories = function() { $('.add_tax_category').click(add_tax_category); $('.remove_tax_category').click(remove_tax_category); - hide_show_remove(); + hide_show_remove_tax_category(); }; init_add_remove_tax_categories(); var duplicate_found = false; + // run validator once for all fields - $.validator.addMethod('tax_category' , function(value, element) { + $.validator.addMethod("check4TaxCategoryDups" , function(value, element) { var value_count = 0; - $("input[name*='tax_category']").each(function() { + $('input[name="tax_category[]"]').each(function() { value_count = $(this).val() == value ? value_count + 1 : value_count; }); - return value_count < 2; + if (value_count > 1) { + return false; + } + return true; }, "lang->line('taxes_tax_category_duplicate'); ?>"); - $.validator.addMethod('valid_chars', function(value, element) { - return value.indexOf('_') === -1; + $.validator.addMethod('validateTaxCategoryCharacters', function(value, element) { + if ((value.indexOf('_') != -1)) { + return false; + } + return true; }, "lang->line('taxes_tax_category_invalid_chars'); ?>"); + $.validator.addMethod('requireTaxCategory', function(value, element) { + if (value .trim() == '') { + return false; + } + return true; + }, "lang->line('taxes_tax_category_required'); ?>"); + $('#tax_categories_form').validate($.extend(form_support.handler, { submitHandler: function(form) { $(form).ajaxSubmit({ @@ -96,41 +104,25 @@ dataType: 'json' }); }, - - errorLabelContainer: "#tax_category_error_message_box", - - rules: - { - $tax_category_data) - { - ?> - : - { - required: true, - tax_category: true, - valid_chars: true + invalidHandler: function(event, validator) { + $.notify("lang->line('common_correct_errors'); ?>"); }, - - }, - - messages: - { - $tax_category_data) - { - ?> - : "lang->line('taxes_tax_category_required'); ?>", - - } + errorLabelContainer: "#tax_category_error_message_box" })); + + $tax_category_data) + { + ?> + $('').rules( "add", { + requireTaxCategory: true, + check4TaxCategoryDups: true, + validateTaxCategoryCharacters: true + }); + + }); diff --git a/application/views/taxes/tax_codes.php b/application/views/taxes/tax_codes.php index ad2bd7220..d061fb500 100644 --- a/application/views/taxes/tax_codes.php +++ b/application/views/taxes/tax_codes.php @@ -26,7 +26,7 @@ tax_code_count = 1; } - var hide_show_remove = function() { + var hide_show_remove_tax_code = function() { if ($("input[name*='tax_code']:enabled").length > 1) { $(".remove_tax_code").show(); @@ -38,59 +38,64 @@ }; var add_tax_code = function() { - var id = $(this).parent().find('input').attr('id'); + var id = $(this).parent().find("input[name='tax_code[]']").attr('id'); id = id.replace(/.*?_(\d+)$/g, "$1"); - var previous_tax_code_id_id = 'tax_code_id_' + id; var previous_tax_code_id = 'tax_code_' + id; - var previous_tax_code_name_id = 'tax_code_name_' + id; - var previous_city_id = 'city_' + id; - var previous_statte_id = 'state_' + id; var block = $(this).parent().clone(true); var new_block = block.insertAfter($(this).parent()); ++tax_code_count; - var new_tax_code_id_id = 'tax_code_id_' + tax_code_count; var new_tax_code_id = 'tax_code_' + tax_code_count; - var new_tax_code_name_id = 'tax_code_name_' + tax_code_count; - var new_city_id = 'city_' + tax_code_count; - var new_state_id = 'state_' + tax_code_count; $(new_block).find('label').html("lang->line('taxes_tax_code'); ?> " + tax_code_count).attr('for', new_tax_code_id).attr('class', 'control-label col-xs-2'); - $(new_block).find("input[id='"+previous_tax_code_id+"']").attr('id', new_tax_code_id).removeAttr('disabled').attr('name', new_tax_code_id).attr('class', 'form-control text-uppercase required input-sm').val(''); - $(new_block).find("input[id='"+previous_tax_code_name_id+"']").attr('id', new_tax_code_name_id).removeAttr('disabled').attr('name', new_tax_code_name_id).attr('class', 'form-control required input-sm').val(''); - $(new_block).find("input[id='"+previous_city_id+"']").attr('id', new_city_id).removeAttr('disabled').attr('name', new_city_id).attr('class', 'form-control input-sm').val(''); - $(new_block).find("input[id='"+previous_statte_id+"']").attr('id', new_state_id).removeAttr('disabled').attr('name', new_state_id).attr('class', 'form-control input-sm').val(''); + $(new_block).find("input[name='tax_code[]']").attr('id', new_tax_code_id).removeAttr('disabled').attr('class', 'form-control text-uppercase required input-sm').val(''); + $(new_block).find("input[name='tax_code_name[]']").removeAttr('disabled').attr('class', 'form-control required input-sm').val(''); + $(new_block).find("input[name='city[]']").removeAttr('disabled').attr('class', 'form-control input-sm').val(''); + $(new_block).find("input[name='state[]']").removeAttr('disabled').attr('class', 'form-control input-sm').val(''); + $(new_block).find("input[name='tax_code_id[]']").val('-1'); - hide_show_remove(); + hide_show_remove_tax_code(); }; var remove_tax_code = function() { $(this).parent().remove(); - hide_show_remove(); + hide_show_remove_tax_code(); }; var init_add_remove_tax_codes = function() { $('.add_tax_code').click(add_tax_code); $('.remove_tax_code').click(remove_tax_code); - hide_show_remove(); + hide_show_remove_tax_code(); }; init_add_remove_tax_codes(); - var duplicate_found = false; // run validator once for all fields - $.validator.addMethod('tax_code' , function(value, element) { + $.validator.addMethod('check4TaxCodeDups' , function(value, element) { var value_count = 0; - $("input[name*='tax_code']").each(function() { + $("input[name='tax_code[]']").each(function() { value_count = $(this).val() == value ? value_count + 1 : value_count; }); - return value_count < 2; + if (value_count > 1) { + return false; + } + return true; }, "lang->line('taxes_tax_code_duplicate'); ?>"); - $.validator.addMethod('valid_chars', function(value, element) { - return value.indexOf('_') === -1; + $.validator.addMethod('validateTaxCodeCharacters', function(value, element) { + if ((value.indexOf('_') != -1)) { + return false; + } + return true; }, "lang->line('taxes_tax_code_invalid_chars'); ?>"); + $.validator.addMethod('requireTaxCode', function(value, element) { + if (value .trim() == '') { + return false; + } + return true; + }, "lang->line('taxes_tax_code_required'); ?>"); + $('#tax_codes_form').validate($.extend(form_support.handler, { - submitHandler: function(form) { + submitHandler: function(form, event) { $(form).ajaxSubmit({ success: function(response) { $.notify({ message: response.message }, { type: response.success ? 'success' : 'danger'}); @@ -99,41 +104,25 @@ dataType: 'json' }); }, - - errorLabelContainer: "#tax_code_error_message_box", - - rules: - { - $tax_code_data) - { - ?> - : - { - required: true, - tax_code: true, - valid_chars: true - }, - + invalidHandler: function(event, validator) { + $.notify("lang->line('common_correct_errors'); ?>"); }, - - messages: - { - $tax_code_data) - { - ?> - : "lang->line('taxes_tax_code_required'); ?>", - - } + errorLabelContainer: "#tax_code_error_message_box" })); + + $tax_code_data) + { + ?> + $('').rules( "add", { + requireTaxCode: true, + check4TaxCodeDups: true, + validateTaxCodeCharacters: true + }); + + }); diff --git a/application/views/taxes/tax_jurisdictions.php b/application/views/taxes/tax_jurisdictions.php index e72c98dd0..1327c54f6 100644 --- a/application/views/taxes/tax_jurisdictions.php +++ b/application/views/taxes/tax_jurisdictions.php @@ -27,7 +27,7 @@ } var tax_type_options = ''; - var hide_show_remove = function() { + var hide_show_remove_tax_jurisdiction = function() { if ($("input[name*='tax_jurisdiction']:enabled").length > 1) { $(".remove_tax_jurisdiction").show(); @@ -42,61 +42,61 @@ var id = $(this).parent().find('input').attr('id'); id = id.replace(/.*?_(\d+)$/g, "$1"); - var previous_jurisdiction_id = 'jurisdiction_id_' + id; var previous_jurisdiction_name_id = 'jurisdiction_name_' + id; - var previous_tax_group_id = 'tax_group_' + id; - var previous_tax_type_id = 'tax_type_' + id; - var previous_reporting_authority_id = 'reporting_authority_' + id; - var previous_tax_group_sequence_id = 'tax_group_sequence_' + id; - var previous_cascade_sequence_id = 'cascade_sequence_' + id; var block = $(this).parent().clone(true); var new_block = block.insertAfter($(this).parent()); ++tax_jurisdictions_count; - var new_jurisdiction_id = 'jurisdiction_id_' + tax_jurisdictions_count; var new_jurisdiction_name_id = 'jurisdiction_name_' + tax_jurisdictions_count; - var new_tax_group_id = 'tax_group_' + tax_jurisdictions_count; - var new_tax_type_id = 'tax_type_' + tax_jurisdictions_count; - var new_reporting_authority_id = 'reporting_authority_' + tax_jurisdictions_count; - var new_tax_group_sequence_id = 'tax_group_sequence_' + tax_jurisdictions_count; - var new_cascade_sequence_id = 'cascade_sequence_' + tax_jurisdictions_count; $(new_block).find('label').html("lang->line('taxes_tax_jurisdiction'); ?> " + tax_jurisdictions_count).attr('for', new_jurisdiction_name_id).attr('class', 'control-label col-xs-2'); - $(new_block).find("input[name='"+previous_jurisdiction_id+"']").attr('name', new_jurisdiction_id).val('-1'); - $(new_block).find("input[id='"+previous_jurisdiction_name_id+"']").attr('id', new_jurisdiction_name_id).removeAttr('disabled').attr('name', new_jurisdiction_name_id).attr('class', 'form-control required input-sm').val(''); - $(new_block).find("input[id='"+previous_tax_group_id+"']").attr('id', new_tax_group_id).removeAttr('disabled').attr('name', new_tax_group_id).attr('class', 'form-control required input-sm').val(''); - $(new_block).find("select[name='"+previous_tax_type_id+"']").attr('name', new_tax_type_id).removeAttr('disabled').attr('class', 'form-control required input-sm').val(''); - $(new_block).find("input[id='"+previous_reporting_authority_id+"']").attr('id', new_reporting_authority_id).removeAttr('disabled').attr('name', new_reporting_authority_id).attr('class', 'form-control input-sm').val(''); - $(new_block).find("input[id='"+previous_tax_group_sequence_id+"']").attr('id', new_tax_group_sequence_id).removeAttr('disabled').attr('name', new_tax_group_sequence_id).attr('class', 'form-control input-sm').val(''); - $(new_block).find("input[id='"+previous_cascade_sequence_id+"']").attr('id', new_cascade_sequence_id).removeAttr('disabled').attr('name', new_cascade_sequence_id).attr('class', 'form-control input-sm').val(''); - hide_show_remove(); + $(new_block).find("input[name='jurisdiction_name[]']").attr('id', new_jurisdiction_name_id).removeAttr('disabled').attr('class', 'form-control required input-sm').val(''); + $(new_block).find("input[name='tax_group[]']").removeAttr('disabled').attr('class', 'form-control required input-sm').val(''); + $(new_block).find("select[name='tax_type[]']").removeAttr('disabled').attr('class', 'form-control required input-sm').val(''); + $(new_block).find("input[name='reporting_authority[]']").removeAttr('disabled').attr('class', 'form-control input-sm').val(''); + $(new_block).find("input[name='tax_group_sequence[]']").removeAttr('disabled').attr('class', 'form-control input-sm').val(''); + $(new_block).find("input[name='cascade_sequence[]']").removeAttr('disabled').attr('class', 'form-control input-sm').val(''); + $(new_block).find("input[name='jurisdiction_id[]']").val('-1'); + hide_show_remove_tax_jurisdiction(); }; var remove_tax_jurisdiction = function() { $(this).parent().remove(); - hide_show_remove(); + hide_show_remove_tax_jurisdiction(); }; var init_add_remove_tax_jurisdiction = function() { $('.add_tax_jurisdiction').click(add_tax_jurisdiction); $('.remove_tax_jurisdiction').click(remove_tax_jurisdiction); - hide_show_remove(); + hide_show_remove_tax_jurisdiction(); }; init_add_remove_tax_jurisdiction(); - var duplicate_found = false; // run validator once for all fields - $.validator.addMethod('tax_jurisdiction' , function(value, element) { + $.validator.addMethod('check4TaxJurisdictionDups' , function(value, element) { var value_count = 0; - $("input[name*='tax_jurisdiction']").each(function() { + $("input[name='jurisdiction_name[]']").each(function() { value_count = $(this).val() == value ? value_count + 1 : value_count; }); - return value_count < 2; + if (value_count > 1) { + return false; + } + return true; }, "lang->line('taxes_tax_jurisdiction_duplicate'); ?>"); - $.validator.addMethod('valid_chars', function(value, element) { - return value.indexOf('_') === -1; + $.validator.addMethod('validateTaxJurisdictionCharacters', function(value, element) { + if ((value.indexOf('_') != -1)) { + return false; + } + return true; }, "lang->line('taxes_tax_jurisdiction_invalid_chars'); ?>"); + $.validator.addMethod('requireTaxJurisdiction', function(value, element) { + if (value .trim() == '') { + return false; + } + return true; + }, "lang->line('taxes_tax_jurisdiction_required'); ?>"); + $('#tax_jurisdictions_form').validate($.extend(form_support.handler, { submitHandler: function(form) { $(form).ajaxSubmit({ @@ -107,41 +107,24 @@ dataType: 'json' }); }, - - errorLabelContainer: "#tax_jurisdiction_error_message_box", - - rules: - { - $tax_jurisdiction_data) - { - ?> - : - { - required: true, - tax_jurisdiction: true, - valid_chars: true - }, - + invalidHandler: function(event, validator) { + $.notify("lang->line('common_correct_errors'); ?>"); }, - - messages: - { - $tax_jurisdiction_data) - { - ?> - : "lang->line('taxes_tax_jurisdiction_required'); ?>", - - } + errorLabelContainer: "#tax_jurisdiction_error_message_box" })); + + $tax_jurisdiction_data) + { + ?> + $('').rules( "add", { + requireTaxJurisdiction: true, + check4TaxJurisdictionDups: true, + validateTaxJurisdictionCharacters: true + }); + }); From 02d7588e59a08f52db9004aec5fbd1d4c88117ec Mon Sep 17 00:00:00 2001 From: jekkos Date: Thu, 10 Jan 2019 19:19:04 +0100 Subject: [PATCH 483/568] Add config item for default order discount --- application/controllers/Config.php | 2 ++ application/controllers/Receivings.php | 7 +++-- application/controllers/Sales.php | 8 +----- application/language/en-GB/config_lang.php | 5 +++- application/language/en-US/common_lang.php | 2 +- application/language/en-US/config_lang.php | 5 +++- application/language/nl-BE/config_lang.php | 5 +++- application/libraries/Receiving_lib.php | 10 +++---- .../migrations/sqlscripts/3.2.1_to_3.3.0.sql | 12 +++++--- application/views/configs/general_config.php | 28 +++++++++++++++++++ 10 files changed, 61 insertions(+), 23 deletions(-) diff --git a/application/controllers/Config.php b/application/controllers/Config.php index 8a7e91f4f..4dd1f8cae 100644 --- a/application/controllers/Config.php +++ b/application/controllers/Config.php @@ -276,6 +276,8 @@ class Config extends Secure_Controller 'theme' => $this->input->post('theme'), 'default_sales_discount_type' => $this->input->post('default_sales_discount_type') != NULL, 'default_sales_discount' => $this->input->post('default_sales_discount'), + 'default_receivings_discount_type' => $this->input->post('default_receivings_discount_type') != NULL, + 'default_receivings_discount' => $this->input->post('default_receivings_discount'), 'enforce_privacy' => $this->input->post('enforce_privacy'), 'receiving_calculate_average_price' => $this->input->post('receiving_calculate_average_price') != NULL, 'lines_per_page' => $this->input->post('lines_per_page'), diff --git a/application/controllers/Receivings.php b/application/controllers/Receivings.php index 10eec315a..7872eff29 100644 --- a/application/controllers/Receivings.php +++ b/application/controllers/Receivings.php @@ -93,7 +93,8 @@ class Receivings extends Secure_Controller $this->barcode_lib->parse_barcode_fields($quantity, $item_id_or_number_or_item_kit_or_receipt); $quantity = ($mode == 'receive' || $mode == 'requisition') ? $quantity : -$quantity; $item_location = $this->receiving_lib->get_stock_source(); - $discount_type = $this->config->item('default_sales_discount_type'); + $discount = $this->config->item('default_receivings_discount'); + $discount_type = $this->config->item('default_receivings_discount_type'); if($mode == 'return' && $this->Receiving->is_valid_receipt($item_id_or_number_or_item_kit_or_receipt)) { @@ -101,9 +102,9 @@ class Receivings extends Secure_Controller } elseif($this->Item_kit->is_valid_item_kit($item_id_or_number_or_item_kit_or_receipt)) { - $this->receiving_lib->add_item_kit($item_id_or_number_or_item_kit_or_receipt, $item_location, $discount_type); + $this->receiving_lib->add_item_kit($item_id_or_number_or_item_kit_or_receipt, $item_location, $discount, $discount_type); } - elseif(!$this->receiving_lib->add_item($item_id_or_number_or_item_kit_or_receipt, $quantity, $item_location, $discount_type)) + elseif(!$this->receiving_lib->add_item($item_id_or_number_or_item_kit_or_receipt, $quantity, $item_location, $discount, $discount_type)) { $data['error'] = $this->lang->line('receivings_unable_to_add_item'); } diff --git a/application/controllers/Sales.php b/application/controllers/Sales.php index 19fb36873..731991390 100644 --- a/application/controllers/Sales.php +++ b/application/controllers/Sales.php @@ -367,7 +367,7 @@ class Sales extends Secure_Controller { $data = array(); - $discount = 0.0; + $discount = $this->config->item('default_sales_discount'); $discount_type = $this->config->item('default_sales_discount_type'); // check if any discount is assigned to the selected customer @@ -384,12 +384,6 @@ class Sales extends Secure_Controller } } - // if the customer discount is 0 or no customer is selected apply the default sales discount - if($discount == 0) - { - $discount = $this->config->item('default_sales_discount'); - } - $item_id_or_number_or_item_kit_or_receipt = $this->input->post('item'); $this->barcode_lib->parse_barcode_fields($quantity, $item_id_or_number_or_item_kit_or_receipt); $mode = $this->sale_lib->get_mode(); diff --git a/application/language/en-GB/config_lang.php b/application/language/en-GB/config_lang.php index d367425cc..3ed2bee2a 100644 --- a/application/language/en-GB/config_lang.php +++ b/application/language/en-GB/config_lang.php @@ -68,7 +68,10 @@ $lang["config_default_barcode_width_number"] = "Default Barcode Width must be a $lang["config_default_barcode_width_required"] = "Default Barcode Width is a required field"; $lang["config_default_item_columns"] = "Default Visible Item Columns"; $lang["config_default_origin_tax_code"] = "Default Origin Tax Code"; -$lang["config_default_sales_discount"] = "Default Sales Discount %"; +$lang["config_default_receivings_discount"] = "Default Receivings Discount"; +$lang["config_default_receivings_discount_number"] = "Default Receivings Discount must be a number"; +$lang["config_default_receivings_discount_required"] = "Default Receivings Discount is a required field"; +$lang["config_default_sales_discount"] = "Default Sales Discount"; $lang["config_default_sales_discount_number"] = "Default Sales Discount must be a number"; $lang["config_default_sales_discount_required"] = "Default Sales Discount is a required field"; $lang["config_default_tax_category"] = "Default Tax Category"; diff --git a/application/language/en-US/common_lang.php b/application/language/en-US/common_lang.php index d88c26d58..c6e36926e 100644 --- a/application/language/en-US/common_lang.php +++ b/application/language/en-US/common_lang.php @@ -42,7 +42,7 @@ $lang["common_logout"] = "Logout"; $lang["common_migration_needed"] = "A database migration to %1 will start after login."; $lang["common_new"] = "New"; $lang["common_no_persons_to_display"] = "There are no people to display."; -$lang["common_none_selected_text"] = "[Select]"; +$lang["common_none_selected_text"] = "Nothing selected"; $lang["common_or"] = "OR"; $lang["common_phone_number"] = "Phone Number"; $lang["common_phone_number_required"] = ""; diff --git a/application/language/en-US/config_lang.php b/application/language/en-US/config_lang.php index 32a1b7cb1..d21c10978 100644 --- a/application/language/en-US/config_lang.php +++ b/application/language/en-US/config_lang.php @@ -69,7 +69,10 @@ $lang["config_default_barcode_width_number"] = "Default Barcode Width must be a $lang["config_default_barcode_width_required"] = "Default Barcode Width is a required field."; $lang["config_default_item_columns"] = "Default Visible Item Columns"; $lang["config_default_origin_tax_code"] = "Default Origin Tax Code"; -$lang["config_default_sales_discount"] = "Default Sales Discount %"; +$lang["config_default_receivings_discount"] = "Default Receivings Discount"; +$lang["config_default_receivings_discount_number"] = "Default Receivings Discount must be a number."; +$lang["config_default_receivings_discount_required"] = "Default Receivings Discount is a required field."; +$lang["config_default_sales_discount"] = "Default Sales Discount"; $lang["config_default_sales_discount_number"] = "Default Sales Discount must be a number."; $lang["config_default_sales_discount_required"] = "Default Sales Discount is a required field."; $lang["config_default_tax_category"] = "Default Tax Category"; diff --git a/application/language/nl-BE/config_lang.php b/application/language/nl-BE/config_lang.php index 8c211347c..36f3ed26e 100755 --- a/application/language/nl-BE/config_lang.php +++ b/application/language/nl-BE/config_lang.php @@ -68,7 +68,10 @@ $lang["config_default_barcode_width_number"] = "De breedte van de barcode moet e $lang["config_default_barcode_width_required"] = "De breedte van de barcode is een verplicht veld."; $lang["config_default_item_columns"] = "Standaard Zichtbaarheid Kolommen"; $lang["config_default_origin_tax_code"] = "Standaard VAT code"; -$lang["config_default_sales_discount"] = "Standaard Korting %"; +$lang["config_default_receivings_discount"] = "Standaard Korting Orders"; +$lang["config_default_receivings_discount_number"] = "De korting moet een getal zijn."; +$lang["config_default_receivings_discount_required"] = "De korting is een verplicht veld."; +$lang["config_default_sales_discount"] = "Standaard Korting Verkoop"; $lang["config_default_sales_discount_number"] = "De korting moet een getal zijn."; $lang["config_default_sales_discount_required"] = "De korting is een verplicht veld."; $lang["config_default_tax_category"] = "Standaard Tax Categorie"; diff --git a/application/libraries/Receiving_lib.php b/application/libraries/Receiving_lib.php index 132bb6d35..a7982d6c3 100644 --- a/application/libraries/Receiving_lib.php +++ b/application/libraries/Receiving_lib.php @@ -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, $receiving_id = NULL, $include_deleted = FALSE) + public function add_item($item_id, $quantity = 1, $item_location = NULL, $discount = 0, $discount_type = 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)) @@ -320,13 +320,13 @@ 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, $receiving_id, $row->receiving_quantity, TRUE); + $this->add_item($row->item_id, -$row->quantity_purchased, $row->item_location, $row->discount, $row->discount_type, $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); } - public function add_item_kit($external_item_kit_id, $item_location, $discount_type) + public function add_item_kit($external_item_kit_id, $item_location, $discount, $discount_type) { //KIT # $pieces = explode(' ',$external_item_kit_id); @@ -334,7 +334,7 @@ class Receiving_lib foreach($this->CI->Item_kit_items->get_info($item_kit_id) as $item_kit_item) { - $this->add_item($item_kit_item['item_id'],$item_kit_item['quantity'], $item_location, $discount_type); + $this->add_item($item_kit_item['item_id'], $item_kit_item['quantity'], $item_location, $discount, $discount_type); } } @@ -345,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, $receiving_id, TRUE); + $this->add_item($row->item_id, $row->quantity_purchased, $row->item_location, $row->discount, $row->discount_type, $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); diff --git a/application/migrations/sqlscripts/3.2.1_to_3.3.0.sql b/application/migrations/sqlscripts/3.2.1_to_3.3.0.sql index 313f25291..e99727b23 100644 --- a/application/migrations/sqlscripts/3.2.1_to_3.3.0.sql +++ b/application/migrations/sqlscripts/3.2.1_to_3.3.0.sql @@ -132,15 +132,19 @@ SET `ospos_expenses`.`supplier_id` = `ospos_suppliers`.`person_id`; -- Save name in description for those expenses whose supplier isn't registered UPDATE `ospos_expenses` -SET `description` = CONCAT(`description`, CONCAT('\nSupplier name: ', `supplier_name`)) -WHERE `supplier_id` is NULL; + SET `description` = CONCAT(`description`, CONCAT('\nSupplier name: ', `supplier_name`)) + WHERE `supplier_id` is NULL; -- Add foreign key ALTER TABLE `ospos_expenses` -ADD CONSTRAINT `ospos_expenses_ibfk_3` FOREIGN KEY (`supplier_id`) REFERENCES `ospos_suppliers` (`person_id`); + ADD CONSTRAINT `ospos_expenses_ibfk_3` FOREIGN KEY (`supplier_id`) REFERENCES `ospos_suppliers` (`person_id`); -- Delete supplier name ALTER TABLE `ospos_expenses` -DROP COLUMN `supplier_name`; + DROP COLUMN `supplier_name`; + +INSERT INTO `ospos_app_config` (`key`, `value`) VALUES + ('default_receivings_discount_type', '0'), + ('default_receivings_discount', '0'); diff --git a/application/views/configs/general_config.php b/application/views/configs/general_config.php index 598bec6c8..e84edcfc7 100644 --- a/application/views/configs/general_config.php +++ b/application/views/configs/general_config.php @@ -39,6 +39,34 @@
                      +
                      + lang->line('config_default_receivings_discount'), 'default_receivings_discount', array('class' => 'control-label col-xs-2 required')); ?> +
                      +
                      + 'default_receivings_discount', + 'id' => 'default_receivings_discount', + 'class' => 'form-control input-sm required', + 'type' => 'number', + 'min' => 0, + 'max' => 100, + 'value' => $this->config->item('default_receivings_discount'))); ?> + + 'default_receivings_discount_type', + 'name' => 'default_receivings_discount_type', + 'value' => 1, + 'data-toggle' => 'toggle', + 'data-size' => 'normal', + 'data-onstyle' => 'success', + 'data-on' => ''.$this->config->item('currency_symbol').'', + 'data-off' => '%', + 'checked' => $this->config->item('default_receivings_discount_type'))); ?> + +
                      +
                      +
                      +
                      lang->line('config_enforce_privacy'), 'enforce_privacy', array('class' => 'control-label col-xs-2')); ?>
                      From f911cebae277b89fe61d38befcf31e4e2bbb6e79 Mon Sep 17 00:00:00 2001 From: jekkos Date: Sat, 12 Jan 2019 17:49:17 +0100 Subject: [PATCH 484/568] Revert translation update + bump migration script version --- application/language/en-US/common_lang.php | 2 +- ...upgrade_to_3_3_0.php => 20190111270000_upgrade_to_3_3_0.php} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename application/migrations/{20181014170000_upgrade_to_3_3_0.php => 20190111270000_upgrade_to_3_3_0.php} (100%) diff --git a/application/language/en-US/common_lang.php b/application/language/en-US/common_lang.php index c6e36926e..d88c26d58 100644 --- a/application/language/en-US/common_lang.php +++ b/application/language/en-US/common_lang.php @@ -42,7 +42,7 @@ $lang["common_logout"] = "Logout"; $lang["common_migration_needed"] = "A database migration to %1 will start after login."; $lang["common_new"] = "New"; $lang["common_no_persons_to_display"] = "There are no people to display."; -$lang["common_none_selected_text"] = "Nothing selected"; +$lang["common_none_selected_text"] = "[Select]"; $lang["common_or"] = "OR"; $lang["common_phone_number"] = "Phone Number"; $lang["common_phone_number_required"] = ""; diff --git a/application/migrations/20181014170000_upgrade_to_3_3_0.php b/application/migrations/20190111270000_upgrade_to_3_3_0.php similarity index 100% rename from application/migrations/20181014170000_upgrade_to_3_3_0.php rename to application/migrations/20190111270000_upgrade_to_3_3_0.php From 687229dbec2f0c66b068152103382725cf4065b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albert=20Garc=C3=ADa?= Date: Fri, 11 Jan 2019 13:47:41 +0000 Subject: [PATCH 485/568] Translated using Weblate (Spanish) Currently translated at 100.0% (66 of 66 strings) Translation: ospos/common Translate-URL: http://weblate.jpeelaer.net/projects/ospos/common/es/ --- application/language/es/common_lang.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/application/language/es/common_lang.php b/application/language/es/common_lang.php index 0af4826ce..0dab36127 100644 --- a/application/language/es/common_lang.php +++ b/application/language/es/common_lang.php @@ -1,5 +1,4 @@ - Date: Fri, 11 Jan 2019 13:52:50 +0000 Subject: [PATCH 486/568] Translated using Weblate (Spanish) Currently translated at 96.6% (260 of 269 strings) Translation: ospos/config Translate-URL: http://weblate.jpeelaer.net/projects/ospos/config/es/ --- application/language/es/config_lang.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/application/language/es/config_lang.php b/application/language/es/config_lang.php index a971b3c9b..95cb3dc34 100644 --- a/application/language/es/config_lang.php +++ b/application/language/es/config_lang.php @@ -1,5 +1,4 @@ - Date: Fri, 11 Jan 2019 13:49:39 +0000 Subject: [PATCH 487/568] Translated using Weblate (Spanish) Currently translated at 100.0% (12 of 12 strings) Translation: ospos/messages Translate-URL: http://weblate.jpeelaer.net/projects/ospos/messages/es/ --- application/language/es/messages_lang.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/application/language/es/messages_lang.php b/application/language/es/messages_lang.php index 9ae3a7b34..370f6c0da 100644 --- a/application/language/es/messages_lang.php +++ b/application/language/es/messages_lang.php @@ -1,5 +1,4 @@ - Date: Tue, 8 Jan 2019 09:33:37 +0000 Subject: [PATCH 488/568] Translated using Weblate (Arabic (Egypt)) Currently translated at 94.7% (164 of 173 strings) Translation: ospos/sales Translate-URL: http://weblate.jpeelaer.net/projects/ospos/sales/ar_EG/ --- application/language/ar-EG/sales_lang.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/application/language/ar-EG/sales_lang.php b/application/language/ar-EG/sales_lang.php index 5caaeb71a..ad52ed1a2 100644 --- a/application/language/ar-EG/sales_lang.php +++ b/application/language/ar-EG/sales_lang.php @@ -1,13 +1,12 @@ - Date: Tue, 8 Jan 2019 09:22:44 +0000 Subject: [PATCH 489/568] Translated using Weblate (Arabic (Egypt)) Currently translated at 43.2% (29 of 67 strings) Translation: ospos/taxes Translate-URL: http://weblate.jpeelaer.net/projects/ospos/taxes/ar_EG/ --- application/language/ar-EG/taxes_lang.php | 29 +++++++++++------------ 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/application/language/ar-EG/taxes_lang.php b/application/language/ar-EG/taxes_lang.php index 47f5ab8f9..27b7e7e74 100644 --- a/application/language/ar-EG/taxes_lang.php +++ b/application/language/ar-EG/taxes_lang.php @@ -1,30 +1,29 @@ - Date: Wed, 16 Jan 2019 21:15:37 -0500 Subject: [PATCH 490/568] Rename sales_tax_amount to sale_tax_amount --- application/libraries/Sale_lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/libraries/Sale_lib.php b/application/libraries/Sale_lib.php index a367e774d..5263c87de 100644 --- a/application/libraries/Sale_lib.php +++ b/application/libraries/Sale_lib.php @@ -1272,9 +1272,9 @@ class Sale_lib if(!$this->CI->config->item('tax_included')) { - foreach($this->CI->tax_lib->get_taxes($this->get_cart()) as $tax) + foreach($this->CI->tax_lib->get_taxes($this->get_cart())[0] as $tax) { - $total = bcadd($total, $tax['sales_tax_amount']); + $total = bcadd($total, $tax['sale_tax_amount']); } } From 322dc85e2cf2bea2d1c0b5ed6feb3f3226f66f66 Mon Sep 17 00:00:00 2001 From: Marek Borowik Date: Sun, 20 Jan 2019 00:05:44 +0000 Subject: [PATCH 491/568] Added translation using Weblate (Polish) --- application/language/pl/common_lang.php | 68 +++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 application/language/pl/common_lang.php diff --git a/application/language/pl/common_lang.php b/application/language/pl/common_lang.php new file mode 100644 index 000000000..d87433794 --- /dev/null +++ b/application/language/pl/common_lang.php @@ -0,0 +1,68 @@ + Date: Sat, 26 Jan 2019 14:47:36 -0600 Subject: [PATCH 492/568] fixed timezone (#2321) --- application/helpers/locale_helper.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/helpers/locale_helper.php b/application/helpers/locale_helper.php index 51b893848..692d9b1bb 100644 --- a/application/helpers/locale_helper.php +++ b/application/helpers/locale_helper.php @@ -112,7 +112,8 @@ function get_timezones() 'America/Chihuahua' => '(GMT-07:00) Chihuahua, La Paz, Mazatlan', 'America/Dawson_Creek' => '(GMT-07:00) Arizona', 'America/Belize' => '(GMT-06:00) Saskatchewan, Central America', - 'America/Cancun' => '(GMT-06:00) Guadalajara, Mexico City, Monterrey', + 'America/Cancun' => '(GMT-05:00) Cancun', + 'America/Mexico_City' => '(GMT-06:00) Guadalajara, Mexico City, Monterrey', 'Chile/EasterIsland' => '(GMT-06:00) Easter Island', 'America/Chicago' => '(GMT-06:00) Central Time (US & Canada)', 'America/New_York' => '(GMT-05:00) Eastern Time (US & Canada)', From e080873ec3faa59bab77588fd011b3eb49704462 Mon Sep 17 00:00:00 2001 From: objecttothis Date: Mon, 28 Jan 2019 18:16:17 +0400 Subject: [PATCH 493/568] Check to see if attribute_value already exists --- application/models/Attribute.php | 45 +++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/application/models/Attribute.php b/application/models/Attribute.php index 9dd597b76..f03e5b632 100644 --- a/application/models/Attribute.php +++ b/application/models/Attribute.php @@ -56,6 +56,17 @@ class Attribute extends CI_Model return ($this->db->get()->num_rows() > 0); } + /* + Determines if a given attribute_value exists in the attribute_values table + */ + public function value_exists($attribute_value) + { + $this->db->from('attribute_values'); + $this->db->where('attribute_value', $attribute_value); + + return ($this->db->get()->num_rows() > 0); + } + /* Gets information about a particular attribute definition */ @@ -111,6 +122,18 @@ class Attribute extends CI_Model return $this->db->get(); } + /* + Given the attribute_value returns the associated attribute_id + */ + private function get_id_by_value($attribute_value) + { + $this->db->distinct('attribute_id'); + $this->db->from('attribute_values'); + $this->db->where('attribute_value',$attribute_value); + + return $this->db->get()->row()->attribute_id; + } + public function get_attributes_by_item($item_id) { $this->db->from('attribute_definitions'); @@ -394,19 +417,27 @@ class Attribute extends CI_Model public function save_value($attribute_value, $definition_id, $item_id = FALSE, $attribute_id = FALSE, $definition_type = DROPDOWN) { $this->db->trans_start(); - + if(empty($attribute_id) || empty($item_id)) { if($definition_type != DATETIME) { - $this->db->insert('attribute_values', array('attribute_value' => $attribute_value)); + if($this->value_exists($attribute_value)) + { + $attribute_id = $this->get_id_by_value($attribute_value); + } + else + { + $this->db->insert('attribute_values', array('attribute_value' => $attribute_value)); + $attribute_id = $this->db->insert_id(); + } } else { $this->db->insert('attribute_values', array('attribute_datetime' => date('Y-m-d H:i:s', strtotime($attribute_value)))); + $attribute_id = $this->db->insert_id(); } - $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, @@ -417,12 +448,12 @@ class Attribute extends CI_Model $this->db->where('attribute_id', $attribute_id); $this->db->update('attribute_values', array('attribute_value' => $attribute_value)); } - + $this->db->trans_complete(); - + return $attribute_id; } - + 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 " . From 4d13cf2f67dd1c8d58f11e6048c054c3f54489be Mon Sep 17 00:00:00 2001 From: objecttothis Date: Tue, 29 Jan 2019 18:25:44 +0400 Subject: [PATCH 494/568] Converting mailchimp config to integrations config --- application/language/en-US/config_lang.php | 1 + application/views/configs/mailchimp_config.php | 3 ++- application/views/configs/manage.php | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/application/language/en-US/config_lang.php b/application/language/en-US/config_lang.php index d21c10978..16ae15941 100644 --- a/application/language/en-US/config_lang.php +++ b/application/language/en-US/config_lang.php @@ -137,6 +137,7 @@ $lang["config_giftcard_series"] = "Generate in Series"; $lang["config_include_hsn"] = "Include Support for HSN Codes"; $lang["config_info"] = "Information"; $lang["config_info_configuration"] = "Store Information"; +$lang["config_integrations"] = "Integrations"; $lang["config_invoice"] = "Invoice"; $lang["config_invoice_configuration"] = "Invoice Print Settings"; $lang["config_invoice_default_comments"] = "Default Invoice Comments"; diff --git a/application/views/configs/mailchimp_config.php b/application/views/configs/mailchimp_config.php index e7e1fdf08..e2850b42a 100644 --- a/application/views/configs/mailchimp_config.php +++ b/application/views/configs/mailchimp_config.php @@ -2,6 +2,7 @@
                      lang->line('common_fields_required_message'); ?>
                      +
                        @@ -78,4 +79,4 @@ $(document).ready(function() errorLabelContainer: '#mailchimp_error_message_box' })); }); - + \ No newline at end of file diff --git a/application/views/configs/manage.php b/application/views/configs/manage.php index 55200a6db..7eb772894 100644 --- a/application/views/configs/manage.php +++ b/application/views/configs/manage.php @@ -42,7 +42,7 @@ lang->line('config_message'); ?>
                      • - lang->line('config_mailchimp'); ?> + lang->line('config_integrations'); ?>
                      • lang->line('config_license'); ?> From f238bc7d40b0d0ef8262574562f6334aa4b3bfeb Mon Sep 17 00:00:00 2001 From: objecttothis <17935339+objecttothis@users.noreply.github.com> Date: Tue, 29 Jan 2019 18:27:41 +0400 Subject: [PATCH 495/568] Rename mailchimp_config.php to integrations_config.php Rename file to match generic integrations rather than specific mailchimp --- .../configs/{mailchimp_config.php => integrations_config.php} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename application/views/configs/{mailchimp_config.php => integrations_config.php} (99%) diff --git a/application/views/configs/mailchimp_config.php b/application/views/configs/integrations_config.php similarity index 99% rename from application/views/configs/mailchimp_config.php rename to application/views/configs/integrations_config.php index e2850b42a..31094ec84 100644 --- a/application/views/configs/mailchimp_config.php +++ b/application/views/configs/integrations_config.php @@ -79,4 +79,4 @@ $(document).ready(function() errorLabelContainer: '#mailchimp_error_message_box' })); }); - \ No newline at end of file + From 57fa8c1a4b6617208587b18dd4dadb2c5d67d2b9 Mon Sep 17 00:00:00 2001 From: Steve Ireland Date: Tue, 29 Jan 2019 21:30:52 -0500 Subject: [PATCH 496/568] India GST script is dependent on the 3.3.0 script. --- .../{20181203115700_indiagst.php => 20190129212600_indiagst.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename application/migrations/{20181203115700_indiagst.php => 20190129212600_indiagst.php} (100%) diff --git a/application/migrations/20181203115700_indiagst.php b/application/migrations/20190129212600_indiagst.php similarity index 100% rename from application/migrations/20181203115700_indiagst.php rename to application/migrations/20190129212600_indiagst.php From 6b12cd6cc7429f94d13074dddd3d46b2f30d9e0a Mon Sep 17 00:00:00 2001 From: objecttothis <17935339+objecttothis@users.noreply.github.com> Date: Wed, 30 Jan 2019 10:35:41 +0400 Subject: [PATCH 497/568] Correct missing change Not sure how this didn't get changed before. I had the change in my test database. I must have just missed it. --- application/views/configs/manage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/configs/manage.php b/application/views/configs/manage.php index 7eb772894..e8e7fafcf 100644 --- a/application/views/configs/manage.php +++ b/application/views/configs/manage.php @@ -87,7 +87,7 @@ load->view("configs/message_config"); ?>
                      • - load->view("configs/mailchimp_config"); ?> + load->view("configs/integrations_config"); ?>
                        load->view("configs/license_config"); ?> From 2c06edba0213d520ce7bb4ee9176e16e6f7db3d7 Mon Sep 17 00:00:00 2001 From: objecttothis Date: Wed, 30 Jan 2019 11:30:28 +0400 Subject: [PATCH 498/568] Remove function and combine call to reduce redundant code. --- application/models/Attribute.php | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/application/models/Attribute.php b/application/models/Attribute.php index f03e5b632..c2edfe9b7 100644 --- a/application/models/Attribute.php +++ b/application/models/Attribute.php @@ -57,14 +57,15 @@ class Attribute extends CI_Model } /* - Determines if a given attribute_value exists in the attribute_values table + Determines if a given attribute_value exists in the attribute_values table and returns the attribute_id if it does */ public function value_exists($attribute_value) { + $this->db->distinct('attribute_id'); $this->db->from('attribute_values'); $this->db->where('attribute_value', $attribute_value); - return ($this->db->get()->num_rows() > 0); + return $this->db->get()->row()->attribute_id; } /* @@ -122,18 +123,6 @@ class Attribute extends CI_Model return $this->db->get(); } - /* - Given the attribute_value returns the associated attribute_id - */ - private function get_id_by_value($attribute_value) - { - $this->db->distinct('attribute_id'); - $this->db->from('attribute_values'); - $this->db->where('attribute_value',$attribute_value); - - return $this->db->get()->row()->attribute_id; - } - public function get_attributes_by_item($item_id) { $this->db->from('attribute_definitions'); @@ -422,15 +411,16 @@ class Attribute extends CI_Model { if($definition_type != DATETIME) { - if($this->value_exists($attribute_value)) - { - $attribute_id = $this->get_id_by_value($attribute_value); - } - else + $attribute_id_check = $this->value_exists($attribute_value); + if(empty($attribute_id_check)) { $this->db->insert('attribute_values', array('attribute_value' => $attribute_value)); $attribute_id = $this->db->insert_id(); } + else + { + $attribute_id = $attribute_id_check; + } } else { From ab2a46ff220b0ac2d68c8e91113790d2605968bf Mon Sep 17 00:00:00 2001 From: objecttothis Date: Wed, 30 Jan 2019 13:08:12 +0400 Subject: [PATCH 499/568] Add IGNORE to insert and UNIQUE constraint to attribute_value --- .../migrations/sqlscripts/attributes.sql | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/application/migrations/sqlscripts/attributes.sql b/application/migrations/sqlscripts/attributes.sql index 74a61100b..66641d298 100644 --- a/application/migrations/sqlscripts/attributes.sql +++ b/application/migrations/sqlscripts/attributes.sql @@ -13,7 +13,7 @@ CREATE TABLE IF NOT EXISTS `ospos_attribute_definitions` ( CREATE TABLE IF NOT EXISTS `ospos_attribute_values` ( `attribute_id` INT NOT NULL AUTO_INCREMENT, - `attribute_value` VARCHAR(255) NULL, + `attribute_value` VARCHAR(255) UNIQUE NULL, `attribute_datetime` DATETIME NULL, PRIMARY KEY (`attribute_id`) ) ENGINE = InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; @@ -88,16 +88,16 @@ INSERT INTO ospos_attribute_links (definition_id, item_id) SELECT definition_id, 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 AND custom10 != ''; -INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom1 FROM ospos_items WHERE custom1 <> '' AND '' <> (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom1_name'); -INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom2 FROM ospos_items WHERE custom2 <> '' AND '' <> (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom2_name'); -INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom3 FROM ospos_items WHERE custom3 <> '' AND '' <> (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom3_name'); -INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom4 FROM ospos_items WHERE custom4 <> '' AND '' <> (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom4_name'); -INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom5 FROM ospos_items WHERE custom5 <> '' AND '' <> (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom5_name'); -INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom6 FROM ospos_items WHERE custom6 <> '' AND '' <> (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom6_name'); -INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom7 FROM ospos_items WHERE custom7 <> '' AND '' <> (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom7_name'); -INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom8 FROM ospos_items WHERE custom8 <> '' AND '' <> (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom8_name'); -INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom9 FROM ospos_items WHERE custom9 <> '' AND '' <> (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom9_name'); -INSERT INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom10 FROM ospos_items WHERE custom10 <> '' AND '' <> (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom10_name'); +INSERT IGNORE INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom1 FROM ospos_items WHERE custom1 <> '' AND '' <> (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom1_name'); +INSERT IGNORE INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom2 FROM ospos_items WHERE custom2 <> '' AND '' <> (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom2_name'); +INSERT IGNORE INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom3 FROM ospos_items WHERE custom3 <> '' AND '' <> (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom3_name'); +INSERT IGNORE INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom4 FROM ospos_items WHERE custom4 <> '' AND '' <> (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom4_name'); +INSERT IGNORE INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom5 FROM ospos_items WHERE custom5 <> '' AND '' <> (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom5_name'); +INSERT IGNORE INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom6 FROM ospos_items WHERE custom6 <> '' AND '' <> (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom6_name'); +INSERT IGNORE INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom7 FROM ospos_items WHERE custom7 <> '' AND '' <> (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom7_name'); +INSERT IGNORE INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom8 FROM ospos_items WHERE custom8 <> '' AND '' <> (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom8_name'); +INSERT IGNORE INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom9 FROM ospos_items WHERE custom9 <> '' AND '' <> (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom9_name'); +INSERT IGNORE INTO ospos_attribute_values (attribute_value) SELECT DISTINCT custom10 FROM ospos_items WHERE custom10 <> '' AND '' <> (SELECT `value` FROM ospos_app_config WHERE `key` = 'custom10_name'); UPDATE ospos_attribute_links INNER JOIN ospos_items ON ospos_attribute_links.item_id = ospos_items.item_id From 00a16ac50bcb7479d83460204ab4da68a30a84a0 Mon Sep 17 00:00:00 2001 From: objecttothis <17935339+objecttothis@users.noreply.github.com> Date: Thu, 31 Jan 2019 16:42:58 +0400 Subject: [PATCH 500/568] Update manage.php Fixed another forgotten change --- application/views/configs/manage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/configs/manage.php b/application/views/configs/manage.php index e8e7fafcf..f767c5dbe 100644 --- a/application/views/configs/manage.php +++ b/application/views/configs/manage.php @@ -86,7 +86,7 @@
                        load->view("configs/message_config"); ?>
                        -
                        +
                        load->view("configs/integrations_config"); ?>
                        From 80a1c73652ec0fbc782278a1788acfb5ad4e4c9c Mon Sep 17 00:00:00 2001 From: jekkos Date: Fri, 1 Feb 2019 21:14:08 +0100 Subject: [PATCH 501/568] Ignore apache rewrite rule for let's encrypt challenge renewal --- .htaccess | 1 + 1 file changed, 1 insertion(+) diff --git a/.htaccess b/.htaccess index 75ce364c4..55eeab755 100755 --- a/.htaccess +++ b/.htaccess @@ -2,6 +2,7 @@ RewriteEngine On RewriteCond %{REQUEST_URI} !^public$ + RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge [NC] RewriteRule "^(.*)$" "/public/" [R=301,L] From 71a1c2ac0895d4ce3e2e7b844a1ec6ba32b84389 Mon Sep 17 00:00:00 2001 From: haygcao Date: Mon, 28 Jan 2019 12:33:11 +0000 Subject: [PATCH 502/568] Translated using Weblate (Chinese (Simplified)) Currently translated at 69.2% (18 of 26 strings) Translation: ospos/attributes Translate-URL: http://weblate.jpeelaer.net/projects/ospos/attributes/zh_Hans/ --- .../language/zh-Hans/attributes_lang.php | 39 +++++++++---------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/application/language/zh-Hans/attributes_lang.php b/application/language/zh-Hans/attributes_lang.php index d6dd4c610..9fb28bb49 100644 --- a/application/language/zh-Hans/attributes_lang.php +++ b/application/language/zh-Hans/attributes_lang.php @@ -1,23 +1,22 @@ - Date: Thu, 31 Jan 2019 11:06:41 +0000 Subject: [PATCH 503/568] Translated using Weblate (Spanish) Currently translated at 100.0% (8 of 8 strings) Translation: ospos/login Translate-URL: http://weblate.jpeelaer.net/projects/ospos/login/es/ --- application/language/es/login_lang.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/application/language/es/login_lang.php b/application/language/es/login_lang.php index 9062929bd..ec966988b 100644 --- a/application/language/es/login_lang.php +++ b/application/language/es/login_lang.php @@ -1,9 +1,8 @@ - Date: Fri, 1 Feb 2019 21:01:27 +0000 Subject: [PATCH 504/568] Translated using Weblate (Flemish) Currently translated at 100.0% (173 of 173 strings) Translation: ospos/sales Translate-URL: http://weblate.jpeelaer.net/projects/ospos/sales/nl_BE/ --- application/language/nl-BE/sales_lang.php | 25 +++++++++++------------ 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/application/language/nl-BE/sales_lang.php b/application/language/nl-BE/sales_lang.php index 9fde643b5..036e57b9b 100755 --- a/application/language/nl-BE/sales_lang.php +++ b/application/language/nl-BE/sales_lang.php @@ -1,13 +1,12 @@ - Date: Thu, 31 Jan 2019 11:08:11 +0000 Subject: [PATCH 505/568] Translated using Weblate (Spanish) Currently translated at 67.5% (52 of 77 strings) Translation: ospos/taxes Translate-URL: http://weblate.jpeelaer.net/projects/ospos/taxes/es/ --- application/language/es/taxes_lang.php | 60 ++++++++++++++------------ 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/application/language/es/taxes_lang.php b/application/language/es/taxes_lang.php index 5dad8422c..e1af426cf 100644 --- a/application/language/es/taxes_lang.php +++ b/application/language/es/taxes_lang.php @@ -1,18 +1,17 @@ - Date: Sat, 2 Feb 2019 11:46:46 +0000 Subject: [PATCH 506/568] Translated using Weblate (Flemish) Currently translated at 100.0% (20 of 20 strings) Translation: ospos/datepicker Translate-URL: http://weblate.jpeelaer.net/projects/ospos/datepicker/nl_BE/ --- application/language/nl-BE/datepicker_lang.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/application/language/nl-BE/datepicker_lang.php b/application/language/nl-BE/datepicker_lang.php index 7a04562fd..86a857003 100644 --- a/application/language/nl-BE/datepicker_lang.php +++ b/application/language/nl-BE/datepicker_lang.php @@ -1,5 +1,4 @@ - Date: Sat, 2 Feb 2019 13:02:52 +0100 Subject: [PATCH 507/568] Disable .gitattributes ident (#2324) --- .gitattributes | 2 -- .travis.yml | 1 + application/config/config.php | 2 +- application/views/partial/footer.php | 2 +- application/views/partial/header.php | 2 +- 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.gitattributes b/.gitattributes index b89b92b39..32d68b41c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,3 @@ dist/ merge=ours application/language/**/*.php merge=ours text=auto -application/config/config.php ident -application/views/partial/footer.php ident diff --git a/.travis.yml b/.travis.yml index 8eb3f1d8b..e17de20ce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,6 +17,7 @@ script: - docker run --rm -v $(pwd):/app composer/composer install - docker run --rm -v $(pwd):/app -w /app lucor/php7-cli php bin/install.php translations develop + - HEAD=$(git rev-parse HEAD) sed -i "s/\(\$Id\)/$HEAD/g" application/config/config.php - docker run --rm -it -v $(pwd):/app -w /app digitallyseamless/nodejs-bower-grunt sh -c "npm install && bower install && grunt package" - docker-compose build diff --git a/application/config/config.php b/application/config/config.php index bd72045ef..31e6b1499 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -19,7 +19,7 @@ $config['application_version'] = '3.3.0'; | | */ -$config['commit_sha1'] = '$Id $'; +$config['commit_sha1'] = '$Id'; /* |-------------------------------------------------------------------------- diff --git a/application/views/partial/footer.php b/application/views/partial/footer.php index 4f5ad5761..caf661ec2 100644 --- a/application/views/partial/footer.php +++ b/application/views/partial/footer.php @@ -4,7 +4,7 @@