add a floor date to prevent adjusting actual history based on the supplied timestamp

This commit is contained in:
Paul Trowbridge 2021-07-16 10:20:32 -04:00
parent 28c14ece67
commit c48e52f95c
1 changed files with 8 additions and 1 deletions

View File

@ -691,5 +691,12 @@ function build_where(req, c, w, d, args) {
args.push(req.body.scenario[i]);
c = c + 1;
};
//if the request has a stamp, then it's an adjustment
//prevent making adjustment to actual history by limiting to current stamp and beyond
if (req.body.stamp) {
w = w +
`
AND order_date >= '` + req.body.stamp + "'::date";
}
return { c, w, d };
}
}