@@ -14,11 +14,11 @@ discard block |
||
| 14 | 14 | $invoices = $invoice->where('user_id', $id)->orderBy('created_at', 'desc')->get(); |
| 15 | 15 | |
| 16 | 16 | return\ DataTables::of($invoices) |
| 17 | - ->addColumn('checkbox', function ($model) { |
|
| 17 | + ->addColumn('checkbox', function($model) { |
|
| 18 | 18 | return "<input type='checkbox' class='invoice_checkbox' |
| 19 | 19 | value=".$model->id.' name=select[] id=check>'; |
| 20 | 20 | }) |
| 21 | - ->addColumn('date', function ($model) use ($client) { |
|
| 21 | + ->addColumn('date', function($model) use ($client) { |
|
| 22 | 22 | $date1 = new \DateTime($model->date); |
| 23 | 23 | // $tz = \Auth::user()->timezone()->first()->name; |
| 24 | 24 | // $date1->setTimezone(new \DateTimeZone($tz)); |
@@ -26,13 +26,13 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | return $date; |
| 28 | 28 | }) |
| 29 | - ->addColumn('invoice_no', function ($model) { |
|
| 29 | + ->addColumn('invoice_no', function($model) { |
|
| 30 | 30 | return '<a href='.url('invoices/show?invoiceid='.$model->id).'>'.$model->number.'</a>'; |
| 31 | 31 | }) |
| 32 | - ->addColumn('total', function ($model) use ($client) { |
|
| 32 | + ->addColumn('total', function($model) use ($client) { |
|
| 33 | 33 | return currency_format($model->grand_total, $code = $client->currency); |
| 34 | 34 | }) |
| 35 | - ->addColumn('paid', function ($model) use ($client) { |
|
| 35 | + ->addColumn('paid', function($model) use ($client) { |
|
| 36 | 36 | $payment = \App\Model\Order\Payment::where('invoice_id', $model->id)->select('amount')->get(); |
| 37 | 37 | $c = count($payment); |
| 38 | 38 | $sum = 0; |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | return currency_format($sum, $code = $client->currency); |
| 45 | 45 | }) |
| 46 | - ->addColumn('balance', function ($model) use ($client) { |
|
| 46 | + ->addColumn('balance', function($model) use ($client) { |
|
| 47 | 47 | $payment = \App\Model\Order\Payment::where('invoice_id', $model->id)->select('amount')->get(); |
| 48 | 48 | $c = count($payment); |
| 49 | 49 | $sum = 0; |
@@ -55,10 +55,10 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | return currency_format($pendingAmount, $code = $client->currency); |
| 57 | 57 | }) |
| 58 | - ->addColumn('status', function ($model) { |
|
| 58 | + ->addColumn('status', function($model) { |
|
| 59 | 59 | return $model->status; |
| 60 | 60 | }) |
| 61 | - ->addColumn('action', function ($model) { |
|
| 61 | + ->addColumn('action', function($model) { |
|
| 62 | 62 | $action = ''; |
| 63 | 63 | $cont = new \App\Http\Controllers\Order\TaxRatesAndCodeExpiryController(); |
| 64 | 64 | $check = $cont->checkExecution($model->id); |
@@ -88,35 +88,35 @@ discard block |
||
| 88 | 88 | $order = $client->order()->orderBy('created_at', 'desc')->get(); |
| 89 | 89 | |
| 90 | 90 | return\ DataTables::of($order) |
| 91 | - ->addColumn('checkbox', function ($model) { |
|
| 91 | + ->addColumn('checkbox', function($model) { |
|
| 92 | 92 | return "<input type='checkbox' class='order_checkbox' |
| 93 | 93 | value=".$model->id.' name=select[] id=checkorder>'; |
| 94 | 94 | }) |
| 95 | - ->addColumn('date', function ($model) { |
|
| 95 | + ->addColumn('date', function($model) { |
|
| 96 | 96 | return ucfirst($model->created_at); |
| 97 | 97 | }) |
| 98 | - ->addColumn('product', function ($model) { |
|
| 98 | + ->addColumn('product', function($model) { |
|
| 99 | 99 | $productName = $model->product()->first() && $model->product()->first()->name ? |
| 100 | 100 | $model->product()->first()->name : 'Unknown'; |
| 101 | 101 | |
| 102 | 102 | return $productName; |
| 103 | 103 | }) |
| 104 | - ->addColumn('number', function ($model) { |
|
| 104 | + ->addColumn('number', function($model) { |
|
| 105 | 105 | $number = $model->number; |
| 106 | 106 | |
| 107 | 107 | return $number; |
| 108 | 108 | }) |
| 109 | - ->addColumn('total', function ($model) use ($client) { |
|
| 109 | + ->addColumn('total', function($model) use ($client) { |
|
| 110 | 110 | $price = currency_format($model->price_override, $code = $client->currency); |
| 111 | 111 | |
| 112 | 112 | return $price; |
| 113 | 113 | }) |
| 114 | - ->addColumn('status', function ($model) { |
|
| 114 | + ->addColumn('status', function($model) { |
|
| 115 | 115 | $status = $model->order_status; |
| 116 | 116 | |
| 117 | 117 | return $status; |
| 118 | 118 | }) |
| 119 | - ->addColumn('action', function ($model) { |
|
| 119 | + ->addColumn('action', function($model) { |
|
| 120 | 120 | return '<a href='.url('orders/'.$model->id)." |
| 121 | 121 | class='btn btn-sm btn-primary btn-xs'><i class='fa fa-eye' |
| 122 | 122 | style='color:white;'> </i> View</a>"; |
@@ -133,25 +133,25 @@ discard block |
||
| 133 | 133 | $extraAmt = $this->getExtraAmtPaid($id); |
| 134 | 134 | |
| 135 | 135 | return\ DataTables::of($payments) |
| 136 | - ->addColumn('checkbox', function ($model) { |
|
| 136 | + ->addColumn('checkbox', function($model) { |
|
| 137 | 137 | return "<input type='checkbox' class='payment_checkbox' |
| 138 | 138 | value=".$model->id.' name=select[] id=checkpayment>'; |
| 139 | 139 | }) |
| 140 | - ->addColumn('invoice_no', function ($model) { |
|
| 140 | + ->addColumn('invoice_no', function($model) { |
|
| 141 | 141 | return $model->invoice()->first() ? $model->invoice()->first()->number : '--'; |
| 142 | 142 | }) |
| 143 | - ->addColumn('date', function ($model) { |
|
| 143 | + ->addColumn('date', function($model) { |
|
| 144 | 144 | $date = $model->created_at; |
| 145 | 145 | $date1 = new \DateTime($date); |
| 146 | 146 | $date = $date1->format('M j, Y, g:i a '); |
| 147 | 147 | |
| 148 | 148 | return $date; |
| 149 | 149 | }) |
| 150 | - ->addColumn('payment_method', function ($model) { |
|
| 150 | + ->addColumn('payment_method', function($model) { |
|
| 151 | 151 | return $model->payment_method; |
| 152 | 152 | }) |
| 153 | 153 | |
| 154 | - ->addColumn('total', function ($model) use ($client, $extraAmt) { |
|
| 154 | + ->addColumn('total', function($model) use ($client, $extraAmt) { |
|
| 155 | 155 | if ($model->invoice_id == 0) { |
| 156 | 156 | $amount = currency_format($extraAmt, $code = $client->currency); |
| 157 | 157 | } else { |
@@ -160,11 +160,11 @@ discard block |
||
| 160 | 160 | |
| 161 | 161 | return $amount; |
| 162 | 162 | }) |
| 163 | - ->addColumn('status', function ($model) { |
|
| 163 | + ->addColumn('status', function($model) { |
|
| 164 | 164 | return ucfirst($model->payment_status); |
| 165 | 165 | }) |
| 166 | 166 | |
| 167 | - ->addColumn('action', function ($model) { |
|
| 167 | + ->addColumn('action', function($model) { |
|
| 168 | 168 | '<input type="hidden" class="paymentid" value="{{$model->id}}">'; |
| 169 | 169 | if ($model->invoice_id == 0) { |
| 170 | 170 | return '<a href='.url('payments/'.$model->id.'/edit/')." class='btn btn-sm btn-primary btn-xs'> <i class='fa fa-edit' style='color:white;'> </i> Edit</a>"; |
@@ -82,8 +82,8 @@ discard block |
||
| 82 | 82 | $status = $view['status']; |
| 83 | 83 | $message = $view['message']; |
| 84 | 84 | \Session::forget('items'); |
| 85 | - \Session::forget('code'); |
|
| 86 | - \Session::forget('codevalue'); |
|
| 85 | + \Session::forget('code'); |
|
| 86 | + \Session::forget('codevalue'); |
|
| 87 | 87 | } else { |
| 88 | 88 | //Afer Renew |
| 89 | 89 | $control->successRenew($invoice); |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | return redirect()->back()->with($status, $message); |
| 99 | 99 | } catch (\Exception $ex) { |
| 100 | - throw new \Exception($ex->getMessage(), $ex->getCode(), $ex->getPrevious()); |
|
| 100 | + throw new \Exception($ex->getMessage(), $ex->getCode(), $ex->getPrevious()); |
|
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | } |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | \Cart::clear(); |
| 129 | 129 | $status = 'success'; |
| 130 | 130 | $message = view('themes.default1.front.postPaymentTemplate', compact('invoice','date','orders', |
| 131 | - 'invoiceItems', 'state', 'currency'))->render(); |
|
| 131 | + 'invoiceItems', 'state', 'currency'))->render(); |
|
| 132 | 132 | |
| 133 | 133 | return ['status'=>$status, 'message'=>$message]; |
| 134 | 134 | } |
@@ -41,15 +41,15 @@ discard block |
||
| 41 | 41 | return $model->file; |
| 42 | 42 | }) |
| 43 | 43 | ->addColumn('action', function ($model) { |
| 44 | - return "<p><button data-toggle='modal' |
|
| 44 | + return "<p><button data-toggle='modal' |
|
| 45 | 45 | data-id=".$model->id." data-title='$model->title' data-description='$model->description' data-version='$model->version'data-file='$model->file' |
| 46 | 46 | class='btn btn-sm btn-primary btn-xs editUploadsOption'><i class='fa fa-edit' |
| 47 | 47 | style='color:white;'> </i> Edit</button> </p>"; |
| 48 | 48 | |
| 49 | - // return '<a href='.('#edit-upload-option/'.$model->id).' |
|
| 50 | - // class=" btn btn-sm btn-primary editupload" data-title="'.$model->title.'" |
|
| 51 | - // data-description="'.$model->description.'" data-version="' |
|
| 52 | - // .$model->version.'" data-id="'.$model->id.'" data-file="'.$model->file.'"onclick="openEditPopup(this)" >Edit</a>'; |
|
| 49 | + // return '<a href='.('#edit-upload-option/'.$model->id).' |
|
| 50 | + // class=" btn btn-sm btn-primary editupload" data-title="'.$model->title.'" |
|
| 51 | + // data-description="'.$model->description.'" data-version="' |
|
| 52 | + // .$model->version.'" data-id="'.$model->id.'" data-file="'.$model->file.'"onclick="openEditPopup(this)" >Edit</a>'; |
|
| 53 | 53 | }) |
| 54 | 54 | ->rawcolumns(['checkbox', 'product_id', 'title', 'description', 'version', 'file', 'action']) |
| 55 | 55 | ->make(true); |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | if ($product->require_domain == 1) { |
| 112 | 112 | $field .= "<div class='col-md-4 form-group'> |
| 113 | 113 | <label class='required'>"./* @scrutinizer ignore-type */ |
| 114 | - \Lang::get('message.domain')."</label> |
|
| 114 | + \Lang::get('message.domain')."</label> |
|
| 115 | 115 | <input type='text' name='domain' class='form-control' |
| 116 | 116 | id='domain' placeholder='http://example.com'> |
| 117 | 117 | </div>"; |
@@ -19,28 +19,28 @@ discard block |
||
| 19 | 19 | ->get(); |
| 20 | 20 | |
| 21 | 21 | return \DataTables::of($new_upload) |
| 22 | - ->addColumn('checkbox', function ($model) { |
|
| 22 | + ->addColumn('checkbox', function($model) { |
|
| 23 | 23 | return "<input type='checkbox' class='upload_checkbox' value=".$model->id.' name=select[] id=checks>'; |
| 24 | 24 | }) |
| 25 | 25 | |
| 26 | - ->addColumn('product_id', function ($model) { |
|
| 26 | + ->addColumn('product_id', function($model) { |
|
| 27 | 27 | return ucfirst($this->product->where('id', $model->product_id)->first()->name); |
| 28 | 28 | }) |
| 29 | 29 | |
| 30 | - ->addColumn('title', function ($model) { |
|
| 30 | + ->addColumn('title', function($model) { |
|
| 31 | 31 | return ucfirst($model->title); |
| 32 | 32 | }) |
| 33 | - ->addColumn('description', function ($model) { |
|
| 33 | + ->addColumn('description', function($model) { |
|
| 34 | 34 | return ucfirst($model->description); |
| 35 | 35 | }) |
| 36 | - ->addColumn('version', function ($model) { |
|
| 36 | + ->addColumn('version', function($model) { |
|
| 37 | 37 | return $model->version; |
| 38 | 38 | }) |
| 39 | 39 | |
| 40 | - ->addColumn('file', function ($model) { |
|
| 40 | + ->addColumn('file', function($model) { |
|
| 41 | 41 | return $model->file; |
| 42 | 42 | }) |
| 43 | - ->addColumn('action', function ($model) { |
|
| 43 | + ->addColumn('action', function($model) { |
|
| 44 | 44 | return "<p><button data-toggle='modal' |
| 45 | 45 | data-id=".$model->id." data-title='$model->title' data-description='$model->description' data-version='$model->version'data-file='$model->file' |
| 46 | 46 | class='btn btn-sm btn-primary btn-xs editUploadsOption'><i class='fa fa-edit' |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | try { |
| 67 | 67 | $file_upload = ProductUpload::find($id); |
| 68 | - $file_upload->where('id',$id)->update(['title'=>$request->input('producttitle'), 'description'=>$request->input('description'), 'version'=> $request->input('version')]); |
|
| 68 | + $file_upload->where('id', $id)->update(['title'=>$request->input('producttitle'), 'description'=>$request->input('description'), 'version'=> $request->input('version')]); |
|
| 69 | 69 | $autoUpdateStatus = StatusSetting::pluck('update_settings')->first(); |
| 70 | 70 | if ($autoUpdateStatus == 1) { //If License Setting Status is on,Add Product to the AutoUpdate Script |
| 71 | 71 | $productSku = $file_upload->product->product_sku; |
@@ -67,7 +67,8 @@ |
||
| 67 | 67 | $file_upload = ProductUpload::find($id); |
| 68 | 68 | $file_upload->where('id',$id)->update(['title'=>$request->input('producttitle'), 'description'=>$request->input('description'), 'version'=> $request->input('version')]); |
| 69 | 69 | $autoUpdateStatus = StatusSetting::pluck('update_settings')->first(); |
| 70 | - if ($autoUpdateStatus == 1) { //If License Setting Status is on,Add Product to the AutoUpdate Script |
|
| 70 | + if ($autoUpdateStatus == 1) { |
|
| 71 | +//If License Setting Status is on,Add Product to the AutoUpdate Script |
|
| 71 | 72 | $productSku = $file_upload->product->product_sku; |
| 72 | 73 | $updateClassObj = new \App\Http\Controllers\AutoUpdate\AutoUpdateController(); |
| 73 | 74 | $addProductToAutoUpdate = $updateClassObj->editVersion($request->input('version'), $productSku); |
@@ -188,7 +188,7 @@ |
||
| 188 | 188 | |
| 189 | 189 | public function postCheckout(Request $request) |
| 190 | 190 | { |
| 191 | - $this->validate($request,[ |
|
| 191 | + $this->validate($request, [ |
|
| 192 | 192 | 'payment_gateway'=>'required', |
| 193 | 193 | ]); |
| 194 | 194 | $invoice_controller = new \App\Http\Controllers\Order\InvoiceController(); |
@@ -130,12 +130,12 @@ discard block |
||
| 130 | 130 | $query = $this->advanceSearch($name, $invoice_no, $currency, $status, $from, $till); |
| 131 | 131 | |
| 132 | 132 | return \DataTables::of($query->take(100)) |
| 133 | - ->setTotalRecords($query->count()) |
|
| 133 | + ->setTotalRecords($query->count()) |
|
| 134 | 134 | |
| 135 | - ->addColumn('checkbox', function ($model) { |
|
| 136 | - return "<input type='checkbox' class='invoice_checkbox' |
|
| 135 | + ->addColumn('checkbox', function ($model) { |
|
| 136 | + return "<input type='checkbox' class='invoice_checkbox' |
|
| 137 | 137 | value=".$model->id.' name=select[] id=check>'; |
| 138 | - }) |
|
| 138 | + }) |
|
| 139 | 139 | ->addColumn('user_id', function ($model) { |
| 140 | 140 | $first = $this->user->where('id', $model->user_id)->first()->first_name; |
| 141 | 141 | $last = $this->user->where('id', $model->user_id)->first()->last_name; |
@@ -143,9 +143,9 @@ discard block |
||
| 143 | 143 | |
| 144 | 144 | return '<a href='.url('clients/'.$id).'>'.ucfirst($first).' '.ucfirst($last).'</a>'; |
| 145 | 145 | }) |
| 146 | - ->addColumn('number', function ($model) { |
|
| 147 | - return ucfirst($model->number); |
|
| 148 | - }) |
|
| 146 | + ->addColumn('number', function ($model) { |
|
| 147 | + return ucfirst($model->number); |
|
| 148 | + }) |
|
| 149 | 149 | |
| 150 | 150 | ->addColumn('date', function ($model) { |
| 151 | 151 | $date = ($model->created_at); |
@@ -153,12 +153,12 @@ discard block |
||
| 153 | 153 | return $date; |
| 154 | 154 | // return "<span style='display:none'>$model->id</span>".$date->format('l, F j, Y H:m'); |
| 155 | 155 | }) |
| 156 | - ->addColumn('grand_total', function ($model) { |
|
| 157 | - return $model->grand_total; |
|
| 158 | - }) |
|
| 159 | - ->addColumn('status', function ($model) { |
|
| 160 | - return ucfirst($model->status); |
|
| 161 | - }) |
|
| 156 | + ->addColumn('grand_total', function ($model) { |
|
| 157 | + return $model->grand_total; |
|
| 158 | + }) |
|
| 159 | + ->addColumn('status', function ($model) { |
|
| 160 | + return ucfirst($model->status); |
|
| 161 | + }) |
|
| 162 | 162 | |
| 163 | 163 | ->addColumn('action', function ($model) { |
| 164 | 164 | $action = ''; |
@@ -176,30 +176,30 @@ discard block |
||
| 176 | 176 | style='color:white;'> </i> View</a>" |
| 177 | 177 | ." $action"; |
| 178 | 178 | }) |
| 179 | - ->filterColumn('user_id', function ($query, $keyword) { |
|
| 180 | - $sql = 'first_name like ?'; |
|
| 181 | - $query->whereRaw($sql, ["%{$keyword}%"]); |
|
| 182 | - }) |
|
| 179 | + ->filterColumn('user_id', function ($query, $keyword) { |
|
| 180 | + $sql = 'first_name like ?'; |
|
| 181 | + $query->whereRaw($sql, ["%{$keyword}%"]); |
|
| 182 | + }) |
|
| 183 | 183 | |
| 184 | - ->filterColumn('status', function ($query, $keyword) { |
|
| 185 | - $sql = 'status like ?'; |
|
| 186 | - $query->whereRaw($sql, ["%{$keyword}%"]); |
|
| 187 | - }) |
|
| 184 | + ->filterColumn('status', function ($query, $keyword) { |
|
| 185 | + $sql = 'status like ?'; |
|
| 186 | + $query->whereRaw($sql, ["%{$keyword}%"]); |
|
| 187 | + }) |
|
| 188 | 188 | |
| 189 | 189 | ->filterColumn('number', function ($query, $keyword) { |
| 190 | 190 | $sql = 'number like ?'; |
| 191 | 191 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 192 | 192 | }) |
| 193 | - ->filterColumn('grand_total', function ($query, $keyword) { |
|
| 194 | - $sql = 'grand_total like ?'; |
|
| 195 | - $query->whereRaw($sql, ["%{$keyword}%"]); |
|
| 196 | - }) |
|
| 197 | - ->filterColumn('date', function ($query, $keyword) { |
|
| 198 | - $sql = 'date like ?'; |
|
| 199 | - $query->whereRaw($sql, ["%{$keyword}%"]); |
|
| 200 | - }) |
|
| 201 | - |
|
| 202 | - ->rawColumns(['checkbox', 'user_id', 'number', 'date', 'grand_total', 'status', 'action']) |
|
| 193 | + ->filterColumn('grand_total', function ($query, $keyword) { |
|
| 194 | + $sql = 'grand_total like ?'; |
|
| 195 | + $query->whereRaw($sql, ["%{$keyword}%"]); |
|
| 196 | + }) |
|
| 197 | + ->filterColumn('date', function ($query, $keyword) { |
|
| 198 | + $sql = 'date like ?'; |
|
| 199 | + $query->whereRaw($sql, ["%{$keyword}%"]); |
|
| 200 | + }) |
|
| 201 | + |
|
| 202 | + ->rawColumns(['checkbox', 'user_id', 'number', 'date', 'grand_total', 'status', 'action']) |
|
| 203 | 203 | ->make(true); |
| 204 | 204 | } |
| 205 | 205 | |
@@ -294,8 +294,8 @@ discard block |
||
| 294 | 294 | |
| 295 | 295 | $symbol = $attributes[0]['currency']['symbol']; |
| 296 | 296 | $invoice = $this->invoice->create(['user_id' => $user_id, 'number' => $number, |
| 297 | - 'date' => $date, 'discount'=>$codevalue, 'grand_total' => $grand_total, 'coupon_code'=>$code, 'status' => 'pending', |
|
| 298 | - 'currency' => \Auth::user()->currency, ]); |
|
| 297 | + 'date' => $date, 'discount'=>$codevalue, 'grand_total' => $grand_total, 'coupon_code'=>$code, 'status' => 'pending', |
|
| 298 | + 'currency' => \Auth::user()->currency, ]); |
|
| 299 | 299 | foreach (\Cart::getContent() as $cart) { |
| 300 | 300 | $this->createInvoiceItems($invoice->id, $cart, $codevalue); |
| 301 | 301 | } |
@@ -415,11 +415,11 @@ discard block |
||
| 415 | 415 | $grand_total = \App\Http\Controllers\Front\CartController::rounding($grand_total); |
| 416 | 416 | |
| 417 | 417 | $invoice = Invoice::create(['user_id' => $user_id, 'number' => $number, 'date' => $date, |
| 418 | - 'coupon_code' => $code, 'discount'=>$codeValue, |
|
| 418 | + 'coupon_code' => $code, 'discount'=>$codeValue, |
|
| 419 | 419 | 'grand_total' => $grand_total, 'currency' => $currency, 'status' => $status, 'description' => $description, ]); |
| 420 | 420 | |
| 421 | 421 | $items = $this->createInvoiceItemsByAdmin($invoice->id, $productid, |
| 422 | - $code, $total, $currency, $qty, $agents, $plan, $user_id, $tax_name, $tax_rate); |
|
| 422 | + $code, $total, $currency, $qty, $agents, $plan, $user_id, $tax_name, $tax_rate); |
|
| 423 | 423 | $result = $this->getMessage($items, $user_id); |
| 424 | 424 | } catch (\Exception $ex) { |
| 425 | 425 | app('log')->info($ex->getMessage()); |
@@ -491,13 +491,13 @@ discard block |
||
| 491 | 491 | $cartController = new CartController(); |
| 492 | 492 | if ($this->tax_option->findOrFail(1)->inclusive == 0) { |
| 493 | 493 | $tax_class_id = TaxProductRelation::where('product_id', $productid)->pluck('tax_class_id')->toArray(); |
| 494 | - if (count($tax_class_id) > 0) { |
|
| 494 | + if (count($tax_class_id) > 0) { |
|
| 495 | 495 | if ($this->tax_option->findOrFail(1)->tax_enable == 1) { |
| 496 | 496 | $taxs = $this->getTaxWhenEnable($productid, $taxs[0], $userid); |
| 497 | 497 | } elseif ($this->tax_option->tax_enable == 0) {//if tax_enable is 0 |
| 498 | 498 | |
| 499 | 499 | $taxClassId = Tax::where('country', '')->where('state', 'Any State') |
| 500 | - ->pluck('tax_classes_id')->first(); //In case of India when |
|
| 500 | + ->pluck('tax_classes_id')->first(); //In case of India when |
|
| 501 | 501 | //other tax is available and tax is not enabled |
| 502 | 502 | if ($taxClassId) { |
| 503 | 503 | $rate = $this->getTotalRate($taxClassId, $productid, $taxs); |
@@ -566,10 +566,10 @@ discard block |
||
| 566 | 566 | foreach ($taxes as $key => $tax) { |
| 567 | 567 | if ($taxes[0]) { |
| 568 | 568 | $tax_attribute[$key] = ['name' => $tax->name, 'name1' => $name1, |
| 569 | - 'name2' => $name2, 'name3' => $name3, 'name4' => $name4, |
|
| 570 | - 'rate' => $value, 'rate1'=>$c_gst, 'rate2'=>$s_gst, |
|
| 571 | - 'rate3' => $i_gst, 'rate4'=>$ut_gst, 'state'=>$state_code, |
|
| 572 | - 'origin_state' => $origin_state, ]; |
|
| 569 | + 'name2' => $name2, 'name3' => $name3, 'name4' => $name4, |
|
| 570 | + 'rate' => $value, 'rate1'=>$c_gst, 'rate2'=>$s_gst, |
|
| 571 | + 'rate3' => $i_gst, 'rate4'=>$ut_gst, 'state'=>$state_code, |
|
| 572 | + 'origin_state' => $origin_state, ]; |
|
| 573 | 573 | |
| 574 | 574 | $rate = $tax->rate; |
| 575 | 575 | |
@@ -494,7 +494,8 @@ discard block |
||
| 494 | 494 | if (count($tax_class_id) > 0) { |
| 495 | 495 | if ($this->tax_option->findOrFail(1)->tax_enable == 1) { |
| 496 | 496 | $taxs = $this->getTaxWhenEnable($productid, $taxs[0], $userid); |
| 497 | - } elseif ($this->tax_option->tax_enable == 0) {//if tax_enable is 0 |
|
| 497 | + } elseif ($this->tax_option->tax_enable == 0) { |
|
| 498 | +//if tax_enable is 0 |
|
| 498 | 499 | |
| 499 | 500 | $taxClassId = Tax::where('country', '')->where('state', 'Any State') |
| 500 | 501 | ->pluck('tax_classes_id')->first(); //In case of India when |
@@ -503,13 +504,15 @@ discard block |
||
| 503 | 504 | $rate = $this->getTotalRate($taxClassId, $productid, $taxs); |
| 504 | 505 | $taxs = $rate['taxes']; |
| 505 | 506 | $rate = $rate['rate']; |
| 506 | - } elseif ($geoip_country != 'IN') {//In case of other country |
|
| 507 | + } elseif ($geoip_country != 'IN') { |
|
| 508 | +//In case of other country |
|
| 507 | 509 | // when tax is available and tax is not enabled(Applicable |
| 508 | 510 | //when Global Tax class for any country and state is not there) |
| 509 | 511 | |
| 510 | 512 | $taxClassId = Tax::where('state', $geoip_state) |
| 511 | 513 | ->orWhere('country', $geoip_country)->pluck('tax_classes_id')->first(); |
| 512 | - if ($taxClassId) { //if state equals the user State |
|
| 514 | + if ($taxClassId) { |
|
| 515 | +//if state equals the user State |
|
| 513 | 516 | $rate = $this->getTotalRate($taxClassId, $productid, $taxs); |
| 514 | 517 | $taxs = $rate['taxes']; |
| 515 | 518 | $rate = $rate['rate']; |
@@ -552,11 +555,13 @@ discard block |
||
| 552 | 555 | $i_gst = 0; |
| 553 | 556 | $ut_gst = 0; |
| 554 | 557 | $state_code = ''; |
| 555 | - if ($user_state != '') {//Get the CGST,SGST,IGST,STATE_CODE of the user |
|
| 558 | + if ($user_state != '') { |
|
| 559 | +//Get the CGST,SGST,IGST,STATE_CODE of the user |
|
| 556 | 560 | $tax = $this->getTaxWhenState($user_state, $productid, $origin_state); |
| 557 | 561 | $taxes = $tax['taxes']; |
| 558 | 562 | $value = $tax['value']; |
| 559 | - } else {//If user from other Country |
|
| 563 | + } else { |
|
| 564 | +//If user from other Country |
|
| 560 | 565 | $tax = $this->getTaxWhenOtherCountry($geoip_state, $geoip_country, $productid); |
| 561 | 566 | $taxes = $tax['taxes']; |
| 562 | 567 | $value = $tax['value']; |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | $sub->update_ends_at = $updatesExpiry; |
| 66 | 66 | $sub->support_ends_at = $supportExpiry; |
| 67 | 67 | $sub->save(); |
| 68 | - $licenseStatus = StatusSetting::pluck('license_status')->first(); |
|
| 68 | + $licenseStatus = StatusSetting::pluck('license_status')->first(); |
|
| 69 | 69 | if ($licenseStatus == 1) { |
| 70 | 70 | $this->editDateInAPL($sub, $updatesExpiry, $licenseExpiry, $supportExpiry); |
| 71 | 71 | } |
@@ -263,7 +263,7 @@ |
||
| 263 | 263 | $productid = $sub->product_id; |
| 264 | 264 | $plans = $this->plan->pluck('name', 'id')->toArray(); |
| 265 | 265 | |
| 266 | - return view('themes.default1.renew.renew', compact('id','productid', 'plans', 'userid')); |
|
| 266 | + return view('themes.default1.renew.renew', compact('id', 'productid', 'plans', 'userid')); |
|
| 267 | 267 | } catch (Exception $ex) { |
| 268 | 268 | return redirect()->back()->with('fails', $ex->getMessage()); |
| 269 | 269 | } |
@@ -123,7 +123,7 @@ |
||
| 123 | 123 | ]); |
| 124 | 124 | $this->createOrderInvoiceRelation($orderid, $invoice->id); |
| 125 | 125 | $items = $controller->createInvoiceItemsByAdmin($invoice->id, $product->id, |
| 126 | - $code, $renewalPrice, $currency, $qty = 1, $agents); |
|
| 126 | + $code, $renewalPrice, $currency, $qty = 1, $agents); |
|
| 127 | 127 | |
| 128 | 128 | return $items; |
| 129 | 129 | } catch (Exception $ex) { |
@@ -108,7 +108,7 @@ |
||
| 108 | 108 | if ($code != '') { |
| 109 | 109 | $product_cost = $controller->checkCode($code, $product->id, $currency); |
| 110 | 110 | } |
| 111 | - $renewalPrice = $cost;//Get Renewal Price before calculating tax over it to save as regular price of product |
|
| 111 | + $renewalPrice = $cost; //Get Renewal Price before calculating tax over it to save as regular price of product |
|
| 112 | 112 | $cost = $this->tax($product, $renewalPrice, $user->id); |
| 113 | 113 | $currency = $this->getUserCurrencyById($user->id); |
| 114 | 114 | $number = rand(11111111, 99999999); |
@@ -105,16 +105,16 @@ discard block |
||
| 105 | 105 | |
| 106 | 106 | return \DataTables::of($query->take(50)) |
| 107 | 107 | ->setTotalRecords($query->count()) |
| 108 | - ->addColumn('checkbox', function ($model) { |
|
| 108 | + ->addColumn('checkbox', function($model) { |
|
| 109 | 109 | return "<input type='checkbox' class='order_checkbox' value=". |
| 110 | 110 | $model->id.' name=select[] id=check>'; |
| 111 | 111 | }) |
| 112 | - ->addColumn('date', function ($model) { |
|
| 112 | + ->addColumn('date', function($model) { |
|
| 113 | 113 | $date = $model->created_at; |
| 114 | 114 | |
| 115 | 115 | return "<span style='display:none'>$model->id</span>".$date; |
| 116 | 116 | }) |
| 117 | - ->addColumn('client', function ($model) { |
|
| 117 | + ->addColumn('client', function($model) { |
|
| 118 | 118 | $user = $this->user->where('id', $model->client)->first(); |
| 119 | 119 | $first = $user->first_name; |
| 120 | 120 | $last = $user->last_name; |
@@ -122,59 +122,59 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | return '<a href='.url('clients/'.$id).'>'.ucfirst($first).' '.ucfirst($last).'<a>'; |
| 124 | 124 | }) |
| 125 | - ->addColumn('productname', function ($model) { |
|
| 125 | + ->addColumn('productname', function($model) { |
|
| 126 | 126 | $productid = ($model->product); |
| 127 | 127 | $productName = Product::where('id', $productid)->pluck('name')->first(); |
| 128 | 128 | |
| 129 | 129 | return $productName; |
| 130 | 130 | }) |
| 131 | - ->addColumn('number', function ($model) { |
|
| 131 | + ->addColumn('number', function($model) { |
|
| 132 | 132 | return ucfirst($model->number); |
| 133 | 133 | }) |
| 134 | - ->addColumn('price_override', function ($model) { |
|
| 134 | + ->addColumn('price_override', function($model) { |
|
| 135 | 135 | $currency = $model->user()->find($model->client)->currency; |
| 136 | - return currency_format($model->price_override,$code = $currency); |
|
| 136 | + return currency_format($model->price_override, $code = $currency); |
|
| 137 | 137 | }) |
| 138 | - ->addColumn('order_status', function ($model) { |
|
| 138 | + ->addColumn('order_status', function($model) { |
|
| 139 | 139 | return ucfirst($model->order_status); |
| 140 | 140 | }) |
| 141 | 141 | // ->showColumns('number', 'price_override', 'order_status') |
| 142 | - ->addColumn('update_ends_at', function ($model) { |
|
| 142 | + ->addColumn('update_ends_at', function($model) { |
|
| 143 | 143 | $end = $this->getEndDate($model); |
| 144 | 144 | |
| 145 | 145 | return $end; |
| 146 | 146 | }) |
| 147 | - ->addColumn('action', function ($model) { |
|
| 147 | + ->addColumn('action', function($model) { |
|
| 148 | 148 | $sub = $model->subscription()->first(); |
| 149 | 149 | $status = $this->checkInvoiceStatusByOrderId($model->id); |
| 150 | 150 | $url = $this->getUrl($model, $status, $sub); |
| 151 | 151 | return $url; |
| 152 | 152 | }) |
| 153 | 153 | |
| 154 | - ->filterColumn('created_at', function ($query, $keyword) { |
|
| 154 | + ->filterColumn('created_at', function($query, $keyword) { |
|
| 155 | 155 | $sql = 'created_at like ?'; |
| 156 | 156 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 157 | 157 | }) |
| 158 | 158 | |
| 159 | - ->filterColumn('client', function ($query, $keyword) { |
|
| 159 | + ->filterColumn('client', function($query, $keyword) { |
|
| 160 | 160 | $sql = 'client like ?'; |
| 161 | 161 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 162 | 162 | }) |
| 163 | 163 | |
| 164 | - ->filterColumn('number', function ($query, $keyword) { |
|
| 164 | + ->filterColumn('number', function($query, $keyword) { |
|
| 165 | 165 | $sql = 'number like ?'; |
| 166 | 166 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 167 | 167 | }) |
| 168 | - ->filterColumn('price_override', function ($query, $keyword) { |
|
| 168 | + ->filterColumn('price_override', function($query, $keyword) { |
|
| 169 | 169 | $sql = 'price_override like ?'; |
| 170 | 170 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 171 | 171 | }) |
| 172 | - ->filterColumn('order_status', function ($query, $keyword) { |
|
| 172 | + ->filterColumn('order_status', function($query, $keyword) { |
|
| 173 | 173 | $sql = 'order_status like ?'; |
| 174 | 174 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 175 | 175 | }) |
| 176 | 176 | |
| 177 | - ->filterColumn('update_ends_at', function ($query, $keyword) { |
|
| 177 | + ->filterColumn('update_ends_at', function($query, $keyword) { |
|
| 178 | 178 | $sql = 'update_ends_at like ?'; |
| 179 | 179 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 180 | 180 | }) |