Remove incorrect calculation percent change factor for value.

This was causing a double dipping of value changes. Along with this
change was a manual purge of the changes that mistakenly were made.
Luckily they were easy to find:
    l.doc->>'type' = 'scale_vp'
    iter = 'adj price'
This commit is contained in:
PhilRunninger 2023-09-12 20:45:18 -04:00
parent 3fa2cb07f5
commit e87c0ecc62

View File

@ -246,7 +246,7 @@ FROM
WHEN (SELECT coalesce(sum(value_loc),0) FROM volume) = 0 -- Get a per-unit pincr value
THEN (SELECT pincr::numeric FROM target) / (SELECT nullif(sum(units),0) FROM volume)
ELSE -- Find percent change for existing value_loc
(SELECT pincr::numeric FROM target) / (SELECT nullif(sum(value_loc * r_rate),0) FROM volume)
(SELECT pincr::numeric FROM target) / (SELECT nullif(sum(value_loc),0) FROM volume) - 1
END factor
)
-- select * from pscale