mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 11:41:09 -04:00
Merge branch 'quantity-fix' into 'master'
fix: exchange rate See merge request mohit.panjvani/crater-web!1302
This commit is contained in:
@ -45,7 +45,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { watch, computed, ref, onMounted } from 'vue'
|
import { watch, computed, ref, onBeforeUnmount } from 'vue'
|
||||||
import { useGlobalStore } from '@/scripts/stores/global'
|
import { useGlobalStore } from '@/scripts/stores/global'
|
||||||
import { useCompanyStore } from '@/scripts/stores/company'
|
import { useCompanyStore } from '@/scripts/stores/company'
|
||||||
import { useExchangeRateStore } from '@/scripts/stores/exchange-rate'
|
import { useExchangeRateStore } from '@/scripts/stores/exchange-rate'
|
||||||
@ -110,7 +110,8 @@ watch(
|
|||||||
() => props.store[props.storeProp].currency_id,
|
() => props.store[props.storeProp].currency_id,
|
||||||
(v) => {
|
(v) => {
|
||||||
onChangeCurrency(v)
|
onChangeCurrency(v)
|
||||||
}
|
},
|
||||||
|
{ immediate: true }
|
||||||
)
|
)
|
||||||
watch(
|
watch(
|
||||||
() => props.customerCurrency,
|
() => props.customerCurrency,
|
||||||
@ -144,7 +145,7 @@ function setCustomerCurrency(v) {
|
|||||||
|
|
||||||
async function onChangeCurrency(v) {
|
async function onChangeCurrency(v) {
|
||||||
if (v !== companyCurrency.value.id) {
|
if (v !== companyCurrency.value.id) {
|
||||||
if (!props.isEdit) {
|
if (!props.isEdit && v) {
|
||||||
await getCurrenctExchangeRate(v)
|
await getCurrenctExchangeRate(v)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -170,4 +171,8 @@ function getCurrenctExchangeRate(v) {
|
|||||||
isFetching.value = false
|
isFetching.value = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onBeforeUnmount(() => {
|
||||||
|
props.store.showExchangeRate = false
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user