mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Merge pull request #11327 from bouaik/fix-display-invoice-tab-for-completed-resumed-canceled-only
Fix display invoice tab for completed, resumed and canceled orders only
This commit is contained in:
@@ -361,6 +361,10 @@ module Spree
|
||||
complete? || resumed? || awaiting_return? || returned?
|
||||
end
|
||||
|
||||
def can_show_invoice?
|
||||
complete? || resumed? || canceled?
|
||||
end
|
||||
|
||||
# Finalizes an in progress order after checkout is complete.
|
||||
# Called after transition to complete state when payments will have been processed
|
||||
def finalize!
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
%li{ class: adjustments_classes }
|
||||
= link_to_with_icon 'icon-cogs', t(:adjustments), spree.admin_order_adjustments_url(@order)
|
||||
|
||||
- if feature?(:invoices)
|
||||
- if feature?(:invoices) && @order.can_show_invoice?
|
||||
- invoices_classes = "active" if current == 'Invoices'
|
||||
%li{ class: invoices_classes }
|
||||
= link_to_with_icon 'icon-cogs', t(:invoices), spree.admin_order_invoices_url(@order)
|
||||
|
||||
@@ -1123,8 +1123,7 @@ describe '
|
||||
visit spree.edit_admin_order_path(order_empty)
|
||||
end
|
||||
|
||||
it "displays the invoice tab" do
|
||||
pending "issue #11240"
|
||||
it "should not display the invoice tab" do
|
||||
expect(page).to have_content "Cart".upcase
|
||||
expect(page).not_to have_content "Invoices".upcase
|
||||
end
|
||||
@@ -1140,8 +1139,7 @@ describe '
|
||||
visit spree.edit_admin_order_path(order4)
|
||||
end
|
||||
|
||||
it "displays the invoice tab" do
|
||||
pending "issue #11240"
|
||||
it "should not display the invoice tab" do
|
||||
expect(page).to have_content "Payment".upcase
|
||||
expect(page).not_to have_content "Invoices".upcase
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user