sqldb: fix end date filter when querying invoices

Previously, the SQL implementation of the invoice query simply
converted the start and end timestamps to time and used them
in SQL queries to check for inclusivity. However, this logic
failed when the start and end timestamps were equal.

This commit addresses and corrects this issue.
This commit is contained in:
Andras Banki-Horvath
2024-08-30 16:31:04 +02:00
parent b57910ee3a
commit 06d4267a76
3 changed files with 5 additions and 3 deletions

View File

@ -78,7 +78,7 @@ WHERE (
created_at >= $6 OR
$6 IS NULL
) AND (
created_at <= $7 OR
created_at < $7 OR
$7 IS NULL
) AND (
CASE

View File

@ -76,7 +76,7 @@ WHERE (
created_at >= sqlc.narg('created_after') OR
sqlc.narg('created_after') IS NULL
) AND (
created_at <= sqlc.narg('created_before') OR
created_at < sqlc.narg('created_before') OR
sqlc.narg('created_before') IS NULL
) AND (
CASE