Add Company VAT-ID and Tax-ID (#54)

* add company vat_id & tax_id field

* add tax & vat id field in company settings

* fix vat & tax id validation

* add german vat & tax id translation

* add translations for pdf

* add vat_id and tax_id field before timestamps

* make fields nullable and fix code style
This commit is contained in:
Timo
2024-04-20 23:08:32 +02:00
committed by GitHub
parent dc8a85538f
commit 8c83df558c
8 changed files with 94 additions and 26 deletions

View File

@@ -84,6 +84,16 @@
class="mt-2"
/>
</div>
<div class="space-y-6">
<BaseInputGroup :label="$t('settings.company_info.tax_id')">
<BaseInput v-model="companyForm.tax_id" type="text" />
</BaseInputGroup>
<BaseInputGroup :label="$t('settings.company_info.vat_id')">
<BaseInput v-model="companyForm.vat_id" type="text" />
</BaseInputGroup>
</div>
</BaseInputGrid>
<BaseButton
@@ -111,24 +121,7 @@
<div class="mt-5">
<button
type="button"
class="
inline-flex
items-center
justify-center
px-4
py-2
border border-transparent
font-medium
rounded-md
text-red-700
bg-red-100
hover:bg-red-200
focus:outline-none
focus:ring-2
focus:ring-offset-2
focus:ring-red-500
sm:text-sm
"
class="inline-flex items-center justify-center px-4 py-2 border border-transparent font-medium rounded-md text-red-700 bg-red-100 hover:bg-red-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:text-sm"
@click="removeCompany"
>
{{ $t('general.delete') }}
@@ -161,6 +154,8 @@ let isSaving = ref(false)
const companyForm = reactive({
name: null,
logo: null,
tax_id: null,
vat_id: null,
address: {
address_street_1: '',
address_street_2: '',
@@ -194,7 +189,7 @@ const rules = computed(() => {
required: helpers.withMessage(t('validation.required'), required),
minLength: helpers.withMessage(
t('validation.name_min_length'),
minLength(3)
minLength(3),
),
},
address: {
@@ -207,7 +202,7 @@ const rules = computed(() => {
const v$ = useVuelidate(
rules,
computed(() => companyForm)
computed(() => companyForm),
)
globalStore.fetchCountries()
@@ -243,7 +238,7 @@ async function updateCompanyData() {
JSON.stringify({
name: logoFileName.value,
data: logoFileBlob.value,
})
}),
)
}
logoData.append('is_company_logo_removed', isCompanyLogoRemoved.value)