From 94287ddec4e8e68662b13ab289867247ab1477ee Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Wed, 21 Jan 2015 13:14:16 +0100 Subject: [PATCH 01/14] Make barcode text configurable --- application/controllers/config.php | 1 + application/controllers/items.php | 2 +- application/language/en/config_lang.php | 3 + application/language/es/config_lang.php | 3 + application/language/fr/config_lang.php | 3 + application/language/id/config_lang.php | 3 + application/language/nl-BE/config_lang.php | 3 + application/language/ru/config_lang.php | 3 + application/language/th/config_lang.php | 3 + application/language/tr/config_lang.php | 3 + application/language/zh/config_lang.php | 3 + application/views/barcode_sheet.php | 2 +- application/views/config.php | 18 +++++ database/2.3_to_2.3.1.sql | 3 +- database/database.sql | 3 +- translations/config_lang.csv | 85 +++++++++++----------- 16 files changed, 96 insertions(+), 45 deletions(-) diff --git a/application/controllers/config.php b/application/controllers/config.php index be3b8775d..913b1e1d4 100644 --- a/application/controllers/config.php +++ b/application/controllers/config.php @@ -41,6 +41,7 @@ class Config extends Secure_area 'tax_included'=>$this->input->post('tax_included'), 'recv_invoice_format'=>$this->input->post('recv_invoice_format'), 'sales_invoice_format'=>$this->input->post('sales_invoice_format'), + 'barcode_text'=>$this->input->post('barcode_text'), 'custom1_name'=>$this->input->post('custom1_name'),/**GARRISON ADDED 4/20/2013**/ 'custom2_name'=>$this->input->post('custom2_name'),/**GARRISON ADDED 4/20/2013**/ 'custom3_name'=>$this->input->post('custom3_name'),/**GARRISON ADDED 4/20/2013**/ diff --git a/application/controllers/items.php b/application/controllers/items.php index a24ce7626..c2bdc3ea4 100644 --- a/application/controllers/items.php +++ b/application/controllers/items.php @@ -271,7 +271,7 @@ class Items extends Secure_area implements iData_controller { $item_info = $this->Item->get_info($item_id); - $result[] = array('name' =>$item_info->name, 'id'=> $item_id); + $result[] = array('name' =>$item_info->name, 'id'=> $item_id, 'item_number'=> $item_info->item_number); } $data['items'] = $result; diff --git a/application/language/en/config_lang.php b/application/language/en/config_lang.php index 1c45f8881..711549904 100644 --- a/application/language/en/config_lang.php +++ b/application/language/en/config_lang.php @@ -40,3 +40,6 @@ $lang["config_stock_location_required"] = "Stock location number is a required f $lang["config_tax_included"] = "Tax Included"; $lang["config_timezone"] = "Timezone"; $lang["config_website"] = "Website"; +$lang["config_barcode_number"] = "UPC/EAN/ISBN"; +$lang["config_barcode_name"] = "Item Name"; +$lang["config_barcode_text"] = "Barcode Content"; diff --git a/application/language/es/config_lang.php b/application/language/es/config_lang.php index 19724dbb8..3cf990da6 100644 --- a/application/language/es/config_lang.php +++ b/application/language/es/config_lang.php @@ -40,3 +40,6 @@ $lang["config_stock_location_required"] = ""; $lang["config_tax_included"] = "Impuestos incluidos"; $lang["config_timezone"] = "Zona Horaria"; $lang["config_website"] = "Sitio Web"; +$lang["config_barcode_number"] = "UPC/EAN/ISBN"; +$lang["config_barcode_name"] = ""; +$lang["config_barcode_text"] = ""; diff --git a/application/language/fr/config_lang.php b/application/language/fr/config_lang.php index 27f7beb23..96d44aef3 100644 --- a/application/language/fr/config_lang.php +++ b/application/language/fr/config_lang.php @@ -40,3 +40,6 @@ $lang["config_stock_location_required"] = ""; $lang["config_tax_included"] = ""; $lang["config_timezone"] = "Fuseau Horaire"; $lang["config_website"] = "Site-web"; +$lang["config_barcode_number"] = "UPC/EAN/ISBN"; +$lang["config_barcode_name"] = ""; +$lang["config_barcode_text"] = ""; diff --git a/application/language/id/config_lang.php b/application/language/id/config_lang.php index 26169fb7d..3a4966164 100644 --- a/application/language/id/config_lang.php +++ b/application/language/id/config_lang.php @@ -40,3 +40,6 @@ $lang["config_stock_location_required"] = ""; $lang["config_tax_included"] = "Dikenakan Pajak"; $lang["config_timezone"] = "Zona Waktu"; $lang["config_website"] = "Situs Perusahaan"; +$lang["config_barcode_number"] = "UPC/EAN/ISBN"; +$lang["config_barcode_name"] = ""; +$lang["config_barcode_text"] = ""; diff --git a/application/language/nl-BE/config_lang.php b/application/language/nl-BE/config_lang.php index 2f32de352..f980888d3 100755 --- a/application/language/nl-BE/config_lang.php +++ b/application/language/nl-BE/config_lang.php @@ -40,3 +40,6 @@ $lang["config_stock_location_required"] = ""; $lang["config_tax_included"] = "VAT Ingebgrepen"; $lang["config_timezone"] = "Tijdzone"; $lang["config_website"] = "Website"; +$lang["config_barcode_number"] = "UPC/EAN/ISBN"; +$lang["config_barcode_name"] = "Productnaam"; +$lang["config_barcode_text"] = "Inhoud Barcode"; diff --git a/application/language/ru/config_lang.php b/application/language/ru/config_lang.php index ff9ecf171..d0e1919d6 100644 --- a/application/language/ru/config_lang.php +++ b/application/language/ru/config_lang.php @@ -40,3 +40,6 @@ $lang["config_stock_location_required"] = ""; $lang["config_tax_included"] = "Tax Included"; $lang["config_timezone"] = "Часовой пояс"; $lang["config_website"] = "Веб-сайт"; +$lang["config_barcode_number"] = "UPC/EAN/ISBN"; +$lang["config_barcode_name"] = ""; +$lang["config_barcode_text"] = ""; diff --git a/application/language/th/config_lang.php b/application/language/th/config_lang.php index fcfeb212a..37f2c9c91 100644 --- a/application/language/th/config_lang.php +++ b/application/language/th/config_lang.php @@ -40,3 +40,6 @@ $lang["config_stock_location_required"] = "จำเป็นต้องระ $lang["config_tax_included"] = "รวมภาษีแล้ว"; $lang["config_timezone"] = "โซนเวลา"; $lang["config_website"] = "เว็บไซต์"; +$lang["config_barcode_number"] = "UPC/EAN/ISBN"; +$lang["config_barcode_name"] = ""; +$lang["config_barcode_text"] = ""; diff --git a/application/language/tr/config_lang.php b/application/language/tr/config_lang.php index 3ce699c19..9f60d3477 100644 --- a/application/language/tr/config_lang.php +++ b/application/language/tr/config_lang.php @@ -40,3 +40,6 @@ $lang["config_stock_location_required"] = "Mağaza Yeri numarası zorunlu aland $lang["config_tax_included"] = ""; $lang["config_timezone"] = "Saat Dilimi"; $lang["config_website"] = "Website"; +$lang["config_barcode_number"] = "UPC/EAN/ISBN"; +$lang["config_barcode_name"] = ""; +$lang["config_barcode_text"] = ""; diff --git a/application/language/zh/config_lang.php b/application/language/zh/config_lang.php index 7640b2950..c033452ad 100755 --- a/application/language/zh/config_lang.php +++ b/application/language/zh/config_lang.php @@ -40,3 +40,6 @@ $lang["config_stock_location_required"] = ""; $lang["config_tax_included"] = "Tax Included"; $lang["config_timezone"] = "時區"; $lang["config_website"] = "網站"; +$lang["config_barcode_number"] = "UPC/EAN/ISBN"; +$lang["config_barcode_name"] = ""; +$lang["config_barcode_text"] = ""; diff --git a/application/views/barcode_sheet.php b/application/views/barcode_sheet.php index eb196ebf4..1b79c632d 100644 --- a/application/views/barcode_sheet.php +++ b/application/views/barcode_sheet.php @@ -12,7 +12,7 @@ $count = 0; foreach($items as $item) { $barcode = $item['id']; - $text = $item['name']; + $text = $this->config->item('barcode_text') === "name" ? $item['name'] : $item['item_number']; if ($count % 2 ==0 and $count!=0) { diff --git a/application/views/config.php b/application/views/config.php index fd722e88c..05b2de742 100644 --- a/application/views/config.php +++ b/application/views/config.php @@ -289,6 +289,24 @@ echo form_open('config/save/',array('id'=>'config_form')); +
+lang->line('config_barcode_text').':', 'barcode_text',array('class'=>'wide')); ?> +
+ 'barcode_text', + 'type'=>'radio', + 'value'=>'name', + 'checked'=>$this->config->item('barcode_text') === "name")); ?> + lang->line('config_barcode_name'); ?> + 'barcode_text', + 'type'=>'radio', + 'value'=>'number', + 'checked'=>$this->config->item('barcode_text') === "number")); ?> + lang->line('config_barcode_number'); ?> +
+
+
lang->line('config_print_after_sale').':', 'print_after_sale',array('class'=>'wide')); ?>
diff --git a/database/2.3_to_2.3.1.sql b/database/2.3_to_2.3.1.sql index d3a3a6e49..57c58d5a1 100644 --- a/database/2.3_to_2.3.1.sql +++ b/database/2.3_to_2.3.1.sql @@ -78,7 +78,8 @@ INSERT INTO `ospos_grants` (`permission_id`, `person_id`) VALUES INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('tax_included', '0'), ('recv_invoice_format', '$CO'), -('sales_invoice_format', '$CO'); +('sales_invoice_format', '$CO'), +('barcode_content', 'name'); -- add invoice_number column to receivings table ALTER TABLE `ospos_receivings` diff --git a/database/database.sql b/database/database.sql index 0a01f0b0a..d5b40ef47 100644 --- a/database/database.sql +++ b/database/database.sql @@ -39,7 +39,8 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('website', ''), ('recv_invoice_format', '$CO'), ('sales_invoice_format', '$CO'), -('tax_included', '0'); +('tax_included', '0'), +('barcode_content', 'name'); -- -------------------------------------------------------- diff --git a/translations/config_lang.csv b/translations/config_lang.csv index a9c5a32ce..13db26b77 100644 --- a/translations/config_lang.csv +++ b/translations/config_lang.csv @@ -1,41 +1,44 @@ -"label","nl-BE","es","en","fr","zh","ru","th","tr","id" -"config_address","Adres","Dirección del Comercio","Company Address","Addresse","公司地址","Адрес Компании","ที่อยู่","Şirket Adresi","Alamat Perusahaan" -"config_address_required","Het adres van het bedrijf moet ingevuld worden","Dirección del Comercio es requerida","Company address is a required field","L\'adresse est requise","公司地址為必填","Адрес Компании обязательный пробел","ที่อยู่ต้องกรอก","Şirket Adresi zorunlu alandır","Alamat Perusahaan wajib diisi" -"config_company","Bedrijfsnaam","Nombre del Comercio","Company Name","Nome de l\'Entreprise","公司名稱","Название Компании","ชื่อร้านค้า","Şirket Adı","Nama Perusahaan" -"config_company_required","De bedrijfsnaam moet ingevuld worden","Nombre del Comercio es requerido","Company name is a required field","Le nom d\'entreprise est requis","公司名稱為必填","Имя Компании обязательный пробел","ชื่อร้านค้าต้องกรอก","Şirket Adı zorunlu alandır","Nama Perusahaan wajib diisi" -"config_company_website_url","De website van het bedrijf is geen geldige URL (http://...)","Sitio Web no es una URL estándard (http://...)","Company website is not a valid URL (http://...)","Le site web de l\'entreprise n\'est pas une URL valide (http://...)","公司網址格式錯誤 (http://...)","Веб-сайт Компании не является допустимым URL (http://...)","เว็บไซต์ร้านค้าไม่ถูกต้อง","website adresi yanlış (http://...)","Situs Perusahaan bukan URL yang benar(http://...)" -"config_currency_side","Rechterkant","Lado derecho","Right side","Symbole à droite","Right side","Правая сторона","ด้านขวา","Sağda","Sisi Kanan" -"config_currency_symbol","Valuta","Símbolo de divisa","Currency Symbol","Symbole Monétaire","貨幣符號","Символ валюты","ลัญลักษณ์สกุลเงิน","Para Birimi","Simbol Mata Uang" -"config_custom1","Custom Veld 1","Campo Libre 1","Custom Field 1","Champ Personnalisé 1","Custom Field 1","Изготовленный пробел 1","พื้นที่เพิ่มเติม 1","Özel Alan 1","Custom Field 1" -"config_custom10","Custom Veld 10","Campo Libre 10","Custom Field 10","Champ Personnalisé 10","Custom Field 10","Изготовленный пробел 10","พื้นที่เพิ่มเติม 10","Özel Alan 10","Custom Field 10" -"config_custom2","Custom Veld 2","Campo Libre 2","Custom Field 2","Champ Personnalisé 2","Custom Field 2","Изготовленный пробел 2","พื้นที่เพิ่มเติม 2","Özel Alan 2","Custom Field 2" -"config_custom3","Custom Veld 3","Campo Libre 3","Custom Field 3","Champ Personnalisé 3","Custom Field 3","Изготовленный пробел 3","พื้นที่เพิ่มเติม 3","Özel Alan 3","Custom Field 3" -"config_custom4","Custom Veld 4","Campo Libre 4","Custom Field 4","Champ Personnalisé 4","Custom Field 4","Изготовленный пробел 4","พื้นที่เพิ่มเติม 4","Özel Alan 4","Custom Field 4" -"config_custom5","Custom Veld 5","Campo Libre 5","Custom Field 5","Champ Personnalisé 5","Custom Field 5","Изготовленный пробел 5","พื้นที่เพิ่มเติม 5","Özel Alan 5","Custom Field 5" -"config_custom6","Custom Veld 6","Campo Libre 6","Custom Field 6","Champ Personnalisé 6","Custom Field 6","Изготовленный пробел 6","พื้นที่เพิ่มเติม 6","Özel Alan 6","Custom Field 6" -"config_custom7","Custom Veld 7","Campo Libre 7","Custom Field 7","Champ Personnalisé 7","Custom Field 7","Изготовленный пробел 7","พื้นที่เพิ่มเติม 7","Özel Alan 7","Custom Field 7" -"config_custom8","Custom Veld 8","Campo Libre 8","Custom Field 8","Champ Personnalisé 8","Custom Field 8","Изготовленный пробел 8","พื้นที่เพิ่มเติม 8","Özel Alan 8","Custom Field 8" -"config_custom9","Custom Veld 9","Campo Libre 9","Custom Field 9","Champ Personnalisé 9","Custom Field 9","Изготовленный пробел 9","พื้นที่เพิ่มเติม 9","Özel Alan 9","Custom Field 9" -"config_default_tax_rate","Standaard VAT %","% de Impuestos Predeterminada","Default Tax Rate %","Taux d\'Imposition par Défaut","預設稅率 %","Обычный ставка налога %","อัตราภาษีโดยปริยาย %","Varsayılan Vergi Oranı %","Tarif Pajak Biasa%" -"config_default_tax_rate_1","VAT 1 %","Impuesto 1","Tax 1 Rate","Taux d\'Imposition 1","稅率 1","ставка налога 1","อัตราภาษี 1","Vergi Oranı 1","Tarif Pajak 1" -"config_default_tax_rate_2","VAT 2 %","Impuesto 2","Tax 2 Rate","Taux d\'Imposition 2","稅率 2","ставка налога 2","อัตราภาษี 2","Vergi Oranı 2","Tarif Pajak 2" -"config_default_tax_rate_number","Het percentage VAT moet een nummer zijn","El Impuesto Predeterminado debe ser un número","The default tax rate must be a number","Le taux d\'imposition doit etre un nombre","預設稅率必需為數字","Обычный ставка налога должен быть цифра","อัตราภาษีเริ่มต้นต้องเป็นตัวเลข","Varsayılan Vergi Oranı sayı olmalıdır","Tarif Pajak Biasa harus angka" -"config_default_tax_rate_required","Het percentage VAT moet ingevuld worden","El Impuesto Predeterminado es requerido","The default tax rate is a required field","Le taux d\'imposition par défaut est requis","預設稅率為必填","Обычный ставка налога обязательный пробел","อัตราภาษีเริ่มต้นต้องกรอก","Varsayılan Vergi Oranı zorunlu alandır","Tarif Pajak Biasa wajib diisi" -"config_fax","Fax","Fax","Fax","Fax","傳真","Факс","แฟ็กซ์","Faks","Fax" -"config_info","Configuratie Informatie","Información del Comercio","Store Configuration Information","Çonfiguration de l\'Entreprise","儲存組態","информация о магазин конфигурация","ข้อมูลร้านค้า","Mağaza yapılandırma bilgisi","Informasi Konfigurasi Toko" -"config_language","Taal","Idioma","Language","Langue","語言","Язик","ภาษา","Dil","Bahasa" -"config_phone","Telefoon","Teléfono del Comercio","Company Phone","Téléphone","電話","Телефон Компании","เบอร์โทรศัพท์","Şirket Telefonu","Telepon Perusahaan" -"config_phone_required","De telefoonnummer van het bedrijf moet ingevuld worden","Teléfono del Comercio es requerido","Company phone is a required field","Le numéro de téléphone est requis","公司電話為必填","Телефон Компании обязательный пробел","เบอร์โทรต้องกรอก","Şirket Telefonu zorunlu alandır","Telepon Perusahaan wajib diisi" -"config_print_after_sale","Druk ticket na verkoop","Imprimir recibo después de una venta","Print receipt after sale","Imprimer un recu après vente","出貨時打印收據","Распечатать квитанцию ​​после продажи","พิมพ์บิลหลังการขาย","Satıştan sonra yazdır","Cetak Faktur setelah penjualan" -"config_recv_invoice_enable","","","Enable Orders Invoice#","","","","หมายเลขใบแจ้งหนี้","","" -"config_recv_invoice_format","","","Receivings Invoice Format","","","","รหัสใบแจ้งหนี้","","" -"config_return_policy_required","De retourvoorwaarden moeten ingevuld worden","Política de Devolución es requerida","Return policy is a required field","Le Message est un champ requis","退換貨政策為必填","Возвратний полис обязательный пробел","กฎการคืนของต้องกรอก","İade Politikası zorunlu alandır","Kebijakan retur wajib diisi" -"config_sales_invoice_enable","","","Enable Sales Invoice#","","","","หมายเลขใบแจ้งหนี้","","" -"config_sales_invoice_format","","","Sales Invoice Format","","","","รหัสใบเสร็จ","","" -"config_saved_successfully","Configuratie werd bewaard","Configuración guardada satisfactoriamente","Configuration saved successfully","Configuration sauvegardée","組態設置儲存成功","Конфигурация успешно сохранена","องค์ประกอบร้านค้าบันทึกเรียบร้อย","Yapılandırma kaydedildi","Konfigurasi berhasil disimpan" -"config_saved_unsuccessfully","Configuratie kon niet worden bewaard","Configuración no guardada","Configuration saved unsuccessfully","Échec de sauvegarde de configuration","組態設置儲存失敗","Конфигурация сохраненная безуспешно","องค์ประกอบร้านค้าบันทึกล้มเหลว","Yapılandırma kaydedilemedi","Konfigurasi tidak berhasil disimpan" -"config_stock_location","","","Stock location","","","","สถานที่เก็บ","Mağaza Yeri","" -"config_stock_location_required","","","Stock location number is a required field","","","","จำเป็นต้องระบุสถานที่เก็บ","Mağaza Yeri numarası zorunlu alandır","" -"config_tax_included","VAT Ingebgrepen","Impuestos incluidos","Tax Included","","Tax Included","Tax Included","รวมภาษีแล้ว","","Dikenakan Pajak" -"config_timezone","Tijdzone","Zona Horaria","Timezone","Fuseau Horaire","時區","Часовой пояс","โซนเวลา","Saat Dilimi","Zona Waktu" -"config_website","Website","Sitio Web","Website","Site-web","網站","Веб-сайт","เว็บไซต์","Website","Situs Perusahaan" +label,nl-BE,es,en,fr,zh,ru,th,tr,id +config_address,Adres,Dirección del Comercio,Company Address,Addresse,公司地址,Адрес Компании,ที่อยู่,Şirket Adresi,Alamat Perusahaan +config_address_required,Het adres van het bedrijf moet ingevuld worden,Dirección del Comercio es requerida,Company address is a required field,L\'adresse est requise,公司地址為必填,Адрес Компании обязательный пробел,ที่อยู่ต้องกรอก,Şirket Adresi zorunlu alandır,Alamat Perusahaan wajib diisi +config_company,Bedrijfsnaam,Nombre del Comercio,Company Name,Nome de l\'Entreprise,公司名稱,Название Компании,ชื่อร้านค้า,Şirket Adı,Nama Perusahaan +config_company_required,De bedrijfsnaam moet ingevuld worden,Nombre del Comercio es requerido,Company name is a required field,Le nom d\'entreprise est requis,公司名稱為必填,Имя Компании обязательный пробел,ชื่อร้านค้าต้องกรอก,Şirket Adı zorunlu alandır,Nama Perusahaan wajib diisi +config_company_website_url,De website van het bedrijf is geen geldige URL (http://...),Sitio Web no es una URL estándard (http://...),Company website is not a valid URL (http://...),Le site web de l\'entreprise n\'est pas une URL valide (http://...),公司網址格式錯誤 (http://...),Веб-сайт Компании не является допустимым URL (http://...),เว็บไซต์ร้านค้าไม่ถูกต้อง,website adresi yanlış (http://...),Situs Perusahaan bukan URL yang benar(http://...) +config_currency_side,Rechterkant,Lado derecho,Right side,Symbole à droite,Right side,Правая сторона,ด้านขวา,Sağda,Sisi Kanan +config_currency_symbol,Valuta,Símbolo de divisa,Currency Symbol,Symbole Monétaire,貨幣符號,Символ валюты,ลัญลักษณ์สกุลเงิน,Para Birimi,Simbol Mata Uang +config_custom1,Custom Veld 1,Campo Libre 1,Custom Field 1,Champ Personnalisé 1,Custom Field 1,Изготовленный пробел 1,พื้นที่เพิ่มเติม 1,Özel Alan 1,Custom Field 1 +config_custom10,Custom Veld 10,Campo Libre 10,Custom Field 10,Champ Personnalisé 10,Custom Field 10,Изготовленный пробел 10,พื้นที่เพิ่มเติม 10,Özel Alan 10,Custom Field 10 +config_custom2,Custom Veld 2,Campo Libre 2,Custom Field 2,Champ Personnalisé 2,Custom Field 2,Изготовленный пробел 2,พื้นที่เพิ่มเติม 2,Özel Alan 2,Custom Field 2 +config_custom3,Custom Veld 3,Campo Libre 3,Custom Field 3,Champ Personnalisé 3,Custom Field 3,Изготовленный пробел 3,พื้นที่เพิ่มเติม 3,Özel Alan 3,Custom Field 3 +config_custom4,Custom Veld 4,Campo Libre 4,Custom Field 4,Champ Personnalisé 4,Custom Field 4,Изготовленный пробел 4,พื้นที่เพิ่มเติม 4,Özel Alan 4,Custom Field 4 +config_custom5,Custom Veld 5,Campo Libre 5,Custom Field 5,Champ Personnalisé 5,Custom Field 5,Изготовленный пробел 5,พื้นที่เพิ่มเติม 5,Özel Alan 5,Custom Field 5 +config_custom6,Custom Veld 6,Campo Libre 6,Custom Field 6,Champ Personnalisé 6,Custom Field 6,Изготовленный пробел 6,พื้นที่เพิ่มเติม 6,Özel Alan 6,Custom Field 6 +config_custom7,Custom Veld 7,Campo Libre 7,Custom Field 7,Champ Personnalisé 7,Custom Field 7,Изготовленный пробел 7,พื้นที่เพิ่มเติม 7,Özel Alan 7,Custom Field 7 +config_custom8,Custom Veld 8,Campo Libre 8,Custom Field 8,Champ Personnalisé 8,Custom Field 8,Изготовленный пробел 8,พื้นที่เพิ่มเติม 8,Özel Alan 8,Custom Field 8 +config_custom9,Custom Veld 9,Campo Libre 9,Custom Field 9,Champ Personnalisé 9,Custom Field 9,Изготовленный пробел 9,พื้นที่เพิ่มเติม 9,Özel Alan 9,Custom Field 9 +config_default_tax_rate,Standaard VAT %,% de Impuestos Predeterminada,Default Tax Rate %,Taux d\'Imposition par Défaut,預設稅率 %,Обычный ставка налога %,อัตราภาษีโดยปริยาย %,Varsayılan Vergi Oranı %,Tarif Pajak Biasa% +config_default_tax_rate_1,VAT 1 %,Impuesto 1,Tax 1 Rate,Taux d\'Imposition 1,稅率 1,ставка налога 1,อัตราภาษี 1,Vergi Oranı 1,Tarif Pajak 1 +config_default_tax_rate_2,VAT 2 %,Impuesto 2,Tax 2 Rate,Taux d\'Imposition 2,稅率 2,ставка налога 2,อัตราภาษี 2,Vergi Oranı 2,Tarif Pajak 2 +config_default_tax_rate_number,Het percentage VAT moet een nummer zijn,El Impuesto Predeterminado debe ser un número,The default tax rate must be a number,Le taux d\'imposition doit etre un nombre,預設稅率必需為數字,Обычный ставка налога должен быть цифра,อัตราภาษีเริ่มต้นต้องเป็นตัวเลข,Varsayılan Vergi Oranı sayı olmalıdır,Tarif Pajak Biasa harus angka +config_default_tax_rate_required,Het percentage VAT moet ingevuld worden,El Impuesto Predeterminado es requerido,The default tax rate is a required field,Le taux d\'imposition par défaut est requis,預設稅率為必填,Обычный ставка налога обязательный пробел,อัตราภาษีเริ่มต้นต้องกรอก,Varsayılan Vergi Oranı zorunlu alandır,Tarif Pajak Biasa wajib diisi +config_fax,Fax,Fax,Fax,Fax,傳真,Факс,แฟ็กซ์,Faks,Fax +config_info,Configuratie Informatie,Información del Comercio,Store Configuration Information,Çonfiguration de l\'Entreprise,儲存組態,информация о магазин конфигурация,ข้อมูลร้านค้า,Mağaza yapılandırma bilgisi,Informasi Konfigurasi Toko +config_language,Taal,Idioma,Language,Langue,語言,Язик,ภาษา,Dil,Bahasa +config_phone,Telefoon,Teléfono del Comercio,Company Phone,Téléphone,電話,Телефон Компании,เบอร์โทรศัพท์,Şirket Telefonu,Telepon Perusahaan +config_phone_required,De telefoonnummer van het bedrijf moet ingevuld worden,Teléfono del Comercio es requerido,Company phone is a required field,Le numéro de téléphone est requis,公司電話為必填,Телефон Компании обязательный пробел,เบอร์โทรต้องกรอก,Şirket Telefonu zorunlu alandır,Telepon Perusahaan wajib diisi +config_print_after_sale,Druk ticket na verkoop,Imprimir recibo después de una venta,Print receipt after sale,Imprimer un recu après vente,出貨時打印收據,Распечатать квитанцию ​​после продажи,พิมพ์บิลหลังการขาย,Satıştan sonra yazdır,Cetak Faktur setelah penjualan +config_recv_invoice_enable,,,Enable Orders Invoice#,,,,หมายเลขใบแจ้งหนี้,, +config_recv_invoice_format,,,Receivings Invoice Format,,,,รหัสใบแจ้งหนี้,, +config_return_policy_required,De retourvoorwaarden moeten ingevuld worden,Política de Devolución es requerida,Return policy is a required field,Le Message est un champ requis,退換貨政策為必填,Возвратний полис обязательный пробел,กฎการคืนของต้องกรอก,İade Politikası zorunlu alandır,Kebijakan retur wajib diisi +config_sales_invoice_enable,,,Enable Sales Invoice#,,,,หมายเลขใบแจ้งหนี้,, +config_sales_invoice_format,,,Sales Invoice Format,,,,รหัสใบเสร็จ,, +config_saved_successfully,Configuratie werd bewaard,Configuración guardada satisfactoriamente,Configuration saved successfully,Configuration sauvegardée,組態設置儲存成功,Конфигурация успешно сохранена,องค์ประกอบร้านค้าบันทึกเรียบร้อย,Yapılandırma kaydedildi,Konfigurasi berhasil disimpan +config_saved_unsuccessfully,Configuratie kon niet worden bewaard,Configuración no guardada,Configuration saved unsuccessfully,Échec de sauvegarde de configuration,組態設置儲存失敗,Конфигурация сохраненная безуспешно,องค์ประกอบร้านค้าบันทึกล้มเหลว,Yapılandırma kaydedilemedi,Konfigurasi tidak berhasil disimpan +config_stock_location,,,Stock location,,,,สถานที่เก็บ,Mağaza Yeri, +config_stock_location_required,,,Stock location number is a required field,,,,จำเป็นต้องระบุสถานที่เก็บ,Mağaza Yeri numarası zorunlu alandır, +config_tax_included,VAT Ingebgrepen,Impuestos incluidos,Tax Included,,Tax Included,Tax Included,รวมภาษีแล้ว,,Dikenakan Pajak +config_timezone,Tijdzone,Zona Horaria,Timezone,Fuseau Horaire,時區,Часовой пояс,โซนเวลา,Saat Dilimi,Zona Waktu +config_website,Website,Sitio Web,Website,Site-web,網站,Веб-сайт,เว็บไซต์,Website,Situs Perusahaan +config_barcode_number,UPC/EAN/ISBN,UPC/EAN/ISBN,UPC/EAN/ISBN,UPC/EAN/ISBN,UPC/EAN/ISBN,UPC/EAN/ISBN,UPC/EAN/ISBN,UPC/EAN/ISBN,UPC/EAN/ISBN +config_barcode_name,Productnaam,,Item Name,,,,,, +config_barcode_text,Inhoud Barcode,,Barcode Content,,,,,, From ad51278ba5c1cf00590d55099fbd37b2ad7a1558 Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Thu, 22 Jan 2015 23:36:56 +0100 Subject: [PATCH 02/14] UPC config option now adds UPC content to barcodes as well --- application/controllers/config.php | 2 +- application/language/en/config_lang.php | 4 ++-- application/language/es/config_lang.php | 4 ++-- application/language/fr/config_lang.php | 4 ++-- application/language/id/config_lang.php | 4 ++-- application/language/nl-BE/config_lang.php | 4 ++-- application/language/ru/config_lang.php | 4 ++-- application/language/th/config_lang.php | 4 ++-- application/language/tr/config_lang.php | 4 ++-- application/language/zh/config_lang.php | 4 ++-- application/views/barcode_sheet.php | 4 ++-- application/views/config.php | 14 +++++++------- database/2.3_to_2.3.1.sql | 2 +- database/database.sql | 2 +- translations/.~lock.config_lang.csv# | 1 + translations/config_lang.csv | 4 ++-- 16 files changed, 33 insertions(+), 32 deletions(-) create mode 100644 translations/.~lock.config_lang.csv# diff --git a/application/controllers/config.php b/application/controllers/config.php index 913b1e1d4..65c539c08 100644 --- a/application/controllers/config.php +++ b/application/controllers/config.php @@ -41,7 +41,7 @@ class Config extends Secure_area 'tax_included'=>$this->input->post('tax_included'), 'recv_invoice_format'=>$this->input->post('recv_invoice_format'), 'sales_invoice_format'=>$this->input->post('sales_invoice_format'), - 'barcode_text'=>$this->input->post('barcode_text'), + 'barcode_content'=>$this->input->post('barcode_content'), 'custom1_name'=>$this->input->post('custom1_name'),/**GARRISON ADDED 4/20/2013**/ 'custom2_name'=>$this->input->post('custom2_name'),/**GARRISON ADDED 4/20/2013**/ 'custom3_name'=>$this->input->post('custom3_name'),/**GARRISON ADDED 4/20/2013**/ diff --git a/application/language/en/config_lang.php b/application/language/en/config_lang.php index 711549904..028beed5a 100644 --- a/application/language/en/config_lang.php +++ b/application/language/en/config_lang.php @@ -41,5 +41,5 @@ $lang["config_tax_included"] = "Tax Included"; $lang["config_timezone"] = "Timezone"; $lang["config_website"] = "Website"; $lang["config_barcode_number"] = "UPC/EAN/ISBN"; -$lang["config_barcode_name"] = "Item Name"; -$lang["config_barcode_text"] = "Barcode Content"; +$lang["config_barcode_id"] = "Item Id/Name"; +$lang["config_barcode_content"] = "Barcode Content"; diff --git a/application/language/es/config_lang.php b/application/language/es/config_lang.php index 3cf990da6..40a378629 100644 --- a/application/language/es/config_lang.php +++ b/application/language/es/config_lang.php @@ -41,5 +41,5 @@ $lang["config_tax_included"] = "Impuestos incluidos"; $lang["config_timezone"] = "Zona Horaria"; $lang["config_website"] = "Sitio Web"; $lang["config_barcode_number"] = "UPC/EAN/ISBN"; -$lang["config_barcode_name"] = ""; -$lang["config_barcode_text"] = ""; +$lang["config_barcode_id"] = "Item Id/Name"; +$lang["config_barcode_content"] = "Barcode Content"; diff --git a/application/language/fr/config_lang.php b/application/language/fr/config_lang.php index 96d44aef3..5c810af19 100644 --- a/application/language/fr/config_lang.php +++ b/application/language/fr/config_lang.php @@ -41,5 +41,5 @@ $lang["config_tax_included"] = ""; $lang["config_timezone"] = "Fuseau Horaire"; $lang["config_website"] = "Site-web"; $lang["config_barcode_number"] = "UPC/EAN/ISBN"; -$lang["config_barcode_name"] = ""; -$lang["config_barcode_text"] = ""; +$lang["config_barcode_id"] = "Item Id/Name"; +$lang["config_barcode_content"] = "Barcode Content"; diff --git a/application/language/id/config_lang.php b/application/language/id/config_lang.php index 3a4966164..9a5bb1ab0 100644 --- a/application/language/id/config_lang.php +++ b/application/language/id/config_lang.php @@ -41,5 +41,5 @@ $lang["config_tax_included"] = "Dikenakan Pajak"; $lang["config_timezone"] = "Zona Waktu"; $lang["config_website"] = "Situs Perusahaan"; $lang["config_barcode_number"] = "UPC/EAN/ISBN"; -$lang["config_barcode_name"] = ""; -$lang["config_barcode_text"] = ""; +$lang["config_barcode_id"] = "Item Id/Name"; +$lang["config_barcode_content"] = "Barcode Content"; diff --git a/application/language/nl-BE/config_lang.php b/application/language/nl-BE/config_lang.php index f980888d3..eb6127329 100755 --- a/application/language/nl-BE/config_lang.php +++ b/application/language/nl-BE/config_lang.php @@ -41,5 +41,5 @@ $lang["config_tax_included"] = "VAT Ingebgrepen"; $lang["config_timezone"] = "Tijdzone"; $lang["config_website"] = "Website"; $lang["config_barcode_number"] = "UPC/EAN/ISBN"; -$lang["config_barcode_name"] = "Productnaam"; -$lang["config_barcode_text"] = "Inhoud Barcode"; +$lang["config_barcode_id"] = "Product id/naam"; +$lang["config_barcode_content"] = "Inhoud Barcode"; diff --git a/application/language/ru/config_lang.php b/application/language/ru/config_lang.php index d0e1919d6..17d355240 100644 --- a/application/language/ru/config_lang.php +++ b/application/language/ru/config_lang.php @@ -41,5 +41,5 @@ $lang["config_tax_included"] = "Tax Included"; $lang["config_timezone"] = "Часовой пояс"; $lang["config_website"] = "Веб-сайт"; $lang["config_barcode_number"] = "UPC/EAN/ISBN"; -$lang["config_barcode_name"] = ""; -$lang["config_barcode_text"] = ""; +$lang["config_barcode_id"] = "Item Id/Name"; +$lang["config_barcode_content"] = "Barcode Content"; diff --git a/application/language/th/config_lang.php b/application/language/th/config_lang.php index 37f2c9c91..497f2d3d8 100644 --- a/application/language/th/config_lang.php +++ b/application/language/th/config_lang.php @@ -41,5 +41,5 @@ $lang["config_tax_included"] = "รวมภาษีแล้ว"; $lang["config_timezone"] = "โซนเวลา"; $lang["config_website"] = "เว็บไซต์"; $lang["config_barcode_number"] = "UPC/EAN/ISBN"; -$lang["config_barcode_name"] = ""; -$lang["config_barcode_text"] = ""; +$lang["config_barcode_id"] = "Item Id/Name"; +$lang["config_barcode_content"] = "Barcode Content"; diff --git a/application/language/tr/config_lang.php b/application/language/tr/config_lang.php index 9f60d3477..72e712367 100644 --- a/application/language/tr/config_lang.php +++ b/application/language/tr/config_lang.php @@ -41,5 +41,5 @@ $lang["config_tax_included"] = ""; $lang["config_timezone"] = "Saat Dilimi"; $lang["config_website"] = "Website"; $lang["config_barcode_number"] = "UPC/EAN/ISBN"; -$lang["config_barcode_name"] = ""; -$lang["config_barcode_text"] = ""; +$lang["config_barcode_id"] = "Item Id/Name"; +$lang["config_barcode_content"] = "Barcode Content"; diff --git a/application/language/zh/config_lang.php b/application/language/zh/config_lang.php index c033452ad..53e6f673c 100755 --- a/application/language/zh/config_lang.php +++ b/application/language/zh/config_lang.php @@ -41,5 +41,5 @@ $lang["config_tax_included"] = "Tax Included"; $lang["config_timezone"] = "時區"; $lang["config_website"] = "網站"; $lang["config_barcode_number"] = "UPC/EAN/ISBN"; -$lang["config_barcode_name"] = ""; -$lang["config_barcode_text"] = ""; +$lang["config_barcode_id"] = "Item Id/Name"; +$lang["config_barcode_content"] = "Barcode Content"; diff --git a/application/views/barcode_sheet.php b/application/views/barcode_sheet.php index 1b79c632d..7fd4b14df 100644 --- a/application/views/barcode_sheet.php +++ b/application/views/barcode_sheet.php @@ -11,8 +11,8 @@ $count = 0; foreach($items as $item) { - $barcode = $item['id']; - $text = $this->config->item('barcode_text') === "name" ? $item['name'] : $item['item_number']; + $barcode = $this->config->item('barcode_content') === "id" ? $item['id'] : $item['item_number']; + $text = $this->config->item('barcode_content') === "id" ? $item['name'] : $item['item_number']; if ($count % 2 ==0 and $count!=0) { diff --git a/application/views/config.php b/application/views/config.php index 05b2de742..314fd6811 100644 --- a/application/views/config.php +++ b/application/views/config.php @@ -290,19 +290,19 @@ echo form_open('config/save/',array('id'=>'config_form'));
-lang->line('config_barcode_text').':', 'barcode_text',array('class'=>'wide')); ?> +lang->line('config_barcode_content').':', 'barcode_content',array('class'=>'wide')); ?>
'barcode_text', + 'name'=>'barcode_content', 'type'=>'radio', - 'value'=>'name', - 'checked'=>$this->config->item('barcode_text') === "name")); ?> - lang->line('config_barcode_name'); ?> + 'value'=>'id', + 'checked'=>$this->config->item('barcode_content') === "id")); ?> + lang->line('config_barcode_id'); ?> 'barcode_text', + 'name'=>'barcode_content', 'type'=>'radio', 'value'=>'number', - 'checked'=>$this->config->item('barcode_text') === "number")); ?> + 'checked'=>$this->config->item('barcode_content') === "number")); ?> lang->line('config_barcode_number'); ?>
diff --git a/database/2.3_to_2.3.1.sql b/database/2.3_to_2.3.1.sql index 57c58d5a1..d84291c11 100644 --- a/database/2.3_to_2.3.1.sql +++ b/database/2.3_to_2.3.1.sql @@ -79,7 +79,7 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('tax_included', '0'), ('recv_invoice_format', '$CO'), ('sales_invoice_format', '$CO'), -('barcode_content', 'name'); +('barcode_content', 'id'); -- add invoice_number column to receivings table ALTER TABLE `ospos_receivings` diff --git a/database/database.sql b/database/database.sql index d5b40ef47..c28907baf 100644 --- a/database/database.sql +++ b/database/database.sql @@ -40,7 +40,7 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('recv_invoice_format', '$CO'), ('sales_invoice_format', '$CO'), ('tax_included', '0'), -('barcode_content', 'name'); +('barcode_content', 'id'); -- -------------------------------------------------------- diff --git a/translations/.~lock.config_lang.csv# b/translations/.~lock.config_lang.csv# new file mode 100644 index 000000000..14175dca6 --- /dev/null +++ b/translations/.~lock.config_lang.csv# @@ -0,0 +1 @@ +jekkos ,jekkos,lenovo-t520.home,22.01.2015 23:34,file:///home/jekkos/.config/libreoffice/3; \ No newline at end of file diff --git a/translations/config_lang.csv b/translations/config_lang.csv index 13db26b77..c14791617 100644 --- a/translations/config_lang.csv +++ b/translations/config_lang.csv @@ -40,5 +40,5 @@ config_tax_included,VAT Ingebgrepen,Impuestos incluidos,Tax Included,,Tax Includ config_timezone,Tijdzone,Zona Horaria,Timezone,Fuseau Horaire,時區,Часовой пояс,โซนเวลา,Saat Dilimi,Zona Waktu config_website,Website,Sitio Web,Website,Site-web,網站,Веб-сайт,เว็บไซต์,Website,Situs Perusahaan config_barcode_number,UPC/EAN/ISBN,UPC/EAN/ISBN,UPC/EAN/ISBN,UPC/EAN/ISBN,UPC/EAN/ISBN,UPC/EAN/ISBN,UPC/EAN/ISBN,UPC/EAN/ISBN,UPC/EAN/ISBN -config_barcode_name,Productnaam,,Item Name,,,,,, -config_barcode_text,Inhoud Barcode,,Barcode Content,,,,,, +config_barcode_id,Product id/naam,Item Id/Name,Item Id/Name,Item Id/Name,Item Id/Name,Item Id/Name,Item Id/Name,Item Id/Name,Item Id/Name +config_barcode_content,Inhoud Barcode,Barcode Content,Barcode Content,Barcode Content,Barcode Content,Barcode Content,Barcode Content,Barcode Content,Barcode Content From e7fd57afdfdac0552ef10a24cdb0772b6114183a Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Fri, 23 Jan 2015 00:18:43 +0100 Subject: [PATCH 03/14] Cleanup duplicate cookies when browsing items module --- application/controllers/items.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/application/controllers/items.php b/application/controllers/items.php index c2bdc3ea4..0c340ac7c 100644 --- a/application/controllers/items.php +++ b/application/controllers/items.php @@ -25,6 +25,7 @@ class Items extends Secure_area implements iData_controller $data['form_width']=$this->get_form_width(); $data['manage_table']=get_items_manage_table( $this->Item->get_all( $stock_location, $config['per_page'], $this->uri->segment( $config['uri_segment'] ) ), $this ); $this->load->view('items/manage',$data); + $this->_remove_duplicate_cookies(); } function refresh() @@ -49,6 +50,7 @@ class Items extends Secure_area implements iData_controller $data['form_width']=$this->get_form_width(); $data['manage_table']=get_items_manage_table($this->Item->get_all_filtered($stock_location,$is_serialized,$no_description,$search_custom,$is_deleted),$this);//GARRISON MODIFIED 4/13/2013, Parq 131215 $this->load->view('items/manage',$data); + $this->_remove_duplicate_cookies(); } function find_item_info() From 1d9661d0b0fec39c2f0360365d53886fffde75af Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Sat, 24 Jan 2015 15:06:29 +0100 Subject: [PATCH 04/14] Add name, price and company name as possible barcode labels --- application/controllers/config.php | 27 +++++++++++++++------- application/controllers/items.php | 2 +- application/language/en/config_lang.php | 4 ++++ application/language/es/config_lang.php | 4 ++++ application/language/fr/config_lang.php | 4 ++++ application/language/id/config_lang.php | 4 ++++ application/language/nl-BE/config_lang.php | 4 ++++ application/language/ru/config_lang.php | 4 ++++ application/language/th/config_lang.php | 4 ++++ application/language/tr/config_lang.php | 4 ++++ application/language/zh/config_lang.php | 4 ++++ application/views/barcode_sheet.php | 22 +++++++++++++++++- application/views/config.php | 23 ++++++++++++++++-- translations/.~lock.config_lang.csv# | 1 - translations/config_lang.csv | 4 ++++ 15 files changed, 102 insertions(+), 13 deletions(-) delete mode 100644 translations/.~lock.config_lang.csv# diff --git a/application/controllers/config.php b/application/controllers/config.php index 65c539c08..2de52dc52 100644 --- a/application/controllers/config.php +++ b/application/controllers/config.php @@ -21,6 +21,11 @@ class Config extends Secure_area function save() { + $barcode_labels = preg_replace('/^_|barcode_label_|_$/', '', implode('_', array( + $this->input->post('barcode_label_name'), + $this->input->post('barcode_label_price'), + $this->input->post('barcode_label_company') + ))); $batch_save_data=array( 'company'=>$this->input->post('company'), 'address'=>$this->input->post('address'), @@ -41,6 +46,7 @@ class Config extends Secure_area 'tax_included'=>$this->input->post('tax_included'), 'recv_invoice_format'=>$this->input->post('recv_invoice_format'), 'sales_invoice_format'=>$this->input->post('sales_invoice_format'), + 'barcode_labels'=>$barcode_labels, 'barcode_content'=>$this->input->post('barcode_content'), 'custom1_name'=>$this->input->post('custom1_name'),/**GARRISON ADDED 4/20/2013**/ 'custom2_name'=>$this->input->post('custom2_name'),/**GARRISON ADDED 4/20/2013**/ @@ -61,15 +67,9 @@ class Config extends Secure_area array_push($stock_locations_trimmed, trim($location, ' ')); } $current_locations = $this->Stock_locations->concat_location_names()->location_names; - if ($this->input->post('stock_locations') != $current_locations) + if ($this->input->post('stock_locations') != $current_locations) { - $this->load->library('sale_lib'); - $this->sale_lib->clear_sale_location(); - $this->sale_lib->clear_all(); - $this->load->library('receiving_lib'); - $this->receiving_lib->clear_stock_source(); - $this->receiving_lib->clear_stock_destination(); - $this->receiving_lib->clear_all(); + $this->_clear_session_state(); } if( $this->Appconfig->batch_save( $batch_save_data ) && $this->Stock_locations->array_save($stock_locations_trimmed)) @@ -77,5 +77,16 @@ class Config extends Secure_area echo json_encode(array('success'=>true,'message'=>$this->lang->line('config_saved_successfully'))); } } + + function _clear_session_state() + { + $this->load->library('sale_lib'); + $this->sale_lib->clear_sale_location(); + $this->sale_lib->clear_all(); + $this->load->library('receiving_lib'); + $this->receiving_lib->clear_stock_source(); + $this->receiving_lib->clear_stock_destination(); + $this->receiving_lib->clear_all(); + } } ?> \ No newline at end of file diff --git a/application/controllers/items.php b/application/controllers/items.php index 0c340ac7c..dadd4c097 100644 --- a/application/controllers/items.php +++ b/application/controllers/items.php @@ -273,7 +273,7 @@ class Items extends Secure_area implements iData_controller { $item_info = $this->Item->get_info($item_id); - $result[] = array('name' =>$item_info->name, 'id'=> $item_id, 'item_number'=> $item_info->item_number); + $result[] = array('name' =>$item_info->name, 'id'=> $item_id, 'item_number'=> $item_info->item_number, 'unit_price'=>$item_info->unit_price); } $data['items'] = $result; diff --git a/application/language/en/config_lang.php b/application/language/en/config_lang.php index 028beed5a..64d54f030 100644 --- a/application/language/en/config_lang.php +++ b/application/language/en/config_lang.php @@ -43,3 +43,7 @@ $lang["config_website"] = "Website"; $lang["config_barcode_number"] = "UPC/EAN/ISBN"; $lang["config_barcode_id"] = "Item Id/Name"; $lang["config_barcode_content"] = "Barcode Content"; +$lang["config_barcode_labels"] = "Barcode Labels"; +$lang["config_barcode_name"] = "Name"; +$lang["config_barcode_price"] = "Price"; +$lang["config_barcode_company"] = "Company Name"; diff --git a/application/language/es/config_lang.php b/application/language/es/config_lang.php index 40a378629..cf7bbf477 100644 --- a/application/language/es/config_lang.php +++ b/application/language/es/config_lang.php @@ -43,3 +43,7 @@ $lang["config_website"] = "Sitio Web"; $lang["config_barcode_number"] = "UPC/EAN/ISBN"; $lang["config_barcode_id"] = "Item Id/Name"; $lang["config_barcode_content"] = "Barcode Content"; +$lang["config_barcode_labels"] = "Barcode Labels"; +$lang["config_barcode_name"] = "Name"; +$lang["config_barcode_price"] = "Price"; +$lang["config_barcode_company"] = "Nombre del Comercio"; diff --git a/application/language/fr/config_lang.php b/application/language/fr/config_lang.php index 5c810af19..94c80ac87 100644 --- a/application/language/fr/config_lang.php +++ b/application/language/fr/config_lang.php @@ -43,3 +43,7 @@ $lang["config_website"] = "Site-web"; $lang["config_barcode_number"] = "UPC/EAN/ISBN"; $lang["config_barcode_id"] = "Item Id/Name"; $lang["config_barcode_content"] = "Barcode Content"; +$lang["config_barcode_labels"] = "Barcode Labels"; +$lang["config_barcode_name"] = "Name"; +$lang["config_barcode_price"] = "Price"; +$lang["config_barcode_company"] = "Nome de l\'Entreprise"; diff --git a/application/language/id/config_lang.php b/application/language/id/config_lang.php index 9a5bb1ab0..929bae8bc 100644 --- a/application/language/id/config_lang.php +++ b/application/language/id/config_lang.php @@ -43,3 +43,7 @@ $lang["config_website"] = "Situs Perusahaan"; $lang["config_barcode_number"] = "UPC/EAN/ISBN"; $lang["config_barcode_id"] = "Item Id/Name"; $lang["config_barcode_content"] = "Barcode Content"; +$lang["config_barcode_labels"] = "Barcode Labels"; +$lang["config_barcode_name"] = "Name"; +$lang["config_barcode_price"] = "Price"; +$lang["config_barcode_company"] = "Nama Perusahaan"; diff --git a/application/language/nl-BE/config_lang.php b/application/language/nl-BE/config_lang.php index eb6127329..445fc64fc 100755 --- a/application/language/nl-BE/config_lang.php +++ b/application/language/nl-BE/config_lang.php @@ -43,3 +43,7 @@ $lang["config_website"] = "Website"; $lang["config_barcode_number"] = "UPC/EAN/ISBN"; $lang["config_barcode_id"] = "Product id/naam"; $lang["config_barcode_content"] = "Inhoud Barcode"; +$lang["config_barcode_labels"] = "Barcode Labels"; +$lang["config_barcode_name"] = "Productnaam"; +$lang["config_barcode_price"] = "Prijs"; +$lang["config_barcode_company"] = "Bedrijfsnaam"; diff --git a/application/language/ru/config_lang.php b/application/language/ru/config_lang.php index 17d355240..b6a962827 100644 --- a/application/language/ru/config_lang.php +++ b/application/language/ru/config_lang.php @@ -43,3 +43,7 @@ $lang["config_website"] = "Веб-сайт"; $lang["config_barcode_number"] = "UPC/EAN/ISBN"; $lang["config_barcode_id"] = "Item Id/Name"; $lang["config_barcode_content"] = "Barcode Content"; +$lang["config_barcode_labels"] = "Barcode Labels"; +$lang["config_barcode_name"] = "Name"; +$lang["config_barcode_price"] = "Price"; +$lang["config_barcode_company"] = "Название Компании"; diff --git a/application/language/th/config_lang.php b/application/language/th/config_lang.php index 497f2d3d8..c04d37620 100644 --- a/application/language/th/config_lang.php +++ b/application/language/th/config_lang.php @@ -43,3 +43,7 @@ $lang["config_website"] = "เว็บไซต์"; $lang["config_barcode_number"] = "UPC/EAN/ISBN"; $lang["config_barcode_id"] = "Item Id/Name"; $lang["config_barcode_content"] = "Barcode Content"; +$lang["config_barcode_labels"] = "Barcode Labels"; +$lang["config_barcode_name"] = "Name"; +$lang["config_barcode_price"] = "Price"; +$lang["config_barcode_company"] = "ชื่อร้านค้า"; diff --git a/application/language/tr/config_lang.php b/application/language/tr/config_lang.php index 72e712367..a44336fc8 100644 --- a/application/language/tr/config_lang.php +++ b/application/language/tr/config_lang.php @@ -43,3 +43,7 @@ $lang["config_website"] = "Website"; $lang["config_barcode_number"] = "UPC/EAN/ISBN"; $lang["config_barcode_id"] = "Item Id/Name"; $lang["config_barcode_content"] = "Barcode Content"; +$lang["config_barcode_labels"] = "Barcode Labels"; +$lang["config_barcode_name"] = "Name"; +$lang["config_barcode_price"] = "Price"; +$lang["config_barcode_company"] = "Şirket Adı"; diff --git a/application/language/zh/config_lang.php b/application/language/zh/config_lang.php index 53e6f673c..e3a95e987 100755 --- a/application/language/zh/config_lang.php +++ b/application/language/zh/config_lang.php @@ -43,3 +43,7 @@ $lang["config_website"] = "網站"; $lang["config_barcode_number"] = "UPC/EAN/ISBN"; $lang["config_barcode_id"] = "Item Id/Name"; $lang["config_barcode_content"] = "Barcode Content"; +$lang["config_barcode_labels"] = "Barcode Labels"; +$lang["config_barcode_name"] = "Name"; +$lang["config_barcode_price"] = "Price"; +$lang["config_barcode_company"] = "公司名稱"; diff --git a/application/views/barcode_sheet.php b/application/views/barcode_sheet.php index 7fd4b14df..c7232e7a6 100644 --- a/application/views/barcode_sheet.php +++ b/application/views/barcode_sheet.php @@ -3,6 +3,12 @@ <?php echo $this->lang->line('items_generate_barcodes'); ?> + @@ -18,7 +24,21 @@ foreach($items as $item) { echo ''; } - echo ""; + echo ""; $count++; } ?> diff --git a/application/views/config.php b/application/views/config.php index 314fd6811..c23db69f0 100644 --- a/application/views/config.php +++ b/application/views/config.php @@ -294,19 +294,38 @@ echo form_open('config/save/',array('id'=>'config_form'));
'barcode_content', - 'type'=>'radio', 'value'=>'id', 'checked'=>$this->config->item('barcode_content') === "id")); ?> lang->line('config_barcode_id'); ?> 'barcode_content', - 'type'=>'radio', 'value'=>'number', 'checked'=>$this->config->item('barcode_content') === "number")); ?> lang->line('config_barcode_number'); ?>
+
+lang->line('config_barcode_labels').':', 'barcode_labels',array('class'=>'wide')); ?> +
+ 'barcode_label_company', + 'value'=>'barcode_label_company', + 'checked'=>strstr($this->config->item('barcode_labels'), 'company'))); ?> + lang->line('config_barcode_company'); ?> + 'barcode_label_name', + 'value'=>'barcode_label_name', + 'checked'=>strstr($this->config->item('barcode_labels'), 'name'))); ?> + lang->line('config_barcode_name'); ?> + 'barcode_label_price', + 'value'=>'barcode_label_price', + 'checked'=>strstr($this->config->item('barcode_labels'), 'price'))); ?> + lang->line('config_barcode_price'); ?> +
+
+
lang->line('config_print_after_sale').':', 'print_after_sale',array('class'=>'wide')); ?>
diff --git a/translations/.~lock.config_lang.csv# b/translations/.~lock.config_lang.csv# deleted file mode 100644 index 14175dca6..000000000 --- a/translations/.~lock.config_lang.csv# +++ /dev/null @@ -1 +0,0 @@ -jekkos ,jekkos,lenovo-t520.home,22.01.2015 23:34,file:///home/jekkos/.config/libreoffice/3; \ No newline at end of file diff --git a/translations/config_lang.csv b/translations/config_lang.csv index c14791617..f1274c2c5 100644 --- a/translations/config_lang.csv +++ b/translations/config_lang.csv @@ -42,3 +42,7 @@ config_website,Website,Sitio Web,Website,Site-web,網站,Веб-сайт,เว config_barcode_number,UPC/EAN/ISBN,UPC/EAN/ISBN,UPC/EAN/ISBN,UPC/EAN/ISBN,UPC/EAN/ISBN,UPC/EAN/ISBN,UPC/EAN/ISBN,UPC/EAN/ISBN,UPC/EAN/ISBN config_barcode_id,Product id/naam,Item Id/Name,Item Id/Name,Item Id/Name,Item Id/Name,Item Id/Name,Item Id/Name,Item Id/Name,Item Id/Name config_barcode_content,Inhoud Barcode,Barcode Content,Barcode Content,Barcode Content,Barcode Content,Barcode Content,Barcode Content,Barcode Content,Barcode Content +config_barcode_labels,Barcode Labels,Barcode Labels,Barcode Labels,Barcode Labels,Barcode Labels,Barcode Labels,Barcode Labels,Barcode Labels,Barcode Labels +config_barcode_name,Productnaam,Name,Name,Name,Name,Name,Name,Name,Name +config_barcode_price,Prijs,Price,Price,Price,Price,Price,Price,Price,Price +config_barcode_company,Bedrijfsnaam,Nombre del Comercio,Company Name,Nome de l\'Entreprise,公司名稱,Название Компании,ชื่อร้านค้า,Şirket Adı,Nama Perusahaan From 868721c6f51b8328cc36e8b0577415c5784c3a81 Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Sat, 24 Jan 2015 15:18:00 +0100 Subject: [PATCH 05/14] Adapt sql scripts for new barcode label options --- application/views/barcode_sheet.php | 2 +- database/2.3_to_2.3.1.sql | 3 ++- database/database.sql | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/application/views/barcode_sheet.php b/application/views/barcode_sheet.php index c7232e7a6..d8e89addd 100644 --- a/application/views/barcode_sheet.php +++ b/application/views/barcode_sheet.php @@ -36,7 +36,7 @@ foreach($items as $item) } if (strstr($this->config->item('barcode_labels'), 'name')) { - echo ": " . $item['name']; + echo " " . $item['name']; } echo ""; $count++; diff --git a/database/2.3_to_2.3.1.sql b/database/2.3_to_2.3.1.sql index d84291c11..3bd1f4eb4 100644 --- a/database/2.3_to_2.3.1.sql +++ b/database/2.3_to_2.3.1.sql @@ -79,7 +79,8 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('tax_included', '0'), ('recv_invoice_format', '$CO'), ('sales_invoice_format', '$CO'), -('barcode_content', 'id'); +('barcode_content', 'id'), +('barcode_labels', ''); -- add invoice_number column to receivings table ALTER TABLE `ospos_receivings` diff --git a/database/database.sql b/database/database.sql index c28907baf..21bada017 100644 --- a/database/database.sql +++ b/database/database.sql @@ -40,7 +40,8 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('recv_invoice_format', '$CO'), ('sales_invoice_format', '$CO'), ('tax_included', '0'), -('barcode_content', 'id'); +('barcode_content', 'id'), +('barcode_labels', ''); -- -------------------------------------------------------- From 4556938154447690c3000176af2f40c59e5b1814 Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Sun, 25 Jan 2015 14:32:15 +0100 Subject: [PATCH 06/14] Add cookie cleanup after search() and get_row() --- application/controllers/items.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/application/controllers/items.php b/application/controllers/items.php index 7051a5390..0aec46ebc 100644 --- a/application/controllers/items.php +++ b/application/controllers/items.php @@ -65,6 +65,7 @@ class Items extends Secure_area implements iData_controller $stock_location=$this->item_lib->get_item_location(); $data_rows=get_items_manage_table_data_rows($this->Item->search($search,$stock_location),$this); echo $data_rows; + $this->_remove_duplicate_cookies(); } /* @@ -203,6 +204,7 @@ class Items extends Secure_area implements iData_controller $data_row=get_item_data_row($item_info,$this); echo $data_row; + $this->_remove_duplicate_cookies(); } function view($item_id=-1) From 344cb5c74940e00553ee033742dd9ceddc773a7c Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Sun, 25 Jan 2015 15:46:42 +0100 Subject: [PATCH 07/14] Add route for no_access controller with just one parameter Remove permission dependency between sales, receivings and items module Add explicit stock permission to sales and receiving modules --- application/config/routes.php | 1 + application/controllers/employees.php | 2 +- application/controllers/no_access.php | 2 +- application/controllers/receivings.php | 2 +- application/controllers/sales.php | 2 +- application/views/no_access.php | 2 +- database/2.3_to_2.3.1.sql | 11 ++++++++++- database/database.sql | 7 +++++-- 8 files changed, 21 insertions(+), 8 deletions(-) diff --git a/application/config/routes.php b/application/config/routes.php index 1047287a4..03120d02c 100644 --- a/application/config/routes.php +++ b/application/config/routes.php @@ -39,6 +39,7 @@ */ $route['default_controller'] = "login"; +$route['no_access/(:any)'] = "no_access/index/$1"; $route['no_access/(:any)/(:any)'] = "no_access/index/$1/$2"; $route['reports/(summary_:any)/(:any)/(:any)'] = "reports/$1/$2/$3"; $route['reports/summary_:any'] = "reports/date_input_excel_export"; diff --git a/application/controllers/employees.php b/application/controllers/employees.php index 698d132d7..d6d0c7527 100644 --- a/application/controllers/employees.php +++ b/application/controllers/employees.php @@ -69,7 +69,7 @@ class Employees extends Person_controller 'country'=>$this->input->post('country'), 'comments'=>$this->input->post('comments') ); - $grants_data = $this->input->post("grants")!=false ? $this->input->post("grants"):array(); + $grants_data = $this->input->post("grants")!=FALSE ? $this->input->post("grants"):array(); //Password has been changed OR first time password set if($this->input->post('password')!='') diff --git a/application/controllers/no_access.php b/application/controllers/no_access.php index b64a7f6b9..9761c02af 100644 --- a/application/controllers/no_access.php +++ b/application/controllers/no_access.php @@ -9,7 +9,7 @@ class No_Access extends CI_Controller function index($module_id='',$permission_id='') { $data['module_name']=$this->Module->get_module_name($module_id); - $data['permission_id']=empty($permission_id)?$module_id:$permission_id; + $data['permission_id']=$permission_id; $this->load->view('no_access',$data); } } diff --git a/application/controllers/receivings.php b/application/controllers/receivings.php index 23d1bb50c..f49c49386 100644 --- a/application/controllers/receivings.php +++ b/application/controllers/receivings.php @@ -4,7 +4,7 @@ class Receivings extends Secure_area { function __construct() { - parent::__construct('receivings','items'); + parent::__construct('receivings'); $this->load->library('receiving_lib'); } diff --git a/application/controllers/sales.php b/application/controllers/sales.php index a5b735be2..897eede34 100644 --- a/application/controllers/sales.php +++ b/application/controllers/sales.php @@ -4,7 +4,7 @@ class Sales extends Secure_area { function __construct() { - parent::__construct('sales','items'); + parent::__construct('sales'); $this->load->library('sale_lib'); } diff --git a/application/views/no_access.php b/application/views/no_access.php index 695f0843e..35d546e4d 100644 --- a/application/views/no_access.php +++ b/application/views/no_access.php @@ -1,3 +1,3 @@ lang->line('error_no_permission_module').' '.$module_name . ' (' . $permission_id . ')'; +echo $this->lang->line('error_no_permission_module').' '.$module_name . (!empty($permission_id) ? ' (' . $permission_id . ')' : ''); ?> \ No newline at end of file diff --git a/database/2.3_to_2.3.1.sql b/database/2.3_to_2.3.1.sql index 3bd1f4eb4..93291b1c8 100644 --- a/database/2.3_to_2.3.1.sql +++ b/database/2.3_to_2.3.1.sql @@ -37,7 +37,14 @@ INSERT INTO `ospos_permissions` (`permission_id`, `module_id`) VALUES ('suppliers', 'suppliers'); -- add permissions for existing stock locations -INSERT INTO `ospos_permissions` (permission_id, module_id, location_id) (SELECT CONCAT('items_', location_name), 'items', location_id FROM ospos_stock_locations); +INSERT INTO `ospos_permissions` (permission_id, module_id, location_id) +(SELECT CONCAT('items_', location_name), 'items', location_id FROM ospos_stock_locations); + +INSERT INTO `ospos_permissions` (permission_id, module_id, location_id) +(SELECT CONCAT('sales_', location_name), 'sales', location_id FROM ospos_stock_locations); + +INSERT INTO `ospos_permissions` (permission_id, module_id, location_id) +(SELECT CONCAT('receivings_', location_name), 'receivings', location_id FROM ospos_stock_locations); CREATE TABLE `ospos_grants` ( `permission_id` varchar(255) NOT NULL, @@ -72,6 +79,8 @@ INSERT INTO `ospos_grants` (`permission_id`, `person_id`) VALUES ('sales', 1), ('config', 1), ('items_stock', 1), +('sales_stock', 1), +('receivings_stock', 1), ('suppliers', 1); -- add config options for tax inclusive sales diff --git a/database/database.sql b/database/database.sql index 21bada017..369421034 100644 --- a/database/database.sql +++ b/database/database.sql @@ -345,8 +345,9 @@ INSERT INTO `ospos_permissions` (`permission_id`, `module_id`) VALUES ('suppliers', 'suppliers'); INSERT INTO `ospos_permissions` (`permission_id`, `module_id`, `location_id`) VALUES -('items_stock', 'items', 1); - +('items_stock', 'items', 1), +('sales_stock', 'sales', 1), +('receivings_stock', 'receivings', 1); -- -------------------------------------------------------- @@ -387,6 +388,8 @@ INSERT INTO `ospos_grants` (`permission_id`, `person_id`) VALUES ('sales', 1), ('config', 1), ('items_stock', 1), +('sales_stock', 1), +('receivings_stock', 1), ('suppliers', 1); -- From b9ee7b6b01a1cadce378d2c515386a095f8e0dfd Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Sun, 25 Jan 2015 16:07:53 +0100 Subject: [PATCH 08/14] Invert quantity correction when deleting sales --- application/models/sale.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/models/sale.php b/application/models/sale.php index 361fd587f..58bbcf4b3 100644 --- a/application/models/sale.php +++ b/application/models/sale.php @@ -185,7 +185,7 @@ class Sale extends CI_Model 'trans_user'=>$employee_id, 'trans_comment'=>'Deleting sale ' . $sale_id, 'trans_location'=>$item['item_location'], - 'trans_inventory'=>$item['quantity_purchased']*-1 + 'trans_inventory'=>$item['quantity_purchased'] ); // update inventory @@ -194,7 +194,7 @@ class Sale extends CI_Model // update quantities $this->Item_quantities->change_quantity($item['item_id'], $item['item_location'], - $item['quantity_purchased']*-1); + $item['quantity_purchased']); } } // delete all items From 16814f2d1206fbe5dd4a8ba49d806fbdca61ab96 Mon Sep 17 00:00:00 2001 From: jekkos Date: Sun, 25 Jan 2015 16:39:31 +0100 Subject: [PATCH 09/14] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index d248e5c01..d4417de21 100644 --- a/README.md +++ b/README.md @@ -15,3 +15,8 @@ password:pointofsale 9. Enjoy A more extensive setup guide can be found at [this site](http://www.opensourceposguide.com/guide/gettingstarted/installation) + +If you like the project, and you are making money out of it on a daily basis, then consider to buy me a coffee so I can keep adding features. + + +[![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=MUN6AEG7NY6H8) From 8705b91bd357b3c935f3a543711e2477e302fa7b Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Wed, 29 Oct 2014 07:02:52 +0100 Subject: [PATCH 10/14] Start refactoring the stock locations configuration screen --- application/controllers/config.php | 15 +++++--- application/models/stock_locations.php | 1 + application/views/config.php | 52 ++++++++++++++++++++++++-- database/database.sql | 2 +- 4 files changed, 59 insertions(+), 11 deletions(-) diff --git a/application/controllers/config.php b/application/controllers/config.php index 8895bd595..fb063d986 100644 --- a/application/controllers/config.php +++ b/application/controllers/config.php @@ -10,12 +10,8 @@ class Config extends Secure_area function index() { $location_names = array(); - $locations = $this->Stock_locations->get_location_names(); - foreach($locations->result_array() as $array) - { - array_push($location_names, $array['location_name']); - } - $data['location_names'] = implode(',', $location_names); + $allowed_locations = $this->Stock_locations->get_allowed_locations(); + $data['allowed_locations'] = $allowed_locations; $this->load->view("config", $data); } @@ -59,6 +55,13 @@ class Config extends Secure_area array_push($stock_locations_trimmed, trim($location, ' ')); } $current_locations = $this->Stock_locations->concat_location_names()->location_names; + foreach($this->input->post() as $key => $value) + { + if (strstr($key, 'stock_location')) + { + // save or update + } + } if ($this->input->post('stock_locations') != $current_locations) { $this->load->library('sale_lib'); diff --git a/application/models/stock_locations.php b/application/models/stock_locations.php index 96349648d..66d418b7c 100644 --- a/application/models/stock_locations.php +++ b/application/models/stock_locations.php @@ -79,6 +79,7 @@ class Stock_locations extends CI_Model // check for insertion foreach ($stock_locations as $location_name) { + $index=0; if(!$this->exists($location_name)) { $this->db->trans_start(); diff --git a/application/views/config.php b/application/views/config.php index b441f5408..968b12681 100644 --- a/application/views/config.php +++ b/application/views/config.php @@ -258,15 +258,20 @@ echo form_open('config/save/',array('id'=>'config_form'));
+ + $location_name ) { ?>
-lang->line('config_stock_location').':', 'stock_location',array('class'=>'required wide')); ?> +lang->line('config_stock_location').' ' .++$i. ':', 'stock_location_'.$i ,array('class'=>'required wide')); ?>
'stock_location', - 'id'=>'stock_location', - 'value'=>$location_names)); ?> + 'name'=>'stock_location_'.$location_id, + 'id'=>'stock_location_'.$location_id, + 'value'=>$location_name)); ?>
+ +
+
lang->line('config_recv_invoice_format').':', 'recv_invoice_format',array('class'=>'wide')); ?> @@ -419,6 +424,45 @@ echo form_close(); //validation and submit handling $(document).ready(function() { + var location_count = ; + + var hide_show_remove = function() + { + if ($("input[name*='stock_location']").length > 1) + { + $(".remove_stock_location").show(); + } + else + { + $(".remove_stock_location").hide(); + } + }; + + hide_show_remove(); + + var add_stock_location = function() + { + var id = $(this).parent().find('input').attr('id'); + id = id.replace(/.*?_(\d+)$/g, "$1"); + var block = $(this).parent().clone(true); + var new_block = block.insertAfter($(this).parent()); + var new_block_id = 'stock_location_' + ++id; + $(new_block).find('label').html("lang->line('config_stock_location'); ?> " + ++location_count + ": ").attr('for', new_block_id); + $(new_block).find('input').attr('id', new_block_id).attr('name', new_block_id); + $('.add_stock_location', new_block).click(add_stock_location); + $('.remove_stock_location', new_block).click(remove_stock_location); + hide_show_remove(); + }; + + var remove_stock_location = function() + { + $(this).parent().remove(); + hide_show_remove(); + }; + + $('.add_stock_location').click(add_stock_location); + $('.remove_stock_location').click(remove_stock_location); + $('#config_form').validate({ submitHandler:function(form) { diff --git a/database/database.sql b/database/database.sql index 4501965f1..02deaece4 100644 --- a/database/database.sql +++ b/database/database.sql @@ -644,7 +644,7 @@ CREATE TABLE `ospos_stock_locations` ( `location_name` varchar(255) CHARACTER SET utf8 DEFAULT NULL, `deleted` int(1) NOT NULL DEFAULT '0', PRIMARY KEY (`location_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=0; +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1; -- -- Dumping data for table `ospos_stock_locations` From 24a6c9c34ff0c77269386f4ff7396c3b9c002a38 Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Tue, 27 Jan 2015 19:03:57 +0100 Subject: [PATCH 11/14] Config location editing works now --- application/controllers/config.php | 51 ++++--- application/models/stock_locations.php | 136 +++++++++--------- application/views/config.php | 51 ++++--- application/views/partial/stock_locations.php | 20 +++ 4 files changed, 144 insertions(+), 114 deletions(-) create mode 100644 application/views/partial/stock_locations.php diff --git a/application/controllers/config.php b/application/controllers/config.php index fb063d986..b0c0d28dd 100644 --- a/application/controllers/config.php +++ b/application/controllers/config.php @@ -10,9 +10,8 @@ class Config extends Secure_area function index() { $location_names = array(); - $allowed_locations = $this->Stock_locations->get_allowed_locations(); - $data['allowed_locations'] = $allowed_locations; - $this->load->view("config", $data); + $stock_locations = $this->Stock_locations->get_all()->result_array(); + $this->load->view("config", array('stock_locations' => $stock_locations)); } function save() @@ -48,35 +47,49 @@ class Config extends Secure_area 'custom10_name'=>$this->input->post('custom10_name')/**GARRISON ADDED 4/20/2013**/ ); - $stock_locations = explode( ',', $this->input->post('stock_location')); - $stock_locations_trimmed=array(); - foreach($stock_locations as $location) - { - array_push($stock_locations_trimmed, trim($location, ' ')); - } - $current_locations = $this->Stock_locations->concat_location_names()->location_names; + $deleted_locations = $this->Stock_locations->get_allowed_locations(); foreach($this->input->post() as $key => $value) { if (strstr($key, 'stock_location')) { + $location_id = preg_replace("/.*?_(\d+)$/", "$1", $key); + unset($deleted_locations[$location_id]); // save or update + $location_data = array('location_name' => $value); + if ($this->Stock_locations->save($location_data, $location_id)) + { + $this->_clear_session_state(); + } } } - if ($this->input->post('stock_locations') != $current_locations) + // all locations not available in post will be deleted now + foreach ($deleted_locations as $location_id => $location_name) { - $this->load->library('sale_lib'); - $this->sale_lib->clear_sale_location(); - $this->sale_lib->clear_all(); - $this->load->library('receiving_lib'); - $this->receiving_lib->clear_stock_source(); - $this->receiving_lib->clear_stock_destination(); - $this->receiving_lib->clear_all(); + $this->Stock_locations->delete($location_id); } - if( $this->Appconfig->batch_save( $batch_save_data ) && $this->Stock_locations->array_save($stock_locations_trimmed)) + if( $this->Appconfig->batch_save( $batch_save_data )) { echo json_encode(array('success'=>true,'message'=>$this->lang->line('config_saved_successfully'))); } + $this->_remove_duplicate_cookies(); + } + + function stock_locations() + { + $stock_locations = $this->Stock_locations->get_all()->result_array(); + $this->load->view('partial/stock_locations', array('stock_locations' => $stock_locations)); + } + + function _clear_session_state() + { + $this->load->library('sale_lib'); + $this->sale_lib->clear_sale_location(); + $this->sale_lib->clear_all(); + $this->load->library('receiving_lib'); + $this->receiving_lib->clear_stock_source(); + $this->receiving_lib->clear_stock_destination(); + $this->receiving_lib->clear_all(); } } ?> \ No newline at end of file diff --git a/application/models/stock_locations.php b/application/models/stock_locations.php index 66d418b7c..95a069cf3 100644 --- a/application/models/stock_locations.php +++ b/application/models/stock_locations.php @@ -1,13 +1,13 @@ db->from('stock_locations'); - $this->db->where('location_name',$location_name); + $this->db->where('location_id',$location_id); $query = $this->db->get(); - return ($query->num_rows()==1); + return ($query->num_rows()>=1); } function get_all($limit=10000, $offset=0) @@ -18,22 +18,6 @@ class Stock_locations extends CI_Model return $this->db->get(); } - function get_location_names() - { - $this->db->select('location_name'); - $this->db->from('stock_locations'); - $this->db->where('deleted', 0); - return $this->db->get(); - } - - function concat_location_names() - { - $this->db->select('GROUP_CONCAT(location_name SEPARATOR\',\') AS location_names', FALSE); - $this->db->from('stock_locations'); - $this->db->where('deleted', 0); - return $this->db->get()->row(); - } - function get_undeleted_all() { $this->db->from('stock_locations'); @@ -73,60 +57,68 @@ class Stock_locations extends CI_Model return $this->db->get()->row()->location_name; } - function array_save($stock_locations) + function save(&$location_data,$location_id) { - $allowed_locations = $this->get_allowed_locations(); - // check for insertion - foreach ($stock_locations as $location_name) - { - $index=0; - if(!$this->exists($location_name)) - { - $this->db->trans_start(); - $location_data = array('location_name'=>$location_name,'deleted'=>0); - $this->db->insert('stock_locations',$location_data); - $location_id = $this->db->insert_id(); - - // insert new permission for stock location - $permission_id = 'items_'.$location_name; - $permission_data = array('permission_id'=>$permission_id,'module_id'=>'items','location_id' => $location_id); - $this->db->insert('permissions', $permission_data); - - // insert grants for new permission - $employees = $this->Employee->get_all(); - foreach ($employees->result_array() as $employee) - { - $grants_data = array('permission_id' => $permission_id, 'person_id' => $employee['person_id']); - $this->db->insert('grants', $grants_data); - } - - // insert quantities for existing items - $items = $this->Item->get_all(); - foreach ($items->result_array() as $item) - { - $quantity_data = array('item_id' => $item['item_id'], 'location_id' => $location_id, 'quantity' => 0); - $this->db->insert('item_quantities', $quantity_data); - } - $this->db->trans_complete(); - } - else if (!in_array($location_name, array_values($allowed_locations))) - { - $this->db->where('location_name', $location_name); - $this->db->update('stock_locations', array('deleted' => 0)); - } - } - - // check for deletion - foreach ($allowed_locations as $location_id => $location_name) - { - if (!in_array($location_name, $stock_locations)) - { - $this->db->where('location_id', $location_id); - $this->db->update('stock_locations', array('deleted' => 1)); - } - } - - return true; + if (!$this->exists($location_id)) + { + if($this->db->insert('stock_locations',$location_data)) + { + $location_name = $location_data['location_name']; + $this->db->trans_start(); + $location_data = array('location_name'=>$location_name,'deleted'=>0); + $this->db->insert('stock_locations',$location_data); + $location_id = $this->db->insert_id(); + + $this->_insert_new_permission('items', $location_id, $location_name); + $this->_insert_new_permission('sales', $location_id, $location_name); + $this->_insert_new_permission('receivings', $location_id, $location_name); + + + // insert quantities for existing items + $items = $this->Item->get_all(); + foreach ($items->result_array() as $item) + { + $quantity_data = array('item_id' => $item['item_id'], 'location_id' => $location_id, 'quantity' => 0); + $this->db->insert('item_quantities', $quantity_data); + } + $this->db->trans_complete(); + return TRUE; + } + return FALSE; + } + else + { + $this->db->where('location_id', $location_id); + return $this->db->update('stock_locations',$location_data); + } } + + function _insert_new_permission($module, $location_id, $location_name) + { + // insert new permission for stock location + $permission_id = $module."_".$location_name; + $permission_data = array('permission_id'=>$permission_id,'module_id'=>$module,'location_id' => $location_id); + $this->db->insert('permissions', $permission_data); + + // insert grants for new permission + $employees = $this->Employee->get_all(); + foreach ($employees->result_array() as $employee) + { + $grants_data = array('permission_id' => $permission_id, 'person_id' => $employee['person_id']); + $this->db->insert('grants', $grants_data); + } + + } + + /* + Deletes one item + */ + function delete($location_id) + { + $this->db->where('location_id', $location_id); + return $this->db->update('stock_locations', array('deleted' => 1)); + } + + } ?> diff --git a/application/views/config.php b/application/views/config.php index 968b12681..3568bb75a 100644 --- a/application/views/config.php +++ b/application/views/config.php @@ -258,20 +258,7 @@ echo form_open('config/save/',array('id'=>'config_form'));
- - $location_name ) { ?> -
-lang->line('config_stock_location').' ' .++$i. ':', 'stock_location_'.$i ,array('class'=>'required wide')); ?> -
- 'stock_location_'.$location_id, - 'id'=>'stock_location_'.$location_id, - 'value'=>$location_name)); ?> -
- - -
- +load->view('partial/stock_locations', array('stock_locations' => $stock_locations)); ?>
lang->line('config_recv_invoice_format').':', 'recv_invoice_format',array('class'=>'wide')); ?> @@ -424,7 +411,7 @@ echo form_close(); //validation and submit handling $(document).ready(function() { - var location_count = ; + var location_count = ; var hide_show_remove = function() { @@ -448,7 +435,7 @@ $(document).ready(function() var new_block = block.insertAfter($(this).parent()); var new_block_id = 'stock_location_' + ++id; $(new_block).find('label').html("lang->line('config_stock_location'); ?> " + ++location_count + ": ").attr('for', new_block_id); - $(new_block).find('input').attr('id', new_block_id).attr('name', new_block_id); + $(new_block).find('input').attr('id', new_block_id).attr('name', new_block_id).attr('class', new_block_id).val(''); $('.add_stock_location', new_block).click(add_stock_location); $('.remove_stock_location', new_block).click(remove_stock_location); hide_show_remove(); @@ -459,9 +446,27 @@ $(document).ready(function() $(this).parent().remove(); hide_show_remove(); }; + + var init_add_remove_locations = function() + { + $('.add_stock_location').click(add_stock_location); + $('.remove_stock_location').click(remove_stock_location); + }; + init_add_remove_locations(); - $('.add_stock_location').click(add_stock_location); - $('.remove_stock_location').click(remove_stock_location); + // run validator once for all fields + var validator_name = $("input[name*='stock_location']:first").attr('class'); + $.validator.addMethod(validator_name , function(value, element) + { + var result = true; + var locations = {}; + $("input[name*='stock_location']").each(function() { + var content = $(this).val(); + result &= content && !locations[content]; + locations[content] = content; + }); + return result; + }, "lang->line('config_stock_location_required'); ?>"); $('#config_form').validate({ submitHandler:function(form) @@ -477,6 +482,7 @@ $(document).ready(function() { set_feedback(response.message,'error_message',true); } + $("#stock_locations").load('', init_add_remove_locations); }, dataType:'json' }); @@ -496,8 +502,9 @@ $(document).ready(function() }, email:"email", return_policy: "required", - stock_location:"required" - + stock_location: { + stock_location: true + } }, messages: { @@ -510,9 +517,7 @@ $(document).ready(function() number:"lang->line('config_default_tax_rate_number'); ?>" }, email: "lang->line('common_email_invalid_format'); ?>", - return_policy:"lang->line('config_return_policy_required'); ?>", - stock_location:"lang->line('config_stock_location_required'); ?>" - + return_policy:"lang->line('config_return_policy_required'); ?>" } }); }); diff --git a/application/views/partial/stock_locations.php b/application/views/partial/stock_locations.php new file mode 100644 index 000000000..8706c9ad8 --- /dev/null +++ b/application/views/partial/stock_locations.php @@ -0,0 +1,20 @@ +
+ + $location_data ) { ?> + + + + + +
visibility \ No newline at end of file From f497ac54f11c93438e90d2ddbeb7220fabcb6c57 Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Tue, 27 Jan 2015 23:27:43 +0100 Subject: [PATCH 12/14] Review stock location management in config screen (merged old refactor branch) Remove some obsolete labels from tranlations csv's --- application/language/en/config_lang.php | 1 + application/language/en/sales_lang.php | 5 +--- application/language/es/config_lang.php | 1 + application/language/es/sales_lang.php | 7 ++---- application/language/fr/config_lang.php | 1 + application/language/fr/sales_lang.php | 5 +--- application/language/id/config_lang.php | 1 + application/language/id/sales_lang.php | 3 --- application/language/nl-BE/config_lang.php | 5 ++-- application/language/nl-BE/sales_lang.php | 15 +++++------- application/language/ru/config_lang.php | 1 + application/language/ru/sales_lang.php | 3 --- application/language/th/config_lang.php | 1 + application/language/th/sales_lang.php | 3 --- application/language/tr/config_lang.php | 1 + application/language/tr/sales_lang.php | 3 --- application/language/zh/config_lang.php | 1 + application/language/zh/sales_lang.php | 3 --- application/views/config.php | 23 +++++++++---------- application/views/partial/stock_locations.php | 2 +- translations/config_lang.csv | 5 ++-- translations/sales_lang.csv | 17 ++++++-------- 22 files changed, 43 insertions(+), 64 deletions(-) diff --git a/application/language/en/config_lang.php b/application/language/en/config_lang.php index 64d54f030..8549e3b8d 100644 --- a/application/language/en/config_lang.php +++ b/application/language/en/config_lang.php @@ -36,6 +36,7 @@ $lang["config_sales_invoice_format"] = "Sales Invoice Format"; $lang["config_saved_successfully"] = "Configuration saved successfully"; $lang["config_saved_unsuccessfully"] = "Configuration saved unsuccessfully"; $lang["config_stock_location"] = "Stock location"; +$lang["config_stock_location_duplicate"] = "Please use an unique location name"; $lang["config_stock_location_required"] = "Stock location number is a required field"; $lang["config_tax_included"] = "Tax Included"; $lang["config_timezone"] = "Timezone"; diff --git a/application/language/en/sales_lang.php b/application/language/en/sales_lang.php index 853fe66fe..87afbac18 100644 --- a/application/language/en/sales_lang.php +++ b/application/language/en/sales_lang.php @@ -5,7 +5,6 @@ $lang["sales_amount_due"] = "Amount Due"; $lang["sales_amount_tendered"] = "Amount Tendered"; $lang["sales_basic_information"] = "Sale information"; $lang["sales_cancel_sale"] = "Cancel Sale"; -$lang["sales_cannot_be_deleted"] = "Sale(s) could not be deleted"; $lang["sales_cash"] = "Cash"; $lang["sales_change_due"] = "Change Due"; $lang["sales_check"] = "Check"; @@ -27,7 +26,6 @@ $lang["sales_delete_successful"] = "You have successfully deleted a sale"; $lang["sales_delete_unsuccessful"] = "You have unsuccessfully deleted a sale"; $lang["sales_description_abbrv"] = "Desc"; $lang["sales_discount"] = "Disc %"; -$lang["sales_discount_included"] = ""; $lang["sales_discount_short"] = "%"; $lang["sales_edit"] = "Edit"; $lang["sales_edit_item"] = "Edit Item"; @@ -43,7 +41,6 @@ $lang["sales_id"] = "Sale ID"; $lang["sales_invoice_number"] = "Invoice #"; $lang["sales_invoice_number_duplicate"] = "Please enter an unique invoice number"; $lang["sales_item_insufficient_of_stock"] = "Item is Insufficient of Stock"; -$lang["sales_item_insufficient_of_stockfi"] = ""; $lang["sales_item_name"] = "Item Name"; $lang["sales_item_number"] = "Item #"; $lang["sales_item_out_of_stock"] = "Item is Out of Stock"; @@ -87,7 +84,7 @@ $lang["sales_tax_percent"] = "Tax %"; $lang["sales_total"] = "Total"; $lang["sales_transaction_failed"] = "Sales Transaction Failed"; $lang["sales_unable_to_add_item"] = "Unable to add item to sale"; -$lang["sales_unsuccessfully_deleted"] = ""; +$lang["sales_unsuccessfully_deleted"] = "Sale(s) could not be deleted"; $lang["sales_unsuccessfully_updated"] = "Sale unsuccessfully updated"; $lang["sales_unsuspend"] = "Unsuspend"; $lang["sales_unsuspend_and_delete"] = ""; diff --git a/application/language/es/config_lang.php b/application/language/es/config_lang.php index cf7bbf477..11d27728a 100644 --- a/application/language/es/config_lang.php +++ b/application/language/es/config_lang.php @@ -36,6 +36,7 @@ $lang["config_sales_invoice_format"] = ""; $lang["config_saved_successfully"] = "Configuración guardada satisfactoriamente"; $lang["config_saved_unsuccessfully"] = "Configuración no guardada"; $lang["config_stock_location"] = ""; +$lang["config_stock_location_duplicate"] = ""; $lang["config_stock_location_required"] = ""; $lang["config_tax_included"] = "Impuestos incluidos"; $lang["config_timezone"] = "Zona Horaria"; diff --git a/application/language/es/sales_lang.php b/application/language/es/sales_lang.php index ad78afa02..390144889 100644 --- a/application/language/es/sales_lang.php +++ b/application/language/es/sales_lang.php @@ -5,7 +5,6 @@ $lang["sales_amount_due"] = "Debe"; $lang["sales_amount_tendered"] = "Cantidad Recibida"; $lang["sales_basic_information"] = "información sobre las entradas"; $lang["sales_cancel_sale"] = "Cancelar Venta"; -$lang["sales_cannot_be_deleted"] = ""; $lang["sales_cash"] = "Efectivo"; $lang["sales_change_due"] = "Cambio"; $lang["sales_check"] = "Cheque"; @@ -27,7 +26,6 @@ $lang["sales_delete_successful"] = "Has borrado satisfactoriamente una venta"; $lang["sales_delete_unsuccessful"] = "No he podido borrar la venta satisfactoriamente"; $lang["sales_description_abbrv"] = "Desc"; $lang["sales_discount"] = "Desc %"; -$lang["sales_discount_included"] = ""; $lang["sales_discount_short"] = "%"; $lang["sales_edit"] = "Editar"; $lang["sales_edit_item"] = "Editar Artículo"; @@ -40,10 +38,9 @@ $lang["sales_find_or_scan_item_or_receipt"] = "Encontrar/Escanear Artículo o En $lang["sales_giftcard"] = "Tarjeta de Regalo"; $lang["sales_giftcard_number"] = "Número de Tarjeta de Regalo"; $lang["sales_id"] = "ID de Venta"; -$lang["sales_invoice_number"] = ""; -$lang["sales_invoice_number_duplicate"] = ""; +$lang["sales_invoice_number"] = "Invoice #"; +$lang["sales_invoice_number_duplicate"] = "Please enter an unique invoice number"; $lang["sales_item_insufficient_of_stock"] = "Hay un número insuficiente de Artículos en existencia"; -$lang["sales_item_insufficient_of_stockfi"] = ""; $lang["sales_item_name"] = "Nombre del Artículo"; $lang["sales_item_number"] = "UPC/EAN/ISBN"; $lang["sales_item_out_of_stock"] = "El artículo está agotado"; diff --git a/application/language/fr/config_lang.php b/application/language/fr/config_lang.php index 94c80ac87..0e8999538 100644 --- a/application/language/fr/config_lang.php +++ b/application/language/fr/config_lang.php @@ -36,6 +36,7 @@ $lang["config_sales_invoice_format"] = ""; $lang["config_saved_successfully"] = "Configuration sauvegardée"; $lang["config_saved_unsuccessfully"] = "Échec de sauvegarde de configuration"; $lang["config_stock_location"] = ""; +$lang["config_stock_location_duplicate"] = ""; $lang["config_stock_location_required"] = ""; $lang["config_tax_included"] = ""; $lang["config_timezone"] = "Fuseau Horaire"; diff --git a/application/language/fr/sales_lang.php b/application/language/fr/sales_lang.php index 7faac9b05..27ea4f1ea 100644 --- a/application/language/fr/sales_lang.php +++ b/application/language/fr/sales_lang.php @@ -5,7 +5,6 @@ $lang["sales_amount_due"] = "Somme Due"; $lang["sales_amount_tendered"] = "Somme"; $lang["sales_basic_information"] = "Information de Vente"; $lang["sales_cancel_sale"] = "Annuler la Vente"; -$lang["sales_cannot_be_deleted"] = ""; $lang["sales_cash"] = "Cash"; $lang["sales_change_due"] = "Reste"; $lang["sales_check"] = "Cheque"; @@ -27,7 +26,6 @@ $lang["sales_delete_successful"] = "Suppréssion réussie"; $lang["sales_delete_unsuccessful"] = "Échec de suppression"; $lang["sales_description_abbrv"] = "Desc"; $lang["sales_discount"] = "% Remise"; -$lang["sales_discount_included"] = ""; $lang["sales_discount_short"] = "%"; $lang["sales_edit"] = "Éditer"; $lang["sales_edit_item"] = "Éditer Item"; @@ -40,10 +38,9 @@ $lang["sales_find_or_scan_item_or_receipt"] = "Trouver/Scanner Item OU Recu"; $lang["sales_giftcard"] = "Carte Cadeau"; $lang["sales_giftcard_number"] = "Numéro de Carte cadeau"; $lang["sales_id"] = "ID Vente"; -$lang["sales_invoice_number"] = ""; +$lang["sales_invoice_number"] = "Invoice #"; $lang["sales_invoice_number_duplicate"] = ""; $lang["sales_item_insufficient_of_stock"] = "Stock top faible"; -$lang["sales_item_insufficient_of_stockfi"] = ""; $lang["sales_item_name"] = "Nom"; $lang["sales_item_number"] = "# Item"; $lang["sales_item_out_of_stock"] = "Stock épuisé"; diff --git a/application/language/id/config_lang.php b/application/language/id/config_lang.php index 929bae8bc..d05225725 100644 --- a/application/language/id/config_lang.php +++ b/application/language/id/config_lang.php @@ -36,6 +36,7 @@ $lang["config_sales_invoice_format"] = ""; $lang["config_saved_successfully"] = "Konfigurasi berhasil disimpan"; $lang["config_saved_unsuccessfully"] = "Konfigurasi tidak berhasil disimpan"; $lang["config_stock_location"] = ""; +$lang["config_stock_location_duplicate"] = ""; $lang["config_stock_location_required"] = ""; $lang["config_tax_included"] = "Dikenakan Pajak"; $lang["config_timezone"] = "Zona Waktu"; diff --git a/application/language/id/sales_lang.php b/application/language/id/sales_lang.php index 306c82f48..6ac91256c 100644 --- a/application/language/id/sales_lang.php +++ b/application/language/id/sales_lang.php @@ -5,7 +5,6 @@ $lang["sales_amount_due"] = "Kembalian Uang"; $lang["sales_amount_tendered"] = "Nilai Pembayaran"; $lang["sales_basic_information"] = "Sale information"; $lang["sales_cancel_sale"] = "Batal Jual"; -$lang["sales_cannot_be_deleted"] = ""; $lang["sales_cash"] = "Tunai"; $lang["sales_change_due"] = "Kembalian Uang"; $lang["sales_check"] = "Cek"; @@ -27,7 +26,6 @@ $lang["sales_delete_successful"] = "Transaksi Penjualan berhasil dihapus"; $lang["sales_delete_unsuccessful"] = "Transaksi Penjualan tidak berhasil dihapus"; $lang["sales_description_abbrv"] = "Deskripsi"; $lang["sales_discount"] = "Diskon %"; -$lang["sales_discount_included"] = ""; $lang["sales_discount_short"] = "%"; $lang["sales_edit"] = "Ubah"; $lang["sales_edit_item"] = "Ubah Item"; @@ -43,7 +41,6 @@ $lang["sales_id"] = "ID Penjualan"; $lang["sales_invoice_number"] = ""; $lang["sales_invoice_number_duplicate"] = ""; $lang["sales_item_insufficient_of_stock"] = "Stok Item tidak mencukupi"; -$lang["sales_item_insufficient_of_stockfi"] = ""; $lang["sales_item_name"] = "Nama Item "; $lang["sales_item_number"] = "Item #"; $lang["sales_item_out_of_stock"] = "Item tidak ada stok"; diff --git a/application/language/nl-BE/config_lang.php b/application/language/nl-BE/config_lang.php index 445fc64fc..ae8bd7f6a 100755 --- a/application/language/nl-BE/config_lang.php +++ b/application/language/nl-BE/config_lang.php @@ -35,8 +35,9 @@ $lang["config_sales_invoice_enable"] = ""; $lang["config_sales_invoice_format"] = ""; $lang["config_saved_successfully"] = "Configuratie werd bewaard"; $lang["config_saved_unsuccessfully"] = "Configuratie kon niet worden bewaard"; -$lang["config_stock_location"] = ""; -$lang["config_stock_location_required"] = ""; +$lang["config_stock_location"] = "Stock locatie"; +$lang["config_stock_location_duplicate"] = "Vul een unieke naam in"; +$lang["config_stock_location_required"] = "Naam van de stock locatie is een verplicht veld"; $lang["config_tax_included"] = "VAT Ingebgrepen"; $lang["config_timezone"] = "Tijdzone"; $lang["config_website"] = "Website"; diff --git a/application/language/nl-BE/sales_lang.php b/application/language/nl-BE/sales_lang.php index 5568c344e..247e8f43e 100755 --- a/application/language/nl-BE/sales_lang.php +++ b/application/language/nl-BE/sales_lang.php @@ -5,7 +5,6 @@ $lang["sales_amount_due"] = "Te betalen"; $lang["sales_amount_tendered"] = "Ontvangen bedrag"; $lang["sales_basic_information"] = "Ticket informatie"; $lang["sales_cancel_sale"] = "Annuleer"; -$lang["sales_cannot_be_deleted"] = ""; $lang["sales_cash"] = "Contant"; $lang["sales_change_due"] = "Wisselgeld terug"; $lang["sales_check"] = "Waardebon"; @@ -27,7 +26,6 @@ $lang["sales_delete_successful"] = "De geselecteerde aanko(o)p(en) werden verwij $lang["sales_delete_unsuccessful"] = "De geselecteerde aankopen konden niet worden verwijderd."; $lang["sales_description_abbrv"] = "Omschr."; $lang["sales_discount"] = "%"; -$lang["sales_discount_included"] = ""; $lang["sales_discount_short"] = "%"; $lang["sales_edit"] = "Bewerk"; $lang["sales_edit_item"] = "Bewaar"; @@ -41,9 +39,8 @@ $lang["sales_giftcard"] = "Cadeaubon"; $lang["sales_giftcard_number"] = "Cadeaubon nummer"; $lang["sales_id"] = "Nummer Verkoop "; $lang["sales_invoice_number"] = ""; -$lang["sales_invoice_number_duplicate"] = ""; -$lang["sales_item_insufficient_of_stock"] = ""; -$lang["sales_item_insufficient_of_stockfi"] = "Product is niet meer in voorraad"; +$lang["sales_invoice_number_duplicate"] = "Vul een unieke nummer in"; +$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"; @@ -53,7 +50,7 @@ $lang["sales_must_enter_numeric_giftcard"] = "Er moet een geldige code worden in $lang["sales_new_customer"] = "Nieuwe klant"; $lang["sales_new_item"] = "Nieuw Product"; $lang["sales_no_items_in_cart"] = "Er zijn geen aankopen geselecteerd"; -$lang["sales_one_or_multiple"] = ""; +$lang["sales_one_or_multiple"] = "aankopen verwijderd"; $lang["sales_payment"] = "Betaalmethode"; $lang["sales_payment_amount"] = "Bedrag"; $lang["sales_payment_not_cover_total"] = "Betaalde hoeveelheid is onvoldoende"; @@ -74,9 +71,9 @@ $lang["sales_select_customer"] = "Selecteer Klant (Optioneel)"; $lang["sales_serial"] = "Nummer"; $lang["sales_start_typing_customer_name"] = "Typ naam klant..."; $lang["sales_start_typing_item_name"] = "Typ naam product of barcode..."; -$lang["sales_stock_location"] = ""; +$lang["sales_stock_location"] = "Stock locatie"; $lang["sales_sub_total"] = "Subtotaal excl. VAT"; -$lang["sales_successfully_deleted"] = ""; +$lang["sales_successfully_deleted"] = "Uw aankoop werd verwijded"; $lang["sales_successfully_suspended_sale"] = "Uw aankoop werd met sucess bewaard"; $lang["sales_successfully_updated"] = "Wijzigingen bewaard voor ticket"; $lang["sales_suspend_sale"] = "Bewaar aankoop"; @@ -87,7 +84,7 @@ $lang["sales_tax_percent"] = "VAT %"; $lang["sales_total"] = "Totaal"; $lang["sales_transaction_failed"] = "Transactie mislukt"; $lang["sales_unable_to_add_item"] = "Onmogelijk om product toe te voegen"; -$lang["sales_unsuccessfully_deleted"] = ""; +$lang["sales_unsuccessfully_deleted"] = "De aankoop kon niet verwijderd worden"; $lang["sales_unsuccessfully_updated"] = "Fout bij het bewaren van ticket"; $lang["sales_unsuspend"] = "Hervat"; $lang["sales_unsuspend_and_delete"] = ""; diff --git a/application/language/ru/config_lang.php b/application/language/ru/config_lang.php index b6a962827..9c0a93c88 100644 --- a/application/language/ru/config_lang.php +++ b/application/language/ru/config_lang.php @@ -36,6 +36,7 @@ $lang["config_sales_invoice_format"] = ""; $lang["config_saved_successfully"] = "Конфигурация успешно сохранена"; $lang["config_saved_unsuccessfully"] = "Конфигурация сохраненная безуспешно"; $lang["config_stock_location"] = ""; +$lang["config_stock_location_duplicate"] = ""; $lang["config_stock_location_required"] = ""; $lang["config_tax_included"] = "Tax Included"; $lang["config_timezone"] = "Часовой пояс"; diff --git a/application/language/ru/sales_lang.php b/application/language/ru/sales_lang.php index 08ac12d58..5edf8c28a 100644 --- a/application/language/ru/sales_lang.php +++ b/application/language/ru/sales_lang.php @@ -5,7 +5,6 @@ $lang["sales_amount_due"] = "Amount Due"; $lang["sales_amount_tendered"] = "предложенная сумма"; $lang["sales_basic_information"] = "информацию о билетах"; $lang["sales_cancel_sale"] = "Отменить продажу"; -$lang["sales_cannot_be_deleted"] = ""; $lang["sales_cash"] = "наличные деньги"; $lang["sales_change_due"] = "сдача должное"; $lang["sales_check"] = "банковский чек"; @@ -27,7 +26,6 @@ $lang["sales_delete_successful"] = "Вы успешно удален прода $lang["sales_delete_unsuccessful"] = "Вы безуспешно удален продаже"; $lang["sales_description_abbrv"] = "описание"; $lang["sales_discount"] = "скидка %"; -$lang["sales_discount_included"] = ""; $lang["sales_discount_short"] = "%"; $lang["sales_edit"] = "редактировать"; $lang["sales_edit_item"] = "Редактировать Товар"; @@ -43,7 +41,6 @@ $lang["sales_id"] = "Номер Продажы"; $lang["sales_invoice_number"] = ""; $lang["sales_invoice_number_duplicate"] = ""; $lang["sales_item_insufficient_of_stock"] = "Товар недостаточно на складе"; -$lang["sales_item_insufficient_of_stockfi"] = ""; $lang["sales_item_name"] = "Название товара"; $lang["sales_item_number"] = "Номер товара"; $lang["sales_item_out_of_stock"] = "Товар распродано"; diff --git a/application/language/th/config_lang.php b/application/language/th/config_lang.php index c04d37620..bb9376e3f 100644 --- a/application/language/th/config_lang.php +++ b/application/language/th/config_lang.php @@ -36,6 +36,7 @@ $lang["config_sales_invoice_format"] = "รหัสใบเสร็จ"; $lang["config_saved_successfully"] = "องค์ประกอบร้านค้าบันทึกเรียบร้อย"; $lang["config_saved_unsuccessfully"] = "องค์ประกอบร้านค้าบันทึกล้มเหลว"; $lang["config_stock_location"] = "สถานที่เก็บ"; +$lang["config_stock_location_duplicate"] = ""; $lang["config_stock_location_required"] = "จำเป็นต้องระบุสถานที่เก็บ"; $lang["config_tax_included"] = "รวมภาษีแล้ว"; $lang["config_timezone"] = "โซนเวลา"; diff --git a/application/language/th/sales_lang.php b/application/language/th/sales_lang.php index 0b24472b9..c1ae9d1ab 100644 --- a/application/language/th/sales_lang.php +++ b/application/language/th/sales_lang.php @@ -5,7 +5,6 @@ $lang["sales_amount_due"] = ""; $lang["sales_amount_tendered"] = "จำนวนประมูล"; $lang["sales_basic_information"] = ""; $lang["sales_cancel_sale"] = "ยกเลิกการขาย"; -$lang["sales_cannot_be_deleted"] = ""; $lang["sales_cash"] = "เงินสด"; $lang["sales_change_due"] = "เงินทอน"; $lang["sales_check"] = "เช็ก"; @@ -27,7 +26,6 @@ $lang["sales_delete_successful"] = "คุณลบการขายสำเ $lang["sales_delete_unsuccessful"] = "คุณลบการขายไม่สำเร็จ"; $lang["sales_description_abbrv"] = "Desc"; $lang["sales_discount"] = "ส่วนลด %"; -$lang["sales_discount_included"] = ""; $lang["sales_discount_short"] = ""; $lang["sales_edit"] = "แก้ไข"; $lang["sales_edit_item"] = "แก้ไขสินค้า"; @@ -43,7 +41,6 @@ $lang["sales_id"] = "เลขที่ขาย"; $lang["sales_invoice_number"] = ""; $lang["sales_invoice_number_duplicate"] = ""; $lang["sales_item_insufficient_of_stock"] = "จำนวนสินค้าไม่เพียงพอ"; -$lang["sales_item_insufficient_of_stockfi"] = ""; $lang["sales_item_name"] = "ชื่อสินค้า"; $lang["sales_item_number"] = "สินค้า #"; $lang["sales_item_out_of_stock"] = "สินค้าจำหน่ายหมด"; diff --git a/application/language/tr/config_lang.php b/application/language/tr/config_lang.php index a44336fc8..4caf3af3b 100644 --- a/application/language/tr/config_lang.php +++ b/application/language/tr/config_lang.php @@ -36,6 +36,7 @@ $lang["config_sales_invoice_format"] = ""; $lang["config_saved_successfully"] = "Yapılandırma kaydedildi"; $lang["config_saved_unsuccessfully"] = "Yapılandırma kaydedilemedi"; $lang["config_stock_location"] = "Mağaza Yeri"; +$lang["config_stock_location_duplicate"] = ""; $lang["config_stock_location_required"] = "Mağaza Yeri numarası zorunlu alandır"; $lang["config_tax_included"] = ""; $lang["config_timezone"] = "Saat Dilimi"; diff --git a/application/language/tr/sales_lang.php b/application/language/tr/sales_lang.php index ecf7ad06b..64957bf9b 100644 --- a/application/language/tr/sales_lang.php +++ b/application/language/tr/sales_lang.php @@ -5,7 +5,6 @@ $lang["sales_amount_due"] = "Kalan Ödeme"; $lang["sales_amount_tendered"] = "Ödenen Tutar"; $lang["sales_basic_information"] = "Satış bilgisi"; $lang["sales_cancel_sale"] = "İptal Et"; -$lang["sales_cannot_be_deleted"] = ""; $lang["sales_cash"] = "Nakit"; $lang["sales_change_due"] = "Para Üstü"; $lang["sales_check"] = "Çek"; @@ -27,7 +26,6 @@ $lang["sales_delete_successful"] = "Satışı sildiniz"; $lang["sales_delete_unsuccessful"] = "Satışı silemediniz"; $lang["sales_description_abbrv"] = "Tanım"; $lang["sales_discount"] = "İndirim %"; -$lang["sales_discount_included"] = "% İndirim"; $lang["sales_discount_short"] = "%"; $lang["sales_edit"] = "Düzenle"; $lang["sales_edit_item"] = "Düzenle"; @@ -43,7 +41,6 @@ $lang["sales_id"] = "Satış No"; $lang["sales_invoice_number"] = ""; $lang["sales_invoice_number_duplicate"] = ""; $lang["sales_item_insufficient_of_stock"] = "Ürün Stoğu Yetersiz"; -$lang["sales_item_insufficient_of_stockfi"] = ""; $lang["sales_item_name"] = "Ürün Adı"; $lang["sales_item_number"] = "Ürün No"; $lang["sales_item_out_of_stock"] = "Ürün Stokta Yok"; diff --git a/application/language/zh/config_lang.php b/application/language/zh/config_lang.php index e3a95e987..8074e2492 100755 --- a/application/language/zh/config_lang.php +++ b/application/language/zh/config_lang.php @@ -36,6 +36,7 @@ $lang["config_sales_invoice_format"] = ""; $lang["config_saved_successfully"] = "組態設置儲存成功"; $lang["config_saved_unsuccessfully"] = "組態設置儲存失敗"; $lang["config_stock_location"] = ""; +$lang["config_stock_location_duplicate"] = ""; $lang["config_stock_location_required"] = ""; $lang["config_tax_included"] = "Tax Included"; $lang["config_timezone"] = "時區"; diff --git a/application/language/zh/sales_lang.php b/application/language/zh/sales_lang.php index da43a4869..2bbd1f6bf 100755 --- a/application/language/zh/sales_lang.php +++ b/application/language/zh/sales_lang.php @@ -5,7 +5,6 @@ $lang["sales_amount_due"] = "Amount Due"; $lang["sales_amount_tendered"] = "已收帳款"; $lang["sales_basic_information"] = "Sale information"; $lang["sales_cancel_sale"] = "取消銷售"; -$lang["sales_cannot_be_deleted"] = ""; $lang["sales_cash"] = "現金"; $lang["sales_change_due"] = "更改到期日"; $lang["sales_check"] = "支票"; @@ -27,7 +26,6 @@ $lang["sales_delete_successful"] = "您已成功刪除銷售資料"; $lang["sales_delete_unsuccessful"] = "銷售資料刪除失敗"; $lang["sales_description_abbrv"] = "倒序"; $lang["sales_discount"] = "折扣 %"; -$lang["sales_discount_included"] = ""; $lang["sales_discount_short"] = "%"; $lang["sales_edit"] = "編輯"; $lang["sales_edit_item"] = "編輯產品"; @@ -43,7 +41,6 @@ $lang["sales_id"] = "銷售編號"; $lang["sales_invoice_number"] = ""; $lang["sales_invoice_number_duplicate"] = ""; $lang["sales_item_insufficient_of_stock"] = "產品庫存不足"; -$lang["sales_item_insufficient_of_stockfi"] = ""; $lang["sales_item_name"] = "產品名稱"; $lang["sales_item_number"] = "產品 #"; $lang["sales_item_out_of_stock"] = "產品缺貨"; diff --git a/application/views/config.php b/application/views/config.php index 5484a689b..7319da59b 100644 --- a/application/views/config.php +++ b/application/views/config.php @@ -483,7 +483,7 @@ $(document).ready(function() var new_block = block.insertAfter($(this).parent()); var new_block_id = 'stock_location_' + ++id; $(new_block).find('label').html("lang->line('config_stock_location'); ?> " + ++location_count + ": ").attr('for', new_block_id); - $(new_block).find('input').attr('id', new_block_id).attr('name', new_block_id).attr('class', new_block_id).val(''); + $(new_block).find('input').attr('id', new_block_id).attr('name', new_block_id).val(''); $('.add_stock_location', new_block).click(add_stock_location); $('.remove_stock_location', new_block).click(remove_stock_location); hide_show_remove(); @@ -501,20 +501,17 @@ $(document).ready(function() $('.remove_stock_location').click(remove_stock_location); }; init_add_remove_locations(); - + + var duplicate_found = false; // run validator once for all fields - var validator_name = $("input[name*='stock_location']:first").attr('class'); - $.validator.addMethod(validator_name , function(value, element) + $.validator.addMethod('stock_location' , function(value, element) { - var result = true; - var locations = {}; + var value_count = 0; $("input[name*='stock_location']").each(function() { - var content = $(this).val(); - result &= content && !locations[content]; - locations[content] = content; + value_count = $(this).val() == value ? value_count + 1 : value_count; }); - return result; - }, "lang->line('config_stock_location_required'); ?>"); + return value_count < 2; + }, "lang->line('config_stock_location_duplicate'); ?>"); $('#config_form').validate({ submitHandler:function(form) @@ -551,6 +548,7 @@ $(document).ready(function() email:"email", return_policy: "required", stock_location: { + required:true, stock_location: true } }, @@ -565,7 +563,8 @@ $(document).ready(function() number:"lang->line('config_default_tax_rate_number'); ?>" }, email: "lang->line('common_email_invalid_format'); ?>", - return_policy:"lang->line('config_return_policy_required'); ?>" + return_policy:"lang->line('config_return_policy_required'); ?>", + stock_location:"lang->line('config_stock_location_required'); ?>" } }); }); diff --git a/application/views/partial/stock_locations.php b/application/views/partial/stock_locations.php index 7217edf1d..6cbe4f292 100644 --- a/application/views/partial/stock_locations.php +++ b/application/views/partial/stock_locations.php @@ -9,7 +9,7 @@ 'stock_location_'.$location_id, 'id'=>'stock_location_'.$location_id, - 'class'=>'stock_location_'.$location_id, + 'class'=>'stock_location required', 'value'=>$location_name)); ?>
diff --git a/translations/config_lang.csv b/translations/config_lang.csv index f1274c2c5..93309eddb 100644 --- a/translations/config_lang.csv +++ b/translations/config_lang.csv @@ -34,8 +34,9 @@ config_sales_invoice_enable,,,Enable Sales Invoice#,,,,หมายเลขใ config_sales_invoice_format,,,Sales Invoice Format,,,,รหัสใบเสร็จ,, config_saved_successfully,Configuratie werd bewaard,Configuración guardada satisfactoriamente,Configuration saved successfully,Configuration sauvegardée,組態設置儲存成功,Конфигурация успешно сохранена,องค์ประกอบร้านค้าบันทึกเรียบร้อย,Yapılandırma kaydedildi,Konfigurasi berhasil disimpan config_saved_unsuccessfully,Configuratie kon niet worden bewaard,Configuración no guardada,Configuration saved unsuccessfully,Échec de sauvegarde de configuration,組態設置儲存失敗,Конфигурация сохраненная безуспешно,องค์ประกอบร้านค้าบันทึกล้มเหลว,Yapılandırma kaydedilemedi,Konfigurasi tidak berhasil disimpan -config_stock_location,,,Stock location,,,,สถานที่เก็บ,Mağaza Yeri, -config_stock_location_required,,,Stock location number is a required field,,,,จำเป็นต้องระบุสถานที่เก็บ,Mağaza Yeri numarası zorunlu alandır, +config_stock_location,Stock locatie,,Stock location,,,,สถานที่เก็บ,Mağaza Yeri, +config_stock_location_duplicate,Vul een unieke naam in,,Please use an unique location name,,,,,, +config_stock_location_required,Naam van de stock locatie is een verplicht veld,,Stock location number is a required field,,,,จำเป็นต้องระบุสถานที่เก็บ,Mağaza Yeri numarası zorunlu alandır, config_tax_included,VAT Ingebgrepen,Impuestos incluidos,Tax Included,,Tax Included,Tax Included,รวมภาษีแล้ว,,Dikenakan Pajak config_timezone,Tijdzone,Zona Horaria,Timezone,Fuseau Horaire,時區,Часовой пояс,โซนเวลา,Saat Dilimi,Zona Waktu config_website,Website,Sitio Web,Website,Site-web,網站,Веб-сайт,เว็บไซต์,Website,Situs Perusahaan diff --git a/translations/sales_lang.csv b/translations/sales_lang.csv index 3ab991a4d..6904a7dc5 100644 --- a/translations/sales_lang.csv +++ b/translations/sales_lang.csv @@ -4,7 +4,6 @@ sales_amount_due,Te betalen,Debe,Amount Due,Somme Due,Amount Due,Amount Due,,Kal sales_amount_tendered,Ontvangen bedrag,Cantidad Recibida,Amount Tendered,Somme,已收帳款,предложенная сумма,จำนวนประมูล,Ödenen Tutar,Nilai Pembayaran sales_basic_information,Ticket informatie,información sobre las entradas,Sale information,Information de Vente,Sale information,информацию о билетах,,Satış bilgisi,Sale information sales_cancel_sale,Annuleer,Cancelar Venta,Cancel Sale,Annuler la Vente,取消銷售,Отменить продажу,ยกเลิกการขาย,İptal Et,Batal Jual -sales_cannot_be_deleted,,,Sale(s) could not be deleted,,,,,, sales_cash,Contant,Efectivo,Cash,Cash,現金,наличные деньги,เงินสด,Nakit,Tunai sales_change_due,Wisselgeld terug,Cambio,Change Due,Reste,更改到期日,сдача должное,เงินทอน,Para Üstü,Kembalian Uang sales_check,Waardebon,Cheque,Check,Cheque,支票,банковский чек,เช็ก,Çek,Cek @@ -26,7 +25,6 @@ sales_delete_successful,De geselecteerde aanko(o)p(en) werden verwijderd,Has bor sales_delete_unsuccessful,De geselecteerde aankopen konden niet worden verwijderd.,No he podido borrar la venta satisfactoriamente,You have unsuccessfully deleted a sale,Échec de suppression,銷售資料刪除失敗,Вы безуспешно удален продаже,คุณลบการขายไม่สำเร็จ,Satışı silemediniz,Transaksi Penjualan tidak berhasil dihapus sales_description_abbrv,Omschr.,Desc,Desc,Desc,倒序,описание,Desc,Tanım,Deskripsi sales_discount,%,Desc %,Disc %,% Remise,折扣 %,скидка %,ส่วนลด %,İndirim %,Diskon % -sales_discount_included,,,,,,,,% İndirim, sales_discount_short,%,%,%,%,%,%,,%,% sales_edit,Bewerk,Editar,Edit,Éditer,編輯,редактировать,แก้ไข,Düzenle,Ubah sales_edit_item,Bewaar,Editar Artículo,Edit Item,Éditer Item,編輯產品,Редактировать Товар,แก้ไขสินค้า,Düzenle,Ubah Item @@ -39,10 +37,9 @@ sales_find_or_scan_item_or_receipt,Zoek/Scan Product of Ticket,Encontrar/Escanea sales_giftcard,Cadeaubon,Tarjeta de Regalo,Gift Card,Carte Cadeau,禮金券,Подарочная карта,Gift Card,Hediye Çeki,Gift Card sales_giftcard_number,Cadeaubon nummer,Número de Tarjeta de Regalo,Gift Card Number,Numéro de Carte cadeau,禮金券編號,Номер подарочных карт,เลขที่ Gift Card,Hediye Çeki No,Nomor Gift Card sales_id,Nummer Verkoop ,ID de Venta,Sale ID,ID Vente,銷售編號,Номер Продажы,เลขที่ขาย,Satış No,ID Penjualan -sales_invoice_number,,,Invoice #,,,,,, -sales_invoice_number_duplicate,,,Please enter an unique invoice number,,,,,, -sales_item_insufficient_of_stock,,Hay un número insuficiente de Artículos en existencia,Item is Insufficient of Stock,Stock top faible,產品庫存不足,Товар недостаточно на складе,จำนวนสินค้าไม่เพียงพอ,Ürün Stoğu Yetersiz,Stok Item tidak mencukupi -sales_item_insufficient_of_stockfi,Product is niet meer in voorraad,,,,,,,, +sales_invoice_number,,Invoice #,Invoice #,Invoice #,,,,, +sales_invoice_number_duplicate,Vul een unieke nummer in,Please enter an unique invoice number,Please enter an unique invoice number,,,,,, +sales_item_insufficient_of_stock,Product is niet meer in voorraad,Hay un número insuficiente de Artículos en existencia,Item is Insufficient of Stock,Stock top faible,產品庫存不足,Товар недостаточно на складе,จำนวนสินค้าไม่เพียงพอ,Ürün Stoğu Yetersiz,Stok Item tidak mencukupi sales_item_name,Naam,Nombre del Artículo,Item Name,Nom,產品名稱,Название товара,ชื่อสินค้า,Ürün Adı,Nama Item sales_item_number,Product #,UPC/EAN/ISBN,Item #,# Item,產品 #,Номер товара,สินค้า #,Ürün No,Item # sales_item_out_of_stock,Product is niet meer in voorraad,El artículo está agotado,Item is Out of Stock,Stock épuisé,產品缺貨,Товар распродано,สินค้าจำหน่ายหมด,Ürün Stokta Yok,Item tidak ada stok @@ -52,7 +49,7 @@ sales_must_enter_numeric_giftcard,Er moet een geldige code worden ingevuld voor sales_new_customer,Nieuwe klant,Cliente Nuevo,New Customer,Nouveau Client,新客戶,Новый клиент,ลูกค้าใหม่,Yeni Müşteri,Pelanggan Baru sales_new_item,Nieuw Product,Artículo Nuevo,New Item,Nouvel Élément,新增產品,Новый Товар,สินค้าใหม่,Yeni Ürün,Item Baru sales_no_items_in_cart,Er zijn geen aankopen geselecteerd,No hay artículos en el carrito,There are no items in the cart,Il n\'y a rien dans votre panier,購物車中沒有任何產品,Там нет товаров в корзине,ไม่พบสินค้าในตระกร้า,Sepette Ürün Yok,Tidak ada Item dalam Keranjang Belanja -sales_one_or_multiple,,,sale(s),,,,,, +sales_one_or_multiple,aankopen verwijderd,,sale(s),,,,,, sales_payment,Betaalmethode,Tipo de Pago,Payment Type,Type Paiement,付款方式,Вид оплаты,รูปแบบชำระเงิน,Ödeme Türü,Type Pembayaran sales_payment_amount,Bedrag,Cantidad,Amount,Somme,Amount,количество,,Tutar,Amount sales_payment_not_cover_total,Betaalde hoeveelheid is onvoldoende,La Cantidad Recibida no cubre el pago total,Payment Amount does not cover Total,Le Paiement ne couvre pas le Total,付款金額不足,оплачиваемая сумма недостаточно, ปริมาณการจ่ายที่ไม่เพียงพอกะยอดรวม,Ödemeler toplam tutarı karşılamıyor,Jumlah pembayaran tidak mencakup Total @@ -73,9 +70,9 @@ sales_select_customer,Selecteer Klant (Optioneel),Seleccionar Cliente (Opcional) sales_serial,Nummer,Serial,Serial,Serie,序號,серийный номер,Serial,Seri,Serial sales_start_typing_customer_name,Typ naam klant...,Empieza a escribir el cliente...,Start Typing customer\'s name...,Commencez à saisir le nom du client...,開始輸入客戶的名字,Начните печатать название клиента...,เริ่มต้นพิมพ์ชื่อลูกค้า...,Müşteri Adı...,Ketik Nama Pelanggan... sales_start_typing_item_name,Typ naam product of barcode...,Empieza a escribir o escanea el código de barras...,Start Typing item\'s name or scan barcode...,Commencez à saisir le nom de l\'item ou scannez le code-barre...,開始輸入產品名或掃描條碼...,Начните печатать название товара или сканировайте штрих-кода...,เริ่มต้นพิมพ์ชื่อสินค้า หรือ สแกนบาร์โค๊ด...,Ürün adı yazın yada barkod okutun...,Ketik Nama Barang atau Scan Barcode... -sales_stock_location,,,Stock location,,,,,Stok yeri, +sales_stock_location,Stock locatie,,Stock location,,,,,Stok yeri, sales_sub_total,Subtotaal excl. VAT,Subtotal,Sub Total,Sous-Total,小計,промежуточный итог,ยอดรวมหักภาษี ,Ara Toplam,Sub Total -sales_successfully_deleted,,La Venta ha sido borrada satisfactoriamente,You have successfully deleted,Vente supprimée,銷售資料成功刪除,продажи успешно удален,ลบการขายสมยูรณ์,Satış silindi,Transaksi Penjualan berhasil dihapus +sales_successfully_deleted,Uw aankoop werd verwijded,La Venta ha sido borrada satisfactoriamente,You have successfully deleted,Vente supprimée,銷售資料成功刪除,продажи успешно удален,ลบการขายสมยูรณ์,Satış silindi,Transaksi Penjualan berhasil dihapus sales_successfully_suspended_sale,Uw aankoop werd met sucess bewaard,La venta ha sido suspendida satisfactoriamente,Your sale has been successfully suspended,Vente suspendue,本銷售資料已經成功暫停,Ваши продажи успешно приостановлена,การขายของคุณถูกระงับเรียบร้อย,Satış askıya alındı,Penjualan anda telah berhasil ditangguhkan sales_successfully_updated,Wijzigingen bewaard voor ticket,La venta ha sido actualizada satisfactoriamente,Sale successfully updated,Vente éditée,銷售資料成功更新,Продажа успешно обновлен,อัพเดทการขายสมบูรณ์,Satış düzenlendi,Penjualan berhasil diperbarui sales_suspend_sale,Bewaar aankoop,Suspender Venta,Suspend Sale,Suspendre la Vente,暫停銷售,Приостановить продажи,ระงับการขายชั่วคราว,Satışı Askıya Al,Tangguhkan @@ -86,7 +83,7 @@ sales_tax_percent,VAT %,% de Impuesto,Tax %,% Taxe,稅率 %,Налоговые % sales_total,Totaal,Total,Total,Total,總計,сумма,ยอดรวม,Toplam,Total sales_transaction_failed,Transactie mislukt,La transacción de venta falló,Sales Transaction Failed,Échec de Transaction de vente,銷售交易失敗,Транзакция не удалось,การดำเนินการขายล้มเหลว,Satış işlemi hatası,Transaksi Penjualan Salah sales_unable_to_add_item,Onmogelijk om product toe te voegen,No se puede agregar el artículo a la venta,Unable to add item to sale,Erreur d\'ajout à la vente,無法增加出售產品,Невозможно добавить товар продажи,ไม่สามารถเพิ่มสินค้าได้,Ürün satışa eklenemedi,Tidak dapat menambahkan item dengan penjualan -sales_unsuccessfully_deleted,,Ha fallado la eliminación de la Venta,,Échec de suppression,銷售資料刪除失敗,продажи безуспешно удален,ลบการขายไม่สมยูรณ์,Satış silinemedi,Transaksi Penjualan tidak berhasil dihapus +sales_unsuccessfully_deleted,De aankoop kon niet verwijderd worden,Ha fallado la eliminación de la Venta,Sale(s) could not be deleted,Échec de suppression,銷售資料刪除失敗,продажи безуспешно удален,ลบการขายไม่สมยูรณ์,Satış silinemedi,Transaksi Penjualan tidak berhasil dihapus sales_unsuccessfully_updated,Fout bij het bewaren van ticket,Ha fallado la actualización de la venta,Sale unsuccessfully updated,Échec d\'édition,銷售資料更新失敗,Продажа безуспешно обновлен,อัพเดทการขายไม่สมบูรณ์,Satış düzenlenemedi,Penjualan tidak berhasil diperbarui sales_unsuspend,Hervat,Retomar,Unsuspend,Débloquer,取消暫停銷售,Разблокировать,ยกเลิกการระงับ,Satışa Al,Batal Penangguhan sales_unsuspend_and_delete,,Retomar y Borrar,,,取消暫停銷售並刪除,Разблокировать и удалить,ยกเลิกการระงับ และ ลบ,,Batalkan dan hapus penangguhan From 43f4e9e7901783c5c6e67238aafd15d15a9e7120 Mon Sep 17 00:00:00 2001 From: jekkos Date: Tue, 27 Jan 2015 23:40:50 +0100 Subject: [PATCH 13/14] Update README.md add bitcoin donation address to readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index d4417de21..3f3a260fb 100644 --- a/README.md +++ b/README.md @@ -20,3 +20,5 @@ If you like the project, and you are making money out of it on a daily basis, th [![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=MUN6AEG7NY6H8) + +Or send some coins to **19kwPpAwrUTxbNEs5D6cRR1k4mf5HNa4v2** From 08325c8cf785e4cecfeb8c2abde62d6b4554c1f1 Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Wed, 28 Jan 2015 18:31:50 +0100 Subject: [PATCH 14/14] Fix last stock_locations config quirks --- application/models/stock_locations.php | 51 +++++++++---------- application/views/config.php | 4 +- application/views/employees/form.php | 3 +- application/views/partial/stock_locations.php | 36 +++++++------ database/database.sql | 4 +- 5 files changed, 49 insertions(+), 49 deletions(-) diff --git a/application/models/stock_locations.php b/application/models/stock_locations.php index d8021b22f..2d3ab0220 100644 --- a/application/models/stock_locations.php +++ b/application/models/stock_locations.php @@ -80,31 +80,26 @@ class Stock_locations extends CI_Model { if (!$this->exists($location_id)) { - if($this->db->insert('stock_locations',$location_data)) - { - $location_name = $location_data['location_name']; - $this->db->trans_start(); - $location_data = array('location_name'=>$location_name,'deleted'=>0); - $this->db->insert('stock_locations',$location_data); - $location_id = $this->db->insert_id(); - - $this->_insert_new_permission('items', $location_id, $location_name); - $this->_insert_new_permission('sales', $location_id, $location_name); - $this->_insert_new_permission('receivings', $location_id, $location_name); + $location_name = $location_data['location_name']; + $this->db->trans_start(); + $location_data = array('location_name'=>$location_name,'deleted'=>0); + $this->db->insert('stock_locations',$location_data); + $location_id = $this->db->insert_id(); + + $this->_insert_new_permission('items', $location_id, $location_name); + $this->_insert_new_permission('sales', $location_id, $location_name); + $this->_insert_new_permission('receivings', $location_id, $location_name); - // insert quantities for existing items - $items = $this->Item->get_all(); - foreach ($items->result_array() as $item) - { - $quantity_data = array('item_id' => $item['item_id'], 'location_id' => $location_id, 'quantity' => 0); - $this->db->insert('item_quantities', $quantity_data); - } - $this->db->trans_complete(); - return TRUE; - } - return FALSE; - } + // insert quantities for existing items + $items = $this->Item->get_all(); + foreach ($items->result_array() as $item) + { + $quantity_data = array('item_id' => $item['item_id'], 'location_id' => $location_id, 'quantity' => 0); + $this->db->insert('item_quantities', $quantity_data); + } + $this->db->trans_complete(); + } else { $this->db->where('location_id', $location_id); @@ -125,8 +120,6 @@ class Stock_locations extends CI_Model { $grants_data = array('permission_id' => $permission_id, 'person_id' => $employee['person_id']); $this->db->insert('grants', $grants_data); - - $this->db->delete('permissions', array('permission_id' => 'items_'.$location_name)); } } @@ -136,8 +129,14 @@ class Stock_locations extends CI_Model */ function delete($location_id) { + $this->db->trans_start(); $this->db->where('location_id', $location_id); - return $this->db->update('stock_locations', array('deleted' => 1)); + $this->db->update('stock_locations', array('deleted' => 1)); + + // should delete permissions and grants as well? + $this->db->where('location_id', $location_id); + $this->db->delete('permissions'); + $this->db->trans_complete(); } diff --git a/application/views/config.php b/application/views/config.php index 7319da59b..df840fe1d 100644 --- a/application/views/config.php +++ b/application/views/config.php @@ -259,7 +259,9 @@ echo form_open('config/save/',array('id'=>'config_form')); -load->view('partial/stock_locations', array('stock_locations' => $stock_locations)); ?> +
+ load->view('partial/stock_locations', array('stock_locations' => $stock_locations)); ?> +
lang->line('config_sales_invoice_format').':', 'sales_invoice_format',array('class'=>'wide')); ?> diff --git a/application/views/employees/form.php b/application/views/employees/form.php index 7f38f6b62..5951b6548 100644 --- a/application/views/employees/form.php +++ b/application/views/employees/form.php @@ -161,7 +161,8 @@ $(document).ready(function() { equalTo: "#password" }, - email: "email", "grants[]" : { + email: "email", + "grants[]" : { required : function(element) { var checked = false; $("ul#permission_list > li > input:checkbox").each(function() diff --git a/application/views/partial/stock_locations.php b/application/views/partial/stock_locations.php index 6cbe4f292..7c8f741fc 100644 --- a/application/views/partial/stock_locations.php +++ b/application/views/partial/stock_locations.php @@ -1,19 +1,17 @@ -
- - $location_data ) { ?> - - - - -
\ No newline at end of file + + $location_data ) { ?> + + + + diff --git a/database/database.sql b/database/database.sql index 4783eaab4..67c53e136 100644 --- a/database/database.sql +++ b/database/database.sql @@ -737,8 +737,8 @@ ALTER TABLE `ospos_permissions` -- Constraints for table `ospos_grants` -- ALTER TABLE `ospos_grants` - ADD CONSTRAINT `ospos_grants_ibfk_1` foreign key (`permission_id`) references `ospos_permissions` (`permission_id`), - ADD CONSTRAINT `ospos_grants_ibfk_2` foreign key (`person_id`) references `ospos_employees` (`person_id`); + 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`
"; + if (strstr($this->config->item('barcode_labels'), 'company')) + { + echo $this->config->item('company'); + } + echo "

"; + if (strstr($this->config->item('barcode_labels'), 'price')) + { + echo to_currency($item['unit_price']); + } + if (strstr($this->config->item('barcode_labels'), 'name')) + { + echo ": " . $item['name']; + } + echo "