diff --git a/src/hooks/floorPlan/estimate/useEstimateController.js b/src/hooks/floorPlan/estimate/useEstimateController.js index b3c662d7..ec0bbe77 100644 --- a/src/hooks/floorPlan/estimate/useEstimateController.js +++ b/src/hooks/floorPlan/estimate/useEstimateController.js @@ -167,29 +167,31 @@ export const useEstimateController = (planNo) => { if (fileFlg) { estimateData.itemList.map((item) => { - item.amount = item.amount?.replaceAll(',', '') - item.salePrice = parseFloat(item.salePrice?.replaceAll(',', '')).toFixed(2) - item.saleTotPrice = parseFloat(item.saleTotPrice?.replaceAll(',', '')).toFixed(2) + if (item.delFlg === '0') { + item.amount = item.amount?.replaceAll(',', '') + item.salePrice = parseFloat(item.salePrice?.replaceAll(',', '')).toFixed(2) + item.saleTotPrice = parseFloat(item.saleTotPrice?.replaceAll(',', '')).toFixed(2) - if (!item.paDispOrder) { - if (itemFlg) { - if (isNaN(item.amount)) { - item.amount = '0' - } - - if (item.amount < 1) { - itemFlg = false - return alert(getMessage('estimate.detail.save.requiredAmount')) - } - - if (estimateData.estimateType !== 'YJSS') { - if (isNaN(item.salePrice)) { - item.salePrice = '0' + if (!item.paDispOrder) { + if (itemFlg) { + if (isNaN(item.amount)) { + item.amount = '0' } - if (item.salePrice < 1) { + if (item.amount < 1) { itemFlg = false - return alert(getMessage('estimate.detail.save.requiredSalePrice')) + return alert(getMessage('estimate.detail.save.requiredAmount')) + } + + if (estimateData.estimateType !== 'YJSS') { + if (isNaN(item.salePrice)) { + item.salePrice = '0' + } + + if (item.salePrice < 1) { + itemFlg = false + return alert(getMessage('estimate.detail.save.requiredSalePrice')) + } } } }