mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'main' into 'dev/presupuestos_guardar_event'
# Conflicts: # ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/viewCosidotapablandaForm.php
This commit is contained in:
@ -512,11 +512,11 @@ $routes->group('clientedirecciones', ['namespace' => 'App\Controllers\Clientes']
|
||||
});
|
||||
$routes->resource('clientedirecciones', ['namespace' => 'App\Controllers\Clientes', 'controller' => 'Clientedirecciones', 'except' => 'show,new,create,update']);
|
||||
|
||||
|
||||
|
||||
$routes->group('cosidotapablanda', ['namespace' => 'App\Controllers\Presupuestos'], function ($routes) {
|
||||
$routes->get('list/(:num)', 'Cosidotapablanda::list/$1', ['as' => 'cosidotapablandaList']); // HOMOGENIZAR CON ARGS DINAMICOS!!!
|
||||
$routes->get('add', 'Cosidotapablanda::add', ['as' => 'newCosidotapablanda']);
|
||||
$routes->post('add', 'Cosidotapablanda::add', ['as' => 'createCosidotapablanda']);
|
||||
$routes->get('add/(:num)', 'Cosidotapablanda::add/$1', ['as' => 'newCosidotapablanda']);
|
||||
$routes->post('add/(:num)', 'Cosidotapablanda::add/$1', ['as' => 'createCosidotapablanda']);
|
||||
$routes->post('create', 'Cosidotapablanda::create', ['as' => 'ajaxCreateCosidotapablanda']);
|
||||
$routes->put('(:num)/update', 'Cosidotapablanda::update/$1', ['as' => 'ajaxUpdateCosidotapablanda']);
|
||||
$routes->post('edit/(:num)', 'Cosidotapablanda::edit/$1', ['as' => 'updateCosidotapablanda']);
|
||||
|
||||
@ -47,55 +47,41 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
|
||||
{
|
||||
|
||||
$this->viewData['pageTitle'] = lang('Presupuestos.moduleTitleCosidoTB');
|
||||
$this->viewData['usingSweetAlert'] = true;
|
||||
|
||||
// Se indica que este controlador trabaja con soft_delete
|
||||
$this->soft_delete = true;
|
||||
// Se indica el flag para los ficheros borrados
|
||||
$this->delete_flag = 1;
|
||||
|
||||
|
||||
$this->viewData = ['usingServerSideDataTable' => true]; // JJO
|
||||
|
||||
// Breadcrumbs
|
||||
$this->viewData['breadcrumb'] = [
|
||||
['title' => lang("App.menu_presupuestos"), 'route' => "javascript:void(0);", 'active' => false],
|
||||
['title' => lang("App.menu_libros_cosido_tapa_blanda"), 'route' => site_url('presupuestos/cosidotapablanda/list/4'), 'active' => true]
|
||||
];
|
||||
|
||||
parent::initController($request, $response, $logger);
|
||||
$this->model = new PresupuestoModel();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function list($tipo_presupuesto = 4)
|
||||
public function list($tipo_impresion_id = 4)
|
||||
{
|
||||
switch ($tipo_presupuesto){
|
||||
|
||||
case 4:
|
||||
break;
|
||||
|
||||
default:
|
||||
return "A IMPLEMENTAR!";
|
||||
|
||||
}
|
||||
|
||||
$viewData = [
|
||||
'currentModule' => static::$controllerSlug,
|
||||
'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('Presupuestos.presupuesto')]),
|
||||
'presupuestoEntity' => new PresupuestoEntity(),
|
||||
'usingServerSideDataTable' => true,
|
||||
|
||||
'tipo_impresion_id' => $tipo_impresion_id
|
||||
];
|
||||
|
||||
$viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
|
||||
$viewData = array_merge($viewData, $this->getStringsFromTipoImpresion($tipo_impresion_id));
|
||||
|
||||
$viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
|
||||
|
||||
|
||||
return view(static::$viewPath . 'viewCosidotapablandaList', $viewData);
|
||||
}
|
||||
|
||||
|
||||
public function add()
|
||||
public function add($tipo_impresion_id = null)
|
||||
{
|
||||
|
||||
// JJO
|
||||
@ -152,8 +138,9 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
|
||||
endif; // ($requestMethod === 'post')
|
||||
|
||||
$this->viewData['tipo_impresion_id'] = 4; // Cosido tapa blanda JJO
|
||||
$this->viewData['presupuestoEntity'] = isset($sanitizedData) ? new PresupuestoEntity($sanitizedData) : new PresupuestoEntity();
|
||||
$this->viewData['tipo_impresion_id'] = $tipo_impresion_id; // Cosido tapa blanda JJO
|
||||
$presupuestoEntity = isset($sanitizedData) ? new PresupuestoEntity($sanitizedData) : new PresupuestoEntity();
|
||||
$this->viewData['presupuestoEntity'] = $presupuestoEntity;
|
||||
$this->viewData['isCosido'] = (new TipoPresupuestoModel())->get_isCosido($this->viewData['tipo_impresion_id']);
|
||||
|
||||
$this->viewData['clienteList'] = $this->getClienteListItems($presupuestoEntity->cliente_id ?? null);
|
||||
@ -163,136 +150,123 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
|
||||
$this->viewData['POD'] = $this->getPOD();
|
||||
|
||||
$this->viewData['formAction'] = route_to('createCosidotapablanda');
|
||||
$this->viewData['formAction'] = route_to('createCosidotapablanda', $tipo_impresion_id);
|
||||
|
||||
$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__);
|
||||
} // end function add()
|
||||
|
||||
|
||||
public function edit($requestedId = null)
|
||||
{
|
||||
// JJO
|
||||
$session = session();
|
||||
|
||||
// JJO
|
||||
$session = session();
|
||||
if ($requestedId == null) :
|
||||
return $this->redirect2listView();
|
||||
endif;
|
||||
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
|
||||
$presupuestoEntity = $this->model->find($id);
|
||||
|
||||
if ($requestedId == null) :
|
||||
return $this->redirect2listView();
|
||||
endif;
|
||||
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
|
||||
$presupuestoEntity = $this->model->find($id);
|
||||
if ($presupuestoEntity == false) :
|
||||
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Presupuestos.presupuesto')), $id]);
|
||||
return $this->redirect2listView('sweet-error', $message);
|
||||
endif;
|
||||
|
||||
if ($presupuestoEntity == false) :
|
||||
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Presupuestos.presupuesto')), $id]);
|
||||
return $this->redirect2listView('sweet-error', $message);
|
||||
endif;
|
||||
$requestMethod = $this->request->getMethod();
|
||||
|
||||
$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;
|
||||
|
||||
|
||||
// JJO
|
||||
$sanitizedData['user_updated_id'] = $session->id_user;
|
||||
if ($this->request->getPost('retractilado') == null) {
|
||||
$sanitizedData['retractilado'] = false;
|
||||
}
|
||||
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) {
|
||||
$sanitizedData['retractilado'] = false;
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
$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;
|
||||
$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{
|
||||
|
||||
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;
|
||||
$this->session->setFlashData('errorMessage', lang('Presupuestos.errores.formato_papel'));
|
||||
}
|
||||
$successfulResult = false;
|
||||
}
|
||||
else{
|
||||
|
||||
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 ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) )
|
||||
|
||||
if ($thenRedirect) :
|
||||
if (!empty($this->indexRoute)) :
|
||||
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
|
||||
else :
|
||||
if ($this->request->isAJAX()) {
|
||||
$newTokenHash = csrf_hash();
|
||||
$csrfTokenName = csrf_token();
|
||||
$data = [
|
||||
'mensaje' => $message,
|
||||
$csrfTokenName => $newTokenHash
|
||||
];
|
||||
return $this->respond($data);
|
||||
}
|
||||
else{
|
||||
return $this->redirect2listView('sweet-success', $message);
|
||||
}
|
||||
|
||||
endif;
|
||||
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;
|
||||
}
|
||||
|
||||
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 :
|
||||
if ($this->request->isAJAX()) {
|
||||
$newTokenHash = csrf_hash();
|
||||
@ -304,12 +278,27 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
return $this->respond($data);
|
||||
}
|
||||
else{
|
||||
$this->session->setFlashData('sweet-success', $message);
|
||||
return $this->redirect2listView('sweet-success', $message);
|
||||
}
|
||||
|
||||
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; // ($requestMethod === 'post')
|
||||
endif; // $noException && $successfulResult
|
||||
endif; // ($requestMethod === 'post')
|
||||
|
||||
|
||||
$this->viewData['presupuestoId'] = $id;
|
||||
@ -363,11 +352,13 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
'fajaColor' => 16,
|
||||
];
|
||||
|
||||
$this->viewData['tipo_impresion_id'] = 4; // Cosido tapa blanda JJO
|
||||
$this->viewData['tipo_impresion_id'] = $presupuestoEntity->tipo_impresion_id; // Cosido tapa blanda JJO
|
||||
|
||||
$this->viewData = array_merge($this->viewData, $this->getStringsFromTipoImpresion($presupuestoEntity->tipo_impresion_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);
|
||||
@ -403,12 +394,14 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
$order3 = PresupuestoModel::SORTABLE[$requestedOrder3 >= 0 ? $requestedOrder1 : 0];
|
||||
$dir3 = $reqData['order']['0']['dir'] ?? 'asc';
|
||||
|
||||
// por defecto, se deja cosido tapa blanda por ahora JJO
|
||||
$tipo_impresion_id = $reqData['tipo_impresion_id'] ?? 4;
|
||||
|
||||
if (is_null($type)) {
|
||||
|
||||
$searchValues = get_filter_datatables_columns($reqData);
|
||||
|
||||
$resourceData = $this->model->getResource($searchValues)->orderBy($order1, $dir1)->orderBy($order2, $dir2)
|
||||
$resourceData = $this->model->getResource($searchValues, $tipo_impresion_id)->orderBy($order1, $dir1)->orderBy($order2, $dir2)
|
||||
->orderBy($order3, $dir3)->limit($length, $start)->get()->getResultObject();
|
||||
foreach ($resourceData as $item) :
|
||||
if (isset($item->comentarios_pdf) && strlen($item->comentarios_pdf) > 100) :
|
||||
@ -460,7 +453,7 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
'ancho' => intval($reqData['ancho']) ?? 100000,
|
||||
'alto' => intval($reqData['alto']) ?? 100000,
|
||||
'a_favor_fibra' => $reqData['a_favor_fibra'] ?? 1,
|
||||
'isCosido' => true, // JJO esto es custom por cada tipo de presupuesto
|
||||
'isCosido' => (new TipoPresupuestoModel())->get_isCosido($tipo_impresion_id), // JJO esto es custom por cada tipo de presupuesto
|
||||
);
|
||||
|
||||
$papel_generico = [
|
||||
@ -490,7 +483,9 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
array_push($datosTipolog, $data);
|
||||
}
|
||||
|
||||
$resourceData = $this->getCompIntData($type, $datosPedido, $papel_generico, $gramaje, $isColor, $isHq, $cliente_id, $datosTipolog);
|
||||
$a_favor_fibra = $reqData['a_favor_fibra'] ?? false;
|
||||
|
||||
$resourceData = $this->getCompIntData($type, $datosPedido, $papel_generico, $gramaje, $isColor, $isHq, $cliente_id, $datosTipolog, $a_favor_fibra);
|
||||
|
||||
$newTokenHash = csrf_hash();
|
||||
$csrfTokenName = csrf_token();
|
||||
@ -556,13 +551,12 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
return $this->respond($data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return $this->respond(Collection::datatable(
|
||||
$resourceData,
|
||||
$this->model->getResource()->countAllResults(),
|
||||
$this->model->getResource($search)->countAllResults()
|
||||
$this->model->getResource("", $tipo_impresion_id)->countAllResults(),
|
||||
$this->model->getResource($search, $tipo_impresion_id)->countAllResults()
|
||||
));
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
@ -613,8 +607,42 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
}
|
||||
}
|
||||
|
||||
private function getStringsFromTipoImpresion($tipo_impresion_id){
|
||||
|
||||
$breadcrumbTitle = "";
|
||||
|
||||
public function getCompIntData($uso, $datosPedido, $papel_generico, $gramaje, $isColor, $isHq, $cliente_id, $datosTipolog = null)
|
||||
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, $a_favor_fibra = false)
|
||||
{
|
||||
$tipo = $isColor? ($isHq?'colorhq':'color'): ($isHq?'negrohq':'negro');
|
||||
|
||||
@ -671,7 +699,7 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
|
||||
if($maquina->is_inkjet){
|
||||
$parametrosInkjet = (object)array(
|
||||
'a_favor_fibra' => 1, // este parametro se cambia para comprobar
|
||||
'a_favor_fibra' => $a_favor_fibra, // este parametro se cambia para comprobar
|
||||
// en las dos direcciones (menos en rustica fresada que es siempre 1)
|
||||
'bnPages' => $isColor?0:$datosPedido->paginas,
|
||||
'colorPages' => $isColor?$datosPedido->paginas:0,
|
||||
@ -709,13 +737,7 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
}
|
||||
|
||||
if($maquina->is_inkjet){
|
||||
$linea['fields'] = PresupuestoService::getCostesLineaRotativa($maquina, $papel, $datosPedido, $parametrosInkjet);
|
||||
[$precio_pliego_impresion, $margen_pliego_impresion] = PresupuestoService::getPrecioPliego($maquina, $papel, $datosPedido->paginas);
|
||||
$linea['fields']['precios_pliegos'] = $precio_pliego_impresion;
|
||||
$linea['fields']['precio_libro'] = $linea['fields']['pliegos_libro'] * $precio_pliego_impresion;
|
||||
$linea['fields']['a_favor_fibra'] = $parametrosInkjet->a_favor_fibra;
|
||||
$linea['fields']['paginas_color'] = $isColor?$datosPedido->paginas:0;
|
||||
$linea['fields']['datosTipologias'] = $datosTipologias[0];
|
||||
$linea = PresupuestoService::getCostesLinea($uso, $datosPedido, $maquina, $papel, $opciones_papel, $tarifa, $parametrosInkjet->a_favor_fibra);
|
||||
}
|
||||
else{
|
||||
$linea = PresupuestoService::getCostesLinea($uso, $datosPedido, $maquina, $papel, $opciones_papel, $tarifa);
|
||||
@ -723,6 +745,11 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
|
||||
if(array_key_exists('error', $linea))
|
||||
continue;
|
||||
|
||||
if($maquina->is_inkjet){
|
||||
// calculo de tintas
|
||||
$linea['fields'] = array_merge($linea['fields'], PresupuestoService::calculoCosteTintas($maquina, $datosPedido, $parametrosInkjet));
|
||||
}
|
||||
|
||||
$linea['fields']['tarifa_impresion_id'] = $tarifaId;
|
||||
$linea['fields']['maquina'] = $maquina->maquina;
|
||||
@ -735,10 +762,6 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
$linea['fields']['papel_generico_id'] = $papel_generico['id'];
|
||||
$linea['fields']['papel_generico'] = $papel_generico['nombre'];
|
||||
|
||||
if($maquina->is_inkjet){
|
||||
$linea['fields']['precio_click'] = $tarifa;
|
||||
$linea['fields']['precio_click_pedido'] = $linea['fields']['clicks_pedido'] * $linea['fields']['precio_click'];
|
||||
}
|
||||
$linea['fields']['tiempo_maquina'] = PresupuestoService::getTiempoMaquina(
|
||||
$linea['fields']['precio_click_pedido'],
|
||||
$linea['fields']['precio_click'],
|
||||
@ -760,7 +783,7 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
continue;
|
||||
}
|
||||
|
||||
$linea['fields']['tipo_maquina'] = $maquina->is_inkjet?'inkjet':'toner';
|
||||
$linea['fields']['tipo_maquina'] = $maquina->is_inkjet?'inkjet':'toner';
|
||||
$linea['fields']['precio_hora'] = $precio_hora*(1+$margen_precio_hora/100.0);
|
||||
$linea['fields']['precio_hora_margen'] = $margen_precio_hora;
|
||||
$linea['fields']['horas_maquina'] = $tiempo;
|
||||
@ -768,8 +791,16 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
$linea['fields']['margen_impresion_horas'] = $precio_hora*($margen_precio_hora/100.0)*$tiempo;
|
||||
|
||||
if($maquina->is_inkjet){
|
||||
$linea['fields']['precio_pedido'] = $linea['fields']['precio_libro'] * ($datosPedido->tirada + $datosPedido->merma)*(1+$margen_pliego_impresion);
|
||||
$linea['fields']['margen_papel_pedido'] = $linea['fields']['pliegos_libro']*$margen_pliego_impresion* ($datosPedido->tirada + $datosPedido->merma); ;
|
||||
$linea['fields']['a_favor_fibra'] = $parametrosInkjet->a_favor_fibra;
|
||||
$linea['fields']['paginas_color'] = $isColor?$datosPedido->paginas:0;
|
||||
$linea['fields']['totalClicksPedido'] = $linea['fields']['precio_click_pedido'];
|
||||
$linea['fields']['clicks_libro'] = round(ceil($linea['fields']['pliegos_libro']) * 2, 2);
|
||||
$linea['fields']['clicks_pedido'] = round($linea['fields']['clicks_libro'] * ($datosPedido->tirada + $datosPedido->merma), 2);
|
||||
[$ancho, $alto] = PresupuestoService::calculoDimForma($datosPedido, $parametrosInkjet);
|
||||
$linea['fields']['factor_anchura'] = round($maquina->ancho_impresion / $ancho, 2);
|
||||
$linea['fields']['factor_altura'] = round($maquina->alto_impresion / ($alto + PresupuestoService::MARGEN_PAGINAS_ROTATIVA), 2);
|
||||
$linea['fields']['paginas_por_pliego'] = ($datosPedido->isCosido)?$linea['fields']['num_formas']['value']*2:$linea['fields']['num_formas']['value'] * 2; // Se multiplica *2 porque es doble cara
|
||||
$linea['fields']['datosTipologias'] = $datosTipologias[0];
|
||||
$linea['fields']['total_impresion'] =
|
||||
$linea['fields']['precio_pedido'] + // papel
|
||||
$linea['fields']['precio_impresion_horas'] + // horas de maquina
|
||||
@ -790,6 +821,8 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
return $lineas;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function getCompIntRotData($datosPedido, $papel_generico, $gramaje, $paginas, $cliente_id, $datosTipolog = null)
|
||||
{
|
||||
$uso = 'interior';
|
||||
|
||||
@ -140,8 +140,11 @@ class Presupuestoencuadernaciones extends \App\Controllers\GoBaseResourceControl
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
$values = $this->model->initPresupuesto(4, $solapas, $tirada, $paginas, $ancho, $alto, $POD);
|
||||
else{
|
||||
$tipo_impresion_id = $reqData['tipo_impresion_id'] ?? 4;
|
||||
$values = $this->model->initPresupuesto($tipo_impresion_id, $solapas, $tirada, $paginas, $ancho, $alto, $POD);
|
||||
}
|
||||
|
||||
$data = [
|
||||
'values' => $values,
|
||||
$csrfTokenName => $newTokenHash
|
||||
|
||||
@ -104,6 +104,7 @@ class Presupuestomanipulados extends \App\Controllers\GoBaseResourceController
|
||||
$POD = $reqData['POD'] ?? 0;
|
||||
$tipo = $reqData['tipo'] ?? null;
|
||||
|
||||
|
||||
$newTokenHash = csrf_hash();
|
||||
$csrfTokenName = csrf_token();
|
||||
|
||||
@ -112,7 +113,8 @@ class Presupuestomanipulados extends \App\Controllers\GoBaseResourceController
|
||||
}
|
||||
else{
|
||||
$solapas = $reqData['solapas'] ?? -1;
|
||||
$values = $this->model->initPresupuesto(4, $solapas, $tirada, $POD);
|
||||
$tipo_impresion_id = $reqData['tipo_impresion_id'] ?? 4;
|
||||
$values = $this->model->initPresupuesto($tipo_impresion_id, $solapas, $tirada, $POD);
|
||||
}
|
||||
|
||||
$data = [
|
||||
|
||||
@ -4,8 +4,10 @@
|
||||
|
||||
return [
|
||||
'moduleTitleCosidoTB' => 'Budget for Softcover Stitched Book',
|
||||
'moduleTitleFresadoTB' => 'Budget for Softcover Milling Book',
|
||||
|
||||
'presupuestoCosidotapablandaList' => 'List of budgets for Softcover Stitched Books',
|
||||
'presupuestoFresadotapablandaList' => 'List of budgets for Milling Stitched Books',
|
||||
'presupuesto' => 'Budget',
|
||||
|
||||
'datosPresupuesto' => 'Budget information',
|
||||
|
||||
@ -3,8 +3,10 @@
|
||||
|
||||
return [
|
||||
'moduleTitleCosidoTB' => 'Presupuesto Libro Cosido Tapa Blanda',
|
||||
'moduleTitleFresadoTB' => 'Presupuesto Libro Fresado Tapa Blanda',
|
||||
|
||||
'presupuestoCosidotapablandaList' => 'Lista presupuestos Libros Cosido Tapa Blanda',
|
||||
'presupuestoFresadotapablandaList' => 'Lista presupuestos Libros Fresado Tapa Blanda',
|
||||
'presupuesto' => 'Presupuesto',
|
||||
|
||||
'datosPresupuesto' => 'Datos generales del presupuesto',
|
||||
|
||||
@ -51,12 +51,11 @@ class PresupuestoEncuadernacionesModel extends \App\Models\GoBaseModel
|
||||
public function initPresupuesto($tipo_presupuesto, $solapas, $tirada, $paginas, $ancho, $alto, $POD){
|
||||
|
||||
$model = model('App\Models\Presupuestos\TipoPresupuestoServiciosDefectoModel');
|
||||
$tarifas_procesar = $model->get_tarifas($tipo_presupuesto,$solapas, "encuadernacion");
|
||||
$tarifas_procesar = $model->get_tarifas($tipo_presupuesto, $solapas, "encuadernacion");
|
||||
|
||||
$modelTarifa = model('App\Models\Tarifas\TarifaEncuadernacionModel');
|
||||
$tarifas = [];
|
||||
|
||||
|
||||
foreach($tarifas_procesar as $tarifa){
|
||||
|
||||
if($modelTarifa->isTarifaPorHoras($tarifa['tarifa_id'])){
|
||||
|
||||
@ -220,7 +220,7 @@ class PresupuestoModel extends \App\Models\GoBaseModel
|
||||
*
|
||||
* @return \CodeIgniter\Database\BaseBuilder
|
||||
*/
|
||||
public function getResource($search = [])
|
||||
public function getResource($search = [], $tipo_impresion_id = 4)
|
||||
{
|
||||
$builder = $this->db
|
||||
->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->where("t1.is_deleted", 0);
|
||||
$builder->where("t1.tipo_impresion_id", $tipo_impresion_id);
|
||||
|
||||
if (empty($search))
|
||||
return $builder;
|
||||
|
||||
@ -34,8 +34,6 @@ class TipoPresupuestoServiciosDefectoModel extends \App\Models\GoBaseModel
|
||||
|
||||
public function get_tarifas($tipo_presupuesto=-1, $solapas=0, $tipo=""){
|
||||
|
||||
$where = "(t1.solapas=2) OR (t1.solapas=" . $solapas . ")";
|
||||
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->where("t1.tipo_presupuesto_id", $tipo_presupuesto);
|
||||
@ -43,42 +41,42 @@ class TipoPresupuestoServiciosDefectoModel extends \App\Models\GoBaseModel
|
||||
if(strcmp($tipo, "encuadernacion")==0){
|
||||
|
||||
$builder->join("tarifa_encuadernacion t2", "t1.tarifa_id = t2.id", "left");
|
||||
$builder->where("is_servicio_encuadernacion", 1);
|
||||
$builder->where("is_servicio_acabado", 0);
|
||||
$builder->where("is_servicio_manipulado", 0);
|
||||
$builder->where("is_servicio_preimpresion", 0);
|
||||
$builder->where("t1.is_servicio_encuadernacion", 1);
|
||||
$builder->where("t1.is_servicio_acabado", 0);
|
||||
$builder->where("t1.is_servicio_manipulado", 0);
|
||||
$builder->where("t1.is_servicio_preimpresion", 0);
|
||||
}
|
||||
else if(strcmp($tipo, "acabado")==0){
|
||||
|
||||
$builder->join("lg_tarifa_acabado t2", "t1.tarifa_id = t2.id", "left");
|
||||
$builder->where("is_servicio_acabado", 1);
|
||||
$builder->where("is_servicio_encuadernacion", 0);
|
||||
$builder->where("is_servicio_manipulado", 0);
|
||||
$builder->where("is_servicio_preimpresion", 0);
|
||||
$builder->where("t1.is_servicio_acabado", 1);
|
||||
$builder->where("t1.is_servicio_encuadernacion", 0);
|
||||
$builder->where("t1.is_servicio_manipulado", 0);
|
||||
$builder->where("t1.is_servicio_preimpresion", 0);
|
||||
}
|
||||
else if(strcmp($tipo, "manipulado")==0){
|
||||
|
||||
$builder->join("lg_tarifa_manipulado t2", "t1.tarifa_id = t2.id", "left");
|
||||
$builder->where("is_servicio_manipulado", 1);
|
||||
$builder->where("is_servicio_encuadernacion", 0);
|
||||
$builder->where("is_servicio_acabado", 0);
|
||||
$builder->where("is_servicio_preimpresion", 0);
|
||||
$builder->where("t1.is_servicio_manipulado", 1);
|
||||
$builder->where("t1.is_servicio_encuadernacion", 0);
|
||||
$builder->where("t1.is_servicio_acabado", 0);
|
||||
$builder->where("t1.is_servicio_preimpresion", 0);
|
||||
|
||||
}
|
||||
else if(strcmp($tipo, "preimpresion")==0){
|
||||
|
||||
$builder->join("lg_tarifa_preimpresion t2", "t1.tarifa_id = t2.id", "left");
|
||||
$builder->where("is_servicio_preimpresion", 1);
|
||||
$builder->where("is_servicio_encuadernacion", 0);
|
||||
$builder->where("is_servicio_acabado", 0);
|
||||
$builder->where("is_servicio_manipulado", 0);
|
||||
$builder->where("t1.is_servicio_preimpresion", 1);
|
||||
$builder->where("t1.is_servicio_encuadernacion", 0);
|
||||
$builder->where("t1.is_servicio_acabado", 0);
|
||||
$builder->where("t1.is_servicio_manipulado", 0);
|
||||
|
||||
}
|
||||
else{
|
||||
return [];
|
||||
}
|
||||
|
||||
$where = "t1.solapas IS NULL OR t1.solapas='" . $solapas . "'";
|
||||
$where = "(t1.solapas IS NULL OR t1.solapas='" . $solapas . "')";
|
||||
$builder->where($where);
|
||||
|
||||
$builder->where("t2.is_deleted", 0);
|
||||
|
||||
@ -38,14 +38,14 @@ class PresupuestoService extends BaseService
|
||||
*
|
||||
* @return [type]
|
||||
*/
|
||||
public static function getCostesLinea($uso, $datosPedido, $maquina, $papel_impresion, $opciones_papel, $tarifa)
|
||||
public static function getCostesLinea($uso, $datosPedido, $maquina, $papel_impresion, $opciones_papel, $tarifa, $forzar_a_favor_fibra = false)
|
||||
{
|
||||
$response['fields'] = [];
|
||||
|
||||
if ($uso!='rotativa') {
|
||||
|
||||
$ancho_calculo = ($uso=='cubierta' || $uso=='sobrecubierta') ? $datosPedido->anchoExteriores : $datosPedido->ancho;
|
||||
$formas = PresupuestoService::getNumFormasPlana($uso, $maquina, $ancho_calculo, $datosPedido->alto, $datosPedido->isCosido);
|
||||
$formas = PresupuestoService::getNumFormasPlana($uso, $maquina, $ancho_calculo, $datosPedido->alto, $datosPedido->isCosido, $forzar_a_favor_fibra);
|
||||
$response['fields'] = $formas;
|
||||
}
|
||||
|
||||
@ -142,131 +142,7 @@ class PresupuestoService extends BaseService
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Devuelve los calculos para la linea de rotativa.
|
||||
*/
|
||||
public static function getCostesLineaInkjet($maquina, $papel_impresion, $datosPedido, $parametrosInkjet)
|
||||
{
|
||||
$data = [];
|
||||
|
||||
$data['resolucion'] = 600;
|
||||
$data['pulgada'] = 1 / 1000000000000.0;
|
||||
$data['superficie'] = round((($datosPedido->ancho / 2.54) / 10) * (($datosPedido->alto / 2.54) / 10), 2);
|
||||
|
||||
// posicionamos paginas en función de a favor de fibra o no
|
||||
|
||||
$anchoLibro = $datosPedido->ancho;
|
||||
$altoLibro = $datosPedido->alto;
|
||||
|
||||
$formas = PresupuestoService::getNumFormasPlana('interior', $maquina, $datosPedido->ancho, $datosPedido->alto, $datosPedido->isCosido);
|
||||
$response['fields'] = $formas;
|
||||
|
||||
|
||||
if ($response['fields']['num_formas']['posicion_formas'] == 'n/a') {
|
||||
$response['error']['value'] = true;
|
||||
$response['error']['message'] = 'no_formas_disponibles';
|
||||
return $response;
|
||||
}
|
||||
|
||||
$data['ancho'] = $anchoLibro;
|
||||
$data['alto'] = $altoLibro;
|
||||
|
||||
// si es cosido ancho x 2
|
||||
|
||||
if ($datosPedido->isCosido) {
|
||||
|
||||
$data['ancho'] = $data['ancho'] * 2;
|
||||
}
|
||||
|
||||
// calculo de papel y clicks
|
||||
$factor_anchura = round($maquina->ancho_impresion / $data['ancho'], 2);
|
||||
$factor_altura = round($maquina->alto_impresion / ($data['alto'] + self::MARGEN_PAGINAS_ROTATIVA), 2);
|
||||
$factor_altura_click = round($maquina->alto_click / ($data['alto'] + self::MARGEN_PAGINAS_ROTATIVA), 2);
|
||||
|
||||
$multiplicador_pliego = $datosPedido->isCosido ? 4 : 2;
|
||||
$paginas_por_pliego = round(floor($factor_anchura) * $factor_altura * $multiplicador_pliego, 2);
|
||||
$pliegos_libro = round($paginas_por_pliego ? $datosPedido->paginas / $paginas_por_pliego : 0, 2);
|
||||
$metros_papel_libro = round($pliegos_libro * ($maquina->alto_impresion / 1000.0), 2);
|
||||
$metros_papel_total = round($metros_papel_libro * ($datosPedido->tirada + $datosPedido->merma), 2);
|
||||
|
||||
$paginas_por_pliego_click = round(floor($factor_anchura) * $factor_altura_click * $multiplicador_pliego, 2);
|
||||
$pliegos_libro_click = round($paginas_por_pliego_click ? $datosPedido->paginas / $paginas_por_pliego_click : 0, 2);
|
||||
$clicks_libro = round(ceil($pliegos_libro_click) * 2, 2);
|
||||
$clicks_pedido = round($clicks_libro * ($datosPedido->tirada + $datosPedido->merma), 2);
|
||||
|
||||
$data['factor_altura'] = $factor_altura;
|
||||
$data['factor_anchura'] = $factor_anchura;
|
||||
$data['paginas_por_pliego'] = $paginas_por_pliego;
|
||||
$data['pliegos_libro'] = $pliegos_libro;
|
||||
$data['pliegos_pedido'] = $pliegos_libro * ($datosPedido->tirada + $datosPedido->merma);
|
||||
$data['metros_papel_libro'] = $metros_papel_libro;
|
||||
$data['metros_papel_total'] = $metros_papel_total;
|
||||
$data['clicks_libro'] = $clicks_libro;
|
||||
$data['clicks_pedido'] = $clicks_pedido;
|
||||
|
||||
// calculo de tintas
|
||||
$data['num_gotas_negro'] = round($data['superficie'] * $data['resolucion'] * $data['resolucion'] * ($parametrosInkjet->rotativa_negro / 100.0), 0);
|
||||
$data['num_gotas_cyan'] = round($data['superficie'] * $data['resolucion'] * $data['resolucion'] * ($parametrosInkjet->rotativa_cyan / 100.0), 0);
|
||||
$data['num_gotas_magenta'] = round($data['superficie'] * $data['resolucion'] * $data['resolucion'] * ($parametrosInkjet->rotativa_magenta / 100.0), 0);
|
||||
$data['num_gotas_amarillo'] = round($data['superficie'] * $data['resolucion'] * $data['resolucion'] * ($parametrosInkjet->rotativa_amarillo / 100.0), 0);
|
||||
|
||||
$pag_negro = $parametrosInkjet->bnPages;
|
||||
$pag_color = 0;
|
||||
if ($parametrosInkjet->colorPages>0) {
|
||||
$pag_color = $parametrosInkjet->colorPages;
|
||||
}
|
||||
|
||||
// peso tintas
|
||||
$data['peso_gotas_negro'] = round((($data['num_gotas_negro'] * $parametrosInkjet->rotativa_gota_negro * $data['pulgada']) / (17.91 / 20.0)) * $pag_negro * 1000, 6);
|
||||
$data['peso_gotas_cyan'] = round((($data['num_gotas_cyan'] * $parametrosInkjet->rotativa_gota_color * $data['pulgada']) / (17.65 / 20.0)) * $pag_color * 1000, 6);
|
||||
$data['peso_gotas_magenta'] = round((($data['num_gotas_magenta'] * $parametrosInkjet->rotativa_gota_color * $data['pulgada']) / (17.65 / 20.0)) * $pag_color * 1000, 6);
|
||||
$data['peso_gotas_amarillo'] = round((($data['num_gotas_amarillo'] * $parametrosInkjet->rotativa_gota_color * $data['pulgada']) / (17.65 / 20.0)) * $pag_color * 1000, 6);
|
||||
|
||||
// costes de tintas
|
||||
$data['peso_gotas_negro_pedido'] = round($data['peso_gotas_negro'], 2) * ($datosPedido->tirada + $datosPedido->merma);
|
||||
$data['peso_gotas_cyan_pedido'] = round($data['peso_gotas_cyan'], 2) * ($datosPedido->tirada + $datosPedido->merma);
|
||||
$data['peso_gotas_magenta_pedido'] = round($data['peso_gotas_magenta'], 2) * ($datosPedido->tirada + $datosPedido->merma);
|
||||
$data['peso_gotas_amarillo_pedido'] = round($data['peso_gotas_amarillo'], 2) * ($datosPedido->tirada + $datosPedido->merma);
|
||||
|
||||
// precio tinta
|
||||
$data['precio_tinta'] = round(
|
||||
round(($data['peso_gotas_negro_pedido'] / 1000.0) * $maquina->precio_tinta_negro, 2) +
|
||||
round(($data['peso_gotas_cyan_pedido'] / 1000.0) * $maquina->precio_tinta_color, 2) +
|
||||
round(($data['peso_gotas_magenta_pedido'] / 1000.0) * $maquina->precio_tinta_color, 2) +
|
||||
round(($data['peso_gotas_amarillo_pedido'] / 1000.0) * $maquina->precio_tinta_color, 2)
|
||||
, 2);
|
||||
|
||||
// precio pagina
|
||||
$data['precio_pagina_negro'] = round($pag_negro ? $data['precio_tinta'] / ($pag_negro * ($datosPedido->tirada + $datosPedido->merma)) : 0, 6);
|
||||
$data['precio_pagina_color'] = round($pag_color ? $data['precio_tinta'] / ($pag_color * ($datosPedido->tirada + $datosPedido->merma)) : 0, 6);
|
||||
|
||||
|
||||
|
||||
$data['mano'] = PresupuestoService::computeLomoInterior($datosPedido->paginas, $papel_impresion->espesor);
|
||||
// ($paginas / 2.0) * (($gramaje / 1000.0) * $papel_compra->mano);
|
||||
|
||||
// peso
|
||||
$data['peso'] = PresupuestoService::computePeso(
|
||||
ancho: $datosPedido->isCosido ? $datosPedido->ancho / 2.0 : $datosPedido->ancho,
|
||||
alto: $datosPedido->alto,
|
||||
gramaje: $papel_impresion->gramaje,
|
||||
paginas: $datosPedido->paginas
|
||||
);
|
||||
|
||||
$data['dimensiones_maquina'] = [$maquina->ancho, $maquina->alto];
|
||||
$data['dimensiones_maquina_impresion'] = [$maquina->ancho_impresion, $maquina->alto_impresion];
|
||||
$data['dimensiones_maquina_click'] = [$maquina->ancho_impresion, $maquina->alto_click];
|
||||
$data['dimensiones_libro'] = [$datosPedido->ancho, $datosPedido->alto];
|
||||
|
||||
$data['alto_click'] = $maquina->alto_click;
|
||||
|
||||
$formas = PresupuestoService::getNumFormasRot($maquina, $datosPedido->ancho, $datosPedido->alto, $datosPedido->isCosido);
|
||||
$data['num_formas'] = $formas;
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Devuelve los calculos para la linea de rotativa.
|
||||
*/
|
||||
@ -274,32 +150,7 @@ class PresupuestoService extends BaseService
|
||||
{
|
||||
$data = [];
|
||||
|
||||
$data['resolucion'] = 600;
|
||||
$data['pulgada'] = 1 / 1000000000000.0;
|
||||
$data['superficie'] = round((($datosPedido->ancho / 2.54) / 10) * (($datosPedido->alto / 2.54) / 10), 2);
|
||||
|
||||
// posicionamos paginas en función de a favor de fibra o no
|
||||
|
||||
$anchoLibro = $datosPedido->ancho;
|
||||
$altoLibro = $datosPedido->alto;
|
||||
|
||||
if (!$parametrosRotativa->a_favor_fibra) {
|
||||
$anchoLibro = $datosPedido->alto;
|
||||
$altoLibro = $datosPedido->ancho;
|
||||
}
|
||||
|
||||
$data['ancho'] = $anchoLibro;
|
||||
$data['alto'] = $altoLibro;
|
||||
|
||||
// si es cosido ancho x 2
|
||||
|
||||
if ($datosPedido->isCosido) {
|
||||
if (!$parametrosRotativa->a_favor_fibra) {
|
||||
$data['alto'] = $data['alto'] * 2;
|
||||
} else {
|
||||
$data['ancho'] = $data['ancho'] * 2;
|
||||
}
|
||||
}
|
||||
[$data['ancho'], $data['alto']] = PresupuestoService::calculoDimForma($datosPedido, $parametrosRotativa);
|
||||
|
||||
// calculo de papel y clicks
|
||||
$factor_anchura = round($maquina->ancho_impresion / $data['ancho'], 2);
|
||||
@ -328,41 +179,8 @@ class PresupuestoService extends BaseService
|
||||
$data['clicks_pedido'] = $clicks_pedido;
|
||||
|
||||
// calculo de tintas
|
||||
$data['num_gotas_negro'] = round($data['superficie'] * $data['resolucion'] * $data['resolucion'] * ($parametrosRotativa->rotativa_negro / 100.0), 0);
|
||||
$data['num_gotas_cyan'] = round($data['superficie'] * $data['resolucion'] * $data['resolucion'] * ($parametrosRotativa->rotativa_cyan / 100.0), 0);
|
||||
$data['num_gotas_magenta'] = round($data['superficie'] * $data['resolucion'] * $data['resolucion'] * ($parametrosRotativa->rotativa_magenta / 100.0), 0);
|
||||
$data['num_gotas_amarillo'] = round($data['superficie'] * $data['resolucion'] * $data['resolucion'] * ($parametrosRotativa->rotativa_amarillo / 100.0), 0);
|
||||
|
||||
$pag_negro = $parametrosRotativa->bnPages;
|
||||
$pag_color = 0;
|
||||
if ($parametrosRotativa->colorPages>0) {
|
||||
$pag_color = $parametrosRotativa->colorPages;
|
||||
}
|
||||
|
||||
// peso tintas
|
||||
$data['peso_gotas_negro'] = round((($data['num_gotas_negro'] * $parametrosRotativa->rotativa_gota_negro * $data['pulgada']) / (17.91 / 20.0)) * $pag_negro * 1000, 6);
|
||||
$data['peso_gotas_cyan'] = round((($data['num_gotas_cyan'] * $parametrosRotativa->rotativa_gota_color * $data['pulgada']) / (17.65 / 20.0)) * $pag_color * 1000, 6);
|
||||
$data['peso_gotas_magenta'] = round((($data['num_gotas_magenta'] * $parametrosRotativa->rotativa_gota_color * $data['pulgada']) / (17.65 / 20.0)) * $pag_color * 1000, 6);
|
||||
$data['peso_gotas_amarillo'] = round((($data['num_gotas_amarillo'] * $parametrosRotativa->rotativa_gota_color * $data['pulgada']) / (17.65 / 20.0)) * $pag_color * 1000, 6);
|
||||
|
||||
// costes de tintas
|
||||
$data['peso_gotas_negro_pedido'] = round($data['peso_gotas_negro'], 2) * ($datosPedido->tirada + $datosPedido->merma);
|
||||
$data['peso_gotas_cyan_pedido'] = round($data['peso_gotas_cyan'], 2) * ($datosPedido->tirada + $datosPedido->merma);
|
||||
$data['peso_gotas_magenta_pedido'] = round($data['peso_gotas_magenta'], 2) * ($datosPedido->tirada + $datosPedido->merma);
|
||||
$data['peso_gotas_amarillo_pedido'] = round($data['peso_gotas_amarillo'], 2) * ($datosPedido->tirada + $datosPedido->merma);
|
||||
|
||||
// precio tinta
|
||||
$data['precio_tinta'] = round(
|
||||
round(($data['peso_gotas_negro_pedido'] / 1000.0) * $maquina->precio_tinta_negro, 2) +
|
||||
round(($data['peso_gotas_cyan_pedido'] / 1000.0) * $maquina->precio_tinta_color, 2) +
|
||||
round(($data['peso_gotas_magenta_pedido'] / 1000.0) * $maquina->precio_tinta_color, 2) +
|
||||
round(($data['peso_gotas_amarillo_pedido'] / 1000.0) * $maquina->precio_tinta_color, 2)
|
||||
, 2);
|
||||
|
||||
// precio pagina
|
||||
$data['precio_pagina_negro'] = round($pag_negro ? $data['precio_tinta'] / ($pag_negro * ($datosPedido->tirada + $datosPedido->merma)) : 0, 6);
|
||||
$data['precio_pagina_color'] = round($pag_color ? $data['precio_tinta'] / ($pag_color * ($datosPedido->tirada + $datosPedido->merma)) : 0, 6);
|
||||
|
||||
$data = array_merge($data, PresupuestoService::calculoCosteTintas($maquina, $datosPedido, $parametrosRotativa));
|
||||
|
||||
// calculo de corte
|
||||
$data['velocidad_corte'] = $maquina->velocidad_corte;
|
||||
$data['precio_hora_corte'] = $maquina->precio_hora_corte;
|
||||
@ -387,13 +205,96 @@ class PresupuestoService extends BaseService
|
||||
|
||||
$data['alto_click'] = $maquina->alto_click;
|
||||
|
||||
$formas = PresupuestoService::getNumFormasRot($maquina, $datosPedido->ancho, $datosPedido->alto, $datosPedido->isCosido);
|
||||
$formas = PresupuestoService::getNumFormasRot(
|
||||
$maquina,
|
||||
$datosPedido->ancho,
|
||||
$datosPedido->alto,
|
||||
$datosPedido->isCosido,
|
||||
$parametrosRotativa->a_favor_fibra);
|
||||
$data['num_formas'] = $formas;
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public static function getNumFormasRot($maquina, $ancho, $alto, $isCosido)
|
||||
|
||||
/**
|
||||
* Devuelve los calculos de las dimensiones de la forma
|
||||
*/
|
||||
public static function calculoDimForma($datosPedido, $parametros){
|
||||
// posicionamos paginas en función de a favor de fibra o no
|
||||
if (!$parametros->a_favor_fibra) {
|
||||
$anchoLibro = $datosPedido->alto;
|
||||
$altoLibro = $datosPedido->ancho;
|
||||
}
|
||||
else{
|
||||
$anchoLibro = $datosPedido->ancho;
|
||||
$altoLibro = $datosPedido->alto;
|
||||
}
|
||||
|
||||
// si es cosido ancho x 2
|
||||
if ($datosPedido->isCosido) {
|
||||
if (!$parametros->a_favor_fibra) {
|
||||
$altoLibro = $altoLibro * 2;
|
||||
} else {
|
||||
$anchoLibro = $anchoLibro * 2;
|
||||
}
|
||||
}
|
||||
|
||||
return [$anchoLibro, $altoLibro];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Devuelve los calculos para el coste de tintas
|
||||
*/
|
||||
public static function calculoCosteTintas($maquina, $datosPedido, $parametros)
|
||||
{
|
||||
$data = [];
|
||||
|
||||
$data['pulgada'] = 1 / 1000000000000.0;
|
||||
$data['resolucion'] = 600;
|
||||
$data['superficie'] = round((($datosPedido->ancho / 2.54) / 10) * (($datosPedido->alto / 2.54) / 10), 2);
|
||||
|
||||
$data['num_gotas_negro'] = round($data['superficie'] * $data['resolucion'] * $data['resolucion'] * ($parametros->rotativa_negro / 100.0), 0);
|
||||
$data['num_gotas_cyan'] = round($data['superficie'] * $data['resolucion'] * $data['resolucion'] * ($parametros->rotativa_cyan / 100.0), 0);
|
||||
$data['num_gotas_magenta'] = round($data['superficie'] * $data['resolucion'] * $data['resolucion'] * ($parametros->rotativa_magenta / 100.0), 0);
|
||||
$data['num_gotas_amarillo'] = round($data['superficie'] * $data['resolucion'] * $data['resolucion'] * ($parametros->rotativa_amarillo / 100.0), 0);
|
||||
|
||||
$pag_negro = $parametros->bnPages;
|
||||
$pag_color = 0;
|
||||
if ($parametros->colorPages>0) {
|
||||
$pag_color = $parametros->colorPages;
|
||||
}
|
||||
|
||||
// peso tintas
|
||||
$data['peso_gotas_negro'] = round((($data['num_gotas_negro'] * $parametros->rotativa_gota_negro * $data['pulgada']) / (17.91 / 20.0)) * $pag_negro * 1000, 6);
|
||||
$data['peso_gotas_cyan'] = round((($data['num_gotas_cyan'] * $parametros->rotativa_gota_color * $data['pulgada']) / (17.65 / 20.0)) * $pag_color * 1000, 6);
|
||||
$data['peso_gotas_magenta'] = round((($data['num_gotas_magenta'] * $parametros->rotativa_gota_color * $data['pulgada']) / (17.65 / 20.0)) * $pag_color * 1000, 6);
|
||||
$data['peso_gotas_amarillo'] = round((($data['num_gotas_amarillo'] * $parametros->rotativa_gota_color * $data['pulgada']) / (17.65 / 20.0)) * $pag_color * 1000, 6);
|
||||
|
||||
// costes de tintas
|
||||
$data['peso_gotas_negro_pedido'] = round($data['peso_gotas_negro'], 2) * ($datosPedido->tirada + $datosPedido->merma);
|
||||
$data['peso_gotas_cyan_pedido'] = round($data['peso_gotas_cyan'], 2) * ($datosPedido->tirada + $datosPedido->merma);
|
||||
$data['peso_gotas_magenta_pedido'] = round($data['peso_gotas_magenta'], 2) * ($datosPedido->tirada + $datosPedido->merma);
|
||||
$data['peso_gotas_amarillo_pedido'] = round($data['peso_gotas_amarillo'], 2) * ($datosPedido->tirada + $datosPedido->merma);
|
||||
|
||||
// precio tinta
|
||||
$data['precio_tinta'] = round(
|
||||
round(($data['peso_gotas_negro_pedido'] / 1000.0) * $maquina->precio_tinta_negro, 2) +
|
||||
round(($data['peso_gotas_cyan_pedido'] / 1000.0) * $maquina->precio_tinta_color, 2) +
|
||||
round(($data['peso_gotas_magenta_pedido'] / 1000.0) * $maquina->precio_tinta_color, 2) +
|
||||
round(($data['peso_gotas_amarillo_pedido'] / 1000.0) * $maquina->precio_tinta_color, 2)
|
||||
, 2);
|
||||
|
||||
// precio pagina
|
||||
$data['precio_pagina_negro'] = round($pag_negro ? $data['precio_tinta'] / ($pag_negro * ($datosPedido->tirada + $datosPedido->merma)) : 0, 6);
|
||||
$data['precio_pagina_color'] = round($pag_color ? $data['precio_tinta'] / ($pag_color * ($datosPedido->tirada + $datosPedido->merma)) : 0, 6);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
public static function getNumFormasRot($maquina, $ancho, $alto, $isCosido, $a_favor_fibra = true)
|
||||
{
|
||||
// El ancho si es cosido es el doble
|
||||
$anchoForCalculo = $isCosido ? $ancho * 2 : $ancho;
|
||||
@ -403,35 +304,38 @@ class PresupuestoService extends BaseService
|
||||
$h2_temp = floor($maquina->ancho_impresion / $alto);
|
||||
|
||||
// horizontales
|
||||
$calles = (new \App\Models\Configuracion\MaquinasCallesModel())->getCallesForMaquina($maquina->maquina_id, $h1_temp);
|
||||
// Si son mas de 2 formas
|
||||
if(count($calles)>0)
|
||||
$h1 = ($h1_temp * $anchoForCalculo + 2 * $calles[0]->externas + ($h1_temp - 1) * $calles[0]->internas < ($maquina->ancho)) ? $h1_temp : $h1_temp - 1;
|
||||
else
|
||||
$h1 = $h1_temp;
|
||||
|
||||
$v1 = floor($maquina->alto_click / $alto);
|
||||
$formas_h = $h1 * $v1; //p1
|
||||
if($a_favor_fibra){
|
||||
|
||||
$calles = (new \App\Models\Configuracion\MaquinasCallesModel())->getCallesForMaquina($maquina->maquina_id, $h1_temp);
|
||||
// Si son mas de 2 formas
|
||||
if(count($calles)>0)
|
||||
$h1 = ($h1_temp * $anchoForCalculo + 2 * $calles[0]->externas + ($h1_temp - 1) * $calles[0]->internas < ($maquina->ancho)) ? $h1_temp : $h1_temp - 1;
|
||||
else
|
||||
$h1 = $h1_temp;
|
||||
|
||||
$v1 = floor($maquina->alto_click / $alto);
|
||||
$formas_h = $h1 * $v1; //p1
|
||||
}
|
||||
// verticales
|
||||
$calles = (new \App\Models\Configuracion\MaquinasCallesModel())->getCallesForMaquina($maquina->maquina_id, $h2_temp);
|
||||
if(count($calles)>0)
|
||||
$h2 = ($h2_temp * $anchoForCalculo + 2 * $calles[0]->externas + ($h2_temp - 1) * $calles[0]->internas < ($maquina->ancho)) ? $h2_temp : $h2_temp - 1;
|
||||
else
|
||||
$h2 = $h2_temp;
|
||||
$v2 = floor($maquina->alto_click / $anchoForCalculo);
|
||||
$formas_v = $h2 * $v2; //p2
|
||||
else{
|
||||
|
||||
$calles = (new \App\Models\Configuracion\MaquinasCallesModel())->getCallesForMaquina($maquina->maquina_id, $h2_temp);
|
||||
if(count($calles)>0)
|
||||
$h2 = ($h2_temp * $alto + 2 * $calles[0]->externas + ($h2_temp - 1) * $calles[0]->internas < ($maquina->ancho)) ? $h2_temp : $h2_temp - 1;
|
||||
else
|
||||
$h2 = $h2_temp;
|
||||
$v2 = floor($maquina->alto_click / $anchoForCalculo);
|
||||
$formas_v = $h2 * $v2; //p2
|
||||
}
|
||||
|
||||
$num_formas = ($formas_h > $formas_v) ? $formas_h : $formas_v;
|
||||
$num_formas = $a_favor_fibra ? $formas_h : $formas_v;
|
||||
$num_formas = $isCosido ? $num_formas * 2 : $num_formas;
|
||||
|
||||
|
||||
// si no hay formas se devuelve n/a
|
||||
if ($num_formas == 0) {
|
||||
$response['posicion_formas'] = 'n/a'; // not available
|
||||
} else if ($formas_h > $formas_v) {
|
||||
} else if ($a_favor_fibra) {
|
||||
$response['posicion_formas'] = 'h';
|
||||
$response['num_formas_horizontales'] = $h1;
|
||||
$response['num_formas_verticales'] = $v1;
|
||||
@ -446,11 +350,13 @@ class PresupuestoService extends BaseService
|
||||
return $response;
|
||||
}
|
||||
|
||||
public static function getNumFormasPlana($uso, $maquina, $ancho, $alto, $isCosido)
|
||||
public static function getNumFormasPlana($uso, $maquina, $ancho, $alto, $isCosido, $forzar_a_favor_fibra = false)
|
||||
{
|
||||
$h1_temp = 0;
|
||||
$h2_temp = 0;
|
||||
|
||||
|
||||
|
||||
// El ancho si es cosido es el doble
|
||||
if($uso != 'cubierta' && $uso != 'sobrecubierta'){
|
||||
$anchoForCalculo = $isCosido ? $ancho * 2 : $ancho;
|
||||
@ -458,6 +364,13 @@ class PresupuestoService extends BaseService
|
||||
else{
|
||||
$anchoForCalculo = $ancho;
|
||||
}
|
||||
|
||||
// Generates a message like: User 123 logged into the system from 127.0.0.1
|
||||
$info = [
|
||||
'isCosido' => $forzar_a_favor_fibra,
|
||||
];
|
||||
|
||||
log_message('error', 'isCosido en formas planas: {isCosido}', $info);
|
||||
|
||||
if($uso == 'cubierta' || $uso == 'sobrecubierta') {
|
||||
if(property_exists($maquina, 'forzar_num_formas_horizontales_cubierta') &&
|
||||
@ -510,10 +423,15 @@ class PresupuestoService extends BaseService
|
||||
|
||||
|
||||
// Se calcula el numero de formas
|
||||
if($uso != 'cubierta' && $uso != 'sobrecubierta'){
|
||||
if($uso != 'cubierta' && $uso != 'sobrecubierta' && !$forzar_a_favor_fibra){
|
||||
$num_formas = ($formas_h > $formas_v) ? $formas_h : $formas_v;
|
||||
$num_formas = $isCosido ? $num_formas * 2 : $num_formas;
|
||||
}
|
||||
else if ($forzar_a_favor_fibra){
|
||||
$num_formas = $formas_h;
|
||||
$num_formas = $isCosido ? $num_formas * 2 : $num_formas;
|
||||
|
||||
}
|
||||
else{
|
||||
$num_formas = $h1*$h2;
|
||||
}
|
||||
@ -522,7 +440,7 @@ class PresupuestoService extends BaseService
|
||||
// si no hay formas se devuelve n/a
|
||||
if ($num_formas == 0) {
|
||||
$response['num_formas']['posicion_formas'] = 'n/a'; // not available
|
||||
} else if ($formas_h > $formas_v) {
|
||||
} else if ($formas_h > $formas_v || $forzar_a_favor_fibra) {
|
||||
$response['num_formas']['posicion_formas'] = 'h';
|
||||
$response['num_formas']['num_formas_horizontales'] = $h1;
|
||||
$response['num_formas']['num_formas_verticales'] = $v1;
|
||||
|
||||
@ -834,6 +834,7 @@
|
||||
const dimension = getDimensionLibro();
|
||||
|
||||
let datos = {
|
||||
tipo_impresion_id: <?php echo $tipo_impresion_id ?>,
|
||||
type: 'interior',
|
||||
color: is_color?1:0,
|
||||
hq: is_hq?1:0,
|
||||
@ -911,6 +912,7 @@
|
||||
if(checkInputsForRotativa()){
|
||||
|
||||
let datos = {
|
||||
tipo_impresion_id: <?php echo $tipo_impresion_id ?>,
|
||||
type: 'interior_rot',
|
||||
paginas: parseInt($('#paginas').val()),
|
||||
paginas_negro: parseInt($('#compPaginasNegro').val()),
|
||||
@ -988,6 +990,7 @@
|
||||
const dimension = getDimensionLibro();
|
||||
|
||||
let datos = {
|
||||
tipo_impresion_id: <?php echo $tipo_impresion_id ?>,
|
||||
type: 'cubierta',
|
||||
paginas: parseInt($('#compCarasCubierta').select2('data')[0].id),
|
||||
tirada: parseInt($('#tirada').val()),
|
||||
|
||||
@ -877,8 +877,10 @@
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
};
|
||||
|
||||
if(tipo != null)
|
||||
if(tipo != null){
|
||||
datos['tipo'] = tipo;
|
||||
datos['tipo_impresion_id'] = <?php echo $tipo_impresion_id; ?>;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
@ -1095,6 +1097,7 @@
|
||||
if(tipo != null){
|
||||
datos['tipo'] = tipo;
|
||||
datos['solapas'] = $('#solapas').is(':checked')?1:0;
|
||||
datos['tipo_impresion_id'] = <?php echo $tipo_impresion_id; ?>;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -90,26 +90,26 @@ function format(d) {
|
||||
'<td></td>'+
|
||||
'<td></td>'+
|
||||
'<td colspan="10">'+
|
||||
'<div class="row flex-grow-1 d-flex justify-content-center align-items-end">' +
|
||||
'<div class="row flex-grow-1 d-flex align-items-end">' +
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
"<?= lang("Presupuestos.numeroPliegos") ?>" +
|
||||
'<input id="' + d.row_id +'_numeroPliegos" name="' + d.row_id +'_numeroPliegos" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.numeroPliegos +'">'+
|
||||
'<input readonly id="' + d.row_id +'_numeroPliegos" name="' + d.row_id +'_numeroPliegos" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.numeroPliegos +'">'+
|
||||
'</div>'+
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
"<?= lang("Presupuestos.pliegosPedido") ?>" +
|
||||
'<input id="' + d.row_id +'_pliegosPedido" name="' + d.row_id +'_pliegosPedido" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.pliegosPedido +'">'+
|
||||
'<input readonly id="' + d.row_id +'_pliegosPedido" name="' + d.row_id +'_pliegosPedido" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.pliegosPedido +'">'+
|
||||
'</div>'+
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
"<?= lang("Presupuestos.precioPliego") ?>" +
|
||||
'<input id="' + d.row_id +'_precioPliego" name="' + d.row_id +'_precioPliego" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.precioPliego +'">'+
|
||||
'<input readonly id="' + d.row_id +'_precioPliego" name="' + d.row_id +'_precioPliego" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.precioPliego +'">'+
|
||||
'</div>'+
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
"<?= lang("Presupuestos.libro") ?>" +
|
||||
'<input id="' + d.row_id +'_libro" name="' + d.row_id +'_libro" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.libro +'">'+
|
||||
'<input readonly id="' + d.row_id +'_libro" name="' + d.row_id +'_libro" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.libro +'">'+
|
||||
'</div>'+
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
"<?= lang("Presupuestos.totalPapelPedido") ?>" +
|
||||
'<input id="' + d.row_id +'_totalPapelPedido" name="' + d.row_id +'_totalPapelPedido" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.totalPapelPedido +'">'+
|
||||
'<input readonly id="' + d.row_id +'_totalPapelPedido" name="' + d.row_id +'_totalPapelPedido" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.totalPapelPedido +'">'+
|
||||
'</div>'+
|
||||
'<input id="' + d.row_id +'_margenPapelPedido" name="' + d.row_id +'_margenPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled ' + d.row_class + '-input" type="text" value="' + d.margenPapelPedido +'" style="display: none;">' +
|
||||
'<div class="d-flex col-md-auto justify-content-center align-items-center">' +
|
||||
@ -117,23 +117,23 @@ function format(d) {
|
||||
'</div>'+
|
||||
'<div class="col-md-1 col-lg-1">' +
|
||||
"<?= lang("Presupuestos.click") ?>" +
|
||||
'<input id="' + d.row_id +'_click" name="' + d.row_id +'_click" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.click +'">'+
|
||||
'<input readonly id="' + d.row_id +'_click" name="' + d.row_id +'_click" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.click +'">'+
|
||||
'</div>'+
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
"<?= lang("Presupuestos.totalClicks") ?>" +
|
||||
'<input id="' + d.row_id +'_totalClicks" name="' + d.row_id +'_totalClicks" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.totalClicks +'">'+
|
||||
'<input readonly id="' + d.row_id +'_totalClicks" name="' + d.row_id +'_totalClicks" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.totalClicks +'">'+
|
||||
'</div>'+
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
"<?= lang("Presupuestos.horas") ?>" +
|
||||
'<input id="' + d.row_id +'_horasMaquina" name="' + d.row_id +'_horasMaquina" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.horasMaquina +'">'+
|
||||
'<input readonly id="' + d.row_id +'_horasMaquina" name="' + d.row_id +'_horasMaquina" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.horasMaquina +'">'+
|
||||
'</div>'+
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
"<?= lang("Presupuestos.precioHora") ?>" +
|
||||
'<input id="' + d.row_id +'_precioHora" name="' + d.row_id +'_precioHora" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.precioHora +'">'+
|
||||
'<input readonly id="' + d.row_id +'_precioHora" name="' + d.row_id +'_precioHora" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.precioHora +'">'+
|
||||
'</div>'+
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
"<?= lang("Presupuestos.precioImpresion") ?>" +
|
||||
'<input id="' + d.row_id +'_precioImpresion" name="' + d.row_id +'_precioImpresion" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.precioImpresion +'">'+
|
||||
'<input readonly id="' + d.row_id +'_precioImpresion" name="' + d.row_id +'_precioImpresion" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.precioImpresion +'">'+
|
||||
'</div>'+
|
||||
'<div class="d-flex col-md-auto justify-content-center align-items-center">' +
|
||||
'<input id="' + d.row_id + '_checkClicks" name="' + d.row_id +'_checkClicks" class="update-totales" style="bottom:0;width: 15px; padding: 0; margin:0;" type="checkbox" ' + (d.check_impresion_total==true?'checked':'') + '>' +
|
||||
@ -153,7 +153,7 @@ function format(d) {
|
||||
'<td></td>'+
|
||||
'<td></td>'+
|
||||
'<td colspan="10">'+
|
||||
'<div class="row flex-grow-1 d-flex justify-content-center align-items-end">' +
|
||||
'<div class="row flex-grow-1 d-flex align-items-end">' +
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
'<button id="' + d.row_id +'_defecto" name="' + d.row_id +'_defecto" type="button" class="btn btn-label-primary waves-effect lp-button"><?= lang('Presupuestos.porDefecto') ?></button>' +
|
||||
'</div>'+
|
||||
@ -163,7 +163,7 @@ function format(d) {
|
||||
'</div>' +
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
'<?= lang('Presupuestos.saturacion') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_saturacion" name="' + d.row_id +'_saturacion" class="lp-cell lp-input lp-cell-disabled" readonly value="100">' +
|
||||
'<input readonly type="text" id="' + d.row_id +'_saturacion" name="' + d.row_id +'_saturacion" class="lp-cell lp-input lp-cell-disabled" readonly value="100">' +
|
||||
'</div>' +
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
'<?= lang('Presupuestos.cobNegro') ?>' +
|
||||
@ -204,54 +204,54 @@ function format(d) {
|
||||
'<td></td>'+
|
||||
'<td></td>'+
|
||||
'<td colspan="10">'+
|
||||
'<div class="row flex-grow-1 d-flex justify-content-center align-items-end">' +
|
||||
'<div class="row flex-grow-1 d-flex align-items-end">' +
|
||||
(d.row_id.includes('rot')?'<div class="col-md-12 col-lg-1">': '<div class="col-md-12 col-lg-1" style="display:none;">') +
|
||||
'<?= lang('Presupuestos.metrosMinuto') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_metrosMinuto" name="' + d.row_id +'_metrosMinuto" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.metrosMinuto +'">' +
|
||||
'<input readonly type="text" id="' + d.row_id +'_metrosMinuto" name="' + d.row_id +'_metrosMinuto" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.metrosMinuto +'">' +
|
||||
'</div>' +
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
'<?= lang('Presupuestos.resolucion') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_resolucion" name="' + d.row_id +'_resolucion" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.resolucion +'">' +
|
||||
'<input readonly type="text" id="' + d.row_id +'_resolucion" name="' + d.row_id +'_resolucion" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.resolucion +'">' +
|
||||
'</div>' +
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
'<?= lang('Presupuestos.areaPaginas') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_areaPaginas" name="' + d.row_id +'_areaPaginas" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.areaPaginas +'">' +
|
||||
'<input readonly type="text" id="' + d.row_id +'_areaPaginas" name="' + d.row_id +'_areaPaginas" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.areaPaginas +'">' +
|
||||
'</div>' +
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
'<?= lang('Presupuestos.gotasNegro') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_gotasNegro" name="' + d.row_id +'_gotasNegro" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gotasNegro +'">' +
|
||||
'<input readonly type="text" id="' + d.row_id +'_gotasNegro" name="' + d.row_id +'_gotasNegro" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gotasNegro +'">' +
|
||||
'</div>' +
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
'<?= lang('Presupuestos.gotasCyan') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_gotasCyan" name="' + d.row_id +'_gotasCyan" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gotasCyan +'">' +
|
||||
'<input readonly type="text" id="' + d.row_id +'_gotasCyan" name="' + d.row_id +'_gotasCyan" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gotasCyan +'">' +
|
||||
'</div>' +
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
'<?= lang('Presupuestos.gotasMagenta') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_gotasMagenta" name="' + d.row_id +'_gotasMagenta" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gotasMagenta +'">' +
|
||||
'<input readonly type="text" id="' + d.row_id +'_gotasMagenta" name="' + d.row_id +'_gotasMagenta" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gotasMagenta +'">' +
|
||||
'</div>' +
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
'<?= lang('Presupuestos.gotasAmarillo') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_gotasAmarillo" name="' + d.row_id +'_gotasAmarillo" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gotasAmarillo +'">' +
|
||||
'<input readonly type="text" id="' + d.row_id +'_gotasAmarillo" name="' + d.row_id +'_gotasAmarillo" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gotasAmarillo +'">' +
|
||||
'</div>' +
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
'<?= lang('Presupuestos.precioPagNegro') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_precioPagNegro" name="' + d.row_id +'_precioPagNegro" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.precioPagNegro +'">' +
|
||||
'<input readonly type="text" id="' + d.row_id +'_precioPagNegro" name="' + d.row_id +'_precioPagNegro" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.precioPagNegro +'">' +
|
||||
'</div>' +
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
'<?= lang('Presupuestos.precioPagColor') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_precioPagColor" name="' + d.row_id +'_precioPagColor" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.precioPagColor +'">' +
|
||||
'<input readonly type="text" id="' + d.row_id +'_precioPagColor" name="' + d.row_id +'_precioPagColor" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.precioPagColor +'">' +
|
||||
'</div>' +
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
'<?= lang('Presupuestos.factorAltura') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_factorAltura" name="' + d.row_id +'_factorAltura" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.factorAltura +'">' +
|
||||
'<input readonly type="text" id="' + d.row_id +'_factorAltura" name="' + d.row_id +'_factorAltura" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.factorAltura +'">' +
|
||||
'</div>' +
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
'<?= lang('Presupuestos.factorAnchura') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_factorAnchura" name="' + d.row_id +'_factorAnchura" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.factorAnchura +'">' +
|
||||
'<input readonly type="text" id="' + d.row_id +'_factorAnchura" name="' + d.row_id +'_factorAnchura" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.factorAnchura +'">' +
|
||||
'</div>' +
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
'<?= lang('Presupuestos.paginasPliego') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_paginasPliego" name="' + d.row_id +'_paginasPliego" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.paginasPliego +'">' +
|
||||
'<input readonly type="text" id="' + d.row_id +'_paginasPliego" name="' + d.row_id +'_paginasPliego" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.paginasPliego +'">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</td>' +
|
||||
@ -260,54 +260,54 @@ function format(d) {
|
||||
'<td></td>'+
|
||||
'<td></td>'+
|
||||
'<td colspan="10">'+
|
||||
'<div class="row flex-grow-1 d-flex justify-content-center align-items-end">' +
|
||||
'<div class="row flex-grow-1 d-flex align-items-end">' +
|
||||
(d.row_id.includes('rot')?'<div class="col-md-12 col-lg-1">': '<div class="col-md-12 col-lg-1" style="display:none;">') +
|
||||
'<?= lang('Presupuestos.metrosPapelLibro') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_metrosPapelLibro" name="' + d.row_id +'_metrosPapelLibro" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.metrosPapelLibro +'">' +
|
||||
'<input readonly type="text" id="' + d.row_id +'_metrosPapelLibro" name="' + d.row_id +'_metrosPapelLibro" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.metrosPapelLibro +'">' +
|
||||
'</div>' +
|
||||
(d.row_id.includes('rot')?'<div class="col-md-12 col-lg-1">': '<div class="col-md-12 col-lg-1" style="display:none;">') +
|
||||
'<?= lang('Presupuestos.metrosPapelTotal') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_metrosPapelTotal" name="' + d.row_id +'_metrosPapelTotal" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.metrosPapelTotal +'">' +
|
||||
'<input readonly type="text" id="' + d.row_id +'_metrosPapelTotal" name="' + d.row_id +'_metrosPapelTotal" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.metrosPapelTotal +'">' +
|
||||
'</div>' +
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
'<?= lang('Presupuestos.clicksLibro') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_clicksLibro" name="' + d.row_id +'_clicksLibro" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.clicksLibro +'">' +
|
||||
'<input readonly type="text" id="' + d.row_id +'_clicksLibro" name="' + d.row_id +'_clicksLibro" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.clicksLibro +'">' +
|
||||
'</div>' +
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
'<?= lang('Presupuestos.gTintaNegro') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_gTintaNegro" name="' + d.row_id +'_gTintaNegro" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gTintaNegro +'">' +
|
||||
'<input readonly type="text" id="' + d.row_id +'_gTintaNegro" name="' + d.row_id +'_gTintaNegro" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gTintaNegro +'">' +
|
||||
'</div>' +
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
'<?= lang('Presupuestos.gTintaCyan') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_gTintaCyan" name="' + d.row_id +'_gTintaCyan" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gTintaCyan +'">' +
|
||||
'<input readonly type="text" id="' + d.row_id +'_gTintaCyan" name="' + d.row_id +'_gTintaCyan" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gTintaCyan +'">' +
|
||||
'</div>' +
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
'<?= lang('Presupuestos.gTintaMagenta') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_gTintaMagenta" name="' + d.row_id +'_gTintaMagenta" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gTintaMagenta +'">' +
|
||||
'<input readonly type="text" id="' + d.row_id +'_gTintaMagenta" name="' + d.row_id +'_gTintaMagenta" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gTintaMagenta +'">' +
|
||||
'</div>' +
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
'<?= lang('Presupuestos.gTintaAmarillo') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_gTintaAmarillo" name="' + d.row_id +'_gTintaAmarillo" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gTintaAmarillo +'">' +
|
||||
'<input readonly type="text" id="' + d.row_id +'_gTintaAmarillo" name="' + d.row_id +'_gTintaAmarillo" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gTintaAmarillo +'">' +
|
||||
'</div>' +
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
'<?= lang('Presupuestos.clicksPedido') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_clicksPedido" name="' + d.row_id +'_clicksPedido" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.clicksPedido +'">' +
|
||||
'<input readonly type="text" id="' + d.row_id +'_clicksPedido" name="' + d.row_id +'_clicksPedido" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.clicksPedido +'">' +
|
||||
'</div>' +
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
'<?= lang('Presupuestos.totalClicks') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_totalClicksPedido" name="' + d.row_id +'_totalClicksPedido" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.totalClicksPedido +'">' +
|
||||
'<input readonly type="text" id="' + d.row_id +'_totalClicksPedido" name="' + d.row_id +'_totalClicksPedido" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.totalClicksPedido +'">' +
|
||||
'</div>' +
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
'<?= lang('Presupuestos.totalTinta') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_totalTinta" name="' + d.row_id +'_totalTinta" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.totalTinta +'">' +
|
||||
'<input readonly type="text" id="' + d.row_id +'_totalTinta" name="' + d.row_id +'_totalTinta" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.totalTinta +'">' +
|
||||
'</div>' +
|
||||
(d.row_id.includes('rot')?'<div class="col-md-12 col-lg-1">': '<div class="col-md-12 col-lg-1" style="display:none;">') +
|
||||
'<?= lang('Presupuestos.totalCorte') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_totalCorte" name="' + d.row_id +'_totalCorte" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.totalCorte +'">' +
|
||||
'<input readonly type="text" id="' + d.row_id +'_totalCorte" name="' + d.row_id +'_totalCorte" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.totalCorte +'">' +
|
||||
'</div>' +
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
'<?= lang('Presupuestos.totalImpresion') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_totalImpresion" name="' + d.row_id +'_totalImpresion" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.totalImpresion +'">' +
|
||||
'<input readonly type="text" id="' + d.row_id +'_totalImpresion" name="' + d.row_id +'_totalImpresion" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.totalImpresion +'">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</td>' +
|
||||
@ -316,34 +316,34 @@ function format(d) {
|
||||
'<td></td>'+
|
||||
'<td></td>'+
|
||||
'<td colspan="10">'+
|
||||
'<div class="row flex-grow-1 d-flex justify-content-center align-items-end" >' +
|
||||
'<div class="row flex-grow-1 d-flex align-items-end" >' +
|
||||
(d.row_id.includes('rot')?'<div class="col-md-12 col-lg-1">': '<div class="col-md-12 col-lg-1" style="display:none;">') +
|
||||
'<?= lang('Presupuestos.velocidadCorte') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_velocidadCorte" name="' + d.row_id +'_velocidadCorte" class="lp-cell lp-input lp-cell-disabled" readonly value="' + d.velocidadCorte +'">' +
|
||||
'<input readonly type="text" id="' + d.row_id +'_velocidadCorte" name="' + d.row_id +'_velocidadCorte" class="lp-cell lp-input lp-cell-disabled" readonly value="' + d.velocidadCorte +'">' +
|
||||
'</div>' +
|
||||
(d.row_id.includes('rot')?'<div class="col-md-12 col-lg-1">': '<div class="col-md-12 col-lg-1" style="display:none;">') +
|
||||
'<?= lang('Presupuestos.precioHoraCorte') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_precioHoraCorte" name="' + d.row_id +'_precioHoraCorte" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.precioHoraCorte +'">' +
|
||||
'<input readonly type="text" id="' + d.row_id +'_precioHoraCorte" name="' + d.row_id +'_precioHoraCorte" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.precioHoraCorte +'">' +
|
||||
'</div>' +
|
||||
(d.row_id.includes('rot')?'<div class="col-md-12 col-lg-1">': '<div class="col-md-12 col-lg-1" style="display:none;">') +
|
||||
'<?= lang('Presupuestos.tiempoCorte') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_tiempoCorte" name="' + d.row_id +'_tiempoCorte" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.tiempoCorte +'">' +
|
||||
'<input readonly type="text" id="' + d.row_id +'_tiempoCorte" name="' + d.row_id +'_tiempoCorte" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.tiempoCorte +'">' +
|
||||
'</div>' +
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
'<?= lang('Presupuestos.gTintaNegroPed') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_gTintaNegroPed" name="' + d.row_id +'_gTintaNegroPed" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gTintaNegroPed +'">' +
|
||||
'<input readonly type="text" id="' + d.row_id +'_gTintaNegroPed" name="' + d.row_id +'_gTintaNegroPed" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gTintaNegroPed +'">' +
|
||||
'</div>' +
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
'<?= lang('Presupuestos.gTintaCyanPed') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_gTintaCyanPed" name="' + d.row_id +'_gTintaCyanPed" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gTintaCyanPed +'">' +
|
||||
'<input readonly type="text" id="' + d.row_id +'_gTintaCyanPed" name="' + d.row_id +'_gTintaCyanPed" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gTintaCyanPed +'">' +
|
||||
'</div>' +
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
'<?= lang('Presupuestos.gTintaMagentaPed') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_gTintaMagentaPed" name="' + d.row_id +'_gTintaMagentaPed" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gTintaMagentaPed +'">' +
|
||||
'<input readonly type="text" id="' + d.row_id +'_gTintaMagentaPed" name="' + d.row_id +'_gTintaMagentaPed" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gTintaMagentaPed +'">' +
|
||||
'</div>' +
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
'<?= lang('Presupuestos.gTintaAmarilloPed') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_gTintaAmarilloPed" name="' + d.row_id +'_gTintaAmarilloPed" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gTintaAmarilloPed +'">'+
|
||||
'<input readonly type="text" id="' + d.row_id +'_gTintaAmarilloPed" name="' + d.row_id +'_gTintaAmarilloPed" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gTintaAmarilloPed +'">'+
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</td>' +
|
||||
@ -1173,7 +1173,6 @@ function change_lp_bn_maquina(){
|
||||
}
|
||||
|
||||
|
||||
|
||||
function change_lp_bn_paginas(){
|
||||
|
||||
if( parseInt($('#lp_bn_paginas').val())>0 &&
|
||||
@ -1186,6 +1185,23 @@ function change_lp_bn_paginas(){
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function change_lp_bn_aFavorFibra(){
|
||||
|
||||
if( parseInt($('#lp_bn_paginas').val())>0 &&
|
||||
parseInt($('#lp_bn_papel option:selected').val())>0 &&
|
||||
$('#lp_bn_gramaje option:selected').text().length>0 &&
|
||||
parseInt($('#lp_bn_papelImpresion option:selected').val())>0
|
||||
){
|
||||
var rowData = tableLineasPresupuesto.row('#lp_bn').data()
|
||||
rowData.aFavorFibra = $('#lp_bn_aFavorFibra').prop('checked')
|
||||
tableLineasPresupuesto.row('#lp_bn').data(rowData).draw(false)
|
||||
|
||||
calcularPresupuesto_bn(false, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function calcularPresupuesto_bn(input_data={}, updatedTipologias = false){
|
||||
|
||||
const dimension = getDimensionLibro();
|
||||
@ -1203,6 +1219,7 @@ function calcularPresupuesto_bn(input_data={}, updatedTipologias = false){
|
||||
}
|
||||
|
||||
var datos = {
|
||||
tipo_impresion_id: <?php echo $tipo_impresion_id ?>,
|
||||
type: 'interior',
|
||||
color: 0,
|
||||
hq: 0,
|
||||
@ -1218,6 +1235,11 @@ function calcularPresupuesto_bn(input_data={}, updatedTipologias = false){
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
};
|
||||
|
||||
// Si es inkjet, existe este check
|
||||
if ($('#lp_bn_aFavorFibra').length){
|
||||
datos.a_favor_fibra = $('#lp_bn_aFavorFibra').prop('checked')
|
||||
}
|
||||
|
||||
if(updatedTipologias){
|
||||
datos.gota_negro= $('#lp_bn_gotaNegro').val()
|
||||
datos.gota_color= $('#lp_bn_gotaColor').val()
|
||||
@ -1242,9 +1264,11 @@ function calcularPresupuesto_bn(input_data={}, updatedTipologias = false){
|
||||
value.fields.papel_generico_id === input_data.papel_generico_id &&
|
||||
value.fields.papel_impresion_id === input_data.papel_impresion_id) {
|
||||
|
||||
// Si viene del comparador
|
||||
if(Object.keys(input_data).length == 0){
|
||||
value.fields.check_papel_total = $('#lp_bn' + '_checkPapel').is(":checked")?1:0
|
||||
value.fields.check_impresion_total = $('#lp_bn' + '_checkClicks').is(":checked")?1:0
|
||||
|
||||
}
|
||||
else{
|
||||
value.fields.check_papel_total = 1
|
||||
@ -1352,6 +1376,7 @@ function eventos_lp_bn(isInkjet = false){
|
||||
if(isInkjet){
|
||||
$('.lp-bn-tipologia').bind("change", change_lp_bn_tipologia);
|
||||
$('#lp_bn_defecto').bind("click", por_defecto_lp_bn);
|
||||
$('#lp_bn_aFavorFibra').bind("change", change_lp_bn_aFavorFibra);
|
||||
}
|
||||
|
||||
$('#lp_bn_checkPapel').bind("change", {id_linea: 'lp_bn'}, update_total_linea);
|
||||
@ -1497,7 +1522,7 @@ function change_lp_color_tipologia(){
|
||||
}
|
||||
|
||||
|
||||
function por_defecto_lp_bn(){
|
||||
function por_defecto_lp_color(){
|
||||
|
||||
if( parseInt($('#lp_color_paginas').val())>0 &&
|
||||
parseInt($('#lp_color_papel option:selected').val())>0 &&
|
||||
@ -1509,6 +1534,24 @@ function por_defecto_lp_bn(){
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function change_lp_color_aFavorFibra(){
|
||||
|
||||
if( parseInt($('#lp_color_paginas').val())>0 &&
|
||||
parseInt($('#lp_color_papel option:selected').val())>0 &&
|
||||
$('#lp_color_gramaje option:selected').text().length>0 &&
|
||||
parseInt($('#lp_color_papelImpresion option:selected').val())>0
|
||||
){
|
||||
var rowData = tableLineasPresupuesto.row('#lp_color').data()
|
||||
rowData.aFavorFibra = $('#lp_color_aFavorFibra').prop('checked')
|
||||
tableLineasPresupuesto.row('#lp_color').data(rowData).draw(false)
|
||||
|
||||
calcularPresupuesto_color(false, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function calcularPresupuesto_color(input_data={}, updatedTipologias = false){
|
||||
|
||||
const dimension = getDimensionLibro();
|
||||
@ -1526,6 +1569,7 @@ function calcularPresupuesto_color(input_data={}, updatedTipologias = false){
|
||||
}
|
||||
|
||||
let datos = {
|
||||
tipo_impresion_id: <?php echo $tipo_impresion_id ?>,
|
||||
type: 'interior',
|
||||
color: 1,
|
||||
hq: 0,
|
||||
@ -1550,6 +1594,11 @@ function calcularPresupuesto_color(input_data={}, updatedTipologias = false){
|
||||
datos.amarillo= $('#lp_color_cobAmarillo').val()
|
||||
}
|
||||
|
||||
// Si es inkjet, existe este check
|
||||
if ($('#lp_color_aFavorFibra').length){
|
||||
datos.a_favor_fibra = $('#lp_color_aFavorFibra').prop('checked')
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/cosidotapablanda/datatable",
|
||||
@ -1648,6 +1697,7 @@ function eventos_lp_color(isInkjet = false){
|
||||
if(isInkjet){
|
||||
$('.lp-color-tipologia').bind("change", change_lp_color_tipologia);
|
||||
$('#lp_color_defecto').bind("click", por_defecto_lp_color);
|
||||
$('#lp_color_aFavorFibra').bind("change", change_lp_color_aFavorFibra);
|
||||
}
|
||||
|
||||
$('#lp_color_checkPapel').bind("change", {id_linea: 'lp_color'}, update_total_linea);
|
||||
@ -1804,6 +1854,21 @@ function por_defecto_lp_bnhq(){
|
||||
}
|
||||
}
|
||||
|
||||
function change_lp_bnhq_aFavorFibra(){
|
||||
|
||||
if( parseInt($('#lp_bnhq_paginas').val())>0 &&
|
||||
parseInt($('#lp_bnhq_papel option:selected').val())>0 &&
|
||||
$('#lp_bnhq_gramaje option:selected').text().length>0 &&
|
||||
parseInt($('#lp_bnhq_papelImpresion option:selected').val())>0
|
||||
){
|
||||
var rowData = tableLineasPresupuesto.row('#lp_bnhq').data()
|
||||
rowData.aFavorFibra = $('#lp_bnhq_aFavorFibra').prop('checked')
|
||||
tableLineasPresupuesto.row('#lp_bnhq').data(rowData).draw(false)
|
||||
|
||||
calcularPresupuesto_bnhq(false, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function calcularPresupuesto_bnhq(input_data={}, updatedTipologias = false){
|
||||
|
||||
@ -1822,6 +1887,7 @@ function calcularPresupuesto_bnhq(input_data={}, updatedTipologias = false){
|
||||
}
|
||||
|
||||
let datos = {
|
||||
tipo_impresion_id: <?php echo $tipo_impresion_id ?>,
|
||||
type: 'interior',
|
||||
color: 0,
|
||||
hq: 1,
|
||||
@ -1846,6 +1912,11 @@ function calcularPresupuesto_bnhq(input_data={}, updatedTipologias = false){
|
||||
datos.amarillo= $('#lp_bnhq_cobAmarillo').val()
|
||||
}
|
||||
|
||||
// Si es inkjet, existe este check
|
||||
if ($('#lp_bnhq_aFavorFibra').length){
|
||||
datos.a_favor_fibra = $('#lp_bnhq_aFavorFibra').prop('checked')?1:0
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/cosidotapablanda/datatable",
|
||||
@ -1943,6 +2014,7 @@ function eventos_lp_bnhq(isInkjet = false){
|
||||
if(isInkjet){
|
||||
$('.lp-bnhq-tipologia').bind("change", change_lp_bnhq_tipologia);
|
||||
$('#lp_bnhq_defecto').bind("click", por_defecto_lp_bnhq);
|
||||
$('#lp_bnhq_aFavorFibra').bind("change", change_lp_bnhq_aFavorFibra);
|
||||
}
|
||||
|
||||
$('#lp_bnhq_checkPapel').bind("change", {id_linea: 'lp_bnhq'}, update_total_linea);
|
||||
@ -2103,6 +2175,21 @@ function por_defecto_lp_colorhq(){
|
||||
}
|
||||
|
||||
|
||||
function change_lp_colorhq_aFavorFibra(){
|
||||
|
||||
if( parseInt($('#lp_colorhq_paginas').val())>0 &&
|
||||
parseInt($('#lp_colorhq_papel option:selected').val())>0 &&
|
||||
$('#lp_colorhq_gramaje option:selected').text().length>0 &&
|
||||
parseInt($('#lp_colorhq_papelImpresion option:selected').val())>0
|
||||
){
|
||||
var rowData = tableLineasPresupuesto.row('#lp_colorhq').data()
|
||||
rowData.aFavorFibra = $('#lp_colorhq_aFavorFibra').prop('checked')
|
||||
tableLineasPresupuesto.row('#lp_colorhq').data(rowData).draw(false)
|
||||
|
||||
calcularPresupuesto_colorhq(false, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function calcularPresupuesto_colorhq(input_data={}, updatedTipologias = false){
|
||||
|
||||
@ -2121,6 +2208,7 @@ function calcularPresupuesto_colorhq(input_data={}, updatedTipologias = false){
|
||||
}
|
||||
|
||||
let datos = {
|
||||
tipo_impresion_id: <?php echo $tipo_impresion_id ?>,
|
||||
type: 'interior',
|
||||
color: 1,
|
||||
hq: 1,
|
||||
@ -2145,6 +2233,11 @@ function calcularPresupuesto_colorhq(input_data={}, updatedTipologias = false){
|
||||
datos.amarillo= $('#lp_colorhq_cobAmarillo').val()
|
||||
}
|
||||
|
||||
// Si es inkjet, existe este check
|
||||
if ($('#lp_colorhq_aFavorFibra').length){
|
||||
datos.a_favor_fibra = $('#lp_colorhq_aFavorFibra').prop('checked')?1:0
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/cosidotapablanda/datatable",
|
||||
@ -2242,6 +2335,7 @@ function eventos_lp_colorhq(isInkjet = false){
|
||||
if(isInkjet){
|
||||
$('.lp-colorhq-tipologia').bind("change", change_lp_colorhq_tipologia);
|
||||
$('#lp_colorhq_defecto').bind("click", por_defecto_lp_colorhq);
|
||||
$('#lp_colorhq_aFavorFibra').bind("change", change_lp_colorhq_aFavorFibra);
|
||||
}
|
||||
|
||||
$('#lp_colorhq_checkPapel').bind("change", {id_linea: 'lp_colorhq'}, update_total_linea);
|
||||
@ -2412,6 +2506,7 @@ function calcularPresupuesto_rot_bn(fromComparador=false, updatedTipologias=fals
|
||||
}
|
||||
|
||||
let datos = {
|
||||
tipo_impresion_id: <?php echo $tipo_impresion_id ?>,
|
||||
type: 'interior_rot',
|
||||
color: 0,
|
||||
hq: 0,
|
||||
@ -2745,6 +2840,7 @@ function calcularPresupuesto_rot_color(fromComparador=false, updatedTipologias=f
|
||||
paginas_color = isNaN(parseInt($('#lp_rot_color_numPagColor').val()))?input_data.paginas:parseInt($('#lp_rot_color_numPagColor').val())
|
||||
|
||||
let datos = {
|
||||
tipo_impresion_id: <?php echo $tipo_impresion_id ?>,
|
||||
type: 'interior_rot',
|
||||
color: 1,
|
||||
hq: 0,
|
||||
@ -2786,6 +2882,7 @@ function calcularPresupuesto_rot_color(fromComparador=false, updatedTipologias=f
|
||||
if(data.lineas.length >0){
|
||||
// Se cogen los valores de la linea con los datos correspondientes
|
||||
$.each(data.lineas, function(key, value) {
|
||||
console.log(value.fields.num_formas)
|
||||
fibra = $('#lp_rot_color_aFavorFibra').prop('checked')
|
||||
if(fromComparador){
|
||||
if(value.fields.maquina_id === input_data.maquina_id &&
|
||||
@ -3060,6 +3157,7 @@ function calcularPresupuesto_cubierta(fromComparador=false, input_data={}){
|
||||
|
||||
|
||||
let datos = {
|
||||
tipo_impresion_id: <?php echo $tipo_impresion_id ?>,
|
||||
type: 'cubierta',
|
||||
color: 1,
|
||||
hq: 1,
|
||||
@ -3317,16 +3415,16 @@ function fill_lp_from_bbdd(){
|
||||
|
||||
switch(lp.tipo){
|
||||
case 'lp_bn':
|
||||
eventos_lp_bn()
|
||||
eventos_lp_bn(lp.maquina_tipo=='inkjet'?true:false)
|
||||
break
|
||||
case 'lp_bnhq':
|
||||
eventos_lp_bnhq()
|
||||
eventos_lp_bnhq(lp.maquina_tipo=='inkjet'?true:false)
|
||||
break
|
||||
case 'lp_color':
|
||||
eventos_lp_color()
|
||||
eventos_lp_color(lp.maquina_tipo=='inkjet'?true:false)
|
||||
break
|
||||
case 'lp_colorhq':
|
||||
eventos_lp_colorhq()
|
||||
eventos_lp_colorhq(lp.maquina_tipo=='inkjet'?true:false)
|
||||
break
|
||||
case 'lp_rot_bn':
|
||||
eventos_lp_rot_bn()
|
||||
|
||||
@ -740,50 +740,50 @@
|
||||
|
||||
$('#tab-pv-bn').on( "click", function() {
|
||||
|
||||
previewInteriorPlana('bn');
|
||||
previewInteriorPlana('bn', <?php echo $isCosido; ?>);
|
||||
|
||||
} );
|
||||
|
||||
$('#tab-pv-bnhq').on( "click", function() {
|
||||
|
||||
previewInteriorPlana('bnhq');
|
||||
previewInteriorPlana('bnhq', <?php echo $isCosido; ?>);
|
||||
|
||||
} );
|
||||
|
||||
$('#tab-pv-color').on( "click", function() {
|
||||
|
||||
previewInteriorPlana('color');
|
||||
previewInteriorPlana('color', <?php echo $isCosido; ?>);
|
||||
|
||||
} );
|
||||
|
||||
$('#tab-pv-colorhq').on( "click", function() {
|
||||
|
||||
|
||||
previewInteriorPlana('colorhq');
|
||||
previewInteriorPlana('colorhq', <?php echo $isCosido; ?>);
|
||||
|
||||
} );
|
||||
|
||||
$('#tab-pv-rot-bn').on( "click", function() {
|
||||
|
||||
previewRotativa('rot_bn');
|
||||
previewRotativa('rot_bn', <?php echo $isCosido; ?>);
|
||||
|
||||
} );
|
||||
|
||||
$('#tab-pv-rot-color').on( "click", function() {
|
||||
|
||||
previewRotativa('rot_color');
|
||||
previewRotativa('rot_color', <?php echo $isCosido; ?>);
|
||||
|
||||
} );
|
||||
|
||||
$('#tab-pv-cubierta').on( "click", function() {
|
||||
|
||||
previewInteriorPlana('cubierta');
|
||||
previewInteriorPlana('cubierta', <?php echo $isCosido; ?>);
|
||||
|
||||
} );
|
||||
|
||||
$('#tab-pv-esquema-cubierta').on( "click", function() {
|
||||
|
||||
previewEsquemaCubierta('ec');
|
||||
previewEsquemaCubierta('ec', <?php echo $isCosido; ?>);
|
||||
|
||||
} );
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// Global parameters
|
||||
var _isCosido = true;
|
||||
//var _isCosido = true;
|
||||
var pvObj;
|
||||
|
||||
var sangradoTexto = "Sangrado 5 mm";
|
||||
@ -7,7 +7,7 @@ var sangradoValor = parseFloat(5); // mm
|
||||
var offsetSolapaValor = parseFloat(0); // mm
|
||||
|
||||
|
||||
function previewInteriorPlana(lpTagName) {
|
||||
function previewInteriorPlana(lpTagName, isCosido) {
|
||||
|
||||
// Local parameters
|
||||
let guardaV = 0;
|
||||
@ -15,7 +15,7 @@ function previewInteriorPlana(lpTagName) {
|
||||
let styleText = {size: 12, family: 'Public Sans'};
|
||||
|
||||
// Get the preview Object parameters
|
||||
getObjetoLP(lpTagName);
|
||||
getObjetoLP(lpTagName, isCosido);
|
||||
|
||||
// Configuracion de las guardas
|
||||
// Guarda vertical
|
||||
@ -83,7 +83,7 @@ function previewInteriorPlana(lpTagName) {
|
||||
_pvPlana.update();
|
||||
}
|
||||
|
||||
function previewRotativa(lpTagName) {
|
||||
function previewRotativa(lpTagName, isCosido) {
|
||||
|
||||
// Local parameters
|
||||
let styleText = {size: 12, family: 'Public Sans'};
|
||||
@ -92,7 +92,7 @@ function previewRotativa(lpTagName) {
|
||||
let guardaH = 0;
|
||||
|
||||
// Get the preview Object parameters
|
||||
getObjetoLP(lpTagName);
|
||||
getObjetoLP(lpTagName, isCosido);
|
||||
|
||||
// Calculos
|
||||
// Configuracion de las guardas
|
||||
@ -186,14 +186,14 @@ function getDecimalPart(floatNumber) {
|
||||
}
|
||||
|
||||
|
||||
function previewEsquemaCubierta(lpTagName) {
|
||||
function previewEsquemaCubierta(lpTagName, isCosido) {
|
||||
|
||||
// Variables locales
|
||||
let altoLibro, anchoLibro, lomoLibro, anchoSolapa, anchoCubierta, altoSangrado, anchoSangrado;
|
||||
let styleCotas = {size: 12, family: 'Public Sans'};
|
||||
|
||||
// Get the preview Object parameters
|
||||
getObjetoLP(lpTagName);
|
||||
getObjetoLP(lpTagName, isCosido);
|
||||
|
||||
// Definicion de los parametros del Esquema de Cubierta (EC)
|
||||
if (pvObj.anchoSolapa == 0) {
|
||||
@ -360,7 +360,7 @@ function getLomoLibro() {
|
||||
}
|
||||
|
||||
|
||||
function getObjetoLP(lpName) {
|
||||
function getObjetoLP(lpName, _isCosido) {
|
||||
|
||||
let rowData = null;
|
||||
|
||||
@ -455,10 +455,11 @@ function getObjetoLP(lpName) {
|
||||
|
||||
case 'rot_bn':
|
||||
case 'rot_color':
|
||||
if ((pvObj.anchoImpresion / pvObj.altoForma) > (pvObj.anchoImpresion / pvObj.anchoForma)) {
|
||||
let auxReg = pvObj.anchoForma;
|
||||
pvObj.anchoForma = pvObj.altoForma;
|
||||
pvObj.altoForma = auxReg;
|
||||
// Conditional assignements depending on rotation of the printing shape
|
||||
if (pvObj.orientacionFormas == 'v') {
|
||||
let auxReg = pvObj.altoForma;
|
||||
pvObj.altoForma = pvObj.anchoForma;
|
||||
pvObj.anchoForma = auxReg;
|
||||
}
|
||||
$(pvName + '_forma').text(pvObj.anchoForma + "x" + pvObj.altoForma);
|
||||
pvObj.altoClick = isNaN(parseFloat(rowData.alto_click))?305:parseFloat(rowData.alto_click);
|
||||
|
||||
@ -9,8 +9,8 @@
|
||||
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><?=lang('Presupuestos.presupuestoCosidotapablandaList') ?></h3>
|
||||
<?=anchor(route_to('newCosidotapablanda'), lang('Basic.global.addNew').' '.lang('Presupuestos.presupuesto'), ['class'=>'btn btn-primary ']); ?>
|
||||
<h3 class="card-title"><?= $pageTitle ?></h3>
|
||||
<?=anchor(route_to('newCosidotapablanda', $tipo_impresion_id), lang('Basic.global.addNew').' '.lang('Presupuestos.presupuesto'), ['class'=>'btn btn-primary ']); ?>
|
||||
</div><!--//.card-header -->
|
||||
<div class="card-body">
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
@ -155,6 +155,9 @@ theTable = $('#tableOfPresupuestos').DataTable({
|
||||
},
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfCosidotapablanda') ?>',
|
||||
data: function (d) {
|
||||
d.tipo_impresion_id = '<?php echo $tipo_impresion_id; ?>';
|
||||
},
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
@ -218,7 +221,7 @@ theTable.on( 'draw.dt', function () {
|
||||
|
||||
|
||||
$(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')}/`;
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user