mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
falta boton borrar albaranes!
This commit is contained in:
@ -47,6 +47,18 @@ class Albaran extends \App\Controllers\BaseResourceController
|
||||
}
|
||||
}
|
||||
|
||||
public function editAlbaran($albaran_id){
|
||||
|
||||
$albaran = $this->model->find($albaran_id);
|
||||
if ($albaran == false) {
|
||||
return redirect()->to(base_url('albaranesList'));
|
||||
}
|
||||
$this->viewData['boxTitle'] = lang('Albaran.editAlbaran') . ' ' . $albaran->numero_albaran;
|
||||
$this->viewData['albaranId'] = $albaran_id;
|
||||
|
||||
return view('themes/vuexy/form/logistica/albaranes/viewAlbaranesEdit', $this->viewData);
|
||||
}
|
||||
|
||||
public function addLinea($albaran_id)
|
||||
{
|
||||
|
||||
@ -305,6 +317,23 @@ class Albaran extends \App\Controllers\BaseResourceController
|
||||
}
|
||||
}
|
||||
|
||||
public function getAlbaran()
|
||||
{
|
||||
|
||||
if ($this->request->isAJAX()) {
|
||||
|
||||
$id = $this->request->getGet('id');
|
||||
$albaran = $this->model->getAlbaranData($id);
|
||||
$data = [
|
||||
'success' => true,
|
||||
'data' => $albaran,
|
||||
];
|
||||
return $this->respond($data);
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
|
||||
public function generateAlbaran()
|
||||
{
|
||||
|
||||
@ -324,6 +353,32 @@ class Albaran extends \App\Controllers\BaseResourceController
|
||||
}
|
||||
}
|
||||
|
||||
public function datatable(){
|
||||
|
||||
$pedidosFilter = $this->request->getGet('pedidosFilter');
|
||||
$q = $this->model->getDatatableQuery();
|
||||
|
||||
if($pedidosFilter != null && !empty($pedidosFilter)) {
|
||||
$q->groupStart();
|
||||
$q->like('t4.id', $pedidosFilter);
|
||||
$q->groupEnd();
|
||||
}
|
||||
$result = DataTable::of($q)
|
||||
->add(
|
||||
"action",
|
||||
callback: function ($q) {
|
||||
return '
|
||||
<div class="btn-group btn-group-sm">
|
||||
<a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="' . $q->id . '"></i></a>
|
||||
<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete-albaran-lineas mx-2" data-id="' . $q->id . '"></i></a>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
);
|
||||
|
||||
return $result->toJson(returnAsObject: true);
|
||||
}
|
||||
|
||||
public function datatablesLineasAlbaran()
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user