mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 19:51:09 -04:00
added mark as default changes in estimate and invoice template
This commit is contained in:
@ -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,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user