@@ -22,13 +22,13 @@ discard block |
||
| 22 | 22 | $ut_gst = $user_state->ut_gst; |
| 23 | 23 | $state_code = $user_state->state_code; |
| 24 | 24 | if ($state_code == $origin_state) {//If user and origin state are same |
| 25 | - $taxClassId = TaxClass::where('name', 'Intra State GST')->pluck('id')->toArray(); //Get the class Id of state |
|
| 26 | - if ($taxClassId) { |
|
| 27 | - $taxes = $cartController->getTaxByPriority($taxClassId); |
|
| 28 | - $value = $cartController->getValueForSameState($productid, $c_gst, $s_gst, $taxClassId, $taxes); |
|
| 29 | - } else { |
|
| 30 | - $taxes = [0]; |
|
| 31 | - } |
|
| 25 | + $taxClassId = TaxClass::where('name', 'Intra State GST')->pluck('id')->toArray(); //Get the class Id of state |
|
| 26 | + if ($taxClassId) { |
|
| 27 | + $taxes = $cartController->getTaxByPriority($taxClassId); |
|
| 28 | + $value = $cartController->getValueForSameState($productid, $c_gst, $s_gst, $taxClassId, $taxes); |
|
| 29 | + } else { |
|
| 30 | + $taxes = [0]; |
|
| 31 | + } |
|
| 32 | 32 | } elseif ($state_code != $origin_state && $ut_gst == 'NULL') {//If user is from other state |
| 33 | 33 | |
| 34 | 34 | $taxClassId = TaxClass::where('name', 'Inter State GST')->pluck('id')->toArray(); //Get the class Id of state |
@@ -40,12 +40,12 @@ discard block |
||
| 40 | 40 | } |
| 41 | 41 | } elseif ($state_code != $origin_state && $ut_gst != 'NULL') {//if user from Union Territory |
| 42 | 42 | $taxClassId = TaxClass::where('name', 'Union Territory GST')->pluck('id')->toArray(); //Get the class Id of state |
| 43 | - if ($taxClassId) { |
|
| 44 | - $taxes = $cartController->getTaxByPriority($taxClassId); |
|
| 45 | - $value = $cartController->getValueForUnionTerritory($productid, $c_gst, $ut_gst, $taxClassId, $taxes); |
|
| 46 | - } else { |
|
| 47 | - $taxes = [0]; |
|
| 48 | - } |
|
| 43 | + if ($taxClassId) { |
|
| 44 | + $taxes = $cartController->getTaxByPriority($taxClassId); |
|
| 45 | + $value = $cartController->getValueForUnionTerritory($productid, $c_gst, $ut_gst, $taxClassId, $taxes); |
|
| 46 | + } else { |
|
| 47 | + $taxes = [0]; |
|
| 48 | + } |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | return ['taxes'=>$taxes, 'value'=>$value]; |