diff --git a/resources/scripts/admin/components/modal-components/ItemModal.vue b/resources/scripts/admin/components/modal-components/ItemModal.vue index e9d847d4..73cdb5b6 100644 --- a/resources/scripts/admin/components/modal-components/ItemModal.vue +++ b/resources/scripts/admin/components/modal-components/ItemModal.vue @@ -208,15 +208,15 @@ const v$ = useVuelidate( const getTaxTypes = computed(() => { return taxTypeStore.taxTypes.map((tax) => { - const amount = tax.calculation_type === 'fixed' + const amount = tax.calculation_type === 'fixed' ? new Intl.NumberFormat(undefined, { style: 'currency', currency: companyStore.selectedCompanyCurrency.code }).format(tax.fixed_amount / 100) : `${tax.percent}%` - - return { - ...tax, + + return { + ...tax, tax_name: `${tax.name} (${amount})` } }) @@ -239,7 +239,7 @@ async function submitItemData() { taxes: itemStore.currentItem.taxes.map((tax) => { return { tax_type_id: tax.id, - amount: tax.calculation_type === 'fixed' ? tax.fixed_amount : (price.value * tax.percent) / 100, + amount: tax.calculation_type === 'fixed' ? tax.fixed_amount : Math.round(price.value * tax.percent), percent: tax.percent, fixed_amount: tax.fixed_amount, calculation_type: tax.calculation_type,