From 8252e9a96332092abdb9df85ef64abc1c0c893b7 Mon Sep 17 00:00:00 2001 From: Jonathan Niles Date: Sun, 6 Dec 2020 07:29:19 +0100 Subject: [PATCH] fix(reports): updates vars in stock exp. report This commit fixes the stock expiration report which no longer worked after the variable case change landed in the stock performance updates. --- server/controllers/stock/reports/stock/expiration_report.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/controllers/stock/reports/stock/expiration_report.js b/server/controllers/stock/reports/stock/expiration_report.js index cbb9feaf69..4d1ce841c5 100644 --- a/server/controllers/stock/reports/stock/expiration_report.js +++ b/server/controllers/stock/reports/stock/expiration_report.js @@ -39,8 +39,9 @@ async function stockExpirationReport(req, res, next) { delete options.label; // define month average and the algo to use - options.monthAverageConsumption = req.session.stock_settings.month_average_consumption; - options.averageConsumptionAlgo = req.session.stock_settings.average_consumption_algo; + // eslint-disable-next-line + const { month_average_consumption, average_consumption_algo } = req.session.stock_settings; + _.extend(options, { month_average_consumption, average_consumption_algo }); // get the lots for this depot const lots = await stockCore.getLotsDepot(options.depot_uuid, options);