diff --git a/application/controllers/Config.php b/application/controllers/Config.php index 50664085a..4c40feea3 100644 --- a/application/controllers/Config.php +++ b/application/controllers/Config.php @@ -99,7 +99,8 @@ class Config extends Secure_Controller 'currency_decimals' => $this->input->post('currency_decimals'), 'tax_decimals' => $this->input->post('tax_decimals'), 'quantity_decimals' => $this->input->post('quantity_decimals'), - 'country_codes' => $this->input->post('country_codes') + 'country_codes' => $this->input->post('country_codes'), + 'payment_options_order' => $this->input->post('payment_options_order') ); $result = $this->Appconfig->batch_save($batch_save_data); diff --git a/application/language/de-CH/config_lang.php b/application/language/de-CH/config_lang.php index 3c2b20f78..b1ad3692f 100644 --- a/application/language/de-CH/config_lang.php +++ b/application/language/de-CH/config_lang.php @@ -104,6 +104,7 @@ $lang["config_msg_pwd_required"] = "SMS-API Password is a required field"; $lang["config_msg_src"] = "SMS-API Sender ID"; $lang["config_msg_src_required"] = "SMS-API Sender ID is a required field"; $lang["config_number_format"] = "Zahlenformat"; +$lang["config_payment_options_order"] = "Payment Options Order"; $lang["config_phone"] = "Telefon"; $lang["config_phone_required"] = "Telefon ist erforderlich"; $lang["config_print_bottom_margin"] = "Unterer Rand"; diff --git a/application/language/en/config_lang.php b/application/language/en/config_lang.php index 05fec3e1e..e1742030c 100644 --- a/application/language/en/config_lang.php +++ b/application/language/en/config_lang.php @@ -104,6 +104,7 @@ $lang["config_msg_pwd_required"] = "SMS-API Password is a required field"; $lang["config_msg_src"] = "SMS-API Sender ID"; $lang["config_msg_src_required"] = "SMS-API Sender ID is a required field"; $lang["config_number_format"] = "Number Format"; +$lang["config_payment_options_order"] = "Payment Options Order"; $lang["config_phone"] = "Company Phone"; $lang["config_phone_required"] = "Company phone is a required field"; $lang["config_print_bottom_margin"] = "Margin Bottom"; diff --git a/application/language/es/config_lang.php b/application/language/es/config_lang.php index 0cd39d0b6..e05a9d94d 100644 --- a/application/language/es/config_lang.php +++ b/application/language/es/config_lang.php @@ -104,6 +104,7 @@ $lang["config_msg_pwd_required"] = "SMS-API Password es un campo requerido"; $lang["config_msg_src"] = "SMS-API ID remitente"; $lang["config_msg_src_required"] = "SMS-API ID remitente es un campo requerido"; $lang["config_number_format"] = "Formato de número"; +$lang["config_payment_options_order"] = "Payment Options Order"; $lang["config_phone"] = "Teléfono del Comercio"; $lang["config_phone_required"] = "Teléfono del Comercio es requerido"; $lang["config_print_bottom_margin"] = "Margen Inferior"; diff --git a/application/language/fr/config_lang.php b/application/language/fr/config_lang.php index 41de04128..b1c656f1a 100644 --- a/application/language/fr/config_lang.php +++ b/application/language/fr/config_lang.php @@ -104,6 +104,7 @@ $lang["config_msg_pwd_required"] = "SMS-API Password is a required field"; $lang["config_msg_src"] = "SMS-API Sender ID"; $lang["config_msg_src_required"] = "SMS-API Sender ID is a required field"; $lang["config_number_format"] = "Number Format"; +$lang["config_payment_options_order"] = "Payment Options Order"; $lang["config_phone"] = "Téléphone"; $lang["config_phone_required"] = "Le numéro de téléphone est requis"; $lang["config_print_bottom_margin"] = "Margin Bottom"; diff --git a/application/language/hr-HR/config_lang.php b/application/language/hr-HR/config_lang.php index 119128f6a..6128e74a8 100644 --- a/application/language/hr-HR/config_lang.php +++ b/application/language/hr-HR/config_lang.php @@ -104,6 +104,7 @@ $lang["config_msg_pwd_required"] = "SMS-API Password is a required field"; $lang["config_msg_src"] = "SMS-API Sender ID"; $lang["config_msg_src_required"] = "SMS-API Sender ID is a required field"; $lang["config_number_format"] = "Format broja"; +$lang["config_payment_options_order"] = "Payment Options Order"; $lang["config_phone"] = "Telefon tvrtke"; $lang["config_phone_required"] = "Telefon tvrtke je potreban"; $lang["config_print_bottom_margin"] = "Doljnja margina"; diff --git a/application/language/hu-HU/config_lang.php b/application/language/hu-HU/config_lang.php index 9c3086338..0d78909e7 100644 --- a/application/language/hu-HU/config_lang.php +++ b/application/language/hu-HU/config_lang.php @@ -104,6 +104,7 @@ $lang["config_msg_pwd_required"] = "SMS-API Password is a required field"; $lang["config_msg_src"] = "SMS-API Sender ID"; $lang["config_msg_src_required"] = "SMS-API Sender ID is a required field"; $lang["config_number_format"] = "Szám formátum"; +$lang["config_payment_options_order"] = "Payment Options Order"; $lang["config_phone"] = "Cég telefonszáma"; $lang["config_phone_required"] = "Cég telefonszáma kötelező mező"; $lang["config_print_bottom_margin"] = "Alsó margó"; diff --git a/application/language/id/config_lang.php b/application/language/id/config_lang.php index c2730bcb9..d80e37646 100644 --- a/application/language/id/config_lang.php +++ b/application/language/id/config_lang.php @@ -104,6 +104,7 @@ $lang["config_msg_pwd_required"] = "SMS-API Password is a required field"; $lang["config_msg_src"] = "SMS-API Sender ID"; $lang["config_msg_src_required"] = "SMS-API Sender ID is a required field"; $lang["config_number_format"] = "Format Nomor"; +$lang["config_payment_options_order"] = "Payment Options Order"; $lang["config_phone"] = "Telepon Perusahaan"; $lang["config_phone_required"] = "Telepon Perusahaan wajib diisi"; $lang["config_print_bottom_margin"] = "Margin Bottom"; diff --git a/application/language/nl-BE/config_lang.php b/application/language/nl-BE/config_lang.php index 4e0940518..66c62401a 100755 --- a/application/language/nl-BE/config_lang.php +++ b/application/language/nl-BE/config_lang.php @@ -104,6 +104,7 @@ $lang["config_msg_pwd_required"] = "SMS-API Password is a required field"; $lang["config_msg_src"] = "SMS-API Sender ID"; $lang["config_msg_src_required"] = "SMS-API Sender ID is a required field"; $lang["config_number_format"] = "Number Format"; +$lang["config_payment_options_order"] = "Payment Options Order"; $lang["config_phone"] = "Telefoon"; $lang["config_phone_required"] = "De telefoonnummer van het bedrijf moet ingevuld worden"; $lang["config_print_bottom_margin"] = "Marge Beneden"; diff --git a/application/language/pt-BR/config_lang.php b/application/language/pt-BR/config_lang.php index 78c9fba86..3449eeebe 100644 --- a/application/language/pt-BR/config_lang.php +++ b/application/language/pt-BR/config_lang.php @@ -104,6 +104,7 @@ $lang["config_msg_pwd_required"] = "SMS-API Senha é um campo obrigatório"; $lang["config_msg_src"] = "SMS-API Remetente ID"; $lang["config_msg_src_required"] = "SMS-API Remetente ID é um campo obrigatório "; $lang["config_number_format"] = "Formato do número"; +$lang["config_payment_options_order"] = "Payment Options Order"; $lang["config_phone"] = "Telefone"; $lang["config_phone_required"] = "Telefone da Empresa é requerido"; $lang["config_print_bottom_margin"] = "Margem inferior"; diff --git a/application/language/ru/config_lang.php b/application/language/ru/config_lang.php index 958e0e809..52263a0ef 100644 --- a/application/language/ru/config_lang.php +++ b/application/language/ru/config_lang.php @@ -104,6 +104,7 @@ $lang["config_msg_pwd_required"] = "SMS-API Password is a required field"; $lang["config_msg_src"] = "SMS-API Sender ID"; $lang["config_msg_src_required"] = "SMS-API Sender ID is a required field"; $lang["config_number_format"] = "Number Format"; +$lang["config_payment_options_order"] = "Payment Options Order"; $lang["config_phone"] = "Телефон Компании"; $lang["config_phone_required"] = "Телефон Компании обязательный пробел"; $lang["config_print_bottom_margin"] = "Margin Bottom"; diff --git a/application/language/th/config_lang.php b/application/language/th/config_lang.php index 366344d11..0a6a5ce3e 100644 --- a/application/language/th/config_lang.php +++ b/application/language/th/config_lang.php @@ -104,6 +104,7 @@ $lang["config_msg_pwd_required"] = "SMS-API Password is a required field"; $lang["config_msg_src"] = "SMS-API Sender ID"; $lang["config_msg_src_required"] = "SMS-API Sender ID is a required field"; $lang["config_number_format"] = "รูปแบบตัวเลข"; +$lang["config_payment_options_order"] = "Payment Options Order"; $lang["config_phone"] = "เบอร์โทรศัพท์"; $lang["config_phone_required"] = "เบอร์โทรต้องกรอก"; $lang["config_print_bottom_margin"] = "Margin Bottom"; diff --git a/application/language/tr/config_lang.php b/application/language/tr/config_lang.php index b1a449c64..828efdb77 100644 --- a/application/language/tr/config_lang.php +++ b/application/language/tr/config_lang.php @@ -104,6 +104,7 @@ $lang["config_msg_pwd_required"] = "SMS-API Password is a required field"; $lang["config_msg_src"] = "SMS-API Sender ID"; $lang["config_msg_src_required"] = "SMS-API Sender ID is a required field"; $lang["config_number_format"] = "Number Format"; +$lang["config_payment_options_order"] = "Payment Options Order"; $lang["config_phone"] = "Şirket Telefonu"; $lang["config_phone_required"] = "Şirket Telefonu zorunlu alandır"; $lang["config_print_bottom_margin"] = "Margin Bottom"; diff --git a/application/language/zh/config_lang.php b/application/language/zh/config_lang.php index 80eeaac44..b5fdc501b 100755 --- a/application/language/zh/config_lang.php +++ b/application/language/zh/config_lang.php @@ -104,6 +104,7 @@ $lang["config_msg_pwd_required"] = "SMS-API Password is a required field"; $lang["config_msg_src"] = "SMS-API Sender ID"; $lang["config_msg_src_required"] = "SMS-API Sender ID is a required field"; $lang["config_number_format"] = "Number Format"; +$lang["config_payment_options_order"] = "Payment Options Order"; $lang["config_phone"] = "電話"; $lang["config_phone_required"] = "公司電話為必填"; $lang["config_print_bottom_margin"] = "Margin Bottom"; diff --git a/application/models/Sale.php b/application/models/Sale.php index 1a6d8f377..3e7d005f7 100644 --- a/application/models/Sale.php +++ b/application/models/Sale.php @@ -469,13 +469,29 @@ class Sale extends CI_Model public function get_payment_options($giftcard = TRUE) { - $payments = array( - $this->lang->line('sales_debit') => $this->lang->line('sales_debit'), - $this->lang->line('sales_credit') => $this->lang->line('sales_credit'), - $this->lang->line('sales_cash') => $this->lang->line('sales_cash'), - $this->lang->line('sales_check') => $this->lang->line('sales_check') - ); + $payments = array(); + if($this->config->item('payment_options_order') == 'debitcreditcash') + { + $payments[$this->lang->line('sales_debit')] = $this->lang->line('sales_debit'); + $payments[$this->lang->line('sales_credit')] = $this->lang->line('sales_credit'); + $payments[$this->lang->line('sales_cash')] = $this->lang->line('sales_cash'); + } + else if($this->config->item('payment_options_order') == 'debitcashcredit') + { + $payments[$this->lang->line('sales_debit')] = $this->lang->line('sales_debit'); + $payments[$this->lang->line('sales_cash')] = $this->lang->line('sales_cash'); + $payments[$this->lang->line('sales_credit')] = $this->lang->line('sales_credit'); + } + else // default: if($this->config->item('payment_options_order') == 'cashdebitcredit') + { + $payments[$this->lang->line('sales_cash')] = $this->lang->line('sales_cash'); + $payments[$this->lang->line('sales_debit')] = $this->lang->line('sales_debit'); + $payments[$this->lang->line('sales_credit')] = $this->lang->line('sales_credit'); + } + + $payments[$this->lang->line('sales_check')] = $this->lang->line('sales_check'); + if($giftcard) { $payments[$this->lang->line('sales_giftcard')] = $this->lang->line('sales_giftcard'); diff --git a/application/views/configs/locale_config.php b/application/views/configs/locale_config.php index 294f3cdd1..54b59fe21 100644 --- a/application/views/configs/locale_config.php +++ b/application/views/configs/locale_config.php @@ -92,6 +92,19 @@ +
+ lang->line('config_payment_options_order'), 'payment_options_order', array('class'=>'control-label col-xs-2')); ?> +
+ 'Cash/Debit/Credit', + 'debitcreditcash' => 'Debit/Credit/Cash', + 'debitcashcredit' => 'Debit/Cash/Credit' + ), + $this->config->item('payment_options_order'), array('class'=>'form-control input-sm')); + ?> +
+
+
lang->line('config_country_codes'), 'country_codes', array('class'=>'control-label col-xs-2')); ?>
diff --git a/database/2.4_to_3.0.sql b/database/2.4_to_3.0.sql index 260651c1b..2237cc0d3 100644 --- a/database/2.4_to_3.0.sql +++ b/database/2.4_to_3.0.sql @@ -39,8 +39,9 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('receipt_show_serialnumber', '1'), ('invoice_enable', '1'), ('country_codes', 'us'), - ('notify_horziontal_position', 'right'), - ('notify_vertical_position', 'top'); + ('notify_horizontal_position', 'right'), + ('notify_vertical_position', 'top'), + ('payment_options_order', 'cashdebitcredit'); DELETE FROM `ospos_app_config` WHERE `key` = 'use_invoice_template'; diff --git a/database/database.sql b/database/database.sql index 1b4c478c5..a0b85a7b4 100644 --- a/database/database.sql +++ b/database/database.sql @@ -69,8 +69,9 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('msg_uid', ''), ('msg_src', ''), ('msg_pwd', ''), -('notify_horziontal_position', 'right'), -('notify_vertical_position', 'top'); +('notify_horizontal_position', 'right'), +('notify_vertical_position', 'top'), +('payment_options_order', 'cashdebitcredit'); -- -------------------------------------------------------- diff --git a/database/migrate_phppos_dist.sql b/database/migrate_phppos_dist.sql index b315bcf28..46951d2a6 100644 --- a/database/migrate_phppos_dist.sql +++ b/database/migrate_phppos_dist.sql @@ -69,8 +69,9 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('msg_uid', ''), ('msg_src', ''), ('msg_pwd', ''), -('notify_horziontal_position', 'right'), -('notify_vertical_position', 'top'); +('notify_horizontal_position', 'right'), +('notify_vertical_position', 'top'), +('payment_options_order', 'cashdebitcredit'); -- -------------------------------------------------------- diff --git a/database/tables.sql b/database/tables.sql index 6cd8b5820..78a129b39 100644 --- a/database/tables.sql +++ b/database/tables.sql @@ -69,8 +69,9 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('msg_uid', ''), ('msg_src', ''), ('msg_pwd', ''), -('notify_horziontal_position', 'right'), -('notify_vertical_position', 'top'); +('notify_horizontal_position', 'right'), +('notify_vertical_position', 'top'), +('payment_options_order', 'cashdebitcredit'); -- -------------------------------------------------------- diff --git a/translations/config_lang.csv b/translations/config_lang.csv index a767aadbf..62de03b9d 100644 --- a/translations/config_lang.csv +++ b/translations/config_lang.csv @@ -103,6 +103,7 @@ config_msg_pwd_required,SMS-API Password is a required field,SMS-API Password is config_msg_src,SMS-API Sender ID,SMS-API Sender ID,SMS-API Sender ID,SMS-API ID remitente,SMS-API Sender ID,SMS-API Sender ID,SMS-API Sender ID,SMS-API Sender ID,SMS-API Sender ID,SMS-API Sender ID,SMS-API Sender ID,SMS-API Remetente ID,SMS-API Sender ID config_msg_src_required,SMS-API Sender ID is a required field,SMS-API Sender ID is a required field,SMS-API Sender ID is a required field,SMS-API ID remitente es un campo requerido,SMS-API Sender ID is a required field,SMS-API Sender ID is a required field,SMS-API Sender ID is a required field,SMS-API Sender ID is a required field,SMS-API Sender ID is a required field,SMS-API Sender ID is a required field,SMS-API Sender ID is a required field,SMS-API Remetente ID é um campo obrigatório ,SMS-API Sender ID is a required field config_number_format,Szám formátum,Zahlenformat,Number Format,Formato de número,Number Format,Number Format,Number Format,Number Format,รูปแบบตัวเลข,Number Format,Format Nomor,Formato do número,Format broja +config_payment_options_order,Payment Options Order,Payment Options Order,Payment Options Order,Payment Options Order,Payment Options Order,Payment Options Order,Payment Options Order,Payment Options Order,Payment Options Order,Payment Options Order,Payment Options Order,Payment Options Order,Payment Options Order config_phone,Cég telefonszáma,Telefon,Telefoon,Teléfono del Comercio,Company Phone,Téléphone,電話,Телефон Компании,เบอร์โทรศัพท์,Şirket Telefonu,Telepon Perusahaan,Telefone,Telefon tvrtke config_phone_required,Cég telefonszáma kötelező mező,Telefon ist erforderlich,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,Telefone da Empresa é requerido,Telefon tvrtke je potreban config_print_bottom_margin,Alsó margó,Unterer Rand,Marge Beneden,Margen Inferior,Margin Bottom,Margin Bottom,Margin Bottom,Margin Bottom,Margin Bottom,Margin Bottom,Margin Bottom,Margem inferior,Doljnja margina