Customers tax id field

This commit is contained in:
Martin Chevignard
2024-10-04 12:07:29 +02:00
parent dd98df1c77
commit 03b9defeb1
12 changed files with 73 additions and 11 deletions

View File

@@ -116,6 +116,15 @@
/>
</BaseInputGroup>
</BaseInputGrid>
<BaseInputGroup :label="$t('customers.tax_id')">
<BaseInput
v-model="customerStore.currentCustomer.tax_id"
type="text"
class="mt-1 md:mt-0"
/>
</BaseInputGroup>
</BaseInputGrid>
</BaseTab>

View File

@@ -157,6 +157,24 @@
@input="v$.currentCustomer.prefix.$touch()"
/>
</BaseInputGroup>
<BaseInputGroup
:label="$t('customers.tax_id')"
:error="
v$.currentCustomer.tax_id.$error &&
v$.currentCustomer.tax_id.$errors[0].$message
"
:content-loading="isFetchingInitialData"
>
<BaseInput
v-model="customerStore.currentCustomer.tax_id"
:content-loading="isFetchingInitialData"
type="text"
name="tax_id"
:invalid="v$.currentCustomer.tax_id.$error"
@input="v$.currentCustomer.tax_id.$touch()"
/>
</BaseInputGroup>
</BaseInputGrid>
</div>
@@ -645,6 +663,9 @@ const rules = computed(() => {
minLength(3)
),
},
tax_id: {
required: helpers.withMessage(t('validation.required'), required),
},
currency_id: {
required: helpers.withMessage(t('validation.required'), required),
},

View File

@@ -180,6 +180,7 @@ async function getFields() {
{ label: 'Email', value: 'CONTACT_EMAIL' },
{ label: 'Phone', value: 'CONTACT_PHONE' },
{ label: 'Website', value: 'CONTACT_WEBSITE' },
{ label: 'Tax ID', value: 'CONTACT_TAX_ID' },
...customerFields.value.map((i) => ({
label: i.label,
value: i.slug,

View File

@@ -14,11 +14,10 @@ import.meta.glob([
window.pinia = pinia
window.Vuelidate = Vuelidate
import InvoiceShelf from './InvoiceShelf'
import InvoiceShelf from './InvoiceShelf.js'
window.Vue = Vue
window.router = router
window.VueRouter = VueRouter
window.InvoiceShelf = new InvoiceShelf()
window.InvoiceShelf = new InvoiceShelf()