견적서
This commit is contained in:
parent
d5d6cda1f0
commit
8e47b69266
@ -447,7 +447,6 @@ export default function Estimate({ params }) {
|
||||
})
|
||||
//아이템들 중 조건에 맞는애들 뽑아서 상단 공급가액 부가세 총액 수정
|
||||
setItemChangeYn(true)
|
||||
} else {
|
||||
}
|
||||
}
|
||||
|
||||
@ -471,10 +470,15 @@ export default function Estimate({ params }) {
|
||||
updateList = estimateContextState.itemList.map((item) => {
|
||||
if (item.dispOrder === dispOrder) {
|
||||
return { ...item, ...updates }
|
||||
} else if (item.paDispOrder === dispOrder) {
|
||||
return { ...item, ...updates, amount: (item.bomAmount * amount?.replaceAll(',', '')).toLocaleString(), saleTotPrice: '0' }
|
||||
} else {
|
||||
return item
|
||||
}
|
||||
})
|
||||
|
||||
console.log('updateList::', updateList)
|
||||
// return
|
||||
setEstimateContextState({
|
||||
itemList: updateList,
|
||||
})
|
||||
@ -556,7 +560,6 @@ export default function Estimate({ params }) {
|
||||
return { ...item, ...updates }
|
||||
} else if (item.paDispOrder === dispOrder) {
|
||||
return { ...item, delFlg: '0' }
|
||||
// return { ...item, delFlg: '1' }
|
||||
} else {
|
||||
return item
|
||||
}
|
||||
@ -569,14 +572,16 @@ export default function Estimate({ params }) {
|
||||
bomItem.dispOrder = (index + 1 + maxItemDispOrder).toString()
|
||||
bomItem.paDispOrder = dispOrder
|
||||
bomItem.salePrice = '0'
|
||||
//unitPrice는??
|
||||
bomItem.saleTotPrice = '0'
|
||||
bomItem.unitPrice = '0'
|
||||
bomItem.amount = bomItem.bomAmount
|
||||
} else {
|
||||
bomItem.dispOrder = (index + 1 + Number(dispOrder)).toString()
|
||||
bomItem.paDispOrder = dispOrder
|
||||
bomItem.salePrice = '0'
|
||||
//unitPrice는??
|
||||
bomItem.saleTotPrice = '0'
|
||||
bomItem.unitPrice = '0'
|
||||
bomItem.amount = bomItem.bomAmount
|
||||
}
|
||||
|
||||
bomItem.delFlg = '0'
|
||||
@ -620,6 +625,8 @@ export default function Estimate({ params }) {
|
||||
}
|
||||
})
|
||||
|
||||
console.log('updateList::', updateList)
|
||||
|
||||
let delCnt = 0
|
||||
updateList.map((item) => {
|
||||
if (item.delFlg === '1') {
|
||||
@ -696,15 +703,16 @@ export default function Estimate({ params }) {
|
||||
estimateContextState.itemList.map((item) => {
|
||||
if (item.delFlg === '0') {
|
||||
let amount = Number(item.amount?.replace(/[^0-9]/g, '').replaceAll(',', ''))
|
||||
let price = Number(item.saleTotPrice?.replaceAll(',', ''))
|
||||
console.log('amount::', amount)
|
||||
let salePrice = Number(item.salePrice?.replaceAll(',', ''))
|
||||
let saleTotPrice = Number(item.saleTotPrice?.replaceAll(',', ''))
|
||||
|
||||
if (isNaN(amount)) {
|
||||
amount = 0
|
||||
}
|
||||
|
||||
if (isNaN(price)) {
|
||||
price = 0
|
||||
if (isNaN(saleTotPrice)) {
|
||||
saleTotPrice = 0
|
||||
}
|
||||
|
||||
if (isNaN(salePrice)) {
|
||||
@ -715,9 +723,7 @@ export default function Estimate({ params }) {
|
||||
const volKw = (item.pnowW * amount) / 1000
|
||||
totVolKw += volKw
|
||||
}
|
||||
|
||||
// const price
|
||||
supplyPrice += price
|
||||
// const saleTotPrice
|
||||
totAmount += amount
|
||||
if (item.pkgMaterialFlg === '1') {
|
||||
const pkgPrice = amount * salePrice
|
||||
@ -725,6 +731,7 @@ export default function Estimate({ params }) {
|
||||
//YJSS는 PKG제외상품들만(1) 모아서 수량 * 단가를 공급가액(supplyPrice)에 추가로 더해줌
|
||||
addSupplyPrice += pkgPrice
|
||||
}
|
||||
|
||||
if (!item.paDispOrder) {
|
||||
//paDispOrder
|
||||
if (item.pkgMaterialFlg === '0') {
|
||||
@ -735,7 +742,7 @@ export default function Estimate({ params }) {
|
||||
}
|
||||
})
|
||||
|
||||
supplyPrice += addSupplyPrice
|
||||
supplyPrice = addSupplyPrice + Number(estimateContextState.pkgTotPrice)
|
||||
vatPrice = supplyPrice * 0.1
|
||||
totPrice = supplyPrice + vatPrice
|
||||
setEstimateContextState({
|
||||
@ -1145,15 +1152,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">{convertNumberToPriceDecimalToFixed(estimateContextState?.supplyPrice, 2)}</div>
|
||||
<div className="estimate-name blue">{convertNumberToPriceDecimal(estimateContextState?.supplyPrice)}</div>
|
||||
</div>
|
||||
<div className="estimate-box">
|
||||
<div className="estimate-tit">{getMessage('estimate.detail.sepcialEstimateProductInfo.vatPrice')}</div>
|
||||
<div className="estimate-name blue">{convertNumberToPriceDecimalToFixed(estimateContextState?.vatPrice, 2)}</div>
|
||||
<div className="estimate-name blue">{convertNumberToPriceDecimal(estimateContextState?.vatPrice)}</div>
|
||||
</div>
|
||||
<div className="estimate-box">
|
||||
<div className="estimate-tit">{getMessage('estimate.detail.sepcialEstimateProductInfo.totPrice')}</div>
|
||||
<div className="estimate-name red">{convertNumberToPriceDecimalToFixed(estimateContextState?.totPrice, 2)}</div>
|
||||
<div className="estimate-name red">{convertNumberToPriceDecimal(estimateContextState?.totPrice)}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -1189,7 +1196,7 @@ export default function Estimate({ params }) {
|
||||
<th>{getMessage('estimate.detail.sepcialEstimateProductInfo.pkgWeight')}</th>
|
||||
<td>{convertNumberToPriceDecimalToFixed(estimateContextState?.totVolKw, 2)}</td>
|
||||
<th>{getMessage('estimate.detail.sepcialEstimateProductInfo.pkgPrice')}</th>
|
||||
<td>{convertNumberToPriceDecimalToFixed(estimateContextState?.pkgTotPrice, 2)}</td>
|
||||
<td>{convertNumberToPriceDecimal(estimateContextState?.pkgTotPrice)}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -1405,7 +1412,7 @@ export default function Estimate({ params }) {
|
||||
</div> */}
|
||||
</div>
|
||||
</td>
|
||||
<td className="al-r">{convertNumberToPriceDecimalToFixed(item?.saleTotPrice?.replaceAll(',', ''), 2)}</td>
|
||||
<td className="al-r">{convertNumberToPriceDecimal(item?.saleTotPrice?.replaceAll(',', ''))}</td>
|
||||
{/* {item?.showSaleTotPrice === '0' ? (
|
||||
<td className="al-r"></td>
|
||||
) : (
|
||||
|
||||
@ -80,7 +80,7 @@ export const useEstimateController = (planNo) => {
|
||||
itemId: '', //제품번호
|
||||
itemNo: '',
|
||||
itemName: '', //형명
|
||||
amount: '0', //수량
|
||||
amount: '', //수량
|
||||
unitPrice: '0',
|
||||
unit: '', //단위
|
||||
salePrice: '', //단가
|
||||
@ -88,6 +88,7 @@ export const useEstimateController = (planNo) => {
|
||||
itemChangeFlg: '1', //추가시 체인지플래그 1로
|
||||
partAdd: '1', //NEW 체인지 플래그
|
||||
delFlg: '0', //삭제 플래그 0 삭제하면 1
|
||||
// addFlg: '1', //제품추가해서 추가된건지 구분값
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user