Completed
Branch feature-dynamic-fields (cdebc1)
by Ashutosh
10:20
created
app/Http/Controllers/Order/InvoiceController.php 1 patch
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -475,7 +475,8 @@  discard block
 block discarded – undo
475 475
             if ($this->tax_option->findOrFail(1)->inclusive == 0) {
476 476
                 if ($this->tax_option->findOrFail(1)->tax_enable == 1) {
477 477
                     $taxs = $this->getTaxWhenEnable($productid, $taxs[0], $userid);
478
-                } elseif ($this->tax_option->tax_enable == 0) {//if tax_enable is 0
478
+                } elseif ($this->tax_option->tax_enable == 0) {
479
+//if tax_enable is 0
479 480
 
480 481
                     $taxClassId = Tax::where('country', '')->where('state', 'Any State')
481 482
                      ->pluck('tax_classes_id')->first(); //In case of India when
@@ -484,13 +485,15 @@  discard block
 block discarded – undo
484 485
                         $rate = $this->getTotalRate($taxClassId, $productid, $taxs);
485 486
                         $taxs = $rate['taxes'];
486 487
                         $rate = $rate['rate'];
487
-                    } elseif ($geoip_country != 'IN') {//In case of other country
488
+                    } elseif ($geoip_country != 'IN') {
489
+//In case of other country
488 490
                         // when tax is available and tax is not enabled(Applicable
489 491
                         //when Global Tax class for any country and state is not there)
490 492
 
491 493
                         $taxClassId = Tax::where('state', $geoip_state)
492 494
                         ->orWhere('country', $geoip_country)->pluck('tax_classes_id')->first();
493
-                        if ($taxClassId) { //if state equals the user State
495
+                        if ($taxClassId) {
496
+//if state equals the user State
494 497
                             $rate = $this->getTotalRate($taxClassId, $productid, $taxs);
495 498
                             $taxs = $rate['taxes'];
496 499
                             $rate = $rate['rate'];
@@ -533,11 +536,13 @@  discard block
 block discarded – undo
533 536
         $i_gst = 0;
534 537
         $ut_gst = 0;
535 538
         $state_code = '';
536
-        if ($user_state != '') {//Get the CGST,SGST,IGST,STATE_CODE of the user
539
+        if ($user_state != '') {
540
+//Get the CGST,SGST,IGST,STATE_CODE of the user
537 541
             $tax = $this->getTaxWhenState($user_state, $productid, $origin_state);
538 542
             $taxes = $tax['taxes'];
539 543
             $value = $tax['value'];
540
-        } else {//If user from other Country
544
+        } else {
545
+//If user from other Country
541 546
             $tax = $this->getTaxWhenOtherCountry($geoip_state, $geoip_country, $productid);
542 547
             $taxes = $tax['taxes'];
543 548
             $value = $tax['value'];
Please login to merge, or discard this patch.
app/Traits/CoupCodeAndInvoiceSearch.php 1 patch
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -406,10 +406,12 @@  discard block
 block discarded – undo
406 406
 
407 407
     public function getAgents($agents, $productid, $plan)
408 408
     {
409
-        if (!$agents) {//If agents is not received in the request in the case when
409
+        if (!$agents) {
410
+//If agents is not received in the request in the case when
410 411
             // 'modify agent' is not allowed for the Product,get the no of Agents from the Plan Table.
411 412
             $planForAgent = Product::find($productid)->planRelation->find($plan);
412
-            if ($planForAgent) {//If Plan Exists For the Product ie not a Product without Plan
413
+            if ($planForAgent) {
414
+//If Plan Exists For the Product ie not a Product without Plan
413 415
                 $noOfAgents = $planForAgent->planPrice->first()->no_of_agents;
414 416
                 $agents = $noOfAgents ? $noOfAgents : 0; //If no. of Agents is specified then that,else 0(Unlimited Agents)
415 417
             } else {
@@ -422,7 +424,8 @@  discard block
 block discarded – undo
422 424
 
423 425
     public function getQuantity($qty, $productid, $plan)
424 426
     {
425
-        if (!$qty) {//If quantity is not received in the request in the case when 'modify quantity' is not allowed for the Product,get the Product qUANTITY from the Plan Table.
427
+        if (!$qty) {
428
+//If quantity is not received in the request in the case when 'modify quantity' is not allowed for the Product,get the Product qUANTITY from the Plan Table.
426 429
             $planForQty = Product::find($productid)->planRelation->find($plan);
427 430
             if ($planForQty) {
428 431
                 $quantity = Product::find($productid)->planRelation->find($plan)->planPrice->first()->product_quantity;
Please login to merge, or discard this patch.