Completed
Branch feature-dynamic-fields (9e5831)
by Ashutosh
13:15
created
app/Http/Controllers/RazorpayController.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,8 @@
 block discarded – undo
54 54
         $api = new Api($rzp_key, $rzp_secret);
55 55
         $payment = $api->payment->fetch($input['razorpay_payment_id']);
56 56
 
57
-        if (count($input) && !empty($input['razorpay_payment_id'])) { //Verify Razorpay Payment Id and Signature
57
+        if (count($input) && !empty($input['razorpay_payment_id'])) {
58
+//Verify Razorpay Payment Id and Signature
58 59
 
59 60
             //Fetch payment information by razorpay_payment_id
60 61
             try {
Please login to merge, or discard this patch.
app/Http/Controllers/Product/BaseProductController.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -121,7 +121,8 @@
 block discarded – undo
121 121
 
122 122
     public function getRelease($owner, $repository, $order_id, $file)
123 123
     {
124
-        if ($owner && $repository) {//If the Product is downloaded from Github
124
+        if ($owner && $repository) {
125
+//If the Product is downloaded from Github
125 126
             $github_controller = new \App\Http\Controllers\Github\GithubController();
126 127
             $relese = $github_controller->listRepositories($owner, $repository, $order_id);
127 128
 
Please login to merge, or discard this patch.
app/Http/Controllers/Order/BaseInvoiceController.php 1 patch
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -86,7 +86,8 @@  discard block
 block discarded – undo
86 86
         $i_gst = $user_state->i_gst;
87 87
         $ut_gst = $user_state->ut_gst;
88 88
         $state_code = $user_state->state_code;
89
-        if ($state_code == $origin_state) {//If user and origin state are same
89
+        if ($state_code == $origin_state) {
90
+//If user and origin state are same
90 91
             $taxClassId = TaxClass::where('name', 'Intra State GST')
91 92
              ->pluck('id')->toArray(); //Get the class Id  of state
92 93
             if ($taxClassId) {
@@ -95,7 +96,8 @@  discard block
 block discarded – undo
95 96
             } else {
96 97
                 $taxes = [0];
97 98
             }
98
-        } elseif ($state_code != $origin_state && $ut_gst == 'NULL') {//If user is from other state
99
+        } elseif ($state_code != $origin_state && $ut_gst == 'NULL') {
100
+//If user is from other state
99 101
 
100 102
             $taxClassId = TaxClass::where('name', 'Inter State GST')
101 103
             ->pluck('id')->toArray(); //Get the class Id  of state
@@ -105,7 +107,8 @@  discard block
 block discarded – undo
105 107
             } else {
106 108
                 $taxes = [0];
107 109
             }
108
-        } elseif ($state_code != $origin_state && $ut_gst != 'NULL') {//if user from Union Territory
110
+        } elseif ($state_code != $origin_state && $ut_gst != 'NULL') {
111
+//if user from Union Territory
109 112
             $taxClassId = TaxClass::where('name', 'Union Territory GST')
110 113
         ->pluck('id')->toArray(); //Get the class Id  of state
111 114
             if ($taxClassId) {
@@ -130,14 +133,16 @@  discard block
 block discarded – undo
130 133
         ->pluck('tax_classes_id')->first();
131 134
         $value = '';
132 135
         $rate = '';
133
-        if ($taxClassId) { //if state equals the user State
136
+        if ($taxClassId) {
137
+//if state equals the user State
134 138
 
135 139
             $taxes = $cartController->getTaxByPriority($taxClassId);
136 140
 
137 141
             // $taxes = $this->cartController::getTaxByPriority($taxClassId);
138 142
             $value = $cartController->getValueForOthers($productid, $taxClassId, $taxes);
139 143
             $rate = $value;
140
-        } else {//if Tax is selected for Any State Any Country
144
+        } else {
145
+//if Tax is selected for Any State Any Country
141 146
             $taxClassId = Tax::where('country', '')->where('state', 'Any State')->pluck('tax_classes_id')->first();
142 147
             if ($taxClassId) {
143 148
                 $taxes = $cartController->getTaxByPriority($taxClassId);
Please login to merge, or discard this patch.
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/Http/Controllers/Order/ExtendedBaseInvoiceController.php 1 patch
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -133,7 +133,8 @@  discard block
 block discarded – undo
133 133
     {
134 134
         try {
135 135
             foreach ($invoiceChecked as $key => $value) {
136
-                if ($key != 0) {//If Payment is linked to Invoice
136
+                if ($key != 0) {
137
+//If Payment is linked to Invoice
137 138
                     $invoice = Invoice::find($value);
138 139
                     $invoice_status = 'pending';
139 140
                     $payment = Payment::where('invoice_id', $value)->create([
@@ -157,7 +158,8 @@  discard block
 block discarded – undo
157 158
                         $invoice->status = $invoice_status;
158 159
                         $invoice->save();
159 160
                     }
160
-                } elseif (count($invoiceChecked) == 1 || $amtToCredit > 0) {//If Payment is not linked to any invoice and is to be credited to User Accunt
161
+                } elseif (count($invoiceChecked) == 1 || $amtToCredit > 0) {
162
+//If Payment is not linked to any invoice and is to be credited to User Accunt
161 163
                     $payment = Payment::create([
162 164
                 'invoice_id'     => $value,
163 165
                 'user_id'        => $clientid,
@@ -224,7 +226,8 @@  discard block
 block discarded – undo
224 226
         try {
225 227
             $sum = 0;
226 228
             foreach ($invoiceChecked as $key => $value) {
227
-                if ($key != 0) {//If Payment is linked to Invoice
229
+                if ($key != 0) {
230
+//If Payment is linked to Invoice
228 231
                     $invoice = Invoice::find($value);
229 232
                     Payment::where('user_id', $clientid)->where('invoice_id', 0)->update(['amt_to_credit'=>$amtToCredit]);
230 233
                     $invoice_status = 'pending';
Please login to merge, or discard this patch.
app/Traits/TaxCalculation.php 1 patch
Braces   +16 added lines, -8 removed lines patch added patch discarded remove patch
@@ -8,24 +8,28 @@  discard block
 block discarded – undo
8 8
 {
9 9
     public function getDetailsWhenUserStateIsIndian($user_state, $origin_state, $productid, $geoip_state, $geoip_country, $status = 1)
10 10
     {
11
-        if ($user_state != '') {//Get the CGST,SGST,IGST,STATE_CODE of the user,if user from INdia
11
+        if ($user_state != '') {
12
+//Get the CGST,SGST,IGST,STATE_CODE of the user,if user from INdia
12 13
             $c_gst = $user_state->c_gst;
13 14
             $s_gst = $user_state->s_gst;
14 15
             $i_gst = $user_state->i_gst;
15 16
             $ut_gst = $user_state->ut_gst;
16 17
             $state_code = $user_state->state_code;
17 18
 
18
-            if ($state_code == $origin_state) {//If user and origin state are same
19
+            if ($state_code == $origin_state) {
20
+//If user and origin state are same
19 21
                 $rateForSameState = $this->getTaxWhenIndianSameState($user_state, $origin_state, $productid, $c_gst, $s_gst, $state_code, $status);
20 22
                 $taxes = $rateForSameState['taxes'];
21 23
                 $status = $rateForSameState['status'];
22 24
                 $value = $rateForSameState['value'];
23
-            } elseif ($state_code != $origin_state && $ut_gst == 'NULL') {//If user is from other state
25
+            } elseif ($state_code != $origin_state && $ut_gst == 'NULL') {
26
+//If user is from other state
24 27
                 $rateForOtherState = $this->getTaxWhenIndianOtherState($user_state, $origin_state, $productid, $i_gst, $state_code, $status);
25 28
                 $taxes = $rateForOtherState['taxes'];
26 29
                 $status = $rateForOtherState['status'];
27 30
                 $value = $rateForOtherState['value'];
28
-            } elseif ($state_code != $origin_state && $ut_gst != 'NULL') {//if user from Union Territory
31
+            } elseif ($state_code != $origin_state && $ut_gst != 'NULL') {
32
+//if user from Union Territory
29 33
                 $rateForUnionTerritory = $this->getTaxWhenUnionTerritory($user_state, $origin_state, $productid, $c_gst, $ut_gst, $state_code, $status);
30 34
                 $taxes = $rateForUnionTerritory['taxes'];
31 35
                 $status = $rateForUnionTerritory['status'];
@@ -46,13 +50,15 @@  discard block
 block discarded – undo
46 50
         $taxClassId = Tax::where('state', $geoip_state)
47 51
                 ->orWhere('country', $geoip_country)
48 52
                 ->pluck('tax_classes_id')->first();
49
-        if ($taxClassId) { //if state equals the user State or country equals user country
53
+        if ($taxClassId) {
54
+//if state equals the user State or country equals user country
50 55
             $taxForSpecificCountry = $this->getTaxForSpecificCountry($taxClassId, $productid, $status);
51 56
             $taxes = $taxForSpecificCountry['taxes'];
52 57
             $status = $taxForSpecificCountry['status'];
53 58
             $value = $taxForSpecificCountry['value'];
54 59
             $rate = $taxForSpecificCountry['value'];
55
-        } else {//if Tax is selected for Any Country Any State
60
+        } else {
61
+//if Tax is selected for Any Country Any State
56 62
             $taxClassId = Tax::where('country', '')
57 63
                     ->where('state', 'Any State')
58 64
                     ->pluck('tax_classes_id')->first();
@@ -86,13 +92,15 @@  discard block
 block discarded – undo
86 92
                 $status = 0;
87 93
             }
88 94
             $rate = $value;
89
-        } else {//In case of other country
95
+        } else {
96
+//In case of other country
90 97
             //when tax is available and tax is not enabled
91 98
             //(Applicable when Global Tax class for any country and state is not there)
92 99
             $taxClassId = Tax::where('state', $geoip_state)
93 100
             ->orWhere('country', $geoip_country)
94 101
             ->pluck('tax_classes_id')->first();
95
-            if ($taxClassId) { //if state equals the user State
102
+            if ($taxClassId) {
103
+//if state equals the user State
96 104
                 $taxes = $this->getTaxByPriority($taxClassId);
97 105
                 $value = $this->getValueForOthers($productid, $taxClassId, $taxes);
98 106
                 if ($value == '') {
Please login to merge, or discard this patch.
app/Http/Controllers/Common/BaseTemplateController.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,8 @@
 block discarded – undo
25 25
             $currencyAndSymbol = $cart_controller->currency();
26 26
             $currency = $currencyAndSymbol['currency'];
27 27
             $symbol = $currencyAndSymbol['symbol'];
28
-            if ($symbol == '') {  //If user has no currency symbol(In case of old customers)
28
+            if ($symbol == '') {
29
+//If user has no currency symbol(In case of old customers)
29 30
                 $symbol = Currency::where('code', $currency)->pluck('symbol')->first();
30 31
                 $symbol = \Auth::user()->update(['currency_symbol'=> $symbol]);
31 32
             }
Please login to merge, or discard this patch.
app/Http/Controllers/Common/SettingsController.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -96,7 +96,8 @@
 block discarded – undo
96 96
                     $pluginName[] = $plugin->name; //get the name of active plugin
97 97
                 }
98 98
 
99
-                if (count($models) > 0) {//If more than 1 plugin is active it will check the currencies allowed for that plugin.If the currencies allowed matches the passed arguement(currency),that plugin name is returned
99
+                if (count($models) > 0) {
100
+//If more than 1 plugin is active it will check the currencies allowed for that plugin.If the currencies allowed matches the passed arguement(currency),that plugin name is returned
100 101
                     for ($i = 0; $i < count($pluginName); $i++) {
101 102
                         $currencies = explode(',', $models[$i]->currencies);
102 103
                         if (in_array($currency, $currencies)) {
Please login to merge, or discard this patch.
app/Http/Controllers/Product/ExtendedBaseProductController.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,8 @@
 block discarded – undo
58 58
         $file_upload->description = $request->input('description');
59 59
         $file_upload->version = $request->input('version');
60 60
         $autoUpdateStatus = StatusSetting::pluck('update_settings')->first();
61
-        if ($autoUpdateStatus == 1) { //If License Setting Status is on,Add Product to the License Manager
61
+        if ($autoUpdateStatus == 1) {
62
+//If License Setting Status is on,Add Product to the License Manager
62 63
             $productSku = $file_upload->product->product_sku;
63 64
             $updateClassObj = new \App\Http\Controllers\AutoUpdate\AutoUpdateController();
64 65
             $addProductToAutoUpdate = $updateClassObj->editVersion($request->input('version'), $productSku);
Please login to merge, or discard this patch.