Skip to content

Commit

Permalink
[TC-5371] Hide the possibility to download the invoice for the POs
Browse files Browse the repository at this point in the history
  • Loading branch information
TamasKerdo committed Aug 25, 2021
1 parent 15c215d commit 63c8eaa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def index
# Massaging the params for the index view like Spree::Admin::Orders#index
params[:q] ||= {}
@search = Spree::BookkeepingDocument.ransack(params[:q])
@is_a_purchase_order = @order.try(:po?)
@bookkeeping_documents = @search.result
@bookkeeping_documents = @bookkeeping_documents.where(printable: @order) if order_focused?
@bookkeeping_documents = @bookkeeping_documents.page(params[:page] || 1).per(10)
Expand Down
8 changes: 5 additions & 3 deletions app/views/spree/admin/bookkeeping_documents/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,11 @@
<td><%= bookkeeping_document.lastname %></td>
<td><%= bookkeeping_document.email %></td>
<td><%= bookkeeping_document.display_total.to_html %></td>
<td class='actions actions-1' data-hook="admin_orders_index_row_actions">
<%= link_to_with_icon "file", "", admin_bookkeeping_document_path(bookkeeping_document, format: :pdf), title: "show_bookkeeping_document_#{bookkeeping_document.id}", no_text: true, target: '_blank' %>
</td>
<% if !@is_a_purchase_order || bookkeeping_document.template != 'invoice' %>
<td class='actions actions-1' data-hook="admin_orders_index_row_actions">
<%= link_to_with_icon "file", "", admin_bookkeeping_document_path(bookkeeping_document, format: :pdf), title: "show_bookkeeping_document_#{bookkeeping_document.id}", no_text: true, target: '_blank' %>
</td>
<% end %>
</tr>
<% end %>
</tbody>
Expand Down

0 comments on commit 63c8eaa

Please sign in to comment.