From 646492fbd6fc9fefdb677f2861f54c0d6a14cd11 Mon Sep 17 00:00:00 2001 From: yamin Date: Mon, 14 Aug 2017 10:18:59 +0630 Subject: [PATCH 1/8] updateability --- app/models/ability.rb | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/app/models/ability.rb b/app/models/ability.rb index 1938fb45..ffd0dbaa 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -41,8 +41,8 @@ class Ability can :index, :void_sale can :get_customer, Customer - can :add_customer, Customer - can :update_sale_by_customer, Customer + can :add_customer, Customer + can :update_sale_by_customer, Customer can :index, :other_charge can :create, :other_charge @@ -57,7 +57,7 @@ class Ability can :reprint, :payment can :rounding_adj, :payment - can :move_dining, :movetable + can :move_dining, :movetable can :moving, :movetable can :move_dining, :moveroom @@ -71,14 +71,14 @@ class Ability can :overall_void, :void elsif user.role == "cashier" - + # can :overall_void, :void can :read, Order can :update, Order - - can :read, Sale - can :update, Sale + + can :read, Sale + can :update, Sale can :get_customer, Customer can :add_customer, Customer can :update_sale_by_customer, Customer @@ -97,7 +97,7 @@ class Ability can :reprint, :payment can :rounding_adj, :payment - can :move_dining, :movetable + can :move_dining, :movetable can :moving, :movetable can :move_dining, :moveroom @@ -108,7 +108,7 @@ class Ability can :reprint, :payment can :manage, DiningQueue - + elsif user.role == "account" can :index, :dailysale @@ -122,9 +122,18 @@ class Ability can :edit, :sale_edit can :item_void, :sale_edit + can :an :edit, :sale_edit + can :item_void, :sale_edit can :item_edit, :sale_edit can :item_void_cancel, :sale_edit - can :cancel_all_void, :sale_edit + can :cancel_all_void, :sale_edit + can :apply_void, :sale_edit + can :overall_void, :void + + can :first_bill, :payment + can :citem_edit, :sale_edit + can :item_void_cancel, :sale_edit + can :cancel_all_void, :sale_edit can :apply_void, :sale_edit can :overall_void, :void From fa68bcff69e0226a5695ca30b34e846e5d409afc Mon Sep 17 00:00:00 2001 From: yamin Date: Mon, 14 Aug 2017 14:26:16 +0630 Subject: [PATCH 2/8] removeDBcolsanddbparams --- app/controllers/print_settings_controller.rb | 2 +- app/models/ability.rb | 4 +--- app/views/print_settings/_form.html.erb | 4 ---- app/views/print_settings/index.html.erb | 12 ++---------- app/views/print_settings/show.html.erb | 16 ---------------- ...4041543_remove_d_bcols_from_print_settings.rb | 8 ++++++++ 6 files changed, 12 insertions(+), 34 deletions(-) create mode 100644 db/migrate/20170814041543_remove_d_bcols_from_print_settings.rb diff --git a/app/controllers/print_settings_controller.rb b/app/controllers/print_settings_controller.rb index 8efb9dd5..5bf654ef 100644 --- a/app/controllers/print_settings_controller.rb +++ b/app/controllers/print_settings_controller.rb @@ -70,6 +70,6 @@ class PrintSettingsController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def print_setting_params - params.require(:print_setting).permit(:name, :unique_code, :template, :db_name, :db_type, :db_username, :db_password, :printer_name, :api_settings, :page_width, :page_height, :print_copies,:precision,:delimiter,:heading_space) + params.require(:print_setting).permit(:name, :unique_code, :template, :printer_name, :api_settings, :page_width, :page_height, :print_copies,:precision,:delimiter,:heading_space) end end diff --git a/app/models/ability.rb b/app/models/ability.rb index ffd0dbaa..444795dd 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -122,11 +122,9 @@ class Ability can :edit, :sale_edit can :item_void, :sale_edit - can :an :edit, :sale_edit - can :item_void, :sale_edit can :item_edit, :sale_edit can :item_void_cancel, :sale_edit - can :cancel_all_void, :sale_edit + can :cancel_all_void, :sale_edit can :apply_void, :sale_edit can :overall_void, :void diff --git a/app/views/print_settings/_form.html.erb b/app/views/print_settings/_form.html.erb index ba703aae..f9079f99 100644 --- a/app/views/print_settings/_form.html.erb +++ b/app/views/print_settings/_form.html.erb @@ -5,10 +5,6 @@ <%= f.input :name %> <%= f.input :unique_code %> <%= f.input :template %> - <%= f.input :db_name %> - <%= f.input :db_type %> - <%= f.input :db_username %> - <%= f.input :db_password %> <%= f.input :printer_name %> <%= f.input :api_settings %> <%= f.input :page_width %> diff --git a/app/views/print_settings/index.html.erb b/app/views/print_settings/index.html.erb index 9c8ce0b0..c16a28c2 100644 --- a/app/views/print_settings/index.html.erb +++ b/app/views/print_settings/index.html.erb @@ -16,11 +16,7 @@ Name Unique code - + Template Printer name Api settings Page width @@ -38,11 +34,7 @@ <%= print_setting.name %> <%= print_setting.unique_code %> - + <%= print_setting.template %> <%= print_setting.printer_name %> <%= print_setting.api_settings %> <%= print_setting.page_width %> diff --git a/app/views/print_settings/show.html.erb b/app/views/print_settings/show.html.erb index 71d74950..46126c4b 100644 --- a/app/views/print_settings/show.html.erb +++ b/app/views/print_settings/show.html.erb @@ -29,22 +29,6 @@ Template <%= @print_setting.template %> - - Db name - <%= @print_setting.db_name %> - - - Db type - <%= @print_setting.db_type %> - - - Db username - <%= @print_setting.db_username %> - - - Db password - <%= @print_setting.db_password %> - Printer name <%= @print_setting.printer_name %> diff --git a/db/migrate/20170814041543_remove_d_bcols_from_print_settings.rb b/db/migrate/20170814041543_remove_d_bcols_from_print_settings.rb new file mode 100644 index 00000000..48a7de5d --- /dev/null +++ b/db/migrate/20170814041543_remove_d_bcols_from_print_settings.rb @@ -0,0 +1,8 @@ +class RemoveDBcolsFromPrintSettings < ActiveRecord::Migration[5.1] + def change + remove_column :print_settings, :db_name, :string + remove_column :print_settings, :db_type, :string + remove_column :print_settings, :db_username, :string + remove_column :print_settings, :db_password, :string + end +end From 3c54f4da89a1346ee853ec587ca2dba5f1a54a70 Mon Sep 17 00:00:00 2001 From: yamin Date: Mon, 14 Aug 2017 14:29:03 +0630 Subject: [PATCH 3/8] addQueryforwidthandheight --- app/pdf/close_cashier_pdf.rb | 4 ++-- app/pdf/crm_order_pdf.rb | 4 ++-- app/pdf/order_item_pdf.rb | 4 ++-- app/pdf/order_summary_pdf.rb | 4 ++-- app/pdf/queue_no_pdf.rb | 4 ++-- app/pdf/receipt_bill_pdf.rb | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/pdf/close_cashier_pdf.rb b/app/pdf/close_cashier_pdf.rb index 4eadf007..133d9c48 100644 --- a/app/pdf/close_cashier_pdf.rb +++ b/app/pdf/close_cashier_pdf.rb @@ -1,8 +1,8 @@ class CloseCashierPdf < Prawn::Document attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width,:text_width def initialize(printer_settings, shift_sale,shop_details,sale_taxes) - self.page_width = 210 - self.page_height = 7000 + self.page_width = PrintSetting.where("name = ?","Close Cashier").first.page_width + self.page_height = PrintSetting.where("name = ?","Close Cashier").first.page_height self.margin = 5 self.price_width = 40 self.qty_width = 20 diff --git a/app/pdf/crm_order_pdf.rb b/app/pdf/crm_order_pdf.rb index 55d08ecc..a7f85098 100644 --- a/app/pdf/crm_order_pdf.rb +++ b/app/pdf/crm_order_pdf.rb @@ -1,8 +1,8 @@ class CrmOrderPdf < Prawn::Document attr_accessor :receipt_width,:price_column_width,:p_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_column_width,:item_description_width def initialize(booking,order_items,printer_settings) - self.p_width = 200 - self.page_height = 1450 + self.page_width = PrintSetting.where("name = ?","CRM Order").first.page_width + self.page_height = PrintSetting.where("name = ?","CRM Order").first.page_height self.margin = 10 # self.price_width = self.p_width / 2 self.price_width=80 diff --git a/app/pdf/order_item_pdf.rb b/app/pdf/order_item_pdf.rb index 20a4537c..7b2e350b 100644 --- a/app/pdf/order_item_pdf.rb +++ b/app/pdf/order_item_pdf.rb @@ -2,8 +2,8 @@ class OrderItemPdf < Prawn::Document include ActionView::Helpers::NumberHelper attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width def initialize(print_settings,order_item, print_status, options, alt_name) - self.page_width = 185 - self.page_height = 1450 + self.page_width = PrintSetting.where("name = ?","OrderItemPdf").first.page_width + self.page_height = PrintSetting.where("name = ?","OrderItemPdf").first.page_height self.margin = 0 self.price_width = 40 # No Need for item self.qty_width = 40 diff --git a/app/pdf/order_summary_pdf.rb b/app/pdf/order_summary_pdf.rb index 244fbdfa..902c68ad 100644 --- a/app/pdf/order_summary_pdf.rb +++ b/app/pdf/order_summary_pdf.rb @@ -2,8 +2,8 @@ class OrderSummaryPdf < Prawn::Document include ActionView::Helpers::NumberHelper attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width def initialize(print_settings,order, print_status, order_items = nil,alt_name) - self.page_width = 190 - self.page_height = 1450 + self.page_width = PrintSetting.where("name = ?","Order Summary").first.page_width + self.page_height = PrintSetting.where("name = ?","Order Summary").first.page_height self.margin = 0 self.price_width = 40 # No Need for item self.qty_width = 40 diff --git a/app/pdf/queue_no_pdf.rb b/app/pdf/queue_no_pdf.rb index 0963f55e..cda410ca 100644 --- a/app/pdf/queue_no_pdf.rb +++ b/app/pdf/queue_no_pdf.rb @@ -1,8 +1,8 @@ class QueueNoPdf < Prawn::Document attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width def initialize(printer_settings, queue) - self.page_width = 210 - self.page_height = 1450 + self.page_width = PrintSetting.where("name = ?","Queue No").first.page_width + self.page_height = PrintSetting.where("name = ?","Queue No").first.page_height self.margin = 5 self.price_width = 35 self.qty_width = 20 diff --git a/app/pdf/receipt_bill_pdf.rb b/app/pdf/receipt_bill_pdf.rb index 2dca6d16..3027fb60 100644 --- a/app/pdf/receipt_bill_pdf.rb +++ b/app/pdf/receipt_bill_pdf.rb @@ -2,8 +2,8 @@ class ReceiptBillPdf < Prawn::Document include ActionView::Helpers::NumberHelper attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width, :description_width, :price_num_width def initialize(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info = nil,rebate_amount = nil,shop_details, printed_status) - self.page_width = 210 - self.page_height = 1450 + self.page_width = PrintSetting.where("name = ?","Receipt Bill").first.page_width + self.page_height = PrintSetting.where("name = ?","Receipt Bill").first.page_height self.margin = 5 self.price_width = 40 self.qty_width = 20 From af3a7c1d88571d6e2560c372499acd15b5dcc58b Mon Sep 17 00:00:00 2001 From: Phyo Date: Mon, 14 Aug 2017 15:33:13 +0630 Subject: [PATCH 4/8] Room Charges Bug Fix --- .../settings/dining_charges_controller.rb | 12 ++++++++-- app/views/settings/rooms/_form.html.erb | 22 +++++++++++++++++++ app/views/settings/tables/_form.html.erb | 12 +++++----- 3 files changed, 39 insertions(+), 7 deletions(-) diff --git a/app/controllers/settings/dining_charges_controller.rb b/app/controllers/settings/dining_charges_controller.rb index 6de504bf..2c8e3b7e 100644 --- a/app/controllers/settings/dining_charges_controller.rb +++ b/app/controllers/settings/dining_charges_controller.rb @@ -29,7 +29,11 @@ class Settings::DiningChargesController < ApplicationController @dining_charge.dining_facility_id = @settings_dining_facility.id respond_to do |format| if @dining_charge.save - format.html { redirect_to edit_settings_zone_table_path(@zone,@settings_dining_facility), notice: 'Dining charge was successfully created.' } + if @table + format.html { redirect_to edit_settings_zone_table_path(@zone,@settings_dining_facility), notice: 'Dining charge was successfully created.' } + else + format.html { redirect_to edit_settings_zone_room_path(@zone,@settings_dining_facility), notice: 'Dining charge was successfully created.' } + end format.json { render :show, status: :created, location: @dining_charge } else format.html { render :new } @@ -44,7 +48,11 @@ class Settings::DiningChargesController < ApplicationController respond_to do |format| @dining_charge.dining_facility_id = @settings_dining_facility.id if @dining_charge.update(dining_charge_params) - format.html { redirect_to edit_settings_zone_table_path(@zone,@settings_dining_facility), notice: 'Dining charge was successfully updated.' } + if @table + format.html { redirect_to edit_settings_zone_table_path(@zone,@settings_dining_facility), notice: 'Dining charge was successfully updated.' } + else + format.html { redirect_to edit_settings_zone_room_path(@zone,@settings_dining_facility), notice: 'Dining charge was successfully updated.' } + end format.json { render :show, status: :ok, location: @dining_charge } else format.html { render :edit } diff --git a/app/views/settings/rooms/_form.html.erb b/app/views/settings/rooms/_form.html.erb index 25af618c..a0118e61 100644 --- a/app/views/settings/rooms/_form.html.erb +++ b/app/views/settings/rooms/_form.html.erb @@ -7,6 +7,28 @@ <%= f.input :seater %> <%= f.input :order_by %> <%= f.input :is_active %> + <% if @settings_room.dining_charges.length == 0 %> + <% if @settings_room.id != nil %> +
+
+ <%= link_to 'Add For Extra Charges', new_settings_zone_room_dining_charge_path(@zone,@settings_room),:class => 'btn btn-primary' %> +
+
+ <% end %> + <% else %> + <% @settings_room.dining_charges.each do |dc| %> +
+
Dining Charge
+
item code : <%= dc.item_code %>
+
Unit price : <%= dc.unit_price %>
+
Charge type : <%= dc.charge_type %>
+
+ <%= link_to 'Edit Charges', edit_settings_zone_room_dining_charge_path(@zone,@settings_room,dc),:class => 'btn btn-primary' %> + +
+
+ <% end %> + <% end %>
diff --git a/app/views/settings/tables/_form.html.erb b/app/views/settings/tables/_form.html.erb index 3d641592..9736f523 100644 --- a/app/views/settings/tables/_form.html.erb +++ b/app/views/settings/tables/_form.html.erb @@ -8,11 +8,13 @@ <%= f.input :order_by %> <%= f.input :is_active %> <% if @settings_table.dining_charges.length == 0 %> -
-
- <%= link_to 'Add For Extra Charges', new_settings_zone_table_dining_charge_path(@zone,@settings_table),:class => 'btn btn-primary' %> -
-
+ <% if @settings_table.id != nil %> +
+
+ <%= link_to 'Add For Extra Charges', new_settings_zone_table_dining_charge_path(@zone,@settings_table),:class => 'btn btn-primary' %> +
+
+ <% end %> <% else %> <% @settings_table.dining_charges.each do |dc| %>
From 7dae1c2c27f1d44c80fad0876c5513f3c3cf2740 Mon Sep 17 00:00:00 2001 From: Zin Lin Phyo Date: Mon, 14 Aug 2017 16:43:35 +0630 Subject: [PATCH 5/8] dashboard link --- .gitignore | 3 + .idea/.generators | 2 +- .idea/.rakeTasks | 2 +- .idea/sxrestaurant.iml | 28 +- .idea/workspace.xml | 910 +++++++++++------------------- app/models/ability.rb | 208 +++---- app/views/home/dashboard.html.erb | 304 +++++++++- app/views/home/show.html.erb | 131 ++--- 8 files changed, 811 insertions(+), 777 deletions(-) diff --git a/.gitignore b/.gitignore index 5dafee53..3d6c48d5 100644 --- a/.gitignore +++ b/.gitignore @@ -51,3 +51,6 @@ dump.rdb # Fonts public/fonts/* + +# Ruby-Mine IDE folder +.idea diff --git a/.idea/.generators b/.idea/.generators index 16189766..d2c02fb2 100644 --- a/.idea/.generators +++ b/.idea/.generators @@ -5,4 +5,4 @@ You are allowed to: 2. Remove generators 3. Add installed generators To add new installed generators automatically delete this file and reload the project. ---> +--> diff --git a/.idea/.rakeTasks b/.idea/.rakeTasks index 3577d8ad..bc783dc5 100644 --- a/.idea/.rakeTasks +++ b/.idea/.rakeTasks @@ -4,4 +4,4 @@ You are allowed to: 1. Remove rake task 2. Add existing rake tasks To add existing rake tasks automatically delete this file and reload the project. ---> +--> diff --git a/.idea/sxrestaurant.iml b/.idea/sxrestaurant.iml index 586fd380..169f839c 100644 --- a/.idea/sxrestaurant.iml +++ b/.idea/sxrestaurant.iml @@ -124,14 +124,14 @@ - - - - - - - - + + + + + + + + @@ -142,6 +142,7 @@ + @@ -150,7 +151,7 @@ - + @@ -160,7 +161,7 @@ - + @@ -175,7 +176,7 @@ - + @@ -190,10 +191,10 @@ - + - + @@ -228,6 +229,7 @@ + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 34b4f3b1..958de2f8 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,7 +2,14 @@ - + + + + + + + + @@ -18,141 +25,65 @@ - - + + - - + + - - + + - - - + + + + + + + - + - - + + + + + + + + + + + + - + - - - - - - - - - - - - - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -165,6 +96,7 @@ origami table_invoice sale_id + oqs @@ -184,6 +116,11 @@ @@ -194,15 +131,16 @@ DEFINITION_ORDER + - + @@ -217,355 +155,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -578,6 +167,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -585,6 +301,7 @@ + - - + - + - - + + + @@ -948,11 +667,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - @@ -960,7 +727,6 @@ - @@ -968,7 +734,6 @@ - @@ -976,7 +741,6 @@ - @@ -984,7 +748,6 @@ - @@ -992,7 +755,6 @@ - @@ -1000,15 +762,6 @@ - - - - - - - - - @@ -1030,7 +783,6 @@ - @@ -1038,7 +790,6 @@ - @@ -1046,7 +797,6 @@ - @@ -1054,7 +804,6 @@ - @@ -1062,7 +811,6 @@ - @@ -1070,7 +818,6 @@ - @@ -1078,7 +825,6 @@ - @@ -1086,7 +832,6 @@ - @@ -1094,7 +839,6 @@ - @@ -1102,7 +846,6 @@ - @@ -1110,15 +853,6 @@ - - - - - - - - - @@ -1126,7 +860,6 @@ - @@ -1134,7 +867,6 @@ - @@ -1142,7 +874,6 @@ - @@ -1150,113 +881,162 @@ - - - - + + - - - + + - - - - - + + - - - + + - + - - + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/models/ability.rb b/app/models/ability.rb index 1938fb45..6965ab05 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -4,135 +4,135 @@ class Ability def initialize(user) user ||= Employee.new - if user.role == "administrator" + if user.role == 'administrator' - can :manage, :all + can :manage, :all - elsif user.role == "manager" + elsif user.role == 'manager' - can :manage, Menu - can :manage, MenuCategory - can :manage, MenuItemAttribute - can :manage, MenuItemInstance - can :manage, MenuItemOption - can :manage, SetMenuItem - can :manage, OrderQueueStation - can :manage, Zone - can :manage, CashierTerminal - can :manage, Employee - # can :manage, MembershipSetting - # can :manage, MembershipAction - # can :manage, PaymentMethodSetting - can :manage, TaxProfile - can :manage, PrintSetting - can :manage, Account + can :manage, Menu + can :manage, MenuCategory + can :manage, MenuItemAttribute + can :manage, MenuItemInstance + can :manage, MenuItemOption + can :manage, SetMenuItem + can :manage, OrderQueueStation + can :manage, Zone + can :manage, CashierTerminal + can :manage, Employee + # can :manage, MembershipSetting + # can :manage, MembershipAction + # can :manage, PaymentMethodSetting + can :manage, TaxProfile + can :manage, PrintSetting + can :manage, Account - can :manage, Order - can :manage, Sale + can :manage, Order + can :manage, Sale - can :manage, Customer - can :manage, DiningQueue + can :manage, Customer + can :manage, DiningQueue - can :index, :dailysale - can :index, :saleitem - can :index, :receipt_no - can :index, :shiftsale - can :index, :credit_payment - can :index, :void_sale + can :index, :dailysale + can :index, :saleitem + can :index, :receipt_no + can :index, :shiftsale + can :index, :credit_payment + can :index, :void_sale - can :get_customer, Customer - can :add_customer, Customer - can :update_sale_by_customer, Customer + can :get_customer, Customer + can :add_customer, Customer + can :update_sale_by_customer, Customer - can :index, :other_charge - can :create, :other_charge - can :index, :discount - can :create, :discount - can :remove_discount_items, :discount - can :remove_all_discount, :discount + can :index, :other_charge + can :create, :other_charge + can :index, :discount + can :create, :discount + can :remove_discount_items, :discount + can :remove_all_discount, :discount - can :first_bill, :payment - can :show, :payment - can :create, :payment - can :reprint, :payment - can :rounding_adj, :payment + can :first_bill, :payment + can :show, :payment + can :create, :payment + can :reprint, :payment + can :rounding_adj, :payment - can :move_dining, :movetable - can :moving, :movetable + can :move_dining, :movetable + can :moving, :movetable - can :move_dining, :moveroom + can :move_dining, :moveroom - can :edit, :sale_edit - can :item_void, :sale_edit - can :item_void_cancel, :sale_edit - can :cancel_all_void, :sale_edit - can :apply_void, :sale_edit + can :edit, :sale_edit + can :item_void, :sale_edit + can :item_void_cancel, :sale_edit + can :cancel_all_void, :sale_edit + can :apply_void, :sale_edit - can :overall_void, :void + can :overall_void, :void - elsif user.role == "cashier" - - # can :overall_void, :void + elsif user.role == 'cashier' - can :read, Order - can :update, Order - - can :read, Sale - can :update, Sale - can :get_customer, Customer - can :add_customer, Customer - can :update_sale_by_customer, Customer + # can :overall_void, :void - can :index, :other_charge - can :create, :other_charge - can :index, :discount - can :create, :discount - can :remove_discount_items, :discount - can :remove_all_discount, :discount - can :member_discount, :discount + can :read, Order + can :update, Order - can :first_bill, :payment - can :show, :payment - can :create, :payment - can :reprint, :payment - can :rounding_adj, :payment + can :read, Sale + can :update, Sale + can :get_customer, Customer + can :add_customer, Customer + can :update_sale_by_customer, Customer - can :move_dining, :movetable - can :moving, :movetable + can :index, :other_charge + can :create, :other_charge + can :index, :discount + can :create, :discount + can :remove_discount_items, :discount + can :remove_all_discount, :discount + can :member_discount, :discount - can :move_dining, :moveroom + can :first_bill, :payment + can :show, :payment + can :create, :payment + can :reprint, :payment + can :rounding_adj, :payment - can :first_bill, :payment - can :show, :payment - can :create, :payment - can :reprint, :payment + can :move_dining, :movetable + can :moving, :movetable - can :manage, DiningQueue - - elsif user.role == "account" + can :move_dining, :moveroom - can :index, :dailysale - can :index, :saleitem - can :index, :receipt_no - can :index, :shiftsale - can :index, :credit_payment - can :index, :void_sale + can :first_bill, :payment + can :show, :payment + can :create, :payment + can :reprint, :payment - elsif user.role == "supervisour" + can :manage, DiningQueue - can :edit, :sale_edit - can :item_void, :sale_edit - can :item_edit, :sale_edit - can :item_void_cancel, :sale_edit - can :cancel_all_void, :sale_edit - can :apply_void, :sale_edit - can :overall_void, :void + elsif user.role == 'account' - can :first_bill, :payment - can :create, :payment - can :show, :payment - can :reprint, :payment - can :rounding_adj, :payment + can :index, :dailysale + can :index, :saleitem + can :index, :receipt_no + can :index, :shiftsale + can :index, :credit_payment + can :index, :void_sale + + elsif user.role == 'supervisour' + + can :edit, :sale_edit + can :item_void, :sale_edit + can :item_edit, :sale_edit + can :item_void_cancel, :sale_edit + can :cancel_all_void, :sale_edit + can :apply_void, :sale_edit + can :overall_void, :void + + can :first_bill, :payment + can :create, :payment + can :show, :payment + can :reprint, :payment + can :rounding_adj, :payment end end diff --git a/app/views/home/dashboard.html.erb b/app/views/home/dashboard.html.erb index c2074720..571360c3 100644 --- a/app/views/home/dashboard.html.erb +++ b/app/views/home/dashboard.html.erb @@ -1,47 +1,291 @@ -
-
+
+
- <% if current_login_employee.role = "admin" %> + <% if current_login_employee.role = "admin" %> - <% elsif current_login_employee.role = "cashier" %> - <%= link_to "Cashier Station", origami_path %> + <% elsif current_login_employee.role = "cashier" %> + <%= link_to "Cashier Station", origami_path %> - <% elsif current_login_employee = "account" %> - <%= link_to "Cashier Station", oishi_path %> + <% elsif current_login_employee = "account" %> + <%= link_to "Cashier Station", oishi_path %> - <% else %> - <%= link_to "Cashier Station", oishi_path %> + <% else %> + <%= link_to "Cashier Station", oishi_path %> - <% end %> - <% shop = Shop.first %> + <% end %> + <% shop = Shop.first %> - - - - -
+
-