|
@@ -192,14 +192,14 @@ const orderDetail = ref({
|
|
|
})
|
|
|
const calculateTotalProfit = () => {
|
|
|
let profit = 0
|
|
|
- if (orderDetail.fundReceived && orderDetail.fundReceived.length > 0) {
|
|
|
- for (let i = 0; i < orderDetail.fundReceived.length; i++) {
|
|
|
- profit = Number(Math.round((profit + orderDetail.fundReceived[i].receivedAmount) * 100) / 100)
|
|
|
+ if (formData.data.fundReceived && formData.data.fundReceived.length > 0) {
|
|
|
+ for (let i = 0; i < formData.data.fundReceived.length; i++) {
|
|
|
+ profit = Number(Math.round((profit + formData.data.fundReceived[i].receivedAmount) * 100) / 100)
|
|
|
}
|
|
|
}
|
|
|
- if (orderDetail.payment && orderDetail.payment.length > 0) {
|
|
|
- for (let i = 0; i < orderDetail.payment.length; i++) {
|
|
|
- profit = Number(Math.round((profit - orderDetail.payment[i].amount) * 100) / 100)
|
|
|
+ if (formData.data.payment && formData.data.payment.length > 0) {
|
|
|
+ for (let i = 0; i < formData.data.payment.length; i++) {
|
|
|
+ profit = Number(Math.round((profit - formData.data.payment[i].amount) * 100) / 100)
|
|
|
}
|
|
|
}
|
|
|
return profit
|