Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

currency depending on payment #1150

Merged
merged 1 commit into from
Sep 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions src/components/ADempiere/Form/VPOS/Collection/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
</span>
<span v-else>
{{
formatPrice(1, dayRate.iSOCode)
formatPrice(1, currentPointOfSales.currentPriceList.currency.iSOCode)
}}
</span>
</b>
Expand Down Expand Up @@ -513,19 +513,21 @@ export default {
return {}
},
dayRate() {
const currency = this.listCurrency.find(currency => currency.iso_code === this.currentFieldCurrency)
const convert = this.convertionsList.find(convert => {
if (!this.isEmptyValue(currency) && !this.isEmptyValue(convert.currencyTo) && currency.id === convert.currencyTo.id && this.currentPointOfSales.currentPriceList.currency.id !== currency.id) {
if (!this.isEmptyValue(this.currentFieldCurrency)) {
const currency = this.listCurrency.find(currency => currency.iso_code === this.currentFieldCurrency)
const convert = this.convertionsList.find(convert => {
if (!this.isEmptyValue(currency) && !this.isEmptyValue(convert.currencyTo) && currency.id === convert.currencyTo.id && this.currentPointOfSales.currentPriceList.currency.id !== currency.id) {
return convert
}
})
if (!this.isEmptyValue(convert)) {
return convert
}
})
if (!this.isEmptyValue(convert)) {
return convert
}
return {
currencyTo: this.currentPointOfSales.currentPriceList.currency,
currencyTo: this.currentPointOfSales.priceList.currency,
divideRate: 1,
iSOCode: this.currentPointOfSales.currentPriceList.currency.iSOCode
iSOCode: this.currentPointOfSales.priceList.currency.iSOCode
}
},
fieldsPaymentType() {
Expand Down Expand Up @@ -658,6 +660,12 @@ export default {
})
}
},
currentFieldPaymentMethods(value) {
const payment = this.availablePaymentMethods.find(payment => payment.uuid === value)
if (!this.isEmptyValue(payment.refund_reference_currency)) {
this.currentFieldCurrency = payment.refund_reference_currency.iso_code
}
},
precision() {
return this.$store.getters.getCurrency.standardPrecision
}
Expand Down
2 changes: 2 additions & 0 deletions src/components/ADempiere/Form/VPOS/Order/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@
v-for="item in listWarehouses"
:key="item.uuid"
:command="item"
:disabled="isDisabled"
>
{{ item.name }}
</el-dropdown-item>
Expand All @@ -308,6 +309,7 @@
v-for="item in pointPriceList"
:key="item.uuid"
:command="item"
:disabled="isDisabled"
>
{{ item.name }}
</el-dropdown-item>
Expand Down