@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | try { |
| 60 | 60 | $merge_fields = $this->field($email); |
| 61 | 61 | $interestGroupIdForNo = $this->relation->is_paid_no; //Interest GroupId for IsPaid Is No |
| 62 | - $interestGroupIdForYes = $this->relation->is_paid_yes; //Interest GroupId for IsPaid Is Yes |
|
| 62 | + $interestGroupIdForYes = $this->relation->is_paid_yes; //Interest GroupId for IsPaid Is Yes |
|
| 63 | 63 | $result = $this->mailchimp->post("lists/$this->list_id/members", [ |
| 64 | 64 | 'status' => $this->mailchimp_set->subscribe_status, |
| 65 | 65 | 'email_address' => $email, |
@@ -155,11 +155,11 @@ discard block |
||
| 155 | 155 | |
| 156 | 156 | $this->addProductInterestFieldsToAgora(); //add all the fields in Product Section of Groups to the db |
| 157 | 157 | $group_fields = $this->groups->where('list_id', $this->list_id) |
| 158 | - ->select('category_name', 'category_option_id', 'category_id')->get()->toArray(); |
|
| 158 | + ->select('category_name', 'category_option_id', 'category_id')->get()->toArray(); |
|
| 159 | 159 | // dd($group_fields[0]); |
| 160 | 160 | $relations = MailchimpGroupAgoraRelation::where('id', '!=', 0) |
| 161 | - ->select('agora_product_id', 'mailchimp_group_cat_id') |
|
| 162 | - ->orderBy('id', 'asc')->get()->toArray(); |
|
| 161 | + ->select('agora_product_id', 'mailchimp_group_cat_id') |
|
| 162 | + ->orderBy('id', 'asc')->get()->toArray(); |
|
| 163 | 163 | $productList = []; |
| 164 | 164 | $categoryList = []; |
| 165 | 165 | if (count($relations) != 0) { |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | public function mailing($from, $to, $data, $subject, $replace = [], |
| 57 | - $type = '', $bcc = [], $fromname = '', $toname = '', $cc = [], $attach = []) |
|
| 57 | + $type = '', $bcc = [], $fromname = '', $toname = '', $cc = [], $attach = []) |
|
| 58 | 58 | { |
| 59 | 59 | try { |
| 60 | 60 | $transform = []; |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | private function getActiveQueue() |
| 34 | 34 | { |
| 35 | - return persistentCache('queue_configuration', function () { |
|
| 35 | + return persistentCache('queue_configuration', function() { |
|
| 36 | 36 | $short = 'database'; |
| 37 | 37 | $field = [ |
| 38 | 38 | 'driver' => 'database', |
@@ -64,25 +64,25 @@ discard block |
||
| 64 | 64 | $settings = \App\Model\Common\Setting::find(1); |
| 65 | 65 | $fromname = $settings->company; |
| 66 | 66 | $this->setMailConfig($settings); |
| 67 | - \Mail::send('emails.mail', ['data' => $data], function ($m) use ($from, $to, $subject, $fromname, $toname, $cc, $attach, $bcc) { |
|
| 67 | + \Mail::send('emails.mail', ['data' => $data], function($m) use ($from, $to, $subject, $fromname, $toname, $cc, $attach, $bcc) { |
|
| 68 | 68 | $m->from($from, $fromname); |
| 69 | 69 | |
| 70 | 70 | $m->to($to, $toname)->subject($subject); |
| 71 | 71 | /* if cc is need */ |
| 72 | - if (! empty($cc)) { |
|
| 72 | + if (!empty($cc)) { |
|
| 73 | 73 | foreach ($cc as $address) { |
| 74 | 74 | $m->cc($address['address'], $address['name']); |
| 75 | 75 | } |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - if (! empty($bcc)) { |
|
| 78 | + if (!empty($bcc)) { |
|
| 79 | 79 | foreach ($bcc as $address) { |
| 80 | 80 | $m->bcc($address); |
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | /* if attachment is need */ |
| 85 | - if (! empty($attach)) { |
|
| 85 | + if (!empty($attach)) { |
|
| 86 | 86 | foreach ($attach as $file) { |
| 87 | 87 | $m->attach($file['path'], $options = []); |
| 88 | 88 | } |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | 'username' => $mail->email, |
| 127 | 127 | 'password' => $mail->password, |
| 128 | 128 | ]; |
| 129 | - if (! $this->commonMailer->setSmtpDriver($config)) { |
|
| 129 | + if (!$this->commonMailer->setSmtpDriver($config)) { |
|
| 130 | 130 | \Log::info('Invaid configuration :- '.$config); |
| 131 | 131 | |
| 132 | 132 | return 'invalid mail configuration'; |
@@ -305,37 +305,37 @@ discard block |
||
| 305 | 305 | $query = $this->advanceSearch($from, $till, $delFrom, $delTill); |
| 306 | 306 | |
| 307 | 307 | return \DataTables::of($query->take(50)) |
| 308 | - ->setTotalRecords($query->count()) |
|
| 309 | - ->addColumn('checkbox', function ($model) { |
|
| 310 | - return "<input type='checkbox' class='activity' value=".$model->id.' name=select[] id=check>'; |
|
| 311 | - }) |
|
| 312 | - ->addColumn('name', function ($model) { |
|
| 313 | - return ucfirst($model->log_name); |
|
| 314 | - }) |
|
| 315 | - ->addColumn('description', function ($model) { |
|
| 316 | - return ucfirst($model->description); |
|
| 317 | - }) |
|
| 318 | - ->addColumn('username', function ($model) { |
|
| 319 | - $causer_id = $model->causer_id; |
|
| 320 | - $names = User::where('id', $causer_id)->pluck('last_name', 'first_name'); |
|
| 321 | - foreach ($names as $key => $value) { |
|
| 322 | - $fullName = $key.' '.$value; |
|
| 323 | - |
|
| 324 | - return $fullName; |
|
| 325 | - } |
|
| 326 | - }) |
|
| 327 | - ->addColumn('role', function ($model) { |
|
| 328 | - $causer_id = $model->causer_id; |
|
| 329 | - $role = User::where('id', $causer_id)->pluck('role'); |
|
| 330 | - |
|
| 331 | - return json_decode($role); |
|
| 332 | - }) |
|
| 333 | - ->addColumn('new', function ($model) { |
|
| 334 | - $properties = ($model->properties); |
|
| 335 | - $newEntry = $this->getNewEntry($properties, $model); |
|
| 336 | - |
|
| 337 | - return $newEntry; |
|
| 338 | - }) |
|
| 308 | + ->setTotalRecords($query->count()) |
|
| 309 | + ->addColumn('checkbox', function ($model) { |
|
| 310 | + return "<input type='checkbox' class='activity' value=".$model->id.' name=select[] id=check>'; |
|
| 311 | + }) |
|
| 312 | + ->addColumn('name', function ($model) { |
|
| 313 | + return ucfirst($model->log_name); |
|
| 314 | + }) |
|
| 315 | + ->addColumn('description', function ($model) { |
|
| 316 | + return ucfirst($model->description); |
|
| 317 | + }) |
|
| 318 | + ->addColumn('username', function ($model) { |
|
| 319 | + $causer_id = $model->causer_id; |
|
| 320 | + $names = User::where('id', $causer_id)->pluck('last_name', 'first_name'); |
|
| 321 | + foreach ($names as $key => $value) { |
|
| 322 | + $fullName = $key.' '.$value; |
|
| 323 | + |
|
| 324 | + return $fullName; |
|
| 325 | + } |
|
| 326 | + }) |
|
| 327 | + ->addColumn('role', function ($model) { |
|
| 328 | + $causer_id = $model->causer_id; |
|
| 329 | + $role = User::where('id', $causer_id)->pluck('role'); |
|
| 330 | + |
|
| 331 | + return json_decode($role); |
|
| 332 | + }) |
|
| 333 | + ->addColumn('new', function ($model) { |
|
| 334 | + $properties = ($model->properties); |
|
| 335 | + $newEntry = $this->getNewEntry($properties, $model); |
|
| 336 | + |
|
| 337 | + return $newEntry; |
|
| 338 | + }) |
|
| 339 | 339 | ->addColumn('old', function ($model) { |
| 340 | 340 | $data = ($model->properties); |
| 341 | 341 | $oldEntry = $this->getOldEntry($data, $model); |
@@ -378,49 +378,49 @@ discard block |
||
| 378 | 378 | |
| 379 | 379 | return\ DataTables::of($email_log) |
| 380 | 380 | ->setTotalRecords($email_log->count()) |
| 381 | - ->addColumn('checkbox', function ($model) { |
|
| 382 | - return "<input type='checkbox' class='email' value=".$model->id.' name=select[] id=check>'; |
|
| 383 | - }) |
|
| 384 | - ->addColumn('date', function ($model) { |
|
| 385 | - $date = $model->date; |
|
| 386 | - |
|
| 387 | - return getDateHtml($date); |
|
| 388 | - }) |
|
| 389 | - ->addColumn('from', function ($model) { |
|
| 390 | - $from = Markdown::convertToHtml($model->from); |
|
| 391 | - |
|
| 392 | - return $from; |
|
| 393 | - }) |
|
| 394 | - ->addColumn('to', function ($model) { |
|
| 395 | - $to = Markdown::convertToHtml($model->to); |
|
| 396 | - |
|
| 397 | - return $to; |
|
| 398 | - }) |
|
| 399 | - |
|
| 400 | - ->addColumn('subject', function ($model) { |
|
| 401 | - return ucfirst($model->subject); |
|
| 402 | - }) |
|
| 403 | - ->addColumn('status', function ($model) { |
|
| 404 | - return ucfirst($model->status); |
|
| 405 | - }) |
|
| 406 | - ->filterColumn('from', function ($query, $keyword) { |
|
| 407 | - $sql = '`from` like ?'; |
|
| 408 | - $query->whereRaw($sql, ["%{$keyword}%"]); |
|
| 409 | - }) |
|
| 410 | - ->filterColumn('to', function ($query, $keyword) { |
|
| 411 | - $sql = '`to` like ?'; |
|
| 412 | - $query->whereRaw($sql, ["%{$keyword}%"]); |
|
| 413 | - }) |
|
| 414 | - ->filterColumn('subject', function ($query, $keyword) { |
|
| 415 | - $sql = '`subject` like ?'; |
|
| 416 | - $query->whereRaw($sql, ["%{$keyword}%"]); |
|
| 417 | - }) |
|
| 418 | - ->filterColumn('status', function ($query, $keyword) { |
|
| 419 | - $sql = '`status` like ?'; |
|
| 420 | - $query->whereRaw($sql, ["%{$keyword}%"]); |
|
| 421 | - }) |
|
| 422 | - ->rawColumns(['checkbox', 'date', 'from', 'to', |
|
| 423 | - 'bcc', 'subject', 'status', ]) |
|
| 381 | + ->addColumn('checkbox', function ($model) { |
|
| 382 | + return "<input type='checkbox' class='email' value=".$model->id.' name=select[] id=check>'; |
|
| 383 | + }) |
|
| 384 | + ->addColumn('date', function ($model) { |
|
| 385 | + $date = $model->date; |
|
| 386 | + |
|
| 387 | + return getDateHtml($date); |
|
| 388 | + }) |
|
| 389 | + ->addColumn('from', function ($model) { |
|
| 390 | + $from = Markdown::convertToHtml($model->from); |
|
| 391 | + |
|
| 392 | + return $from; |
|
| 393 | + }) |
|
| 394 | + ->addColumn('to', function ($model) { |
|
| 395 | + $to = Markdown::convertToHtml($model->to); |
|
| 396 | + |
|
| 397 | + return $to; |
|
| 398 | + }) |
|
| 399 | + |
|
| 400 | + ->addColumn('subject', function ($model) { |
|
| 401 | + return ucfirst($model->subject); |
|
| 402 | + }) |
|
| 403 | + ->addColumn('status', function ($model) { |
|
| 404 | + return ucfirst($model->status); |
|
| 405 | + }) |
|
| 406 | + ->filterColumn('from', function ($query, $keyword) { |
|
| 407 | + $sql = '`from` like ?'; |
|
| 408 | + $query->whereRaw($sql, ["%{$keyword}%"]); |
|
| 409 | + }) |
|
| 410 | + ->filterColumn('to', function ($query, $keyword) { |
|
| 411 | + $sql = '`to` like ?'; |
|
| 412 | + $query->whereRaw($sql, ["%{$keyword}%"]); |
|
| 413 | + }) |
|
| 414 | + ->filterColumn('subject', function ($query, $keyword) { |
|
| 415 | + $sql = '`subject` like ?'; |
|
| 416 | + $query->whereRaw($sql, ["%{$keyword}%"]); |
|
| 417 | + }) |
|
| 418 | + ->filterColumn('status', function ($query, $keyword) { |
|
| 419 | + $sql = '`status` like ?'; |
|
| 420 | + $query->whereRaw($sql, ["%{$keyword}%"]); |
|
| 421 | + }) |
|
| 422 | + ->rawColumns(['checkbox', 'date', 'from', 'to', |
|
| 423 | + 'bcc', 'subject', 'status', ]) |
|
| 424 | 424 | ->make(true); |
| 425 | 425 | } catch (\Exception $e) { |
| 426 | 426 | Bugsnag::notifyException($e); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | public function settings(Setting $settings) |
| 37 | 37 | { |
| 38 | - if (! $settings->where('id', '1')->first()) { |
|
| 38 | + if (!$settings->where('id', '1')->first()) { |
|
| 39 | 39 | $settings->create(['company' => '']); |
| 40 | 40 | } |
| 41 | 41 | $isRedisConfigured = QueueService::where('short_name', 'redis')->value('status'); |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | $msg91Sender = $apikeys->pluck('msg91_sender')->first(); |
| 71 | 71 | $updateUrl = $apikeys->pluck('update_api_url')->first(); |
| 72 | 72 | $emailStatus = StatusSetting::pluck('emailverification_status')->first(); |
| 73 | - $twitterKeys = $apikeys->select('twitter_consumer_key','twitter_consumer_secret', |
|
| 73 | + $twitterKeys = $apikeys->select('twitter_consumer_key', 'twitter_consumer_secret', |
|
| 74 | 74 | 'twitter_access_token', 'access_tooken_secret')->first(); |
| 75 | 75 | $twitterStatus = $this->statusSetting->pluck('twitter_status')->first(); |
| 76 | 76 | $zohoStatus = $this->statusSetting->pluck('zoho_status')->first(); |
@@ -306,16 +306,16 @@ discard block |
||
| 306 | 306 | |
| 307 | 307 | return \DataTables::of($query->take(50)) |
| 308 | 308 | ->setTotalRecords($query->count()) |
| 309 | - ->addColumn('checkbox', function ($model) { |
|
| 309 | + ->addColumn('checkbox', function($model) { |
|
| 310 | 310 | return "<input type='checkbox' class='activity' value=".$model->id.' name=select[] id=check>'; |
| 311 | 311 | }) |
| 312 | - ->addColumn('name', function ($model) { |
|
| 312 | + ->addColumn('name', function($model) { |
|
| 313 | 313 | return ucfirst($model->log_name); |
| 314 | 314 | }) |
| 315 | - ->addColumn('description', function ($model) { |
|
| 315 | + ->addColumn('description', function($model) { |
|
| 316 | 316 | return ucfirst($model->description); |
| 317 | 317 | }) |
| 318 | - ->addColumn('username', function ($model) { |
|
| 318 | + ->addColumn('username', function($model) { |
|
| 319 | 319 | $causer_id = $model->causer_id; |
| 320 | 320 | $names = User::where('id', $causer_id)->pluck('last_name', 'first_name'); |
| 321 | 321 | foreach ($names as $key => $value) { |
@@ -324,39 +324,39 @@ discard block |
||
| 324 | 324 | return $fullName; |
| 325 | 325 | } |
| 326 | 326 | }) |
| 327 | - ->addColumn('role', function ($model) { |
|
| 327 | + ->addColumn('role', function($model) { |
|
| 328 | 328 | $causer_id = $model->causer_id; |
| 329 | 329 | $role = User::where('id', $causer_id)->pluck('role'); |
| 330 | 330 | |
| 331 | 331 | return json_decode($role); |
| 332 | 332 | }) |
| 333 | - ->addColumn('new', function ($model) { |
|
| 333 | + ->addColumn('new', function($model) { |
|
| 334 | 334 | $properties = ($model->properties); |
| 335 | 335 | $newEntry = $this->getNewEntry($properties, $model); |
| 336 | 336 | |
| 337 | 337 | return $newEntry; |
| 338 | 338 | }) |
| 339 | - ->addColumn('old', function ($model) { |
|
| 339 | + ->addColumn('old', function($model) { |
|
| 340 | 340 | $data = ($model->properties); |
| 341 | 341 | $oldEntry = $this->getOldEntry($data, $model); |
| 342 | 342 | |
| 343 | 343 | return $oldEntry; |
| 344 | 344 | }) |
| 345 | - ->addColumn('created_at', function ($model) { |
|
| 345 | + ->addColumn('created_at', function($model) { |
|
| 346 | 346 | return getDateHtml($model->created_at); |
| 347 | 347 | }) |
| 348 | 348 | |
| 349 | - ->filterColumn('log_name', function ($query, $keyword) { |
|
| 349 | + ->filterColumn('log_name', function($query, $keyword) { |
|
| 350 | 350 | $sql = 'log_name like ?'; |
| 351 | 351 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 352 | 352 | }) |
| 353 | 353 | |
| 354 | - ->filterColumn('description', function ($query, $keyword) { |
|
| 354 | + ->filterColumn('description', function($query, $keyword) { |
|
| 355 | 355 | $sql = 'description like ?'; |
| 356 | 356 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 357 | 357 | }) |
| 358 | 358 | |
| 359 | - ->filterColumn('causer_id', function ($query, $keyword) { |
|
| 359 | + ->filterColumn('causer_id', function($query, $keyword) { |
|
| 360 | 360 | $sql = 'first_name like ?'; |
| 361 | 361 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 362 | 362 | }) |
@@ -378,49 +378,49 @@ discard block |
||
| 378 | 378 | |
| 379 | 379 | return\ DataTables::of($email_log) |
| 380 | 380 | ->setTotalRecords($email_log->count()) |
| 381 | - ->addColumn('checkbox', function ($model) { |
|
| 381 | + ->addColumn('checkbox', function($model) { |
|
| 382 | 382 | return "<input type='checkbox' class='email' value=".$model->id.' name=select[] id=check>'; |
| 383 | 383 | }) |
| 384 | - ->addColumn('date', function ($model) { |
|
| 384 | + ->addColumn('date', function($model) { |
|
| 385 | 385 | $date = $model->date; |
| 386 | 386 | |
| 387 | 387 | return getDateHtml($date); |
| 388 | 388 | }) |
| 389 | - ->addColumn('from', function ($model) { |
|
| 389 | + ->addColumn('from', function($model) { |
|
| 390 | 390 | $from = Markdown::convertToHtml($model->from); |
| 391 | 391 | |
| 392 | 392 | return $from; |
| 393 | 393 | }) |
| 394 | - ->addColumn('to', function ($model) { |
|
| 394 | + ->addColumn('to', function($model) { |
|
| 395 | 395 | $to = Markdown::convertToHtml($model->to); |
| 396 | 396 | |
| 397 | 397 | return $to; |
| 398 | 398 | }) |
| 399 | 399 | |
| 400 | - ->addColumn('subject', function ($model) { |
|
| 400 | + ->addColumn('subject', function($model) { |
|
| 401 | 401 | return ucfirst($model->subject); |
| 402 | 402 | }) |
| 403 | - ->addColumn('status', function ($model) { |
|
| 403 | + ->addColumn('status', function($model) { |
|
| 404 | 404 | return ucfirst($model->status); |
| 405 | 405 | }) |
| 406 | - ->filterColumn('from', function ($query, $keyword) { |
|
| 406 | + ->filterColumn('from', function($query, $keyword) { |
|
| 407 | 407 | $sql = '`from` like ?'; |
| 408 | 408 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 409 | 409 | }) |
| 410 | - ->filterColumn('to', function ($query, $keyword) { |
|
| 410 | + ->filterColumn('to', function($query, $keyword) { |
|
| 411 | 411 | $sql = '`to` like ?'; |
| 412 | 412 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 413 | 413 | }) |
| 414 | - ->filterColumn('subject', function ($query, $keyword) { |
|
| 414 | + ->filterColumn('subject', function($query, $keyword) { |
|
| 415 | 415 | $sql = '`subject` like ?'; |
| 416 | 416 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 417 | 417 | }) |
| 418 | - ->filterColumn('status', function ($query, $keyword) { |
|
| 418 | + ->filterColumn('status', function($query, $keyword) { |
|
| 419 | 419 | $sql = '`status` like ?'; |
| 420 | 420 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 421 | 421 | }) |
| 422 | 422 | ->rawColumns(['checkbox', 'date', 'from', 'to', |
| 423 | - 'bcc', 'subject', 'status', ]) |
|
| 423 | + 'bcc', 'subject', 'status', ]) |
|
| 424 | 424 | ->make(true); |
| 425 | 425 | } catch (\Exception $e) { |
| 426 | 426 | Bugsnag::notifyException($e); |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | { |
| 434 | 434 | try { |
| 435 | 435 | $ids = $request->input('select'); |
| 436 | - if (! empty($ids)) { |
|
| 436 | + if (!empty($ids)) { |
|
| 437 | 437 | foreach ($ids as $id) { |
| 438 | 438 | $activity = Activity::where('id', $id)->first(); |
| 439 | 439 | if ($activity) { |
@@ -127,7 +127,8 @@ |
||
| 127 | 127 | $allCurrencies[] = \DB::table(strtolower($plugin->name))->pluck('currencies')->toArray(); //get the table of the active plugin |
| 128 | 128 | $pluginName[] = $plugin->name; //get the name of active plugin |
| 129 | 129 | } |
| 130 | - if ($models) {//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 |
|
| 130 | + if ($models) { |
|
| 131 | +//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 |
|
| 131 | 132 | for ($i = 0; $i < count($pluginName); $i++) { |
| 132 | 133 | $curr = implode(',', $allCurrencies[$i]); |
| 133 | 134 | $currencies = explode(',', $curr); |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | public function setSmtpDriver($config) |
| 10 | 10 | { |
| 11 | 11 | try { |
| 12 | - if (! $config) { |
|
| 12 | + if (!$config) { |
|
| 13 | 13 | return false; |
| 14 | 14 | } |
| 15 | 15 | $https = []; |
@@ -37,20 +37,20 @@ discard block |
||
| 37 | 37 | $social = $this->social->get(); |
| 38 | 38 | |
| 39 | 39 | return \DataTables::of($social) |
| 40 | - ->addColumn('#', function ($model) { |
|
| 40 | + ->addColumn('#', function($model) { |
|
| 41 | 41 | return "<input type='checkbox' value=".$model->id.' name=select[] id=check>'; |
| 42 | 42 | }) |
| 43 | - ->addColumn('name', function ($model) { |
|
| 43 | + ->addColumn('name', function($model) { |
|
| 44 | 44 | return $model->name; |
| 45 | 45 | }) |
| 46 | - ->addColumn('class', function ($model) { |
|
| 46 | + ->addColumn('class', function($model) { |
|
| 47 | 47 | return $model->class; |
| 48 | 48 | }) |
| 49 | - ->addColumn('link', function ($model) { |
|
| 49 | + ->addColumn('link', function($model) { |
|
| 50 | 50 | return $model->link; |
| 51 | 51 | }) |
| 52 | 52 | // ->showColumns('name', 'class', 'link') |
| 53 | - ->addColumn('action', function ($model) { |
|
| 53 | + ->addColumn('action', function($model) { |
|
| 54 | 54 | return '<a href='.url('social-media/'.$model->id.'/edit') |
| 55 | 55 | ." class='btn btn-sm btn-secondary btn-xs'".tooltip('Edit')."<i class='fa fa-edit' |
| 56 | 56 | style='color:white;'> </i></a>"; |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | { |
| 134 | 134 | try { |
| 135 | 135 | $ids = $request->input('select'); |
| 136 | - if (! empty($ids)) { |
|
| 136 | + if (!empty($ids)) { |
|
| 137 | 137 | foreach ($ids as $id) { |
| 138 | 138 | $social = $this->social->where('id', $id)->first(); |
| 139 | 139 | if ($social) { |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | $twitter = ''; |
| 205 | 205 | // Create the HTML output |
| 206 | 206 | //dd($tweets[0]->text); |
| 207 | - if (! empty($tweets)) { |
|
| 207 | + if (!empty($tweets)) { |
|
| 208 | 208 | foreach ($tweets as $tweet) { |
| 209 | 209 | $twitter .= '<li> |
| 210 | 210 | <span class="status"><i class="fa fa-twitter"></i> '.$tweet->text.'</span> |
@@ -121,19 +121,19 @@ discard block |
||
| 121 | 121 | |
| 122 | 122 | return \DataTables::of($query) |
| 123 | 123 | ->setTotalRecords($query->count()) |
| 124 | - ->addColumn('checkbox', function ($model) { |
|
| 124 | + ->addColumn('checkbox', function($model) { |
|
| 125 | 125 | return "<input type='checkbox' class='order_checkbox' value=".$model->id.' name=select[] id=check>'; |
| 126 | 126 | }) |
| 127 | - ->addColumn('client', function ($model) { |
|
| 127 | + ->addColumn('client', function($model) { |
|
| 128 | 128 | return '<a href='.url('clients/'.$model->client_id).'>'.ucfirst($model->client_name).'<a>'; |
| 129 | 129 | }) |
| 130 | - ->addColumn('product_name', function ($model) { |
|
| 130 | + ->addColumn('product_name', function($model) { |
|
| 131 | 131 | return $model->product_name; |
| 132 | 132 | }) |
| 133 | - ->addColumn('version', function ($model) { |
|
| 133 | + ->addColumn('version', function($model) { |
|
| 134 | 134 | return getVersionAndLabel($model->product_version, $model->product); |
| 135 | 135 | }) |
| 136 | - ->addColumn('number', function ($model) { |
|
| 136 | + ->addColumn('number', function($model) { |
|
| 137 | 137 | $orderLink = '<a href='.url('orders/'.$model->id).'>'.$model->number.'</a>'; |
| 138 | 138 | if ($model->subscription_updated_at) {//For few older clients subscription was not generated, so no updated_at column exists |
| 139 | 139 | $orderLink = '<a href='.url('orders/'.$model->id).'>'.$model->number.'</a>'.installationStatusLabel($model->subscription_updated_at, $model->subscription_created_at); |
@@ -141,39 +141,39 @@ discard block |
||
| 141 | 141 | |
| 142 | 142 | return $orderLink; |
| 143 | 143 | }) |
| 144 | - ->addColumn('order_status', function ($model) { |
|
| 144 | + ->addColumn('order_status', function($model) { |
|
| 145 | 145 | return ucfirst($model->order_status); |
| 146 | 146 | }) |
| 147 | - ->addColumn('order_date', function ($model) { |
|
| 147 | + ->addColumn('order_date', function($model) { |
|
| 148 | 148 | return getDateHtml($model->created_at); |
| 149 | 149 | }) |
| 150 | - ->addColumn('update_ends_at', function ($model) { |
|
| 150 | + ->addColumn('update_ends_at', function($model) { |
|
| 151 | 151 | $ends_at = strtotime($model->subscription_ends_at) > 1 ? $model->subscription_ends_at : '--'; |
| 152 | 152 | |
| 153 | 153 | return getExpiryLabel($ends_at); |
| 154 | 154 | }) |
| 155 | - ->addColumn('action', function ($model) { |
|
| 155 | + ->addColumn('action', function($model) { |
|
| 156 | 156 | $status = $this->checkInvoiceStatusByOrderId($model->id); |
| 157 | 157 | |
| 158 | 158 | return $this->getUrl($model, $status, $model->subscription_id); |
| 159 | 159 | }) |
| 160 | 160 | |
| 161 | - ->filterColumn('client', function ($query, $keyword) { |
|
| 161 | + ->filterColumn('client', function($query, $keyword) { |
|
| 162 | 162 | $query->whereRaw("concat(first_name, ' ', last_name) like ?", ["%$keyword%"]); |
| 163 | 163 | }) |
| 164 | - ->filterColumn('product_name', function ($query, $keyword) { |
|
| 164 | + ->filterColumn('product_name', function($query, $keyword) { |
|
| 165 | 165 | $query->whereRaw('products.name like ?', ["%$keyword%"]); |
| 166 | 166 | }) |
| 167 | - ->filterColumn('version', function ($query, $keyword) { |
|
| 167 | + ->filterColumn('version', function($query, $keyword) { |
|
| 168 | 168 | $query->whereRaw('subscriptions.version like ?', ["%$keyword%"]); |
| 169 | 169 | }) |
| 170 | - ->filterColumn('number', function ($query, $keyword) { |
|
| 170 | + ->filterColumn('number', function($query, $keyword) { |
|
| 171 | 171 | $query->whereRaw('number like ?', ["%{$keyword}%"]); |
| 172 | 172 | }) |
| 173 | - ->filterColumn('price_override', function ($query, $keyword) { |
|
| 173 | + ->filterColumn('price_override', function($query, $keyword) { |
|
| 174 | 174 | $query->whereRaw('price_override like ?', ["%{$keyword}%"]); |
| 175 | 175 | }) |
| 176 | - ->filterColumn('order_status', function ($query, $keyword) { |
|
| 176 | + ->filterColumn('order_status', function($query, $keyword) { |
|
| 177 | 177 | $query->whereRaw('order_status like ?', ["%{$keyword}%"]); |
| 178 | 178 | }) |
| 179 | 179 | |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | } |
| 241 | 241 | $invoice = $this->invoice->where('id', $order->invoice_id)->first(); |
| 242 | 242 | |
| 243 | - if (! $invoice) { |
|
| 243 | + if (!$invoice) { |
|
| 244 | 244 | return redirect()->back()->with('fails', 'no orders'); |
| 245 | 245 | } |
| 246 | 246 | $user = $this->user->find($invoice->user_id); |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | try { |
| 325 | 325 | // dd('df'); |
| 326 | 326 | $ids = $request->input('select'); |
| 327 | - if (! empty($ids)) { |
|
| 327 | + if (!empty($ids)) { |
|
| 328 | 328 | foreach ($ids as $id) { |
| 329 | 329 | $order = $this->order->where('id', $id)->first(); |
| 330 | 330 | if ($order) { |
@@ -135,7 +135,8 @@ discard block |
||
| 135 | 135 | }) |
| 136 | 136 | ->addColumn('number', function ($model) { |
| 137 | 137 | $orderLink = '<a href='.url('orders/'.$model->id).'>'.$model->number.'</a>'; |
| 138 | - if ($model->subscription_updated_at) {//For few older clients subscription was not generated, so no updated_at column exists |
|
| 138 | + if ($model->subscription_updated_at) { |
|
| 139 | +//For few older clients subscription was not generated, so no updated_at column exists |
|
| 139 | 140 | $orderLink = '<a href='.url('orders/'.$model->id).'>'.$model->number.'</a>'.installationStatusLabel($model->subscription_updated_at, $model->subscription_created_at); |
| 140 | 141 | } |
| 141 | 142 | |
@@ -220,7 +221,8 @@ discard block |
||
| 220 | 221 | { |
| 221 | 222 | try { |
| 222 | 223 | $order = $this->order->findOrFail($id); |
| 223 | - if (User::onlyTrashed()->find($order->client)) {//If User is soft deleted for this order |
|
| 224 | + if (User::onlyTrashed()->find($order->client)) { |
|
| 225 | +//If User is soft deleted for this order |
|
| 224 | 226 | throw new \Exception('The user for this order is suspended from the system. Restore the user to view order details.'); |
| 225 | 227 | } |
| 226 | 228 | $subscription = $order->subscription()->first(); |
@@ -173,16 +173,16 @@ discard block |
||
| 173 | 173 | { |
| 174 | 174 | try { |
| 175 | 175 | $product = $this->getProductById($productid); |
| 176 | - if (! $product) { |
|
| 176 | + if (!$product) { |
|
| 177 | 177 | throw new Exception('Product has removed from database'); |
| 178 | 178 | } |
| 179 | 179 | $currency = $this->getUserCurrencyById($userid); |
| 180 | 180 | $price = $product->price()->where('currency', $currency)->first(); |
| 181 | - if (! $price) { |
|
| 181 | + if (!$price) { |
|
| 182 | 182 | throw new Exception('Price has removed from database'); |
| 183 | 183 | } |
| 184 | 184 | $cost = $price->sales_price; |
| 185 | - if (! $cost) { |
|
| 185 | + if (!$cost) { |
|
| 186 | 186 | $cost = $price->regular_price; |
| 187 | 187 | } |
| 188 | 188 | |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | { |
| 197 | 197 | try { |
| 198 | 198 | $user = $this->user->find($userid); |
| 199 | - if (! $user) { |
|
| 199 | + if (!$user) { |
|
| 200 | 200 | throw new Exception('User has removed from database'); |
| 201 | 201 | } |
| 202 | 202 | |
@@ -261,7 +261,8 @@ |
||
| 261 | 261 | try { |
| 262 | 262 | $sub = $this->sub->find($id); |
| 263 | 263 | $userid = $sub->user_id; |
| 264 | - if (User::onlyTrashed()->find($userid)) {//If User is soft deleted for this order |
|
| 264 | + if (User::onlyTrashed()->find($userid)) { |
|
| 265 | +//If User is soft deleted for this order |
|
| 265 | 266 | throw new \Exception('The user for this order is suspended from the system. Restore the user to renew.'); |
| 266 | 267 | } |
| 267 | 268 | $productid = $sub->product_id; |
@@ -128,7 +128,7 @@ |
||
| 128 | 128 | ]); |
| 129 | 129 | $this->createOrderInvoiceRelation($orderid, $invoice->id); |
| 130 | 130 | $items = $controller->createInvoiceItemsByAdmin($invoice->id, $product->id, |
| 131 | - $renewalPrice, $currency, $qty = 1, $agents, $planid, $user->id, $tax_name, $tax_rate, $renewalPrice); |
|
| 131 | + $renewalPrice, $currency, $qty = 1, $agents, $planid, $user->id, $tax_name, $tax_rate, $renewalPrice); |
|
| 132 | 132 | |
| 133 | 133 | return $items; |
| 134 | 134 | } catch (Exception $ex) { |
@@ -46,10 +46,10 @@ |
||
| 46 | 46 | $item = InvoiceItem::find($invoice_item_id); |
| 47 | 47 | $product = $this->getProductByName($item->product_name, $order); |
| 48 | 48 | $user = $this->getUserById($order->client); |
| 49 | - if (! $user) { |
|
| 49 | + if (!$user) { |
|
| 50 | 50 | throw new Exception('User has removed from database'); |
| 51 | 51 | } |
| 52 | - if (! $product) { |
|
| 52 | + if (!$product) { |
|
| 53 | 53 | throw new Exception('Product has removed from database'); |
| 54 | 54 | } |
| 55 | 55 | |
@@ -140,12 +140,12 @@ discard block |
||
| 140 | 140 | $query = $this->advanceSearch($name, $invoice_no, $currency, $status, $from, $till); |
| 141 | 141 | |
| 142 | 142 | return \DataTables::of($query->take(100)) |
| 143 | - ->setTotalRecords($query->count()) |
|
| 143 | + ->setTotalRecords($query->count()) |
|
| 144 | 144 | |
| 145 | - ->addColumn('checkbox', function ($model) { |
|
| 146 | - return "<input type='checkbox' class='invoice_checkbox' |
|
| 145 | + ->addColumn('checkbox', function ($model) { |
|
| 146 | + return "<input type='checkbox' class='invoice_checkbox' |
|
| 147 | 147 | value=".$model->id.' name=select[] id=check>'; |
| 148 | - }) |
|
| 148 | + }) |
|
| 149 | 149 | ->addColumn('user_id', function ($model) { |
| 150 | 150 | $user = $this->user->where('id', $model->user_id)->first() ?: User::onlyTrashed()->find($model->user_id); |
| 151 | 151 | |
@@ -155,19 +155,19 @@ discard block |
||
| 155 | 155 | |
| 156 | 156 | return '<a href='.url('clients/'.$id).'>'.ucfirst($first).' '.ucfirst($last).'</a>'; |
| 157 | 157 | }) |
| 158 | - ->addColumn('number', function ($model) { |
|
| 159 | - return ucfirst($model->number); |
|
| 160 | - }) |
|
| 158 | + ->addColumn('number', function ($model) { |
|
| 159 | + return ucfirst($model->number); |
|
| 160 | + }) |
|
| 161 | 161 | |
| 162 | 162 | ->addColumn('date', function ($model) { |
| 163 | 163 | return getDateHtml($model->created_at); |
| 164 | 164 | }) |
| 165 | - ->addColumn('grand_total', function ($model) { |
|
| 166 | - return currencyFormat($model->grand_total, $code = $model->currency); |
|
| 167 | - }) |
|
| 168 | - ->addColumn('status', function ($model) { |
|
| 169 | - return getStatusLabel($model->status); |
|
| 170 | - }) |
|
| 165 | + ->addColumn('grand_total', function ($model) { |
|
| 166 | + return currencyFormat($model->grand_total, $code = $model->currency); |
|
| 167 | + }) |
|
| 168 | + ->addColumn('status', function ($model) { |
|
| 169 | + return getStatusLabel($model->status); |
|
| 170 | + }) |
|
| 171 | 171 | |
| 172 | 172 | ->addColumn('action', function ($model) { |
| 173 | 173 | $action = ''; |
@@ -183,30 +183,30 @@ discard block |
||
| 183 | 183 | style='color:white;'> </i></a>" |
| 184 | 184 | ." $action"; |
| 185 | 185 | }) |
| 186 | - ->filterColumn('user_id', function ($query, $keyword) { |
|
| 187 | - $sql = 'first_name like ?'; |
|
| 188 | - $query->whereRaw($sql, ["%{$keyword}%"]); |
|
| 189 | - }) |
|
| 186 | + ->filterColumn('user_id', function ($query, $keyword) { |
|
| 187 | + $sql = 'first_name like ?'; |
|
| 188 | + $query->whereRaw($sql, ["%{$keyword}%"]); |
|
| 189 | + }) |
|
| 190 | 190 | |
| 191 | - ->filterColumn('status', function ($query, $keyword) { |
|
| 192 | - $sql = 'status like ?'; |
|
| 193 | - $query->whereRaw($sql, ["%{$keyword}%"]); |
|
| 194 | - }) |
|
| 191 | + ->filterColumn('status', function ($query, $keyword) { |
|
| 192 | + $sql = 'status like ?'; |
|
| 193 | + $query->whereRaw($sql, ["%{$keyword}%"]); |
|
| 194 | + }) |
|
| 195 | 195 | |
| 196 | 196 | ->filterColumn('number', function ($query, $keyword) { |
| 197 | 197 | $sql = 'number like ?'; |
| 198 | 198 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 199 | 199 | }) |
| 200 | - ->filterColumn('grand_total', function ($query, $keyword) { |
|
| 201 | - $sql = 'grand_total like ?'; |
|
| 202 | - $query->whereRaw($sql, ["%{$keyword}%"]); |
|
| 203 | - }) |
|
| 204 | - ->filterColumn('date', function ($query, $keyword) { |
|
| 205 | - $sql = 'date like ?'; |
|
| 206 | - $query->whereRaw($sql, ["%{$keyword}%"]); |
|
| 207 | - }) |
|
| 208 | - |
|
| 209 | - ->rawColumns(['checkbox', 'user_id', 'number', 'date', 'grand_total', 'status', 'action']) |
|
| 200 | + ->filterColumn('grand_total', function ($query, $keyword) { |
|
| 201 | + $sql = 'grand_total like ?'; |
|
| 202 | + $query->whereRaw($sql, ["%{$keyword}%"]); |
|
| 203 | + }) |
|
| 204 | + ->filterColumn('date', function ($query, $keyword) { |
|
| 205 | + $sql = 'date like ?'; |
|
| 206 | + $query->whereRaw($sql, ["%{$keyword}%"]); |
|
| 207 | + }) |
|
| 208 | + |
|
| 209 | + ->rawColumns(['checkbox', 'user_id', 'number', 'date', 'grand_total', 'status', 'action']) |
|
| 210 | 210 | ->make(true); |
| 211 | 211 | } |
| 212 | 212 | |
@@ -406,7 +406,7 @@ discard block |
||
| 406 | 406 | 'coupon_code' => $couponTotal['code'], 'discount'=>$couponTotal['value'], 'discount_mode' => $couponTotal['mode'], 'grand_total' => $grand_total, 'currency' => $currency, 'status' => $status, 'description' => $description, ]); |
| 407 | 407 | |
| 408 | 408 | $items = $this->createInvoiceItemsByAdmin($invoice->id, $productid, |
| 409 | - $total, $currency, $qty, $agents, $plan, $user_id, $tax['name'], $tax['value'], $grandTotalAfterCoupon); |
|
| 409 | + $total, $currency, $qty, $agents, $plan, $user_id, $tax['name'], $tax['value'], $grandTotalAfterCoupon); |
|
| 410 | 410 | $result = $this->getMessage($items, $user_id); |
| 411 | 411 | |
| 412 | 412 | return successResponse($result); |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | $from = $request->input('from'); |
| 120 | 120 | $till = $request->input('till'); |
| 121 | 121 | |
| 122 | - return view('themes.default1.invoice.index', compact('request','name','invoice_no','status','currencies','currency_id','from', |
|
| 122 | + return view('themes.default1.invoice.index', compact('request', 'name', 'invoice_no', 'status', 'currencies', 'currency_id', 'from', |
|
| 123 | 123 | |
| 124 | 124 | 'till')); |
| 125 | 125 | } catch (\Exception $ex) { |
@@ -142,11 +142,11 @@ discard block |
||
| 142 | 142 | return \DataTables::of($query->take(100)) |
| 143 | 143 | ->setTotalRecords($query->count()) |
| 144 | 144 | |
| 145 | - ->addColumn('checkbox', function ($model) { |
|
| 145 | + ->addColumn('checkbox', function($model) { |
|
| 146 | 146 | return "<input type='checkbox' class='invoice_checkbox' |
| 147 | 147 | value=".$model->id.' name=select[] id=check>'; |
| 148 | 148 | }) |
| 149 | - ->addColumn('user_id', function ($model) { |
|
| 149 | + ->addColumn('user_id', function($model) { |
|
| 150 | 150 | $user = $this->user->where('id', $model->user_id)->first() ?: User::onlyTrashed()->find($model->user_id); |
| 151 | 151 | |
| 152 | 152 | $id = $user->id; |
@@ -155,21 +155,21 @@ discard block |
||
| 155 | 155 | |
| 156 | 156 | return '<a href='.url('clients/'.$id).'>'.ucfirst($first).' '.ucfirst($last).'</a>'; |
| 157 | 157 | }) |
| 158 | - ->addColumn('number', function ($model) { |
|
| 158 | + ->addColumn('number', function($model) { |
|
| 159 | 159 | return ucfirst($model->number); |
| 160 | 160 | }) |
| 161 | 161 | |
| 162 | - ->addColumn('date', function ($model) { |
|
| 162 | + ->addColumn('date', function($model) { |
|
| 163 | 163 | return getDateHtml($model->created_at); |
| 164 | 164 | }) |
| 165 | - ->addColumn('grand_total', function ($model) { |
|
| 165 | + ->addColumn('grand_total', function($model) { |
|
| 166 | 166 | return currencyFormat($model->grand_total, $code = $model->currency); |
| 167 | 167 | }) |
| 168 | - ->addColumn('status', function ($model) { |
|
| 168 | + ->addColumn('status', function($model) { |
|
| 169 | 169 | return getStatusLabel($model->status); |
| 170 | 170 | }) |
| 171 | 171 | |
| 172 | - ->addColumn('action', function ($model) { |
|
| 172 | + ->addColumn('action', function($model) { |
|
| 173 | 173 | $action = ''; |
| 174 | 174 | |
| 175 | 175 | $check = $this->checkExecution($model->id); |
@@ -183,25 +183,25 @@ discard block |
||
| 183 | 183 | style='color:white;'> </i></a>" |
| 184 | 184 | ." $action"; |
| 185 | 185 | }) |
| 186 | - ->filterColumn('user_id', function ($query, $keyword) { |
|
| 186 | + ->filterColumn('user_id', function($query, $keyword) { |
|
| 187 | 187 | $sql = 'first_name like ?'; |
| 188 | 188 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 189 | 189 | }) |
| 190 | 190 | |
| 191 | - ->filterColumn('status', function ($query, $keyword) { |
|
| 191 | + ->filterColumn('status', function($query, $keyword) { |
|
| 192 | 192 | $sql = 'status like ?'; |
| 193 | 193 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 194 | 194 | }) |
| 195 | 195 | |
| 196 | - ->filterColumn('number', function ($query, $keyword) { |
|
| 196 | + ->filterColumn('number', function($query, $keyword) { |
|
| 197 | 197 | $sql = 'number like ?'; |
| 198 | 198 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 199 | 199 | }) |
| 200 | - ->filterColumn('grand_total', function ($query, $keyword) { |
|
| 200 | + ->filterColumn('grand_total', function($query, $keyword) { |
|
| 201 | 201 | $sql = 'grand_total like ?'; |
| 202 | 202 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 203 | 203 | }) |
| 204 | - ->filterColumn('date', function ($query, $keyword) { |
|
| 204 | + ->filterColumn('date', function($query, $keyword) { |
|
| 205 | 205 | $sql = 'date like ?'; |
| 206 | 206 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 207 | 207 | }) |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | $user = new User(); |
| 255 | 255 | if ($clientid) { |
| 256 | 256 | $user = $user->where('id', $clientid)->first(); |
| 257 | - if (! $user) { |
|
| 257 | + if (!$user) { |
|
| 258 | 258 | return redirect()->back()->with('fails', 'Invalid user'); |
| 259 | 259 | } |
| 260 | 260 | } else { |
@@ -396,14 +396,14 @@ discard block |
||
| 396 | 396 | |
| 397 | 397 | $couponTotal = $this->getGrandTotal($code, $total, $cost, $productid, $currency, $user_id); |
| 398 | 398 | $grandTotalAfterCoupon = $qty * $couponTotal['total']; |
| 399 | - if (! $grandTotalAfterCoupon) { |
|
| 399 | + if (!$grandTotalAfterCoupon) { |
|
| 400 | 400 | $status = 'success'; |
| 401 | 401 | } |
| 402 | 402 | $user = User::where('id', $user_id)->select('state', 'country')->first(); |
| 403 | 403 | $tax = $this->calculateTax($product->id, $user->state, $user->country, true); |
| 404 | 404 | $grand_total = rounding($this->calculateTotal($tax['value'], $grandTotalAfterCoupon)); |
| 405 | 405 | $invoice = Invoice::create(['user_id' => $user_id, 'number' => $number, 'date' => $date, |
| 406 | - 'coupon_code' => $couponTotal['code'], 'discount'=>$couponTotal['value'], 'discount_mode' => $couponTotal['mode'], 'grand_total' => $grand_total, 'currency' => $currency, 'status' => $status, 'description' => $description, ]); |
|
| 406 | + 'coupon_code' => $couponTotal['code'], 'discount'=>$couponTotal['value'], 'discount_mode' => $couponTotal['mode'], 'grand_total' => $grand_total, 'currency' => $currency, 'status' => $status, 'description' => $description, ]); |
|
| 407 | 407 | |
| 408 | 408 | $items = $this->createInvoiceItemsByAdmin($invoice->id, $productid, |
| 409 | 409 | $total, $currency, $qty, $agents, $plan, $user_id, $tax['name'], $tax['value'], $grandTotalAfterCoupon); |
@@ -480,11 +480,11 @@ discard block |
||
| 480 | 480 | { |
| 481 | 481 | try { |
| 482 | 482 | $id = $request->input('invoiceid'); |
| 483 | - if (! $id) { |
|
| 483 | + if (!$id) { |
|
| 484 | 484 | return redirect()->back()->with('fails', \Lang::get('message.no-invoice-id')); |
| 485 | 485 | } |
| 486 | 486 | $invoice = $this->invoice->where('id', $id)->first(); |
| 487 | - if (! $invoice) { |
|
| 487 | + if (!$invoice) { |
|
| 488 | 488 | return redirect()->back()->with('fails', \Lang::get('message.invalid-invoice-id')); |
| 489 | 489 | } |
| 490 | 490 | $invoiceItems = $this->invoiceItem->where('invoice_id', $id)->get(); |
@@ -492,7 +492,7 @@ discard block |
||
| 492 | 492 | return redirect()->back()->with('fails', \Lang::get('message.invalid-invoice-id')); |
| 493 | 493 | } |
| 494 | 494 | $user = $this->user->find($invoice->user_id); |
| 495 | - if (! $user) { |
|
| 495 | + if (!$user) { |
|
| 496 | 496 | return redirect()->back()->with('fails', 'No User'); |
| 497 | 497 | } |
| 498 | 498 | $order = $this->order->getOrderLink($invoice->orderRelation()->value('order_id'), 'my-order'); |