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..4cdbe61f 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,7 +2,28 @@ - + + + + + + + + + + + + + + + + + + + + + + @@ -18,141 +39,101 @@ - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + - - + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -165,6 +146,7 @@ origami table_invoice sale_id + oqs @@ -184,6 +166,11 @@ @@ -194,15 +181,16 @@ DEFINITION_ORDER + - + @@ -217,355 +205,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -578,6 +217,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -585,6 +351,7 @@ + - - + - + - - + + + @@ -948,11 +717,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - @@ -960,7 +777,6 @@ - @@ -968,7 +784,6 @@ - @@ -976,7 +791,6 @@ - @@ -984,7 +798,6 @@ - @@ -992,7 +805,6 @@ - @@ -1000,15 +812,6 @@ - - - - - - - - - @@ -1030,7 +833,6 @@ - @@ -1038,7 +840,6 @@ - @@ -1046,7 +847,6 @@ - @@ -1054,7 +854,6 @@ - @@ -1062,7 +861,6 @@ - @@ -1070,7 +868,6 @@ - @@ -1078,7 +875,6 @@ - @@ -1086,7 +882,6 @@ - @@ -1094,7 +889,6 @@ - @@ -1102,7 +896,6 @@ - @@ -1110,15 +903,6 @@ - - - - - - - - - @@ -1126,7 +910,6 @@ - @@ -1134,7 +917,6 @@ - @@ -1142,7 +924,6 @@ - @@ -1150,110 +931,185 @@ - - - - + + - - - + + - - - - - + + - - - + + - + - - + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/models/ability.rb b/app/models/ability.rb index 444795dd..6965ab05 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -4,142 +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" + elsif user.role == 'cashier' - # can :overall_void, :void + # can :overall_void, :void - can :read, Order - can :update, Order + 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 :read, Sale + can :update, Sale + 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 :member_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 :member_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 :first_bill, :payment - can :show, :payment - can :create, :payment - can :reprint, :payment + can :first_bill, :payment + can :show, :payment + can :create, :payment + can :reprint, :payment - can :manage, DiningQueue + can :manage, DiningQueue - elsif user.role == "account" + elsif user.role == 'account' - 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 - elsif user.role == "supervisour" + 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 :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 :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 - - can :first_bill, :payment - can :create, :payment - can :show, :payment - can :reprint, :payment - can :rounding_adj, :payment + 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 %> - - - - -
+
-