mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 12:11:08 -04:00
Add copy pdf url option
This commit is contained in:
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-if="payment" class="main-content payment-view-page">
|
<div v-if="payment" class="main-content payment-view-page">
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<h3 class="page-title"> {{ payment.payment_number }}</h3>
|
<h3 class="page-title">{{ payment.payment_number }}</h3>
|
||||||
<div class="page-actions row">
|
<div class="page-actions row">
|
||||||
<base-button
|
<base-button
|
||||||
:loading="isSendingEmail"
|
:loading="isSendingEmail"
|
||||||
@ -11,19 +11,39 @@
|
|||||||
>
|
>
|
||||||
{{ $t('payments.send_payment_receipt') }}
|
{{ $t('payments.send_payment_receipt') }}
|
||||||
</base-button>
|
</base-button>
|
||||||
<v-dropdown :close-on-select="false" align="left" class="filter-container">
|
<v-dropdown
|
||||||
|
:close-on-select="true"
|
||||||
|
align="left"
|
||||||
|
class="filter-container"
|
||||||
|
>
|
||||||
<a slot="activator" href="#">
|
<a slot="activator" href="#">
|
||||||
<base-button color="theme">
|
<base-button color="theme">
|
||||||
<font-awesome-icon icon="ellipsis-h" />
|
<font-awesome-icon icon="ellipsis-h" />
|
||||||
</base-button>
|
</base-button>
|
||||||
</a>
|
</a>
|
||||||
<v-dropdown-item>
|
<v-dropdown-item>
|
||||||
<router-link :to="{path: `/admin/payments/${$route.params.id}/edit`}" class="dropdown-item">
|
<div class="dropdown-item" @click="copyPdfUrl">
|
||||||
<font-awesome-icon :icon="['fas', 'pencil-alt']" class="dropdown-item-icon"/>
|
<font-awesome-icon
|
||||||
|
:icon="['fas', 'link']"
|
||||||
|
class="dropdown-item-icon"
|
||||||
|
/>
|
||||||
|
{{ $t('general.copy_pdf_url') }}
|
||||||
|
</div>
|
||||||
|
<router-link
|
||||||
|
:to="{ path: `/admin/payments/${$route.params.id}/edit` }"
|
||||||
|
class="dropdown-item"
|
||||||
|
>
|
||||||
|
<font-awesome-icon
|
||||||
|
:icon="['fas', 'pencil-alt']"
|
||||||
|
class="dropdown-item-icon"
|
||||||
|
/>
|
||||||
{{ $t('general.edit') }}
|
{{ $t('general.edit') }}
|
||||||
</router-link>
|
</router-link>
|
||||||
<div class="dropdown-item" @click="removePayment($route.params.id)">
|
<div class="dropdown-item" @click="removePayment($route.params.id)">
|
||||||
<font-awesome-icon :icon="['fas', 'trash']" class="dropdown-item-icon" />
|
<font-awesome-icon
|
||||||
|
:icon="['fas', 'trash']"
|
||||||
|
class="dropdown-item-icon"
|
||||||
|
/>
|
||||||
{{ $t('general.delete') }}
|
{{ $t('general.delete') }}
|
||||||
</div>
|
</div>
|
||||||
</v-dropdown-item>
|
</v-dropdown-item>
|
||||||
@ -41,14 +61,18 @@
|
|||||||
align-icon="right"
|
align-icon="right"
|
||||||
@input="onSearch"
|
@input="onSearch"
|
||||||
/>
|
/>
|
||||||
<div
|
<div class="btn-group ml-3" role="group" aria-label="First group">
|
||||||
class="btn-group ml-3"
|
<v-dropdown
|
||||||
role="group"
|
:close-on-select="false"
|
||||||
aria-label="First group"
|
align="left"
|
||||||
>
|
class="filter-container"
|
||||||
<v-dropdown :close-on-select="false" align="left" class="filter-container">
|
>
|
||||||
<a slot="activator" href="#">
|
<a slot="activator" href="#">
|
||||||
<base-button class="inv-button inv-filter-fields-btn" color="default" size="medium">
|
<base-button
|
||||||
|
class="inv-button inv-filter-fields-btn"
|
||||||
|
color="default"
|
||||||
|
size="medium"
|
||||||
|
>
|
||||||
<font-awesome-icon icon="filter" />
|
<font-awesome-icon icon="filter" />
|
||||||
</base-button>
|
</base-button>
|
||||||
</a>
|
</a>
|
||||||
@ -64,8 +88,10 @@
|
|||||||
class="inv-radio"
|
class="inv-radio"
|
||||||
value="invoice_number"
|
value="invoice_number"
|
||||||
@change="onSearch"
|
@change="onSearch"
|
||||||
>
|
/>
|
||||||
<label class="inv-label" for="filter_invoice_number">{{ $t('invoices.title') }}</label>
|
<label class="inv-label" for="filter_invoice_number">{{
|
||||||
|
$t('invoices.title')
|
||||||
|
}}</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="filter-items">
|
<div class="filter-items">
|
||||||
<input
|
<input
|
||||||
@ -76,8 +102,10 @@
|
|||||||
class="inv-radio"
|
class="inv-radio"
|
||||||
value="payment_date"
|
value="payment_date"
|
||||||
@change="onSearch"
|
@change="onSearch"
|
||||||
>
|
/>
|
||||||
<label class="inv-label" for="filter_payment_date">{{ $t('payments.date') }}</label>
|
<label class="inv-label" for="filter_payment_date">{{
|
||||||
|
$t('payments.date')
|
||||||
|
}}</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="filter-items">
|
<div class="filter-items">
|
||||||
<input
|
<input
|
||||||
@ -88,11 +116,19 @@
|
|||||||
class="inv-radio"
|
class="inv-radio"
|
||||||
value="payment_number"
|
value="payment_number"
|
||||||
@change="onSearch"
|
@change="onSearch"
|
||||||
>
|
/>
|
||||||
<label class="inv-label" for="filter_payment_number">{{ $t('payments.payment_number') }}</label>
|
<label class="inv-label" for="filter_payment_number">{{
|
||||||
|
$t('payments.payment_number')
|
||||||
|
}}</label>
|
||||||
</div>
|
</div>
|
||||||
</v-dropdown>
|
</v-dropdown>
|
||||||
<base-button v-tooltip.top-center="{ content: getOrderName }" class="inv-button inv-filter-sorting-btn" color="default" size="medium" @click="sortData">
|
<base-button
|
||||||
|
v-tooltip.top-center="{ content: getOrderName }"
|
||||||
|
class="inv-button inv-filter-sorting-btn"
|
||||||
|
color="default"
|
||||||
|
size="medium"
|
||||||
|
@click="sortData"
|
||||||
|
>
|
||||||
<font-awesome-icon v-if="getOrderBy" icon="sort-amount-up" />
|
<font-awesome-icon v-if="getOrderBy" icon="sort-amount-up" />
|
||||||
<font-awesome-icon v-else icon="sort-amount-down" />
|
<font-awesome-icon v-else icon="sort-amount-down" />
|
||||||
</base-button>
|
</base-button>
|
||||||
@ -101,7 +137,7 @@
|
|||||||
<base-loader v-if="isSearching" />
|
<base-loader v-if="isSearching" />
|
||||||
<div v-else class="side-content">
|
<div v-else class="side-content">
|
||||||
<router-link
|
<router-link
|
||||||
v-for="(payment,index) in payments"
|
v-for="(payment, index) in payments"
|
||||||
:to="`/admin/payments/${payment.id}/view`"
|
:to="`/admin/payments/${payment.id}/view`"
|
||||||
:key="index"
|
:key="index"
|
||||||
class="side-payment"
|
class="side-payment"
|
||||||
@ -112,7 +148,10 @@
|
|||||||
<div class="inv-number">{{ payment.invoice_number }}</div>
|
<div class="inv-number">{{ payment.invoice_number }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<div class="inv-amount" v-html="$utils.formatMoney(payment.amount, payment.user.currency)" />
|
<div
|
||||||
|
class="inv-amount"
|
||||||
|
v-html="$utils.formatMoney(payment.amount, payment.user.currency)"
|
||||||
|
/>
|
||||||
<div class="inv-date">{{ payment.formattedPaymentDate }}</div>
|
<div class="inv-date">{{ payment.formattedPaymentDate }}</div>
|
||||||
<!-- <div class="inv-number">{{ payment.payment_method.name }}</div> -->
|
<!-- <div class="inv-number">{{ payment.payment_method.name }}</div> -->
|
||||||
</div>
|
</div>
|
||||||
@ -122,8 +161,8 @@
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="payment-view-page-container" >
|
<div class="payment-view-page-container">
|
||||||
<iframe :src="`${shareableLink}`" class="frame-style"/>
|
<iframe :src="`${shareableLink}`" class="frame-style" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -260,6 +299,13 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
copyPdfUrl () {
|
||||||
|
let pdfUrl = `${window.location.origin}/payments/pdf/${this.payment.unique_hash}`
|
||||||
|
|
||||||
|
let response = this.$utils.copyTextToClipboard(pdfUrl)
|
||||||
|
|
||||||
|
window.toastr['success'](this.$tc('Copied PDF url to clipboard!'))
|
||||||
|
},
|
||||||
async removePayment (id) {
|
async removePayment (id) {
|
||||||
this.id = id
|
this.id = id
|
||||||
window.swal({
|
window.swal({
|
||||||
|
|||||||
Reference in New Issue
Block a user