mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-19 03:04:05 +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:
@@ -110,7 +110,12 @@
|
||||
cursor-pointer
|
||||
"
|
||||
>
|
||||
{{ taxType.percent }} %
|
||||
<template v-if="taxType.calculation_type === 'fixed'">
|
||||
<BaseFormatMoney :amount="taxType.fixed_amount" :currency="companyStore.selectedCompanyCurrency" />
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ taxType.percent }} %
|
||||
</template>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@@ -173,7 +178,9 @@ import { useInvoiceStore } from '@/scripts/admin/stores/invoice'
|
||||
import { useModalStore } from '@/scripts/stores/modal'
|
||||
import { useTaxTypeStore } from '@/scripts/admin/stores/tax-type'
|
||||
import { useUserStore } from '@/scripts/admin/stores/user'
|
||||
import { useCompanyStore } from '@/scripts/admin/stores/company'
|
||||
import abilities from '@/scripts/admin/stub/abilities'
|
||||
import BaseFormatMoney from '@/scripts/components/base/BaseFormatMoney.vue'
|
||||
|
||||
const props = defineProps({
|
||||
type: {
|
||||
@@ -195,10 +202,15 @@ const emit = defineEmits(['select:taxType'])
|
||||
const modalStore = useModalStore()
|
||||
const taxTypeStore = useTaxTypeStore()
|
||||
const userStore = useUserStore()
|
||||
const companyStore = useCompanyStore()
|
||||
|
||||
const { t } = useI18n()
|
||||
const textSearch = ref(null)
|
||||
|
||||
const formatMoney = (amount) => {
|
||||
return companyStore.formatMoney(amount)
|
||||
}
|
||||
|
||||
const filteredTaxType = computed(() => {
|
||||
if (textSearch.value) {
|
||||
return taxTypeStore.taxTypes.filter(function (el) {
|
||||
|
||||
Reference in New Issue
Block a user