From 31dea3e8561013cd9317cdc094e80dde8ef9e99e Mon Sep 17 00:00:00 2001 From: lomamech Date: Thu, 4 Mar 2021 10:30:38 +0100 Subject: [PATCH] Clean and sanitaze code --- .../modals/consumption_lot.modal.js | 43 ------------------- .../stock/exit/exitAggregateConsumption.js | 2 +- 2 files changed, 1 insertion(+), 44 deletions(-) diff --git a/client/src/modules/stock/aggregated_consumption/modals/consumption_lot.modal.js b/client/src/modules/stock/aggregated_consumption/modals/consumption_lot.modal.js index 609cc68c8c..0042b8a83a 100644 --- a/client/src/modules/stock/aggregated_consumption/modals/consumption_lot.modal.js +++ b/client/src/modules/stock/aggregated_consumption/modals/consumption_lot.modal.js @@ -37,7 +37,6 @@ function StockConsumptionLotsModalController( vm.submit = submit; vm.cancel = cancel; - vm.onLotBlur = onLotBlur; vm.onChanges = onChanges; vm.onChangeQuantity = onChangeQuantity; vm.onChangeUnitCost = onChangeUnitCost; @@ -103,10 +102,6 @@ function StockConsumptionLotsModalController( }; function init() { - if (cache.enableFastInsert) { - vm.enableFastInsert = cache.enableFastInsert; - } - if (vm.form.rows.length) { return; } vm.form.addItem(); @@ -116,44 +111,6 @@ function StockConsumptionLotsModalController( vm.gridApi = api; } - /** - * @method onLotBlur - * - * @description - * if the fast insert option is enable do this : - * - add new row automatically on blur - * - set the focus in the new row - * @param {string} rowLot the row.entity.lot string - */ - function onLotBlur(rowLot) { - if (vm.enableFastInsert && rowLot) { - - const emptyLotRow = getFirstEmptyLot(); - - if (emptyLotRow) { - // don't add new row but focus on the empty lot row - Focus(emptyLotRow.identifier); - } else { - // add a new row - const newLotRow = vm.form.addItem(); - // set the focus on the new row - Focus(newLotRow.identifier); - } - } - } - - function getFirstEmptyLot() { - let line; - for (let i = 0; i < vm.form.rows.length; i++) { - const row = vm.form.rows[i]; - if (!row.lot || row.lot.length === 0) { - line = row; - break; - } - } - return line; - } - function onChanges() { vm.errors = vm.form.validate(); vm.gridApi.core.notifyDataChange(uiGridConstants.dataChange.EDIT); diff --git a/server/controllers/stock/reports/stock/exit/exitAggregateConsumption.js b/server/controllers/stock/reports/stock/exit/exitAggregateConsumption.js index b9be54c210..9f086f6990 100644 --- a/server/controllers/stock/reports/stock/exit/exitAggregateConsumption.js +++ b/server/controllers/stock/reports/stock/exit/exitAggregateConsumption.js @@ -5,7 +5,7 @@ const EXIT_AGGREGATED_CONSUMPTION_ID = 16; /** * @function fetch - * @description fetch stock exit for patient + * @description fetch stock exit for Aggregate consumption */ function fetch(depotUuid, dateFrom, dateTo, showDetails) { const sql = `