Completed
Branch feature-dynamic-fields (a5624d)
by Ashutosh
09:27
created
app/Http/Controllers/Order/BaseOrderController.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -271,7 +271,7 @@
 block discarded – undo
271 271
         $data = $template->data;
272 272
         $replace = [
273 273
             'name'         => $user->first_name.' '.$user->last_name,
274
-             'serialkeyurl'=> $myaccounturl,
274
+                'serialkeyurl'=> $myaccounturl,
275 275
             'downloadurl'  => $downloadurl,
276 276
             'invoiceurl'   => $invoiceurl,
277 277
             'product'      => $product,
Please login to merge, or discard this patch.
app/Http/Controllers/Order/InvoiceController.php 1 patch
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -129,12 +129,12 @@  discard block
 block discarded – undo
129 129
         $query = $this->advanceSearch($name, $invoice_no, $currency, $status, $from, $till);
130 130
 
131 131
         return \DataTables::of($query->take(100))
132
-         ->setTotalRecords($query->count())
132
+            ->setTotalRecords($query->count())
133 133
 
134
-         ->addColumn('checkbox', function ($model) {
135
-             return "<input type='checkbox' class='invoice_checkbox' 
134
+            ->addColumn('checkbox', function ($model) {
135
+                return "<input type='checkbox' class='invoice_checkbox' 
136 136
                             value=".$model->id.' name=select[] id=check>';
137
-         })
137
+            })
138 138
                         ->addColumn('user_id', function ($model) {
139 139
                             $first = $this->user->where('id', $model->user_id)->first()->first_name;
140 140
                             $last = $this->user->where('id', $model->user_id)->first()->last_name;
@@ -142,9 +142,9 @@  discard block
 block discarded – undo
142 142
 
143 143
                             return '<a href='.url('clients/'.$id).'>'.ucfirst($first).' '.ucfirst($last).'</a>';
144 144
                         })
145
-                         ->addColumn('number', function ($model) {
146
-                             return ucfirst($model->number);
147
-                         })
145
+                            ->addColumn('number', function ($model) {
146
+                                return ucfirst($model->number);
147
+                            })
148 148
 
149 149
                         ->addColumn('date', function ($model) {
150 150
                             $date = ($model->created_at);
@@ -152,12 +152,12 @@  discard block
 block discarded – undo
152 152
                             return $date;
153 153
                             // return "<span style='display:none'>$model->id</span>".$date->format('l, F j, Y H:m');
154 154
                         })
155
-                         ->addColumn('grand_total', function ($model) {
156
-                             return ucfirst($model->number);
157
-                         })
158
-                          ->addColumn('status', function ($model) {
159
-                              return ucfirst($model->status);
160
-                          })
155
+                            ->addColumn('grand_total', function ($model) {
156
+                                return ucfirst($model->number);
157
+                            })
158
+                            ->addColumn('status', function ($model) {
159
+                                return ucfirst($model->status);
160
+                            })
161 161
 
162 162
                         ->addColumn('action', function ($model) {
163 163
                             $action = '';
@@ -175,30 +175,30 @@  discard block
 block discarded – undo
175 175
                             style='color:white;'> </i>&nbsp;&nbsp;View</a>"
176 176
                                     ."   $action";
177 177
                         })
178
-                         ->filterColumn('user_id', function ($query, $keyword) {
179
-                             $sql = 'first_name like ?';
180
-                             $query->whereRaw($sql, ["%{$keyword}%"]);
181
-                         })
178
+                            ->filterColumn('user_id', function ($query, $keyword) {
179
+                                $sql = 'first_name like ?';
180
+                                $query->whereRaw($sql, ["%{$keyword}%"]);
181
+                            })
182 182
 
183
-                          ->filterColumn('status', function ($query, $keyword) {
184
-                              $sql = 'status like ?';
185
-                              $query->whereRaw($sql, ["%{$keyword}%"]);
186
-                          })
183
+                            ->filterColumn('status', function ($query, $keyword) {
184
+                                $sql = 'status like ?';
185
+                                $query->whereRaw($sql, ["%{$keyword}%"]);
186
+                            })
187 187
 
188 188
                         ->filterColumn('number', function ($query, $keyword) {
189 189
                             $sql = 'number like ?';
190 190
                             $query->whereRaw($sql, ["%{$keyword}%"]);
191 191
                         })
192
-                         ->filterColumn('grand_total', function ($query, $keyword) {
193
-                             $sql = 'grand_total like ?';
194
-                             $query->whereRaw($sql, ["%{$keyword}%"]);
195
-                         })
196
-                          ->filterColumn('date', function ($query, $keyword) {
197
-                              $sql = 'date like ?';
198
-                              $query->whereRaw($sql, ["%{$keyword}%"]);
199
-                          })
200
-
201
-                         ->rawColumns(['checkbox', 'user_id', 'number', 'date', 'grand_total', 'status', 'action'])
192
+                            ->filterColumn('grand_total', function ($query, $keyword) {
193
+                                $sql = 'grand_total like ?';
194
+                                $query->whereRaw($sql, ["%{$keyword}%"]);
195
+                            })
196
+                            ->filterColumn('date', function ($query, $keyword) {
197
+                                $sql = 'date like ?';
198
+                                $query->whereRaw($sql, ["%{$keyword}%"]);
199
+                            })
200
+
201
+                            ->rawColumns(['checkbox', 'user_id', 'number', 'date', 'grand_total', 'status', 'action'])
202 202
                         ->make(true);
203 203
     }
204 204
 
@@ -290,8 +290,8 @@  discard block
 block discarded – undo
290 290
             }
291 291
             $symbol = $attributes[0]['currency']['symbol'];
292 292
             $invoice = $this->invoice->create(['user_id' => $user_id, 'number' => $number,
293
-             'date'                                      => $date, 'grand_total' => $grand_total, 'status' => 'pending',
294
-             'currency'                                  => $symbol, ]);
293
+                'date'                                      => $date, 'grand_total' => $grand_total, 'status' => 'pending',
294
+                'currency'                                  => $symbol, ]);
295 295
             foreach (\Cart::getContent() as $cart) {
296 296
                 $this->createInvoiceItems($invoice->id, $cart);
297 297
             }
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
                 'currency'                        => $currency, 'status' => 'pending', 'description' => $description, ]);
405 405
 
406 406
             $items = $this->createInvoiceItemsByAdmin($invoice->id, $productid,
407
-             $code, $total, $currency, $qty, $agents, $plan, $user_id, $tax_name, $tax_rate);
407
+                $code, $total, $currency, $qty, $agents, $plan, $user_id, $tax_name, $tax_rate);
408 408
             $result = $this->getMessage($items, $user_id);
409 409
         } catch (\Exception $ex) {
410 410
             app('log')->info($ex->getMessage());
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
                 } elseif ($this->tax_option->tax_enable == 0) {//if tax_enable is 0
482 482
 
483 483
                     $taxClassId = Tax::where('country', '')->where('state', 'Any State')
484
-                     ->pluck('tax_classes_id')->first(); //In case of India when
484
+                        ->pluck('tax_classes_id')->first(); //In case of India when
485 485
                     //other tax is available and tax is not enabled
486 486
                     if ($taxClassId) {
487 487
                         $rate = $this->getTotalRate($taxClassId, $productid, $taxs);
@@ -549,10 +549,10 @@  discard block
 block discarded – undo
549 549
         foreach ($taxes as $key => $tax) {
550 550
             if ($taxes[0]) {
551 551
                 $tax_attribute[$key] = ['name' => $tax->name, 'name1' => $name1,
552
-                 'name2'                       => $name2, 'name3' => $name3, 'name4' => $name4,
553
-                 'rate'                        => $value, 'rate1'=>$c_gst, 'rate2'=>$s_gst,
554
-                 'rate3'                       => $i_gst, 'rate4'=>$ut_gst, 'state'=>$state_code,
555
-                  'origin_state'               => $origin_state, ];
552
+                    'name2'                       => $name2, 'name3' => $name3, 'name4' => $name4,
553
+                    'rate'                        => $value, 'rate1'=>$c_gst, 'rate2'=>$s_gst,
554
+                    'rate3'                       => $i_gst, 'rate4'=>$ut_gst, 'state'=>$state_code,
555
+                    'origin_state'               => $origin_state, ];
556 556
 
557 557
                 $rate = $tax->rate;
558 558
 
Please login to merge, or discard this patch.
app/Traits/PaymentsAndInvoices.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
                 $paymentRenewal = $this->updateInvoicePayment(
158 158
                 $invoiceid,
159 159
                 $payment_method,
160
-             $payment_status,
160
+                $payment_status,
161 161
                 $payment_date,
162 162
                 $amount
163 163
             );
@@ -215,15 +215,15 @@  discard block
 block discarded – undo
215 215
 
216 216
                     return view(
217 217
                     'themes.default1.invoice.payment',
218
-                 compact(
219
-                     'invoice_status',
220
-                     'payment_status',
221
-                  'payment_method',
222
-                     'invoice_id',
223
-                     'domain',
224
-                     'invoice',
225
-                     'userid'
226
-                 )
218
+                    compact(
219
+                        'invoice_status',
220
+                        'payment_status',
221
+                    'payment_method',
222
+                        'invoice_id',
223
+                        'domain',
224
+                        'invoice',
225
+                        'userid'
226
+                    )
227 227
                 );
228 228
                 }
229 229
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -90,10 +90,12 @@  discard block
 block discarded – undo
90 90
 
91 91
         public function getAgents($agents, $productid, $plan)
92 92
         {
93
-            if (!$agents) {//If agents is not received in the request in the case when
93
+            if (!$agents) {
94
+//If agents is not received in the request in the case when
94 95
                 // 'modify agent' is not allowed for the Product,get the no of Agents from the Plan Table.
95 96
                 $planForAgent = Product::find($productid)->planRelation->find($plan);
96
-                if ($planForAgent) {//If Plan Exists For the Product ie not a Product without Plan
97
+                if ($planForAgent) {
98
+//If Plan Exists For the Product ie not a Product without Plan
97 99
                     $noOfAgents = $planForAgent->planPrice->first()->no_of_agents;
98 100
                     $agents = $noOfAgents ? $noOfAgents : 0; //If no. of Agents is specified then that,else 0(Unlimited Agents)
99 101
                 } else {
@@ -106,7 +108,8 @@  discard block
 block discarded – undo
106 108
 
107 109
         public function getQuantity($qty, $productid, $plan)
108 110
         {
109
-            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.
111
+            if (!$qty) {
112
+//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.
110 113
                 $planForQty = Product::find($productid)->planRelation->find($plan);
111 114
                 if ($planForQty) {
112 115
                     $quantity = Product::find($productid)->planRelation->find($plan)->planPrice->first()->product_quantity;
Please login to merge, or discard this patch.