mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-05-27 13:44:54 +00:00
Merge remote-tracking branch 'origin/master' into frontend-performance-improvements
This commit is contained in:
@@ -250,6 +250,14 @@ customFieldStore.resetCustomFields()
|
||||
v$.value.$reset
|
||||
estimateStore.fetchEstimateInitialSettings(isEdit.value)
|
||||
|
||||
watch(
|
||||
() => companyStore.selectedCompanySettings?.tax_included_by_default,
|
||||
(newVal) => {
|
||||
estimateStore.newEstimate.tax_included = newVal === 'YES'
|
||||
},
|
||||
{immediate: true}
|
||||
)
|
||||
|
||||
async function submitForm() {
|
||||
v$.value.$touch()
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ async function verifyDomain() {
|
||||
try {
|
||||
await installationStore.setInstallationDomain(formData)
|
||||
await installationStore.installationLogin()
|
||||
let driverRes = await installationStore.checkAutheticated()
|
||||
let driverRes = await installationStore.checkAuthenticated()
|
||||
|
||||
if (driverRes.data) {
|
||||
emit('next', 4)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<form action="" @submit.prevent="next">
|
||||
<div class="grid grid-cols-1 gap-5 md:grid-cols-2 lg:mb-6 md:mb-6">
|
||||
<div class="grid grid-cols-1 gap-5 md:grid-cols-2 mb-6">
|
||||
<BaseInputGroup
|
||||
:label="$t('wizard.database.app_url')"
|
||||
:error="v$.app_url.$error && v$.app_url.$errors[0].$message"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<form action="" @submit.prevent="next">
|
||||
<div class="grid grid-cols-1 gap-5 md:grid-cols-2 lg:mb-6 md:mb-6">
|
||||
<div class="grid grid-cols-1 gap-5 md:grid-cols-2 mb-6">
|
||||
<BaseInputGroup
|
||||
:label="$t('wizard.database.app_url')"
|
||||
:content-loading="isFetchingInitialData"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<form action="" @submit.prevent="next">
|
||||
<div class="grid grid-cols-1 gap-5 md:grid-cols-2 lg:mb-6 md:mb-6">
|
||||
<div class="grid grid-cols-1 gap-5 md:grid-cols-2 mb-6">
|
||||
<BaseInputGroup
|
||||
:label="$t('wizard.database.app_url')"
|
||||
:content-loading="isFetchingInitialData"
|
||||
|
||||
@@ -404,8 +404,8 @@ onSearched = debounce(onSearched, 500)
|
||||
</BaseDropdown>
|
||||
|
||||
<BaseButton class="ml-1" size="md" variant="gray" @click="sortData">
|
||||
<BaseIcon v-if="getOrderBy" name="SortAscendingIcon" />
|
||||
<BaseIcon v-else name="SortDescendingIcon" />
|
||||
<BaseIcon v-if="getOrderBy" name="BarsArrowUpIcon" />
|
||||
<BaseIcon v-else name="BarsArrowDownIcon" />
|
||||
</BaseButton>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -254,6 +254,14 @@ watch(
|
||||
}
|
||||
)
|
||||
|
||||
watch(
|
||||
() => companyStore.selectedCompanySettings?.tax_included_by_default,
|
||||
(newVal) => {
|
||||
invoiceStore.newInvoice.tax_included = newVal === 'YES'
|
||||
},
|
||||
{immediate: true}
|
||||
)
|
||||
|
||||
async function submitForm() {
|
||||
v$.value.$touch()
|
||||
|
||||
|
||||
@@ -191,7 +191,7 @@ const taxes = computed({
|
||||
return {
|
||||
...tax,
|
||||
tax_type_id: tax.id,
|
||||
tax_name: `${tax.name} (${tax.calculation_type === 'fixed'
|
||||
tax_name: `${tax.name} (${tax.calculation_type === 'fixed'
|
||||
? new Intl.NumberFormat(undefined, {
|
||||
style: 'currency',
|
||||
currency: companyStore.selectedCompanyCurrency.code
|
||||
@@ -216,7 +216,7 @@ const getTaxTypes = computed(() => {
|
||||
return {
|
||||
...tax,
|
||||
tax_type_id: tax.id,
|
||||
tax_name: `${tax.name} (${tax.calculation_type === 'fixed'
|
||||
tax_name: `${tax.name} (${tax.calculation_type === 'fixed'
|
||||
? new Intl.NumberFormat(undefined, {
|
||||
style: 'currency',
|
||||
currency: companyStore.selectedCompanyCurrency.code
|
||||
@@ -299,7 +299,7 @@ async function submitItem() {
|
||||
tax_type_id: tax.tax_type_id,
|
||||
calculation_type: tax.calculation_type,
|
||||
fixed_amount: tax.fixed_amount,
|
||||
amount: tax.calculation_type === 'fixed' ? tax.fixed_amount : price.value * tax.percent,
|
||||
amount: tax.calculation_type === 'fixed' ? tax.fixed_amount : Math.round(price.value * tax.percent),
|
||||
percent: tax.percent,
|
||||
name: tax.name,
|
||||
collective_tax: 0,
|
||||
|
||||
@@ -284,6 +284,14 @@ watch(
|
||||
}
|
||||
)
|
||||
|
||||
watch(
|
||||
() => companyStore.selectedCompanySettings?.tax_included_by_default,
|
||||
(newVal) => {
|
||||
recurringInvoiceStore.newRecurringInvoice.tax_included = newVal === 'YES'
|
||||
},
|
||||
{immediate: true}
|
||||
)
|
||||
|
||||
async function submitForm() {
|
||||
v$.value.$touch()
|
||||
|
||||
|
||||
@@ -52,6 +52,21 @@
|
||||
:title="$t('settings.tax_types.tax_per_item')"
|
||||
:description="$t('settings.tax_types.tax_setting_description')"
|
||||
/>
|
||||
|
||||
<BaseDivider class="mt-8 mb-2" />
|
||||
|
||||
<BaseSwitchSection
|
||||
v-model="taxIncludedField"
|
||||
:title="$t('settings.tax_types.tax_included')"
|
||||
:description="$t('settings.tax_types.tax_included_description')"
|
||||
/>
|
||||
|
||||
<BaseSwitchSection
|
||||
v-if="taxIncludedField"
|
||||
v-model="taxIncludedByDefaultField"
|
||||
:title="$t('settings.tax_types.tax_included_by_default')"
|
||||
:description="$t('settings.tax_types.tax_included_by_default_description')"
|
||||
/>
|
||||
</div>
|
||||
</BaseSettingCard>
|
||||
</template>
|
||||
@@ -145,6 +160,61 @@ const taxPerItemField = computed({
|
||||
},
|
||||
})
|
||||
|
||||
const taxIncludedSettings = reactive({
|
||||
tax_included: 'NO',
|
||||
tax_included_by_default: 'NO',
|
||||
})
|
||||
|
||||
utils.mergeSettings(taxIncludedSettings, {
|
||||
...companyStore.selectedCompanySettings,
|
||||
})
|
||||
|
||||
const taxIncludedField = computed({
|
||||
get: () => {
|
||||
return taxIncludedSettings.tax_included === 'YES'
|
||||
},
|
||||
set: async (newValue) => {
|
||||
const value = newValue ? 'YES' : 'NO'
|
||||
taxIncludedSettings.tax_included = value
|
||||
|
||||
if (!newValue) {
|
||||
taxIncludedSettings.tax_included_by_default = 'NO'
|
||||
}
|
||||
|
||||
let data = {
|
||||
settings: {
|
||||
...taxIncludedSettings,
|
||||
},
|
||||
}
|
||||
|
||||
await companyStore.updateCompanySettings({
|
||||
data,
|
||||
message: 'general.setting_updated',
|
||||
})
|
||||
},
|
||||
})
|
||||
|
||||
const taxIncludedByDefaultField = computed({
|
||||
get: () => {
|
||||
return taxIncludedSettings.tax_included_by_default === 'YES'
|
||||
},
|
||||
set: async (newValue) => {
|
||||
const value = newValue ? 'YES' : 'NO'
|
||||
taxIncludedSettings.tax_included_by_default = value
|
||||
|
||||
let data = {
|
||||
settings: {
|
||||
tax_included_by_default: taxIncludedSettings.tax_included_by_default,
|
||||
},
|
||||
}
|
||||
|
||||
await companyStore.updateCompanySettings({
|
||||
data,
|
||||
message: 'general.setting_updated',
|
||||
})
|
||||
},
|
||||
})
|
||||
|
||||
function hasAtleastOneAbility() {
|
||||
return userStore.hasAbilities([
|
||||
abilities.DELETE_TAX_TYPE,
|
||||
|
||||
Reference in New Issue
Block a user