Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customer Second Display #2482

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions application/controllers/Config.php
Expand Up @@ -286,6 +286,7 @@ public function save_general()
'gcaptcha_enable' => $this->input->post('gcaptcha_enable') != NULL,
'gcaptcha_secret_key' => $this->input->post('gcaptcha_secret_key'),
'gcaptcha_site_key' => $this->input->post('gcaptcha_site_key'),
'second_display_enabled' => $this->input->post('second_display_enabled') != NULL,
'suggestions_first_column' => $this->input->post('suggestions_first_column'),
'suggestions_second_column' => $this->input->post('suggestions_second_column'),
'suggestions_third_column' => $this->input->post('suggestions_third_column'),
Expand Down
105 changes: 105 additions & 0 deletions application/controllers/Sales.php
Expand Up @@ -55,6 +55,111 @@ public function manage()
}
}

public function second_display()
{
$data = array();
WebShells marked this conversation as resolved.
Show resolved Hide resolved
$sale_id = $this->session->userdata('sale_id');
if($sale_id == '')
{
$sale_id = -1;
$this->session->set_userdata('sale_id', -1);
}
$data['cart'] = $this->sale_lib->get_cart();
$customer_info = $this->_load_customer_data($this->sale_lib->get_customer(), $data, TRUE);
$data['modes'] = $this->sale_lib->get_register_mode_options();
$data['mode'] = $this->sale_lib->get_mode();
$data['empty_tables'] = $this->sale_lib->get_empty_tables();
$data['selected_table'] = $this->sale_lib->get_dinner_table();
$data['stock_locations'] = $this->Stock_location->get_allowed_locations('sales');
$data['stock_location'] = $this->sale_lib->get_sale_location();
$data['tax_exclusive_subtotal'] = $this->sale_lib->get_subtotal(TRUE, TRUE);
$tax_details = $this->tax_lib->get_taxes($data['cart']);
$data['taxes'] = $tax_details[0];
$data['discount'] = $this->sale_lib->get_discount();
$data['payments'] = $this->sale_lib->get_payments();
// sale_type (0=pos, 1=invoice, 2=work order, 3=quote, 4=return)
$sale_type = $this->sale_lib->get_sale_type();
// Returns 'subtotal', 'total', 'cash_total', 'payment_total', 'amount_due', 'cash_amount_due', 'payments_cover_total'
$totals = $this->sale_lib->get_totals($tax_details[0]);
$data['item_count'] = $totals['item_count'];
$data['total_units'] = $totals['total_units'];
$data['subtotal'] = $totals['subtotal'];
$data['total'] = $totals['total'];
$data['payments_total'] = $totals['payment_total'];
$data['payments_cover_total'] = $totals['payments_cover_total'];
$data['cash_rounding'] = $this->session->userdata('cash_rounding');
$data['prediscount_subtotal'] = $totals['prediscount_subtotal'];
$data['cash_total'] = $totals['cash_total'];
$data['non_cash_total'] = $totals['total'];
$data['cash_amount_due'] = $totals['cash_amount_due'];
$data['non_cash_amount_due'] = $totals['amount_due'];
if($data['cash_rounding'])
{
$data['total'] = $totals['cash_total'];
$data['amount_due'] = $totals['cash_amount_due'];
}
else
{
$data['total'] = $totals['total'];
$data['amount_due'] = $totals['amount_due'];
}
$data['amount_change'] = $data['amount_due'] * -1;
$data['comment'] = $this->sale_lib->get_comment();
$data['email_receipt'] = $this->sale_lib->is_email_receipt();
$data['selected_payment_type'] = $this->sale_lib->get_payment_type();
if($customer_info && $this->config->item('customer_reward_enable') == TRUE)
{
$data['payment_options'] = $this->Sale->get_payment_options(TRUE, TRUE);
}
else
{
$data['payment_options'] = $this->Sale->get_payment_options();
}
$data['items_module_allowed'] = $this->Employee->has_grant('items', $this->Employee->get_logged_in_employee_info()->person_id);
$invoice_format = $this->config->item('sales_invoice_format');
$data['invoice_format'] = $invoice_format;
$this->set_invoice_number($invoice_format);
$data['invoice_number'] = $invoice_format;
$data['invoice_number_enabled'] = $this->sale_lib->is_invoice_mode();
$data['print_after_sale'] = $this->sale_lib->is_print_after_sale();
$data['price_work_orders'] = $this->sale_lib->is_price_work_orders();
$data['pos_mode'] = $data['mode'] == 'sale' || $data['mode'] == 'return';
$data['quote_number'] = $this->sale_lib->get_quote_number();
$data['work_order_number'] = $this->sale_lib->get_work_order_number();
if($this->sale_lib->get_mode() == 'sale_invoice')
{
$data['mode_label'] = $this->lang->line('sales_invoice');
$data['customer_required'] = $this->lang->line('sales_customer_required');
}
elseif($this->sale_lib->get_mode() == 'sale_quote')
{
$data['mode_label'] = $this->lang->line('sales_quote');
$data['customer_required'] = $this->lang->line('sales_customer_required');
}
elseif($this->sale_lib->get_mode() == 'sale_work_order')
{
$data['mode_label'] = $this->lang->line('sales_work_order');
$data['customer_required'] = $this->lang->line('sales_customer_required');
}
elseif($this->sale_lib->get_mode() == 'return')
{
$data['mode_label'] = $this->lang->line('sales_return');
$data['customer_required'] = $this->lang->line('sales_customer_optional');
}
else
{
$data['mode_label'] = $this->lang->line('sales_receipt');
$data['customer_required'] = $this->lang->line('sales_customer_optional');
}
$data = $this->xss_clean($data);
$this->load->view('sales/second_display', $data);
}

public function reloadedMatrix()
{
$this->second_display();
}

public function get_row($row_id)
{
$sale_info = $this->Sale->get_info($row_id)->row();
Expand Down
1 change: 1 addition & 0 deletions application/language/ar-EG/config_lang.php
Expand Up @@ -278,3 +278,4 @@
$lang["config_website"] = "موقع الشركة";
$lang["config_work_order_enable"] = "تفعيل طلبات العمل";
$lang["config_work_order_format"] = "شكل طلبات العمل";
$lang["config_second_display"] = "Show Customer Display";
1 change: 1 addition & 0 deletions application/language/ar-EG/sales_lang.php
Expand Up @@ -174,3 +174,4 @@
$lang["sales_work_order_number_duplicate"] = "رقم طلب العمل يجب ان يكون فريد.";
$lang["sales_work_order_sent"] = "تم ارسال طلب العمل الى";
$lang["sales_work_order_unsent"] = "فشل في ارسال طلب العمل الى";
$lang["sales_second_display"] = "Second Display";
1 change: 1 addition & 0 deletions application/language/az-AZ/config_lang.php
Expand Up @@ -278,3 +278,4 @@
$lang["config_website"] = "Vebsayt";
$lang["config_work_order_enable"] = "İş Sifariş Dəstəyi";
$lang["config_work_order_format"] = "İş Sifarş Farmatı";
$lang["config_second_display"] = "Show Customer Display";
1 change: 1 addition & 0 deletions application/language/az-AZ/sales_lang.php
Expand Up @@ -173,3 +173,4 @@
$lang["sales_work_order_number_duplicate"] = "İş sifarişinin nömrəsi unikal olmalıdır.";
$lang["sales_work_order_sent"] = "İş sifarişi göndərildi";
$lang["sales_work_order_unsent"] = "İş Sifarişi göndərilməmişdi";
$lang["sales_second_display"] = "Second Display";
1 change: 1 addition & 0 deletions application/language/bg/config_lang.php
Expand Up @@ -279,3 +279,4 @@
$lang["config_website"] = "Website";
$lang["config_work_order_enable"] = "Work Order Support";
$lang["config_work_order_format"] = "Work Order Format";
$lang["config_second_display"] = "Show Customer Display";
1 change: 1 addition & 0 deletions application/language/bg/sales_lang.php
Expand Up @@ -174,3 +174,4 @@
$lang["sales_work_order_number_duplicate"] = "Номерът на работната поръчка трябва да е уникален.";
$lang["sales_work_order_sent"] = "Работната поръчка е изпратена до";
$lang["sales_work_order_unsent"] = "Работната поръчка не бе изпратена до";
$lang["sales_second_display"] = "Second Display";
1 change: 1 addition & 0 deletions application/language/cs/config_lang.php
Expand Up @@ -279,3 +279,4 @@
$lang["config_website"] = "";
$lang["config_work_order_enable"] = "";
$lang["config_work_order_format"] = "";
$lang["config_second_display"] = "Show Customer Display";
1 change: 1 addition & 0 deletions application/language/cs/sales_lang.php
Expand Up @@ -174,3 +174,4 @@
$lang["sales_work_order_number_duplicate"] = "";
$lang["sales_work_order_sent"] = "";
$lang["sales_work_order_unsent"] = "";
$lang["sales_second_display"] = "Second Display";
1 change: 1 addition & 0 deletions application/language/de-CH/config_lang.php
Expand Up @@ -279,3 +279,4 @@
$lang["config_website"] = "Website";
$lang["config_work_order_enable"] = "";
$lang["config_work_order_format"] = "";
$lang["config_second_display"] = "Show Customer Display";
1 change: 1 addition & 0 deletions application/language/de-CH/sales_lang.php
Expand Up @@ -174,3 +174,4 @@
$lang["sales_work_order_number_duplicate"] = "";
$lang["sales_work_order_sent"] = "";
$lang["sales_work_order_unsent"] = "";
$lang["sales_second_display"] = "Second Display";
1 change: 1 addition & 0 deletions application/language/de/config_lang.php
Expand Up @@ -279,3 +279,4 @@
$lang["config_website"] = "Website";
$lang["config_work_order_enable"] = "Unterstützung von Arbeitsaufträgen";
$lang["config_work_order_format"] = "Arbeitsauftragsformat";
$lang["config_second_display"] = "Show Customer Display";
1 change: 1 addition & 0 deletions application/language/de/sales_lang.php
Expand Up @@ -174,3 +174,4 @@
$lang["sales_work_order_number_duplicate"] = "Arbeitsauftragsnummer muss eindeutig sein.";
$lang["sales_work_order_sent"] = "Arbeitsauftrag gesendet an";
$lang["sales_work_order_unsent"] = "Der Arbeitsauftrag konnte nicht gesendet werden an";
$lang["sales_second_display"] = "Second Display";
1 change: 1 addition & 0 deletions application/language/el/config_lang.php
Expand Up @@ -279,3 +279,4 @@
$lang["config_website"] = "";
$lang["config_work_order_enable"] = "";
$lang["config_work_order_format"] = "";
$lang["config_second_display"] = "Show Customer Display";
1 change: 1 addition & 0 deletions application/language/el/sales_lang.php
Expand Up @@ -173,3 +173,4 @@
$lang["sales_work_order_number_duplicate"] = "Ο Αριθμός της Παραγγελίας Εργασίας πρέπει να είναι μοναδικός.";
$lang["sales_work_order_sent"] = "Εντολή Εργασίας απεστάλη σε";
$lang["sales_work_order_unsent"] = "Ανεπιτυχής αποστολή Εντολής Εργασίας";
$lang["sales_second_display"] = "Second Display";
1 change: 1 addition & 0 deletions application/language/en-GB/config_lang.php
Expand Up @@ -279,3 +279,4 @@
$lang["config_website"] = "Website";
$lang["config_work_order_enable"] = "Work Order Support";
$lang["config_work_order_format"] = "Work Order Format";
$lang["config_second_display"] = "Show Customer Display";
1 change: 1 addition & 0 deletions application/language/en-GB/sales_lang.php
Expand Up @@ -174,3 +174,4 @@
$lang["sales_work_order_number_duplicate"] = "Work Order Number must be unique";
$lang["sales_work_order_sent"] = "Work Order sent to";
$lang["sales_work_order_unsent"] = "Work Order failed to be sent to";
$lang["sales_second_display"] = "Second Display";
1 change: 1 addition & 0 deletions application/language/en-US/config_lang.php
Expand Up @@ -279,3 +279,4 @@
$lang["config_website"] = "Website";
$lang["config_work_order_enable"] = "Work Order Support";
$lang["config_work_order_format"] = "Work Order Format";
$lang["config_second_display"] = "Show Customer Display";
1 change: 1 addition & 0 deletions application/language/en-US/sales_lang.php
Expand Up @@ -174,3 +174,4 @@
$lang["sales_work_order_number_duplicate"] = "Work Order Number must be unique.";
$lang["sales_work_order_sent"] = "Work Order sent to";
$lang["sales_work_order_unsent"] = "Work Order failed to be sent to";
$lang["sales_second_display"] = "Second Display";
1 change: 1 addition & 0 deletions application/language/es/config_lang.php
Expand Up @@ -279,3 +279,4 @@
$lang["config_website"] = "Sitio Web";
$lang["config_work_order_enable"] = "Soporte Ordenes de Trabajo";
$lang["config_work_order_format"] = "Formato Ordenes de trabajo";
$lang["config_second_display"] = "Show Customer Display";
1 change: 1 addition & 0 deletions application/language/es/sales_lang.php
Expand Up @@ -173,3 +173,4 @@
$lang["sales_work_order_number_duplicate"] = "El numero de orden de trabajo debe ser unico.";
$lang["sales_work_order_sent"] = "Orden de trabajo enviada a";
$lang["sales_work_order_unsent"] = "Orden de trabajo fallida al enviar a";
$lang["sales_second_display"] = "Second Display";
1 change: 1 addition & 0 deletions application/language/es_MX/config_lang.php
Expand Up @@ -278,3 +278,4 @@
$lang["config_website"] = "Website";
$lang["config_work_order_enable"] = "Work Order Support";
$lang["config_work_order_format"] = "Work Order Format";
$lang["config_second_display"] = "Show Customer Display";
1 change: 1 addition & 0 deletions application/language/es_MX/sales_lang.php
Expand Up @@ -174,3 +174,4 @@
$lang["sales_work_order_number_duplicate"] = "";
$lang["sales_work_order_sent"] = "";
$lang["sales_work_order_unsent"] = "";
$lang["sales_second_display"] = "Second Display";
1 change: 1 addition & 0 deletions application/language/fr/config_lang.php
Expand Up @@ -279,3 +279,4 @@
$lang["config_website"] = "Site Internet";
$lang["config_work_order_enable"] = "Support de commande de travail";
$lang["config_work_order_format"] = "Format de bon de travail";
$lang["config_second_display"] = "Show Customer Display";
1 change: 1 addition & 0 deletions application/language/fr/sales_lang.php
Expand Up @@ -174,3 +174,4 @@
$lang["sales_work_order_number_duplicate"] = "Le numéro de bon de travail doit être unique.";
$lang["sales_work_order_sent"] = "Ordre de travail envoyé à";
$lang["sales_work_order_unsent"] = "L'ordre de travail n'a pas pu être envoyé à";
$lang["sales_second_display"] = "Second Display";
1 change: 1 addition & 0 deletions application/language/he/config_lang.php
Expand Up @@ -279,3 +279,4 @@
$lang["config_website"] = "אתר";
$lang["config_work_order_enable"] = "תמיכה בהזמנת עבודה";
$lang["config_work_order_format"] = "פורמט הזמנת עבודה";
$lang["config_second_display"] = "Show Customer Display";
1 change: 1 addition & 0 deletions application/language/he/sales_lang.php
Expand Up @@ -174,3 +174,4 @@
$lang["sales_work_order_number_duplicate"] = "מספר הזמנת עבודה חייב להיות ייחודי.";
$lang["sales_work_order_sent"] = "הזמנת עבודה נשלחה אל";
$lang["sales_work_order_unsent"] = "הזמנת עבודה לא נשלחה אל";
$lang["sales_second_display"] = "Second Display";
1 change: 1 addition & 0 deletions application/language/hr-HR/config_lang.php
Expand Up @@ -279,3 +279,4 @@
$lang["config_website"] = "web strana";
$lang["config_work_order_enable"] = "";
$lang["config_work_order_format"] = "";
$lang["config_second_display"] = "Show Customer Display";
1 change: 1 addition & 0 deletions application/language/hr-HR/sales_lang.php
Expand Up @@ -174,3 +174,4 @@
$lang["sales_work_order_number_duplicate"] = "";
$lang["sales_work_order_sent"] = "";
$lang["sales_work_order_unsent"] = "";
$lang["sales_second_display"] = "Second Display";
1 change: 1 addition & 0 deletions application/language/hu-HU/config_lang.php
Expand Up @@ -279,3 +279,4 @@
$lang["config_website"] = "Weboldal";
$lang["config_work_order_enable"] = "";
$lang["config_work_order_format"] = "";
$lang["config_second_display"] = "Show Customer Display";
1 change: 1 addition & 0 deletions application/language/hu-HU/sales_lang.php
Expand Up @@ -174,3 +174,4 @@
$lang["sales_work_order_number_duplicate"] = "";
$lang["sales_work_order_sent"] = "";
$lang["sales_work_order_unsent"] = "";
$lang["sales_second_display"] = "Second Display";
1 change: 1 addition & 0 deletions application/language/id/config_lang.php
Expand Up @@ -278,3 +278,4 @@
$lang["config_website"] = "Situs Perusahaan";
$lang["config_work_order_enable"] = "Dukungan Work Order";
$lang["config_work_order_format"] = "Format Work Order";
$lang["config_second_display"] = "Show Customer Display";
1 change: 1 addition & 0 deletions application/language/id/sales_lang.php
Expand Up @@ -173,3 +173,4 @@
$lang["sales_work_order_number_duplicate"] = "Nomor Perintah Kerja tidak boleh sama.";
$lang["sales_work_order_sent"] = "Perintah Kerja dikirim ke";
$lang["sales_work_order_unsent"] = "Perintah Kerja gagal dikirim ke";
$lang["sales_second_display"] = "Second Display";
1 change: 1 addition & 0 deletions application/language/it/config_lang.php
Expand Up @@ -279,3 +279,4 @@
$lang["config_website"] = "Sitoweb";
$lang["config_work_order_enable"] = "Supporto all'ordine (Work Order Support)";
$lang["config_work_order_format"] = "Formato ordine di lavoro/commessa";
$lang["config_second_display"] = "Show Customer Display";
1 change: 1 addition & 0 deletions application/language/it/sales_lang.php
Expand Up @@ -174,3 +174,4 @@
$lang["sales_work_order_number_duplicate"] = "Numero Ordine di Lavoro deve essere unico.";
$lang["sales_work_order_sent"] = "Ordine di lavoro inviato";
$lang["sales_work_order_unsent"] = "Ordine di Lavoro fallito da inviare a";
$lang["sales_second_display"] = "Second Display";
1 change: 1 addition & 0 deletions application/language/km/config_lang.php
Expand Up @@ -279,3 +279,4 @@
$lang["config_website"] = "";
$lang["config_work_order_enable"] = "";
$lang["config_work_order_format"] = "";
$lang["config_second_display"] = "Show Customer Display";
1 change: 1 addition & 0 deletions application/language/km/sales_lang.php
Expand Up @@ -174,3 +174,4 @@
$lang["sales_work_order_number_duplicate"] = "";
$lang["sales_work_order_sent"] = "";
$lang["sales_work_order_unsent"] = "";
$lang["sales_second_display"] = "Second Display";
1 change: 1 addition & 0 deletions application/language/lo/config_lang.php
Expand Up @@ -279,3 +279,4 @@
$lang["config_website"] = "Website";
$lang["config_work_order_enable"] = "Work Order Support";
$lang["config_work_order_format"] = "Work Order Format";
$lang["config_second_display"] = "Show Customer Display";
1 change: 1 addition & 0 deletions application/language/lo/sales_lang.php
Expand Up @@ -174,3 +174,4 @@
$lang["sales_work_order_number_duplicate"] = "Work Order Number must be unique.";
$lang["sales_work_order_sent"] = "Work Order sent to";
$lang["sales_work_order_unsent"] = "Work Order failed to be sent to";
$lang["sales_second_display"] = "Second Display";
1 change: 1 addition & 0 deletions application/language/ml/config_lang.php
Expand Up @@ -279,3 +279,4 @@
$lang["config_website"] = "";
$lang["config_work_order_enable"] = "";
$lang["config_work_order_format"] = "";
$lang["config_second_display"] = "Show Customer Display";
1 change: 1 addition & 0 deletions application/language/ml/sales_lang.php
Expand Up @@ -174,3 +174,4 @@
$lang["sales_work_order_number_duplicate"] = "";
$lang["sales_work_order_sent"] = "";
$lang["sales_work_order_unsent"] = "";
$lang["sales_second_display"] = "Second Display";
1 change: 1 addition & 0 deletions application/language/nl-BE/config_lang.php
Expand Up @@ -279,3 +279,4 @@
$lang["config_website"] = "Website";
$lang["config_work_order_enable"] = "Werk Order Ondersteuning";
$lang["config_work_order_format"] = "Werk Order Formaat";
$lang["config_second_display"] = "Show Customer Display";
1 change: 1 addition & 0 deletions application/language/nl-BE/sales_lang.php
Expand Up @@ -174,3 +174,4 @@
$lang["sales_work_order_number_duplicate"] = "Werkorder Nummer moet uniek zijn.";
$lang["sales_work_order_sent"] = "Werkorder verzonder naar";
$lang["sales_work_order_unsent"] = "Werkorder kon niet verzonden worden naar";
$lang["sales_second_display"] = "Second Display";
1 change: 1 addition & 0 deletions application/language/nl/config_lang.php
Expand Up @@ -279,3 +279,4 @@
$lang["config_website"] = "";
$lang["config_work_order_enable"] = "";
$lang["config_work_order_format"] = "";
$lang["config_second_display"] = "Show Customer Display";
1 change: 1 addition & 0 deletions application/language/nl/sales_lang.php
Expand Up @@ -174,3 +174,4 @@
$lang["sales_work_order_number_duplicate"] = "";
$lang["sales_work_order_sent"] = "";
$lang["sales_work_order_unsent"] = "";
$lang["sales_second_display"] = "Second Display";
1 change: 1 addition & 0 deletions application/language/pl/config_lang.php
Expand Up @@ -279,3 +279,4 @@
$lang["config_website"] = "";
$lang["config_work_order_enable"] = "";
$lang["config_work_order_format"] = "";
$lang["config_second_display"] = "Show Customer Display";
1 change: 1 addition & 0 deletions application/language/pl/sales_lang.php
Expand Up @@ -174,3 +174,4 @@
$lang["sales_work_order_number_duplicate"] = "";
$lang["sales_work_order_sent"] = "";
$lang["sales_work_order_unsent"] = "";
$lang["sales_second_display"] = "Second Display";