@@ -49,16 +49,16 @@ discard block |
||
| 49 | 49 | $this->domain($domain, $join); |
| 50 | 50 | |
| 51 | 51 | $join = $join->orderBy('created_at', 'desc') |
| 52 | - ->select( |
|
| 53 | - 'orders.id', |
|
| 54 | - 'orders.created_at', |
|
| 55 | - 'client', |
|
| 52 | + ->select( |
|
| 53 | + 'orders.id', |
|
| 54 | + 'orders.created_at', |
|
| 55 | + 'client', |
|
| 56 | 56 | 'price_override', |
| 57 | - 'order_status', |
|
| 58 | - 'product', |
|
| 59 | - 'number', |
|
| 60 | - 'serial_key' |
|
| 61 | - ); |
|
| 57 | + 'order_status', |
|
| 58 | + 'product', |
|
| 59 | + 'number', |
|
| 60 | + 'serial_key' |
|
| 61 | + ); |
|
| 62 | 62 | |
| 63 | 63 | return $join; |
| 64 | 64 | } catch (\Exception $ex) { |
@@ -268,17 +268,17 @@ discard block |
||
| 268 | 268 | case '1': |
| 269 | 269 | $lastFour = '000'.$agents; |
| 270 | 270 | break; |
| 271 | - case '2': |
|
| 271 | + case '2': |
|
| 272 | 272 | |
| 273 | 273 | $lastFour = '00'.$agents; |
| 274 | - break; |
|
| 275 | - case '3': |
|
| 274 | + break; |
|
| 275 | + case '3': |
|
| 276 | 276 | $lastFour = '0'.$agents; |
| 277 | - break; |
|
| 278 | - case '4': |
|
| 277 | + break; |
|
| 278 | + case '4': |
|
| 279 | 279 | $lastFour = $agents; |
| 280 | 280 | |
| 281 | - break; |
|
| 281 | + break; |
|
| 282 | 282 | default: |
| 283 | 283 | $lastFour = '0000'; |
| 284 | 284 | break; |
@@ -125,7 +125,7 @@ |
||
| 125 | 125 | ]); |
| 126 | 126 | $this->createOrderInvoiceRelation($orderid, $invoice->id); |
| 127 | 127 | $items = $controller->createInvoiceItemsByAdmin($invoice->id, $product->id, |
| 128 | - $code, $cost, $currency, $qty = 1, $agents); |
|
| 128 | + $code, $cost, $currency, $qty = 1, $agents); |
|
| 129 | 129 | |
| 130 | 130 | return $items; |
| 131 | 131 | } catch (Exception $ex) { |
@@ -134,14 +134,16 @@ |
||
| 134 | 134 | $planid = Session::get('plan'); |
| 135 | 135 | } |
| 136 | 136 | $plan = Plan::where('id', $planid)->where('product', $productid)->first(); |
| 137 | - if ($plan) { //Get the Total Plan Cost if the Plan Exists For a Product |
|
| 137 | + if ($plan) { |
|
| 138 | +//Get the Total Plan Cost if the Plan Exists For a Product |
|
| 138 | 139 | $months = 1; |
| 139 | 140 | $cont = new CartController(); |
| 140 | 141 | $currency = $cont->currency($userid); |
| 141 | 142 | $product = Product::find($productid); |
| 142 | 143 | $days = $plan->periods->pluck('days')->first(); |
| 143 | 144 | $price = ($product->planRelation->find($planid)->planPrice->where('currency', $currency['currency'])->first()->add_price); |
| 144 | - if ($days) { //If Period Is defined for a Particular Plan ie no. of Days Generated |
|
| 145 | + if ($days) { |
|
| 146 | +//If Period Is defined for a Particular Plan ie no. of Days Generated |
|
| 145 | 147 | $months = $days >= '365' ? $days / 30 / 12 : $days / 30; |
| 146 | 148 | } |
| 147 | 149 | $finalPrice = str_replace(',', '', $price); |
@@ -96,7 +96,8 @@ discard block |
||
| 96 | 96 | { |
| 97 | 97 | try { |
| 98 | 98 | $plan = ''; |
| 99 | - if ($request->has('subscription')) {//put he Plan id sent into session variable |
|
| 99 | + if ($request->has('subscription')) { |
|
| 100 | +//put he Plan id sent into session variable |
|
| 100 | 101 | $plan = $request->get('subscription'); |
| 101 | 102 | Session::put('plan', $plan); |
| 102 | 103 | } |
@@ -127,7 +128,8 @@ discard block |
||
| 127 | 128 | foreach ($cartCollection as $item) { |
| 128 | 129 | $attributes[] = $item->attributes; |
| 129 | 130 | $cart_currency = $attributes[0]['currency']['currency']; |
| 130 | - if (\Auth::user()) {//If User is Loggen in and his currency changes after logginng in then remove his previous order from cart |
|
| 131 | + if (\Auth::user()) { |
|
| 132 | +//If User is Loggen in and his currency changes after logginng in then remove his previous order from cart |
|
| 131 | 133 | $currency = \Auth::user()->currency; |
| 132 | 134 | if ($cart_currency != $currency) { |
| 133 | 135 | $id = $item->id; |
@@ -175,8 +177,10 @@ discard block |
||
| 175 | 177 | $origin_state = $this->setting->first()->state; //Get the State of origin |
| 176 | 178 | $tax_class_id = TaxProductRelation::where('product_id', $productid)->pluck('tax_class_id')->toArray(); |
| 177 | 179 | |
| 178 | - if (count($tax_class_id) > 0) {//If the product is allowed for tax (Check in tax_product relation table) |
|
| 179 | - if ($tax_enable == 1) {//If GST is Enabled |
|
| 180 | + if (count($tax_class_id) > 0) { |
|
| 181 | +//If the product is allowed for tax (Check in tax_product relation table) |
|
| 182 | + if ($tax_enable == 1) { |
|
| 183 | +//If GST is Enabled |
|
| 180 | 184 | |
| 181 | 185 | $details = $this->getDetailsWhenUserStateIsIndian( |
| 182 | 186 | $user_state, |
@@ -220,7 +224,8 @@ discard block |
||
| 220 | 224 | ]); |
| 221 | 225 | } |
| 222 | 226 | } |
| 223 | - } elseif ($tax_enable == 0) {//If Tax enable is 0 and other tax is available |
|
| 227 | + } elseif ($tax_enable == 0) { |
|
| 228 | +//If Tax enable is 0 and other tax is available |
|
| 224 | 229 | |
| 225 | 230 | $details = $this->whenOtherTaxAvailableAndTaxNotEnable($tax_class_id, $productid, $geoip_state, $geoip_country); |
| 226 | 231 | |
@@ -472,7 +477,8 @@ discard block |
||
| 472 | 477 | try { |
| 473 | 478 | $currency = Setting::find(1)->default_currency; |
| 474 | 479 | $currency_symbol = Setting::find(1)->default_symbol; |
| 475 | - if (!\Auth::user()) {//When user is not logged in |
|
| 480 | + if (!\Auth::user()) { |
|
| 481 | +//When user is not logged in |
|
| 476 | 482 | $cont = new \App\Http\Controllers\Front\PageController(); |
| 477 | 483 | $location = $cont->getLocation(); |
| 478 | 484 | $country = self::findCountryByGeoip($location['iso_code']); |
@@ -487,7 +493,8 @@ discard block |
||
| 487 | 493 | $currency = \Auth::user()->currency; |
| 488 | 494 | $currency_symbol = \Auth::user()->currency_symbol; |
| 489 | 495 | } |
| 490 | - if ($userid != '') {//For Admin Panel Clients |
|
| 496 | + if ($userid != '') { |
|
| 497 | +//For Admin Panel Clients |
|
| 491 | 498 | $currencyAndSymbol = self::getCurrency($userid); |
| 492 | 499 | $currency = $currencyAndSymbol['currency']; |
| 493 | 500 | $currency_symbol = $currencyAndSymbol['symbol']; |
@@ -178,13 +178,13 @@ discard block |
||
| 178 | 178 | if (count($tax_class_id) > 0) {//If the product is allowed for tax (Check in tax_product relation table) |
| 179 | 179 | if ($tax_enable == 1) {//If GST is Enabled |
| 180 | 180 | |
| 181 | - $details = $this->getDetailsWhenUserStateIsIndian( |
|
| 182 | - $user_state, |
|
| 183 | - $origin_state, |
|
| 184 | - $productid, |
|
| 185 | - $geoip_state, |
|
| 186 | - $geoip_country |
|
| 187 | - ); |
|
| 181 | + $details = $this->getDetailsWhenUserStateIsIndian( |
|
| 182 | + $user_state, |
|
| 183 | + $origin_state, |
|
| 184 | + $productid, |
|
| 185 | + $geoip_state, |
|
| 186 | + $geoip_country |
|
| 187 | + ); |
|
| 188 | 188 | $c_gst = $details['cgst']; |
| 189 | 189 | $s_gst = $details['sgst']; |
| 190 | 190 | $i_gst = $details['igst']; |
@@ -202,21 +202,21 @@ discard block |
||
| 202 | 202 | if ($taxes[0]) { |
| 203 | 203 | $tax_attribute[$key] = ['name' => $tax->name, 'c_gst'=>$c_gst, |
| 204 | 204 | |
| 205 | - 's_gst' => $s_gst, 'i_gst'=>$i_gst, 'ut_gst'=>$ut_gst, |
|
| 205 | + 's_gst' => $s_gst, 'i_gst'=>$i_gst, 'ut_gst'=>$ut_gst, |
|
| 206 | 206 | 'state' => $state_code, 'origin_state'=>$origin_state, |
| 207 | - 'tax_enable' => $tax_enable, 'rate'=>$value, 'status'=>$status, ]; |
|
| 207 | + 'tax_enable' => $tax_enable, 'rate'=>$value, 'status'=>$status, ]; |
|
| 208 | 208 | |
| 209 | 209 | $taxCondition[0] = new \Darryldecode\Cart\CartCondition([ |
| 210 | 210 | 'name' => 'no compound', 'type' => 'tax', |
| 211 | 211 | 'target' => 'item', 'value' => $value, |
| 212 | - ]); |
|
| 212 | + ]); |
|
| 213 | 213 | } else { |
| 214 | 214 | $tax_attribute[0] = ['name' => 'null', 'rate' => 0, 'tax_enable' =>0]; |
| 215 | 215 | $taxCondition[0] = new \Darryldecode\Cart\CartCondition([ |
| 216 | - 'name' => 'null', 'type' => 'tax', |
|
| 217 | - 'target' => 'item', 'value' => '0%', |
|
| 218 | - 'rate' => 0, 'tax_enable' =>0, |
|
| 219 | - ]); |
|
| 216 | + 'name' => 'null', 'type' => 'tax', |
|
| 217 | + 'target' => 'item', 'value' => '0%', |
|
| 218 | + 'rate' => 0, 'tax_enable' =>0, |
|
| 219 | + ]); |
|
| 220 | 220 | } |
| 221 | 221 | } |
| 222 | 222 | } elseif ($tax_enable == 0) {//If Tax enable is 0 and other tax is available |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | $subregion = \App\Model\Common\State::where('state_subdivision_code', $code)->first(); |
| 353 | 353 | if ($subregion) { |
| 354 | 354 | $result = ['id' => $subregion->state_subdivision_code, |
| 355 | - 'name' => $subregion->state_subdivision_name, ]; |
|
| 355 | + 'name' => $subregion->state_subdivision_name, ]; |
|
| 356 | 356 | } |
| 357 | 357 | |
| 358 | 358 | return $result; |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | $paymentRenewal = $this->updateInvoicePayment( |
| 158 | 158 | $invoiceid, |
| 159 | 159 | $payment_method, |
| 160 | - $payment_status, |
|
| 160 | + $payment_status, |
|
| 161 | 161 | $payment_date, |
| 162 | 162 | $amount |
| 163 | 163 | ); |
@@ -215,15 +215,15 @@ discard block |
||
| 215 | 215 | |
| 216 | 216 | return view( |
| 217 | 217 | 'themes.default1.invoice.payment', |
| 218 | - compact( |
|
| 219 | - 'invoice_status', |
|
| 220 | - 'payment_status', |
|
| 221 | - 'payment_method', |
|
| 222 | - 'invoice_id', |
|
| 223 | - 'domain', |
|
| 224 | - 'invoice', |
|
| 225 | - 'userid' |
|
| 226 | - ) |
|
| 218 | + compact( |
|
| 219 | + 'invoice_status', |
|
| 220 | + 'payment_status', |
|
| 221 | + 'payment_method', |
|
| 222 | + 'invoice_id', |
|
| 223 | + 'domain', |
|
| 224 | + 'invoice', |
|
| 225 | + 'userid' |
|
| 226 | + ) |
|
| 227 | 227 | ); |
| 228 | 228 | } |
| 229 | 229 | |
@@ -90,10 +90,12 @@ discard block |
||
| 90 | 90 | |
| 91 | 91 | public function getAgents($agents, $productid, $plan) |
| 92 | 92 | { |
| 93 | - if (!$agents) {//If agents is not received in the request in the case when |
|
| 93 | + if (!$agents) { |
|
| 94 | +//If agents is not received in the request in the case when |
|
| 94 | 95 | // 'modify agent' is not allowed for the Product,get the no of Agents from the Plan Table. |
| 95 | 96 | $planForAgent = Product::find($productid)->planRelation->find($plan); |
| 96 | - if ($planForAgent) {//If Plan Exists For the Product ie not a Product without Plan |
|
| 97 | + if ($planForAgent) { |
|
| 98 | +//If Plan Exists For the Product ie not a Product without Plan |
|
| 97 | 99 | $noOfAgents = $planForAgent->planPrice->first()->no_of_agents; |
| 98 | 100 | $agents = $noOfAgents ? $noOfAgents : 0; //If no. of Agents is specified then that,else 0(Unlimited Agents) |
| 99 | 101 | } else { |
@@ -106,7 +108,8 @@ discard block |
||
| 106 | 108 | |
| 107 | 109 | public function getQuantity($qty, $productid, $plan) |
| 108 | 110 | { |
| 109 | - if (!$qty) {//If quantity is not received in the request in the case when 'modify quantity' is not allowed for the Product,get the Product qUANTITY from the Plan Table. |
|
| 111 | + if (!$qty) { |
|
| 112 | +//If quantity is not received in the request in the case when 'modify quantity' is not allowed for the Product,get the Product qUANTITY from the Plan Table. |
|
| 110 | 113 | $planForQty = Product::find($productid)->planRelation->find($plan); |
| 111 | 114 | if ($planForQty) { |
| 112 | 115 | $quantity = Product::find($productid)->planRelation->find($plan)->planPrice->first()->product_quantity; |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | public function editUpdateExpiry(Request $request) |
| 23 | 23 | { |
| 24 | 24 | $this->validate($request, [ |
| 25 | - 'date' => 'required', |
|
| 25 | + 'date' => 'required', |
|
| 26 | 26 | ]); |
| 27 | 27 | |
| 28 | 28 | try { |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | public function editLicenseExpiry(Request $request) |
| 68 | 68 | { |
| 69 | 69 | $this->validate($request, [ |
| 70 | - 'date' => 'required', |
|
| 70 | + 'date' => 'required', |
|
| 71 | 71 | ]); |
| 72 | 72 | |
| 73 | 73 | try { |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | public function editSupportExpiry(Request $request) |
| 113 | 113 | { |
| 114 | 114 | $this->validate($request, [ |
| 115 | - 'date' => 'required', |
|
| 115 | + 'date' => 'required', |
|
| 116 | 116 | ]); |
| 117 | 117 | |
| 118 | 118 | try { |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $status = $request->input('status'); |
| 61 | 61 | |
| 62 | 62 | return view('themes.default1.common.dashboard', compact('allowedCurrencies1','allowedCurrencies2','currency1Symbol','currency2Symbol','totalSalesCurrency2', 'totalSalesCurrency1', 'yearlySalesCurrency2', 'yearlySalesCurrency1', 'monthlySalesCurrency2', 'monthlySalesCurrency1', 'users','count_users', 'arraylists', 'productSoldlists','orders','subscriptions','invoices', 'products', 'arrayCountList', 'pendingPaymentCurrency2', 'pendingPaymentCurrency1', 'status','startSubscriptionDate', |
| 63 | - 'endSubscriptionDate')); |
|
| 63 | + 'endSubscriptionDate')); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | /** |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | // dd($currentYear,$currentMonth ); |
| 158 | 158 | $total = Invoice::whereYear('created_at', '=', $currentYear)->whereMonth('created_at', '=', $currentMonth) |
| 159 | 159 | ->where('currency', $allowedCurrencies1) |
| 160 | - ->where('status', '=', 'success') |
|
| 160 | + ->where('status', '=', 'success') |
|
| 161 | 161 | ->pluck('grand_total')->all(); |
| 162 | 162 | $grandTotal = array_sum($total); |
| 163 | 163 | |
@@ -204,9 +204,9 @@ discard block |
||
| 204 | 204 | public function getAllUsers() |
| 205 | 205 | { |
| 206 | 206 | $allUsers = User::orderBy('created_at', 'desc')->where('active', 1)->where('mobile_verified', 1) |
| 207 | - ->take(20) |
|
| 208 | - ->get() |
|
| 209 | - ->toArray(); |
|
| 207 | + ->take(20) |
|
| 208 | + ->get() |
|
| 209 | + ->toArray(); |
|
| 210 | 210 | |
| 211 | 211 | return $allUsers; |
| 212 | 212 | } |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | $dayUtc = new Carbon('-30 days'); |
| 242 | 242 | $minus30Day = $dayUtc->toDateTimeString(); |
| 243 | 243 | $recentOrders = Order::where('created_at', '>', $minus30Day)->orderBy('created_at', 'desc') |
| 244 | - ->where('price_override', '>', 0)->get(); |
|
| 244 | + ->where('price_override', '>', 0)->get(); |
|
| 245 | 245 | |
| 246 | 246 | return $recentOrders; |
| 247 | 247 | } |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | $endSubscriptionDate = date('Y-m-d', strtotime('+3 months')); |
| 60 | 60 | $status = $request->input('status'); |
| 61 | 61 | |
| 62 | - return view('themes.default1.common.dashboard', compact('allowedCurrencies1','allowedCurrencies2','currency1Symbol','currency2Symbol','totalSalesCurrency2', 'totalSalesCurrency1', 'yearlySalesCurrency2', 'yearlySalesCurrency1', 'monthlySalesCurrency2', 'monthlySalesCurrency1', 'users','count_users', 'arraylists', 'productSoldlists','orders','subscriptions','invoices', 'products', 'arrayCountList', 'pendingPaymentCurrency2', 'pendingPaymentCurrency1', 'status','startSubscriptionDate', |
|
| 62 | + return view('themes.default1.common.dashboard', compact('allowedCurrencies1', 'allowedCurrencies2', 'currency1Symbol', 'currency2Symbol', 'totalSalesCurrency2', 'totalSalesCurrency1', 'yearlySalesCurrency2', 'yearlySalesCurrency1', 'monthlySalesCurrency2', 'monthlySalesCurrency1', 'users', 'count_users', 'arraylists', 'productSoldlists', 'orders', 'subscriptions', 'invoices', 'products', 'arrayCountList', 'pendingPaymentCurrency2', 'pendingPaymentCurrency1', 'status', 'startSubscriptionDate', |
|
| 63 | 63 | 'endSubscriptionDate')); |
| 64 | 64 | } |
| 65 | 65 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | $serial_key = $this->checkSerialKey($faveo_encrypted_key, $order_number); |
| 97 | 97 | |
| 98 | 98 | \Log::emergency(json_encode(['domain' => $request->input('domain'), |
| 99 | - 'serial' => $serial_key, 'order' => $order_number, ])); |
|
| 99 | + 'serial' => $serial_key, 'order' => $order_number, ])); |
|
| 100 | 100 | $result = []; |
| 101 | 101 | if ($request_type == 'install') { |
| 102 | 102 | $result = $this->verificationResult($order_number, $serial_key); |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | $faveo_serial_key = $request->input('serial_key'); |
| 349 | 349 | $encrypted_serial = Crypt::encrypt($faveo_serial_key); |
| 350 | 350 | $this_order = $order |
| 351 | - ->where('number', $faveo_encrypted_order_number) |
|
| 351 | + ->where('number', $faveo_encrypted_order_number) |
|
| 352 | 352 | ->where('serial_key', $encrypted_serial) |
| 353 | 353 | ->first(); |
| 354 | 354 | if ($this_order) { |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | public function checkUpdatesExpiry(Request $request) |
| 399 | 399 | { |
| 400 | 400 | $v = \Validator::make($request->all(), [ |
| 401 | - 'order_number' => 'required', |
|
| 401 | + 'order_number' => 'required', |
|
| 402 | 402 | ]); |
| 403 | 403 | if ($v->fails()) { |
| 404 | 404 | $error = $v->errors(); |
@@ -275,7 +275,7 @@ |
||
| 275 | 275 | $data = $template->data; |
| 276 | 276 | $replace = [ |
| 277 | 277 | 'name' => $user->first_name.' '.$user->last_name, |
| 278 | - 'serialkeyurl' => $myaccounturl, |
|
| 278 | + 'serialkeyurl' => $myaccounturl, |
|
| 279 | 279 | 'downloadurl' => $downloadurl, |
| 280 | 280 | 'invoiceurl' => $invoiceurl, |
| 281 | 281 | 'product' => $product, |