aboutsummaryrefslogtreecommitdiff
path: root/src/components/editors/item-editor.js
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.xyz>2022-10-13 14:28:29 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.xyz>2022-10-13 14:28:29 +0530
commit097a393b2bf170d69ba1cef16c5e70f204e2fe65 (patch)
tree91254e3de332506be13cff7bea74cca170fe3efc /src/components/editors/item-editor.js
parent300a4eb39ccea56da416d83400cddc97118e1649 (diff)
added an invoice summary component
Diffstat (limited to 'src/components/editors/item-editor.js')
-rw-r--r--src/components/editors/item-editor.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/components/editors/item-editor.js b/src/components/editors/item-editor.js
index eb6e8c1..d72cff3 100644
--- a/src/components/editors/item-editor.js
+++ b/src/components/editors/item-editor.js
@@ -28,7 +28,7 @@ const ItemEditor = (props) => {
const [unit, setUnit] = useState(props.item.UnitOfMeasure);
const [unitPrice, setUnitPrice] = useState(props.item.UnitPrice);
const [gstP, setGSTP] = useState(props.item.GSTPercentage);
- const [minQty, setMinQty] = useState(props.item.MinQuantity);
+ const [minQty, setMinQty] = useState(props.item.MinQuantity > 0 ? props.item.MinQuantity : 1);
const [maxQty, setMaxQty] = useState(props.item.MaxQuantity);
const [brand, setBrand] = useState(props.item.Brand);
const [savedBrands, setSavedBrands] = useState([]);
@@ -163,7 +163,7 @@ const ItemEditor = (props) => {
Minimum Quantity:
<input
type="number"
- value={minQty == "0" ? "" : minQty}
+ value={minQty === 0 ? "" : minQty}
min="0"
onChange={(e) => setMinQty(e.target.value)} />
</label>
@@ -172,7 +172,7 @@ const ItemEditor = (props) => {
Maximum Quantity:
<input
type="number"
- value={maxQty == "0" ? "" : maxQty}
+ value={maxQty === 0 ? "" : maxQty}
min="0"
onChange={(e) => setMaxQty(e.target.value)} />
</label>