Skip to content

Commit

Permalink
feat: add accounting buttons in order management views (usability enh…
Browse files Browse the repository at this point in the history
…ancement) (#1061)

* add accounting button in order show view
* add accounting buttons in order management index view
  • Loading branch information
twothreenine committed Apr 5, 2024
1 parent 790a263 commit d6a92bf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 2 additions & 0 deletions app/views/orders/index.html.haml
Expand Up @@ -58,6 +58,8 @@
%td
- unless order.stockit?
= receive_button order, class: 'btn-small'
- if current_user.role_finance?
= link_to t('finance.balancing.orders.clear'), new_finance_order_path(order_id: order.id), class: 'btn btn-small btn-primary'

%td
= link_to t('ui.copy'), new_order_path(order_id: order), class: 'btn btn-small'
Expand Down
13 changes: 8 additions & 5 deletions app/views/orders/show.html.haml
Expand Up @@ -75,11 +75,14 @@
- else
= link_to t('.stock_order'), new_group_order_path(order_id: @order.id, stock_order: true), class: 'btn'
= link_to t('ui.edit'), edit_order_path(@order), class: 'btn'
- elsif not @order.closed? and not @order.stockit?
= link_to t('.send_to_supplier'), send_result_to_supplier_order_path(@order), method: :post,
class: "btn#{' btn-primary' unless @order.last_sent_mail}",
data: {confirm: @order.last_sent_mail && t('.confirm_send_to_supplier', when: format_time(@order.last_sent_mail)) }
= receive_button @order
- elsif not @order.closed?
- unless @order.stockit?
= link_to t('.send_to_supplier'), send_result_to_supplier_order_path(@order), method: :post,
class: "btn#{' btn-primary' unless @order.last_sent_mail}",
data: {confirm: @order.last_sent_mail && t('.confirm_send_to_supplier', when: format_time(@order.last_sent_mail)) }
= receive_button @order
- if current_user.role_finance?
= link_to t('finance.balancing.orders.clear'), new_finance_order_path(order_id: @order.id), class: 'btn btn-primary'
- unless @order.closed?
= link_to t('ui.delete'), @order, data: {confirm: t('.confirm_delete')}, method: :delete,
class: 'btn btn-danger'
Expand Down

0 comments on commit d6a92bf

Please sign in to comment.