@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | $from = $request->input('from'); |
| 110 | 110 | $till = $request->input('till'); |
| 111 | 111 | |
| 112 | - return view('themes.default1.invoice.index', compact('name','invoice_no','status','currencies','currency_id','from', |
|
| 112 | + return view('themes.default1.invoice.index', compact('name', 'invoice_no', 'status', 'currencies', 'currency_id', 'from', |
|
| 113 | 113 | |
| 114 | 114 | 'till')); |
| 115 | 115 | } catch (\Exception $ex) { |
@@ -132,35 +132,35 @@ discard block |
||
| 132 | 132 | return \DataTables::of($query->take(100)) |
| 133 | 133 | ->setTotalRecords($query->count()) |
| 134 | 134 | |
| 135 | - ->addColumn('checkbox', function ($model) { |
|
| 135 | + ->addColumn('checkbox', function($model) { |
|
| 136 | 136 | return "<input type='checkbox' class='invoice_checkbox' |
| 137 | 137 | value=".$model->id.' name=select[] id=check>'; |
| 138 | 138 | }) |
| 139 | - ->addColumn('user_id', function ($model) { |
|
| 139 | + ->addColumn('user_id', function($model) { |
|
| 140 | 140 | $first = $this->user->where('id', $model->user_id)->first()->first_name; |
| 141 | 141 | $last = $this->user->where('id', $model->user_id)->first()->last_name; |
| 142 | 142 | $id = $this->user->where('id', $model->user_id)->first()->id; |
| 143 | 143 | |
| 144 | 144 | return '<a href='.url('clients/'.$id).'>'.ucfirst($first).' '.ucfirst($last).'</a>'; |
| 145 | 145 | }) |
| 146 | - ->addColumn('number', function ($model) { |
|
| 146 | + ->addColumn('number', function($model) { |
|
| 147 | 147 | return ucfirst($model->number); |
| 148 | 148 | }) |
| 149 | 149 | |
| 150 | - ->addColumn('date', function ($model) { |
|
| 150 | + ->addColumn('date', function($model) { |
|
| 151 | 151 | $date = ($model->created_at); |
| 152 | 152 | |
| 153 | 153 | return $date; |
| 154 | 154 | // return "<span style='display:none'>$model->id</span>".$date->format('l, F j, Y H:m'); |
| 155 | 155 | }) |
| 156 | - ->addColumn('grand_total', function ($model) { |
|
| 156 | + ->addColumn('grand_total', function($model) { |
|
| 157 | 157 | return currency_format($model->grand_total, $code = $model->currency); |
| 158 | 158 | }) |
| 159 | - ->addColumn('status', function ($model) { |
|
| 159 | + ->addColumn('status', function($model) { |
|
| 160 | 160 | return ucfirst($model->status); |
| 161 | 161 | }) |
| 162 | 162 | |
| 163 | - ->addColumn('action', function ($model) { |
|
| 163 | + ->addColumn('action', function($model) { |
|
| 164 | 164 | $action = ''; |
| 165 | 165 | |
| 166 | 166 | $check = $this->checkExecution($model->id); |
@@ -176,25 +176,25 @@ discard block |
||
| 176 | 176 | style='color:white;'> </i> View</a>" |
| 177 | 177 | ." $action"; |
| 178 | 178 | }) |
| 179 | - ->filterColumn('user_id', function ($query, $keyword) { |
|
| 179 | + ->filterColumn('user_id', function($query, $keyword) { |
|
| 180 | 180 | $sql = 'first_name like ?'; |
| 181 | 181 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 182 | 182 | }) |
| 183 | 183 | |
| 184 | - ->filterColumn('status', function ($query, $keyword) { |
|
| 184 | + ->filterColumn('status', function($query, $keyword) { |
|
| 185 | 185 | $sql = 'status like ?'; |
| 186 | 186 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 187 | 187 | }) |
| 188 | 188 | |
| 189 | - ->filterColumn('number', function ($query, $keyword) { |
|
| 189 | + ->filterColumn('number', function($query, $keyword) { |
|
| 190 | 190 | $sql = 'number like ?'; |
| 191 | 191 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 192 | 192 | }) |
| 193 | - ->filterColumn('grand_total', function ($query, $keyword) { |
|
| 193 | + ->filterColumn('grand_total', function($query, $keyword) { |
|
| 194 | 194 | $sql = 'grand_total like ?'; |
| 195 | 195 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 196 | 196 | }) |
| 197 | - ->filterColumn('date', function ($query, $keyword) { |
|
| 197 | + ->filterColumn('date', function($query, $keyword) { |
|
| 198 | 198 | $sql = 'date like ?'; |
| 199 | 199 | $query->whereRaw($sql, ["%{$keyword}%"]); |
| 200 | 200 | }) |
@@ -415,7 +415,7 @@ discard block |
||
| 415 | 415 | |
| 416 | 416 | $invoice = Invoice::create(['user_id' => $user_id, 'number' => $number, 'date' => $date, |
| 417 | 417 | 'coupon_code' => $code, 'discount'=>$codeValue, |
| 418 | - 'grand_total' => $grand_total, 'currency' => $currency, 'status' => $status, 'description' => $description, ]); |
|
| 418 | + 'grand_total' => $grand_total, 'currency' => $currency, 'status' => $status, 'description' => $description, ]); |
|
| 419 | 419 | |
| 420 | 420 | $items = $this->createInvoiceItemsByAdmin($invoice->id, $productid, |
| 421 | 421 | $code, $total, $currency, $qty, $agents, $plan, $user_id, $tax_name, $tax_rate); |