mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
show warning when a new invoice can be generated
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
- if show_generate_invoice_button?(@order)
|
||||
.alert-box.warning
|
||||
=t(:order_has_changed_and_invoice_might_not_be_up_to_date)
|
||||
|
||||
= render partial: 'spree/admin/shared/order_page_title'
|
||||
= render partial: 'spree/admin/shared/order_tabs', locals: { current: 'Invoices' }
|
||||
|
||||
|
||||
@@ -4182,6 +4182,9 @@ See the %{link} to find out more about %{sitename}'s features and to start using
|
||||
line_item_adjustments: "Line Item Adjustments"
|
||||
order_adjustments: "Order Adjustments"
|
||||
order_total: "Order Total"
|
||||
invoices:
|
||||
index:
|
||||
order_has_changed_and_invoice_might_not_be_up_to_date: "The order has changed since the last invoice update. The invoice shown here might not be up-to-date anymore."
|
||||
overview:
|
||||
enterprises_header:
|
||||
ofn_with_tip: Enterprises are Producers and/or Hubs and are the basic unit of organisation within the Open Food Network.
|
||||
|
||||
@@ -1102,12 +1102,14 @@ describe '
|
||||
expect(page).to have_content "#{customer.first_name} #{customer.last_name} -"
|
||||
expect(page.find("table").text).to have_content(table_header)
|
||||
|
||||
# the New invoice button should be visible
|
||||
# the New invoice button + the warning should be visible
|
||||
expect(page).to have_link "Create or Update Invoice"
|
||||
expect(page).to have_content "The order has changed since the last invoice update. The invoice shown here might not be up-to-date anymore."
|
||||
click_link "Create or Update Invoice"
|
||||
|
||||
# and disappear after clicking
|
||||
expect(page).to have_no_link "Create or Update Invoice"
|
||||
expect(page).to_not have_content "The order has changed since the last invoice update. The invoice shown here might not be up-to-date anymore."
|
||||
|
||||
# creating an invoice, displays a second row
|
||||
expect(page.find("table").text).to have_content(table_contents)
|
||||
|
||||
Reference in New Issue
Block a user