Completed
Branch feature-dynamic-fields (3b03cc)
by Ashutosh
09:05
created
app/Http/Controllers/Common/ChatScriptController.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,9 +36,9 @@
 block discarded – undo
36 36
                             value=".$model->id.' name=select[] id=check>';
37 37
                         })
38 38
 
39
-                         ->addColumn('name', function ($model) {
40
-                             return $model->name;
41
-                         })
39
+                            ->addColumn('name', function ($model) {
40
+                                return $model->name;
41
+                            })
42 42
 
43 43
                         ->addColumn('action', function ($model) {
44 44
                             return '<a href='.url('chat/'.$model->id.'/edit').
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -32,21 +32,21 @@
 block discarded – undo
32 32
     {
33 33
         try {
34 34
             return \DataTables::of($this->script->get())
35
-                        ->addColumn('checkbox', function ($model) {
35
+                        ->addColumn('checkbox', function($model) {
36 36
                             return "<input type='checkbox' class='chat_checkbox' 
37 37
                             value=".$model->id.' name=select[] id=check>';
38 38
                         })
39 39
 
40
-                         ->addColumn('name', function ($model) {
40
+                         ->addColumn('name', function($model) {
41 41
                              return $model->name;
42 42
                          })
43 43
 
44
-                        ->addColumn('action', function ($model) {
44
+                        ->addColumn('action', function($model) {
45 45
                             return '<a href='.url('chat/'.$model->id.'/edit').
46 46
                             " class='btn btn-sm btn-primary btn-xs'><i class='fa fa-edit'
47 47
                                  style='color:white;'> </i>&nbsp;&nbsp;Edit</a>";
48 48
                         })
49
-                        ->rawColumns(['checkbox', 'name',  'action'])
49
+                        ->rawColumns(['checkbox', 'name', 'action'])
50 50
                         ->make(true);
51 51
         } catch (\Exception $ex) {
52 52
             return redirect()->back()->with('fails', $ex->getMessage());
Please login to merge, or discard this patch.
app/Http/Controllers/Order/ExtendedBaseInvoiceController.php 3 patches
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.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
             $orders = $order->where('client', $clientid)->get();
38 38
 
39 39
             return view('themes.default1.invoice.newpayment', compact('clientid', 'client', 'invoices',  'orders',
40
-                  'invoiceSum', 'amountReceived', 'pendingAmount', 'currency', 'symbol'));
40
+                    'invoiceSum', 'amountReceived', 'pendingAmount', 'currency', 'symbol'));
41 41
         } catch (Exception $ex) {
42 42
             return redirect()->back()->with('fails', $ex->getMessage());
43 43
         }
@@ -46,9 +46,9 @@  discard block
 block discarded – undo
46 46
     public function postNewPayment($clientid, Request $request)
47 47
     {
48 48
         $this->validate($request, [
49
-           'payment_date'  => 'required',
50
-           'payment_method'=> 'required',
51
-           'amount'        => 'required',
49
+            'payment_date'  => 'required',
50
+            'payment_method'=> 'required',
51
+            'amount'        => 'required',
52 52
         ]);
53 53
 
54 54
         try {
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
             $amtToCredit = $request->amtToCredit;
114 114
             $payment_status = 'success';
115 115
             $payment = $this->multiplePayment($clientid,$invoiceChecked, $payment_method,
116
-             $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status);
116
+                $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status);
117 117
             $response = ['type' => 'success', 'message' => 'Payment Updated Successfully'];
118 118
 
119 119
             return response()->json($response);
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
     }
131 131
 
132 132
     public function multiplePayment($clientid,$invoiceChecked, $payment_method,
133
-             $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status)
133
+                $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status)
134 134
     {
135 135
         try {
136 136
             foreach ($invoiceChecked as $key => $value) {
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
             $amtToCredit = $request->amtToCredit;
206 206
             $payment_status = 'success';
207 207
             $payment = $this->updatePaymentByInvoice($clientid,$invoiceChecked, $payment_method,
208
-             $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status);
208
+                $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status);
209 209
             $response = ['type' => 'success', 'message' => 'Payment Updated Successfully'];
210 210
 
211 211
             return response()->json($response);
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
     }
220 220
 
221 221
     public function updatePaymentByInvoice($clientid,$invoiceChecked, $payment_method,
222
-             $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status)
222
+                $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status)
223 223
     {
224 224
         try {
225 225
             $sum = 0;
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
             $symbol = Currency::where('code', $currency)->pluck('symbol')->first();
37 37
             $orders = $order->where('client', $clientid)->get();
38 38
 
39
-            return view('themes.default1.invoice.newpayment', compact('clientid', 'client', 'invoices',  'orders',
39
+            return view('themes.default1.invoice.newpayment', compact('clientid', 'client', 'invoices', 'orders',
40 40
                   'invoiceSum', 'amountReceived', 'pendingAmount', 'currency', 'symbol'));
41 41
         } catch (Exception $ex) {
42 42
             return redirect()->back()->with('fails', $ex->getMessage());
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
             $invoicAmount = $request->invoiceAmount;
113 113
             $amtToCredit = $request->amtToCredit;
114 114
             $payment_status = 'success';
115
-            $payment = $this->multiplePayment($clientid,$invoiceChecked, $payment_method,
115
+            $payment = $this->multiplePayment($clientid, $invoiceChecked, $payment_method,
116 116
              $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status);
117 117
             $response = ['type' => 'success', 'message' => 'Payment Updated Successfully'];
118 118
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
         }
130 130
     }
131 131
 
132
-    public function multiplePayment($clientid,$invoiceChecked, $payment_method,
132
+    public function multiplePayment($clientid, $invoiceChecked, $payment_method,
133 133
              $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status)
134 134
     {
135 135
         try {
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
             $invoicAmount = $request->invoiceAmount;
205 205
             $amtToCredit = $request->amtToCredit;
206 206
             $payment_status = 'success';
207
-            $payment = $this->updatePaymentByInvoice($clientid,$invoiceChecked, $payment_method,
207
+            $payment = $this->updatePaymentByInvoice($clientid, $invoiceChecked, $payment_method,
208 208
              $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status);
209 209
             $response = ['type' => 'success', 'message' => 'Payment Updated Successfully'];
210 210
 
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
         }
219 219
     }
220 220
 
221
-    public function updatePaymentByInvoice($clientid,$invoiceChecked, $payment_method,
221
+    public function updatePaymentByInvoice($clientid, $invoiceChecked, $payment_method,
222 222
              $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status)
223 223
     {
224 224
         try {
Please login to merge, or discard this patch.
app/Http/Controllers/Payment/CurrencyController.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,18 +37,18 @@
 block discarded – undo
37 37
 
38 38
         return \DataTables::of($model)
39 39
 
40
-                        ->addColumn('name', function ($model) {
40
+                        ->addColumn('name', function($model) {
41 41
                             return $model->name;
42 42
                         })
43 43
 
44
-                          ->addColumn('code', function ($model) {
44
+                          ->addColumn('code', function($model) {
45 45
                               return $model->code;
46 46
                           })
47 47
 
48
-                          ->addColumn('symbol', function ($model) {
48
+                          ->addColumn('symbol', function($model) {
49 49
                               return $model->symbol;
50 50
                           })
51
-                        ->addColumn('status', function ($model) {
51
+                        ->addColumn('status', function($model) {
52 52
                             if ($model->status == 1) {
53 53
                                 return'<label class="switch toggle_event_editing">
54 54
                             <input type="hidden" name="module_id" class="module_id" value="'.$model->id.'" >
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -43,13 +43,13 @@  discard block
 block discarded – undo
43 43
                             return $model->name;
44 44
                         })
45 45
 
46
-                          ->addColumn('code', function ($model) {
47
-                              return $model->code;
48
-                          })
46
+                            ->addColumn('code', function ($model) {
47
+                                return $model->code;
48
+                            })
49 49
 
50
-                          ->addColumn('symbol', function ($model) {
51
-                              return $model->symbol;
52
-                          })
50
+                            ->addColumn('symbol', function ($model) {
51
+                                return $model->symbol;
52
+                            })
53 53
                         ->addColumn('status', function ($model) {
54 54
                             if ($model->status == 1) {
55 55
                                 return'<label class="switch toggle_event_editing">
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
     {
241 241
         $countryDetails = Country::where('country_id', $request->id)->select('currency_code', 'currency_symbol', 'currency_name')->first();
242 242
         $data = (['code'=> $countryDetails->currency_code,
243
-          'symbol'      => $countryDetails->currency_symbol, 'currency'=>$countryDetails->currency_name, ]);
243
+            'symbol'      => $countryDetails->currency_symbol, 'currency'=>$countryDetails->currency_name, ]);
244 244
 
245 245
         return $data;
246 246
     }
Please login to merge, or discard this patch.
app/Http/Controllers/Front/WidgetController.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -31,19 +31,19 @@
 block discarded – undo
31 31
     public function getPages()
32 32
     {
33 33
         return \DataTables::of($this->widget->get())
34
-                       ->addColumn('checkbox', function ($model) {
35
-                           return "<input type='checkbox' class='widget_checkbox' 
34
+                        ->addColumn('checkbox', function ($model) {
35
+                            return "<input type='checkbox' class='widget_checkbox' 
36 36
                             value=".$model->id.' name=select[] id=check>';
37
-                       })
38
-                          ->addColumn('name', function ($model) {
39
-                              return ucfirst($model->name);
40
-                          })
37
+                        })
38
+                            ->addColumn('name', function ($model) {
39
+                                return ucfirst($model->name);
40
+                            })
41 41
                             ->addColumn('type', function ($model) {
42 42
                                 return $model->type;
43 43
                             })
44
-                              ->addColumn('created_at', function ($model) {
45
-                                  return $model->created_at;
46
-                              })
44
+                                ->addColumn('created_at', function ($model) {
45
+                                    return $model->created_at;
46
+                                })
47 47
                         // ->showColumns('name', 'type', 'created_at')
48 48
                         ->addColumn('content', function ($model) {
49 49
                             return str_limit($model->content, 10, '...');
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -31,24 +31,24 @@
 block discarded – undo
31 31
     public function getPages()
32 32
     {
33 33
         return \DataTables::of($this->widget->get())
34
-                       ->addColumn('checkbox', function ($model) {
34
+                       ->addColumn('checkbox', function($model) {
35 35
                            return "<input type='checkbox' class='widget_checkbox' 
36 36
                             value=".$model->id.' name=select[] id=check>';
37 37
                        })
38
-                          ->addColumn('name', function ($model) {
38
+                          ->addColumn('name', function($model) {
39 39
                               return ucfirst($model->name);
40 40
                           })
41
-                            ->addColumn('type', function ($model) {
41
+                            ->addColumn('type', function($model) {
42 42
                                 return $model->type;
43 43
                             })
44
-                              ->addColumn('created_at', function ($model) {
44
+                              ->addColumn('created_at', function($model) {
45 45
                                   return $model->created_at;
46 46
                               })
47 47
                         // ->showColumns('name', 'type', 'created_at')
48
-                        ->addColumn('content', function ($model) {
48
+                        ->addColumn('content', function($model) {
49 49
                             return str_limit($model->content, 10, '...');
50 50
                         })
51
-                        ->addColumn('action', function ($model) {
51
+                        ->addColumn('action', function($model) {
52 52
                             return '<a href='.url('widgets/'.$model->id.'/edit')."
53 53
                              class='btn btn-sm btn-primary btn-xs'><i class='fa fa-edit'
54 54
                                  style='color:white;'> </i>&nbsp;&nbsp;Edit</a>";
Please login to merge, or discard this patch.
app/Http/Controllers/Common/TemplateController.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -127,9 +127,9 @@  discard block
 block discarded – undo
127 127
                             value=".$model->id.' name=select[] id=check>';
128 128
                         })
129 129
 
130
-                         ->addColumn('name', function ($model) {
131
-                             return $model->name;
132
-                         })
130
+                            ->addColumn('name', function ($model) {
131
+                                return $model->name;
132
+                            })
133 133
                         ->addColumn('type', function ($model) {
134 134
                             return $this->type->where('id', $model->type)->first()->name;
135 135
                         })
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
     }
274 274
 
275 275
     public function mailing($from, $to, $data, $subject, $replace = [],
276
-     $type = '', $fromname = '', $toname = '', $cc = [], $attach = [])
276
+        $type = '', $fromname = '', $toname = '', $cc = [], $attach = [])
277 277
     {
278 278
         try {
279 279
             $transform = [];
@@ -305,10 +305,10 @@  discard block
 block discarded – undo
305 305
                 'date' => date('Y-m-d H:i:s'),
306 306
             'from'     => $from,
307 307
             'to'       => $to,
308
-             'subject' => $subject,
308
+                'subject' => $subject,
309 309
             'body'     => $data,
310
-          'status'     => 'success',
311
-          ]);
310
+            'status'     => 'success',
311
+            ]);
312 312
 
313 313
             return 'success';
314 314
         } catch (\Exception $ex) {
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
             'date'     => date('Y-m-d H:i:s'),
317 317
             'from'     => $from,
318 318
             'to'       => $to,
319
-             'subject' => $subject,
319
+                'subject' => $subject,
320 320
             'body'     => $data,
321 321
             'status'   => 'failed',
322 322
         ]);
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -122,18 +122,18 @@  discard block
 block discarded – undo
122 122
     public function getTemplates()
123 123
     {
124 124
         return \DataTables::of($this->template->select('id', 'name', 'type')->get())
125
-                        ->addColumn('checkbox', function ($model) {
125
+                        ->addColumn('checkbox', function($model) {
126 126
                             return "<input type='checkbox' class='template_checkbox' 
127 127
                             value=".$model->id.' name=select[] id=check>';
128 128
                         })
129 129
 
130
-                         ->addColumn('name', function ($model) {
130
+                         ->addColumn('name', function($model) {
131 131
                              return $model->name;
132 132
                          })
133
-                        ->addColumn('type', function ($model) {
133
+                        ->addColumn('type', function($model) {
134 134
                             return $this->type->where('id', $model->type)->first()->name;
135 135
                         })
136
-                        ->addColumn('action', function ($model) {
136
+                        ->addColumn('action', function($model) {
137 137
                             return '<a href='.url('templates/'.$model->id.'/edit').
138 138
                             " class='btn btn-sm btn-primary btn-xs'><i class='fa fa-edit'
139 139
                                  style='color:white;'> </i>&nbsp;&nbsp;Edit</a>";
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
             
285 285
             $settings = \App\Model\Common\Setting::find(1);
286 286
             $fromname = $settings->company;
287
-            \Mail::send('emails.mail', ['data' => $data], function ($m) use ($from, $to, $subject, $fromname, $toname, $cc, $attach) {
287
+            \Mail::send('emails.mail', ['data' => $data], function($m) use ($from, $to, $subject, $fromname, $toname, $cc, $attach) {
288 288
                 $m->from($from, $fromname);
289 289
 
290 290
                 $m->to($to, $toname)->subject($subject);
Please login to merge, or discard this patch.
app/Model/Payment/Currency.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
         return '';
34 34
 
35 35
         // return "Product  has been {$eventName}";
36
-         // \Auth::user()->activity;
36
+            // \Auth::user()->activity;
37 37
     }
38 38
 
39 39
     public function country()
Please login to merge, or discard this patch.
app/Model/Common/ChatScript.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,6 +33,6 @@
 block discarded – undo
33 33
         return '';
34 34
 
35 35
         // return "Product  has been {$eventName}";
36
-         // \Auth::user()->activity;
36
+            // \Auth::user()->activity;
37 37
     }
38 38
 }
Please login to merge, or discard this patch.
app/Model/Product/ProductCategory.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,6 +33,6 @@
 block discarded – undo
33 33
         return '';
34 34
 
35 35
         // return "Product  has been {$eventName}";
36
-         // \Auth::user()->activity;
36
+            // \Auth::user()->activity;
37 37
     }
38 38
 }
Please login to merge, or discard this patch.
app/Http/Controllers/DashboardController.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -56,8 +56,8 @@  discard block
 block discarded – undo
56 56
         return view('themes.default1.common.dashboard', compact('totalSalesINR', 'totalSalesUSD',
57 57
                 'yearlySalesINR', 'yearlySalesUSD', 'monthlySalesINR', 'monthlySalesUSD', 'users',
58 58
                 'count_users', 'arraylists', 'productSoldlists','orders','subscriptions','invoices',
59
-                 'products', 'arrayCountList', 'pendingPaymentINR', 'pendingPaymentUSD', 'status','startSubscriptionDate',
60
-                 'endSubscriptionDate'));
59
+                    'products', 'arrayCountList', 'pendingPaymentINR', 'pendingPaymentUSD', 'status','startSubscriptionDate',
60
+                    'endSubscriptionDate'));
61 61
     }
62 62
 
63 63
     /**
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
         // dd($currentYear,$currentMonth );
155 155
         $total = Invoice::whereYear('created_at', '=', $currentYear)->whereMonth('created_at', '=', $currentMonth)
156 156
                 ->where('currency', 'USD')
157
-                 ->where('status', '=', 'success')
157
+                    ->where('status', '=', 'success')
158 158
                 ->pluck('grand_total')->all();
159 159
         $grandTotal = array_sum($total);
160 160
 
@@ -201,9 +201,9 @@  discard block
 block discarded – undo
201 201
     public function getAllUsers()
202 202
     {
203 203
         $allUsers = User::orderBy('created_at', 'desc')->where('active', 1)->where('mobile_verified', 1)
204
-              ->take(20)
205
-              ->get()
206
-              ->toArray();
204
+                ->take(20)
205
+                ->get()
206
+                ->toArray();
207 207
 
208 208
         return $allUsers;
209 209
     }
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
         $dayUtc = new Carbon('-30 days');
239 239
         $minus30Day = $dayUtc->toDateTimeString();
240 240
         $recentOrders = Order::where('created_at', '>', $minus30Day)->orderBy('created_at', 'desc')
241
-                 ->where('price_override', '>', 0)->get();
241
+                    ->where('price_override', '>', 0)->get();
242 242
 
243 243
         return $recentOrders;
244 244
     }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,8 +55,8 @@
 block discarded – undo
55 55
 
56 56
         return view('themes.default1.common.dashboard', compact('totalSalesINR', 'totalSalesUSD',
57 57
                 'yearlySalesINR', 'yearlySalesUSD', 'monthlySalesINR', 'monthlySalesUSD', 'users',
58
-                'count_users', 'arraylists', 'productSoldlists','orders','subscriptions','invoices',
59
-                 'products', 'arrayCountList', 'pendingPaymentINR', 'pendingPaymentUSD', 'status','startSubscriptionDate',
58
+                'count_users', 'arraylists', 'productSoldlists', 'orders', 'subscriptions', 'invoices',
59
+                 'products', 'arrayCountList', 'pendingPaymentINR', 'pendingPaymentUSD', 'status', 'startSubscriptionDate',
60 60
                  'endSubscriptionDate'));
61 61
     }
62 62
 
Please login to merge, or discard this patch.