@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | try { |
| 130 | 130 | $versions = ProductUpload::where('product_id', $productid) |
| 131 | 131 | ->select('id', 'product_id', 'version', |
| 132 | - 'title', 'description', 'file', 'created_at')->get(); |
|
| 132 | + 'title', 'description', 'file', 'created_at')->get(); |
|
| 133 | 133 | |
| 134 | 134 | return \DataTables::of($versions) |
| 135 | 135 | ->addColumn('id', function ($versions) { |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | $bussinesses = \App\Model\Common\Bussiness::pluck('name', 'short')->toArray(); |
| 319 | 319 | |
| 320 | 320 | return view('themes.default1.front.clients.profile', |
| 321 | - compact('user', 'timezones', 'state', 'states', 'bussinesses')); |
|
| 321 | + compact('user', 'timezones', 'state', 'states', 'bussinesses')); |
|
| 322 | 322 | } catch (Exception $ex) { |
| 323 | 323 | Bugsnag::notifyException($ex); |
| 324 | 324 | |
@@ -397,7 +397,7 @@ discard block |
||
| 397 | 397 | return $model->grand_total; |
| 398 | 398 | }) |
| 399 | 399 | ->rawColumns(['checkbox', 'number', 'total', |
| 400 | - 'payment_method', 'payment_status', 'created_at', ]) |
|
| 400 | + 'payment_method', 'payment_status', 'created_at', ]) |
|
| 401 | 401 | ->make(true); |
| 402 | 402 | } catch (Exception $ex) { |
| 403 | 403 | Bugsnag::notifyException($ex); |
@@ -423,17 +423,17 @@ discard block |
||
| 423 | 423 | ->addColumn('number', function ($model) { |
| 424 | 424 | return $model->invoice()->first()->number; |
| 425 | 425 | }) |
| 426 | - ->addColumn('total', function ($model) { |
|
| 427 | - return $model->amount; |
|
| 428 | - }) |
|
| 429 | - ->addColumn('created_at', function ($model) { |
|
| 430 | - $date1 = new DateTime($model->created_at); |
|
| 431 | - $tz = \Auth::user()->timezone()->first()->name; |
|
| 432 | - $date1->setTimezone(new DateTimeZone($tz)); |
|
| 433 | - $date = $date1->format('M j, Y, g:i a'); |
|
| 434 | - |
|
| 435 | - return $date; |
|
| 436 | - }) |
|
| 426 | + ->addColumn('total', function ($model) { |
|
| 427 | + return $model->amount; |
|
| 428 | + }) |
|
| 429 | + ->addColumn('created_at', function ($model) { |
|
| 430 | + $date1 = new DateTime($model->created_at); |
|
| 431 | + $tz = \Auth::user()->timezone()->first()->name; |
|
| 432 | + $date1->setTimezone(new DateTimeZone($tz)); |
|
| 433 | + $date = $date1->format('M j, Y, g:i a'); |
|
| 434 | + |
|
| 435 | + return $date; |
|
| 436 | + }) |
|
| 437 | 437 | |
| 438 | 438 | ->addColumn('payment_method', 'payment_status', 'created_at') |
| 439 | 439 | |
@@ -77,20 +77,20 @@ discard block |
||
| 77 | 77 | ->select('number', 'created_at', 'grand_total', 'id', 'status'); |
| 78 | 78 | |
| 79 | 79 | return \DataTables::of($invoices->get()) |
| 80 | - ->addColumn('number', function ($model) { |
|
| 80 | + ->addColumn('number', function($model) { |
|
| 81 | 81 | return $model->number; |
| 82 | 82 | }) |
| 83 | - ->addColumn('date', function ($model) { |
|
| 83 | + ->addColumn('date', function($model) { |
|
| 84 | 84 | $date = $model->created_at; |
| 85 | 85 | |
| 86 | 86 | return $date; |
| 87 | 87 | // $myobject->created_at->timezone($this->auth->user()->timezone); |
| 88 | 88 | }) |
| 89 | 89 | // ->showColumns('created_at') |
| 90 | - ->addColumn('total', function ($model) { |
|
| 90 | + ->addColumn('total', function($model) { |
|
| 91 | 91 | return $model->grand_total; |
| 92 | 92 | }) |
| 93 | - ->addColumn('Action', function ($model) { |
|
| 93 | + ->addColumn('Action', function($model) { |
|
| 94 | 94 | $status = $model->status; |
| 95 | 95 | $payment = ''; |
| 96 | 96 | if ($status == 'Pending' && $model->grand_total > 0) { |
@@ -132,19 +132,19 @@ discard block |
||
| 132 | 132 | 'title', 'description', 'file', 'created_at')->get(); |
| 133 | 133 | |
| 134 | 134 | return \DataTables::of($versions) |
| 135 | - ->addColumn('id', function ($versions) { |
|
| 135 | + ->addColumn('id', function($versions) { |
|
| 136 | 136 | return ucfirst($versions->id); |
| 137 | 137 | }) |
| 138 | - ->addColumn('version', function ($versions) { |
|
| 138 | + ->addColumn('version', function($versions) { |
|
| 139 | 139 | return ucfirst($versions->version); |
| 140 | 140 | }) |
| 141 | - ->addColumn('title', function ($versions) { |
|
| 141 | + ->addColumn('title', function($versions) { |
|
| 142 | 142 | return ucfirst($versions->title); |
| 143 | 143 | }) |
| 144 | - ->addColumn('description', function ($versions) { |
|
| 144 | + ->addColumn('description', function($versions) { |
|
| 145 | 145 | return ucfirst($versions->description); |
| 146 | 146 | }) |
| 147 | - ->addColumn('file', function ($versions) use ($clientid, $invoiceid, $productid) { |
|
| 147 | + ->addColumn('file', function($versions) use ($clientid, $invoiceid, $productid) { |
|
| 148 | 148 | $invoice_id = Invoice::where('number', $invoiceid)->pluck('id')->first(); |
| 149 | 149 | $order = Order::where('invoice_id', '=', $invoice_id)->first(); |
| 150 | 150 | $order_id = $order->id; |
@@ -196,18 +196,18 @@ discard block |
||
| 196 | 196 | $link = (array_slice($link, 0, 10, true)); |
| 197 | 197 | |
| 198 | 198 | return \DataTables::of($link) |
| 199 | - ->addColumn('version', function ($link) { |
|
| 199 | + ->addColumn('version', function($link) { |
|
| 200 | 200 | return ucfirst($link['tag_name']); |
| 201 | 201 | }) |
| 202 | - ->addColumn('name', function ($link) { |
|
| 202 | + ->addColumn('name', function($link) { |
|
| 203 | 203 | return ucfirst($link['name']); |
| 204 | 204 | }) |
| 205 | - ->addColumn('description', function ($link) { |
|
| 205 | + ->addColumn('description', function($link) { |
|
| 206 | 206 | $markdown = Markdown::convertToHtml(ucfirst($link['body'])); |
| 207 | 207 | |
| 208 | 208 | return $markdown; |
| 209 | 209 | }) |
| 210 | - ->addColumn('file', function ($link) use ($invoiceid, $productid) { |
|
| 210 | + ->addColumn('file', function($link) use ($invoiceid, $productid) { |
|
| 211 | 211 | $order = Order::where('invoice_id', '=', $invoiceid)->first(); |
| 212 | 212 | $order_id = $order->id; |
| 213 | 213 | $orderEndDate = Subscription::select('ends_at') |
@@ -255,20 +255,20 @@ discard block |
||
| 255 | 255 | $orders = Order::where('client', \Auth::user()->id); |
| 256 | 256 | |
| 257 | 257 | return \DataTables::of($orders->get()) |
| 258 | - ->addColumn('id', function ($model) { |
|
| 258 | + ->addColumn('id', function($model) { |
|
| 259 | 259 | return $model->id; |
| 260 | 260 | }) |
| 261 | - ->addColumn('product_name', function ($model) { |
|
| 261 | + ->addColumn('product_name', function($model) { |
|
| 262 | 262 | return $model->product()->first()->name; |
| 263 | 263 | }) |
| 264 | - ->addColumn('expiry', function ($model) { |
|
| 264 | + ->addColumn('expiry', function($model) { |
|
| 265 | 265 | $tz = \Auth::user()->timezone()->first()->name; |
| 266 | 266 | $end = $this->getExpiryDate($model); |
| 267 | 267 | |
| 268 | 268 | return $end; |
| 269 | 269 | }) |
| 270 | 270 | |
| 271 | - ->addColumn('Action', function ($model) { |
|
| 271 | + ->addColumn('Action', function($model) { |
|
| 272 | 272 | $sub = $model->subscription()->first(); |
| 273 | 273 | $order = Order::where('id', $model->id)->select('product')->first(); |
| 274 | 274 | $productid = $order->product; |
@@ -383,17 +383,17 @@ discard block |
||
| 383 | 383 | ->select('id', 'invoice_id', 'user_id', 'amount', 'payment_method', 'payment_status', 'created_at'); |
| 384 | 384 | |
| 385 | 385 | return \DataTables::of($payments->get()) |
| 386 | - ->addColumn('checkbox', function ($model) { |
|
| 386 | + ->addColumn('checkbox', function($model) { |
|
| 387 | 387 | if (\Input::get('client') != 'true') { |
| 388 | 388 | return "<input type='checkbox' class='payment_checkbox' |
| 389 | 389 | value=".$model->id.' name=select[] id=check>'; |
| 390 | 390 | } |
| 391 | 391 | }) |
| 392 | - ->addColumn('number', function ($model) { |
|
| 392 | + ->addColumn('number', function($model) { |
|
| 393 | 393 | return $model->invoice()->first()->number; |
| 394 | 394 | }) |
| 395 | 395 | ->addColumn('amount', 'payment_method', 'payment_status', 'created_at') |
| 396 | - ->addColumn('total', function ($model) { |
|
| 396 | + ->addColumn('total', function($model) { |
|
| 397 | 397 | return $model->grand_total; |
| 398 | 398 | }) |
| 399 | 399 | ->rawColumns(['checkbox', 'number', 'total', |
@@ -420,13 +420,13 @@ discard block |
||
| 420 | 420 | ->select('id', 'invoice_id', 'user_id', 'payment_method', 'payment_status', 'created_at', 'amount'); |
| 421 | 421 | //dd(\Input::all()); |
| 422 | 422 | return \DataTables::of($payments->get()) |
| 423 | - ->addColumn('number', function ($model) { |
|
| 423 | + ->addColumn('number', function($model) { |
|
| 424 | 424 | return $model->invoice()->first()->number; |
| 425 | 425 | }) |
| 426 | - ->addColumn('total', function ($model) { |
|
| 426 | + ->addColumn('total', function($model) { |
|
| 427 | 427 | return $model->amount; |
| 428 | 428 | }) |
| 429 | - ->addColumn('created_at', function ($model) { |
|
| 429 | + ->addColumn('created_at', function($model) { |
|
| 430 | 430 | $date1 = new DateTime($model->created_at); |
| 431 | 431 | $tz = \Auth::user()->timezone()->first()->name; |
| 432 | 432 | $date1->setTimezone(new DateTimeZone($tz)); |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | ->addColumn('country', function ($model) { |
| 86 | 86 | if ($this->country->where('country_code_char2', $model->country)->first()) { |
| 87 | 87 | return ucfirst($this->country |
| 88 | - ->where('country_code_char2', $model->country)->first()->country_name); |
|
| 88 | + ->where('country_code_char2', $model->country)->first()->country_name); |
|
| 89 | 89 | } |
| 90 | 90 | }) |
| 91 | 91 | ->addColumn('state', function ($model) { |
@@ -112,27 +112,27 @@ discard block |
||
| 112 | 112 | public function getTaxTable() |
| 113 | 113 | { |
| 114 | 114 | return \DataTables::of(TaxByState::select('id', 'state', 'c_gst', 's_gst', 'i_gst', 'ut_gst')->get()) |
| 115 | - ->addColumn('id', function ($model) { |
|
| 116 | - return $model->id; |
|
| 117 | - }) |
|
| 118 | - |
|
| 119 | - ->addColumn('state', function ($model) { |
|
| 120 | - return ucfirst($model->state); |
|
| 121 | - }) |
|
| 122 | - ->addColumn('c_gst', function ($model) { |
|
| 123 | - return ucfirst($model->c_gst); |
|
| 124 | - }) |
|
| 125 | - ->addColumn('s_gst', function ($model) { |
|
| 126 | - return ucfirst($model->s_gst); |
|
| 127 | - }) |
|
| 128 | - ->addColumn('i_gst', function ($model) { |
|
| 129 | - return ucfirst($model->i_gst); |
|
| 130 | - }) |
|
| 131 | - ->addColumn('ut_gst', function ($model) { |
|
| 132 | - return ucfirst($model->ut_gst); |
|
| 133 | - }) |
|
| 134 | - ->rawColumns(['id', 'state', 'c_gst', 's_gst', 'i_gst', 'ut_gst']) |
|
| 135 | - ->make(true); |
|
| 115 | + ->addColumn('id', function ($model) { |
|
| 116 | + return $model->id; |
|
| 117 | + }) |
|
| 118 | + |
|
| 119 | + ->addColumn('state', function ($model) { |
|
| 120 | + return ucfirst($model->state); |
|
| 121 | + }) |
|
| 122 | + ->addColumn('c_gst', function ($model) { |
|
| 123 | + return ucfirst($model->c_gst); |
|
| 124 | + }) |
|
| 125 | + ->addColumn('s_gst', function ($model) { |
|
| 126 | + return ucfirst($model->s_gst); |
|
| 127 | + }) |
|
| 128 | + ->addColumn('i_gst', function ($model) { |
|
| 129 | + return ucfirst($model->i_gst); |
|
| 130 | + }) |
|
| 131 | + ->addColumn('ut_gst', function ($model) { |
|
| 132 | + return ucfirst($model->ut_gst); |
|
| 133 | + }) |
|
| 134 | + ->rawColumns(['id', 'state', 'c_gst', 's_gst', 'i_gst', 'ut_gst']) |
|
| 135 | + ->make(true); |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | /** |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | ->withInput(); |
| 369 | 369 | } |
| 370 | 370 | $this->tax_class->fill($request->except('tax-name', 'level', |
| 371 | - 'active', 'country', 'country1', 'rate'))->save(); |
|
| 371 | + 'active', 'country', 'country1', 'rate'))->save(); |
|
| 372 | 372 | $country = ($request->input('rate')) ? $request->input('country') : $request->input('country1'); |
| 373 | 373 | |
| 374 | 374 | $this->tax->fill($request->except('tax-name', 'name', 'country'))->save(); |
@@ -197,149 +197,149 @@ discard block |
||
| 197 | 197 | $tax_class_id = TaxProductRelation::where('product_id', $productid)->pluck('tax_class_id')->toArray(); |
| 198 | 198 | |
| 199 | 199 | if ($tax_class_id) {//If the product is allowed for tax (Check in tax_product relation table) |
| 200 | - if ($tax_enable == 1) {//If GST is Enabled |
|
| 201 | - |
|
| 202 | - $state_code = ''; |
|
| 203 | - $c_gst = ''; |
|
| 204 | - $s_gst = ''; |
|
| 205 | - $i_gst = ''; |
|
| 206 | - $ut_gst = ''; |
|
| 207 | - $value = ''; |
|
| 208 | - $rate = ''; |
|
| 209 | - $status = 1; |
|
| 210 | - |
|
| 211 | - if ($user_state != '') {//Get the CGST,SGST,IGST,STATE_CODE of the user |
|
| 212 | - $c_gst = $user_state->c_gst; |
|
| 213 | - $s_gst = $user_state->s_gst; |
|
| 214 | - $i_gst = $user_state->i_gst; |
|
| 215 | - $ut_gst = $user_state->ut_gst; |
|
| 216 | - $state_code = $user_state->state_code; |
|
| 217 | - |
|
| 218 | - if ($state_code == $origin_state) {//If user and origin state are same |
|
| 219 | - $rateForSameState = $this->getTaxWhenIndianSameState($user_state, |
|
| 200 | + if ($tax_enable == 1) {//If GST is Enabled |
|
| 201 | + |
|
| 202 | + $state_code = ''; |
|
| 203 | + $c_gst = ''; |
|
| 204 | + $s_gst = ''; |
|
| 205 | + $i_gst = ''; |
|
| 206 | + $ut_gst = ''; |
|
| 207 | + $value = ''; |
|
| 208 | + $rate = ''; |
|
| 209 | + $status = 1; |
|
| 210 | + |
|
| 211 | + if ($user_state != '') {//Get the CGST,SGST,IGST,STATE_CODE of the user |
|
| 212 | + $c_gst = $user_state->c_gst; |
|
| 213 | + $s_gst = $user_state->s_gst; |
|
| 214 | + $i_gst = $user_state->i_gst; |
|
| 215 | + $ut_gst = $user_state->ut_gst; |
|
| 216 | + $state_code = $user_state->state_code; |
|
| 217 | + |
|
| 218 | + if ($state_code == $origin_state) {//If user and origin state are same |
|
| 219 | + $rateForSameState = $this->getTaxWhenIndianSameState($user_state, |
|
| 220 | 220 | $origin_state, $productid, $c_gst, $s_gst, $state_code, $status); |
| 221 | 221 | |
| 222 | - $taxes = $rateForSameState['taxes']; |
|
| 223 | - $status = $rateForSameState['status']; |
|
| 224 | - $value = $rateForSameState['value']; |
|
| 225 | - } elseif ($state_code != $origin_state && $ut_gst == 'NULL') {//If user is from other state |
|
| 226 | - $rateForOtherState = $this->getTaxWhenIndianOtherState($user_state, |
|
| 222 | + $taxes = $rateForSameState['taxes']; |
|
| 223 | + $status = $rateForSameState['status']; |
|
| 224 | + $value = $rateForSameState['value']; |
|
| 225 | + } elseif ($state_code != $origin_state && $ut_gst == 'NULL') {//If user is from other state |
|
| 226 | + $rateForOtherState = $this->getTaxWhenIndianOtherState($user_state, |
|
| 227 | 227 | $origin_state, $productid, $i_gst, $state_code, $status); |
| 228 | - $taxes = $rateForOtherState['taxes']; |
|
| 229 | - $status = $rateForOtherState['status']; |
|
| 230 | - $value = $rateForOtherState['value']; |
|
| 231 | - } elseif ($state_code != $origin_state && $ut_gst != 'NULL') {//if user from Union Territory |
|
| 232 | - $rateForUnionTerritory = $this->getTaxWhenUnionTerritory($user_state, |
|
| 228 | + $taxes = $rateForOtherState['taxes']; |
|
| 229 | + $status = $rateForOtherState['status']; |
|
| 230 | + $value = $rateForOtherState['value']; |
|
| 231 | + } elseif ($state_code != $origin_state && $ut_gst != 'NULL') {//if user from Union Territory |
|
| 232 | + $rateForUnionTerritory = $this->getTaxWhenUnionTerritory($user_state, |
|
| 233 | 233 | $origin_state, $productid, $c_gst, $ut_gst, $state_code, $status); |
| 234 | - $taxes = $rateForUnionTerritory['taxes']; |
|
| 235 | - $status = $rateForUnionTerritory['status']; |
|
| 236 | - $value = $rateForUnionTerritory['value']; |
|
| 237 | - } |
|
| 238 | - } else {//If user from other Country |
|
| 239 | - $taxClassId = Tax::where('state', $geoip_state) |
|
| 240 | - ->orWhere('country', $geoip_country) |
|
| 241 | - ->pluck('tax_classes_id')->first(); |
|
| 242 | - if ($taxClassId) { //if state equals the user State or country equals user country |
|
| 243 | - $taxForSpecificCountry = $this->getTaxForSpecificCountry($taxClassId, |
|
| 234 | + $taxes = $rateForUnionTerritory['taxes']; |
|
| 235 | + $status = $rateForUnionTerritory['status']; |
|
| 236 | + $value = $rateForUnionTerritory['value']; |
|
| 237 | + } |
|
| 238 | + } else {//If user from other Country |
|
| 239 | + $taxClassId = Tax::where('state', $geoip_state) |
|
| 240 | + ->orWhere('country', $geoip_country) |
|
| 241 | + ->pluck('tax_classes_id')->first(); |
|
| 242 | + if ($taxClassId) { //if state equals the user State or country equals user country |
|
| 243 | + $taxForSpecificCountry = $this->getTaxForSpecificCountry($taxClassId, |
|
| 244 | 244 | $productid, $status); |
| 245 | - $taxes = $taxForSpecificCountry['taxes']; |
|
| 246 | - $status = $taxForSpecificCountry['status']; |
|
| 247 | - $value = $taxForSpecificCountry['value']; |
|
| 248 | - $rate = $taxForSpecificCountry['value']; |
|
| 249 | - } else {//if Tax is selected for Any Country Any State |
|
| 250 | - $taxClassId = Tax::where('country', '') |
|
| 251 | - ->where('state', 'Any State') |
|
| 252 | - ->pluck('tax_classes_id')->first(); |
|
| 253 | - if ($taxClassId) { |
|
| 254 | - $taxForAnyCountry = $this->getTaxForAnyCountry($taxClassId, $productid, $status); |
|
| 255 | - $taxes = $taxForAnyCountry['taxes']; |
|
| 256 | - $status = $taxForAnyCountry['status']; |
|
| 257 | - $value = $taxForAnyCountry['value']; |
|
| 258 | - $rate = $taxForAnyCountry['value']; |
|
| 259 | - } else { |
|
| 260 | - $taxes = [0]; |
|
| 261 | - } |
|
| 262 | - } |
|
| 263 | - } |
|
| 264 | - foreach ($taxes as $key => $tax) { |
|
| 245 | + $taxes = $taxForSpecificCountry['taxes']; |
|
| 246 | + $status = $taxForSpecificCountry['status']; |
|
| 247 | + $value = $taxForSpecificCountry['value']; |
|
| 248 | + $rate = $taxForSpecificCountry['value']; |
|
| 249 | + } else {//if Tax is selected for Any Country Any State |
|
| 250 | + $taxClassId = Tax::where('country', '') |
|
| 251 | + ->where('state', 'Any State') |
|
| 252 | + ->pluck('tax_classes_id')->first(); |
|
| 253 | + if ($taxClassId) { |
|
| 254 | + $taxForAnyCountry = $this->getTaxForAnyCountry($taxClassId, $productid, $status); |
|
| 255 | + $taxes = $taxForAnyCountry['taxes']; |
|
| 256 | + $status = $taxForAnyCountry['status']; |
|
| 257 | + $value = $taxForAnyCountry['value']; |
|
| 258 | + $rate = $taxForAnyCountry['value']; |
|
| 259 | + } else { |
|
| 260 | + $taxes = [0]; |
|
| 261 | + } |
|
| 262 | + } |
|
| 263 | + } |
|
| 264 | + foreach ($taxes as $key => $tax) { |
|
| 265 | 265 | |
| 266 | 266 | //All the da a attribute that is sent to the checkout Page if tax_compound=0 |
| 267 | - if ($taxes[0]) { |
|
| 268 | - $tax_attribute[$key] = ['name' => $tax->name, 'c_gst'=>$c_gst, |
|
| 269 | - 's_gst' => $s_gst, 'i_gst'=>$i_gst, 'ut_gst'=>$ut_gst, |
|
| 267 | + if ($taxes[0]) { |
|
| 268 | + $tax_attribute[$key] = ['name' => $tax->name, 'c_gst'=>$c_gst, |
|
| 269 | + 's_gst' => $s_gst, 'i_gst'=>$i_gst, 'ut_gst'=>$ut_gst, |
|
| 270 | 270 | 'state' => $state_code, 'origin_state'=>$origin_state, |
| 271 | - 'tax_enable' => $tax_enable, 'rate'=>$value, 'status'=>$status, ]; |
|
| 271 | + 'tax_enable' => $tax_enable, 'rate'=>$value, 'status'=>$status, ]; |
|
| 272 | 272 | |
| 273 | - $taxCondition[0] = new \Darryldecode\Cart\CartCondition([ |
|
| 273 | + $taxCondition[0] = new \Darryldecode\Cart\CartCondition([ |
|
| 274 | 274 | |
| 275 | 275 | 'name' => 'no compound', |
| 276 | 276 | 'type' => 'tax', |
| 277 | 277 | 'target' => 'item', |
| 278 | 278 | 'value' => $value, |
| 279 | - ]); |
|
| 280 | - } else { |
|
| 281 | - $tax_attribute[0] = ['name' => 'null', 'rate' => 0, 'tax_enable' =>0]; |
|
| 282 | - $taxCondition[0] = new \Darryldecode\Cart\CartCondition([ |
|
| 283 | - 'name' => 'null', |
|
| 284 | - 'type' => 'tax', |
|
| 285 | - 'target' => 'item', |
|
| 286 | - 'value' => '0%', |
|
| 287 | - ]); |
|
| 288 | - } |
|
| 289 | - } |
|
| 290 | - } elseif ($tax_enable == 0) {//If Tax enable is 0 |
|
| 291 | - $status = 1; |
|
| 292 | - if ($this->tax_option->findOrFail(1)->tax_enable == 0) { |
|
| 293 | - $taxClassId = Tax::where('country', '') |
|
| 294 | - ->where('state', 'Any State') |
|
| 295 | - ->pluck('tax_classes_id')->first(); //In case of India when |
|
| 296 | - // other tax is available and tax is not enabled |
|
| 297 | - if ($taxClassId) { |
|
| 298 | - $taxes = $this->getTaxByPriority($taxClassId); |
|
| 299 | - $value = $this->getValueForOthers($productid, $taxClassId, $taxes); |
|
| 300 | - if ($value == 0) { |
|
| 301 | - $status = 0; |
|
| 302 | - } |
|
| 303 | - $rate = $value; |
|
| 304 | - foreach ($taxes as $key => $tax) { |
|
| 305 | - $tax_attribute[$key] = ['name' => $tax->name, |
|
| 306 | - 'rate' => $value, 'tax_enable'=>0, 'status' => $status, ]; |
|
| 307 | - $taxCondition[$key] = new \Darryldecode\Cart\CartCondition([ |
|
| 279 | + ]); |
|
| 280 | + } else { |
|
| 281 | + $tax_attribute[0] = ['name' => 'null', 'rate' => 0, 'tax_enable' =>0]; |
|
| 282 | + $taxCondition[0] = new \Darryldecode\Cart\CartCondition([ |
|
| 283 | + 'name' => 'null', |
|
| 284 | + 'type' => 'tax', |
|
| 285 | + 'target' => 'item', |
|
| 286 | + 'value' => '0%', |
|
| 287 | + ]); |
|
| 288 | + } |
|
| 289 | + } |
|
| 290 | + } elseif ($tax_enable == 0) {//If Tax enable is 0 |
|
| 291 | + $status = 1; |
|
| 292 | + if ($this->tax_option->findOrFail(1)->tax_enable == 0) { |
|
| 293 | + $taxClassId = Tax::where('country', '') |
|
| 294 | + ->where('state', 'Any State') |
|
| 295 | + ->pluck('tax_classes_id')->first(); //In case of India when |
|
| 296 | + // other tax is available and tax is not enabled |
|
| 297 | + if ($taxClassId) { |
|
| 298 | + $taxes = $this->getTaxByPriority($taxClassId); |
|
| 299 | + $value = $this->getValueForOthers($productid, $taxClassId, $taxes); |
|
| 300 | + if ($value == 0) { |
|
| 301 | + $status = 0; |
|
| 302 | + } |
|
| 303 | + $rate = $value; |
|
| 304 | + foreach ($taxes as $key => $tax) { |
|
| 305 | + $tax_attribute[$key] = ['name' => $tax->name, |
|
| 306 | + 'rate' => $value, 'tax_enable'=>0, 'status' => $status, ]; |
|
| 307 | + $taxCondition[$key] = new \Darryldecode\Cart\CartCondition([ |
|
| 308 | 308 | |
| 309 | 309 | 'name' => $tax->name, |
| 310 | 310 | 'type' => 'tax', |
| 311 | 311 | 'target' => 'item', |
| 312 | 312 | 'value' => $value, |
| 313 | 313 | ]); |
| 314 | - } |
|
| 315 | - } else {//In case of other country |
|
| 316 | - //when tax is available and tax is not enabled |
|
| 317 | - //(Applicable when Global Tax class for any country and state is not there) |
|
| 318 | - $taxClassId = Tax::where('state', $geoip_state) |
|
| 319 | - ->orWhere('country', $geoip_country) |
|
| 320 | - ->pluck('tax_classes_id')->first(); |
|
| 321 | - if ($taxClassId) { //if state equals the user State |
|
| 322 | - $taxes = $this->getTaxByPriority($taxClassId); |
|
| 323 | - $value = $this->getValueForOthers($productid, $taxClassId, $taxes); |
|
| 324 | - if ($value == '') { |
|
| 325 | - $status = 0; |
|
| 326 | - } |
|
| 327 | - $rate = $value; |
|
| 328 | - } |
|
| 329 | - foreach ($taxes as $key => $tax) { |
|
| 330 | - $tax_attribute[$key] = ['name' => $tax->name, |
|
| 331 | - 'rate' => $value, 'tax_enable'=>0, 'status' => $status, ]; |
|
| 332 | - $taxCondition[$key] = new \Darryldecode\Cart\CartCondition([ |
|
| 314 | + } |
|
| 315 | + } else {//In case of other country |
|
| 316 | + //when tax is available and tax is not enabled |
|
| 317 | + //(Applicable when Global Tax class for any country and state is not there) |
|
| 318 | + $taxClassId = Tax::where('state', $geoip_state) |
|
| 319 | + ->orWhere('country', $geoip_country) |
|
| 320 | + ->pluck('tax_classes_id')->first(); |
|
| 321 | + if ($taxClassId) { //if state equals the user State |
|
| 322 | + $taxes = $this->getTaxByPriority($taxClassId); |
|
| 323 | + $value = $this->getValueForOthers($productid, $taxClassId, $taxes); |
|
| 324 | + if ($value == '') { |
|
| 325 | + $status = 0; |
|
| 326 | + } |
|
| 327 | + $rate = $value; |
|
| 328 | + } |
|
| 329 | + foreach ($taxes as $key => $tax) { |
|
| 330 | + $tax_attribute[$key] = ['name' => $tax->name, |
|
| 331 | + 'rate' => $value, 'tax_enable'=>0, 'status' => $status, ]; |
|
| 332 | + $taxCondition[$key] = new \Darryldecode\Cart\CartCondition([ |
|
| 333 | 333 | |
| 334 | 334 | 'name' => $tax->name, |
| 335 | 335 | 'type' => 'tax', |
| 336 | 336 | 'target' => 'item', |
| 337 | 337 | 'value' => $value, |
| 338 | 338 | ]); |
| 339 | - } |
|
| 340 | - } |
|
| 341 | - } |
|
| 342 | - } |
|
| 339 | + } |
|
| 340 | + } |
|
| 341 | + } |
|
| 342 | + } |
|
| 343 | 343 | } else { |
| 344 | 344 | $tax_attribute[0] = ['name' => 'null', 'rate' => 0, 'tax_enable' =>0]; |
| 345 | 345 | $taxCondition[0] = new \Darryldecode\Cart\CartCondition([ |
@@ -418,7 +418,7 @@ discard block |
||
| 418 | 418 | $value = ''; |
| 419 | 419 | $value = $taxes->toArray()[0]['active'] ? |
| 420 | 420 | (TaxProductRelation::where('product_id', $productid) |
| 421 | - ->where('tax_class_id', $taxClassId)->count() ? $ut_gst + $c_gst.'%' : 0) : 0; |
|
| 421 | + ->where('tax_class_id', $taxClassId)->count() ? $ut_gst + $c_gst.'%' : 0) : 0; |
|
| 422 | 422 | |
| 423 | 423 | return $value; |
| 424 | 424 | } |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | $otherRate = 0; |
| 438 | 438 | $status = $taxes->toArray()[0]['active']; |
| 439 | 439 | if ($status && (TaxProductRelation::where('product_id', $productid) |
| 440 | - ->where('tax_class_id', $taxClassId)->count() > 0)) { |
|
| 440 | + ->where('tax_class_id', $taxClassId)->count() > 0)) { |
|
| 441 | 441 | $otherRate = Tax::where('tax_classes_id', $taxClassId)->first()->rate; |
| 442 | 442 | } |
| 443 | 443 | |
@@ -723,7 +723,7 @@ discard block |
||
| 723 | 723 | if ($subregion) { |
| 724 | 724 | $result = ['id' => $subregion->state_subdivision_code, |
| 725 | 725 | |
| 726 | - 'name' => $subregion->state_subdivision_name, ]; |
|
| 726 | + 'name' => $subregion->state_subdivision_name, ]; |
|
| 727 | 727 | } |
| 728 | 728 | |
| 729 | 729 | return $result; |
@@ -13,6 +13,6 @@ |
||
| 13 | 13 | 'state_subdivision_id', 'country_code_char2', |
| 14 | 14 | 'country_code_char3', 'state_subdivision_name', |
| 15 | 15 | 'state_subdivision_alternate_names', 'primary_level_name', |
| 16 | - 'state_subdivision_code', |
|
| 16 | + 'state_subdivision_code', |
|
| 17 | 17 | ]; |
| 18 | 18 | } |
@@ -121,21 +121,21 @@ discard block |
||
| 121 | 121 | |
| 122 | 122 | return '<a href='.url('clients/'.$id).'>'.ucfirst($first).' '.ucfirst($last).'</a>'; |
| 123 | 123 | }) |
| 124 | - ->addColumn('number', function ($model) { |
|
| 125 | - return ucfirst($model->number); |
|
| 126 | - }) |
|
| 124 | + ->addColumn('number', function ($model) { |
|
| 125 | + return ucfirst($model->number); |
|
| 126 | + }) |
|
| 127 | 127 | |
| 128 | 128 | ->addColumn('date', function ($model) { |
| 129 | 129 | $date = date_create($model->created_at); |
| 130 | 130 | |
| 131 | 131 | return "<span style='display:none'>$model->id</span>".$date->format('l, F j, Y H:m'); |
| 132 | 132 | }) |
| 133 | - ->addColumn('grand_total', function ($model) { |
|
| 134 | - return ucfirst($model->number); |
|
| 135 | - }) |
|
| 136 | - ->addColumn('status', function ($model) { |
|
| 137 | - return ucfirst($model->status); |
|
| 138 | - }) |
|
| 133 | + ->addColumn('grand_total', function ($model) { |
|
| 134 | + return ucfirst($model->number); |
|
| 135 | + }) |
|
| 136 | + ->addColumn('status', function ($model) { |
|
| 137 | + return ucfirst($model->status); |
|
| 138 | + }) |
|
| 139 | 139 | |
| 140 | 140 | ->addColumn('action', function ($model) { |
| 141 | 141 | $action = ''; |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | ." $action"; |
| 155 | 155 | }) |
| 156 | 156 | |
| 157 | - ->rawColumns(['checkbox', 'user_id', 'number', 'date', 'grand_total', 'status', 'action']) |
|
| 157 | + ->rawColumns(['checkbox', 'user_id', 'number', 'date', 'grand_total', 'status', 'action']) |
|
| 158 | 158 | ->make(true); |
| 159 | 159 | } |
| 160 | 160 | |
@@ -283,8 +283,8 @@ discard block |
||
| 283 | 283 | $symbol = $attributes[0]['currency'][0]['code']; |
| 284 | 284 | //dd($symbol); |
| 285 | 285 | $invoice = $this->invoice->create(['user_id' => $user_id, 'number' => $number, |
| 286 | - 'date' => $date, 'grand_total' => $grand_total, 'status' => 'pending', |
|
| 287 | - 'currency' => $symbol, ]); |
|
| 286 | + 'date' => $date, 'grand_total' => $grand_total, 'status' => 'pending', |
|
| 287 | + 'currency' => $symbol, ]); |
|
| 288 | 288 | |
| 289 | 289 | foreach (\Cart::getContent() as $cart) { |
| 290 | 290 | $this->createInvoiceItems($invoice->id, $cart); |
@@ -480,7 +480,7 @@ discard block |
||
| 480 | 480 | } elseif ($this->tax_option->tax_enable == 0) {//if tax_enable is 0 |
| 481 | 481 | |
| 482 | 482 | $taxClassId = Tax::where('country', '')->where('state', 'Any State') |
| 483 | - ->pluck('tax_classes_id')->first(); //In case of India when |
|
| 483 | + ->pluck('tax_classes_id')->first(); //In case of India when |
|
| 484 | 484 | //other tax is available and tax is not enabled |
| 485 | 485 | if ($taxClassId) { |
| 486 | 486 | $rate = $this->getTotalRate($taxClassId, $productid, $taxs); |
@@ -549,10 +549,10 @@ discard block |
||
| 549 | 549 | foreach ($taxes as $key => $tax) { |
| 550 | 550 | if ($taxes[0]) { |
| 551 | 551 | $tax_attribute[$key] = ['name' => $tax->name, 'name1' => $name1, |
| 552 | - 'name2' => $name2, 'name3' => $name3, 'name4' => $name4, |
|
| 553 | - 'rate' => $value, 'rate1'=>$c_gst, 'rate2'=>$s_gst, |
|
| 554 | - 'rate3' => $i_gst, 'rate4'=>$ut_gst, 'state'=>$state_code, |
|
| 555 | - 'origin_state' => $origin_state, ]; |
|
| 552 | + 'name2' => $name2, 'name3' => $name3, 'name4' => $name4, |
|
| 553 | + 'rate' => $value, 'rate1'=>$c_gst, 'rate2'=>$s_gst, |
|
| 554 | + 'rate3' => $i_gst, 'rate4'=>$ut_gst, 'state'=>$state_code, |
|
| 555 | + 'origin_state' => $origin_state, ]; |
|
| 556 | 556 | |
| 557 | 557 | $rate = $tax->rate; |
| 558 | 558 | |
@@ -761,8 +761,8 @@ discard block |
||
| 761 | 761 | } |
| 762 | 762 | |
| 763 | 763 | return view('themes.default1.invoice.payment', |
| 764 | - compact('invoice_status', 'payment_status', |
|
| 765 | - 'payment_method', 'invoice_id', 'domain', 'invoice')); |
|
| 764 | + compact('invoice_status', 'payment_status', |
|
| 765 | + 'payment_method', 'invoice_id', 'domain', 'invoice')); |
|
| 766 | 766 | } |
| 767 | 767 | |
| 768 | 768 | return redirect()->back(); |
@@ -800,7 +800,7 @@ discard block |
||
| 800 | 800 | case 1: |
| 801 | 801 | $percentage = $price * ($value / 100); |
| 802 | 802 | |
| 803 | - return $price - $percentage; |
|
| 803 | + return $price - $percentage; |
|
| 804 | 804 | case 2: |
| 805 | 805 | return $price - $value; |
| 806 | 806 | case 3: |
@@ -818,7 +818,7 @@ discard block |
||
| 818 | 818 | $payment_date = \Carbon\Carbon::now()->toDateTimeString(); |
| 819 | 819 | $amount = $grand_total; |
| 820 | 820 | $paymentRenewal = $this->updateInvoicePayment($invoiceid, $payment_method, |
| 821 | - $payment_status, $payment_date, $amount); |
|
| 821 | + $payment_status, $payment_date, $amount); |
|
| 822 | 822 | |
| 823 | 823 | return redirect()->back()->with('success', 'Payment Accepted Successfully'); |
| 824 | 824 | } catch (\Exception $ex) { |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | ], [ |
| 119 | 119 | 'domain.*.required' => 'Please provide Domain name', |
| 120 | 120 | //'domain.*.url' => 'Domain name is not valid', |
| 121 | - ]); |
|
| 121 | + ]); |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | try { |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | $items = \Cart::getContent(); |
| 329 | 329 | foreach ($items as $item) { |
| 330 | 330 | |
| 331 | - //this is product |
|
| 331 | + //this is product |
|
| 332 | 332 | $id = $item->id; |
| 333 | 333 | $this->AddProductToOrder($id); |
| 334 | 334 | } |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | $ends_at = ''; |
| 389 | 389 | } |
| 390 | 390 | $this->subscription->create(['user_id' => \Auth::user()->id, |
| 391 | - 'plan_id' => $planid, 'order_id' => $orderid, 'ends_at' => $ends_at, ]); |
|
| 391 | + 'plan_id' => $planid, 'order_id' => $orderid, 'ends_at' => $ends_at, ]); |
|
| 392 | 392 | } catch (\Exception $ex) { |
| 393 | 393 | app('log')->useDailyFiles(storage_path().'/logs/laravel.log'); |
| 394 | 394 | app('log')->info($ex->getMessage()); |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | $invoiceItem = $this->invoiceItem->create(['invoice_id' => $invoiceid, |
| 443 | 443 | 'product_name' => $product_name, 'regular_price' => $regular_price, |
| 444 | 444 | 'quantity' => $quantity, 'tax_name' => $tax_name, |
| 445 | - 'tax_percentage' => $tax_percentage, 'subtotal' => $subtotal, ]); |
|
| 445 | + 'tax_percentage' => $tax_percentage, 'subtotal' => $subtotal, ]); |
|
| 446 | 446 | } catch (\Exception $ex) { |
| 447 | 447 | app('log')->useDailyFiles(storage_path().'/logs/laravel.log'); |
| 448 | 448 | app('log')->info($ex->getMessage()); |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | return '<a href='.('#edit-upload-option/'.$model->id).' |
| 43 | 43 | class=" btn btn-sm btn-primary " data-title="'.$model->title.'" |
| 44 | 44 | data-description="'.$model->description.'" data-version="' |
| 45 | - .$model->version.'" data-id="'.$model->id.'" onclick="openEditPopup(this)" >Edit</a>'; |
|
| 45 | + .$model->version.'" data-id="'.$model->id.'" onclick="openEditPopup(this)" >Edit</a>'; |
|
| 46 | 46 | }) |
| 47 | 47 | ->rawcolumns(['checkbox', 'product_id', 'title', 'description', 'version', 'file', 'action']) |
| 48 | 48 | ->make(true); |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | if ($product->require_domain == 1) { |
| 93 | 93 | $field .= "<div class='col-md-4 form-group'> |
| 94 | 94 | <label class='required'>"./* @scrutinizer ignore-type */ |
| 95 | - \Lang::get('message.domain')."</label> |
|
| 95 | + \Lang::get('message.domain')."</label> |
|
| 96 | 96 | <input type='text' name='domain' class='form-control' |
| 97 | 97 | id='domain' placeholder='http://example.com'> |
| 98 | 98 | </div>"; |
@@ -339,7 +339,7 @@ |
||
| 339 | 339 | 'type' => 'required', |
| 340 | 340 | 'group' => 'required', |
| 341 | 341 | 'image' => 'sometimes | mimes:jpeg,jpg,png,gif | max:1000', |
| 342 | - ]); |
|
| 342 | + ]); |
|
| 343 | 343 | |
| 344 | 344 | if ($v->fails()) { |
| 345 | 345 | return redirect()->back()->with('errors', $v->errors()); |
@@ -107,42 +107,42 @@ |
||
| 107 | 107 | |
| 108 | 108 | return\ DataTables::of($new_product) |
| 109 | 109 | |
| 110 | - ->addColumn('checkbox', function ($model) { |
|
| 110 | + ->addColumn('checkbox', function($model) { |
|
| 111 | 111 | return "<input type='checkbox' class='product_checkbox' |
| 112 | 112 | value=".$model->id.' name=select[] id=check>'; |
| 113 | 113 | }) |
| 114 | - ->addColumn('name', function ($model) { |
|
| 114 | + ->addColumn('name', function($model) { |
|
| 115 | 115 | return ucfirst($model->name); |
| 116 | 116 | }) |
| 117 | - ->addColumn('type', function ($model) { |
|
| 117 | + ->addColumn('type', function($model) { |
|
| 118 | 118 | if ($this->type->where('id', $model->type)->first()) { |
| 119 | 119 | return $this->type->where('id', $model->type)->first()->name; |
| 120 | 120 | } else { |
| 121 | 121 | return 'Not available'; |
| 122 | 122 | } |
| 123 | 123 | }) |
| 124 | - ->addColumn('group', function ($model) { |
|
| 124 | + ->addColumn('group', function($model) { |
|
| 125 | 125 | if ($this->group->where('id', $model->group)->first()) { |
| 126 | 126 | return $this->group->where('id', $model->group)->first()->name; |
| 127 | 127 | } else { |
| 128 | 128 | return 'Not available'; |
| 129 | 129 | } |
| 130 | 130 | }) |
| 131 | - ->addColumn('price', function ($model) { |
|
| 131 | + ->addColumn('price', function($model) { |
|
| 132 | 132 | if ($this->price->where('product_id', $model->id)->first()) { |
| 133 | 133 | return $this->price->where('product_id', $model->id)->first()->price; |
| 134 | 134 | } else { |
| 135 | 135 | return 'Not available'; |
| 136 | 136 | } |
| 137 | 137 | }) |
| 138 | - ->addColumn('currency', function ($model) { |
|
| 138 | + ->addColumn('currency', function($model) { |
|
| 139 | 139 | if ($this->price->where('product_id', $model->id)->first()) { |
| 140 | 140 | return $this->price->where('product_id', $model->id)->first()->currency; |
| 141 | 141 | } else { |
| 142 | 142 | return 'Not available'; |
| 143 | 143 | } |
| 144 | 144 | }) |
| 145 | - ->addColumn('Action', function ($model) { |
|
| 145 | + ->addColumn('Action', function($model) { |
|
| 146 | 146 | $url = ''; |
| 147 | 147 | if ($model->type == 2) { |
| 148 | 148 | $url = '<a href='.url('product/download/'.$model->id). |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | $serial_key = $this->checkSerialKey($faveo_encrypted_key, $order_number); |
| 96 | 96 | |
| 97 | 97 | \Log::emergency(json_encode(['domain' => $request->input('domain'), |
| 98 | - 'serial' => $serial_key, 'order' => $order_number, ])); |
|
| 98 | + 'serial' => $serial_key, 'order' => $order_number, ])); |
|
| 99 | 99 | $result = []; |
| 100 | 100 | if ($request_type == 'install') { |
| 101 | 101 | $result = $this->verificationResult($order_number, $serial_key, $domain); |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | // $faveo_encrypted_key = self::decryptByFaveoPrivateKey($request->input('serial_key')); |
| 349 | 349 | // $faveo_encrypted_domain = self::decryptByFaveoPrivateKey($request->input('domain')); |
| 350 | 350 | $this_order = $order |
| 351 | - ->where('number', $faveo_encrypted_order_number) |
|
| 351 | + ->where('number', $faveo_encrypted_order_number) |
|
| 352 | 352 | // ->where('number', $request->input('order_number')) |
| 353 | 353 | //->where('serial_key', $faveo_encrypted_key) |
| 354 | 354 | //->where('domain', $faveo_encrypted_domain) |