Errors in browser console when trying to calculate total cost without entering requested quantity on the non full supply tab

Description

While working on the https://openlmis.atlassian.net/browse/OLMIS-2466#icft=OLMIS-2466 I've noticed that removing requested quantity from one of the non full supply items results in a lot of errors in the browser console.

openlmis.js:9 TypeError: Cannot read property 'push' of undefined at Object.calculateAverageConsumption [as averageConsumption] (https://test.openlmis.org/openlmis.js:56:8077) at getColumnValue (https://test.openlmis.org/openlmis.js:56:9683) at Object.calculateMaximumStockQuantity [as maximumStockQuantity] (https://test.openlmis.org/openlmis.js:56:9054) at getColumnValue (https://test.openlmis.org/openlmis.js:56:9683) at calculateOrderQuantity (https://test.openlmis.org/openlmis.js:56:9453) at getOrderQuantity (https://test.openlmis.org/openlmis.js:56:8807) at Object.calculatePacksToShip [as packsToShip] (https://test.openlmis.org/openlmis.js:56:6774) at Object.calculateTotalCost [as totalCost] (https://test.openlmis.org/openlmis.js:56:7250) at https://test.openlmis.org/openlmis.js:57:10446 at Array.forEach (native)

Acceptance criteria

  • No more errors in browser console when emptying requested quantity on one of the non full supply products.

  • Calculations related to the requested quantity work as they should.

Environment

None

QAlity Plus - Test Management

Checklists

Activity

Lucyna Laska 
May 17, 2017 at 9:40 AM

Now it's okay. I do not see the errors.

Done
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Story Points

Original estimate

Time tracking

4h logged

Components

Sprint

Fix versions

Priority

Time Assistant

Created May 15, 2017 at 12:34 PM
Updated December 29, 2021 at 12:36 PM
Resolved May 17, 2017 at 9:40 AM