mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-05 22:26:07 +00:00
fix display invoice tab
This commit is contained in:
@@ -357,6 +357,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,10 +61,11 @@
|
||||
%li{ class: adjustments_classes }
|
||||
= link_to_with_icon 'icon-cogs', t(:adjustments), spree.admin_order_adjustments_url(@order)
|
||||
|
||||
- if feature?(:invoices)
|
||||
- invoices_classes = "active" if current == 'Invoices'
|
||||
%li{ class: invoices_classes }
|
||||
= link_to_with_icon 'icon-cogs', t(:invoices), spree.admin_order_invoices_url(@order)
|
||||
- if feature?(:invoices, spree_current_user)
|
||||
- if @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)
|
||||
|
||||
- if @order.completed?
|
||||
- authorizations_classes = "active" if current == "Return Authorizations"
|
||||
|
||||
Reference in New Issue
Block a user