Skip to content

Commit

Permalink
19912- Updating refund type types (#2743)
Browse files Browse the repository at this point in the history
* Updating refund type types

Adding BASE_FEES, FUTURE_EFFECTIVE_FEES, PRIORITY_FEES

Removing OTHER_FEES

* Remove class

* Readd
  • Loading branch information
rodrigo-barraza authored Feb 28, 2024
1 parent 995dbc2 commit 20484dd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
4 changes: 2 additions & 2 deletions auth-web/src/components/auth/common/Product.vue
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,13 @@
>
<p
v-if="$te(productLabel.details)"
class="mb-0"
v-sanitize="$t(productLabel.details)"
class="mb-0"
/>
<p
v-if="$te(productLabel.note)"
class="mb-0"
v-sanitize="$t(productLabel.note)"
class="mb-0"
/>
<component
:is="productFooter.component"
Expand Down
38 changes: 20 additions & 18 deletions auth-web/src/views/pay/RefundView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,10 @@ enum RefundType {
}
enum RefundLineTypes {
OTHER_FEES = 'OTHER_FEES',
SERVICE_FEE = 'SERVICE_FEE',
BASE_FEES = 'BASE_FEES',
FUTURE_EFFECTIVE_FEES = 'FUTURE_EFFECTIVE_FEES',
PRIORITY_FEES = 'PRIORITY_FEES',
SERVICE_FEES = 'SERVICE_FEES'
}
export default defineComponent({
Expand Down Expand Up @@ -218,23 +220,23 @@ export default defineComponent({
if (state.refundType === RefundType.PARTIAL) {
state.refundedItems.forEach(index => {
const item = state.paymentLineItems[index]
if (item.total > 0) {
refundPayload.refundRevenue.push({
paymentLineItemId: item.id,
refundAmount: parseFloat(item.total),
refundType: RefundLineTypes.OTHER_FEES
})
}
if (item.serviceFees > 0) {
refundPayload.refundRevenue.push({
paymentLineItemId: item.id,
refundAmount: item.serviceFees,
refundType: RefundLineTypes.SERVICE_FEE
})
}
const feeTypes = [
{ key: 'total', type: RefundLineTypes.BASE_FEES },
{ key: 'priorityFees', type: RefundLineTypes.PRIORITY_FEES },
{ key: 'futureEffectiveFees', type: RefundLineTypes.FUTURE_EFFECTIVE_FEES },
{ key: 'serviceFees', type: RefundLineTypes.SERVICE_FEES }
]
feeTypes.forEach(fee => {
if (item[fee.key] > 0) {
refundPayload.refundRevenue.push({
paymentLineItemId: item.id,
refundAmount: parseFloat(item[fee.key]),
refundType: fee.type
})
}
})
})
} else {
delete refundPayload.refundRevenue
}
const response = await state.orgStore.refundInvoice(state.invoiceId, refundPayload)
Expand Down

0 comments on commit 20484dd

Please sign in to comment.