added mark as default changes in estimate and invoice template

This commit is contained in:
asift798
2022-02-11 12:23:36 +05:30
parent 513d43d92f
commit 00133d66c2
9 changed files with 79 additions and 3 deletions

View File

@ -31,6 +31,10 @@ const props = defineProps({
type: String,
default: '',
},
isMarkAsDefault: {
type: Boolean,
default: false,
},
})
const modalStore = useModalStore()
@ -38,6 +42,17 @@ const modalStore = useModalStore()
const { t } = useI18n()
function openTemplateModal() {
let markAsDefaultDescription = ''
if (props.storeProp == 'newEstimate') {
markAsDefaultDescription = t(
'estimates.mark_as_default_estimate_template_description'
)
} else if (props.storeProp == 'newInvoice') {
markAsDefaultDescription = t(
'invoices.mark_as_default_invoice_template_description'
)
}
modalStore.openModal({
title: t('general.choose_template'),
componentName: 'SelectTemplate',
@ -45,6 +60,8 @@ function openTemplateModal() {
templates: props.store.templates,
store: props.store,
storeProp: props.storeProp,
isMarkAsDefault: props.isMarkAsDefault,
markAsDefaultDescription,
},
})
}