trabajando en el add

This commit is contained in:
Jaime Jiménez
2024-01-28 13:38:56 +01:00
parent b679e9b89d
commit c4e42d4239
7 changed files with 186 additions and 148 deletions

View File

@ -512,10 +512,10 @@ $routes->group('clientedirecciones', ['namespace' => 'App\Controllers\Clientes']
}); });
$routes->resource('clientedirecciones', ['namespace' => 'App\Controllers\Clientes', 'controller' => 'Clientedirecciones', 'except' => 'show,new,create,update']); $routes->resource('clientedirecciones', ['namespace' => 'App\Controllers\Clientes', 'controller' => 'Clientedirecciones', 'except' => 'show,new,create,update']);
$routes->group('cosidotapablanda', ['namespace' => 'App\Controllers\Presupuestos'], function ($routes) { $routes->group('cosidotapablanda', ['namespace' => 'App\Controllers\Presupuestos'], function ($routes) {
$routes->get('list/(:num)', 'Cosidotapablanda::list/$1', ['as' => 'cosidotapablandaList']); // HOMOGENIZAR CON ARGS DINAMICOS!!! $routes->get('list/(:num)', 'Cosidotapablanda::list/$1', ['as' => 'cosidotapablandaList']); // HOMOGENIZAR CON ARGS DINAMICOS!!!
$routes->get('add', 'Cosidotapablanda::add', ['as' => 'newCosidotapablanda']); $routes->get('add/(:num)', 'Cosidotapablanda::add/$1', ['as' => 'newCosidotapablanda']);
$routes->post('add', 'Cosidotapablanda::add', ['as' => 'createCosidotapablanda']); $routes->post('add', 'Cosidotapablanda::add', ['as' => 'createCosidotapablanda']);
$routes->post('create', 'Cosidotapablanda::create', ['as' => 'ajaxCreateCosidotapablanda']); $routes->post('create', 'Cosidotapablanda::create', ['as' => 'ajaxCreateCosidotapablanda']);
$routes->put('(:num)/update', 'Cosidotapablanda::update/$1', ['as' => 'ajaxUpdateCosidotapablanda']); $routes->put('(:num)/update', 'Cosidotapablanda::update/$1', ['as' => 'ajaxUpdateCosidotapablanda']);

View File

@ -47,20 +47,22 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger) public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
{ {
$this->viewData['pageTitle'] = lang('Presupuestos.moduleTitleCosidoTB'); //$this->viewData['pageTitle'] = lang('Presupuestos.moduleTitleCosidoTB');
$this->viewData['usingSweetAlert'] = true; $this->viewData['usingSweetAlert'] = true;
// Se indica que este controlador trabaja con soft_delete // Se indica que este controlador trabaja con soft_delete
$this->soft_delete = true; $this->soft_delete = true;
// Se indica el flag para los ficheros borrados // Se indica el flag para los ficheros borrados
$this->delete_flag = 1; $this->delete_flag = 1;
$this->viewData = ['usingServerSideDataTable' => true]; // JJO $this->viewData = ['usingServerSideDataTable' => true]; // JJO
// Breadcrumbs $this->viewData = [
$this->viewData['breadcrumb'] = [ 'currentModule' => static::$controllerSlug,
['title' => lang("App.menu_presupuestos"), 'route' => "javascript:void(0);", 'active' => false], 'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('Presupuestos.presupuesto')]),
['title' => lang("App.menu_libros_cosido_tapa_blanda"), 'route' => site_url('presupuestos/cosidotapablanda/list/4'), 'active' => true] 'presupuestoEntity' => new PresupuestoEntity(),
'usingServerSideDataTable' => true,
]; ];
parent::initController($request, $response, $logger); parent::initController($request, $response, $logger);
@ -69,33 +71,22 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
public function list($tipo_presupuesto = 4) public function list($tipo_impresion_id = 4)
{ {
switch ($tipo_presupuesto){
// Se pasa a la vista el tipo de presupuesto
$viewData['tipo_impresion_id'] = $tipo_impresion_id;
case 4: $viewData = array_merge($viewData, $this->getStringsFromTipoImpresion($tipo_impresion_id));
break;
default:
return "A IMPLEMENTAR!";
}
$viewData = [
'currentModule' => static::$controllerSlug,
'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('Presupuestos.presupuesto')]),
'presupuestoEntity' => new PresupuestoEntity(),
'usingServerSideDataTable' => true,
];
$viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class $viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
return view(static::$viewPath . 'viewCosidotapablandaList', $viewData); return view(static::$viewPath . 'viewCosidotapablandaList', $viewData);
} }
public function add() public function add($tipo_impresion_id = 4)
{ {
// JJO // JJO
@ -165,134 +156,121 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
$this->viewData['formAction'] = route_to('createCosidotapablanda'); $this->viewData['formAction'] = route_to('createCosidotapablanda');
$this->viewData['boxTitle'] = lang('Basic.global.addNew') . ' ' . lang('Presupuestos.moduleTitleCosidoTB') . ' ' . lang('Basic.global.addNewSuffix'); $this->viewData = array_merge($this->viewData, $this->getStringsFromTipoImpresion($tipo_impresion_id));
$this->viewData['boxTitle'] = lang('Basic.global.addNew') . ' ' . $this->viewData['pageTitle'] . ' ' . lang('Basic.global.addNewSuffix');
return $this->displayForm(__METHOD__); return $this->displayForm(__METHOD__);
} // end function add() } // end function add()
public function edit($requestedId = null) public function edit($requestedId = null)
{ {
// JJO
$session = session();
// JJO if ($requestedId == null) :
$session = session(); return $this->redirect2listView();
endif;
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
$presupuestoEntity = $this->model->find($id);
if ($requestedId == null) : if ($presupuestoEntity == false) :
return $this->redirect2listView(); $message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Presupuestos.presupuesto')), $id]);
endif; return $this->redirect2listView('sweet-error', $message);
$id = filter_var($requestedId, FILTER_SANITIZE_URL); endif;
$presupuestoEntity = $this->model->find($id);
if ($presupuestoEntity == false) : $requestMethod = $this->request->getMethod();
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Presupuestos.presupuesto')), $id]);
return $this->redirect2listView('sweet-error', $message);
endif;
$requestMethod = $this->request->getMethod(); if ($requestMethod === 'post') :
if ($requestMethod === 'post') : $nullIfEmpty = true; // !(phpversion() >= '8.1');
$nullIfEmpty = true; // !(phpversion() >= '8.1'); $postData = $this->request->getPost();
$postData = $this->request->getPost(); $postData['updated_at'] = gmdate('Y-m-d H:m:s', time());
$postData['updated_at'] = gmdate('Y-m-d H:m:s', time()); $sanitizedData = $this->sanitized($postData, $nullIfEmpty);
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
// JJO
$sanitizedData['user_updated_id'] = $session->id_user;
if ($this->request->getPost('retractilado') == null) {
// JJO $sanitizedData['retractilado'] = false;
$sanitizedData['user_updated_id'] = $session->id_user; }
if ($this->request->getPost('retractilado5') == null) {
$sanitizedData['retractilado5'] = false;
}
if ($this->request->getPost('ferro') == null) {
$sanitizedData['ferro'] = false;
}
if ($this->request->getPost('ferro_digital') == null) {
$sanitizedData['ferro_digital'] = false;
}
if ($this->request->getPost('prototipo') == null) {
$sanitizedData['prototipo'] = false;
}
if ($this->request->getPost('marcapaginas') == null) {
$sanitizedData['marcapaginas'] = false;
}
if ($this->request->getPost('faja_color') == null) {
$sanitizedData['faja_color'] = false;
}
if ($this->request->getPost('papel_formato_personalizado') == null) {
$sanitizedData['papel_formato_personalizado'] = false;
}
if ($this->request->getPost('retractilado') == null) { $noException = true;
$sanitizedData['retractilado'] = false; if($sanitizedData['papel_formato_id'] == null && $sanitizedData['papel_formato_ancho'] == null
} && $sanitizedData['papel_formato_alto'] == null){
if ($this->request->getPost('retractilado5') == null) { if ($this->request->isAJAX()) {
$sanitizedData['retractilado5'] = false; $newTokenHash = csrf_hash();
} $csrfTokenName = csrf_token();
if ($this->request->getPost('ferro') == null) { $data = [
$sanitizedData['ferro'] = false; 'errorMensaje' => lang('Presupuestos.errores.formato_papel'),
} $csrfTokenName => $newTokenHash
if ($this->request->getPost('ferro_digital') == null) { ];
$sanitizedData['ferro_digital'] = false; return $this->respond($data);
}
if ($this->request->getPost('prototipo') == null) {
$sanitizedData['prototipo'] = false;
}
if ($this->request->getPost('marcapaginas') == null) {
$sanitizedData['marcapaginas'] = false;
}
if ($this->request->getPost('faja_color') == null) {
$sanitizedData['faja_color'] = false;
}
if ($this->request->getPost('papel_formato_personalizado') == null) {
$sanitizedData['papel_formato_personalizado'] = false;
}
$noException = true;
if($sanitizedData['papel_formato_id'] == null && $sanitizedData['papel_formato_ancho'] == null
&& $sanitizedData['papel_formato_alto'] == null){
if ($this->request->isAJAX()) {
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
'errorMensaje' => lang('Presupuestos.errores.formato_papel'),
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
}
else{
$this->session->setFlashData('errorMessage', lang('Presupuestos.errores.formato_papel'));
}
$successfulResult = false;
} }
else{ else{
$this->session->setFlashData('errorMessage', lang('Presupuestos.errores.formato_papel'));
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) )
if ($this->canValidate()) :
try {
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
} catch (\Exception $e) {
$noException = false;
$this->dealWithException($e);
}
else :
$this->viewData['warningMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Presupuestos.presupuesto'))]);
$this->session->setFlashdata('formErrors', $this->model->errors());
endif;
$presupuestoEntity->fill($sanitizedData);
$thenRedirect = false;
endif;
} }
$successfulResult = false;
}
else{
if ($noException && $successfulResult) : if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) )
$id = $presupuestoEntity->id ?? $id;
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('Presupuestos.presupuesto'))]) . '.';
// $message .= anchor("admin/presupuestos/{$id}/edit", lang('Basic.global.continueEditing') . '?');
//$message = ucfirst(str_replace("'", "\'", $message));
if ($thenRedirect) : if ($this->canValidate()) :
if (!empty($this->indexRoute)) : try {
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message); $successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
else : } catch (\Exception $e) {
if ($this->request->isAJAX()) { $noException = false;
$newTokenHash = csrf_hash(); $this->dealWithException($e);
$csrfTokenName = csrf_token(); }
$data = [ else :
'mensaje' => $message, $this->viewData['warningMessage'] = lang('Basic.global.formErr1', [mb_strtolower(lang('Presupuestos.presupuesto'))]);
$csrfTokenName => $newTokenHash $this->session->setFlashdata('formErrors', $this->model->errors());
];
return $this->respond($data); endif;
}
else{ $presupuestoEntity->fill($sanitizedData);
return $this->redirect2listView('sweet-success', $message);
} $thenRedirect = false;
endif;
endif; }
if ($noException && $successfulResult) :
$id = $presupuestoEntity->id ?? $id;
$message = lang('Basic.global.updateSuccess', [mb_strtolower(lang('Presupuestos.presupuesto'))]) . '.';
// $message .= anchor("admin/presupuestos/{$id}/edit", lang('Basic.global.continueEditing') . '?');
//$message = ucfirst(str_replace("'", "\'", $message));
if ($thenRedirect) :
if (!empty($this->indexRoute)) :
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
else : else :
if ($this->request->isAJAX()) { if ($this->request->isAJAX()) {
$newTokenHash = csrf_hash(); $newTokenHash = csrf_hash();
@ -304,12 +282,27 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
return $this->respond($data); return $this->respond($data);
} }
else{ else{
$this->session->setFlashData('sweet-success', $message); return $this->redirect2listView('sweet-success', $message);
} }
endif; endif;
else :
if ($this->request->isAJAX()) {
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
'mensaje' => $message,
$csrfTokenName => $newTokenHash
];
return $this->respond($data);
}
else{
$this->session->setFlashData('sweet-success', $message);
}
endif;
endif; // $noException && $successfulResult endif; // $noException && $successfulResult
endif; // ($requestMethod === 'post') endif; // ($requestMethod === 'post')
$this->viewData['presupuestoId'] = $id; $this->viewData['presupuestoId'] = $id;
@ -367,7 +360,7 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
$this->viewData['formAction'] = route_to('updateCosidotapablanda', $id); $this->viewData['formAction'] = route_to('updateCosidotapablanda', $id);
$this->viewData['boxTitle'] = lang('Basic.global.edit2') . ' ' . lang('Presupuestos.moduleTitleCosidoTB') . ' ' . lang('Basic.global.edit3'); $this->viewData['boxTitle'] = lang('Basic.global.edit2') . ' ' . $this->viewData['pageTitle'] . ' ' . lang('Basic.global.edit3');
return $this->displayForm(__METHOD__, $id); return $this->displayForm(__METHOD__, $id);
@ -403,12 +396,14 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
$order3 = PresupuestoModel::SORTABLE[$requestedOrder3 >= 0 ? $requestedOrder1 : 0]; $order3 = PresupuestoModel::SORTABLE[$requestedOrder3 >= 0 ? $requestedOrder1 : 0];
$dir3 = $reqData['order']['0']['dir'] ?? 'asc'; $dir3 = $reqData['order']['0']['dir'] ?? 'asc';
// por defecto, se deja cosido tapa blanda por ahora JJO
$tipo_presupuesto_id = $reqData['tipo_presupuesto_id'] ?? 4;
if (is_null($type)) { if (is_null($type)) {
$searchValues = get_filter_datatables_columns($reqData); $searchValues = get_filter_datatables_columns($reqData);
$resourceData = $this->model->getResource($searchValues)->orderBy($order1, $dir1)->orderBy($order2, $dir2) $resourceData = $this->model->getResource($searchValues, $tipo_presupuesto_id)->orderBy($order1, $dir1)->orderBy($order2, $dir2)
->orderBy($order3, $dir3)->limit($length, $start)->get()->getResultObject(); ->orderBy($order3, $dir3)->limit($length, $start)->get()->getResultObject();
foreach ($resourceData as $item) : foreach ($resourceData as $item) :
if (isset($item->comentarios_pdf) && strlen($item->comentarios_pdf) > 100) : if (isset($item->comentarios_pdf) && strlen($item->comentarios_pdf) > 100) :
@ -561,8 +556,8 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
return $this->respond(Collection::datatable( return $this->respond(Collection::datatable(
$resourceData, $resourceData,
$this->model->getResource()->countAllResults(), $this->model->getResource("", $tipo_presupuesto_id)->countAllResults(),
$this->model->getResource($search)->countAllResults() $this->model->getResource($search, $tipo_presupuesto_id)->countAllResults()
)); ));
} else { } else {
return $this->failUnauthorized('Invalid request', 403); return $this->failUnauthorized('Invalid request', 403);
@ -613,6 +608,40 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
} }
} }
private function getStringsFromTipoImpresion($tipo_impresion_id){
$breadcrumbTitle = "";
switch ($tipo_impresion_id){
// Fresado tapa blanda
case 2:
$viewData['pageTitle'] = lang('Presupuestos.moduleTitleFresadoTB');
$viewData['isCosido'] = 0;
$breadcrumbTitle = lang("App.menu_libros_fresasdo_tapa_blanda");
break;
// Cosido tapa blanda
case 4:
$viewData['pageTitle'] = lang('Presupuestos.moduleTitleCosidoTB');
$viewData['isCosido'] = 1;
$breadcrumbTitle = lang("App.menu_libros_cosido_tapa_blanda");
break;
default:
return "A IMPLEMENTAR!";
}
// Breadcrumbs
$viewData['breadcrumb'] = [
['title' => lang("App.menu_presupuestos"), 'route' => "javascript:void(0);", 'active' => false],
['title' => $breadcrumbTitle, 'route' => site_url('presupuestos/cosidotapablanda/list/' . $tipo_impresion_id), 'active' => true]
];
return $viewData;
}
public function getCompIntData($uso, $datosPedido, $papel_generico, $gramaje, $isColor, $isHq, $cliente_id, $datosTipolog = null) public function getCompIntData($uso, $datosPedido, $papel_generico, $gramaje, $isColor, $isHq, $cliente_id, $datosTipolog = null)
{ {
@ -790,6 +819,8 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
return $lineas; return $lineas;
} }
public function getCompIntRotData($datosPedido, $papel_generico, $gramaje, $paginas, $cliente_id, $datosTipolog = null) public function getCompIntRotData($datosPedido, $papel_generico, $gramaje, $paginas, $cliente_id, $datosTipolog = null)
{ {
$uso = 'interior'; $uso = 'interior';

View File

@ -4,8 +4,10 @@
return [ return [
'moduleTitleCosidoTB' => 'Budget for Softcover Stitched Book', 'moduleTitleCosidoTB' => 'Budget for Softcover Stitched Book',
'moduleTitleFresadoTB' => 'Budget for Softcover Milling Book',
'presupuestoCosidotapablandaList' => 'List of budgets for Softcover Stitched Books', 'presupuestoCosidotapablandaList' => 'List of budgets for Softcover Stitched Books',
'presupuestoFresadotapablandaList' => 'List of budgets for Milling Stitched Books',
'presupuesto' => 'Budget', 'presupuesto' => 'Budget',
'datosPresupuesto' => 'Budget information', 'datosPresupuesto' => 'Budget information',

View File

@ -3,8 +3,10 @@
return [ return [
'moduleTitleCosidoTB' => 'Presupuesto Libro Cosido Tapa Blanda', 'moduleTitleCosidoTB' => 'Presupuesto Libro Cosido Tapa Blanda',
'moduleTitleFresadoTB' => 'Presupuesto Libro Fresado Tapa Blanda',
'presupuestoCosidotapablandaList' => 'Lista presupuestos Libros Cosido Tapa Blanda', 'presupuestoCosidotapablandaList' => 'Lista presupuestos Libros Cosido Tapa Blanda',
'presupuestoFresadotapablandaList' => 'Lista presupuestos Libros Fresado Tapa Blanda',
'presupuesto' => 'Presupuesto', 'presupuesto' => 'Presupuesto',
'datosPresupuesto' => 'Datos generales del presupuesto', 'datosPresupuesto' => 'Datos generales del presupuesto',

View File

@ -220,7 +220,7 @@ class PresupuestoModel extends \App\Models\GoBaseModel
* *
* @return \CodeIgniter\Database\BaseBuilder * @return \CodeIgniter\Database\BaseBuilder
*/ */
public function getResource($search = []) public function getResource($search = [], $tipo_impresion_id = 4)
{ {
$builder = $this->db $builder = $this->db
->table($this->table . " t1") ->table($this->table . " t1")
@ -236,6 +236,7 @@ class PresupuestoModel extends \App\Models\GoBaseModel
$builder->join("presupuesto_estados t6", "t1.estado_id = t6.id", "left"); $builder->join("presupuesto_estados t6", "t1.estado_id = t6.id", "left");
$builder->where("t1.is_deleted", 0); $builder->where("t1.is_deleted", 0);
$builder->where("t1.tipo_impresion_id", $tipo_impresion_id);
if (empty($search)) if (empty($search))
return $builder; return $builder;

View File

@ -16,7 +16,7 @@
<input type="hidden" name="tipo_impresion_id" id="tipo_impresion_id" class="form-control" <input type="hidden" name="tipo_impresion_id" id="tipo_impresion_id" class="form-control"
value="<?= $tipo_impresion_id ?>"></input> value="<?= $tipo_impresion_id ?>"></input>
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosPresupuestoItems") ?> <?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosPresupuestoItems") ?>
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosLibroItems") ?> <?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/ ") ?>
<?php if (str_contains($formAction, 'edit')): ?> <?php if (str_contains($formAction, 'edit')): ?>
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosPresupuestoClienteItems") ?> <?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosPresupuestoClienteItems") ?>
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_lineasPresupuestoItems") ?> <?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_lineasPresupuestoItems") ?>
@ -82,13 +82,12 @@
id: 'id', id: 'id',
text: 'nombre', text: 'nombre',
searchTerm: params.term, searchTerm: params.term,
< <?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
? = csrf_token() ?? "token" ? > : < ? = csrf_token() ? > v
}; };
}, },
delay: 60, delay: 60,
processResults: function(response) { processResults: function(response) {
yeniden(response. < ? = csrf_token() ? > ); yeniden(response. <?= csrf_token() ?> );
return { return {
results: response.menu results: response.menu
}; };

View File

@ -9,8 +9,8 @@
<div class="card card-info"> <div class="card card-info">
<div class="card-header"> <div class="card-header">
<h3 class="card-title"><?=lang('Presupuestos.presupuestoCosidotapablandaList') ?></h3> <h3 class="card-title"><?= $pageTitle ?></h3>
<?=anchor(route_to('newCosidotapablanda'), lang('Basic.global.addNew').' '.lang('Presupuestos.presupuesto'), ['class'=>'btn btn-primary ']); ?> <?=anchor(route_to('newCosidotapablanda', $tipo_impresion_id), lang('Basic.global.addNew').' '.lang('Presupuestos.presupuesto'), ['class'=>'btn btn-primary ']); ?>
</div><!--//.card-header --> </div><!--//.card-header -->
<div class="card-body"> <div class="card-body">
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?> <?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
@ -155,6 +155,9 @@ theTable = $('#tableOfPresupuestos').DataTable({
}, },
ajax : $.fn.dataTable.pipeline( { ajax : $.fn.dataTable.pipeline( {
url: '<?= route_to('dataTableOfCosidotapablanda') ?>', url: '<?= route_to('dataTableOfCosidotapablanda') ?>',
data: function (d) {
d.tipo_presupuesto_id = '<?php echo $tipo_impresion_id; ?>';
},
method: 'POST', method: 'POST',
headers: {'X-Requested-With': 'XMLHttpRequest'}, headers: {'X-Requested-With': 'XMLHttpRequest'},
async: true, async: true,
@ -218,7 +221,7 @@ theTable.on( 'draw.dt', function () {
$(document).on('click', '.btn-edit', function(e) { $(document).on('click', '.btn-edit', function(e) {
window.location.href = `/presupuestos/cosidotapablanda/edit/${$(this).attr('data-id')}`; window.location.href = `/presupuestos/cosidotapablanda/edit/${$(this).attr('data-id')}/`;
}); });