mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 11:41:09 -04:00
Compare commits
8 Commits
e5afc93efa
...
fix-tax-is
| Author | SHA1 | Date | |
|---|---|---|---|
| c8ee6389a4 | |||
| e4bd002fae | |||
| 05abf7fa74 | |||
| 33bc9ded65 | |||
| 4271ef451e | |||
| 6eb44fba93 | |||
| 96e7300583 | |||
| a479d966d1 |
@ -38,15 +38,15 @@
|
|||||||
"barryvdh/laravel-ide-helper": "^2.6",
|
"barryvdh/laravel-ide-helper": "^2.6",
|
||||||
"beyondcode/laravel-dump-server": "^1.0",
|
"beyondcode/laravel-dump-server": "^1.0",
|
||||||
"facade/ignition": "^2.3.6",
|
"facade/ignition": "^2.3.6",
|
||||||
"friendsofphp/php-cs-fixer": "^3.0",
|
"friendsofphp/php-cs-fixer": "^3.8",
|
||||||
"fzaninotto/faker": "^1.9.1",
|
"fakerphp/faker": "^1.9.1",
|
||||||
"mockery/mockery": "^1.3.1",
|
"mockery/mockery": "^1.3.1",
|
||||||
"nunomaduro/collision": "^5.0",
|
"nunomaduro/collision": "^5.0",
|
||||||
"pestphp/pest": "^1.0",
|
"pestphp/pest": "^1.0",
|
||||||
"pestphp/pest-plugin-faker": "^1.0",
|
"pestphp/pest-plugin-faker": "^1.0",
|
||||||
"pestphp/pest-plugin-laravel": "^1.0",
|
"pestphp/pest-plugin-laravel": "^1.0",
|
||||||
"pestphp/pest-plugin-parallel": "^0.2.1",
|
"pestphp/pest-plugin-parallel": "^0.2.1",
|
||||||
"phpunit/phpunit": "^9.0"
|
"phpunit/phpunit": "^9.3"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
@ -88,4 +88,4 @@
|
|||||||
"dont-discover": []
|
"dont-discover": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
2347
composer.lock
generated
2347
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
|||||||
FROM php:7.4-fpm-alpine
|
FROM php:8.0-fpm-alpine
|
||||||
|
|
||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
php7-bcmath
|
php8-bcmath
|
||||||
|
|
||||||
RUN docker-php-ext-install pdo pdo_mysql bcmath
|
RUN docker-php-ext-install pdo pdo_mysql bcmath
|
||||||
|
|
||||||
|
|||||||
@ -17,18 +17,7 @@
|
|||||||
<td class="px-5 py-4 text-left align-top">
|
<td class="px-5 py-4 text-left align-top">
|
||||||
<div class="flex justify-start">
|
<div class="flex justify-start">
|
||||||
<div
|
<div
|
||||||
class="
|
class="flex items-center justify-center w-5 h-5 mt-2 mr-2 text-gray-300 cursor-move handle"
|
||||||
flex
|
|
||||||
items-center
|
|
||||||
justify-center
|
|
||||||
w-5
|
|
||||||
h-5
|
|
||||||
mt-2
|
|
||||||
text-gray-300
|
|
||||||
cursor-move
|
|
||||||
handle
|
|
||||||
mr-2
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
<DragIcon />
|
<DragIcon />
|
||||||
</div>
|
</div>
|
||||||
@ -108,7 +97,7 @@
|
|||||||
|
|
||||||
<BaseIcon
|
<BaseIcon
|
||||||
name="ChevronDownIcon"
|
name="ChevronDownIcon"
|
||||||
class="w-4 h-4 text-gray-500 ml-1"
|
class="w-4 h-4 ml-1 text-gray-500"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
</BaseButton>
|
</BaseButton>
|
||||||
@ -155,7 +144,7 @@
|
|||||||
<BaseContentPlaceholders v-if="loading">
|
<BaseContentPlaceholders v-if="loading">
|
||||||
<BaseContentPlaceholdersText
|
<BaseContentPlaceholdersText
|
||||||
:lines="1"
|
:lines="1"
|
||||||
class="w-24 h-8 rounded-md border"
|
class="w-24 h-8 border rounded-md"
|
||||||
/>
|
/>
|
||||||
</BaseContentPlaceholders>
|
</BaseContentPlaceholders>
|
||||||
|
|
||||||
@ -175,6 +164,7 @@
|
|||||||
:ability="abilities.CREATE_INVOICE"
|
:ability="abilities.CREATE_INVOICE"
|
||||||
:store="store"
|
:store="store"
|
||||||
:store-prop="storeProp"
|
:store-prop="storeProp"
|
||||||
|
:discount="discount"
|
||||||
@update="updateTax"
|
@update="updateTax"
|
||||||
/>
|
/>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@ -30,24 +30,13 @@
|
|||||||
<template v-if="userStore.hasAbilities(ability)" #action>
|
<template v-if="userStore.hasAbilities(ability)" #action>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="
|
class="flex items-center justify-center w-full px-2 py-2 bg-gray-200 border-none outline-none cursor-pointer "
|
||||||
flex
|
|
||||||
items-center
|
|
||||||
justify-center
|
|
||||||
w-full
|
|
||||||
px-2
|
|
||||||
cursor-pointer
|
|
||||||
py-2
|
|
||||||
bg-gray-200
|
|
||||||
border-none
|
|
||||||
outline-none
|
|
||||||
"
|
|
||||||
@click="openTaxModal"
|
@click="openTaxModal"
|
||||||
>
|
>
|
||||||
<BaseIcon name="CheckCircleIcon" class="h-5 text-primary-400" />
|
<BaseIcon name="CheckCircleIcon" class="h-5 text-primary-400" />
|
||||||
|
|
||||||
<label
|
<label
|
||||||
class="ml-2 text-sm leading-none text-primary-400 cursor-pointer"
|
class="ml-2 text-sm leading-none cursor-pointer text-primary-400"
|
||||||
>{{ $t('invoices.add_new_tax') }}</label
|
>{{ $t('invoices.add_new_tax') }}</label
|
||||||
>
|
>
|
||||||
</button>
|
</button>
|
||||||
@ -115,6 +104,10 @@ const props = defineProps({
|
|||||||
type: Number,
|
type: Number,
|
||||||
default: 0,
|
default: 0,
|
||||||
},
|
},
|
||||||
|
discountedTotal: {
|
||||||
|
type: Number,
|
||||||
|
default: 0,
|
||||||
|
},
|
||||||
currency: {
|
currency: {
|
||||||
type: [Object, String],
|
type: [Object, String],
|
||||||
required: true,
|
required: true,
|
||||||
@ -153,19 +146,19 @@ const filteredTypes = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const taxAmount = computed(() => {
|
const taxAmount = computed(() => {
|
||||||
if (localTax.compound_tax && props.total) {
|
if (localTax.compound_tax && props.discountedTotal) {
|
||||||
return ((props.total + props.totalTax) * localTax.percent) / 100
|
return ((props.discountedTotal + props.totalTax) * localTax.percent) / 100
|
||||||
}
|
}
|
||||||
|
|
||||||
if (props.total && localTax.percent) {
|
if (props.discountedTotal && localTax.percent) {
|
||||||
return (props.total * localTax.percent) / 100
|
return (props.discountedTotal * localTax.percent) / 100
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
})
|
})
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.total,
|
() => props.discountedTotal,
|
||||||
() => {
|
() => {
|
||||||
updateRowTax()
|
updateRowTax()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,14 +29,7 @@
|
|||||||
|
|
||||||
<label
|
<label
|
||||||
v-else
|
v-else
|
||||||
class="
|
class="flex items-center justify-center m-0 text-lg text-black uppercase "
|
||||||
flex
|
|
||||||
items-center
|
|
||||||
justify-center
|
|
||||||
m-0
|
|
||||||
text-lg text-black
|
|
||||||
uppercase
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
<BaseFormatMoney
|
<BaseFormatMoney
|
||||||
:amount="store.getSubTotal"
|
:amount="store.getSubTotal"
|
||||||
@ -66,14 +59,7 @@
|
|||||||
|
|
||||||
<label
|
<label
|
||||||
v-else-if="store[storeProp].tax_per_item === 'YES'"
|
v-else-if="store[storeProp].tax_per_item === 'YES'"
|
||||||
class="
|
class="flex items-center justify-center m-0 text-lg text-black uppercase "
|
||||||
flex
|
|
||||||
items-center
|
|
||||||
justify-center
|
|
||||||
m-0
|
|
||||||
text-lg text-black
|
|
||||||
uppercase
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
<BaseFormatMoney :amount="tax.amount" :currency="defaultCurrency" />
|
<BaseFormatMoney :amount="tax.amount" :currency="defaultCurrency" />
|
||||||
</label>
|
</label>
|
||||||
@ -98,7 +84,7 @@
|
|||||||
<BaseContentPlaceholders v-if="isLoading">
|
<BaseContentPlaceholders v-if="isLoading">
|
||||||
<BaseContentPlaceholdersText
|
<BaseContentPlaceholdersText
|
||||||
:lines="1"
|
:lines="1"
|
||||||
class="w-24 h-8 rounded-md border"
|
class="w-24 h-8 border rounded-md"
|
||||||
/>
|
/>
|
||||||
</BaseContentPlaceholders>
|
</BaseContentPlaceholders>
|
||||||
<div v-else class="flex" style="width: 140px" role="group">
|
<div v-else class="flex" style="width: 140px" role="group">
|
||||||
@ -114,7 +100,7 @@
|
|||||||
<BaseDropdown position="bottom-end">
|
<BaseDropdown position="bottom-end">
|
||||||
<template #activator>
|
<template #activator>
|
||||||
<BaseButton
|
<BaseButton
|
||||||
class="rounded-tr-md rounded-br-md p-2 rounded-none"
|
class="p-2 rounded-none rounded-tr-md rounded-br-md"
|
||||||
type="button"
|
type="button"
|
||||||
variant="white"
|
variant="white"
|
||||||
>
|
>
|
||||||
@ -127,7 +113,7 @@
|
|||||||
|
|
||||||
<BaseIcon
|
<BaseIcon
|
||||||
name="ChevronDownIcon"
|
name="ChevronDownIcon"
|
||||||
class="w-4 h-4 text-gray-500 ml-1"
|
class="w-4 h-4 ml-1 text-gray-500"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
</BaseButton>
|
</BaseButton>
|
||||||
@ -180,15 +166,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="
|
class="flex items-center justify-between w-full pt-2 mt-5 border-t border-gray-200 border-solid "
|
||||||
flex
|
|
||||||
items-center
|
|
||||||
justify-between
|
|
||||||
w-full
|
|
||||||
pt-2
|
|
||||||
mt-5
|
|
||||||
border-t border-gray-200 border-solid
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
<BaseContentPlaceholders v-if="isLoading">
|
<BaseContentPlaceholders v-if="isLoading">
|
||||||
<BaseContentPlaceholdersText :lines="1" class="w-16 h-5" />
|
<BaseContentPlaceholdersText :lines="1" class="w-16 h-5" />
|
||||||
@ -204,14 +182,7 @@
|
|||||||
</BaseContentPlaceholders>
|
</BaseContentPlaceholders>
|
||||||
<label
|
<label
|
||||||
v-else
|
v-else
|
||||||
class="
|
class="flex items-center justify-center text-lg uppercase text-primary-400"
|
||||||
flex
|
|
||||||
items-center
|
|
||||||
justify-center
|
|
||||||
text-lg
|
|
||||||
uppercase
|
|
||||||
text-primary-400
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
<BaseFormatMoney :amount="store.getTotal" :currency="defaultCurrency" />
|
<BaseFormatMoney :amount="store.getTotal" :currency="defaultCurrency" />
|
||||||
</label>
|
</label>
|
||||||
@ -334,6 +305,7 @@ function selectPercentage() {
|
|||||||
|
|
||||||
function onSelectTax(selectedTax) {
|
function onSelectTax(selectedTax) {
|
||||||
let amount = 0
|
let amount = 0
|
||||||
|
|
||||||
if (selectedTax.compound_tax && props.store.getSubtotalWithDiscount) {
|
if (selectedTax.compound_tax && props.store.getSubtotalWithDiscount) {
|
||||||
amount = Math.round(
|
amount = Math.round(
|
||||||
((props.store.getSubtotalWithDiscount + props.store.getTotalSimpleTax) *
|
((props.store.getSubtotalWithDiscount + props.store.getTotalSimpleTax) *
|
||||||
|
|||||||
@ -54,8 +54,6 @@
|
|||||||
label="name"
|
label="name"
|
||||||
:options="itemStore.itemUnits"
|
:options="itemStore.itemUnits"
|
||||||
value-prop="id"
|
value-prop="id"
|
||||||
:can-deselect="false"
|
|
||||||
:can-clear="false"
|
|
||||||
:placeholder="$t('items.select_a_unit')"
|
:placeholder="$t('items.select_a_unit')"
|
||||||
searchable
|
searchable
|
||||||
track-by="name"
|
track-by="name"
|
||||||
|
|||||||
@ -1485,7 +1485,7 @@
|
|||||||
"pdf_estimate_label": "Estimate",
|
"pdf_estimate_label": "Estimate",
|
||||||
"pdf_estimate_number": "Estimate Number",
|
"pdf_estimate_number": "Estimate Number",
|
||||||
"pdf_estimate_date": "Estimate Date",
|
"pdf_estimate_date": "Estimate Date",
|
||||||
"pdf_estimate_expire_date": "Expiry date",
|
"pdf_estimate_expire_date": "Expiry Date",
|
||||||
"pdf_invoice_label": "Invoice",
|
"pdf_invoice_label": "Invoice",
|
||||||
"pdf_invoice_number": "Invoice Number",
|
"pdf_invoice_number": "Invoice Number",
|
||||||
"pdf_invoice_date": "Invoice Date",
|
"pdf_invoice_date": "Invoice Date",
|
||||||
|
|||||||
Reference in New Issue
Block a user