From afcf7725f5b5cdc0a5c9b0005bf8e6416ce8ad61 Mon Sep 17 00:00:00 2001 From: phyusin Date: Wed, 22 Nov 2017 16:28:17 +0630 Subject: [PATCH] change UI for all settings module --- app/models/menu_category.rb | 3 +- app/models/menu_item.rb | 5 +- app/models/menu_item_instance.rb | 2 + app/views/print_settings/_form.html.erb | 42 +- app/views/settings/accounts/_form.html.erb | 30 +- .../settings/cashier_terminals/_form.html.erb | 42 +- .../settings/commissioners/_form.html.erb | 89 ++- app/views/settings/commissions/_form.html.erb | 27 +- app/views/settings/employees/_form.html.erb | 28 +- app/views/settings/item_sets/_form.html.erb | 28 +- .../settings/menu_categories/_form.html.erb | 32 +- .../menu_item_attributes/_form.html.erb | 24 +- .../menu_item_instances/_form.html.erb | 48 +- .../settings/menu_item_options/_form.html.erb | 26 +- app/views/settings/menus/_form.html.erb | 78 +-- .../order_queue_stations/_form.html.erb | 44 +- .../payment_method_settings/_form.html.erb | 32 +- app/views/settings/products/_form.html.erb | 60 +- app/views/settings/promotions/_form.html.erb | 588 +++++++++--------- app/views/settings/rooms/_form.html.erb | 100 +-- .../settings/set_menu_items/_form.html.erb | 49 +- .../settings/set_menu_items/edit.html.erb | 2 +- .../settings/set_menu_items/new.html.erb | 2 +- .../settings/set_menu_items/show.html.erb | 47 +- .../settings/simple_menu_items/_form.html.erb | 47 +- .../settings/simple_menu_items/edit.html.erb | 2 +- .../settings/simple_menu_items/index.html.erb | 2 +- .../settings/simple_menu_items/new.html.erb | 4 +- .../settings/simple_menu_items/show.html.erb | 4 +- app/views/settings/tables/_form.html.erb | 91 +-- app/views/settings/tables/show.html.erb | 42 +- .../settings/tax_profiles/_form.html.erb | 26 +- app/views/settings/zones/_form.html.erb | 26 +- 33 files changed, 903 insertions(+), 769 deletions(-) diff --git a/app/models/menu_category.rb b/app/models/menu_category.rb index e386a227..9930d3cd 100755 --- a/app/models/menu_category.rb +++ b/app/models/menu_category.rb @@ -6,7 +6,8 @@ class MenuCategory < ApplicationRecord belongs_to :parent, :class_name => "MenuCategory", foreign_key: "menu_category_id", optional: true has_many :menu_items - validates_presence_of :name, :menu, :order_by + validates_presence_of :code, :name, :menu, :order_by + validates_uniqueness_of :code default_scope { order('order_by asc') } scope :active, -> {where("is_available = 1")} diff --git a/app/models/menu_item.rb b/app/models/menu_item.rb index 78702fe0..9bfcdb85 100755 --- a/app/models/menu_item.rb +++ b/app/models/menu_item.rb @@ -13,8 +13,9 @@ class MenuItem < ApplicationRecord has_many :menu_item_sets has_many :item_sets, through: :menu_item_sets - validates_presence_of :name, :type, :min_qty, :taxable,:account_id - + validates_presence_of :item_code, :name, :type, :min_qty, :taxable,:account_id + validates_uniqueness_of :item_code + default_scope { order('item_code asc') } scope :simple_menu_item, -> { where(type: 'SimpleMenuItem') } diff --git a/app/models/menu_item_instance.rb b/app/models/menu_item_instance.rb index c8019063..a51a94c4 100755 --- a/app/models/menu_item_instance.rb +++ b/app/models/menu_item_instance.rb @@ -4,6 +4,8 @@ class MenuItemInstance < ApplicationRecord has_many :menu_instance_item_sets has_many :item_sets, through: :menu_instance_item_sets # before_create :generate_menu_item_instance_code + validates_presence_of :item_instance_code + # validates_uniqueness_of :item_instance_code def self.findParentCategory(item) if item.menu_category_id diff --git a/app/views/print_settings/_form.html.erb b/app/views/print_settings/_form.html.erb index 0e7eecc7..b795c380 100755 --- a/app/views/print_settings/_form.html.erb +++ b/app/views/print_settings/_form.html.erb @@ -1,28 +1,32 @@
- <%= simple_form_for(@print_setting) do |f| %> - <%= f.error_notification %> +
+
+ <%= simple_form_for(@print_setting) do |f| %> + <%= f.error_notification %> -
- <%= f.input :name %> - <%= f.input :unique_code %> - <%= f.input :template %> - <%= f.input :font %> - <%= f.input :printer_name %> - <%= f.input :api_settings %> - <%= f.input :page_width %> - <%= f.input :page_height %> - <%= f.input :print_copies %> - <%= f.input :precision %> - <%= f.input :delimiter %> - <%= f.input :heading_space %> -
+
+ <%= f.input :name %> + <%= f.input :unique_code %> + <%= f.input :template %> + <%= f.input :font %> + <%= f.input :printer_name %> + <%= f.input :api_settings %> + <%= f.input :page_width %> + <%= f.input :page_height %> + <%= f.input :print_copies %> + <%= f.input :precision %> + <%= f.input :delimiter %> + <%= f.input :heading_space %> +
-
- <%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %> +
+ <%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %> +
+ <% end %> +
- <% end %>
diff --git a/app/views/settings/accounts/_form.html.erb b/app/views/settings/accounts/_form.html.erb index 5badaff4..e3282cd0 100755 --- a/app/views/settings/accounts/_form.html.erb +++ b/app/views/settings/accounts/_form.html.erb @@ -1,19 +1,23 @@
- <%= simple_form_for([:settings,@settings_account]) do |f| %> - <%= f.error_notification %> -
- <%= f.input :title ,:input_html=>{:class=>"col-md-10"},:required=>true%> - <%= f.input :account_type, :collection => Lookup.collection_of("account_type"),:input_html=>{:class=>"col-md-10"},:required=>true %> - <%= f.input :discount %> - <%= f.input :point %> - <%= f.input :bonus %> - <%= f.input :rebate %> +
+
+ <%= simple_form_for([:settings,@settings_account]) do |f| %> + <%= f.error_notification %> +
+ <%= f.input :title ,:input_html=>{:class=>"col-md-10"},:required=>true%> + <%= f.input :account_type, :collection => Lookup.collection_of("account_type"),:input_html=>{:class=>"col-md-10"},:required=>true %> + <%= f.input :discount %> + <%= f.input :point %> + <%= f.input :bonus %> + <%= f.input :rebate %> +
+
+ <%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %> +
+ <% end %> +
-
- <%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %> -
- <% end %>
diff --git a/app/views/settings/cashier_terminals/_form.html.erb b/app/views/settings/cashier_terminals/_form.html.erb index 454851ba..cb4014dd 100755 --- a/app/views/settings/cashier_terminals/_form.html.erb +++ b/app/views/settings/cashier_terminals/_form.html.erb @@ -1,27 +1,31 @@
- <%= simple_form_for([:settings, @settings_cashier_terminal]) do |f| %> - <%= f.error_notification %> +
+
+ <%= simple_form_for([:settings, @settings_cashier_terminal]) do |f| %> + <%= f.error_notification %> -
- <%= f.input :name %> - <%= f.input :is_active %> - <%= f.input :is_currently_login %> - <%= f.input :auto_print_receipt %> - <%= f.label "Select Zones", :class => 'control-label' %> - <%= f.collection_check_boxes :zone_ids , Zone.all, :id, :name , :class => 'checkbox form-group'%> - <%= f.input :printer_name %> - <%= f.input :font %> - <%= f.input :font_size %> - <%= f.input :show_tax %> - <%= f.input :show_cashier %> - <%= f.input :show_guest_info %> -
+
+ <%= f.input :name %> + <%= f.input :is_active %> + <%= f.input :is_currently_login %> + <%= f.input :auto_print_receipt %> + <%= f.label "Select Zones", :class => 'control-label' %> + <%= f.collection_check_boxes :zone_ids , Zone.all, :id, :name , :class => 'checkbox form-group'%> + <%= f.input :printer_name %> + <%= f.input :font %> + <%= f.input :font_size %> + <%= f.input :show_tax %> + <%= f.input :show_cashier %> + <%= f.input :show_guest_info %> +
-
- <%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %> +
+ <%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %> +
+ <% end %> +
- <% end %>
diff --git a/app/views/settings/commissioners/_form.html.erb b/app/views/settings/commissioners/_form.html.erb index 6c007320..a337e47b 100755 --- a/app/views/settings/commissioners/_form.html.erb +++ b/app/views/settings/commissioners/_form.html.erb @@ -1,57 +1,56 @@ -
-
- <%= simple_form_for([:settings, @commissioner]) do |f| %> - <%= f.error_notification %> - -
- <%= f.input :name %> - <%= f.label :emp_id, 'Employee' %> - - <%= f.collection_select :emp_id, Employee.all.order('name asc'), :id, :name, {prompt: 'Select an Employee'}, {class: "form-control"} %> - -
- - <%= f.label :commission_id, 'Commission'%> - <%= f.select :commission_id, Commission.all.map {|l| [l.name, l.id]}, { :include_blank => 'Choose Commission Product', :selected => ''}, {class: 'form-control'} %> - -
- <%= f.label :joined_date %>
- <%= f.text_field :joined_date, {class: 'form-control datepicker', id: 'joined_date', readonly: true} %>
- <%= f.label :resigned_date %>
- <%= f.text_field :resigned_date, {class: 'form-control datepicker', id: 'resigned_date', readonly: true} %>
- <%= f.input :is_active %> -
- -
- <%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %> -
- <% end %> -
-
-
-
view_headline <%= t("views.right_panel.header.page_detail") %>
-

+ <%= simple_form_for([:settings, @commissioner]) do |f| %> + <%= f.error_notification %> +

+ <%= f.input :name %> + <%= f.label :emp_id, 'Employee' %> + + <%= f.collection_select :emp_id, Employee.all.order('name asc'), :id, :name, {prompt: 'Select an Employee'}, {class: "form-control"} %> + +
+ + <%= f.label :commission_id, 'Commission'%> + <%= f.select :commission_id, Commission.all.map {|l| [l.name, l.id]}, { :include_blank => 'Choose Commission Product', :selected => ''}, {class: 'form-control'} %> +
+ <%= f.label :joined_date %>
+ <%= f.text_field :joined_date, {class: 'form-control datepicker', id: 'joined_date', readonly: true} %>
+ <%= f.label :resigned_date %>
+ <%= f.text_field :resigned_date, {class: 'form-control datepicker', id: 'resigned_date', readonly: true} %>
+ <%= f.input :is_active %> +
+ +
+ <%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %> +
+ <% end %> +
+
+
+
+
+
+
view_headline <%= t("views.right_panel.header.page_detail") %>
+

1) <%= t("views.right_panel.detail.name") %> - <%= t("views.right_panel.detail.write_txt") %> <%= t("views.right_panel.detail.name_txt2") %>
2) <%= t("views.right_panel.detail.employee") %> <%= t("views.right_panel.detail.name_txt2") %> - <%= t("views.right_panel.detail.select_txt") %> <%= t("views.right_panel.detail.employee") %> <%= t("views.right_panel.detail.name_txt2") %>
3) <%= t("views.right_panel.detail.commission_type") %> - <%= t("views.right_panel.detail.select_txt") %> <%= t("views.right_panel.detail.commission_type_txt") %>
4) <%= t("views.right_panel.detail.joined_date") %> - <%= t("views.right_panel.detail.select_txt") %> <%= t("views.right_panel.detail.joined_date_txt") %>
5) <%= t("views.right_panel.detail.resigned_date") %> - <%= t("views.right_panel.detail.select_txt") %> <%= t("views.right_panel.detail.resigned_date_txt") %>
6) <%= t("views.right_panel.detail.active") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.active_txt") %>
-

-
list <%= t("views.right_panel.header.button_lists") %>
-

+

+
list <%= t("views.right_panel.header.button_lists") %>
+

1) <%= t("views.right_panel.button.submit") %> - <%= t("views.right_panel.detail.submit_btn_txt") %> <%= t("views.right_panel.detail.commissioner_txt") %>
-

-
list <%= t("views.right_panel.header.link_lists") %>
-

- 1) <%= t("views.right_panel.button.home") %> - <%= t("views.right_panel.detail.home_txt") %>
- 2) <%= t("views.right_panel.button.back") %> - <%= t("views.right_panel.detail.back_txt") %> <%= t("views.right_panel.detail.commissioner_txt") %>
-

-
-
-
+

+
list <%= t("views.right_panel.header.link_lists") %>
+

+ 1) <%= t("views.right_panel.button.home") %> - <%= t("views.right_panel.detail.home_txt") %>
+ 2) <%= t("views.right_panel.button.back") %> - <%= t("views.right_panel.detail.back_txt") %> <%= t("views.right_panel.detail.commissioner_txt") %>
+

+
+
+
diff --git a/app/views/settings/commissions/_form.html.erb b/app/views/settings/commissions/_form.html.erb index 75bd3e70..bb7f7847 100755 --- a/app/views/settings/commissions/_form.html.erb +++ b/app/views/settings/commissions/_form.html.erb @@ -1,39 +1,42 @@
-
+
+
+
+ <%= simple_form_for([:settings,@commission]) do |f| %> + <%= f.error_notification %> - <%= simple_form_for([:settings,@commission]) do |f| %> - <%= f.error_notification %> - -
+
<%= f.input :name %> <%= f.input :commission_type, :collection => ['Percentage','Net Amount'], prompt: 'Select Commission Type', class: 'form-control' %> <%= f.input :amount %> - <%= f.input :is_active,:class => "filled-in" ,:id => "" %> + <%= f.input :is_active,:class => "filled-in" ,:id => "" %>

<%= f.submit 'Submit', class: 'btn btn-primary wave-effects' %>
<% end %> - +
+ +
view_headline <%= t("views.right_panel.header.page_detail") %>

- 1) <%= t("views.right_panel.detail.product") %> - <%= t("views.right_panel.detail.select_txt") %> <%= t("views.right_panel.detail.product_txt") %>
- 2) <%= t("views.right_panel.detail.commission_type") %> - <%= t("views.right_panel.detail.select_txt") %> <%= t("views.right_panel.detail.commission_type_txt") %>
- 3) <%= t("views.right_panel.detail.amount") %> - <%= t("views.right_panel.detail.write_txt") %> <%= t("views.right_panel.detail.amount_txt") %>
- 4) <%= t("views.right_panel.detail.active") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.active_txt") %>
+ 1) <%= t("views.right_panel.detail.product") %> - <%= t("views.right_panel.detail.select_txt") %> <%= t("views.right_panel.detail.product_txt") %>
+ 2) <%= t("views.right_panel.detail.commission_type") %> - <%= t("views.right_panel.detail.select_txt") %> <%= t("views.right_panel.detail.commission_type_txt") %>
+ 3) <%= t("views.right_panel.detail.amount") %> - <%= t("views.right_panel.detail.write_txt") %> <%= t("views.right_panel.detail.amount_txt") %>
+ 4) <%= t("views.right_panel.detail.active") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.active_txt") %>

list <%= t("views.right_panel.header.button_lists") %>

- 1) <%= t("views.right_panel.button.submit") %> - <%= t("views.right_panel.detail.submit_btn_txt") %> <%= t("views.right_panel.detail.commission_txt") %>
+ 1) <%= t("views.right_panel.button.submit") %> - <%= t("views.right_panel.detail.submit_btn_txt") %> <%= t("views.right_panel.detail.commission_txt") %>

list <%= t("views.right_panel.header.link_lists") %>

diff --git a/app/views/settings/employees/_form.html.erb b/app/views/settings/employees/_form.html.erb index 092dded6..5d5fcb04 100755 --- a/app/views/settings/employees/_form.html.erb +++ b/app/views/settings/employees/_form.html.erb @@ -1,20 +1,24 @@

- <%= simple_form_for([:settings,@employee]) do |f| %> - <%= f.error_notification %> +
+
+ <%= simple_form_for([:settings,@employee]) do |f| %> + <%= f.error_notification %> -
- <%= f.input :name %> - <%= f.input :role, :collection => Lookup.collection_of("employee_roles"),:class=>'form-group' %> - <%= f.input :emp_id, :label => "Employee Numberic ID (*Unique)" %> - <%= f.input :password %> +
+ <%= f.input :name %> + <%= f.input :role, :collection => Lookup.collection_of("employee_roles"),:class=>'form-group' %> + <%= f.input :emp_id, :label => "Employee Numberic ID (*Unique)" %> + <%= f.input :password %> -
+
-
- <%= f.submit t('views.btn.submit'),:class => 'btn btn-primary btn-lg waves-effect' %> -
-<% end %> +
+ <%= f.submit t('views.btn.submit'),:class => 'btn btn-primary btn-lg waves-effect' %> +
+ <% end %> +
+
diff --git a/app/views/settings/item_sets/_form.html.erb b/app/views/settings/item_sets/_form.html.erb index ab600e6d..034ca538 100755 --- a/app/views/settings/item_sets/_form.html.erb +++ b/app/views/settings/item_sets/_form.html.erb @@ -2,20 +2,24 @@
- <%= simple_form_for([:settings,@settings_item_set]) do |f| %> - <%= f.error_notification %> +
+
+ <%= simple_form_for([:settings,@settings_item_set]) do |f| %> + <%= f.error_notification %> -
- <%= f.input :name %> - <%= f.input :alt_name %> - <%= f.input :min_selectable_qty,input_html: {value: f.object.min_selectable_qty || '0'} %> - <%= f.input :max_selectable_qty,input_html: {value: f.object.max_selectable_qty || '0'} %> -
+
+ <%= f.input :name %> + <%= f.input :alt_name %> + <%= f.input :min_selectable_qty,input_html: {value: f.object.min_selectable_qty || '0'} %> + <%= f.input :max_selectable_qty,input_html: {value: f.object.max_selectable_qty || '0'} %> +
-
- <%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %> -
-<% end %> +
+ <%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %> +
+ <% end %> +
+
diff --git a/app/views/settings/menu_categories/_form.html.erb b/app/views/settings/menu_categories/_form.html.erb index a0a0137f..85ebaf74 100755 --- a/app/views/settings/menu_categories/_form.html.erb +++ b/app/views/settings/menu_categories/_form.html.erb @@ -1,22 +1,26 @@
- <%= simple_form_for([:settings, @settings_menu_category]) do |f| %> - <%= f.error_notification %> +
+
+ <%= simple_form_for([:settings, @settings_menu_category]) do |f| %> + <%= f.error_notification %> -
- <%= f.input :menu_id, as: :hidden %> - <%= f.input :code, label: "Category Code" %> - <%= f.input :name %> - <%= f.input :alt_name %> - <%= f.input :is_available %> - <%= f.input :order_by %> - <%= f.association :parent %> -
+
+ <%= f.input :menu_id, as: :hidden %> + <%= f.input :code, label: "Category Code" %> + <%= f.input :name %> + <%= f.input :alt_name %> + <%= f.input :is_available %> + <%= f.input :order_by %> + <%= f.association :parent %> +
-
- <%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %> +
+ <%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %> +
+ <% end %> +
- <% end %>
diff --git a/app/views/settings/menu_item_attributes/_form.html.erb b/app/views/settings/menu_item_attributes/_form.html.erb index 71ba75bf..6eedd3bb 100755 --- a/app/views/settings/menu_item_attributes/_form.html.erb +++ b/app/views/settings/menu_item_attributes/_form.html.erb @@ -1,18 +1,22 @@
- <%= simple_form_for([:settings, @settings_menu_item_attribute]) do |f| %> - <%= f.error_notification %> +
+
+ <%= simple_form_for([:settings, @settings_menu_item_attribute]) do |f| %> + <%= f.error_notification %> -
- <%= f.input :attribute_type,:input_html => { :class => "col-md-9" } %> - <%= f.input :name,:input_html => { :class => "col-md-9" } %> - <%= f.input :value,:input_html => { :class => "col-md-9" } %> -
+
+ <%= f.input :attribute_type,:input_html => { :class => "col-md-9" } %> + <%= f.input :name,:input_html => { :class => "col-md-9" } %> + <%= f.input :value,:input_html => { :class => "col-md-9" } %> +
-
- <%= f.submit t('views.btn.submit'),:class => 'btn btn-primary btn-lg waves-effect' %> +
+ <%= f.submit t('views.btn.submit'),:class => 'btn btn-primary btn-lg waves-effect' %> +
+ <% end %> +
- <% end %>
diff --git a/app/views/settings/menu_item_instances/_form.html.erb b/app/views/settings/menu_item_instances/_form.html.erb index 7a0de4e6..13b2c8ad 100755 --- a/app/views/settings/menu_item_instances/_form.html.erb +++ b/app/views/settings/menu_item_instances/_form.html.erb @@ -1,39 +1,35 @@
+
+
+ <%= simple_form_for([:settings,@item, @settings_menu_item_instances]) do |f| %> + <%= f.error_notification %> - <%= simple_form_for([:settings,@item, @settings_menu_item_instances]) do |f| %> +
+
+ <%= f.input :item_instance_code %> + <%= f.input :item_instance_name %> + <%= f.input :price %> - <%= f.error_notification %> + <%= f.input :item_attributes, collection: MenuItemAttribute.collection, input_html: { multiple: true } %> -
-
- <%= f.input :item_instance_code %> - <%= f.input :item_instance_name %> - <%= f.input :price %> + <%= f.input :is_on_promotion %> + <%= f.input :promotion_price %> + + <%= f.input :is_available %> + <%= f.input :is_default %> - <%= f.input :item_attributes, collection: MenuItemAttribute.collection, input_html: { multiple: true } %> + <%= f.input :item_sets, :collection => @item_sets, :input_html => { :multiple => true }, :class => "form-control item_sets" %> +
+
- <%= f.input :is_on_promotion %> - <%= f.input :promotion_price %> -
-
- -
-
-
- <%= f.input :is_available %> - <%= f.input :is_default %> - - <%= f.input :item_sets, :collection => @item_sets, :input_html => { :multiple => true }, :class => "form-control item_sets" %> +
+ <%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %> +
+ <% end %>
- -
- <%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %> -
- <% end %> -
diff --git a/app/views/settings/menu_item_options/_form.html.erb b/app/views/settings/menu_item_options/_form.html.erb index 266be9e5..c50809bf 100755 --- a/app/views/settings/menu_item_options/_form.html.erb +++ b/app/views/settings/menu_item_options/_form.html.erb @@ -1,19 +1,23 @@
- <%= simple_form_for([:settings, @settings_menu_item_option]) do |f| %> - <%= f.error_notification %> +
+
+ <%= simple_form_for([:settings, @settings_menu_item_option]) do |f| %> + <%= f.error_notification %> -
- <%= f.input :option_type,:input_html=>{:class=>"col-md-10"} %> - <%= f.input :name,:required => true,:input_html=>{:class=>"col-md-10"} %> - <%= f.input :value,:required => true,:input_html=>{:class=>"col-md-10"} %> +
+ <%= f.input :option_type,:input_html=>{:class=>"col-md-10"} %> + <%= f.input :name,:required => true,:input_html=>{:class=>"col-md-10"} %> + <%= f.input :value,:required => true,:input_html=>{:class=>"col-md-10"} %> +
+ +
+ <%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %> +
+ <% end %> +
- -
- <%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %> -
- <% end %>
diff --git a/app/views/settings/menus/_form.html.erb b/app/views/settings/menus/_form.html.erb index 5b103395..c8b5e41a 100755 --- a/app/views/settings/menus/_form.html.erb +++ b/app/views/settings/menus/_form.html.erb @@ -1,45 +1,49 @@
- <%= simple_form_for([:settings,@settings_menu]) do |f| %> - <%= f.error_notification %> +
+
+ <%= simple_form_for([:settings,@settings_menu]) do |f| %> + <%= f.error_notification %> -
- <%= f.input :name,:input_html=>{:class=>"col-md-9"} %> - <%= f.input :is_active,:input_html=>{:class=>"col-md-9"} %> - <%= f.input :valid_days,:input_html=>{:class=>"col-md-9"} %> -
- -
- - date_range - - <% if !@settings_menu.valid_time_from.nil?%> - - <% else %> - - <% end %> +
+ <%= f.input :name,:input_html=>{:class=>"col-md-9"} %> + <%= f.input :is_active,:input_html=>{:class=>"col-md-9"} %> + <%= f.input :valid_days,:input_html=>{:class=>"col-md-9"} %> +
+ +
+ + date_range + + <% if !@settings_menu.valid_time_from.nil?%> + + <% else %> + + <% end %> +
+
+
+ +
+ + date_range + + <% if !@settings_menu.valid_time_to.nil?%> + + <% else %> + + <% end %> +
+
+
-
-
- -
- - date_range - - <% if !@settings_menu.valid_time_to.nil?%> - - <% else %> - - <% end %> -
-
- -
-
- <%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %> -
- <% end %> +
+ <%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %> +
+ <% end %> +
+
diff --git a/app/views/settings/order_queue_stations/_form.html.erb b/app/views/settings/order_queue_stations/_form.html.erb index 97792930..86ca2237 100755 --- a/app/views/settings/order_queue_stations/_form.html.erb +++ b/app/views/settings/order_queue_stations/_form.html.erb @@ -7,29 +7,33 @@ div.form-inputs span{
- <%= simple_form_for([:settings,@settings_order_queue_station]) do |f| %> - <%= f.error_notification %> +
+
+ <%= simple_form_for([:settings,@settings_order_queue_station]) do |f| %> + <%= f.error_notification %> -
- <%= f.input :station_name %> - <%= f.input :is_active %> +
+ <%= f.input :station_name %> + <%= f.input :is_active %> - <%= f.input :printer_name %> - - <%= f.input :print_copy %> - <%= f.hidden_field :processing_items %> - <%= f.label "Select Zones", :class => 'control-label' %> - <%= f.collection_check_boxes :zone_ids , Zone.all, :id, :name , :class => 'checkbox'%> - <%= f.input :cut_per_item %> - <%= f.input :use_alternate_name %> - <%= f.input :processing_items, as: :hidden %> - <%= f.input :auto_print %> + <%= f.input :printer_name %> + + <%= f.input :print_copy %> + <%= f.hidden_field :processing_items %> + <%= f.label "Select Zones", :class => 'control-label' %> + <%= f.collection_check_boxes :zone_ids , Zone.all, :id, :name , :class => 'checkbox'%> + <%= f.input :cut_per_item %> + <%= f.input :use_alternate_name %> + <%= f.input :processing_items, as: :hidden %> + <%= f.input :auto_print %> +
+ +
+ <%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %> +
+ <% end %>
- -
- <%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %> -
- <% end %> +
diff --git a/app/views/settings/payment_method_settings/_form.html.erb b/app/views/settings/payment_method_settings/_form.html.erb index 43804214..bb5ae59a 100755 --- a/app/views/settings/payment_method_settings/_form.html.erb +++ b/app/views/settings/payment_method_settings/_form.html.erb @@ -1,23 +1,27 @@
- <%= simple_form_for([:settings, @settings_payment_method_setting]) do |f| %> - <%= f.error_notification %> +
+
+ <%= simple_form_for([:settings, @settings_payment_method_setting]) do |f| %> + <%= f.error_notification %> -
- <%= f.input :payment_method %> - <%= f.input :is_active %> - <%= f.input :gateway_communication_type %> - <%= f.input :gateway_url %> - <%= f.input :auth_token %> - <%= f.input :merchant_account_id %> - <%= f.input :additional_parameters %> -
+
+ <%= f.input :payment_method %> + <%= f.input :is_active %> + <%= f.input :gateway_communication_type %> + <%= f.input :gateway_url %> + <%= f.input :auth_token %> + <%= f.input :merchant_account_id %> + <%= f.input :additional_parameters %> +
-
- <%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %> +
+ <%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %> +
+ <% end %> +
- <% end %>
diff --git a/app/views/settings/products/_form.html.erb b/app/views/settings/products/_form.html.erb index a1a448ba..f9ad882b 100755 --- a/app/views/settings/products/_form.html.erb +++ b/app/views/settings/products/_form.html.erb @@ -1,38 +1,42 @@
- <%= simple_form_for([:settings,@settings_product]) do |f| %> - <%= f.error_notification %> -
- <%= f.input :item_code, :input_html => { :id => 'item_code' } %> - <%= f.input :name %> - <%= f.input :alt_name %> - <%= f.input :unit_price %> - <%= f.input :description %> - <%= f.input :information %> - <%= f.input:taxable %> -
- - -
-
- - <%= f.file_field :image_path, :class => "img-thumbnail" %> -
+
+
+ <%= simple_form_for([:settings,@settings_product]) do |f| %> + <%= f.error_notification %> +
+ <%= f.input :item_code, :input_html => { :id => 'item_code' } %> + <%= f.input :name %> + <%= f.input :alt_name %> + <%= f.input :unit_price %> + <%= f.input :description %> + <%= f.input :information %> + <%= f.input:taxable %>
-
- <%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %> + +
+
+ + <%= f.file_field :image_path, :class => "img-thumbnail" %> +
+
+ +
+ <%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %> +
+ <% end %>
- <% end %>
+
diff --git a/app/views/settings/promotions/_form.html.erb b/app/views/settings/promotions/_form.html.erb index 1a3f5ba3..979f129a 100755 --- a/app/views/settings/promotions/_form.html.erb +++ b/app/views/settings/promotions/_form.html.erb @@ -1,213 +1,217 @@
- <%= simple_nested_form_for([:settings,@promotion]) do |f| %> - <%= f.error_notification %> - -
-
-
-
- -
- - vpn_key - - -
-
-
- -
-
- -
- - date_range - - <% if !@promotion.promo_start_date.nil?%> - - <% else %> - - <% end %> -
-
-
- -
- - date_range - - <% if !@promotion.promo_end_date.nil?%> - - <% else %> - - <% end %> -
-
-
- -
-
- -
- - access_time - - <% if !@promotion.promo_start_hour.nil?%> - - <% else %> - - <% end %> -
-
-
- -
- - access_time - - <% if !@promotion.promo_end_hour.nil?%> - - <% else %> - - <% end %> -
- -
-
- -
-
-
- -
- <%= f.hidden_field :promo_day, :class => "form-control", :id => "promotion_promo_day" %> -
-    -    -    -    -    -    - -
-
- - - <%= f.input :promo_type,input_html: { :class => 'form-control col-md-5 form-control select' }, - collection: %w{Quantity Net_off Net_price Percentage},:label => "Promotion Type" %> - -
- <% arr = MenuItem.active.order("name desc").pluck(:name,:item_code) %> - <% Product.order("name desc").pluck(:name,:item_code).each do |p| %> - <% arr.push(p) %> - <% end %> -
- - -
- - <% sample = [] %> - <% if !@promotion.original_product.nil? %> - <% if !MenuItemInstance.find_by_item_instance_code(@promotion.original_product).nil? %> - <% sample = MenuItemInstance.where("item_instance_code=?",@promotion.original_product).pluck(:item_instance_name,:item_instance_code)%> - <% else %> - <% sample = Product.where("item_code=?",@promotion.original_product).pluck(:name,:item_code)%> - <% end %> - <% end %> -
<%= f.input :original_product,collection: sample %>
- -
<%= f.input :min_qty ,label: "Qualified Qty", :input_html => {:style => 'height: 37px'} %>
-
-
-
-
-
-
Item Code
-
Item Instance
-
Qualified Qty
-
Net off
-
Net Price
-
Percentage
-
-
-
- <%= f.fields_for :promotion_products do |pro| %> -
- <%= pro.hidden_field :item_code,:class => "promo_product" %> - <% arr = MenuItem.active.order("name desc").pluck(:name,:item_code) %> - <% Product.order("name desc").pluck(:name,:item_code).each do |p| %> - <% arr.push(p) %> - <% end %> - - - -
- <%= pro.input :item_code, :class => 'promoproduct', collection:[],input_html: { selected: 2 }, label: false %> -
- -
- <%= pro.input :min_qty , label: false, :input_html => {:style => 'height: 37px'}%> -
-
- <%= pro.input :net_off , label: false, :input_html => {:style => 'height: 37px'} %> -
-
<%= pro.input :net_price , label: false, :input_html => {:style => 'height: 37px'} %>
-
<%= pro.input :percentage , label: false, :input_html => {:style => 'height: 37px'} %>
-
<%= pro.link_to_remove "X" ,:class=>"btn-primary btn m-r-25", :style => 'width: 25px'%>
-
- <% end %> -
-
- <%= f.link_to_add "Add Product", :promotion_products, :class => 'btn bg-teal addProduct m-r-20' %> -
-
-
-
-
-
- -
-
- <%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %> -
-<% end %> -
-
-
view_headline <%= t("views.right_panel.header.page_detail") %>
-

+ <%= simple_nested_form_for([:settings,@promotion]) do |f| %> + <%= f.error_notification %> + +

+
+
+
+ +
+ + vpn_key + + +
+
+
+ +
+
+ +
+ + date_range + + <% if !@promotion.promo_start_date.nil?%> + + <% else %> + + <% end %> +
+
+
+ +
+ + date_range + + <% if !@promotion.promo_end_date.nil?%> + + <% else %> + + <% end %> +
+
+
+ +
+
+ +
+ + access_time + + <% if !@promotion.promo_start_hour.nil?%> + + <% else %> + + <% end %> +
+
+
+ +
+ + access_time + + <% if !@promotion.promo_end_hour.nil?%> + + <% else %> + + <% end %> +
+ +
+
+ +
+
+
+ +
+ <%= f.hidden_field :promo_day, :class => "form-control", :id => "promotion_promo_day" %> +
+    +    +    +    +    +    + +
+
+ + + <%= f.input :promo_type,input_html: { :class => 'form-control col-md-5 form-control select' }, + collection: %w{Quantity Net_off Net_price Percentage},:label => "Promotion Type" %> + +
+ <% arr = MenuItem.active.order("name desc").pluck(:name,:item_code) %> + <% Product.order("name desc").pluck(:name,:item_code).each do |p| %> + <% arr.push(p) %> + <% end %> +
+ + +
+ + <% sample = [] %> + <% if !@promotion.original_product.nil? %> + <% if !MenuItemInstance.find_by_item_instance_code(@promotion.original_product).nil? %> + <% sample = MenuItemInstance.where("item_instance_code=?",@promotion.original_product).pluck(:item_instance_name,:item_instance_code)%> + <% else %> + <% sample = Product.where("item_code=?",@promotion.original_product).pluck(:name,:item_code)%> + <% end %> + <% end %> +
<%= f.input :original_product,collection: sample %>
+ +
<%= f.input :min_qty ,label: "Qualified Qty", :input_html => {:style => 'height: 37px'} %>
+
+
+
+
+
+
Item Code
+
Item Instance
+
Qualified Qty
+
Net off
+
Net Price
+
Percentage
+
+
+
+ <%= f.fields_for :promotion_products do |pro| %> +
+ <%= pro.hidden_field :item_code,:class => "promo_product" %> + <% arr = MenuItem.active.order("name desc").pluck(:name,:item_code) %> + <% Product.order("name desc").pluck(:name,:item_code).each do |p| %> + <% arr.push(p) %> + <% end %> + + + +
+ <%= pro.input :item_code, :class => 'promoproduct', collection:[],input_html: { selected: 2 }, label: false %> +
+ +
+ <%= pro.input :min_qty , label: false, :input_html => {:style => 'height: 37px'}%> +
+
+ <%= pro.input :net_off , label: false, :input_html => {:style => 'height: 37px'} %> +
+
<%= pro.input :net_price , label: false, :input_html => {:style => 'height: 37px'} %>
+
<%= pro.input :percentage , label: false, :input_html => {:style => 'height: 37px'} %>
+
<%= pro.link_to_remove "X" ,:class=>"btn-primary btn m-r-45", :style => 'width: 25px'%>
+
+ <% end %> +
+
+ <%= f.link_to_add "Add Product", :promotion_products, :class => 'btn bg-teal addProduct m-r-20' %> +
+
+
+
+
+
+ +
+
+ <%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %> +
+ <% end %> +
+
+
+
+
+
+
view_headline <%= t("views.right_panel.header.page_detail") %>
+

1) <%= t("views.right_panel.detail.promotion_code") %> - <%= t("views.right_panel.detail.write_txt") %> <%= t("views.right_panel.detail.promotion_code_txt") %>
2) <%= t("views.right_panel.detail.start_date") %> - <%= t("views.right_panel.detail.select_txt") %> <%= t("views.right_panel.detail.start_date_txt") %>
3) <%= t("views.right_panel.detail.end_date") %> - <%= t("views.right_panel.detail.select_txt") %> <%= t("views.right_panel.detail.end_date_txt") %>
@@ -226,52 +230,52 @@ 4) <%= t("views.right_panel.detail.net_price") %> - <%= t("views.right_panel.detail.write_txt") %> <%= t("views.right_panel.detail.net_price_txt") %>
5) <%= t("views.right_panel.detail.percentage") %> - <%= t("views.right_panel.detail.write_txt") %> <%= t("views.right_panel.detail.percentage_txt") %>
6) " X " - <%= t("views.right_panel.detail.remove_txt") %> <%= t("views.right_panel.detail.product_txt") %>
-

-
list <%= t("views.right_panel.header.button_lists") %>
-

+

+
list <%= t("views.right_panel.header.button_lists") %>
+

1) <%= t("views.right_panel.button.add_product") %> - <%= t("views.right_panel.detail.new_btn_txt") %> <%= t("views.right_panel.detail.product_txt") %>
2) <%= t("views.right_panel.button.submit") %> - <%= t("views.right_panel.detail.submit_btn_txt") %> <%= t("views.right_panel.detail.promotion_txt") %>
-

-
list <%= t("views.right_panel.header.link_lists") %>
-

- 1) <%= t("views.right_panel.button.home") %> - <%= t("views.right_panel.detail.home_txt") %>
- 2) <%= t("views.right_panel.button.back") %> - <%= t("views.right_panel.detail.back_txt") %> <%= t("views.right_panel.detail.promotion_txt") %>
-

-
-
-
+

+
list <%= t("views.right_panel.header.link_lists") %>
+

+ 1) <%= t("views.right_panel.button.home") %> - <%= t("views.right_panel.detail.home_txt") %>
+ 2) <%= t("views.right_panel.button.back") %> - <%= t("views.right_panel.detail.back_txt") %> <%= t("views.right_panel.detail.promotion_txt") %>
+

+
+
+