Пример #1
0
    public function getDatatable()
    {
        $clients = $this->clientRepo->find(Input::get('sSearch'));
        return Datatable::query($clients)->addColumn('checkbox', function ($model) {
            return '<input type="checkbox" name="ids[]" value="' . $model->public_id . '">';
        })->addColumn('name', function ($model) {
            return link_to('clients/' . $model->public_id, $model->name);
        })->addColumn('first_name', function ($model) {
            return link_to('clients/' . $model->public_id, $model->first_name . ' ' . $model->last_name);
        })->addColumn('email', function ($model) {
            return link_to('clients/' . $model->public_id, $model->email);
        })->addColumn('created_at', function ($model) {
            return Utils::timestampToDateString(strtotime($model->created_at));
        })->addColumn('last_login', function ($model) {
            return Utils::timestampToDateString(strtotime($model->last_login));
        })->addColumn('balance', function ($model) {
            return Utils::formatMoney($model->balance, $model->currency_id);
        })->addColumn('dropdown', function ($model) {
            return '<div class="btn-group tr-action" style="visibility:hidden;">
  							<button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown">
    							' . trans('texts.select') . ' <span class="caret"></span>
  							</button>
  							<ul class="dropdown-menu" role="menu">
  							<li><a href="' . URL::to('clients/' . $model->public_id . '/edit') . '">' . trans('texts.edit_client') . '</a></li>
						    <li class="divider"></li>
						    <li><a href="' . URL::to('invoices/create/' . $model->public_id) . '">' . trans('texts.new_invoice') . '</a></li>						    
						    <li><a href="' . URL::to('payments/create/' . $model->public_id) . '">' . trans('texts.new_payment') . '</a></li>						    
						    <li><a href="' . URL::to('credits/create/' . $model->public_id) . '">' . trans('texts.new_credit') . '</a></li>						    
						    <li class="divider"></li>
						    <li><a href="javascript:archiveEntity(' . $model->public_id . ')">' . trans('texts.archive_client') . '</a></li>
						    <li><a href="javascript:deleteEntity(' . $model->public_id . ')">' . trans('texts.delete_client') . '</a></li>						    
						  </ul>
						</div>';
        })->make();
    }
Пример #2
0
 public function getDatatable($clientPublicId = null)
 {
     $credits = $this->creditRepo->find($clientPublicId, Input::get('sSearch'));
     $table = Datatable::query($credits);
     if (!$clientPublicId) {
         $table->addColumn('checkbox', function ($model) {
             return '<input type="checkbox" name="ids[]" value="' . $model->public_id . '">';
         })->addColumn('client_name', function ($model) {
             return link_to('clients/' . $model->client_public_id, Utils::getClientDisplayName($model));
         });
     }
     return $table->addColumn('amount', function ($model) {
         return Utils::formatMoney($model->amount, $model->currency_id);
     })->addColumn('balance', function ($model) {
         return Utils::formatMoney($model->balance, $model->currency_id);
     })->addColumn('credit_date', function ($model) {
         return Utils::fromSqlDate($model->credit_date);
     })->addColumn('private_notes', function ($model) {
         return $model->private_notes;
     })->addColumn('dropdown', function ($model) {
         return '<div class="btn-group tr-action" style="visibility:hidden;">
                         <button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown">
                             ' . trans('texts.select') . ' <span class="caret"></span>
                         </button>
                         <ul class="dropdown-menu" role="menu">
                         <li><a href="javascript:archiveEntity(' . $model->public_id . ')">' . trans('texts.archive_credit') . '</a></li>
                         <li><a href="javascript:deleteEntity(' . $model->public_id . ')">' . trans('texts.delete_credit') . '</a></li>                          
                       </ul>
                     </div>';
     })->make();
 }
 public function getClientDatatable()
 {
     $search = Input::get('sSearch');
     $invitationKey = Session::get('invitation_key');
     $invitation = Invitation::where('invitation_key', '=', $invitationKey)->with('contact.client')->first();
     if (!$invitation) {
         return [];
     }
     $invoice = $invitation->invoice;
     if (!$invoice || $invoice->is_deleted) {
         return [];
     }
     $payments = $this->paymentRepo->findForContact($invitation->contact->id, Input::get('sSearch'));
     return Datatable::query($payments)->addColumn('invoice_number', function ($model) {
         return $model->invitation_key ? link_to('/view/' . $model->invitation_key, $model->invoice_number) : $model->invoice_number;
     })->addColumn('transaction_reference', function ($model) {
         return $model->transaction_reference ? $model->transaction_reference : '<i>Manual entry</i>';
     })->addColumn('payment_type', function ($model) {
         return $model->payment_type ? $model->payment_type : ($model->account_gateway_id ? '<i>Online payment</i>' : '');
     })->addColumn('amount', function ($model) {
         return Utils::formatMoney($model->amount, $model->currency_id);
     })->addColumn('payment_date', function ($model) {
         return Utils::dateToString($model->payment_date);
     })->make();
 }
Пример #4
0
 public function getDatatable()
 {
     $products = $this->ProductRepo->find(Input::get('sSearch'));
     return Datatable::query($products)->addColumn('checkbox', function ($model) {
         return '<input type="checkbox" name="ids[]" value="' . $model->public_id . '">';
     })->addColumn('product_key', function ($model) {
         return link_to('products/' . $model->public_id, $model->product_key);
     })->addColumn('notes', function ($model) {
         return nl2br(Str::limit($model->notes, 50));
     })->addColumn('cost', function ($model) {
         return Utils::formatMoney($model->cost, 1);
     })->addColumn('name', function ($model) {
         return nl2br($model->category_name);
     })->addColumn('dropdown', function ($model) {
         return '<div class="btn-group tr-action" style="visibility:hidden;">
             <button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown">
               ' . trans('texts.select') . ' <span class="caret"></span>
             </button>
             <ul class="dropdown-menu" role="menu">
             <li><a href="' . URL::to('products/' . $model->public_id) . '/edit">' . uctrans('texts.edit_product') . '</a></li>                
             <li class="divider"></li>
             <li><a href="' . URL::to('products/' . $model->public_id) . '/archive">' . uctrans('texts.delete_product') . '</a></li>
           </ul>
         </div>';
     })->make();
 }
Пример #5
0
 public function buscar_registros_dt()
 {
     return \Datatable::query($this->repo_main->buscar_todos_dt())->addColumn('descripcion', function ($model) {
         return $model->denominacion;
     })->addColumn('esta_vigente', function ($model) {
         if ($model->esta_vigente == 1) {
             return '<i class="fa fa-check-square-o"></i>';
         } else {
             return '<i class="fa fa-square-o"></i>';
         }
     })->addColumn('nivel_nacional', function ($model) {
         if ($model->nivel_nacional == 1) {
             return '<i class="fa fa-check-square-o"></i>';
         } else {
             return '<i class="fa fa-square-o"></i>';
         }
     })->addColumn('nivel_zonal', function ($model) {
         if ($model->nivel_zonal == 1) {
             return '<i class="fa fa-check-square-o"></i>';
         } else {
             return '<i class="fa fa-square-o"></i>';
         }
     })->addColumn('nivel_distrital', function ($model) {
         if ($model->nivel_distrital == 1) {
             return '<i class="fa fa-check-square-o"></i>';
         } else {
             return '<i class="fa fa-square-o"></i>';
         }
     })->addColumn('commands', function ($model) {
         return '<div class="btn-group">' . '<a href="' . url('seguridades/roles/editar') . '/' . Crypt::encrypt($model->id_rol) . '" class="btn btn-default btn-xs btn-mini "><i class="fa fa-pencil"></i></a>' . '<a href="' . url('seguridades/roles/eliminar') . '/' . Crypt::encrypt($model->id_rol) . '" class="btn btn-dark btn-xs btn-mini"><i class="fa fa-trash-o"></i></a>' . '<a href="' . url('seguridades/roles/permisos/listar') . '/' . Crypt::encrypt($model->id_rol) . '" class="btn btn-primary btn-xs btn-mini"><i class="fa fa-bars"></i> permisos</a>' . '</div>';
     })->searchColumns('denominacion', 'denominacion_visual', 'esta_vigente', 'nivel_nacional', 'nivel_zonal', 'nivel_distrital')->orderColumns('denominacion', 'denominacion_visual', 'esta_vigente', 'nivel_nacional', 'nivel_zonal', 'nivel_distrital')->make();
 }
 public function getDatatable($accountId, $clientPublicId = null, $entityType, $search)
 {
     $query = $this->getInvoices($accountId, $clientPublicId, $search)->where('invoices.is_quote', '=', $entityType == ENTITY_QUOTE ? true : false);
     $table = \Datatable::query($query);
     if (!$clientPublicId) {
         $table->addColumn('checkbox', function ($model) {
             return '<input type="checkbox" name="ids[]" value="' . $model->public_id . '">';
         });
     }
     $table->addColumn("invoice_number", function ($model) use($entityType) {
         return link_to("{$entityType}s/" . $model->public_id . '/edit', $model->invoice_number);
     });
     if (!$clientPublicId) {
         $table->addColumn('client_name', function ($model) {
             return link_to('clients/' . $model->client_public_id, Utils::getClientDisplayName($model));
         });
     }
     $table->addColumn("invoice_date", function ($model) {
         return Utils::fromSqlDate($model->invoice_date);
     })->addColumn('amount', function ($model) {
         return Utils::formatMoney($model->amount, $model->currency_id);
     });
     if ($entityType == ENTITY_INVOICE) {
         $table->addColumn('balance', function ($model) {
             return Utils::formatMoney($model->balance, $model->currency_id);
         });
     }
     return $table->addColumn('due_date', function ($model) {
         return Utils::fromSqlDate($model->due_date);
     })->addColumn('invoice_status_name', function ($model) {
         return $model->invoice_status_name;
     })->addColumn('dropdown', function ($model) use($entityType) {
         $str = '<div class="btn-group tr-action" style="visibility:hidden;">
           <button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown">
             ' . trans('texts.select') . ' <span class="caret"></span>
           </button>
           <ul class="dropdown-menu" role="menu">
           <li><a href="' . \URL::to("{$entityType}s/" . $model->public_id . '/edit') . '">' . trans("texts.edit_{$entityType}") . '</a></li>
           <li><a href="' . \URL::to("{$entityType}s/" . $model->public_id . '/clone') . '">' . trans("texts.clone_{$entityType}") . '</a></li>
           <li class="divider"></li><li>';
         if ($entityType == ENTITY_INVOICE) {
             $str .= '<a href="' . \URL::to('payments/create/' . $model->client_public_id . '/' . $model->public_id) . '">' . trans('texts.enter_payment') . '</a></li>';
             if ($model->quote_id) {
                 $str .= '<li><a href="' . \URL::to("quotes/{$model->quote_id}/edit") . '">' . trans("texts.view_quote") . '</a></li>';
             }
         } else {
             if ($entityType == ENTITY_QUOTE) {
                 if ($model->quote_invoice_id) {
                     $str .= '<li><a href="' . \URL::to("invoices/{$model->quote_invoice_id}/edit") . '">' . trans("texts.view_invoice") . '</a></li>';
                 }
             }
         }
         return $str . '<li class="divider"></li>
           <li><a href="javascript:archiveEntity(' . $model->public_id . ')">' . trans("texts.archive_{$entityType}") . '</a></li>
           <li><a href="javascript:deleteEntity(' . $model->public_id . ')">' . trans("texts.delete_{$entityType}") . '</a></li>               
         </ul>
       </div>';
     })->make();
 }
 public function buscar_registros_dt()
 {
     return \Datatable::query($this->repo_servicios->buscar_todos_dt())->addColumn('denominacion', function ($model) {
         return $model->denominacion;
     })->addColumn('commands', function ($model) {
         return '<div class="btn-group">' . '<a href="' . url('catalogos/servicios_ac/editar') . '/' . Crypt::encrypt($model->id_servicio) . '" class="btn btn-default btn-xs btn-mini "><i class="fa fa-pencil"></i></a>' . '<a href="' . url('catalogos/servicios_ac/eliminar') . '/' . Crypt::encrypt($model->id_servicio) . '" class="btn btn-dark btn-xs btn-mini"><i class="fa fa-trash-o"></i></a>&nbsp;' . '</div>';
     })->searchColumns('denominacion')->orderColumns('denominacion')->make();
 }
 public function buscar_registros_dt($id_proceso)
 {
     return \Datatable::query($this->repo_main->buscar_todos_dt(Crypt::decrypt($id_proceso)))->addColumn('nombre', function ($model) {
         return $model->nombre;
     })->addColumn('commands', function ($model) {
         return '<div class="btn-group">' . '<a href="' . url('catalogos/procesos_ac/requisitos/editar') . '/' . Crypt::encrypt($model->id_requisitos) . '" class="btn btn-default btn-xs btn-mini "><i class="fa fa-pencil"></i></a>' . '<a href="' . url('catalogos/procesos_ac/requisitos/eliminar') . '/' . Crypt::encrypt($model->id_requisitos) . '" class="btn btn-danger btn-xs btn-mini"><i class="fa fa-trash-o"></i></a>' . '</div>';
     })->searchColumns('id_proceso', 'nombre', 'observaciones')->orderColumns('id_proceso', 'nombre', 'observaciones')->make();
 }
Пример #9
0
 public function buscar_registros_dt($id_rol)
 {
     return \Datatable::query($this->repo_main->buscar_todos_dt(Crypt::decrypt($id_rol)))->addColumn('modulo', function ($model) {
         return $model->modulo;
     })->addColumn('agrupador', function ($model) {
         return '<small class="text-muted text-xs">' . $model->agrupador . '</small>';
     })->addColumn('commands', function ($model) {
         return '<div class="btn-group">' . '<a href="' . url('seguridades/roles/permisos/eliminar') . '/' . Crypt::encrypt($model->id_rol_modulo) . '" class="btn btn-dark btn-xs btn-mini"><i class="fa fa-trash-o"></i></a>' . '</div>';
     })->searchColumns('config_rol_modulo.id_rol_modulo', 'config_modulo.descripcion', 'config_modulosubsistema.descripcion')->orderColumns('config_rol_modulo.id_rol_modulo', 'config_modulo.descripcion', 'config_modulosubsistema.descripcion')->make();
 }
Пример #10
0
 public function buscar_registros_dt($id_provincia)
 {
     return \Datatable::query($this->repo_main->buscar_todos_dt($id_provincia))->addColumn('denominacion', function ($model) {
         return $model->denominacion;
     })->addColumn('codigo', function ($model) {
         return $model->codigo;
     })->addColumn('commands', function ($model) {
         return '<div class="btn-group">' . '<a href="' . url('catalogos/ciudades/editar') . '/' . Crypt::encrypt($model->id_ciudad) . '" class="btn btn-default btn-xs btn-mini "><i class="fa fa-pencil"></i></a>' . '<a href="' . url('catalogos/ciudades/eliminar') . '/' . Crypt::encrypt($model->id_ciudad) . '" class="btn btn-dark btn-xs btn-mini"><i class="fa fa-trash-o"></i></a>' . '<a href="' . url('catalogos/parroquias/listar') . '/' . Crypt::encrypt($model->id_ciudad) . '" class="btn btn-warning  btn-xs btn-mini"><i class="fa fa-bars"></i> parroquias</a>' . '</div>';
     })->searchColumns('denominacion', 'codigo')->orderColumns('denominacion', 'codigo')->make();
 }
Пример #11
0
 public static function datatable($timestamps = true)
 {
     $filters = Input::get('filters');
     $model = static::getClass();
     $query = static::getDTquery(Input::get('trash'), $timestamps);
     $query = static::filterDTQuery($filters, $query, $model);
     $query = static::selectDTFields($query);
     $dataTable = Datatable::query($query);
     return $dataTable;
 }
Пример #12
0
 public function getClientDatatable($clientId)
 {
     $query = DB::table('credits')->join('accounts', 'accounts.id', '=', 'credits.account_id')->join('clients', 'clients.id', '=', 'credits.client_id')->where('credits.client_id', '=', $clientId)->where('clients.deleted_at', '=', null)->where('credits.deleted_at', '=', null)->where('credits.balance', '>', 0)->select(DB::raw('COALESCE(clients.currency_id, accounts.currency_id) currency_id'), DB::raw('COALESCE(clients.country_id, accounts.country_id) country_id'), 'credits.amount', 'credits.balance', 'credits.credit_date');
     $table = \Datatable::query($query)->addColumn('credit_date', function ($model) {
         return Utils::fromSqlDate($model->credit_date);
     })->addColumn('amount', function ($model) {
         return Utils::formatMoney($model->amount, $model->currency_id, $model->country_id);
     })->addColumn('balance', function ($model) {
         return Utils::formatMoney($model->balance, $model->currency_id, $model->country_id);
     })->make();
     return $table;
 }
 public function buscar_registros_dt()
 {
     return \Datatable::query($this->repo_main->buscar_todos_dt())->addColumn('codigo_amie', function ($model) {
         return $model->codigo_amie;
     })->addColumn('denominacion', function ($model) {
         return $model->denominacion;
     })->addColumn('ubicacion', function ($model) {
         return '<small class="text-muted text-xs">' . $model->ubicacion . '<br>' . $model->ubicacion2 . '</small>';
     })->addColumn('commands', function ($model) {
         return '<div class="btn-group">' . '<a href="' . url('catalogos/ies/editar') . '/' . Crypt::encrypt($model->id_institucion_educativa) . '" class="btn btn-default btn-xs btn-mini "><i class="fa fa-pencil"></i></a>' . '<a href="' . url('catalogos/ies/eliminar') . '/' . Crypt::encrypt($model->id_institucion_educativa) . '" class="btn btn-dark btn-xs btn-mini"><i class="fa fa-trash-o"></i></a>&nbsp;' . '</div>';
     })->searchColumns('id_institucion_educativa', 'codigo_amie', 'div_institucion_educativa.denominacion', 'div_distrito.denominacion', 'div_circuito.codigoSemplades', 'div_zona.denominacion', 'div_ciudad.denominacion')->orderColumns('codigo_amie', 'id_institucion_educativa', 'div_institucion_educativa.denominacion')->make();
 }
Пример #14
0
 public function buscar_registros_dt($id_subsistema)
 {
     return \Datatable::query($this->repo_main->buscar_todos_dt(Crypt::decrypt($id_subsistema)))->addColumn('descripcion', function ($model) {
         return $model->descripcion . ' <small class="text-muted">(' . $model->texto . ')</small>';
     })->addColumn('esta_activo', function ($model) {
         return '[' . $model->controlador . ']' . '[' . $model->accion . ']';
     })->addColumn('icon', function ($model) {
         return '<i class="' . $model->icon . '"></i>';
     })->addColumn('commands', function ($model) {
         return '<div class="btn-group">' . '<a href="' . url('seguridades/modulos/detalles/editar') . '/' . Crypt::encrypt($model->id_modulo) . '" class="btn btn-default btn-xs btn-mini "><i class="fa fa-pencil"></i></a>' . '<a href="' . url('seguridades/modulos/detalles/eliminar') . '/' . Crypt::encrypt($model->id_modulo) . '" class="btn btn-dark btn-xs btn-mini"><i class="fa fa-trash-o"></i></a>' . '</div>';
     })->searchColumns('id_modulo', 'id_subsistema', 'orden', 'descripcion', 'texto', 'accion', 'controlador', 'icon')->orderColumns('id_modulo', 'id_subsistema', 'orden', 'descripcion', 'texto', 'accion', 'controlador', 'icon')->make();
 }
Пример #15
0
 public function buscar_registros_dt()
 {
     return \Datatable::query($this->repo_main->buscar_todos_dt())->addColumn('codigoSemplades', function ($model) {
         return $model->codigoSemplades;
     })->addColumn('zona', function ($model) {
         return $model->zona;
     })->addColumn('denominacion_institucional', function ($model) {
         return $model->denominacion_institucional;
     })->addColumn('commands', function ($model) {
         return '<div class="btn-group">' . '<a href="' . url('catalogos/distritos/editar') . '/' . Crypt::encrypt($model->id_distrito) . '" class="btn btn-default btn-xs btn-mini "><i class="fa fa-pencil"></i></a>' . '<a href="' . url('catalogos/distritos/eliminar') . '/' . Crypt::encrypt($model->id_distrito) . '" class="btn btn-dark btn-xs btn-mini"><i class="fa fa-trash-o"></i></a>&nbsp;' . '</div>';
     })->searchColumns('div_distrito.id_distrito', 'div_distrito.codigoSemplades', 'div_distrito.denominacion', 'div_distrito.denominacion_institucional', 'div_zona.denominacion')->orderColumns('div_distrito.id_distrito', 'div_distrito.codigoSemplades', 'div_distrito.denominacion', 'div_distrito.denominacion_institucional', 'div_zona.denominacion')->make();
 }
Пример #16
0
 public function getDatatable($clientPublicId)
 {
     $query = DB::table('activities')->join('clients', 'clients.id', '=', 'activities.client_id')->where('clients.public_id', '=', $clientPublicId)->where('activities.account_id', '=', Auth::user()->account_id)->select('activities.id', 'activities.message', 'activities.created_at', 'activities.balance', 'activities.adjustment');
     return Datatable::query($query)->addColumn('id', function ($model) {
         return Utils::timestampToDateTimeString(strtotime($model->created_at));
     })->addColumn('message', function ($model) {
         return Utils::decodeActivity($model->message);
     })->addColumn('balance', function ($model) {
         return Utils::formatMoney($model->balance, 1);
     })->addColumn('adjustment', function ($model) {
         return $model->adjustment != 0 ? Utils::formatMoney($model->adjustment, 1) : '';
     })->make();
 }
 /**
  * admin.comments.index
  *
  */
 public function getAdminIndex()
 {
     if (Sentry::hasAnyAccess(['comments_index'])) {
         if (Request::ajax()) {
             $result = DB::table('comments')->select(array('comments.id', 'comments.description as description', 'comments.created_at as created', 'users.email as email', 'users.first_name as first_name', 'users.last_name as last_name'))->join('profiles', 'comments.profile_id', '=', 'profiles.id')->join('users', 'profiles.user_id', '=', 'users.id')->where('comments.status', '=', 1);
             return Datatable::query($result)->searchColumns('email', 'first_name', 'last_name', 'description')->orderColumns('created', 'id')->showColumns('id', 'description', 'email', 'first_name', 'last_name')->addColumn('Operaciones', function ($model) {
                 return "<a class='operation' href='" . URL::to('#Send') . "' id={$model->id} data-toggle='modal'>\n\t\t\t\t\t\t\t\t<span class='label label-success'><i class='fa fa-envelope-o'></i> Responder</span>\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t<a class='operation' href='" . URL::to('#Delete') . "' id={$model->id} data-toggle='modal'>\n\t\t\t\t\t\t\t\t<span class='label label-default'><i class='fa fa-trash'></i> Eliminar</span>\n\t\t\t\t\t\t\t</a>";
             })->make();
         } else {
             return View::make('comments.admin.index');
         }
     }
 }
 public function buscar_registros_dt()
 {
     return \Datatable::query($this->repo_main->buscar_todos_dt())->addColumn('denominacion', function ($model) {
         return $model->denominacion;
     })->addColumn('requiere_observaciones', function ($model) {
         if ($model->requiere_observaciones == 1) {
             return '<i class="fa fa-check-square-o"></i>';
         } else {
             return '<i class="fa fa-square-o"></i>';
         }
     })->addColumn('commands', function ($model) {
         return '<div class="btn-group">' . '<a href="' . url('catalogos/tramites_resultado/editar') . '/' . Crypt::encrypt($model->id_tramite_resultado) . '" class="btn btn-default btn-xs btn-mini "><i class="fa fa-pencil"></i></a>' . '<a href="' . url('catalogos/tramites_resultado/eliminar') . '/' . Crypt::encrypt($model->id_tramite_resultado) . '" class="btn btn-dark btn-xs btn-mini"><i class="fa fa-trash-o"></i></a>&nbsp;' . '</div>';
     })->searchColumns('id_tramite_resultado', 'denominacion')->orderColumns('id_tramite_resultado', 'denominacion')->make();
 }
Пример #19
0
 public function getDatatable()
 {
     $query = DB::table('categories')->where('categories.account_id', '=', Auth::user()->account_id)->where('categories.deleted_at', '=', null)->where('categories.public_id', '>', 0)->select('categories.public_id', 'categories.name');
     return Datatable::query($query)->addColumn('name', function ($model) {
         return link_to('categories/' . $model->public_id . '/edit', $model->name);
     })->addColumn('dropdown', function ($model) {
         return '<div class="btn-group tr-action" style="visibility:hidden;">
         <button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown">
           ' . trans('texts.select') . ' <span class="caret"></span>
         </button>
         <ul class="dropdown-menu" role="menu">
         <li><a href="' . URL::to('categories/' . $model->public_id) . '/edit">' . uctrans('texts.edit_category') . '</a></li>                
       </ul>
     </div>';
     })->orderColumns(['name'])->make();
 }
Пример #20
0
    public function getDatatable()
    {
        $today = date('Y-m-d', time());
        $collection = DB::table('item_received_packages')->leftJoin('item_receives', 'item_received_packages.received_id', '=', 'item_receives.id')->where('item_receives.supplier_id', '=', Input::get('supplier_id'))->where('item_received_packages.status', '=', 0)->orWhere('item_received_packages.package_checked_date', '=', $today)->select('item_received_packages.id', 'item_received_packages.package_received_date', 'item_received_packages.package_no', 'item_received_packages.item_count', 'item_received_packages.status')->orderBy('item_received_packages.status');
        //->get();
        #票据
        return Datatable::query($collection)->showColumns('package_received_date', 'package_no', 'item_count')->searchColumns('package_received_date')->orderColumns('package_received_date', 'package_no', 'item_count')->addColumn('actions', function ($model) {
            if ($model->status == 0) {
                return $str = Form::open(array('route' => array('itemreceive.packageconfirm.post', 'package_id=' . $model->id), 'method' => 'POST', 'data-confirm' => '确定操作?')) . '
							<button type="submit" class="btn btn-primary">到包确认</button>' . Form::close();
            } else {
                return $str = '<span class="label-default label">
                                	已确认收货
                                </span>';
            }
        })->make();
    }
Пример #21
0
 public function getDatatable()
 {
     $query = DB::table('book_sales')->where('book_sales.account_id', '=', Auth::user()->account_id)->where('book_sales.deleted_at', '=', null)->select('book_sales.id', 'book_sales.invoice_number', 'book_sales.client_nit', 'book_sales.client_name', 'book_sales.amount');
     return Datatable::query($query)->addColumn('invoice_number', function ($model) {
         return link_to('manuals/' . $model->id . '/edit', $model->invoice_number);
     })->addColumn('dropdown', function ($model) {
         return '<div class="btn-group tr-action" style="visibility:hidden;">
         <button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown">
           ' . trans('texts.select') . ' <span class="caret"></span>
         </button>
         <ul class="dropdown-menu" role="menu">
         <li><a href="' . URL::to('manuals/' . $model->id) . '/edit">' . uctrans('texts.edit_manual') . '</a></li>                
         <li class="divider"></li>
         <li><a href="' . URL::to('manuals/' . $model->id) . '/archive">' . uctrans('texts.archive_manual') . '</a></li>
       </ul>
     </div>';
     })->orderColumns(['invoice_number'])->make();
 }
 public function buscar_registros_dt()
 {
     return \Datatable::query($this->repo_main->buscar_todos_dt())->addColumn('orden', function ($model) {
         return $model->orden;
     })->addColumn('descripcion', function ($model) {
         return $model->descripcion;
     })->addColumn('esta_activo', function ($model) {
         if ($model->esta_activo == 1) {
             return '<i class="fa fa-check-square-o"></i>';
         } else {
             return '<i class="fa fa-square-o"></i>';
         }
     })->addColumn('icon', function ($model) {
         return '<i class="' . $model->icon . '"></i>';
     })->addColumn('commands', function ($model) {
         return '<div class="btn-group">' . '<a href="' . url('seguridades/modulos/editar') . '/' . Crypt::encrypt($model->id_subsistema) . '" class="btn btn-default btn-xs btn-mini "><i class="fa fa-pencil"></i></a>' . '<a href="' . url('seguridades/modulos/eliminar') . '/' . Crypt::encrypt($model->id_subsistema) . '" class="btn btn-dark btn-xs btn-mini"><i class="fa fa-trash-o"></i></a>' . '<a href="' . url('seguridades/modulos/detalles/listar') . '/' . Crypt::encrypt($model->id_subsistema) . '" class="btn btn-warning btn-xs btn-mini"><i class="fa fa-bars"></i> modulos</a>' . '</div>';
     })->searchColumns('descripcion', 'icon')->orderColumns('descripcion', 'icon')->make();
 }
 public function buscar_registros_dt()
 {
     return \Datatable::query($this->repo_main->buscar_todos_dt())->addColumn('denominacion', function ($model) {
         return $model->denominacion;
     })->addColumn('esta_vigente', function ($model) {
         if ($model->esta_vigente == 1) {
             return '<i class="fa fa-check-square-o"></i>';
         } else {
             return '<i class="fa fa-square-o"></i>';
         }
     })->addColumn('aplicable_nacional', function ($model) {
         if ($model->aplicable_nacional == 1) {
             return '<i class="fa fa-check-square-o"></i>';
         } else {
             return '<i class="fa fa-square-o"></i>';
         }
     })->addColumn('aplicable_zonal', function ($model) {
         if ($model->aplicable_zonal == 1) {
             return '<i class="fa fa-check-square-o"></i>';
         } else {
             return '<i class="fa fa-square-o"></i>';
         }
     })->addColumn('aplicable_distrito', function ($model) {
         if ($model->aplicable_distrito == 1) {
             return '<i class="fa fa-check-square-o"></i>';
         } else {
             return '<i class="fa fa-square-o"></i>';
         }
     })->addColumn('bloqueado', function ($model) {
         if ($model->bloqueado == 1) {
             return '<i class="fa fa-check-square-o"></i>';
         } else {
             return '<i class="fa fa-square-o"></i>';
         }
     })->addColumn('permite_asignacion_multiple', function ($model) {
         if ($model->permite_asignacion_multiple == 1) {
             return '<i class="fa fa-check-square-o"></i>';
         } else {
             return '<i class="fa fa-square-o"></i>';
         }
     })->addColumn('commands', function ($model) {
         return '<div class="btn-group">' . '<a href="' . url('catalogos/departamentos_funcionarios/editar') . '/' . Crypt::encrypt($model->id_departamento) . '" class="btn btn-default btn-xs btn-mini "><i class="fa fa-pencil"></i></a>' . '<a href="' . url('catalogos/departamentos_funcionarios/eliminar') . '/' . Crypt::encrypt($model->id_departamento) . '" class="btn btn-dark btn-xs btn-mini"><i class="fa fa-trash-o"></i></a>' . '</div>';
     })->searchColumns('denominacion')->orderColumns('denominacion')->make();
 }
Пример #24
0
 public function buscar_registros_dt()
 {
     return \Datatable::query($this->repo_main->buscar_todos_dt())->addColumn('denominacion', function ($model) {
         return $model->denominacion;
     })->addColumn('aplicable_personas', function ($model) {
         if ($model->aplicable_personas == 1) {
             return '<i class="fa fa-check-square-o"></i>';
         } else {
             return '<i class="fa fa-square-o"></i>';
         }
     })->addColumn('aplicable_funcionarios', function ($model) {
         if ($model->aplicable_funcionarios == 1) {
             return '<i class="fa fa-check-square-o"></i>';
         } else {
             return '<i class="fa fa-square-o"></i>';
         }
     })->addColumn('aplicable_nacional', function ($model) {
         if ($model->aplicable_nacional == 1) {
             return '<i class="fa fa-check-square-o"></i>';
         } else {
             return '<i class="fa fa-square-o"></i>';
         }
     })->addColumn('aplicable_zonal', function ($model) {
         if ($model->aplicable_zonal == 1) {
             return '<i class="fa fa-check-square-o"></i>';
         } else {
             return '<i class="fa fa-square-o"></i>';
         }
     })->addColumn('aplicable_distrito', function ($model) {
         if ($model->aplicable_distrito == 1) {
             return '<i class="fa fa-check-square-o"></i>';
         } else {
             return '<i class="fa fa-square-o"></i>';
         }
     })->addColumn('valida_traslados_tramite_distritos', function ($model) {
         if ($model->valida_traslados_tramite_distritos == 1) {
             return '<i class="fa fa-check-square-o"></i>';
         } else {
             return '<i class="fa fa-square-o"></i>';
         }
     })->addColumn('commands', function ($model) {
         return '<div class="btn-group">' . '<a href="' . url('catalogos/cargos_funcionarios/editar') . '/' . Crypt::encrypt($model->id_cargo) . '" class="btn btn-default btn-xs btn-mini "><i class="fa fa-pencil"></i></a>' . '<a href="' . url('catalogos/cargos_funcionarios/eliminar') . '/' . Crypt::encrypt($model->id_cargo) . '" class="btn btn-dark btn-xs btn-mini"><i class="fa fa-trash-o"></i></a>' . '</div>';
     })->searchColumns('denominacion')->orderColumns('denominacion')->make();
 }
    public function getRecurringDatatable($clientPublicId = null)
    {
        $query = $this->invoiceRepo->getRecurringInvoices(Auth::user()->account_id, $clientPublicId, Input::get('sSearch'));
        $table = Datatable::query($query);
        if (!$clientPublicId) {
            $table->addColumn('checkbox', function ($model) {
                return '<input type="checkbox" name="ids[]" value="' . $model->public_id . '" ' . Utils::getEntityRowClass($model) . '>';
            });
        }
        $table->addColumn('frequency', function ($model) {
            return link_to('invoices/' . $model->public_id, $model->frequency);
        });
        if (!$clientPublicId) {
            $table->addColumn('client_name', function ($model) {
                return link_to('clients/' . $model->client_public_id, Utils::getClientDisplayName($model));
            });
        }
        return $table->addColumn('start_date', function ($model) {
            return Utils::fromSqlDate($model->start_date);
        })->addColumn('end_date', function ($model) {
            return Utils::fromSqlDate($model->end_date);
        })->addColumn('amount', function ($model) {
            return Utils::formatMoney($model->amount, $model->currency_id);
        })->addColumn('dropdown', function ($model) {
            if ($model->is_deleted) {
                return '<div style="height:38px"/>';
            }
            $str = '<div class="btn-group tr-action" style="visibility:hidden;">
                        <button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown">
                            ' . trans('texts.select') . ' <span class="caret"></span>
                        </button>
                        <ul class="dropdown-menu" role="menu">';
            if (!$model->deleted_at || $model->deleted_at == '0000-00-00') {
                $str .= '<li><a href="' . URL::to('invoices/' . $model->public_id . '/edit') . '">' . trans('texts.edit_invoice') . '</a></li>
										    <li class="divider"></li>
										    <li><a href="javascript:archiveEntity(' . $model->public_id . ')">' . trans('texts.archive_invoice') . '</a></li>
										    <li><a href="javascript:deleteEntity(' . $model->public_id . ')">' . trans('texts.delete_invoice') . '</a></li>';
            } else {
                $str .= '<li><a href="javascript:restoreEntity(' . $model->public_id . ')">' . trans('texts.restore_invoice') . '</a></li>';
            }
            return $str . '</ul>
                    </div>';
        })->make();
    }
Пример #26
0
 public function getClientDatatable($contactId, $entityType, $search)
 {
     $query = \DB::table('invitations')->join('invoices', 'invoices.id', '=', 'invitations.invoice_id')->join('clients', 'clients.id', '=', 'invoices.client_id')->where('invitations.contact_id', '=', $contactId)->where('invitations.deleted_at', '=', null)->where('invoices.is_quote', '=', $entityType == ENTITY_QUOTE)->where('invoices.is_deleted', '=', false)->where('clients.deleted_at', '=', null)->where('invoices.is_recurring', '=', false)->select('invitation_key', 'invoice_number', 'invoice_date', 'invoices.balance as balance', 'due_date', 'clients.public_id as client_public_id', 'clients.name as client_name', 'invoices.public_id', 'amount', 'start_date', 'end_date', 'clients.currency_id', 'invoices.partial');
     $table = \Datatable::query($query)->addColumn('invoice_number', function ($model) use($entityType) {
         return link_to('/view/' . $model->invitation_key, $model->invoice_number);
     })->addColumn('invoice_date', function ($model) {
         return Utils::fromSqlDate($model->invoice_date);
     })->addColumn('amount', function ($model) {
         return Utils::formatMoney($model->amount, $model->currency_id);
     });
     if ($entityType == ENTITY_INVOICE) {
         $table->addColumn('balance', function ($model) {
             return $model->partial > 0 ? trans('texts.partial_remaining', ['partial' => Utils::formatMoney($model->partial, $model->currency_id), 'balance' => Utils::formatMoney($model->balance, $model->currency_id)]) : Utils::formatMoney($model->balance, $model->currency_id);
         });
     }
     return $table->addColumn('due_date', function ($model) {
         return Utils::fromSqlDate($model->due_date);
     })->make();
 }
 public function getClientDatatable($contactId, $entityType, $search)
 {
     $query = DB::table('invitations')->join('accounts', 'accounts.id', '=', 'invitations.account_id')->join('invoices', 'invoices.id', '=', 'invitations.invoice_id')->join('clients', 'clients.id', '=', 'invoices.client_id')->join('contacts', 'contacts.client_id', '=', 'clients.id')->where('invitations.contact_id', '=', $contactId)->where('invitations.deleted_at', '=', null)->where('invoices.is_quote', '=', $entityType == ENTITY_QUOTE)->where('invoices.is_deleted', '=', false)->where('clients.deleted_at', '=', null)->where('contacts.deleted_at', '=', null)->where('contacts.is_primary', '=', true)->where('invoices.is_recurring', '=', false)->select(DB::raw('COALESCE(clients.currency_id, accounts.currency_id) currency_id'), DB::raw('COALESCE(clients.country_id, accounts.country_id) country_id'), 'invitations.invitation_key', 'invoices.invoice_number', 'invoices.invoice_date', 'invoices.balance as balance', 'invoices.due_date', 'clients.public_id as client_public_id', DB::raw("COALESCE(NULLIF(clients.name,''), NULLIF(CONCAT(contacts.first_name, ' ', contacts.last_name),''), NULLIF(contacts.email,'')) client_name"), 'invoices.public_id', 'invoices.amount', 'invoices.start_date', 'invoices.end_date', 'invoices.partial');
     $table = \Datatable::query($query)->addColumn('invoice_number', function ($model) use($entityType) {
         return link_to('/view/' . $model->invitation_key, $model->invoice_number)->toHtml();
     })->addColumn('invoice_date', function ($model) {
         return Utils::fromSqlDate($model->invoice_date);
     })->addColumn('amount', function ($model) {
         return Utils::formatMoney($model->amount, $model->currency_id, $model->country_id);
     });
     if ($entityType == ENTITY_INVOICE) {
         $table->addColumn('balance', function ($model) {
             return $model->partial > 0 ? trans('texts.partial_remaining', ['partial' => Utils::formatMoney($model->partial, $model->currency_id, $model->country_id), 'balance' => Utils::formatMoney($model->balance, $model->currency_id, $model->country_id)]) : Utils::formatMoney($model->balance, $model->currency_id, $model->country_id);
         });
     }
     return $table->addColumn('due_date', function ($model) {
         return Utils::fromSqlDate($model->due_date);
     })->make();
 }
Пример #28
0
 public function getDatatable()
 {
     $query = DB::table('products')->where('products.account_id', '=', Auth::user()->account_id)->where('products.deleted_at', '=', null)->select('products.public_id', 'products.product_key', 'products.notes', 'products.cost');
     return Datatable::query($query)->addColumn('product_key', function ($model) {
         return link_to('products/' . $model->public_id . '/edit', $model->product_key);
     })->addColumn('notes', function ($model) {
         return nl2br(Str::limit($model->notes, 100));
     })->addColumn('cost', function ($model) {
         return Utils::formatMoney($model->cost);
     })->addColumn('dropdown', function ($model) {
         return '<div class="btn-group tr-action" style="visibility:hidden;">
         <button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown">
           ' . trans('texts.select') . ' <span class="caret"></span>
         </button>
         <ul class="dropdown-menu" role="menu">
         <li><a href="' . URL::to('products/' . $model->public_id) . '/edit">' . uctrans('texts.edit_product') . '</a></li>                
         <li class="divider"></li>
         <li><a href="' . URL::to('products/' . $model->public_id) . '/archive">' . uctrans('texts.archive_product') . '</a></li>
       </ul>
     </div>';
     })->orderColumns(['cost', 'product_key', 'cost'])->make();
 }
Пример #29
0
 public function getDatatable()
 {
     $query = DB::table('users')->where('users.account_id', '=', Auth::user()->account_id)->where('users.deleted_at', '=', null)->where('users.public_id', '>', 0)->select('users.public_id', 'users.first_name', 'users.last_name', 'users.email', 'users.confirmed', 'users.public_id');
     return Datatable::query($query)->addColumn('first_name', function ($model) {
         return link_to('users/' . $model->public_id . '/edit', $model->first_name . ' ' . $model->last_name);
     })->addColumn('email', function ($model) {
         return $model->email;
     })->addColumn('confirmed', function ($model) {
         return $model->confirmed ? trans('texts.active') : trans('texts.pending');
     })->addColumn('dropdown', function ($model) {
         return '<div class="btn-group tr-action" style="visibility:hidden;">
           <button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown">
             ' . trans('texts.select') . ' <span class="caret"></span>
           </button>
           <ul class="dropdown-menu" role="menu">
           <li><a href="' . URL::to('users/' . $model->public_id) . '/edit">' . uctrans('texts.edit_user') . '</a></li>
           <li class="divider"></li>
           <li><a href="javascript:deleteUser(' . $model->public_id . ')">' . uctrans('texts.delete_user') . '</a></li>              
         </ul>
       </div>';
     })->orderColumns(['first_name', 'email', 'confirmed'])->make();
 }
Пример #30
0
 public function getDatatable($clientPublicId = null)
 {
     $payments = $this->paymentRepo->find($clientPublicId, Input::get('sSearch'));
     $table = Datatable::query($payments);
     if (!$clientPublicId) {
         $table->addColumn('checkbox', function ($model) {
             return '<input type="checkbox" name="ids[]" value="' . $model->public_id . '">';
         });
     }
     $table->addColumn('invoice_number', function ($model) {
         return $model->invoice_public_id ? link_to('invoices/' . $model->invoice_public_id . '/edit', $model->invoice_number) : '';
     });
     if (!$clientPublicId) {
         $table->addColumn('client_name', function ($model) {
             return link_to('clients/' . $model->client_public_id, Utils::getClientDisplayName($model));
         });
     }
     $table->addColumn('transaction_reference', function ($model) {
         return $model->transaction_reference ? $model->transaction_reference : '<i>Manual entry</i>';
     })->addColumn('payment_type', function ($model) {
         return $model->payment_type ? $model->payment_type : ($model->account_gateway_id ? '<i>Online payment</i>' : '');
     });
     return $table->addColumn('amount', function ($model) {
         return Utils::formatMoney($model->amount, $model->currency_id);
     })->addColumn('payment_date', function ($model) {
         return Utils::dateToString($model->payment_date);
     })->addColumn('dropdown', function ($model) {
         return '<div class="btn-group tr-action" style="visibility:hidden;">
                         <button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown">
                         ' . trans('texts.select') . ' <span class="caret"></span>
                         </button>
                         <ul class="dropdown-menu" role="menu">
                         <li><a href="javascript:archiveEntity(' . $model->public_id . ')">' . trans('texts.archive_payment') . '</a></li>
                         <li><a href="javascript:deleteEntity(' . $model->public_id . ')">' . trans('texts.delete_payment') . '</a></li>                          
                       </ul>
                     </div>';
     })->make();
 }