mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-17 02:04:03 +00:00
Adding Flat Tax support with fixed amount (#253)
* Possibility to set a fixed amount on tax types settings * Pint and manage flat taxes on items * Fix display errors and handle global taxes * Tests * Pint with PHP 8.2 cause with PHP 8.3 version it cause workflow error * Merging percent and fixed amount into one column * Now display the currency on SelectTaxPopup on fixed taxes
This commit is contained in:
@@ -20,7 +20,20 @@
|
||||
:data="fetchData"
|
||||
:columns="taxTypeColumns"
|
||||
>
|
||||
<template #cell-percent="{ row }"> {{ row.data.percent }} % </template>
|
||||
<template #cell-calculation_type="{ row }">
|
||||
{{ $t(`settings.tax_types.${row.data.calculation_type}`) }}
|
||||
</template>
|
||||
<template #cell-amount="{ row }">
|
||||
<template v-if="row.data.calculation_type === 'percentage'">
|
||||
{{ row.data.percent }} %
|
||||
</template>
|
||||
<template v-else-if="row.data.calculation_type === 'fixed'">
|
||||
<BaseFormatMoney :amount="row.data.fixed_amount" :currency="defaultCurrency" />
|
||||
</template>
|
||||
<template v-else>
|
||||
-
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<template v-if="hasAtleastOneAbility()" #cell-actions="{ row }">
|
||||
<TaxTypeDropdown
|
||||
@@ -64,9 +77,9 @@ const taxTypeStore = useTaxTypeStore()
|
||||
const modalStore = useModalStore()
|
||||
const userStore = useUserStore()
|
||||
const moduleStore = useModuleStore()
|
||||
|
||||
const table = ref(null)
|
||||
const taxPerItemSetting = ref(companyStore.selectedCompanySettings.tax_per_item)
|
||||
const defaultCurrency = computed(() => companyStore.selectedCompanyCurrency)
|
||||
|
||||
const taxTypeColumns = computed(() => {
|
||||
return [
|
||||
@@ -77,8 +90,14 @@ const taxTypeColumns = computed(() => {
|
||||
tdClass: 'font-medium text-gray-900',
|
||||
},
|
||||
{
|
||||
key: 'percent',
|
||||
label: t('settings.tax_types.percent'),
|
||||
key: 'calculation_type',
|
||||
label: t('settings.tax_types.calculation_type'),
|
||||
thClass: 'extra',
|
||||
tdClass: 'font-medium text-gray-900',
|
||||
},
|
||||
{
|
||||
key: 'amount',
|
||||
label: t('settings.tax_types.amount'),
|
||||
thClass: 'extra',
|
||||
tdClass: 'font-medium text-gray-900',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user