mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 04:01:10 -04:00
Send Invoices/Estimates/Payments as email attachments
This commit is contained in:
@ -745,6 +745,8 @@
|
||||
"invoice_settings": "Invoice Settings",
|
||||
"autogenerate_invoice_number": "Auto-generate Invoice Number",
|
||||
"invoice_setting_description": "Disable this, If you don't wish to auto-generate invoice numbers each time you create a new invoice.",
|
||||
"invoice_email_attachment": "Send invoices as attachments",
|
||||
"invoice_email_attachment_setting_description": "Enable this if you want to send invoices as email attachment.",
|
||||
"enter_invoice_prefix": "Enter invoice prefix",
|
||||
"terms_and_conditions": "Terms and Conditions",
|
||||
"company_address_format": "Company Address Format",
|
||||
@ -759,6 +761,8 @@
|
||||
"estimate_settings": "Estimate Settings",
|
||||
"autogenerate_estimate_number": "Auto-generate Estimate Number",
|
||||
"estimate_setting_description": "Disable this, If you don't wish to auto-generate estimate numbers each time you create a new estimate.",
|
||||
"estimate_email_attachment": "Send estimates as attachments",
|
||||
"estimate_email_attachment_setting_description": "Enable this if you want to send the estimates as an email attachment.",
|
||||
"enter_estimate_prefix": "Enter estmiate prefix",
|
||||
"estimate_setting_updated": "Estimate Setting updated successfully",
|
||||
"company_address_format": "Company Address Format",
|
||||
@ -773,6 +777,8 @@
|
||||
"payment_settings": "Payment Settings",
|
||||
"autogenerate_payment_number": "Auto-generate Payment Number",
|
||||
"payment_setting_description": "Disable this, If you don't wish to auto-generate payment numbers each time you create a new payment.",
|
||||
"payment_email_attachment": "Send payments as attachments",
|
||||
"payment_email_attachment_setting_description": "Enable this if you want to send the payment receipts as an email attachment.",
|
||||
"enter_payment_prefix": "Enter Payment Prefix",
|
||||
"payment_setting_updated": "Payment Setting updated successfully",
|
||||
"payment_modes": "Payment Modes",
|
||||
|
||||
@ -59,12 +59,15 @@ export default {
|
||||
this.isRequestOnGoing = true
|
||||
let res = await this.fetchCompanySettings([
|
||||
'payment_auto_generate',
|
||||
'payment_email_attachment',
|
||||
'payment_prefix',
|
||||
'payment_mail_body',
|
||||
'invoice_auto_generate',
|
||||
'invoice_email_attachment',
|
||||
'invoice_prefix',
|
||||
'invoice_mail_body',
|
||||
'estimate_auto_generate',
|
||||
'estimate_email_attachment',
|
||||
'estimate_prefix',
|
||||
'estimate_mail_body',
|
||||
'invoice_billing_address_format',
|
||||
|
||||
@ -70,7 +70,7 @@
|
||||
|
||||
<sw-divider class="mt-6 mb-8" />
|
||||
|
||||
<div class="flex">
|
||||
<div class="flex mt-3 mb-4">
|
||||
<div class="relative w-12">
|
||||
<sw-switch
|
||||
v-model="estimateAutogenerate"
|
||||
@ -96,6 +96,32 @@
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex mb-2">
|
||||
<div class="relative w-12">
|
||||
<sw-switch
|
||||
v-model="estimateAsAttachment"
|
||||
class="absolute"
|
||||
style="top: -20px"
|
||||
@change="setEstimateSetting"
|
||||
/>
|
||||
</div>
|
||||
<div class="ml-4">
|
||||
<p class="p-0 mb-1 text-base leading-snug text-black">
|
||||
{{
|
||||
$t('settings.customization.estimates.estimate_email_attachment')
|
||||
}}
|
||||
</p>
|
||||
|
||||
<p
|
||||
class="p-0 m-0 text-xs leading-tight text-gray-500"
|
||||
style="max-width: 480px"
|
||||
>
|
||||
{{
|
||||
$t('settings.customization.estimates.estimate_email_attachment_setting_description')
|
||||
}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -115,6 +141,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
estimateAutogenerate: false,
|
||||
estimateAsAttachment: false,
|
||||
|
||||
estimates: {
|
||||
estimate_prefix: null,
|
||||
@ -204,6 +231,14 @@ export default {
|
||||
} else {
|
||||
this.estimateAutogenerate = false
|
||||
}
|
||||
|
||||
this.estimate_email_attachment = val ? val.estimate_email_attachment : ''
|
||||
|
||||
if (this.estimate_email_attachment === 'YES') {
|
||||
this.estimateAsAttachment = true
|
||||
} else {
|
||||
this.estimateAsAttachment = false
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
@ -214,6 +249,7 @@ export default {
|
||||
let data = {
|
||||
settings: {
|
||||
estimate_auto_generate: this.estimateAutogenerate ? 'YES' : 'NO',
|
||||
estimate_email_attachment: this.estimateAsAttachment ? 'YES' : 'NO',
|
||||
},
|
||||
}
|
||||
let response = await this.updateCompanySettings(data)
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
|
||||
<sw-divider class="mt-6 mb-8" />
|
||||
|
||||
<div class="flex">
|
||||
<div class="flex mt-3 mb-4">
|
||||
<div class="relative w-12">
|
||||
<sw-switch
|
||||
v-model="invoiceAutogenerate"
|
||||
@ -101,6 +101,33 @@
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex mb-2">
|
||||
<div class="relative w-12">
|
||||
<sw-switch
|
||||
v-model="invoiceAsAttachment"
|
||||
class="absolute"
|
||||
style="top: -20px"
|
||||
@change="setInvoiceSetting"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="ml-4">
|
||||
<p class="p-0 mb-1 text-base leading-snug text-black">
|
||||
{{
|
||||
$t('settings.customization.invoices.invoice_email_attachment')
|
||||
}}
|
||||
</p>
|
||||
|
||||
<p
|
||||
class="p-0 m-0 text-xs leading-tight text-gray-500"
|
||||
style="max-width: 480px"
|
||||
>
|
||||
{{
|
||||
$t('settings.customization.invoices.invoice_email_attachment_setting_description')
|
||||
}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -120,6 +147,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
invoiceAutogenerate: false,
|
||||
invoiceAsAttachment: false,
|
||||
|
||||
invoices: {
|
||||
invoice_prefix: null,
|
||||
@ -189,6 +217,14 @@ export default {
|
||||
} else {
|
||||
this.invoiceAutogenerate = false
|
||||
}
|
||||
|
||||
this.invoice_email_attachment = val ? val.invoice_email_attachment : ''
|
||||
|
||||
if (this.invoice_email_attachment === 'YES') {
|
||||
this.invoiceAsAttachment = true
|
||||
} else {
|
||||
this.invoiceAsAttachment = false
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
@ -209,6 +245,7 @@ export default {
|
||||
let data = {
|
||||
settings: {
|
||||
invoice_auto_generate: this.invoiceAutogenerate ? 'YES' : 'NO',
|
||||
invoice_email_attachment: this.invoiceAsAttachment ? 'YES' : 'NO',
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@ -63,7 +63,7 @@
|
||||
|
||||
<sw-divider class="mt-6 mb-8" />
|
||||
|
||||
<div class="flex">
|
||||
<div class="flex mt-3 mb-4">
|
||||
<div class="relative w-12">
|
||||
<sw-switch
|
||||
v-model="paymentAutogenerate"
|
||||
@ -90,6 +90,33 @@
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex mb-2">
|
||||
<div class="relative w-12">
|
||||
<sw-switch
|
||||
v-model="paymentAsAttachment"
|
||||
class="absolute"
|
||||
style="top: -20px"
|
||||
@change="setPaymentSetting"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="ml-4">
|
||||
<p class="p-0 mb-1 text-base leading-snug text-black">
|
||||
{{
|
||||
$t('settings.customization.payments.payment_email_attachment')
|
||||
}}
|
||||
</p>
|
||||
|
||||
<p
|
||||
class="p-0 m-0 text-xs leading-tight text-gray-500"
|
||||
style="max-width: 480px"
|
||||
>
|
||||
{{
|
||||
$t('settings.customization.payments.payment_email_attachment_setting_description')
|
||||
}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@ -108,6 +135,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
paymentAutogenerate: false,
|
||||
paymentAsAttachment: false,
|
||||
|
||||
payments: {
|
||||
payment_prefix: null,
|
||||
@ -184,6 +212,14 @@ export default {
|
||||
} else {
|
||||
this.paymentAutogenerate = false
|
||||
}
|
||||
|
||||
this.payment_email_attachment = val ? val.payment_email_attachment : ''
|
||||
|
||||
if (this.payment_email_attachment === 'YES') {
|
||||
this.payment_email_attachment = true
|
||||
} else {
|
||||
this.payment_email_attachment = false
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
@ -203,6 +239,7 @@ export default {
|
||||
let data = {
|
||||
settings: {
|
||||
payment_auto_generate: this.paymentAutogenerate ? 'YES' : 'NO',
|
||||
payment_email_attachment: this.paymentAsAttachment ? 'YES' : 'NO',
|
||||
},
|
||||
}
|
||||
let response = await this.updateCompanySettings(data)
|
||||
|
||||
@ -17,9 +17,11 @@
|
||||
@slot('subcopy')
|
||||
@component('mail::subcopy')
|
||||
{!! $data['body'] !!}
|
||||
@component('mail::button', ['url' => url('/customer/estimates/pdf/'.$data['estimate']['unique_hash'])])
|
||||
View Estimate
|
||||
@endcomponent
|
||||
@if(!$pdfData)
|
||||
@component('mail::button', ['url' => url('/customer/estimates/pdf/'.$data['estimate']['unique_hash'])])
|
||||
View Estimate
|
||||
@endcomponent
|
||||
@endif
|
||||
@endcomponent
|
||||
@endslot
|
||||
|
||||
|
||||
@ -17,9 +17,11 @@
|
||||
@slot('subcopy')
|
||||
@component('mail::subcopy')
|
||||
{!! $data['body'] !!}
|
||||
@component('mail::button', ['url' => url('/customer/invoices/pdf/'.$data['invoice']['unique_hash'])])
|
||||
View Invoice
|
||||
@endcomponent
|
||||
@if(!$pdfData)
|
||||
@component('mail::button', ['url' => url('/customer/invoices/pdf/'.$data['invoice']['unique_hash'])])
|
||||
View Invoice
|
||||
@endcomponent
|
||||
@endif
|
||||
@endcomponent
|
||||
@endslot
|
||||
|
||||
|
||||
@ -17,9 +17,11 @@
|
||||
@slot('subcopy')
|
||||
@component('mail::subcopy')
|
||||
{!! $data['body'] !!}
|
||||
@component('mail::button', ['url' => url('/payments/pdf/'.$data['payment']['unique_hash'])])
|
||||
View Payment
|
||||
@endcomponent
|
||||
@if(!$pdfData)
|
||||
@component('mail::button', ['url' => url('/payments/pdf/'.$data['payment']['unique_hash'])])
|
||||
View Payment
|
||||
@endcomponent
|
||||
@endif
|
||||
@endcomponent
|
||||
@endslot
|
||||
|
||||
|
||||
Reference in New Issue
Block a user