Check if invoice file exists before generating an invoice

Created on 11 December 2020, over 3 years ago

Problem/Motivation

Following scenario happened on one of our sites:
We implemented a commerce store into an existing drupal site. We placed a test order and generated an invoice. Before going live with the eshop we deleted both of them and resetted the number patterns. When a real order was placed by a customer, he was sent a wrong invoice pdf (the one from the test order).

Proposed resolution

This happens because the pdf does not get deleted on invoice entity delete event (which I suppose is a desired behaviour). I understand that we should have cleared the invoice files manually before going live (or do such things in a testing environment), but I still think that we should check for an existing invoice pdf when generating an invoice, inform the administrator about the problem and probably not generate the invoice until the issue is resolved.

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΈπŸ‡°Slovakia gresko8

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ͺπŸ‡ΈSpain prodigia Malaga

    I've encountered a similar issue. I've deleted invoices and PDF files, but when I generate new invoices, the test invoice still appears. Could you please explain how to completely delete the invoice entity?

Production build 0.69.0 2024