update inventory hide and cancan update
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
class Inventory::InventoryController < BaseInventoryController
|
class Inventory::InventoryController < BaseInventoryController
|
||||||
|
load_and_authorize_resource
|
||||||
def index
|
def index
|
||||||
@products = InventoryDefinition.all.active.order('created_at desc')
|
@products = InventoryDefinition.all.active.order('created_at desc')
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
class Origami::InDutiesController < BaseOrigamiController
|
class Origami::InDutiesController < BaseOrigamiController
|
||||||
before_action :set_in_duty, only: %i[show edit update edit_in_duty update_for_in_duty destroy destroy_in_duty]
|
before_action :set_in_duty, only: %i[show edit update edit_in_duty update_for_in_duty destroy destroy_in_duty]
|
||||||
|
|
||||||
# GET /in_duties
|
# GET /in_duties
|
||||||
# GET /in_duties.json
|
# GET /in_duties.json
|
||||||
def index
|
def index
|
||||||
|
|||||||
@@ -25,11 +25,6 @@ class Ability
|
|||||||
can :manage, TaxProfile
|
can :manage, TaxProfile
|
||||||
can :manage, PrintSetting
|
can :manage, PrintSetting
|
||||||
can :manage, Account
|
can :manage, Account
|
||||||
can :manage, Commission
|
|
||||||
can :manage, Commissioner
|
|
||||||
can :manage, Promotion
|
|
||||||
can :manage, Product
|
|
||||||
|
|
||||||
|
|
||||||
can :manage, Order
|
can :manage, Order
|
||||||
can :manage, Booking
|
can :manage, Booking
|
||||||
@@ -79,6 +74,13 @@ class Ability
|
|||||||
|
|
||||||
can :overall_void, :void
|
can :overall_void, :void
|
||||||
|
|
||||||
|
can :manage, Commission
|
||||||
|
can :manage, Commissioner
|
||||||
|
can :manage, Promotion
|
||||||
|
can :manage, Product
|
||||||
|
|
||||||
|
can :manage, Inventory
|
||||||
|
|
||||||
elsif user.role == "cashier"
|
elsif user.role == "cashier"
|
||||||
|
|
||||||
# can :overall_void, :void
|
# can :overall_void, :void
|
||||||
@@ -112,6 +114,11 @@ class Ability
|
|||||||
can :move_dining, :moveroom
|
can :move_dining, :moveroom
|
||||||
|
|
||||||
can :manage, DiningQueue
|
can :manage, DiningQueue
|
||||||
|
|
||||||
|
can :manage, Commission
|
||||||
|
can :manage, Commissioner
|
||||||
|
can :manage, Promotion
|
||||||
|
can :manage, Product
|
||||||
|
|
||||||
elsif user.role == "account"
|
elsif user.role == "account"
|
||||||
|
|
||||||
@@ -148,6 +155,12 @@ class Ability
|
|||||||
can :show, :payment
|
can :show, :payment
|
||||||
can :reprint, :payment
|
can :reprint, :payment
|
||||||
can :rounding_adj, :payment
|
can :rounding_adj, :payment
|
||||||
|
|
||||||
|
can :manage, Commission
|
||||||
|
can :manage, Commissioner
|
||||||
|
can :manage, Promotion
|
||||||
|
can :manage, Product
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -65,12 +65,14 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<li>
|
<% if can? :menage, Inventory %>
|
||||||
|
<!-- <li>
|
||||||
<a href="<%= inventory_path %>">
|
<a href="<%= inventory_path %>">
|
||||||
<i class="material-icons">store</i>
|
<i class="material-icons">store</i>
|
||||||
<span><%= t :inventory %></span>
|
<span><%= t :inventory %></span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li> -->
|
||||||
|
<%end%>
|
||||||
<li>
|
<li>
|
||||||
<a href="javascript:void(0);" class="menu-toggle">
|
<a href="javascript:void(0);" class="menu-toggle">
|
||||||
<i class="material-icons">widgets</i>
|
<i class="material-icons">widgets</i>
|
||||||
|
|||||||
@@ -377,8 +377,10 @@
|
|||||||
<button type="button" class="btn btn-block bg-blue waves-effect" id='edit' active="<%= can? :edit, :sale_edit %>">Edit</button>
|
<button type="button" class="btn btn-block bg-blue waves-effect" id='edit' active="<%= can? :edit, :sale_edit %>">Edit</button>
|
||||||
<button type="button" id="discount" class="btn btn-block bg-blue waves-effect">Discount</button>
|
<button type="button" id="discount" class="btn btn-block bg-blue waves-effect">Discount</button>
|
||||||
<button type="button" id="other-charges" class="btn btn-block bg-blue waves-effect">Charges</button>
|
<button type="button" id="other-charges" class="btn btn-block bg-blue waves-effect">Charges</button>
|
||||||
|
|
||||||
<button type="button" id="commissions" class="btn btn-block bg-blue waves-effect">Commissions</button>
|
<button type="button" id="commissions" class="btn btn-block bg-blue waves-effect">Commissions</button>
|
||||||
<button type="button" id="in_duties" class="btn btn-block bg-blue waves-effect">In Duties</button>
|
<button type="button" id="in_duties" class="btn btn-block bg-blue waves-effect">In Duties</button>
|
||||||
|
|
||||||
<button type="button" id="first_bill" class="btn btn-block bg-blue waves-effect">First Bill</button>
|
<button type="button" id="first_bill" class="btn btn-block bg-blue waves-effect">First Bill</button>
|
||||||
<button type="button" id="pay" class="btn btn-block bg-blue waves-effect">Pay</button>
|
<button type="button" id="pay" class="btn btn-block bg-blue waves-effect">Pay</button>
|
||||||
<button type="button" id="void" class="btn btn-block bg-blue waves-effect" active="<%= can? :overall_void, :void %>"> Void</button>
|
<button type="button" id="void" class="btn btn-block bg-blue waves-effect" active="<%= can? :overall_void, :void %>"> Void</button>
|
||||||
|
|||||||
@@ -348,6 +348,7 @@
|
|||||||
<button type="button" class="btn bg-blue btn-block" id='edit'>Edit</button>
|
<button type="button" class="btn bg-blue btn-block" id='edit'>Edit</button>
|
||||||
<button type="button" id="discount" class="btn bg-blue btn-block" >Discount</button>
|
<button type="button" id="discount" class="btn bg-blue btn-block" >Discount</button>
|
||||||
<button type="button" id="other-charges" class="btn bg-blue btn-block" >Charges</button>
|
<button type="button" id="other-charges" class="btn bg-blue btn-block" >Charges</button>
|
||||||
|
|
||||||
<button type="button" id="commissions" class="btn btn-block bg-blue waves-effect">Commissions</button>
|
<button type="button" id="commissions" class="btn btn-block bg-blue waves-effect">Commissions</button>
|
||||||
<button type="button" id="in_duties" class="btn btn-block bg-blue waves-effect">In Duties</button>
|
<button type="button" id="in_duties" class="btn btn-block bg-blue waves-effect">In Duties</button>
|
||||||
<!-- <button type="button" class="btn bg-blue btn-block" id='move' disabled="">Move</button> -->
|
<!-- <button type="button" class="btn bg-blue btn-block" id='move' disabled="">Move</button> -->
|
||||||
|
|||||||
Reference in New Issue
Block a user