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