견적서

This commit is contained in:
basssy 2024-12-02 09:53:19 +09:00
parent eaa38270db
commit 3e57d53ec7

View File

@ -702,6 +702,7 @@ export default function Estimate({ params }) {
let vatPrice = 0 let vatPrice = 0
let totPrice = 0 let totPrice = 0
let addSupplyPrice = 0 let addSupplyPrice = 0
let pkgTotPrice = 0
if (estimateContextState.estimateType === 'YJOD') { if (estimateContextState.estimateType === 'YJOD') {
estimateContextState.itemList.sort((a, b) => { estimateContextState.itemList.sort((a, b) => {
return a.dispOrder - b.dispOrder return a.dispOrder - b.dispOrder
@ -773,20 +774,16 @@ export default function Estimate({ params }) {
if (item.moduleFlg === '1') { if (item.moduleFlg === '1') {
//(Kw) 1 //(Kw) 1
const volKw = (item.pnowW * amount) / 1000 const volKw = (item.pnowW * amount) / 1000
// const volKw = item.pnowW * amount
totVolKw += volKw totVolKw += volKw
} }
setEstimateContextState({
pkgTotPrice: estimateContextState.pkgAsp.replaceAll(',', '') * totVolKw * 1000,
})
//pkgTotPrice
// const saleTotPrice // const saleTotPrice
totAmount += amount totAmount += amount
if (item.pkgMaterialFlg === '1') { if (item.pkgMaterialFlg === '1') {
const pkgPrice = amount * salePrice const saleTotPrice = amount * salePrice
// //
//YJSS PKG(1) * (supplyPrice) //YJSS PKG(1) * (supplyPrice)
addSupplyPrice += pkgPrice addSupplyPrice += saleTotPrice
} }
if (!item.paDispOrder) { 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 vatPrice = supplyPrice * 0.1
totPrice = supplyPrice + vatPrice totPrice = supplyPrice + vatPrice
setEstimateContextState({ setEstimateContextState({
@ -811,6 +813,18 @@ export default function Estimate({ params }) {
} }
setItemChangeYn(false) 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]) }, [itemChangeYn, estimateContextState.itemList])