diff --git a/resources/scripts/admin/components/estimate-invoice-common/CreateItemRow.vue b/resources/scripts/admin/components/estimate-invoice-common/CreateItemRow.vue
index 41f9e879..f9c4d447 100644
--- a/resources/scripts/admin/components/estimate-invoice-common/CreateItemRow.vue
+++ b/resources/scripts/admin/components/estimate-invoice-common/CreateItemRow.vue
@@ -17,18 +17,7 @@
@@ -108,7 +97,7 @@
@@ -155,7 +144,7 @@
@@ -175,6 +164,7 @@
:ability="abilities.CREATE_INVOICE"
:store="store"
:store-prop="storeProp"
+ :discount="discount"
@update="updateTax"
/>
|
@@ -488,6 +478,7 @@ function syncItemToStore() {
if (!itemTaxes) {
itemTaxes = []
}
+ console.log('syncItemToStore', itemTaxes)
let data = {
...props.store[props.storeProp].items[props.index],
diff --git a/resources/scripts/admin/components/estimate-invoice-common/CreateItemRowTax.vue b/resources/scripts/admin/components/estimate-invoice-common/CreateItemRowTax.vue
index 087fed64..cf3b1294 100644
--- a/resources/scripts/admin/components/estimate-invoice-common/CreateItemRowTax.vue
+++ b/resources/scripts/admin/components/estimate-invoice-common/CreateItemRowTax.vue
@@ -30,24 +30,13 @@
@@ -115,6 +104,10 @@ const props = defineProps({
type: Number,
default: 0,
},
+ discountedTotal: {
+ type: Number,
+ default: 0,
+ },
currency: {
type: [Object, String],
required: true,
@@ -153,19 +146,19 @@ const filteredTypes = computed(() => {
})
const taxAmount = computed(() => {
- if (localTax.compound_tax && props.total) {
- return ((props.total + props.totalTax) * localTax.percent) / 100
+ if (localTax.compound_tax && props.discountedTotal) {
+ return ((props.discountedTotal + props.totalTax) * localTax.percent) / 100
}
- if (props.total && localTax.percent) {
- return (props.total * localTax.percent) / 100
+ if (props.discountedTotal && localTax.percent) {
+ return (props.discountedTotal * localTax.percent) / 100
}
return 0
})
watch(
- () => props.total,
+ () => props.discountedTotal,
() => {
updateRowTax()
}
diff --git a/resources/scripts/admin/components/estimate-invoice-common/CreateTotal.vue b/resources/scripts/admin/components/estimate-invoice-common/CreateTotal.vue
index 51578b63..6f29ecea 100644
--- a/resources/scripts/admin/components/estimate-invoice-common/CreateTotal.vue
+++ b/resources/scripts/admin/components/estimate-invoice-common/CreateTotal.vue
@@ -29,14 +29,7 @@
@@ -98,7 +84,7 @@
@@ -114,7 +100,7 @@
@@ -127,7 +113,7 @@
@@ -180,15 +166,7 @@
@@ -204,14 +182,7 @@
@@ -292,6 +263,7 @@ const itemWiseTaxes = computed(() => {
if (found) {
found.amount += tax.amount
} else if (tax.tax_type_id) {
+ console.log(tax, 'getting the tax here')
taxes.push({
tax_type_id: tax.tax_type_id,
amount: tax.amount,
@@ -334,6 +306,7 @@ function selectPercentage() {
function onSelectTax(selectedTax) {
let amount = 0
+
if (selectedTax.compound_tax && props.store.getSubtotalWithDiscount) {
amount = Math.round(
((props.store.getSubtotalWithDiscount + props.store.getTotalSimpleTax) *