견적서 상세 봄제품
This commit is contained in:
parent
96290ea060
commit
706af69fef
@ -661,12 +661,14 @@ export default function Estimate({ params }) {
|
||||
bomItem.salePrice = '0'
|
||||
bomItem.saleTotPrice = '0'
|
||||
bomItem.unitPrice = '0'
|
||||
bomItem.showSalePrice = '0'
|
||||
} else {
|
||||
bomItem.dispOrder = (index + 1 + Number(dispOrder)).toString()
|
||||
bomItem.paDispOrder = dispOrder
|
||||
bomItem.salePrice = '0'
|
||||
bomItem.saleTotPrice = '0'
|
||||
bomItem.unitPrice = '0'
|
||||
bomItem.showSalePrice = '0'
|
||||
}
|
||||
|
||||
bomItem.delFlg = '0'
|
||||
@ -748,12 +750,10 @@ export default function Estimate({ params }) {
|
||||
makeUniqueSpecialNoteCd(itemList)
|
||||
|
||||
itemList.forEach((item) => {
|
||||
// console.log('YJOD::::::', item)
|
||||
delete item.showSalePrice
|
||||
delete item.showSaleTotPrice
|
||||
if (item.delFlg === '0') {
|
||||
let amount = Number(item.amount?.replace(/[^0-9]/g, '').replaceAll(',', '')) || 0
|
||||
// let price = Number(item.saleTotPrice?.replaceAll(',', '')) || 0
|
||||
let price
|
||||
if (amount === 0) {
|
||||
price = 0
|
||||
@ -768,6 +768,10 @@ export default function Estimate({ params }) {
|
||||
totals.supplyPrice += price
|
||||
totals.totAmount += amount
|
||||
|
||||
if (item.paDispOrder) {
|
||||
item.showSalePrice = '0'
|
||||
item.showSaleTotPrice = '0'
|
||||
}
|
||||
if (item.openFlg === '1') {
|
||||
item.showSalePrice = '0'
|
||||
item.showSaleTotPrice = '0'
|
||||
@ -777,8 +781,6 @@ export default function Estimate({ params }) {
|
||||
|
||||
totals.vatPrice = totals.supplyPrice * 0.1
|
||||
totals.totPrice = totals.supplyPrice + totals.vatPrice
|
||||
|
||||
// console.log('YJOD:::totlas:::', totals)
|
||||
}
|
||||
|
||||
const calculateYJSSTotals = (itemList) => {
|
||||
@ -787,7 +789,6 @@ export default function Estimate({ params }) {
|
||||
itemList.forEach((item) => {
|
||||
if (item.delFlg === '0') {
|
||||
let amount = Number(item.amount?.replace(/[^0-9]/g, '').replaceAll(',', '')) || 0
|
||||
// let salePrice = Number(item.salePrice?.replaceAll(',', '')) || 0
|
||||
let salePrice
|
||||
if (item.moduleFlg === '1') {
|
||||
const volKw = (item.pnowW * amount) / 1000
|
||||
@ -810,6 +811,14 @@ export default function Estimate({ params }) {
|
||||
item.showSalePrice = '0'
|
||||
item.showSaleTotPrice = '0'
|
||||
}
|
||||
} else {
|
||||
item.showSalePrice = '0'
|
||||
item.showSaleTotPrice = '0'
|
||||
}
|
||||
|
||||
if (item.openFlg === '1') {
|
||||
item.showSalePrice = '0'
|
||||
item.showSaleTotPrice = '0'
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -818,18 +827,15 @@ export default function Estimate({ params }) {
|
||||
totals.supplyPrice = totals.addSupplyPrice + totals.pkgTotPrice
|
||||
totals.vatPrice = totals.supplyPrice * 0.1
|
||||
totals.totPrice = totals.supplyPrice + totals.vatPrice
|
||||
|
||||
// console.log('YJOD:::totlas:::', totals)
|
||||
}
|
||||
|
||||
if (estimateContextState.estimateType === 'YJOD') {
|
||||
calculateYJODTotals(estimateContextState.itemList)
|
||||
setEstimateContextState({
|
||||
totAmount: totals.totAmount,
|
||||
totVolKw: totals.totVolKw.toFixed(2),
|
||||
supplyPrice: totals.supplyPrice.toFixed(2),
|
||||
vatPrice: totals.vatPrice.toFixed(2),
|
||||
totPrice: totals.totPrice.toFixed(2),
|
||||
supplyPrice: totals.supplyPrice.toFixed(0), //소수첫자리에서 반올림
|
||||
vatPrice: totals.vatPrice.toFixed(0), //소수첫자리에서 반올림
|
||||
totPrice: totals.totPrice.toFixed(0), //소수첫자리에서 반올림
|
||||
})
|
||||
} else if (estimateContextState.estimateType === 'YJSS') {
|
||||
calculateYJSSTotals(estimateContextState.itemList)
|
||||
@ -837,9 +843,9 @@ export default function Estimate({ params }) {
|
||||
pkgTotPrice: totals.pkgTotPrice,
|
||||
totAmount: totals.totAmount,
|
||||
totVolKw: totals.totVolKw.toFixed(2),
|
||||
supplyPrice: totals.supplyPrice.toFixed(2),
|
||||
vatPrice: totals.vatPrice.toFixed(2),
|
||||
totPrice: totals.totPrice.toFixed(2),
|
||||
supplyPrice: totals.supplyPrice.toFixed(0), //소수첫자리에서 반올림
|
||||
vatPrice: totals.vatPrice.toFixed(0), //소수첫자리에서 반올림
|
||||
totPrice: totals.totPrice.toFixed(0), //소수첫자리에서 반올림
|
||||
})
|
||||
}
|
||||
|
||||
@ -1312,15 +1318,15 @@ export default function Estimate({ params }) {
|
||||
</div>
|
||||
<div className="estimate-box">
|
||||
<div className="estimate-tit">{getMessage('estimate.detail.sepcialEstimateProductInfo.supplyPrice')}</div>
|
||||
<div className="estimate-name blue">{convertNumberToPriceDecimal(estimateContextState?.supplyPrice)}</div>
|
||||
<div className="estimate-name blue">{convertNumberToPriceDecimalToFixed(estimateContextState?.supplyPrice, 0)}</div>
|
||||
</div>
|
||||
<div className="estimate-box">
|
||||
<div className="estimate-tit">{getMessage('estimate.detail.sepcialEstimateProductInfo.vatPrice')}</div>
|
||||
<div className="estimate-name blue">{convertNumberToPriceDecimal(estimateContextState?.vatPrice)}</div>
|
||||
<div className="estimate-name blue">{convertNumberToPriceDecimalToFixed(estimateContextState?.vatPrice, 0)}</div>
|
||||
</div>
|
||||
<div className="estimate-box">
|
||||
<div className="estimate-tit">{getMessage('estimate.detail.sepcialEstimateProductInfo.totPrice')}</div>
|
||||
<div className="estimate-name red">{convertNumberToPriceDecimal(estimateContextState?.totPrice)}</div>
|
||||
<div className="estimate-name red">{convertNumberToPriceDecimalToFixed(estimateContextState?.totPrice, 0)}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -1491,7 +1497,6 @@ export default function Estimate({ params }) {
|
||||
<div className="form-flex-wrap">
|
||||
<div className="select-wrap mr5">
|
||||
<Select
|
||||
// id="long-value-select1"
|
||||
name="long-value-select1"
|
||||
instanceId="long-value-select1"
|
||||
className="react-select-custom"
|
||||
@ -1560,15 +1565,17 @@ export default function Estimate({ params }) {
|
||||
className="input-light al-r"
|
||||
value={convertNumberToPriceDecimal(item?.showSalePrice === '0' ? null : item?.salePrice?.replaceAll(',', ''))}
|
||||
disabled={
|
||||
estimateContextState?.estimateType === 'YJSS'
|
||||
? item?.paDispOrder
|
||||
? true
|
||||
: item.pkgMaterialFlg !== '1'
|
||||
: item.itemId === '' || !!item?.paDispOrder
|
||||
? true
|
||||
: item.openFlg === '1'
|
||||
item.openFlg === '1'
|
||||
? true
|
||||
: estimateContextState?.estimateType === 'YJSS'
|
||||
? item?.paDispOrder
|
||||
? true
|
||||
: false
|
||||
: item.pkgMaterialFlg !== '1'
|
||||
: item.itemId === '' || !!item?.paDispOrder
|
||||
? true
|
||||
: item.openFlg === '1'
|
||||
? true
|
||||
: false
|
||||
}
|
||||
onChange={(e) => {
|
||||
onChangeSalePrice(e.target.value, item.dispOrder, index)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user