Skip to content

Commit

Permalink
period of cover cannot be negative
Browse files Browse the repository at this point in the history
  • Loading branch information
hichamlahlou committed Jan 20, 2025
1 parent 8fad086 commit cbe59b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion freppledb/output/views/buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,7 @@ def query(reportclass, request, basequery, sortsql="1 asc"):
select case
when periodofcover = 999 * 24 * 3600
then '999 days'::interval
else date_trunc('day', least( periodofcover * '1 sec'::interval + flowdate - greatest(d.startdate,arguments.report_currentdate), '999 days'::interval))
else greatest (interval '0 day', date_trunc('day', least( periodofcover * '1 sec'::interval + flowdate - greatest(d.startdate,arguments.report_currentdate), '999 days'::interval)))
end
from operationplanmaterial
where flowdate < greatest(d.startdate,arguments.report_currentdate)
Expand Down

0 comments on commit cbe59b5

Please sign in to comment.