Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Invoices] Bulk printing invoices must show error if ABN is required but not set #12373

Closed
drummer83 opened this issue Apr 12, 2024 · 2 comments · Fixed by #12458 or #12605
Closed

[Invoices] Bulk printing invoices must show error if ABN is required but not set #12373

drummer83 opened this issue Apr 12, 2024 · 2 comments · Fixed by #12458 or #12605
Assignees
Labels
bug-s3 The bug is stopping a critical or non-critical feature but there is a usable workaround.
Milestone

Comments

@drummer83
Copy link
Contributor

drummer83 commented Apr 12, 2024

Description

This should only be fixed under invoice feature toggle

Similar to #12374.

When an instance has the setting "Require an ABN to generate an invoice" ACTIVE, then an error is shown in case an enterprise without ABN tries to generate an invoice. Currently this is only working on the Edit Order page (/admin/orders/Rxxx/edit).
The exact same error has to be shown as well, if invoices are to be generated on the orders page via bulk action (/admin/orders). Currently there is no such error on this page.

In case of selected orders of multiple enterprises, no invoice should be printed at all after the error message was shown, even in case some of the enterprises have the ABN set correctly. The error message must be shown for each enterprise with missing ABN or all of the enterprises with missing ABN must be listed in the error message.

The error shall be shown independently from:

  • New admin v3 feature toggle activated/deactivated
  • Enterprise setting "Charges GST" activated/deactivated

Expected Behavior

The error "Enterprise XY must have a valid ABN before invoices can be used." must be shown on the orders page when generating an invoice in case the instance has the setting "Require an ABN to generate an invoice" ACTIVE, and the enterprise has no ABN set.

Actual Behaviour

There is no error when generating an invoice on the orders page while the setting "Require an ABN to generate an invoice" is ACTIVE and the enterprise has no ABN set.

Steps to Reproduce

Make sure this is only done when feature toggle "invoices" is turned ON

  1. As super admin activate the setting "Require an ABN to generate an invoice" (/admin/invoice_settings/edit).
  2. As admin user (or super admin user) create an enterprise and leave the ABN field empty (/admin/enterprises/<Enterprise xy>/edit#/business_details_panel). You can also use an existing enterprise and delete the input of the ABN setting.
  3. Make sure there is a completed order available for that enterprise.
  4. On page /admin/orders select the checkbox of the order and choose 'Print invoices' from the 'Actions' dropdown menu.
  5. Check if the error is shown or not.

Animated Gif/Screenshot

Instance setting:
image

Enterprise ABN setting:
image

Create invoice on Orders page:
image

Expected error message. It is currently only shown when generating the invoice on the Edit Order page:
image

Workaround

Severity

bug-s3: a feature is broken but there is a workaround

Your Environment

  • Version used:
  • Browser name and version:
  • Operating System and version (desktop or mobile):

Possible Fix

@drummer83 drummer83 added the bug-s3 The bug is stopping a critical or non-critical feature but there is a usable workaround. label Apr 12, 2024
@RachL RachL added this to the Invoices milestone Apr 12, 2024
@abdellani abdellani self-assigned this May 9, 2024
filipefurtad0 added a commit to filipefurtad0/openfoodnetwork that referenced this issue Jun 13, 2024
…n#12374 and openfoodfoundation#12373

When the invoices feature is deactivated, users should still be able to bulk print or send invoices
filipefurtad0 added a commit to filipefurtad0/openfoodnetwork that referenced this issue Jun 18, 2024
…n#12374 and openfoodfoundation#12373

When the invoices feature is deactivated, users should still be able to bulk print or send invoices

Adds assertions for bulk invoice actions with empty ABN
@filipefurtad0 filipefurtad0 reopened this Jun 19, 2024
rioug added a commit that referenced this issue Jun 24, 2024
…tion

Adds test case to assure acceptance criteria from #12374 and #12373
@drummer83
Copy link
Contributor Author

@RachL Same question here: Do we want to fix this for the invoices feature toggle off?
It's less critical here compared to sending the invoices (this is printing here) because the printing is actually being carried out.

@RachL
Copy link
Contributor

RachL commented Aug 23, 2024

@drummer83 no, I know it's weird, but the deal with instance managers is that we keep letting users print without ABN as long as the invoices are not more compliant (helps those who want to print for packing purposes). However when the toggle gets released, this is needed.
So no changes to introduce on the current PDF 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-s3 The bug is stopping a critical or non-critical feature but there is a usable workaround.
Projects
Status: Done
4 participants