Skip to content

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

@xaur

Description

@xaur

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions