|
@@ -74,15 +74,6 @@
|
|
|
<q-separator class="q-my-lg" />
|
|
<q-separator class="q-my-lg" />
|
|
|
|
|
|
|
|
<div class="payment-summary q-mb-lg">
|
|
<div class="payment-summary q-mb-lg">
|
|
|
- <div class="row items-center justify-between q-mb-xs">
|
|
|
|
|
- <span class="summary-label">{{ $t('dashboard_client.pending_schedules.detail_value') }}</span>
|
|
|
|
|
- <span class="summary-value">{{ formatCurrency(baseAmount) }}</span>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="row items-center justify-between q-mb-xs">
|
|
|
|
|
- <span class="summary-label">{{ $t('dashboard_client.pending_schedules.detail_service_fee') }}</span>
|
|
|
|
|
- <span class="summary-value">{{ formatCurrency(selectedPlatformFee) }}</span>
|
|
|
|
|
- </div>
|
|
|
|
|
- <q-separator class="q-my-sm" />
|
|
|
|
|
<div class="row items-center justify-between">
|
|
<div class="row items-center justify-between">
|
|
|
<span class="summary-total-label">{{ $t('dashboard_client.pending_schedules.detail_total') }}</span>
|
|
<span class="summary-total-label">{{ $t('dashboard_client.pending_schedules.detail_total') }}</span>
|
|
|
<span class="summary-total-value">{{ formatCurrency(selectedTotal) }}</span>
|
|
<span class="summary-total-value">{{ formatCurrency(selectedTotal) }}</span>
|
|
@@ -122,7 +113,7 @@ import { userStore } from 'src/stores/user'
|
|
|
import { usePaymentStore } from 'src/stores/payment'
|
|
import { usePaymentStore } from 'src/stores/payment'
|
|
|
import { getClientPaymentMethods } from 'src/api/clientPaymentMethod'
|
|
import { getClientPaymentMethods } from 'src/api/clientPaymentMethod'
|
|
|
import { formatCurrency } from 'src/helpers/utils'
|
|
import { formatCurrency } from 'src/helpers/utils'
|
|
|
-import { getSchedulePlatformFeeRate } from 'src/helpers/paymentPlatformFees'
|
|
|
|
|
|
|
+import { getScheduleTotalWithPlatformFee } from 'src/helpers/paymentPlatformFees'
|
|
|
import { usePaymentPlatformFees } from 'src/composables/usePaymentPlatformFees'
|
|
import { usePaymentPlatformFees } from 'src/composables/usePaymentPlatformFees'
|
|
|
import ProfilePaymentAddDialog from 'src/components/profile/ProfilePaymentAddDialog.vue'
|
|
import ProfilePaymentAddDialog from 'src/components/profile/ProfilePaymentAddDialog.vue'
|
|
|
import SchedulePaymentPixDialog from './SchedulePaymentPixDialog.vue'
|
|
import SchedulePaymentPixDialog from './SchedulePaymentPixDialog.vue'
|
|
@@ -149,11 +140,8 @@ const agreedToTerms = ref(false)
|
|
|
const paymentMethods = ref([])
|
|
const paymentMethods = ref([])
|
|
|
const loadingCards = ref(false)
|
|
const loadingCards = ref(false)
|
|
|
|
|
|
|
|
-const baseAmount = computed(() => Number(props.schedule.total_amount) || 0)
|
|
|
|
|
const selectedPaymentType = computed(() => selectedMethod.value === 'pix' ? 'pix' : 'credit_card')
|
|
const selectedPaymentType = computed(() => selectedMethod.value === 'pix' ? 'pix' : 'credit_card')
|
|
|
-const selectedPlatformFeeRate = computed(() => getSchedulePlatformFeeRate(props.schedule, selectedPaymentType.value, platformFees.value) ?? platformFees.value.pix)
|
|
|
|
|
-const selectedPlatformFee = computed(() => parseFloat((baseAmount.value * selectedPlatformFeeRate.value).toFixed(2)))
|
|
|
|
|
-const selectedTotal = computed(() => parseFloat((baseAmount.value + selectedPlatformFee.value).toFixed(2)))
|
|
|
|
|
|
|
+const selectedTotal = computed(() => getScheduleTotalWithPlatformFee(props.schedule, selectedPaymentType.value, platformFees.value))
|
|
|
|
|
|
|
|
const addressTypeLabel = computed(() => {
|
|
const addressTypeLabel = computed(() => {
|
|
|
const type = props.schedule.address?.address_type
|
|
const type = props.schedule.address?.address_type
|