견적서
This commit is contained in:
parent
eaa38270db
commit
3e57d53ec7
@ -702,6 +702,7 @@ export default function Estimate({ params }) {
|
||||
let vatPrice = 0
|
||||
let totPrice = 0
|
||||
let addSupplyPrice = 0
|
||||
let pkgTotPrice = 0
|
||||
if (estimateContextState.estimateType === 'YJOD') {
|
||||
estimateContextState.itemList.sort((a, b) => {
|
||||
return a.dispOrder - b.dispOrder
|
||||
@ -773,20 +774,16 @@ export default function Estimate({ params }) {
|
||||
if (item.moduleFlg === '1') {
|
||||
//용량(Kw)은 모듈플래그 1만 합산
|
||||
const volKw = (item.pnowW * amount) / 1000
|
||||
// const volKw = item.pnowW * amount
|
||||
totVolKw += volKw
|
||||
}
|
||||
setEstimateContextState({
|
||||
pkgTotPrice: estimateContextState.pkgAsp.replaceAll(',', '') * totVolKw * 1000,
|
||||
})
|
||||
//pkgTotPrice
|
||||
|
||||
// const saleTotPrice
|
||||
totAmount += amount
|
||||
if (item.pkgMaterialFlg === '1') {
|
||||
const pkgPrice = amount * salePrice
|
||||
const saleTotPrice = amount * salePrice
|
||||
//다시계산하기
|
||||
//YJSS는 PKG제외상품들만(1) 모아서 수량 * 단가를 공급가액(supplyPrice)에 추가로 더해줌
|
||||
addSupplyPrice += pkgPrice
|
||||
addSupplyPrice += saleTotPrice
|
||||
}
|
||||
|
||||
if (!item.paDispOrder) {
|
||||
@ -798,7 +795,12 @@ export default function Estimate({ params }) {
|
||||
}
|
||||
}
|
||||
})
|
||||
supplyPrice = addSupplyPrice + Number(estimateContextState.pkgTotPrice / 1000)
|
||||
pkgTotPrice = estimateContextState.pkgAsp.replaceAll(',', '') * totVolKw * 1000
|
||||
setEstimateContextState({
|
||||
pkgTotPrice: pkgTotPrice,
|
||||
})
|
||||
|
||||
supplyPrice = addSupplyPrice + pkgTotPrice
|
||||
vatPrice = supplyPrice * 0.1
|
||||
totPrice = supplyPrice + vatPrice
|
||||
setEstimateContextState({
|
||||
@ -811,6 +813,18 @@ export default function Estimate({ params }) {
|
||||
}
|
||||
|
||||
setItemChangeYn(false)
|
||||
} else {
|
||||
estimateContextState.itemList.map((item) => {
|
||||
if (estimateContextState.estimateType === 'YJSS') {
|
||||
if (!item.paDispOrder) {
|
||||
//paDispOrder
|
||||
if (item.pkgMaterialFlg === '0') {
|
||||
item.showSalePrice = '0'
|
||||
item.showSaleTotPrice = '0'
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}, [itemChangeYn, estimateContextState.itemList])
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user