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

[cms] Fresh domain invoices are not shown if using an old month #1589

Open
xaur opened this issue Nov 30, 2021 · 0 comments
Open

[cms] Fresh domain invoices are not shown if using an old month #1589

xaur opened this issue Nov 30, 2021 · 0 comments

Comments

@xaur
Copy link

xaur commented Nov 30, 2021

Reproduce:

  1. Submit an invoice with Year+Month more than 6 months back
  2. As a different user of same domain as invoice's line items (but not an admin), open Domain Invoices

Result: The new invoice is not visible to the reviewing domain peer, even though it has been created/edited very recently.

I *guess* the root cause is that invoice's Year and Month are used for the "6 months back" display filtering:

date := time.Date(int(inv.Input.Year), time.Month(inv.Input.Month), 0, 0, 0, 0, 0, time.UTC)

If so, this allows to sneak in an invoice with an older month without domain peers noticing it.

A more bullet-proof behavior would be to use invoice's edited/modified timestamp for age filtering, since it is controlled by the server and not the user (unlike Year+Month).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant