From 5133ae127cd89fcd6773a145af6f497537da4f3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Mon, 4 Jan 2021 01:12:14 +0300 Subject: [PATCH] item autocomplete and total method added withholding tax feature --- app/Http/Controllers/Common/Items.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/Http/Controllers/Common/Items.php b/app/Http/Controllers/Common/Items.php index 5cb304a93..d44a7863e 100644 --- a/app/Http/Controllers/Common/Items.php +++ b/app/Http/Controllers/Common/Items.php @@ -277,6 +277,11 @@ class Items extends Controller case 'fixed': $item_tax_price += $tax->rate; break; + case 'withholding': + $item_tax_amount = 0 - $item_price * ($tax->rate / 100); + + $item_tax_price += $item_tax_amount; + break; default: $item_tax_amount = ($item_price / 100) * $tax->rate; @@ -369,6 +374,11 @@ class Items extends Controller case 'fixed': $item_tax_total += $tax->rate * $quantity; break; + case 'withholding': + $item_tax_amount = 0 - $item_discounted_total * ($tax->rate / 100); + + $item_tax_total += $item_tax_amount; + break; default: $item_tax_amount = ($item_discounted_total / 100) * $tax->rate;