@@ -34,21 +34,21 @@ |
||
| 34 | 34 | $allTypes = $this->productType->select('id', 'name')->get(); |
| 35 | 35 | |
| 36 | 36 | return \DataTables::of($allTypes) |
| 37 | - ->addColumn('checkbox', function ($model) { |
|
| 38 | - return "<input type='checkbox' class='type_checkbox' |
|
| 37 | + ->addColumn('checkbox', function ($model) { |
|
| 38 | + return "<input type='checkbox' class='type_checkbox' |
|
| 39 | 39 | value=".$model->id.' name=select[] id=check>'; |
| 40 | - }) |
|
| 41 | - ->addColumn('type_name', function ($model) { |
|
| 42 | - return ucfirst($model->name); |
|
| 43 | - }) |
|
| 44 | - ->addColumn('action', function ($model) { |
|
| 45 | - return "<p><button data-toggle='modal' |
|
| 40 | + }) |
|
| 41 | + ->addColumn('type_name', function ($model) { |
|
| 42 | + return ucfirst($model->name); |
|
| 43 | + }) |
|
| 44 | + ->addColumn('action', function ($model) { |
|
| 45 | + return "<p><button data-toggle='modal' |
|
| 46 | 46 | data-id=".$model->id." data-name= '$model->name' |
| 47 | 47 | class='btn btn-sm btn-primary btn-xs editType'><i class='fa fa-edit' |
| 48 | 48 | style='color:white;'> </i> Edit</button> </p>"; |
| 49 | - }) |
|
| 50 | - ->rawColumns(['checkbox', 'type_name', 'action']) |
|
| 51 | - ->make(true); |
|
| 49 | + }) |
|
| 50 | + ->rawColumns(['checkbox', 'type_name', 'action']) |
|
| 51 | + ->make(true); |
|
| 52 | 52 | } catch (\Exception $ex) { |
| 53 | 53 | Bugsnag::notifyException($ex); |
| 54 | 54 | |
@@ -34,14 +34,14 @@ |
||
| 34 | 34 | $allTypes = $this->productType->select('id', 'name')->get(); |
| 35 | 35 | |
| 36 | 36 | return \DataTables::of($allTypes) |
| 37 | - ->addColumn('checkbox', function ($model) { |
|
| 37 | + ->addColumn('checkbox', function($model) { |
|
| 38 | 38 | return "<input type='checkbox' class='type_checkbox' |
| 39 | 39 | value=".$model->id.' name=select[] id=check>'; |
| 40 | 40 | }) |
| 41 | - ->addColumn('type_name', function ($model) { |
|
| 41 | + ->addColumn('type_name', function($model) { |
|
| 42 | 42 | return ucfirst($model->name); |
| 43 | 43 | }) |
| 44 | - ->addColumn('action', function ($model) { |
|
| 44 | + ->addColumn('action', function($model) { |
|
| 45 | 45 | return "<p><button data-toggle='modal' |
| 46 | 46 | data-id=".$model->id." data-name= '$model->name' |
| 47 | 47 | class='btn btn-sm btn-primary btn-xs editType'><i class='fa fa-edit' |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | { |
| 9 | 9 | protected $table = 'payments'; |
| 10 | 10 | protected $fillable = ['parent_id', 'invoice_id', 'amount', |
| 11 | - 'payment_method', 'user_id', 'payment_status', 'created_at', 'amt_to_credit', ]; |
|
| 11 | + 'payment_method', 'user_id', 'payment_status', 'created_at', 'amt_to_credit', ]; |
|
| 12 | 12 | |
| 13 | 13 | public function invoice() |
| 14 | 14 | { |
@@ -36,9 +36,9 @@ |
||
| 36 | 36 | value=".$model->id.' name=select[] id=check>'; |
| 37 | 37 | }) |
| 38 | 38 | |
| 39 | - ->addColumn('name', function ($model) { |
|
| 40 | - return $model->name; |
|
| 41 | - }) |
|
| 39 | + ->addColumn('name', function ($model) { |
|
| 40 | + return $model->name; |
|
| 41 | + }) |
|
| 42 | 42 | |
| 43 | 43 | ->addColumn('action', function ($model) { |
| 44 | 44 | return '<a href='.url('chat/'.$model->id.'/edit'). |
@@ -32,21 +32,21 @@ |
||
| 32 | 32 | { |
| 33 | 33 | try { |
| 34 | 34 | return \DataTables::of($this->script->get()) |
| 35 | - ->addColumn('checkbox', function ($model) { |
|
| 35 | + ->addColumn('checkbox', function($model) { |
|
| 36 | 36 | return "<input type='checkbox' class='chat_checkbox' |
| 37 | 37 | value=".$model->id.' name=select[] id=check>'; |
| 38 | 38 | }) |
| 39 | 39 | |
| 40 | - ->addColumn('name', function ($model) { |
|
| 40 | + ->addColumn('name', function($model) { |
|
| 41 | 41 | return $model->name; |
| 42 | 42 | }) |
| 43 | 43 | |
| 44 | - ->addColumn('action', function ($model) { |
|
| 44 | + ->addColumn('action', function($model) { |
|
| 45 | 45 | return '<a href='.url('chat/'.$model->id.'/edit'). |
| 46 | 46 | " class='btn btn-sm btn-primary btn-xs'><i class='fa fa-edit' |
| 47 | 47 | style='color:white;'> </i> Edit</a>"; |
| 48 | 48 | }) |
| 49 | - ->rawColumns(['checkbox', 'name', 'action']) |
|
| 49 | + ->rawColumns(['checkbox', 'name', 'action']) |
|
| 50 | 50 | ->make(true); |
| 51 | 51 | } catch (\Exception $ex) { |
| 52 | 52 | return redirect()->back()->with('fails', $ex->getMessage()); |
@@ -31,19 +31,19 @@ |
||
| 31 | 31 | public function getPages() |
| 32 | 32 | { |
| 33 | 33 | return \DataTables::of($this->widget->get()) |
| 34 | - ->addColumn('checkbox', function ($model) { |
|
| 35 | - return "<input type='checkbox' class='widget_checkbox' |
|
| 34 | + ->addColumn('checkbox', function ($model) { |
|
| 35 | + return "<input type='checkbox' class='widget_checkbox' |
|
| 36 | 36 | value=".$model->id.' name=select[] id=check>'; |
| 37 | - }) |
|
| 38 | - ->addColumn('name', function ($model) { |
|
| 39 | - return ucfirst($model->name); |
|
| 40 | - }) |
|
| 37 | + }) |
|
| 38 | + ->addColumn('name', function ($model) { |
|
| 39 | + return ucfirst($model->name); |
|
| 40 | + }) |
|
| 41 | 41 | ->addColumn('type', function ($model) { |
| 42 | 42 | return $model->type; |
| 43 | 43 | }) |
| 44 | - ->addColumn('created_at', function ($model) { |
|
| 45 | - return $model->created_at; |
|
| 46 | - }) |
|
| 44 | + ->addColumn('created_at', function ($model) { |
|
| 45 | + return $model->created_at; |
|
| 46 | + }) |
|
| 47 | 47 | // ->showColumns('name', 'type', 'created_at') |
| 48 | 48 | ->addColumn('content', function ($model) { |
| 49 | 49 | return str_limit($model->content, 10, '...'); |
@@ -31,24 +31,24 @@ |
||
| 31 | 31 | public function getPages() |
| 32 | 32 | { |
| 33 | 33 | return \DataTables::of($this->widget->get()) |
| 34 | - ->addColumn('checkbox', function ($model) { |
|
| 34 | + ->addColumn('checkbox', function($model) { |
|
| 35 | 35 | return "<input type='checkbox' class='widget_checkbox' |
| 36 | 36 | value=".$model->id.' name=select[] id=check>'; |
| 37 | 37 | }) |
| 38 | - ->addColumn('name', function ($model) { |
|
| 38 | + ->addColumn('name', function($model) { |
|
| 39 | 39 | return ucfirst($model->name); |
| 40 | 40 | }) |
| 41 | - ->addColumn('type', function ($model) { |
|
| 41 | + ->addColumn('type', function($model) { |
|
| 42 | 42 | return $model->type; |
| 43 | 43 | }) |
| 44 | - ->addColumn('created_at', function ($model) { |
|
| 44 | + ->addColumn('created_at', function($model) { |
|
| 45 | 45 | return $model->created_at; |
| 46 | 46 | }) |
| 47 | 47 | // ->showColumns('name', 'type', 'created_at') |
| 48 | - ->addColumn('content', function ($model) { |
|
| 48 | + ->addColumn('content', function($model) { |
|
| 49 | 49 | return str_limit($model->content, 10, '...'); |
| 50 | 50 | }) |
| 51 | - ->addColumn('action', function ($model) { |
|
| 51 | + ->addColumn('action', function($model) { |
|
| 52 | 52 | return '<a href='.url('widgets/'.$model->id.'/edit')." |
| 53 | 53 | class='btn btn-sm btn-primary btn-xs'><i class='fa fa-edit' |
| 54 | 54 | style='color:white;'> </i> Edit</a>"; |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | $symbol = Currency::where('code', $currency)->pluck('symbol')->first(); |
| 37 | 37 | $orders = $order->where('client', $clientid)->get(); |
| 38 | 38 | |
| 39 | - return view('themes.default1.invoice.newpayment', compact('clientid', 'client', 'invoices', 'orders', |
|
| 39 | + return view('themes.default1.invoice.newpayment', compact('clientid', 'client', 'invoices', 'orders', |
|
| 40 | 40 | 'invoiceSum', 'amountReceived', 'pendingAmount', 'currency', 'symbol')); |
| 41 | 41 | } catch (Exception $ex) { |
| 42 | 42 | return redirect()->back()->with('fails', $ex->getMessage()); |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | $invoicAmount = $request->invoiceAmount; |
| 113 | 113 | $amtToCredit = $request->amtToCredit; |
| 114 | 114 | $payment_status = 'success'; |
| 115 | - $payment = $this->multiplePayment($clientid,$invoiceChecked, $payment_method, |
|
| 115 | + $payment = $this->multiplePayment($clientid, $invoiceChecked, $payment_method, |
|
| 116 | 116 | $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status); |
| 117 | 117 | $response = ['type' => 'success', 'message' => 'Payment Updated Successfully']; |
| 118 | 118 | |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | } |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | - public function multiplePayment($clientid,$invoiceChecked, $payment_method, |
|
| 132 | + public function multiplePayment($clientid, $invoiceChecked, $payment_method, |
|
| 133 | 133 | $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status) |
| 134 | 134 | { |
| 135 | 135 | try { |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | $invoicAmount = $request->invoiceAmount; |
| 205 | 205 | $amtToCredit = $request->amtToCredit; |
| 206 | 206 | $payment_status = 'success'; |
| 207 | - $payment = $this->updatePaymentByInvoice($clientid,$invoiceChecked, $payment_method, |
|
| 207 | + $payment = $this->updatePaymentByInvoice($clientid, $invoiceChecked, $payment_method, |
|
| 208 | 208 | $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status); |
| 209 | 209 | $response = ['type' => 'success', 'message' => 'Payment Updated Successfully']; |
| 210 | 210 | |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | } |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | - public function updatePaymentByInvoice($clientid,$invoiceChecked, $payment_method, |
|
| 221 | + public function updatePaymentByInvoice($clientid, $invoiceChecked, $payment_method, |
|
| 222 | 222 | $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status) |
| 223 | 223 | { |
| 224 | 224 | try { |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $orders = $order->where('client', $clientid)->get(); |
| 38 | 38 | |
| 39 | 39 | return view('themes.default1.invoice.newpayment', compact('clientid', 'client', 'invoices', 'orders', |
| 40 | - 'invoiceSum', 'amountReceived', 'pendingAmount', 'currency', 'symbol')); |
|
| 40 | + 'invoiceSum', 'amountReceived', 'pendingAmount', 'currency', 'symbol')); |
|
| 41 | 41 | } catch (Exception $ex) { |
| 42 | 42 | return redirect()->back()->with('fails', $ex->getMessage()); |
| 43 | 43 | } |
@@ -46,9 +46,9 @@ discard block |
||
| 46 | 46 | public function postNewPayment($clientid, Request $request) |
| 47 | 47 | { |
| 48 | 48 | $this->validate($request, [ |
| 49 | - 'payment_date' => 'required', |
|
| 50 | - 'payment_method'=> 'required', |
|
| 51 | - 'amount' => 'required', |
|
| 49 | + 'payment_date' => 'required', |
|
| 50 | + 'payment_method'=> 'required', |
|
| 51 | + 'amount' => 'required', |
|
| 52 | 52 | ]); |
| 53 | 53 | |
| 54 | 54 | try { |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | $amtToCredit = $request->amtToCredit; |
| 114 | 114 | $payment_status = 'success'; |
| 115 | 115 | $payment = $this->multiplePayment($clientid,$invoiceChecked, $payment_method, |
| 116 | - $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status); |
|
| 116 | + $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status); |
|
| 117 | 117 | $response = ['type' => 'success', 'message' => 'Payment Updated Successfully']; |
| 118 | 118 | |
| 119 | 119 | return response()->json($response); |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | public function multiplePayment($clientid,$invoiceChecked, $payment_method, |
| 133 | - $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status) |
|
| 133 | + $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status) |
|
| 134 | 134 | { |
| 135 | 135 | try { |
| 136 | 136 | foreach ($invoiceChecked as $key => $value) { |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | $amtToCredit = $request->amtToCredit; |
| 212 | 212 | $payment_status = 'success'; |
| 213 | 213 | $payment = $this->updatePaymentByInvoice($clientid,$invoiceChecked, $payment_method, |
| 214 | - $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status); |
|
| 214 | + $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status); |
|
| 215 | 215 | $response = ['type' => 'success', 'message' => 'Payment Updated Successfully']; |
| 216 | 216 | |
| 217 | 217 | return response()->json($response); |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | public function updatePaymentByInvoice($clientid,$invoiceChecked, $payment_method, |
| 228 | - $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status) |
|
| 228 | + $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status) |
|
| 229 | 229 | { |
| 230 | 230 | try { |
| 231 | 231 | $sum = 0; |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | if ($key != 0) {//If Payment is linked to Invoice |
| 234 | 234 | $invoice = Invoice::find($value); |
| 235 | 235 | Payment::where('user_id', $clientid)->where('invoice_id', 0) |
| 236 | - ->update(['amt_to_credit'=>$amtToCredit]); |
|
| 236 | + ->update(['amt_to_credit'=>$amtToCredit]); |
|
| 237 | 237 | $invoice_status = 'pending'; |
| 238 | 238 | $payment = Payment::create([ |
| 239 | 239 | 'invoice_id' => $value, |
@@ -134,7 +134,8 @@ discard block |
||
| 134 | 134 | { |
| 135 | 135 | try { |
| 136 | 136 | foreach ($invoiceChecked as $key => $value) { |
| 137 | - if ($key != 0) {//If Payment is linked to Invoice |
|
| 137 | + if ($key != 0) { |
|
| 138 | +//If Payment is linked to Invoice |
|
| 138 | 139 | $invoice = Invoice::find($value); |
| 139 | 140 | $invoice_status = 'pending'; |
| 140 | 141 | $payment = Payment::where('invoice_id', $value)->create([ |
@@ -159,7 +160,8 @@ discard block |
||
| 159 | 160 | $invoice->status = $invoice_status; |
| 160 | 161 | $invoice->save(); |
| 161 | 162 | } |
| 162 | - } elseif (count($invoiceChecked) == 1 || $amtToCredit > 0) {//If Payment is not linked to any invoice and is to be credited to User Accunt |
|
| 163 | + } elseif (count($invoiceChecked) == 1 || $amtToCredit > 0) { |
|
| 164 | +//If Payment is not linked to any invoice and is to be credited to User Accunt |
|
| 163 | 165 | $totalExtraSum = Payment::where('user_id', $clientid)->where('invoice_id', 0) |
| 164 | 166 | ->pluck('amt_to_credit')->first(); //Get the total Extra Amt Paid |
| 165 | 167 | if ($totalExtraSum) { |
@@ -230,7 +232,8 @@ discard block |
||
| 230 | 232 | try { |
| 231 | 233 | $sum = 0; |
| 232 | 234 | foreach ($invoiceChecked as $key => $value) { |
| 233 | - if ($key != 0) {//If Payment is linked to Invoice |
|
| 235 | + if ($key != 0) { |
|
| 236 | +//If Payment is linked to Invoice |
|
| 234 | 237 | $invoice = Invoice::find($value); |
| 235 | 238 | Payment::where('user_id', $clientid)->where('invoice_id', 0) |
| 236 | 239 | ->update(['amt_to_credit'=>$amtToCredit]); |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | return ''; |
| 34 | 34 | |
| 35 | 35 | // return "Product has been {$eventName}"; |
| 36 | - // \Auth::user()->activity; |
|
| 36 | + // \Auth::user()->activity; |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | public function country() |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | '<td style="border-bottom: 1px solid#ccc; color: #333; |
| 187 | 187 | font-family: Arial,sans-serif; font-size: 14px; line-height: 20px; |
| 188 | 188 | padding: 15px 8px;" valign="top">'.$this->currency($invoiceid).' ' |
| 189 | - .$item->subtotal.'</td>'. |
|
| 189 | + .$item->subtotal.'</td>'. |
|
| 190 | 190 | '</tr>'; |
| 191 | 191 | } |
| 192 | 192 | } |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | |
| 287 | 287 | return view('themes.default1.invoice.editPayment', |
| 288 | 288 | compact('amountReceived','clientid', 'client', 'invoices', 'orders', |
| 289 | - 'invoiceSum', 'amountReceived', 'pendingAmount', 'currency', 'symbol')); |
|
| 289 | + 'invoiceSum', 'amountReceived', 'pendingAmount', 'currency', 'symbol')); |
|
| 290 | 290 | } catch (\Exception $e) { |
| 291 | 291 | Bugsnag::notifyException($e); |
| 292 | 292 | |
@@ -285,7 +285,7 @@ |
||
| 285 | 285 | $orders = $order->where('client', $clientid)->get(); |
| 286 | 286 | |
| 287 | 287 | return view('themes.default1.invoice.editPayment', |
| 288 | - compact('amountReceived','clientid', 'client', 'invoices', 'orders', |
|
| 288 | + compact('amountReceived', 'clientid', 'client', 'invoices', 'orders', |
|
| 289 | 289 | 'invoiceSum', 'amountReceived', 'pendingAmount', 'currency', 'symbol')); |
| 290 | 290 | } catch (\Exception $e) { |
| 291 | 291 | Bugsnag::notifyException($e); |
@@ -33,6 +33,6 @@ |
||
| 33 | 33 | return ''; |
| 34 | 34 | |
| 35 | 35 | // return "Product has been {$eventName}"; |
| 36 | - // \Auth::user()->activity; |
|
| 36 | + // \Auth::user()->activity; |
|
| 37 | 37 | } |
| 38 | 38 | } |
@@ -33,6 +33,6 @@ |
||
| 33 | 33 | return ''; |
| 34 | 34 | |
| 35 | 35 | // return "Product has been {$eventName}"; |
| 36 | - // \Auth::user()->activity; |
|
| 36 | + // \Auth::user()->activity; |
|
| 37 | 37 | } |
| 38 | 38 | } |