price calulator changed 2

This commit is contained in:
2026-07-02 20:01:27 +03:30
parent 83cce69069
commit 7a150bfdfc
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -98,8 +98,10 @@ export function calcPayablePriceRial(
targetRialCash?: number | null targetRialCash?: number | null
) { ) {
if (feeDeductFromGold.value) { if (feeDeductFromGold.value) {
if (targetRialCash != null && Number(targetRialCash) > 0) {
return Number(targetRialCash)
}
if (isBuy) return finalPriceRial + feeInRial if (isBuy) return finalPriceRial + feeInRial
if (targetRialCash != null && Number(targetRialCash) > 0) return Number(targetRialCash)
return finalPriceRial return finalPriceRial
} }
return isBuy ? finalPriceRial : Math.max(0, finalPriceRial - feeInRial) return isBuy ? finalPriceRial : Math.max(0, finalPriceRial - feeInRial)
+1 -1
View File
@@ -466,7 +466,7 @@ const payablePrice = computed(() =>
finalPrice.value, finalPrice.value,
feeInRial.value, feeInRial.value,
isBuy.value, isBuy.value,
!isBuy.value && inputLock.value === 'rial' ? form.value?.goldCash : undefined inputLock.value === 'rial' ? form.value?.goldCash : undefined
) )
) )
const sellGoldDebit = computed(() => calcSellGoldDebit(orderGoldAmount.value, feeInGrams.value)) const sellGoldDebit = computed(() => calcSellGoldDebit(orderGoldAmount.value, feeInGrams.value))