Document transaction email template changes..
This commit is contained in:
24
resources/assets/js/views/common/documents.js
vendored
24
resources/assets/js/views/common/documents.js
vendored
@ -75,6 +75,7 @@ const app = new Vue({
|
||||
',.',
|
||||
',,'
|
||||
],
|
||||
email_template: false,
|
||||
}
|
||||
},
|
||||
|
||||
@ -533,6 +534,7 @@ const app = new Vue({
|
||||
onDeleteDiscount(item_index) {
|
||||
this.items[item_index].add_discount = false;
|
||||
this.items[item_index].discount = 0;
|
||||
|
||||
this.onCalculateTotal();
|
||||
},
|
||||
|
||||
@ -818,11 +820,17 @@ const app = new Vue({
|
||||
buttons:{}
|
||||
};
|
||||
|
||||
let email_promise = Promise.resolve(window.axios.get(email.route, {
|
||||
params: {
|
||||
email_template: 'invoice_payment_customer'
|
||||
}
|
||||
}));
|
||||
let email_promise = Promise.resolve(window.axios.get(email.route));
|
||||
|
||||
if (this.email_template) {
|
||||
email_promise = Promise.resolve(window.axios.get(email.route, {
|
||||
params: {
|
||||
email_template: this.email_template
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
this.email_template = false;
|
||||
|
||||
email_promise.then(response => {
|
||||
email.modal = true;
|
||||
@ -870,6 +878,12 @@ const app = new Vue({
|
||||
});
|
||||
},
|
||||
|
||||
onEmailViaTemplate(route, template) {
|
||||
this.email_template = template;
|
||||
|
||||
this.onEmail(route);
|
||||
},
|
||||
|
||||
// Change currency get money
|
||||
onChangeCurrency(currency_code) {
|
||||
if (this.edit.status && this.edit.currency <= 2) {
|
||||
|
@ -61,7 +61,7 @@
|
||||
</br>
|
||||
|
||||
@if (! empty($transaction->contact) && $transaction->contact->email)
|
||||
<x-button id="button-email-send" class="text-purple mt-1" override="class" @click="onEmail('{{ route($transactionEmailRoute, $transaction->id) }}')">
|
||||
<x-button id="button-email-send" class="text-purple mt-1" override="class" @click="onEmailViaTemplate('{{ route($transactionEmailRoute, $transaction->id) }}', '{{ $transactionEmailTemplate }}')">
|
||||
<x-button.hover color="to-purple">
|
||||
{{ trans('general.title.send', ['type' => trans_choice('general.receipts', 1)]) }}
|
||||
</x-button.hover>
|
||||
|
@ -45,7 +45,7 @@
|
||||
</br>
|
||||
|
||||
@if (! empty($transaction->contact) && $transaction->contact->email)
|
||||
<x-button id="button-email-send" class="text-purple mt-1" override="class" @click="onEmail('{{ route($transactionEmailRoute, $transaction->id) }}')">
|
||||
<x-button id="button-email-send" class="text-purple mt-1" override="class" @click="onEmailViaTemplate('{{ route($transactionEmailRoute, $transaction->id) }}', '{{ $transactionEmailTemplate }}')">
|
||||
<x-button.hover color="to-purple">
|
||||
{{ trans('general.title.send', ['type' => trans_choice('general.receipts', 1)]) }}
|
||||
</x-button.hover>
|
||||
|
Reference in New Issue
Block a user