Add role_invoices
This new role allows users to create invoices without role_finance. Users can then only modify their own created invoices until somebody with the role_finance sets the paid_on value.
This commit is contained in:
parent
273969ac90
commit
1315103a7d
20 changed files with 73 additions and 20 deletions
|
|
@ -6,6 +6,7 @@
|
|||
= f.input :role_article_meta
|
||||
= f.input :role_orders
|
||||
= f.input :role_finance
|
||||
= f.input :role_invoices
|
||||
= f.input :role_admin
|
||||
= render 'shared/group_form_fields', :f => f, captured: captured
|
||||
.form-actions
|
||||
|
|
|
|||
|
|
@ -15,7 +15,8 @@
|
|||
= f.association :supplier, hint: false
|
||||
= f.input :number
|
||||
= f.input :date, as: :date_picker
|
||||
= f.input :paid_on, as: :date_picker
|
||||
- if current_user.role_finance?
|
||||
= f.input :paid_on, as: :date_picker
|
||||
= f.input :amount, as: :string
|
||||
= f.input :deposit, as: :string
|
||||
= f.input :deposit_credit, as: :string
|
||||
|
|
|
|||
|
|
@ -32,6 +32,10 @@
|
|||
= ', ' if index > 0
|
||||
= link_to format_date(order.ends), new_finance_order_path(order_id: order)
|
||||
%td= truncate(invoice.note)
|
||||
%td= link_to t('ui.edit'), edit_finance_invoice_path(invoice), class: 'btn btn-mini'
|
||||
%td= link_to t('ui.delete'), finance_invoice_path(invoice), :data => {:confirm => t('.confirm_delete')}, :method => :delete,
|
||||
class: 'btn btn-danger btn-mini'
|
||||
%td
|
||||
- if invoice.user_can_edit?(current_user)
|
||||
= link_to t('ui.edit'), edit_finance_invoice_path(invoice), class: 'btn btn-mini'
|
||||
%td
|
||||
- if invoice.user_can_edit?(current_user)
|
||||
= link_to t('ui.delete'), finance_invoice_path(invoice), :data => {:confirm => t('.confirm_delete')}, :method => :delete,
|
||||
class: 'btn btn-danger btn-mini'
|
||||
|
|
|
|||
|
|
@ -47,5 +47,6 @@
|
|||
%b= heading_helper(Invoice, :note) + ':'
|
||||
=h @invoice.note
|
||||
|
||||
= link_to t('ui.edit'), edit_finance_invoice_path(@invoice)
|
||||
- if @invoice.user_can_edit?(current_user)
|
||||
= link_to t('ui.edit'), edit_finance_invoice_path(@invoice)
|
||||
= link_to t('ui.or_cancel'), finance_invoices_path
|
||||
|
|
|
|||
|
|
@ -41,6 +41,10 @@
|
|||
= f.label :role_finance
|
||||
%br/
|
||||
= f.check_box :role_finance
|
||||
%p
|
||||
= f.label :role_invoices
|
||||
%br/
|
||||
= f.check_box :role_invoices
|
||||
%p
|
||||
= f.label :role_orders
|
||||
%br/
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
%th Role Suppliers
|
||||
%th Role Article Meta
|
||||
%th Role Finance
|
||||
%th Role Invoices
|
||||
%th Role Orders
|
||||
%th Deleted At
|
||||
%th Contact Person
|
||||
|
|
@ -28,6 +29,7 @@
|
|||
%td= h ordergroup.role_suppliers
|
||||
%td= h ordergroup.role_article_meta
|
||||
%td= h ordergroup.role_finance
|
||||
%td= h ordergroup.role_invoices
|
||||
%td= h ordergroup.role_orders
|
||||
%td= h ordergroup.deleted_at
|
||||
%td= h ordergroup.contact_person
|
||||
|
|
|
|||
|
|
@ -41,6 +41,10 @@
|
|||
= f.label :role_finance
|
||||
%br/
|
||||
= f.check_box :role_finance
|
||||
%p
|
||||
= f.label :role_invoices
|
||||
%br/
|
||||
= f.check_box :role_invoices
|
||||
%p
|
||||
= f.label :role_orders
|
||||
%br/
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
%th Role Suppliers
|
||||
%th Role Article Meta
|
||||
%th Role Finance
|
||||
%th Role Invoices
|
||||
%th Role Orders
|
||||
%th Deleted At
|
||||
%th Contact Person
|
||||
|
|
@ -28,6 +29,7 @@
|
|||
%td= h workgroup.role_suppliers
|
||||
%td= h workgroup.role_article_meta
|
||||
%td= h workgroup.role_finance
|
||||
%td= h workgroup.role_invoices
|
||||
%td= h workgroup.role_orders
|
||||
%td= h workgroup.deleted_at
|
||||
%td= h workgroup.contact_person
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue