Index: src/stock-adjustment-mobile/add-products-page/add-product-page.jsx =================================================================== diff -u -N -r9cd9fddd897288549e91a306f9b33e8a51d54be9 -r0f27e4111baccf6dba30207bd168429576fa830f --- src/stock-adjustment-mobile/add-products-page/add-product-page.jsx (.../add-product-page.jsx) (revision 9cd9fddd897288549e91a306f9b33e8a51d54be9) +++ src/stock-adjustment-mobile/add-products-page/add-product-page.jsx (.../add-product-page.jsx) (revision 0f27e4111baccf6dba30207bd168429576fa830f) @@ -24,7 +24,7 @@ import InputField from '../../react-components/form-fields/input-field'; import SelectField from '../../react-components/form-fields/select-field'; import ReadOnlyField from '../../react-components/form-fields/read-only-field'; -import { formatLot, formatDate, formatDateISO } from '../format-utils'; +import { formatLot, formatDate, formatDateISO, isQuantityNotFilled } from '../format-utils'; import AddButton from '../../react-components/buttons/add-button'; import { appendToAdjustment } from '../reducers/adjustment'; @@ -48,8 +48,7 @@ delete itemsVal.items[0].lot; } const lotCode = null; - const stockOnHand = getStockOnHand(orderable, lotCode); - return stockOnHand; + return getStockOnHand(orderable, lotCode); } } }, @@ -59,17 +58,12 @@ stockOnHand: (productVal, itemsVal) => { const orderable = itemsVal.items[0]?.product ?? []; const lotCode = itemsVal.items[0]?.lot?.lotCode ?? null; - const stockOnHand = getStockOnHand(orderable, lotCode); - return stockOnHand; + return getStockOnHand(orderable, lotCode); } } } ), []); - const isQuantityNotFilled = (quantity) => { - return _.isUndefined(quantity) || _.isNull(quantity) || _.isNaN(quantity) || quantity === ""; - } - const validate = values => { const errors = { items: [] };