Skip to content

Commit

Permalink
fixed rate in the amount (#1169)
Browse files Browse the repository at this point in the history
Co-authored-by: elsiosanchez <elsiossanches@gmail.com>
  • Loading branch information
elsiosanchez and elsiosanchez authored Sep 8, 2021
1 parent befea77 commit 7a3d50d
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 7 deletions.
18 changes: 12 additions & 6 deletions src/components/ADempiere/Form/VPOS/Collection/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -663,9 +663,16 @@ export default {
this.$store.dispatch('addRateConvertion', this.pointOfSalesCurrency)
this.unsubscribe = this.subscribeChanges()
this.defaultValueCurrency()
if (!this.isEmptyValue(this.dayRate)) {
this.showDayRate(this.dayRate)
}
setTimeout(() => {
if (!this.isEmptyValue(this.dayRate.divideRate)) {
this.showDayRate(this.dayRate, this.dayRate.divideRate)
this.$store.commit('updateValueOfField', {
containerUuid: this.containerUuid,
columnName: 'PayAmt',
value: this.round(this.pending / this.dayRate.divideRate, this.standardPrecision)
})
}
}, 1500)
this.currentFieldPaymentMethods = this.defaulValuePaymentMethods.uuid
},
methods: {
Expand Down Expand Up @@ -825,7 +832,7 @@ export default {
this.$store.commit('updateValueOfField', {
containerUuid: this.containerUuid,
columnName: 'PayAmt',
value: this.round(this.pending)
value: this.round(this.pending / this.dayRate.divideRate, this.standardPrecision)
})
})
this.defaultValueCurrency()
Expand Down Expand Up @@ -855,12 +862,11 @@ export default {
this.$store.commit('updateValueOfField', {
containerUuid: this.containerUuid,
columnName: 'PayAmt',
value: this.round(this.pending)
value: this.round(this.pending / this.dayRate.divideRate, this.standardPrecision)
})
this.defaultValueCurrency()
this.$store.commit('currencyDivideRateCollection', 1)
this.$store.commit('currencyMultiplyRate', 1)
this.currentFieldCurrency = this.pointOfSalesCurrency.iSOCode
},
exit() {
this.cancel()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ export default {
bankUuid: customer.C_Bank_ID_UUID,
amount: this.change / this.dayRate.divideRate,
tenderTypeCode: this.selectionTypeRefund.tender_type,
paymentMethodUuid: this.selectionTypeRefund.uuid,
currencyUuid: this.defaultReferenceCurrency.uuid
})
.then(response => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ export default {
if (currentTenderType) {
return currentTenderType.name
}
return tenderType
return ''
},
iSOCode(value) {
const currencyPay = this.convertionsList.find(currency => !this.isEmptyValue(currency.currencyTo) && currency.currencyTo.uuid === value.currencyUuid)
Expand Down
13 changes: 13 additions & 0 deletions src/store/modules/ADempiere/pointOfSales/payments/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ export default {
convertedAmount,
paymentDate,
tenderTypeCode,
paymentMethodUuid,
currencyUuid
}) {
commit('setAddRefund', {
Expand All @@ -361,6 +362,7 @@ export default {
convertedAmount,
paymentDate,
tenderTypeCode,
paymentMethodUuid,
currencyUuid
})
},
Expand Down Expand Up @@ -400,6 +402,15 @@ export default {
dispatch('listPayments', { orderUuid })
return response
})
.catch(error => {
console.warn(`ListPaymentsFromServer: ${error.message}. Code: ${error.code}.`)
showMessage({
type: 'error',
message: error.message,
showClose: true
})
return
})
},
/**
* Refund payment at a later time
Expand Down Expand Up @@ -436,6 +447,7 @@ export default {
zip,
bankAccountType,
bankUuid,
paymentMethodUuid,
isAch,
addressVerified,
zipVerified,
Expand All @@ -455,6 +467,7 @@ export default {
street,
zip,
bankAccountType,
paymentMethodUuid,
bankUuid,
isAch,
addressVerified,
Expand Down

0 comments on commit 7a3d50d

Please sign in to comment.