@@ -35,14 +35,14 @@ |
||
35 | 35 | public function getServices() |
36 | 36 | { |
37 | 37 | return \Datatable::collection($this->service->get()) |
38 | - ->addColumn('#', function ($model) { |
|
38 | + ->addColumn('#', function($model) { |
|
39 | 39 | return "<input type='checkbox' value=".$model->id.' name=select[] id=check>'; |
40 | 40 | }) |
41 | 41 | ->showColumns('name') |
42 | - ->addColumn('plan', function ($model) { |
|
42 | + ->addColumn('plan', function($model) { |
|
43 | 43 | //return $this->product->plan()->name; |
44 | 44 | }) |
45 | - ->addColumn('action', function ($model) { |
|
45 | + ->addColumn('action', function($model) { |
|
46 | 46 | return '<a href='.url('products/'.$model->id.'/edit')." class='btn btn-sm btn-primary'>Edit</a>"; |
47 | 47 | }) |
48 | 48 | ->searchColumns('name') |
@@ -58,18 +58,18 @@ discard block |
||
58 | 58 | $new_plan = Plan::select('id', 'name', 'days', 'product')->get(); |
59 | 59 | |
60 | 60 | return\ DataTables::of($new_plan) |
61 | - ->addColumn('checkbox', function ($model) { |
|
61 | + ->addColumn('checkbox', function($model) { |
|
62 | 62 | return "<input type='checkbox' class='plan_checkbox' value=".$model->id.' name=select[] id=check>'; |
63 | 63 | }) |
64 | - ->addColumn('name', function ($model) { |
|
64 | + ->addColumn('name', function($model) { |
|
65 | 65 | return ucfirst($model->name); |
66 | 66 | }) |
67 | - ->addColumn('days', function ($model) { |
|
67 | + ->addColumn('days', function($model) { |
|
68 | 68 | $months = $model->days / 30; |
69 | 69 | |
70 | 70 | return round($months); |
71 | 71 | }) |
72 | - ->addColumn('product', function ($model) { |
|
72 | + ->addColumn('product', function($model) { |
|
73 | 73 | $productid = $model->product; |
74 | 74 | $product = $this->product->where('id', $productid)->first(); |
75 | 75 | $response = ''; |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | |
80 | 80 | return ucfirst($response); |
81 | 81 | }) |
82 | - ->addColumn('action', function ($model) { |
|
82 | + ->addColumn('action', function($model) { |
|
83 | 83 | return '<a href='.url('plans/'.$model->id.'/edit')." class='btn btn-sm btn-primary btn-xs'><i class='fa fa-edit' style='color:white;'> </i> Edit</a>"; |
84 | 84 | }) |
85 | 85 | ->rawColumns(['checkbox', 'name', 'days', 'product', 'action']) |
@@ -107,13 +107,13 @@ discard block |
||
107 | 107 | |
108 | 108 | return\ DataTables::of($new_product) |
109 | 109 | // return \Datatable::collection($this->product->select('id', 'name', 'type', 'group')->where('id', '!=', 1)->get()) |
110 | - ->addColumn('checkbox', function ($model) { |
|
110 | + ->addColumn('checkbox', function($model) { |
|
111 | 111 | return "<input type='checkbox' class='product_checkbox' value=".$model->id.' name=select[] id=check>'; |
112 | 112 | }) |
113 | - ->addColumn('name', function ($model) { |
|
113 | + ->addColumn('name', function($model) { |
|
114 | 114 | return ucfirst($model->name); |
115 | 115 | }) |
116 | - ->addColumn('type', function ($model) { |
|
116 | + ->addColumn('type', function($model) { |
|
117 | 117 | //dd($model->type()); |
118 | 118 | if ($this->type->where('id', $model->type)->first()) { |
119 | 119 | return $this->type->where('id', $model->type)->first()->name; |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | return 'Not available'; |
122 | 122 | } |
123 | 123 | }) |
124 | - ->addColumn('group', function ($model) { |
|
124 | + ->addColumn('group', function($model) { |
|
125 | 125 | //dd($model->type()); |
126 | 126 | if ($this->group->where('id', $model->group)->first()) { |
127 | 127 | return $this->group->where('id', $model->group)->first()->name; |
@@ -129,21 +129,21 @@ discard block |
||
129 | 129 | return 'Not available'; |
130 | 130 | } |
131 | 131 | }) |
132 | - ->addColumn('price', function ($model) { |
|
132 | + ->addColumn('price', function($model) { |
|
133 | 133 | if ($this->price->where('product_id', $model->id)->first()) { |
134 | 134 | return $this->price->where('product_id', $model->id)->first()->price; |
135 | 135 | } else { |
136 | 136 | return 'Not available'; |
137 | 137 | } |
138 | 138 | }) |
139 | - ->addColumn('currency', function ($model) { |
|
139 | + ->addColumn('currency', function($model) { |
|
140 | 140 | if ($this->price->where('product_id', $model->id)->first()) { |
141 | 141 | return $this->price->where('product_id', $model->id)->first()->currency; |
142 | 142 | } else { |
143 | 143 | return 'Not available'; |
144 | 144 | } |
145 | 145 | }) |
146 | - ->addColumn('Action', function ($model) { |
|
146 | + ->addColumn('Action', function($model) { |
|
147 | 147 | $url = ''; |
148 | 148 | if ($model->type == 2) { |
149 | 149 | $url = '<a href='.url('product/download/'.$model->id)." class='btn btn-sm btn-primary btn-xs'><i class='fa fa-download' style='color:white;'> </i> Download</a>"; |
@@ -166,28 +166,28 @@ discard block |
||
166 | 166 | $new_upload = ProductUpload::where('product_id', '=', $id)->select('id', 'product_id', 'title', 'description', 'version', 'file')->get(); |
167 | 167 | |
168 | 168 | return \DataTables::of($new_upload) |
169 | - ->addColumn('checkbox', function ($model) { |
|
169 | + ->addColumn('checkbox', function($model) { |
|
170 | 170 | return "<input type='checkbox' class='upload_checkbox' value=".$model->id.' name=select[] id=checks>'; |
171 | 171 | }) |
172 | 172 | |
173 | - ->addColumn('product_id', function ($model) { |
|
173 | + ->addColumn('product_id', function($model) { |
|
174 | 174 | return ucfirst($this->product->where('id', $model->product_id)->first()->name); |
175 | 175 | }) |
176 | 176 | |
177 | - ->addColumn('title', function ($model) { |
|
177 | + ->addColumn('title', function($model) { |
|
178 | 178 | return ucfirst($model->title); |
179 | 179 | }) |
180 | - ->addColumn('description', function ($model) { |
|
180 | + ->addColumn('description', function($model) { |
|
181 | 181 | return ucfirst($model->description); |
182 | 182 | }) |
183 | - ->addColumn('version', function ($model) { |
|
183 | + ->addColumn('version', function($model) { |
|
184 | 184 | return $model->version; |
185 | 185 | }) |
186 | 186 | |
187 | - ->addColumn('file', function ($model) { |
|
187 | + ->addColumn('file', function($model) { |
|
188 | 188 | return $model->file; |
189 | 189 | }) |
190 | - ->addColumn('action', function ($model) { |
|
190 | + ->addColumn('action', function($model) { |
|
191 | 191 | return '<a href='.('#edit-upload-option/'.$model->id).' class=" btn btn-sm btn-primary " data-title="'.$model->title.'" data-description="'.$model->description.'" data-version="'.$model->version.'" data-id="'.$model->id.'" onclick="openEditPopup(this)" >Edit</a>'; |
192 | 192 | }) |
193 | 193 | ->rawcolumns(['checkbox', 'product_id', 'title', 'description', 'version', 'file', 'action']) |
@@ -647,7 +647,8 @@ |
||
647 | 647 | $order = Order::where('invoice_id', '=', $invoice_id)->first(); |
648 | 648 | $order_id = $order->id; |
649 | 649 | if ($type == 2) { |
650 | - if ($owner && $repository) {//If the Product is downloaded from Github |
|
650 | + if ($owner && $repository) { |
|
651 | +//If the Product is downloaded from Github |
|
651 | 652 | $github_controller = new \App\Http\Controllers\Github\GithubController(); |
652 | 653 | $relese = $github_controller->listRepositories($owner, $repository, $order_id); |
653 | 654 |
@@ -130,13 +130,13 @@ |
||
130 | 130 | $currency = 'INR'; |
131 | 131 | $ip = $request->ip(); |
132 | 132 | // $location = \GeoIP::getLocation($ip); |
133 | - if (!empty($_SERVER['HTTP_CLIENT_IP'])) { //check ip from share internet |
|
134 | - $ip = $_SERVER['HTTP_CLIENT_IP']; |
|
135 | - } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { //to check ip is pass from proxy |
|
136 | - $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; |
|
137 | - } else { |
|
138 | - $ip = $_SERVER['REMOTE_ADDR']; |
|
139 | - } |
|
133 | + if (!empty($_SERVER['HTTP_CLIENT_IP'])) { //check ip from share internet |
|
134 | + $ip = $_SERVER['HTTP_CLIENT_IP']; |
|
135 | + } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { //to check ip is pass from proxy |
|
136 | + $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; |
|
137 | + } else { |
|
138 | + $ip = $_SERVER['REMOTE_ADDR']; |
|
139 | + } |
|
140 | 140 | |
141 | 141 | if ($ip != '::1') { |
142 | 142 | $location = json_decode(file_get_contents('http://ip-api.com/json/'.$ip), true); |
@@ -130,9 +130,11 @@ |
||
130 | 130 | $currency = 'INR'; |
131 | 131 | $ip = $request->ip(); |
132 | 132 | // $location = \GeoIP::getLocation($ip); |
133 | - if (!empty($_SERVER['HTTP_CLIENT_IP'])) { //check ip from share internet |
|
133 | + if (!empty($_SERVER['HTTP_CLIENT_IP'])) { |
|
134 | +//check ip from share internet |
|
134 | 135 | $ip = $_SERVER['HTTP_CLIENT_IP']; |
135 | - } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { //to check ip is pass from proxy |
|
136 | + } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { |
|
137 | +//to check ip is pass from proxy |
|
136 | 138 | $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; |
137 | 139 | } else { |
138 | 140 | $ip = $_SERVER['REMOTE_ADDR']; |
@@ -78,20 +78,20 @@ |
||
78 | 78 | ->addColumn('first_name', function ($model) { |
79 | 79 | return '<a href='.url('clients/'.$model->id).'>'.ucfirst($model->first_name).' '.ucfirst($model->last_name).'</a>'; |
80 | 80 | }) |
81 | - ->addColumn('email', function ($model) { |
|
82 | - return $model->email; |
|
83 | - }) |
|
84 | - ->addColumn('created_at', function ($model) { |
|
85 | - $ends = $model->created_at; |
|
86 | - if ($ends) { |
|
87 | - $date = date_create($ends); |
|
88 | - $end = date_format($date, 'l, F j, Y H:m'); |
|
89 | - } |
|
90 | - |
|
91 | - return $end; |
|
92 | - |
|
93 | - // return $model->created_at; |
|
94 | - }) |
|
81 | + ->addColumn('email', function ($model) { |
|
82 | + return $model->email; |
|
83 | + }) |
|
84 | + ->addColumn('created_at', function ($model) { |
|
85 | + $ends = $model->created_at; |
|
86 | + if ($ends) { |
|
87 | + $date = date_create($ends); |
|
88 | + $end = date_format($date, 'l, F j, Y H:m'); |
|
89 | + } |
|
90 | + |
|
91 | + return $end; |
|
92 | + |
|
93 | + // return $model->created_at; |
|
94 | + }) |
|
95 | 95 | // ->showColumns('email', 'created_at') |
96 | 96 | ->addColumn('active', function ($model) { |
97 | 97 | if ($model->active == 1) { |
@@ -72,16 +72,16 @@ discard block |
||
72 | 72 | |
73 | 73 | return\ DataTables::of($user->get()) |
74 | 74 | |
75 | - ->addColumn('checkbox', function ($model) { |
|
75 | + ->addColumn('checkbox', function($model) { |
|
76 | 76 | return "<input type='checkbox' class='user_checkbox' value=".$model->id.' name=select[] id=check>'; |
77 | 77 | }) |
78 | - ->addColumn('first_name', function ($model) { |
|
78 | + ->addColumn('first_name', function($model) { |
|
79 | 79 | return '<a href='.url('clients/'.$model->id).'>'.ucfirst($model->first_name).' '.ucfirst($model->last_name).'</a>'; |
80 | 80 | }) |
81 | - ->addColumn('email', function ($model) { |
|
81 | + ->addColumn('email', function($model) { |
|
82 | 82 | return $model->email; |
83 | 83 | }) |
84 | - ->addColumn('created_at', function ($model) { |
|
84 | + ->addColumn('created_at', function($model) { |
|
85 | 85 | $ends = $model->created_at; |
86 | 86 | if ($ends) { |
87 | 87 | $date = date_create($ends); |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | // return $model->created_at; |
94 | 94 | }) |
95 | 95 | // ->showColumns('email', 'created_at') |
96 | - ->addColumn('active', function ($model) { |
|
96 | + ->addColumn('active', function($model) { |
|
97 | 97 | if ($model->active == 1) { |
98 | 98 | $email = "<span class='glyphicon glyphicon-envelope' style='color:green' title='verified email'></span>"; |
99 | 99 | } else { |
@@ -107,12 +107,12 @@ discard block |
||
107 | 107 | |
108 | 108 | return $email.' '.$mobile; |
109 | 109 | }) |
110 | - ->addColumn('action', function ($model) { |
|
110 | + ->addColumn('action', function($model) { |
|
111 | 111 | return '<a href='.url('clients/'.$model->id.'/edit')." class='btn btn-sm btn-primary btn-xs'><i class='fa fa-edit' style='color:white;'> </i> Edit</a>" |
112 | 112 | .' <a href='.url('clients/'.$model->id)." class='btn btn-sm btn-primary btn-xs'><i class='fa fa-eye' style='color:white;'> </i> View</a>"; |
113 | 113 | // return 'hhhh'; |
114 | 114 | }) |
115 | - ->rawColumns(['checkbox', 'first_name', 'email', 'created_at', 'active', 'action']) |
|
115 | + ->rawColumns(['checkbox', 'first_name', 'email', 'created_at', 'active', 'action']) |
|
116 | 116 | ->make(true); |
117 | 117 | |
118 | 118 | // ->searchColumns('email', 'first_name') |
@@ -485,7 +485,7 @@ |
||
485 | 485 | // $faveo_encrypted_key = self::decryptByFaveoPrivateKey($request->input('serial_key')); |
486 | 486 | // $faveo_encrypted_domain = self::decryptByFaveoPrivateKey($request->input('domain')); |
487 | 487 | $this_order = $order |
488 | - ->where('number', $faveo_encrypted_order_number) |
|
488 | + ->where('number', $faveo_encrypted_order_number) |
|
489 | 489 | // ->where('number', $request->input('order_number')) |
490 | 490 | //->where('serial_key', $faveo_encrypted_key) |
491 | 491 | //->where('domain', $faveo_encrypted_domain) |
@@ -253,50 +253,50 @@ discard block |
||
253 | 253 | $tax_class_id = TaxProductRelation::where('product_id', $productid)->pluck('tax_class_id')->toArray(); |
254 | 254 | |
255 | 255 | if ($tax_class_id) {//If the product is allowed for tax (Check in tax_product relation table) |
256 | - if ($tax_enable == 1) {//If GST is Enabled |
|
257 | - |
|
258 | - $state_code = ''; |
|
259 | - $c_gst = ''; |
|
260 | - $s_gst = ''; |
|
261 | - $i_gst = ''; |
|
262 | - $ut_gst = ''; |
|
263 | - $value = ''; |
|
264 | - $rate = ''; |
|
265 | - $status = 1; |
|
266 | - |
|
267 | - if ($user_state != '') {//Get the CGST,SGST,IGST,STATE_CODE of the user |
|
268 | - |
|
269 | - $c_gst = $user_state->c_gst; |
|
270 | - $s_gst = $user_state->s_gst; |
|
271 | - $i_gst = $user_state->i_gst; |
|
272 | - $ut_gst = $user_state->ut_gst; |
|
273 | - $state_code = $user_state->state_code; |
|
274 | - if ($state_code == $origin_state) {//If user and origin state are same |
|
275 | - |
|
276 | - $taxClassId = TaxClass::where('name', 'Intra State GST')->pluck('id')->toArray(); //Get the class Id of state |
|
277 | - if ($taxClassId) { |
|
278 | - $taxes = $this->getTaxByPriority($taxClassId); |
|
279 | - $value = $this->getValueForSameState($productid, $c_gst, $s_gst, $taxClassId, $taxes); |
|
280 | - |
|
281 | - if ($value == '') { |
|
282 | - $status = 0; |
|
283 | - } |
|
284 | - } else { |
|
285 | - $taxes = [0]; |
|
286 | - } |
|
287 | - } elseif ($state_code != $origin_state && $ut_gst == 'NULL') {//If user is from other state |
|
288 | - |
|
289 | - $taxClassId = TaxClass::where('name', 'Inter State GST')->pluck('id')->toArray(); //Get the class Id of state |
|
290 | - if ($taxClassId) { |
|
291 | - $taxes = $this->getTaxByPriority($taxClassId); |
|
292 | - $value = $this->getValueForOtherState($productid, $i_gst, $taxClassId, $taxes); |
|
293 | - if ($value == '') { |
|
294 | - $status = 0; |
|
295 | - } |
|
296 | - } else { |
|
297 | - $taxes = [0]; |
|
298 | - } |
|
299 | - } elseif ($state_code != $origin_state && $ut_gst != 'NULL') {//if user from Union Territory |
|
256 | + if ($tax_enable == 1) {//If GST is Enabled |
|
257 | + |
|
258 | + $state_code = ''; |
|
259 | + $c_gst = ''; |
|
260 | + $s_gst = ''; |
|
261 | + $i_gst = ''; |
|
262 | + $ut_gst = ''; |
|
263 | + $value = ''; |
|
264 | + $rate = ''; |
|
265 | + $status = 1; |
|
266 | + |
|
267 | + if ($user_state != '') {//Get the CGST,SGST,IGST,STATE_CODE of the user |
|
268 | + |
|
269 | + $c_gst = $user_state->c_gst; |
|
270 | + $s_gst = $user_state->s_gst; |
|
271 | + $i_gst = $user_state->i_gst; |
|
272 | + $ut_gst = $user_state->ut_gst; |
|
273 | + $state_code = $user_state->state_code; |
|
274 | + if ($state_code == $origin_state) {//If user and origin state are same |
|
275 | + |
|
276 | + $taxClassId = TaxClass::where('name', 'Intra State GST')->pluck('id')->toArray(); //Get the class Id of state |
|
277 | + if ($taxClassId) { |
|
278 | + $taxes = $this->getTaxByPriority($taxClassId); |
|
279 | + $value = $this->getValueForSameState($productid, $c_gst, $s_gst, $taxClassId, $taxes); |
|
280 | + |
|
281 | + if ($value == '') { |
|
282 | + $status = 0; |
|
283 | + } |
|
284 | + } else { |
|
285 | + $taxes = [0]; |
|
286 | + } |
|
287 | + } elseif ($state_code != $origin_state && $ut_gst == 'NULL') {//If user is from other state |
|
288 | + |
|
289 | + $taxClassId = TaxClass::where('name', 'Inter State GST')->pluck('id')->toArray(); //Get the class Id of state |
|
290 | + if ($taxClassId) { |
|
291 | + $taxes = $this->getTaxByPriority($taxClassId); |
|
292 | + $value = $this->getValueForOtherState($productid, $i_gst, $taxClassId, $taxes); |
|
293 | + if ($value == '') { |
|
294 | + $status = 0; |
|
295 | + } |
|
296 | + } else { |
|
297 | + $taxes = [0]; |
|
298 | + } |
|
299 | + } elseif ($state_code != $origin_state && $ut_gst != 'NULL') {//if user from Union Territory |
|
300 | 300 | $taxClassId = TaxClass::where('name', 'Union Territory GST')->pluck('id')->toArray(); //Get the class Id of state |
301 | 301 | if ($taxClassId) { |
302 | 302 | $taxes = $this->getTaxByPriority($taxClassId); |
@@ -307,100 +307,100 @@ discard block |
||
307 | 307 | } else { |
308 | 308 | $taxes = [0]; |
309 | 309 | } |
310 | - } |
|
311 | - } else {//If user from other Country |
|
312 | - |
|
313 | - $taxClassId = Tax::where('state', $geoip_state)->orWhere('country', $geoip_country)->pluck('tax_classes_id')->first(); |
|
314 | - |
|
315 | - if ($taxClassId) { //if state equals the user State or country equals user country |
|
316 | - |
|
317 | - $taxes = $this->getTaxByPriority($taxClassId); |
|
318 | - $value = $this->getValueForOthers($productid, $taxClassId, $taxes); |
|
319 | - if ($value == '') { |
|
320 | - $status = 0; |
|
321 | - } |
|
322 | - $rate = $value; |
|
323 | - } else {//if Tax is selected for Any Country Any State |
|
324 | - $taxClassId = Tax::where('country', '')->where('state', 'Any State')->pluck('tax_classes_id')->first(); |
|
325 | - if ($taxClassId) { |
|
326 | - $taxes = $this->getTaxByPriority($taxClassId); |
|
327 | - $value = $this->getValueForOthers($productid, $taxClassId, $taxes); |
|
328 | - if ($value == '') { |
|
329 | - $status = 0; |
|
330 | - } |
|
331 | - $rate = $value; |
|
332 | - } else { |
|
333 | - $taxes = [0]; |
|
334 | - } |
|
335 | - } |
|
336 | - } |
|
337 | - foreach ($taxes as $key => $tax) { |
|
310 | + } |
|
311 | + } else {//If user from other Country |
|
312 | + |
|
313 | + $taxClassId = Tax::where('state', $geoip_state)->orWhere('country', $geoip_country)->pluck('tax_classes_id')->first(); |
|
314 | + |
|
315 | + if ($taxClassId) { //if state equals the user State or country equals user country |
|
316 | + |
|
317 | + $taxes = $this->getTaxByPriority($taxClassId); |
|
318 | + $value = $this->getValueForOthers($productid, $taxClassId, $taxes); |
|
319 | + if ($value == '') { |
|
320 | + $status = 0; |
|
321 | + } |
|
322 | + $rate = $value; |
|
323 | + } else {//if Tax is selected for Any Country Any State |
|
324 | + $taxClassId = Tax::where('country', '')->where('state', 'Any State')->pluck('tax_classes_id')->first(); |
|
325 | + if ($taxClassId) { |
|
326 | + $taxes = $this->getTaxByPriority($taxClassId); |
|
327 | + $value = $this->getValueForOthers($productid, $taxClassId, $taxes); |
|
328 | + if ($value == '') { |
|
329 | + $status = 0; |
|
330 | + } |
|
331 | + $rate = $value; |
|
332 | + } else { |
|
333 | + $taxes = [0]; |
|
334 | + } |
|
335 | + } |
|
336 | + } |
|
337 | + foreach ($taxes as $key => $tax) { |
|
338 | 338 | |
339 | 339 | //All the da a attribute that is sent to the checkout Page if tax_compound=0 |
340 | - if ($taxes[0]) { |
|
341 | - $tax_attribute[$key] = ['name' => $tax->name, 'c_gst'=>$c_gst, 's_gst'=>$s_gst, 'i_gst'=>$i_gst, 'ut_gst'=>$ut_gst, 'state'=>$state_code, 'origin_state'=>$origin_state, 'tax_enable'=>$tax_enable, 'rate'=>$value, 'status'=>$status]; |
|
340 | + if ($taxes[0]) { |
|
341 | + $tax_attribute[$key] = ['name' => $tax->name, 'c_gst'=>$c_gst, 's_gst'=>$s_gst, 'i_gst'=>$i_gst, 'ut_gst'=>$ut_gst, 'state'=>$state_code, 'origin_state'=>$origin_state, 'tax_enable'=>$tax_enable, 'rate'=>$value, 'status'=>$status]; |
|
342 | 342 | |
343 | - $taxCondition[0] = new \Darryldecode\Cart\CartCondition([ |
|
343 | + $taxCondition[0] = new \Darryldecode\Cart\CartCondition([ |
|
344 | 344 | |
345 | 345 | 'name' => 'no compound', |
346 | 346 | 'type' => 'tax', |
347 | 347 | 'target' => 'item', |
348 | 348 | 'value' => $value, |
349 | - ]); |
|
350 | - } else { |
|
351 | - $tax_attribute[0] = ['name' => 'null', 'rate' => 0, 'tax_enable' =>0]; |
|
352 | - $taxCondition[0] = new \Darryldecode\Cart\CartCondition([ |
|
353 | - 'name' => 'null', |
|
354 | - 'type' => 'tax', |
|
355 | - 'target' => 'item', |
|
356 | - 'value' => '0%', |
|
357 | - ]); |
|
358 | - } |
|
359 | - } |
|
360 | - } elseif ($tax_enable == 0) {//If Tax enable is 0 |
|
361 | - $status = 1; |
|
362 | - if ($this->tax_option->findOrFail(1)->tax_enable == 0) { |
|
363 | - $taxClassId = Tax::where('country', '')->where('state', 'Any State')->pluck('tax_classes_id')->first(); //In case of India when other tax is available and tax is not enabled |
|
364 | - if ($taxClassId) { |
|
365 | - $taxes = $this->getTaxByPriority($taxClassId); |
|
366 | - $value = $this->getValueForOthers($productid, $taxClassId, $taxes); |
|
367 | - if ($value == 0) { |
|
368 | - $status = 0; |
|
369 | - } |
|
370 | - $rate = $value; |
|
371 | - foreach ($taxes as $key => $tax) { |
|
372 | - $tax_attribute[$key] = ['name' => $tax->name, 'rate' => $value, 'tax_enable'=>0, 'status' => $status]; |
|
373 | - $taxCondition[$key] = new \Darryldecode\Cart\CartCondition([ |
|
349 | + ]); |
|
350 | + } else { |
|
351 | + $tax_attribute[0] = ['name' => 'null', 'rate' => 0, 'tax_enable' =>0]; |
|
352 | + $taxCondition[0] = new \Darryldecode\Cart\CartCondition([ |
|
353 | + 'name' => 'null', |
|
354 | + 'type' => 'tax', |
|
355 | + 'target' => 'item', |
|
356 | + 'value' => '0%', |
|
357 | + ]); |
|
358 | + } |
|
359 | + } |
|
360 | + } elseif ($tax_enable == 0) {//If Tax enable is 0 |
|
361 | + $status = 1; |
|
362 | + if ($this->tax_option->findOrFail(1)->tax_enable == 0) { |
|
363 | + $taxClassId = Tax::where('country', '')->where('state', 'Any State')->pluck('tax_classes_id')->first(); //In case of India when other tax is available and tax is not enabled |
|
364 | + if ($taxClassId) { |
|
365 | + $taxes = $this->getTaxByPriority($taxClassId); |
|
366 | + $value = $this->getValueForOthers($productid, $taxClassId, $taxes); |
|
367 | + if ($value == 0) { |
|
368 | + $status = 0; |
|
369 | + } |
|
370 | + $rate = $value; |
|
371 | + foreach ($taxes as $key => $tax) { |
|
372 | + $tax_attribute[$key] = ['name' => $tax->name, 'rate' => $value, 'tax_enable'=>0, 'status' => $status]; |
|
373 | + $taxCondition[$key] = new \Darryldecode\Cart\CartCondition([ |
|
374 | 374 | |
375 | 375 | 'name' => $tax->name, |
376 | 376 | 'type' => 'tax', |
377 | 377 | 'target' => 'item', |
378 | 378 | 'value' => $value, |
379 | 379 | ]); |
380 | - } |
|
381 | - } else {//In case of other country when tax is available and tax is not enabled(Applicable when Global Tax class for any country and state is not there) |
|
382 | - $taxClassId = Tax::where('state', $geoip_state)->orWhere('country', $geoip_country)->pluck('tax_classes_id')->first(); |
|
383 | - if ($taxClassId) { //if state equals the user State |
|
384 | - $taxes = $this->getTaxByPriority($taxClassId); |
|
385 | - $value = $this->getValueForOthers($productid, $taxClassId, $taxes); |
|
386 | - if ($value == '') { |
|
387 | - $status = 0; |
|
388 | - } |
|
389 | - $rate = $value; |
|
390 | - } |
|
391 | - foreach ($taxes as $key => $tax) { |
|
392 | - $tax_attribute[$key] = ['name' => $tax->name, 'rate' => $value, 'tax_enable'=>0, 'status' => $status]; |
|
393 | - $taxCondition[$key] = new \Darryldecode\Cart\CartCondition([ |
|
380 | + } |
|
381 | + } else {//In case of other country when tax is available and tax is not enabled(Applicable when Global Tax class for any country and state is not there) |
|
382 | + $taxClassId = Tax::where('state', $geoip_state)->orWhere('country', $geoip_country)->pluck('tax_classes_id')->first(); |
|
383 | + if ($taxClassId) { //if state equals the user State |
|
384 | + $taxes = $this->getTaxByPriority($taxClassId); |
|
385 | + $value = $this->getValueForOthers($productid, $taxClassId, $taxes); |
|
386 | + if ($value == '') { |
|
387 | + $status = 0; |
|
388 | + } |
|
389 | + $rate = $value; |
|
390 | + } |
|
391 | + foreach ($taxes as $key => $tax) { |
|
392 | + $tax_attribute[$key] = ['name' => $tax->name, 'rate' => $value, 'tax_enable'=>0, 'status' => $status]; |
|
393 | + $taxCondition[$key] = new \Darryldecode\Cart\CartCondition([ |
|
394 | 394 | |
395 | 395 | 'name' => $tax->name, |
396 | 396 | 'type' => 'tax', |
397 | 397 | 'target' => 'item', |
398 | 398 | 'value' => $value, |
399 | 399 | ]); |
400 | - } |
|
401 | - } |
|
402 | - } |
|
403 | - } |
|
400 | + } |
|
401 | + } |
|
402 | + } |
|
403 | + } |
|
404 | 404 | } else { |
405 | 405 | $tax_attribute[0] = ['name' => 'null', 'rate' => 0, 'tax_enable' =>0]; |
406 | 406 | $taxCondition[0] = new \Darryldecode\Cart\CartCondition([ |
@@ -64,9 +64,11 @@ discard block |
||
64 | 64 | public function productList(Request $request) |
65 | 65 | { |
66 | 66 | try { |
67 | - if (!empty($_SERVER['HTTP_CLIENT_IP'])) { //check ip from share internet |
|
67 | + if (!empty($_SERVER['HTTP_CLIENT_IP'])) { |
|
68 | +//check ip from share internet |
|
68 | 69 | $ip = $_SERVER['HTTP_CLIENT_IP']; |
69 | - } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { //to check ip is pass from proxy |
|
70 | + } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { |
|
71 | +//to check ip is pass from proxy |
|
70 | 72 | $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; |
71 | 73 | } else { |
72 | 74 | $ip = $_SERVER['REMOTE_ADDR']; |
@@ -204,9 +206,11 @@ discard block |
||
204 | 206 | |
205 | 207 | // $product = $this->product->findOrFail($productid); |
206 | 208 | // dd($product); |
207 | - if (!empty($_SERVER['HTTP_CLIENT_IP'])) { //check ip from share internet |
|
209 | + if (!empty($_SERVER['HTTP_CLIENT_IP'])) { |
|
210 | +//check ip from share internet |
|
208 | 211 | $ip = $_SERVER['HTTP_CLIENT_IP']; |
209 | - } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { //to check ip is pass from proxy |
|
212 | + } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { |
|
213 | +//to check ip is pass from proxy |
|
210 | 214 | $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; |
211 | 215 | } else { |
212 | 216 | $ip = $_SERVER['REMOTE_ADDR']; |
@@ -252,8 +256,10 @@ discard block |
||
252 | 256 | $origin_state = $this->setting->first()->state; //Get the State of origin |
253 | 257 | $tax_class_id = TaxProductRelation::where('product_id', $productid)->pluck('tax_class_id')->toArray(); |
254 | 258 | |
255 | - if ($tax_class_id) {//If the product is allowed for tax (Check in tax_product relation table) |
|
256 | - if ($tax_enable == 1) {//If GST is Enabled |
|
259 | + if ($tax_class_id) { |
|
260 | +//If the product is allowed for tax (Check in tax_product relation table) |
|
261 | + if ($tax_enable == 1) { |
|
262 | +//If GST is Enabled |
|
257 | 263 | |
258 | 264 | $state_code = ''; |
259 | 265 | $c_gst = ''; |
@@ -264,14 +270,16 @@ discard block |
||
264 | 270 | $rate = ''; |
265 | 271 | $status = 1; |
266 | 272 | |
267 | - if ($user_state != '') {//Get the CGST,SGST,IGST,STATE_CODE of the user |
|
273 | + if ($user_state != '') { |
|
274 | +//Get the CGST,SGST,IGST,STATE_CODE of the user |
|
268 | 275 | |
269 | 276 | $c_gst = $user_state->c_gst; |
270 | 277 | $s_gst = $user_state->s_gst; |
271 | 278 | $i_gst = $user_state->i_gst; |
272 | 279 | $ut_gst = $user_state->ut_gst; |
273 | 280 | $state_code = $user_state->state_code; |
274 | - if ($state_code == $origin_state) {//If user and origin state are same |
|
281 | + if ($state_code == $origin_state) { |
|
282 | +//If user and origin state are same |
|
275 | 283 | |
276 | 284 | $taxClassId = TaxClass::where('name', 'Intra State GST')->pluck('id')->toArray(); //Get the class Id of state |
277 | 285 | if ($taxClassId) { |
@@ -284,7 +292,8 @@ discard block |
||
284 | 292 | } else { |
285 | 293 | $taxes = [0]; |
286 | 294 | } |
287 | - } elseif ($state_code != $origin_state && $ut_gst == 'NULL') {//If user is from other state |
|
295 | + } elseif ($state_code != $origin_state && $ut_gst == 'NULL') { |
|
296 | +//If user is from other state |
|
288 | 297 | |
289 | 298 | $taxClassId = TaxClass::where('name', 'Inter State GST')->pluck('id')->toArray(); //Get the class Id of state |
290 | 299 | if ($taxClassId) { |
@@ -296,7 +305,8 @@ discard block |
||
296 | 305 | } else { |
297 | 306 | $taxes = [0]; |
298 | 307 | } |
299 | - } elseif ($state_code != $origin_state && $ut_gst != 'NULL') {//if user from Union Territory |
|
308 | + } elseif ($state_code != $origin_state && $ut_gst != 'NULL') { |
|
309 | +//if user from Union Territory |
|
300 | 310 | $taxClassId = TaxClass::where('name', 'Union Territory GST')->pluck('id')->toArray(); //Get the class Id of state |
301 | 311 | if ($taxClassId) { |
302 | 312 | $taxes = $this->getTaxByPriority($taxClassId); |
@@ -308,11 +318,13 @@ discard block |
||
308 | 318 | $taxes = [0]; |
309 | 319 | } |
310 | 320 | } |
311 | - } else {//If user from other Country |
|
321 | + } else { |
|
322 | +//If user from other Country |
|
312 | 323 | |
313 | 324 | $taxClassId = Tax::where('state', $geoip_state)->orWhere('country', $geoip_country)->pluck('tax_classes_id')->first(); |
314 | 325 | |
315 | - if ($taxClassId) { //if state equals the user State or country equals user country |
|
326 | + if ($taxClassId) { |
|
327 | +//if state equals the user State or country equals user country |
|
316 | 328 | |
317 | 329 | $taxes = $this->getTaxByPriority($taxClassId); |
318 | 330 | $value = $this->getValueForOthers($productid, $taxClassId, $taxes); |
@@ -320,7 +332,8 @@ discard block |
||
320 | 332 | $status = 0; |
321 | 333 | } |
322 | 334 | $rate = $value; |
323 | - } else {//if Tax is selected for Any Country Any State |
|
335 | + } else { |
|
336 | +//if Tax is selected for Any Country Any State |
|
324 | 337 | $taxClassId = Tax::where('country', '')->where('state', 'Any State')->pluck('tax_classes_id')->first(); |
325 | 338 | if ($taxClassId) { |
326 | 339 | $taxes = $this->getTaxByPriority($taxClassId); |
@@ -357,7 +370,8 @@ discard block |
||
357 | 370 | ]); |
358 | 371 | } |
359 | 372 | } |
360 | - } elseif ($tax_enable == 0) {//If Tax enable is 0 |
|
373 | + } elseif ($tax_enable == 0) { |
|
374 | +//If Tax enable is 0 |
|
361 | 375 | $status = 1; |
362 | 376 | if ($this->tax_option->findOrFail(1)->tax_enable == 0) { |
363 | 377 | $taxClassId = Tax::where('country', '')->where('state', 'Any State')->pluck('tax_classes_id')->first(); //In case of India when other tax is available and tax is not enabled |
@@ -378,9 +392,11 @@ discard block |
||
378 | 392 | 'value' => $value, |
379 | 393 | ]); |
380 | 394 | } |
381 | - } else {//In case of other country when tax is available and tax is not enabled(Applicable when Global Tax class for any country and state is not there) |
|
395 | + } else { |
|
396 | +//In case of other country when tax is available and tax is not enabled(Applicable when Global Tax class for any country and state is not there) |
|
382 | 397 | $taxClassId = Tax::where('state', $geoip_state)->orWhere('country', $geoip_country)->pluck('tax_classes_id')->first(); |
383 | - if ($taxClassId) { //if state equals the user State |
|
398 | + if ($taxClassId) { |
|
399 | +//if state equals the user State |
|
384 | 400 | $taxes = $this->getTaxByPriority($taxClassId); |
385 | 401 | $value = $this->getValueForOthers($productid, $taxClassId, $taxes); |
386 | 402 | if ($value == '') { |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | ], [ |
120 | 120 | 'domain.*.required' => 'Please provide Domain name', |
121 | 121 | //'domain.*.url' => 'Domain name is not valid', |
122 | - ]); |
|
122 | + ]); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | try { |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | $items = \Cart::getContent(); |
480 | 480 | foreach ($items as $item) { |
481 | 481 | |
482 | - //this is product |
|
482 | + //this is product |
|
483 | 483 | $id = $item->id; |
484 | 484 | $this->AddProductToOrder($id); |
485 | 485 | } |
@@ -34,15 +34,15 @@ |
||
34 | 34 | ->addColumn('#', function ($model) { |
35 | 35 | return "<input type='checkbox' value=".$model->id.' name=select[] id=check>'; |
36 | 36 | }) |
37 | - ->addColumn('name', function ($model) { |
|
38 | - return ucfirst($model->name); |
|
39 | - }) |
|
37 | + ->addColumn('name', function ($model) { |
|
38 | + return ucfirst($model->name); |
|
39 | + }) |
|
40 | 40 | ->addColumn('type', function ($model) { |
41 | 41 | return $model->type; |
42 | 42 | }) |
43 | - ->addColumn('created_at', function ($model) { |
|
44 | - return $model->created_at; |
|
45 | - }) |
|
43 | + ->addColumn('created_at', function ($model) { |
|
44 | + return $model->created_at; |
|
45 | + }) |
|
46 | 46 | // ->showColumns('name', 'type', 'created_at') |
47 | 47 | ->addColumn('content', function ($model) { |
48 | 48 | return str_limit($model->content, 10, '...'); |
@@ -31,23 +31,23 @@ |
||
31 | 31 | public function getPages() |
32 | 32 | { |
33 | 33 | return \DataTables::of($this->widget->get()) |
34 | - ->addColumn('#', function ($model) { |
|
34 | + ->addColumn('#', function($model) { |
|
35 | 35 | return "<input type='checkbox' value=".$model->id.' name=select[] id=check>'; |
36 | 36 | }) |
37 | - ->addColumn('name', function ($model) { |
|
37 | + ->addColumn('name', function($model) { |
|
38 | 38 | return ucfirst($model->name); |
39 | 39 | }) |
40 | - ->addColumn('type', function ($model) { |
|
40 | + ->addColumn('type', function($model) { |
|
41 | 41 | return $model->type; |
42 | 42 | }) |
43 | - ->addColumn('created_at', function ($model) { |
|
43 | + ->addColumn('created_at', function($model) { |
|
44 | 44 | return $model->created_at; |
45 | 45 | }) |
46 | 46 | // ->showColumns('name', 'type', 'created_at') |
47 | - ->addColumn('content', function ($model) { |
|
47 | + ->addColumn('content', function($model) { |
|
48 | 48 | return str_limit($model->content, 10, '...'); |
49 | 49 | }) |
50 | - ->addColumn('action', function ($model) { |
|
50 | + ->addColumn('action', function($model) { |
|
51 | 51 | return '<a href='.url('widgets/'.$model->id.'/edit')." class='btn btn-sm btn-primary'>Edit</a>"; |
52 | 52 | }) |
53 | 53 | ->rawColumns(['name', 'type', 'created_at', 'content', 'action']) |