Statement email sends incorrect outstanding amount in email body.

Version v5.13.37

Environment: Docker

Checklist

  • Can you replicate the issue on our v5 demo site https://demo.invoiceninja.com or Invoice Ninja? - I can’t send emails using the demo site and therefore cannot replicate.
  • Have you searched existing issues? Yes
  • Have you inspected the logs in storage/logs/laravel.log for any errors? This isn’t an error that can be identified through logs.

Describe the bug

When you send an account statement to a customer the delivered email has an incorrect amount, this email template is not editable via the user interface and therefore the client is being sent misleading information.
The email send to the customer states, “Please find attached your account statement from showing an outstanding balance of £173.60,” that amount listed in the email is actually the amount the customer has previously paid, not the outstanding amount.

Steps To Reproduce

  1. Create an Invoice for an amount, mark as paid.
  2. Create a second Invoice for a different amount, do not mark as paid.
  3. Visit the customer’s page - Client 1 > Dropdown > View Statement > More Actions > Email
  4. View the email sent to the customer- the amount is incorrect in the email, but correct on the PDF statement.

Expected Behavior

The email body outstanding amount to match the statement - “Please find attached your account statement from showing an outstanding balance of £173.60.”.
or
Allowing the contents of the email to be configurable, like Invoice emails, etc.

Additional context

This is a self-hosted docker instance running the latest version of Invoice Ninja debian.

Screenshots

Redacted email received by the customer

Note that the amount is £173.60.

The (redacted) statement attached to the email (and the amount displayed on Ninja)

Note that the outstanding balance due is different to the email.

The customer’s account showing that £173.60 is already paid, linking to the amount sent in the email.

The template and reminders menu (redacted)

Here I would expect to be able to modify the contents of the statement email, like I can do with invoices, etc.

Logs

There are no relevant logs that relate to this event.

Hi,

It looks like it may be a bug, I suggest asking in a discussion on GitHub.