-
-
- <% if @credit_mutations.empty? && @orders.empty? %>
-
-
-
+ <% if policy(Activity).summary? %>
+
+
+ <% if @credit_mutations.empty? && @orders.empty? %>
+
+
+
+
+
+
+
+ Er zijn nog geen bestellingen en er is nog niet ingelegd
+
+
+
+
+
+
+
+ <% else %>
+
+
+
+
+ Resultaat
+ Code
+ Credit
+
+
+
+ <% Product.categories.each do |category| %>
+ <% if Rails.application.config.x.codes[category.first.to_sym] != nil %>
+
+ <%= t(category.first).capitalize %>
+
+ <%= Rails.application.config.x.codes[category.first.to_sym] %>
+
+
+ <%= number_to_currency(@revenue_by_category[category[0]] || 0, unit: '€') %>
+
+
+ <% end %>
+ <% end %>
+
+ Totaal opbrengsten
+
+
+ <%= number_to_currency(@revenue_total, unit: '€') %>
+
+
+
+
+
+
+
+
+
+
+ Balans
+ Code
+ Debit
+ Credit
+
+
+
+
+ Inleg Zatladder Inlegsysteem
+ <%= Rails.application.config.x.codes[:credit_mutation] %>
+
+
+ <%= number_to_currency(@credit_mutations_total, unit: '€') %>
+
+
+
+ Contante bestellingen
+
+
+ <%= number_to_currency(@revenue_with_cash, unit: '€') %>
+
+
+
+
+ Totaal kas
+
+
+ <%= Rails.application.config.x.codes[:cash] %>
+ <%= number_to_currency(@cash_total, unit: '€') %>
+
+
+
+ Omzet Pin
+ <%= Rails.application.config.x.codes[:pin] %>
+ <%= number_to_currency(@revenue_with_pin, unit: '€') %>
+
+
+
+ Omzet Zatladder Inlegsysteem
+ <%= Rails.application.config.x.codes[:credit_mutation] %>
+ <%= number_to_currency(@revenue_with_credit, unit: '€') %>
+
+
+
+
+
+ <% end %>
+
+ <% end %>
+ <% if policy(Activity).credit_mutations? %>
+
+
+
+ <% if @credit_mutations.empty? %>
- Er zijn nog geen bestellingen en er is nog niet ingelegd
+ Er zijn nog geen correcties en er is nog niet ingelegd
-
-
-
- <% else %>
-
-
+ <% else %>
- Resultaat
- Code
- Credit
+ #
+ Tijd
+ Gebruiker
+ Bedrag
- <% Product.categories.each do |category| %>
- <% if Rails.application.config.x.codes[category.first.to_sym] != nil %>
-
- <%= t(category.first).capitalize %>
-
- <%= Rails.application.config.x.codes[category.first.to_sym] %>
-
-
- <%= number_to_currency(@revenue_by_category[category[0]] || 0, unit: '€') %>
-
-
- <% end %>
+ <% @credit_mutations.each do |mutation| %>
+
+ <%= mutation.id %>
+ <%= l mutation.created_at, format: :time_only %>
+
+ <% if policy(User).show? %>
+ <%= link_to mutation.user.name, mutation.user %>
+ <% else %>
+ <%= mutation.user.name %>
+ <% end %>
+
+ <%= number_to_currency(mutation.amount, unit: '€') %>
+
<% end %>
-
- Totaal opbrengsten
-
-
- <%= number_to_currency(@revenue_total, unit: '€') %>
-
-
-
-
-
-
-
-
-
- Balans
- Code
- Debit
- Credit
-
-
-
-
- Inleg Zatladder Inlegsysteem
- <%= Rails.application.config.x.codes[:credit_mutation] %>
-
-
- <%= number_to_currency(@credit_mutations_total, unit: '€') %>
-
-
-
- Contante bestellingen
-
-
- <%= number_to_currency(@revenue_with_cash, unit: '€') %>
-
-
-
-
- Totaal kas
-
-
- <%= Rails.application.config.x.codes[:cash] %>
- <%= number_to_currency(@cash_total, unit: '€') %>
-
-
-
- Omzet Pin
- <%= Rails.application.config.x.codes[:pin] %>
- <%= number_to_currency(@revenue_with_pin, unit: '€') %>
-
-
-
- Omzet Zatladder Inlegsysteem
- <%= Rails.application.config.x.codes[:credit_mutation] %>
- <%= number_to_currency(@revenue_with_credit, unit: '€') %>
-
-
-
-
-
- <% end %>
-
-
-
-
- <% if @credit_mutations.empty? %>
-
-
-
-
- Er zijn nog geen correcties en er is nog niet ingelegd
-
-
-
-
- <% else %>
-
-
- #
- Tijd
- Gebruiker
- Bedrag
-
-
-
- <% @credit_mutations.each do |mutation| %>
-
- <%= mutation.id %>
- <%= l mutation.created_at, format: :time_only %>
- <%= link_to mutation.user.name, mutation.user %>
- <%= number_to_currency(mutation.amount, unit: '€') %>
-
<% end %>
-
- <% end %>
-
+
+
-
- <% if current_user.treasurer? %>
+ <% end %>
+ <% if policy(Activity).orders? %>
@@ -301,7 +323,7 @@
<% order.order_rows.each_with_index do |order_row, i| %>
<%= order_row.product.name %>
<% if order_row.product_count > 1 %>
- ( <%= order_row.product_count %> x)
+ (<%= order_row.product_count %>x )
<% end %>
<% if i < order.order_rows.size - 1 %>
,
@@ -316,13 +338,15 @@
<% end %>
-
-
-
-
+ <% if policy(Activity).product_totals? %>
+
-
+ <% end %>
diff --git a/app/views/index/index.html.erb b/app/views/index/index.html.erb
index 45247a974..0c14c6fb6 100644
--- a/app/views/index/index.html.erb
+++ b/app/views/index/index.html.erb
@@ -3,7 +3,7 @@
- <% if current_user&.treasurer? || current_user&.main_bartender? %>
+ <% if current_user&.treasurer? || current_user&.renting_manager? || current_user&.main_bartender? %>
- <% unless @invoice.paid? %>
+ <% if policy(Invoice).send_invoice? && !@invoice.paid? %>
<%= link_to pay_invoice_url @invoice.token do %>
Betalen
<% end %>
diff --git a/app/views/partials/_navigation_bar.html.erb b/app/views/partials/_navigation_bar.html.erb
index a70b5f94b..e4ebdf08f 100644
--- a/app/views/partials/_navigation_bar.html.erb
+++ b/app/views/partials/_navigation_bar.html.erb
@@ -13,14 +13,14 @@
<%= fa_icon 'home', class: 'me-2', text: 'Home' %>
<% end %>
- <% if current_user&.main_bartender? || current_user&.treasurer? %>
+ <% if policy(Activity).index? %>
<%= nav_link activities_path, class: 'nav-link' do %>
<%= fa_icon 'calendar', class: 'me-2', text: 'Activiteiten' %>
<% end %>
<% end %>
- <% if current_user&.treasurer? %>
+ <% if current_user&.treasurer? || current_user&.renting_manager? %>
<%= nav_link users_path, class: 'nav-link' do %>
<%= fa_icon 'users', class: 'me-2', text: 'Gebruikers' %>
@@ -31,28 +31,36 @@
<%= fa_icon 'beer', class: 'me-2', text: 'Prijslijsten' %>
<% end %>
+ <% end %>
+ <% if current_user&.treasurer? %>
<%= nav_link credit_mutations_path, class: 'nav-link' do %>
<%= fa_icon 'money', class: 'me-2', text: 'Inleg en saldocorrecties' %>
<% end %>
+ <% end %>
+ <% if policy(:zatladder).index? %>
<%= nav_link zatladder_index_path, class: 'nav-link' do %>
<%= fa_icon 'list', class: 'me-2', text: 'Zatladder' %>
<% end %>
+ <% end %>
+ <% if policy(Invoice).index? %>
<%= nav_link invoices_path, class: 'nav-link' do %>
<%= fa_icon 'shopping-cart', class: 'me-2', text: 'Facturen' %>
<% end %>
- <% if policy(Payment).index? %>
-
- <%= nav_link payments_path, class: 'nav-link' do %>
- <%= fa_icon 'credit-card', class: 'me-2', text: 'Betalingen' %>
- <% end %>
-
- <% end %>
+ <% end %>
+ <% if policy(Payment).index? %>
+
+ <%= nav_link payments_path, class: 'nav-link' do %>
+ <%= fa_icon 'credit-card', class: 'me-2', text: 'Betalingen' %>
+ <% end %>
+
+ <% end %>
+ <% if policy(:finance_overview).index? %>
<%= nav_link finance_overview_index_path, class: 'nav-link' do %>
<%= fa_icon 'money', class: 'me-2', text: 'Financien' %>
diff --git a/app/views/price_lists/index.html.erb b/app/views/price_lists/index.html.erb
index ca0f0c25e..2998d0dba 100644
--- a/app/views/price_lists/index.html.erb
+++ b/app/views/price_lists/index.html.erb
@@ -14,19 +14,23 @@
Hier worden alle prijslijsten en alle producten getoond.
-
- <%= fa_icon 'plus', class: 'me-1' %>
- Nieuwe prijslijst
-
-
-
-
-
- Laat gearchieveerde prijslijsten zien
-
+ <% if policy(PriceList).create? %>
+
+ <%= fa_icon 'plus', class: 'me-1' %>
+ Nieuwe prijslijst
+
+ <% end %>
+ <% if policy(PriceList).archive? %>
+
+
+
+ Laat gearchieveerde prijslijsten zien
+
+
+ <% end %>
-