diff --git a/app/Http/Controllers/Common/Items.php b/app/Http/Controllers/Common/Items.php index 3c3db8559..6e7f8a4e3 100644 --- a/app/Http/Controllers/Common/Items.php +++ b/app/Http/Controllers/Common/Items.php @@ -372,7 +372,7 @@ class Items extends Controller foreach ($inclusives as $inclusive) { $item_sub_and_tax_total = $item_sub_total + $item_tax_total; - $item_tax_total = $item_sub_and_tax_total - (($item_sub_and_tax_total * (100 - $inclusive->rate)) / 100); + $item_tax_total = $item_sub_and_tax_total - ($item_sub_and_tax_total / (1 + ($inclusive->rate / 100))); $item_sub_total = $item_sub_and_tax_total - $item_tax_total; @@ -382,7 +382,7 @@ class Items extends Controller foreach ($inclusives as $inclusive) { $item_sub_and_tax_total = $item_discount_total + $item_tax_total; - $item_tax_total = $item_sub_and_tax_total - (($item_sub_and_tax_total * (100 - $inclusive->rate)) / 100); + $item_tax_total = $item_sub_and_tax_total - ($item_sub_and_tax_total / (1 + ($inclusive->rate / 100))); $item_sub_total = $item_sub_and_tax_total - $item_tax_total; diff --git a/app/Jobs/Expense/CreateBillItem.php b/app/Jobs/Expense/CreateBillItem.php index 1826fa2cc..cc83823b3 100644 --- a/app/Jobs/Expense/CreateBillItem.php +++ b/app/Jobs/Expense/CreateBillItem.php @@ -117,7 +117,7 @@ class CreateBillItem foreach ($inclusives as $inclusive) { $item_sub_and_tax_total = $item_amount + $item_tax_total; - $item_tax_total = $item_sub_and_tax_total - (($item_sub_and_tax_total * (100 - $inclusive->rate)) / 100); + $item_tax_total = $item_sub_and_tax_total - ($item_sub_and_tax_total / (1 + ($inclusive->rate / 100))); $item_sub_total = $item_sub_and_tax_total - $item_tax_total; diff --git a/app/Jobs/Income/CreateInvoiceItem.php b/app/Jobs/Income/CreateInvoiceItem.php index 6e6575dff..3478baff1 100644 --- a/app/Jobs/Income/CreateInvoiceItem.php +++ b/app/Jobs/Income/CreateInvoiceItem.php @@ -144,7 +144,7 @@ class CreateInvoiceItem foreach ($inclusives as $inclusive) { $item_sub_and_tax_total = $item_amount + $item_tax_total; - $item_tax_total = $item_sub_and_tax_total - (($item_sub_and_tax_total * (100 - $inclusive->rate)) / 100); + $item_tax_total = $item_sub_and_tax_total - ($item_sub_and_tax_total / (1 + ($inclusive->rate / 100))); $item_sub_total = $item_sub_and_tax_total - $item_tax_total;