diff --git a/.idea/php.xml b/.idea/php.xml
index 89778155..29059d00 100644
--- a/.idea/php.xml
+++ b/.idea/php.xml
@@ -10,7 +10,9 @@
-
+
+
+
diff --git a/ci4/app/Config/Routes.php b/ci4/app/Config/Routes.php
index 9fe3a397..53f241db 100644
--- a/ci4/app/Config/Routes.php
+++ b/ci4/app/Config/Routes.php
@@ -478,11 +478,28 @@ $routes->group('cosidotapablanda', ['namespace' => 'App\Controllers\Presupuestos
});
$routes->resource('cosidotapablanda', ['namespace' => 'App\Controllers\Presupuestos', 'controller' => 'Cosidotapablanda', 'except' => 'show,new,create,update']);
-$routes->group('printpresupuestos', ['namespace' => 'App\Controllers\Pdf'], function ($routes) {
- $routes->get('', 'PrintPresupuestos::index', ['as' => 'pdfList']);
- $routes->match(['get', 'post'], 'generar', 'PrintPresupuestos::generar', ['as' => 'presupuestoToPdf']);
+$routes->group('serviciosacabados', ['namespace' => 'App\Controllers\Presupuestos'], function ($routes) {
+ $routes->post('datatable', 'PresupuestoAcabados::datatable', ['as' => 'dataTableOfPresupuestoAcabados']);
+ $routes->post('datatable_editor', 'PresupuestoAcabados::datatable_editor', ['as' => 'editorOfPresupuestoAcabados']);
+ $routes->get('delete/(:num)', 'PresupuestoAcabados::delete/$1', ['as' => 'deletePresupuestoAcabado']);
});
+$routes->group('serviciosencuadernaciones', ['namespace' => 'App\Controllers\Presupuestos'], function ($routes) {
+ $routes->post('datatable', 'PresupuestoEncuadernaciones::datatable', ['as' => 'dataTableOfPresupuestoEncuadernaciones']);
+ $routes->post('datatable_editor', 'PresupuestoEncuadernaciones::datatable_editor', ['as' => 'editorOfPresupuestoEncuadernaciones']);
+});
+
+$routes->group('serviciosmanipulados', ['namespace' => 'App\Controllers\Presupuestos'], function ($routes) {
+ $routes->post('datatable', 'PresupuestoManipulados::datatable', ['as' => 'dataTableOfPresupuestoManipulados']);
+ $routes->post('datatable_editor', 'PresupuestoManipulados::datatable_editor', ['as' => 'editorOfPresupuestoManipulados']);
+});
+
+$routes->group('serviciospreimpresiones', ['namespace' => 'App\Controllers\Presupuestos'], function ($routes) {
+ $routes->post('datatable', 'PresupuestoPreimpresiones::datatable', ['as' => 'dataTableOfPresupuestoPreimpresiones']);
+ $routes->post('datatable_editor', 'PresupuestoPreimpresiones::datatable_editor', ['as' => 'editorOfPresupuestoPreimpresiones']);
+});
+
+
/*
* --------------------------------------------------------------------
* Additional Routing
diff --git a/ci4/app/Controllers/Clientes/Tarifacliente.php b/ci4/app/Controllers/Clientes/Tarifacliente.php
deleted file mode 100644
index e8c7974e..00000000
--- a/ci4/app/Controllers/Clientes/Tarifacliente.php
+++ /dev/null
@@ -1,46 +0,0 @@
-getSegment(1) . '/' . $uri->getSegment(2);
- echo view(getenv('theme.path').'main/demo_view', $data);
- }
-
- public function delete()
- {
- $uri = service('uri');
- $data['page_name'] = "Tarifa Cliente";
- $data['url'] = base_url() . $uri->getSegment(1) . '/' . $uri->getSegment(2);
- echo view(getenv('theme.path').'main/demo_view', $data);
- }
-
- public function add()
- {
- $uri = service('uri');
- $data['page_name'] = "Tarifa Cliente";
- $data['url'] = base_url() . $uri->getSegment(1) . '/' . $uri->getSegment(2);
- echo view(getenv('theme.path').'main/demo_view', $data);
- }
-
- public function edit()
- {
- $uri = service('uri');
- $data['page_name'] = "Tarifa Cliente";
- $data['url'] = base_url() . $uri->getSegment(1) . '/' . $uri->getSegment(2);
- echo view(getenv('theme.path').'main/demo_view', $data);
- }
-}
-
\ No newline at end of file
diff --git a/ci4/app/Controllers/Configuracion/Formaspago.php b/ci4/app/Controllers/Configuracion/Formaspago.php
deleted file mode 100644
index e7b86ee0..00000000
--- a/ci4/app/Controllers/Configuracion/Formaspago.php
+++ /dev/null
@@ -1,232 +0,0 @@
-viewData['pageTitle'] = lang('FormasPagoes.moduleTitle');
- parent::initController($request, $response, $logger);
- $this->viewData['usingSweetAlert'] = true;
-
- if (session('errorMessage')) {
- $this->session->setFlashData('sweet-error', session('errorMessage'));
- }
- if (session('successMessage')) {
- $this->session->setFlashData('sweet-success', session('successMessage'));
- }
- }
-
- public function index()
- {
-
- $this->viewData['usingClientSideDataTable'] = true;
-
- $this->viewData['pageSubTitle'] = lang('Basic.global.ManageAllRecords', [lang('FormasPagoes.formaPago')]);
- parent::index();
-
- }
-
- public function add()
- {
-
-
- $requestMethod = $this->request->getMethod();
-
- if ($requestMethod === 'post') :
-
- $nullIfEmpty = true; // !(phpversion() >= '8.1');
-
- $postData = $this->request->getPost();
- $sanitizedData = $this->sanitized($postData, $nullIfEmpty);
-
-
- $noException = true;
- if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
-
-
- if ($this->canValidate()) :
- try {
- $successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
- } catch (\Exception $e) {
- $noException = false;
- $this->dealWithException($e);
- }
- else:
- $this->viewData['errorMessage'] = lang('Basic.global.formErr1', [lang('Basic.global.record')]);
- $this->session->setFlashdata('formErrors', $this->model->errors());
- endif;
-
- $thenRedirect = true; // Change this to false if you want your user to stay on the form after submission
- endif;
- if ($noException && $successfulResult) :
-
- $id = $this->model->db->insertID();
-
- $message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
-
- if ($thenRedirect) :
- if (!empty($this->indexRoute)) :
- return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
- else:
- return $this->redirect2listView('sweet-success', $message);
- endif;
- else:
- $this->session->setFlashData('sweet-success', $message);
- endif;
-
- endif; // $noException && $successfulResult
-
- endif; // ($requestMethod === 'post')
-
- $this->viewData['formasPagoEntity'] = isset($sanitizedData) ? new FormasPagoEntity($sanitizedData) : new FormasPagoEntity();
-
- $this->viewData['formAction'] = route_to('createFormaPago');
-
- $this->viewData['boxTitle'] = lang('Basic.global.addNew') . ' ' . lang('FormasPagoes.formaPago') . ' ' . lang('Basic.global.addNewSuffix');
-
-
- return $this->displayForm(__METHOD__);
- } // end function add()
-
- public function edit($requestedId = null)
- {
-
- if ($requestedId == null) :
- return $this->redirect2listView();
- endif;
- $id = filter_var($requestedId, FILTER_SANITIZE_URL);
- $formasPagoEntity = $this->model->find($id);
-
- if ($formasPagoEntity == false) :
- $message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('FormasPagoes.formaPago')), $id]);
- return $this->redirect2listView('sweet-error', $message);
- endif;
-
- $requestMethod = $this->request->getMethod();
-
- if ($requestMethod === 'post') :
-
- $nullIfEmpty = true; // !(phpversion() >= '8.1');
-
- $postData = $this->request->getPost();
- $sanitizedData = $this->sanitized($postData, $nullIfEmpty);
-
-
- $noException = true;
- 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('FormasPagoes.formaPago'))]);
- $this->session->setFlashdata('formErrors', $this->model->errors());
-
- endif;
-
- $formasPagoEntity->fill($sanitizedData);
-
- $thenRedirect = false;
- endif;
- if ($noException && $successfulResult) :
- $id = $formasPagoEntity->id ?? $id;
- $message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
-
- if ($thenRedirect) :
- if (!empty($this->indexRoute)) :
- return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
- else:
- return $this->redirect2listView('sweet-success', $message);
- endif;
- else:
- $this->session->setFlashData('sweet-success', $message);
- endif;
-
- endif; // $noException && $successfulResult
- endif; // ($requestMethod === 'post')
-
- $this->viewData['formasPagoEntity'] = $formasPagoEntity;
-
- $this->viewData['formAction'] = route_to('updateFormaPago', $id);
-
- $this->viewData['boxTitle'] = lang('Basic.global.edit2') . ' ' . lang('FormasPagoes.formaPago') . ' ' . lang('Basic.global.edit3');
-
-
- return $this->displayForm(__METHOD__, $id);
- } // end function edit(...)
-
-
- public function allItemsSelect()
- {
- if ($this->request->isAJAX()) {
- $onlyActiveOnes = true;
- $reqVal = $this->request->getPost('val') ?? 'id';
- $menu = $this->model->getAllForMenu($reqVal . ', nombre', 'nombre', $onlyActiveOnes, false);
- $nonItem = new \stdClass;
- $nonItem->id = '';
- $nonItem->nombre = '- ' . lang('Basic.global.None') . ' -';
- array_unshift($menu, $nonItem);
-
- $newTokenHash = csrf_hash();
- $csrfTokenName = csrf_token();
- $data = [
- 'menu' => $menu,
- $csrfTokenName => $newTokenHash
- ];
- return $this->respond($data);
- } else {
- return $this->failUnauthorized('Invalid request', 403);
- }
- }
-
- public function menuItems()
- {
- if ($this->request->isAJAX()) {
- $searchStr = goSanitize($this->request->getPost('searchTerm'))[0];
- $reqId = goSanitize($this->request->getPost('id'))[0];
- $reqText = goSanitize($this->request->getPost('text'))[0];
- $onlyActiveOnes = false;
- $columns2select = [$reqId ?? 'id', $reqText ?? 'nombre'];
- $onlyActiveOnes = false;
- $menu = $this->model->getSelect2MenuItems($columns2select, $columns2select[1], $onlyActiveOnes, $searchStr);
- $nonItem = new \stdClass;
- $nonItem->id = '';
- $nonItem->text = '- ' . lang('Basic.global.None') . ' -';
- array_unshift($menu, $nonItem);
-
- $newTokenHash = csrf_hash();
- $csrfTokenName = csrf_token();
- $data = [
- 'menu' => $menu,
- $csrfTokenName => $newTokenHash
- ];
- return $this->respond($data);
- } else {
- return $this->failUnauthorized('Invalid request', 403);
- }
- }
-
-}
diff --git a/ci4/app/Controllers/Configuracion/Maquinascalles.php b/ci4/app/Controllers/Configuracion/Maquinascalles.php
index c5816014..9c46a46c 100644
--- a/ci4/app/Controllers/Configuracion/Maquinascalles.php
+++ b/ci4/app/Controllers/Configuracion/Maquinascalles.php
@@ -52,19 +52,12 @@ class Maquinascalles extends \App\Controllers\GoBaseResourceController
// Build our Editor instance and process the data coming from _POST
$response = Editor::inst($db, 'maquinas_calles')
->fields(
- Field::inst('formas_min')
+ Field::inst('formas')
->validator('Validate::numeric', array(
- 'message' => lang('MaquinasCalles.validation.formas_min.integer'))
+ 'message' => lang('MaquinasCalles.validation.formas.integer'))
)
->validator('Validate::notEmpty', array(
- 'message' => lang('MaquinasCalles.validation.formas_min.required'))
- ),
- Field::inst('formas_max')
- ->validator('Validate::numeric', array(
- 'message' => lang('MaquinasCalles.validation.formas_max.integer'))
- )
- ->validator('Validate::notEmpty', array(
- 'message' => lang('MaquinasCalles.validation.formas_max.required'))
+ 'message' => lang('MaquinasCalles.validation.formas.required'))
),
Field::inst('internas')
->validator('Validate::numeric', array(
@@ -94,10 +87,9 @@ class Maquinascalles extends \App\Controllers\GoBaseResourceController
foreach ($data['data'] as $pkey => $values) {
// Si no se quiere borrar...
if ($data['data'][$pkey]['is_deleted'] != 1) {
- $process_data['formas_min'] = $data['data'][$pkey]['formas_min'];
- $process_data['formas_max'] = $data['data'][$pkey]['formas_max'];
+ $process_data['formas'] = $data['data'][$pkey]['formas'];
$process_data['maquina_id'] = $data['data'][$pkey]['maquina_id'];
- $response = $this->model->checkIntervals($process_data, $pkey);
+ $response = $this->model->checkDuplicatedFormas($process_data, $pkey);
// No se pueden duplicar valores al crear o al editar
if (!empty($response)) {
return $response;
diff --git a/ci4/app/Controllers/Configuracion/Maquinaspapelesimpresion.php b/ci4/app/Controllers/Configuracion/Maquinaspapelesimpresion.php
index 0f05f073..15cfc882 100644
--- a/ci4/app/Controllers/Configuracion/Maquinaspapelesimpresion.php
+++ b/ci4/app/Controllers/Configuracion/Maquinaspapelesimpresion.php
@@ -78,8 +78,17 @@ class Maquinaspapelesimpresion extends \App\Controllers\GoBaseResourceController
$length = $reqData['length'] ?? 5;
$search = $reqData['search']['value'];
$requestedOrder = $reqData['order']['0']['column'] ?? 1;
- $order = MaquinasPapelesImpresionModel::SORTABLE[$requestedOrder >= 0 ? $requestedOrder : 1];
+ $requestedOrder2 = $reqData['order']['1']['column'] ?? $requestedOrder;
+ $requestedOrder3 = $reqData['order']['2']['column'] ?? $requestedOrder;
+ $requestedOrder4 = $reqData['order']['3']['column'] ?? $requestedOrder;
+ $order = MaquinasPapelesImpresionModel::SORTABLE[$requestedOrder >= 0 ? $requestedOrder : 0];
+ $order2 = MaquinasPapelesImpresionModel::SORTABLE[$requestedOrder2 >= 0 ? $requestedOrder2 : $requestedOrder];
+ $order3 = MaquinasPapelesImpresionModel::SORTABLE[$requestedOrder3 >= 0 ? $requestedOrder3 : $requestedOrder];
+ $order4 = MaquinasPapelesImpresionModel::SORTABLE[$requestedOrder4 >= 0 ? $requestedOrder4 : $requestedOrder];
$dir = $reqData['order']['0']['dir'] ?? 'asc';
+ $dir2 = $reqData['order']['1']['dir'] ?? $dir;
+ $dir3 = $reqData['order']['2']['dir'] ?? $dir;
+ $dir4= $reqData['order']['3']['dir'] ?? $dir;
$maquina_id = $reqData['maquina_id'] ?? -1;
// Para saber si el papel que se tiene que mostrar es para rotativa
@@ -88,11 +97,12 @@ class Maquinaspapelesimpresion extends \App\Controllers\GoBaseResourceController
// Se obtienen las líneas de las tarifas seleccionadas para esta máquina
$tarifas = $tarifa_model->getResource("", $maquina_id)->get()->getResultObject();
- $resourceData = $this->model->getResource($search, $isRotativa, $tarifas, $maquina_id)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
+ $resourceData = $this->model->getResource($search, $isRotativa, $tarifas, $maquina_id)
+ ->orderBy($order, $dir)->orderBy($order2, $dir2)->orderBy($order3, $dir3)->orderBy($order4, $dir4)->limit($length, $start)->get()->getResultObject();
return $this->respond(Collection::datatable(
$resourceData,
- $this->model->getResource()->countAllResults(),
+ $this->model->getResource("", $isRotativa, $tarifas, $maquina_id)->countAllResults(),
$this->model->getResource($search, $isRotativa, $tarifas, $maquina_id)->countAllResults()
));
} else {
@@ -115,14 +125,25 @@ class Maquinaspapelesimpresion extends \App\Controllers\GoBaseResourceController
$start = $reqData['start'] ?? 0;
$length = $reqData['length'] ?? 5;
$search = $reqData['search']['value'];
- $requestedOrder = $reqData['order']['0']['column'] ?? 1;
- $order = MaquinasPapelesImpresionModel::SORTABLE_2[$requestedOrder >= 0 ? $requestedOrder : 1];
+ $requestedOrder = $reqData['order']['0']['column'] ?? 0;
+ $requestedOrder2 = $reqData['order']['1']['column'] ?? $requestedOrder;
+ $requestedOrder3 = $reqData['order']['2']['column'] ?? $requestedOrder;
+ $requestedOrder4 = $reqData['order']['3']['column'] ?? $requestedOrder;
+ $order = MaquinasPapelesImpresionModel::SORTABLE_2[$requestedOrder >= 0 ? $requestedOrder : 0];
+ $order2 = MaquinasPapelesImpresionModel::SORTABLE_2[$requestedOrder2 >= 0 ? $requestedOrder2 : $requestedOrder];
+ $order3 = MaquinasPapelesImpresionModel::SORTABLE_2[$requestedOrder3 >= 0 ? $requestedOrder3 : $requestedOrder];
+ $order4 = MaquinasPapelesImpresionModel::SORTABLE_2[$requestedOrder4 >= 0 ? $requestedOrder4 : $requestedOrder];
$dir = $reqData['order']['0']['dir'] ?? 'asc';
+ $dir2 = $reqData['order']['1']['dir'] ?? $dir;
+ $dir3 = $reqData['order']['2']['dir'] ?? $dir;
+ $dir4= $reqData['order']['3']['dir'] ?? $dir;
+
$papel_id = $reqData['papel_id'] ?? -1;
$isRotativa = $reqData['isRotativa'] ?? -1;
- $resourceData = $this->model->getResource_maquinas($search, $papel_id, $isRotativa)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
+ $resourceData = $this->model->getResource_maquinas($search, $papel_id, $isRotativa)
+ ->orderBy($order, $dir)->orderBy($order2, $dir2)->orderBy($order3, $dir3)->orderBy($order4, $dir4)->limit($length, $start)->get()->getResultObject();
return $this->respond(Collection::datatable(
$resourceData,
diff --git a/ci4/app/Controllers/Js_loader.php b/ci4/app/Controllers/Js_loader.php
new file mode 100644
index 00000000..691a5842
--- /dev/null
+++ b/ci4/app/Controllers/Js_loader.php
@@ -0,0 +1,26 @@
+response->setHeader('Content-Type', 'text/javascript');
+ return view('themes/backend/vuexy/form/presupuestos/cosidotapablanda/comparador.js');
+
+ }
+
+
+}
+
\ No newline at end of file
diff --git a/ci4/app/Controllers/Presupuestos/Cosidotapablanda.php b/ci4/app/Controllers/Presupuestos/Cosidotapablanda.php
index 520929dc..49b3598e 100644
--- a/ci4/app/Controllers/Presupuestos/Cosidotapablanda.php
+++ b/ci4/app/Controllers/Presupuestos/Cosidotapablanda.php
@@ -3,13 +3,19 @@
namespace App\Controllers\Presupuestos;
use App\Controllers\GoBaseResourceController;
-
+use App\Entities\Configuracion\Maquina;
use App\Models\Collection;
use App\Entities\Presupuestos\PresupuestoEntity;
use App\Models\Configuracion\PapelGenericoModel;
use App\Models\Presupuestos\PresupuestoModel;
+use App\Services\PresupuestoService;
+use App\Models\Configuracion\PapelImpresionModel;
+use App\Models\Configuracion\MaquinaModel;
+use App\Models\Configuracion\MaquinasTarifasImpresionModel;
+
+
class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
{
@@ -132,7 +138,7 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
$this->viewData['presupuestoEntity'] = isset($sanitizedData) ? new PresupuestoEntity($sanitizedData) : new PresupuestoEntity();
$this->viewData['clienteList'] = $this->getClienteListItems($presupuestoEntity->cliente_id ?? null);
- $this->viewData['incReiList'] = array('incidencia'=>lang('Presupuestos.incidencia'), 'reimpresion'=>lang('Presupuestos.reimpresion'), 'sin_cargo'=>lang('Presupuestos.sinCargo'));
+ $this->viewData['incReiList'] = array('incidencia' => lang('Presupuestos.incidencia'), 'reimpresion' => lang('Presupuestos.reimpresion'), 'sin_cargo' => lang('Presupuestos.sinCargo'));
$this->viewData['paisList'] = $this->getPaisListItems();
$this->viewData['papelFormatoList'] = $this->getPapelFormatoListItems($presupuestoEntity->papel_formato_id ?? null);
$this->viewData['papelGenericoNegroList'] = $this->getPapelGenericoNegro();
@@ -141,40 +147,17 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
$this->viewData['papelGenericoColorHQList'] = $this->getPapelGenericoColorHQ();
$this->viewData['papelGenericoCubiertaList'] = $this->getPapelGenericoCubierta();
$this->viewData['papelGenericoSobrecubiertaList'] = $this->getPapelGenericoSobreCubierta();
-
-
-
+
+ // Tarifas
+ $this->viewData['serviciosPreimpresion'] = $this->getServiciosPreimpresion();
+ $this->viewData['serviciosEncuadernacion'] = $this->getServiciosEncuadernacion();
+ $this->viewData['serviciosAcabado'] = $this->getServiciosAcabado();
+ $this->viewData['serviciosManipulado'] = $this->getServiciosManipulado();
+
+
+
/*
- $this->viewData['formaPagoList'] = $this->getFormaPagoListItems();
- $this->viewData['tiposImpresionList'] = $this->getTiposImpresionListItems($presupuestoEntity->tipo_impresion_id ?? null);
- $this->viewData['tipologiasLibroList'] = $this->getTipologiasLibroListItems($presupuestoEntity->tipologia_id ?? null);
-
- $this->viewData['ubicacionLibroList'] = $this->getUbicacionLibroListItems($presupuestoEntity->ubicacion_id ?? null);
- $this->viewData['presupuestoEstadoList'] = $this->getPresupuestoEstadoListItems($presupuestoEntity->estado_id ?? null);
-
- $this->viewData['papelGenericoList'] = $this->getPapelGenericoListItems($presupuestoEntity->paginas_negro_papel_id ?? null);
- $this->viewData['papelImpresionList'] = $this->getPapelImpresionListItems($presupuestoEntity->paginas_negro_papel_impresion_id ?? null);
- $this->viewData['maquinaList'] = $this->getMaquinaListItems($presupuestoEntity->paginas_negro_maquina_id ?? null);
- $this->viewData['maquinasTarifasImpresionList'] = $this->getMaquinasTarifasImpresionListItems($presupuestoEntity->paginas_negro_tarifa_impresion_id ?? null);
- $this->viewData['papelGenericoList2'] = $this->getPapelGenericoListItems2($presupuestoEntity->paginas_color_papel_id ?? null);
- $this->viewData['papelImpresionList2'] = $this->getPapelImpresionListItems2($presupuestoEntity->paginas_color_papel_impresion_id ?? null);
- $this->viewData['maquinaList2'] = $this->getMaquinaListItems2($presupuestoEntity->paginas_color_maquina_id ?? null);
- $this->viewData['maquinasTarifasImpresionList2'] = $this->getMaquinasTarifasImpresionListItems2($presupuestoEntity->paginas_color_tarifa_impresion_id ?? null);
- $this->viewData['papelGenericoList3'] = $this->getPapelGenericoListItems3($presupuestoEntity->paginas_portada_papel_id ?? null);
- $this->viewData['papelImpresionList3'] = $this->getPapelImpresionListItems3($presupuestoEntity->paginas_portada_papel_impresion_id ?? null);
- $this->viewData['maquinaList3'] = $this->getMaquinaListItems3($presupuestoEntity->paginas_portada_maquina_id ?? null);
- $this->viewData['maquinasTarifasImpresionList3'] = $this->getMaquinasTarifasImpresionListItems3($presupuestoEntity->paginas_portada_tarifa_impresion_id ?? null);
- $this->viewData['papelGenericoList4'] = $this->getPapelGenericoListItems4($presupuestoEntity->paginas_cubierta_papel_id ?? null);
- $this->viewData['papelImpresionList4'] = $this->getPapelImpresionListItems4($presupuestoEntity->paginas_cubierta_papel_impresion_id ?? null);
- $this->viewData['maquinaList4'] = $this->getMaquinaListItems4($presupuestoEntity->paginas_cubierta_maquina_id ?? null);
- $this->viewData['maquinasTarifasImpresionList4'] = $this->getMaquinasTarifasImpresionListItems4($presupuestoEntity->paginas_cubierta_tarifa_impresion_id ?? null);
- $this->viewData['userList'] = $this->getUserListItems($presupuestoEntity->total_confirmado_user_id ?? null);
- $this->viewData['userList2'] = $this->getUserListItems2($presupuestoEntity->aprobado_user_id ?? null);
- $this->viewData['userList3'] = $this->getUserListItems3($presupuestoEntity->pedido_espera_user_id ?? null);
- $this->viewData['paginasCubiertaList'] = $this->getPaginasCubiertaOptions();
- $this->viewData['paginasPortadaList'] = $this->getPaginasPortadaOptions();
- */
$this->viewData['formAction'] = route_to('createCosidotapablanda');
$this->viewData['boxTitle'] = lang('Basic.global.addNew') . ' ' . lang('Presupuestos.moduleTitleCosidoTB') . ' ' . lang('Basic.global.addNewSuffix');
@@ -369,7 +352,6 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
$this->viewData['papelGenericoColorHQList'] = $this->getPapelGenericoColorHQ();
$this->viewData['papelGenericoCubiertaList'] = $this->getPapelGenericoCubierta();
$this->viewData['papelGenericoSobrecubiertaList'] = $this->getPapelGenericoSobreCubierta();
-
$this->viewData['formAction'] = route_to('updatePresupuesto', $id);
@@ -385,54 +367,137 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
{
if ($this->request->isAJAX()) {
$reqData = $this->request->getPost();
- if (!isset($reqData['draw']) || !isset($reqData['columns'])) {
- $errstr = 'No data available in response to this specific request.';
- $response = $this->respond(Collection::datatable([], 0, 0, $errstr), 400, $errstr);
- return $response;
+
+ $type = $reqData['type'] ?? null;
+
+ if (is_null($type)) {
+ if (!isset($reqData['draw']) || !isset($reqData['columns'])) {
+ $errstr = 'No data available in response to this specific request.';
+ $response = $this->respond(Collection::datatable([], 0, 0, $errstr), 400, $errstr);
+ return $response;
+ }
+ $search = $reqData['search']['value'];
}
$start = $reqData['start'] ?? 0;
$length = $reqData['length'] ?? 5;
- $search = $reqData['search']['value'];
+
$requestedOrder = $reqData['order']['0']['column'] ?? 0;
$order = PresupuestoModel::SORTABLE[$requestedOrder >= 0 ? $requestedOrder : 0];
$dir = $reqData['order']['0']['dir'] ?? 'asc';
- $resourceData = $this->model->getResource($search)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
- foreach ($resourceData as $item) :
- if (isset($item->comentarios_pdf) && strlen($item->comentarios_pdf) > 100) :
- $item->comentarios_pdf = character_limiter($item->comentarios_pdf, 100);
- endif;
- if (isset($item->causa_cancelacion) && strlen($item->causa_cancelacion) > 100) :
- $item->causa_cancelacion = character_limiter($item->causa_cancelacion, 100);
- endif;
- if (isset($item->comentarios) && strlen($item->comentarios) > 100) :
- $item->comentarios = character_limiter($item->comentarios, 100);
- endif;
- if (isset($item->comentarios_safekat) && strlen($item->comentarios_safekat) > 100) :
- $item->comentarios_safekat = character_limiter($item->comentarios_safekat, 100);
- endif;
- if (isset($item->comentarios_tarifa) && strlen($item->comentarios_tarifa) > 100) :
- $item->comentarios_tarifa = character_limiter($item->comentarios_tarifa, 100);
- endif;
- if (isset($item->tirada_alternativa_json_data) && strlen($item->tirada_alternativa_json_data) > 100) :
- $item->tirada_alternativa_json_data = character_limiter($item->tirada_alternativa_json_data, 100);
- endif;
- if (isset($item->titulo) && strlen($item->titulo) > 100) :
- $item->titulo = character_limiter($item->titulo, 100);
- endif;
- if (isset($item->paginas_color_posicion) && strlen($item->paginas_color_posicion) > 100) :
- $item->paginas_color_posicion = character_limiter($item->paginas_color_posicion, 100);
- endif;
- if (isset($item->aprobado_json_data) && strlen($item->aprobado_json_data) > 100) :
- $item->aprobado_json_data = character_limiter($item->aprobado_json_data, 100);
- endif;
- if (isset($item->comparador_json_data) && strlen($item->comparador_json_data) > 100) :
- $item->comparador_json_data = character_limiter($item->comparador_json_data, 100);
- endif;
- if (isset($item->ws_externo_json_data) && strlen($item->ws_externo_json_data) > 100) :
- $item->ws_externo_json_data = character_limiter($item->ws_externo_json_data, 100);
- endif;
- endforeach;
+
+
+ if (is_null($type)) {
+ $resourceData = $this->model->getResource($search)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
+ foreach ($resourceData as $item) :
+ if (isset($item->comentarios_pdf) && strlen($item->comentarios_pdf) > 100) :
+ $item->comentarios_pdf = character_limiter($item->comentarios_pdf, 100);
+ endif;
+ if (isset($item->causa_cancelacion) && strlen($item->causa_cancelacion) > 100) :
+ $item->causa_cancelacion = character_limiter($item->causa_cancelacion, 100);
+ endif;
+ if (isset($item->comentarios_cliente) && strlen($item->comentarios_cliente) > 100) :
+ $item->comentarios_cliente = character_limiter($item->comentarios_cliente, 100);
+ endif;
+ if (isset($item->comentarios_safekat) && strlen($item->comentarios_safekat) > 100) :
+ $item->comentarios_safekat = character_limiter($item->comentarios_safekat, 100);
+ endif;
+ if (isset($item->comentarios_tarifa) && strlen($item->comentarios_tarifa) > 100) :
+ $item->comentarios_tarifa = character_limiter($item->comentarios_tarifa, 100);
+ endif;
+ if (isset($item->comentarios_produccion) && strlen($item->comentarios_produccion) > 100) :
+ $item->comentarios_produccion = character_limiter($item->comentarios_produccion, 100);
+ endif;
+ if (isset($item->tirada_alternativa_json_data) && strlen($item->tirada_alternativa_json_data) > 100) :
+ $item->tirada_alternativa_json_data = character_limiter($item->tirada_alternativa_json_data, 100);
+ endif;
+ if (isset($item->titulo) && strlen($item->titulo) > 100) :
+ $item->titulo = character_limiter($item->titulo, 100);
+ endif;
+ if (isset($item->paginas_color_posicion) && strlen($item->paginas_color_posicion) > 100) :
+ $item->paginas_color_posicion = character_limiter($item->paginas_color_posicion, 100);
+ endif;
+ if (isset($item->aprobado_json_data) && strlen($item->aprobado_json_data) > 100) :
+ $item->aprobado_json_data = character_limiter($item->aprobado_json_data, 100);
+ endif;
+ if (isset($item->comparador_json_data) && strlen($item->comparador_json_data) > 100) :
+ $item->comparador_json_data = character_limiter($item->comparador_json_data, 100);
+ endif;
+ if (isset($item->ws_externo_json_data) && strlen($item->ws_externo_json_data) > 100) :
+ $item->ws_externo_json_data = character_limiter($item->ws_externo_json_data, 100);
+ endif;
+ endforeach;
+ } else {
+
+ $isColor = $reqData['color'] ?? false;
+ $isHq = $reqData['hq'] ?? false;
+
+ $datosPedido = (object)array(
+ 'paginas' => intval($reqData['paginas']) ?? 0,
+ 'tirada' => intval($reqData['tirada']) ?? 0,
+ 'merma' => intval($reqData['merma']) ?? 0,
+ 'ancho' => intval($reqData['ancho']) ?? 100000,
+ 'alto' => intval($reqData['alto']) ?? 100000,
+ 'isCosido' => true, // JJO esto es custom por cada tipo de presupuesto
+ );
+
+ $papel_generico = [
+ 'id' => $reqData['papel_generico_id'] ?? 0,
+ 'nombre' => $reqData['papel_generico'] ?? "",
+ ];
+
+ $gramaje = $reqData['gramaje'] ?? 0;
+
+ if ($type=='interior') {
+
+ $resourceData = $this->getCompIntData($type, $datosPedido, $papel_generico, $gramaje, $isColor, $isHq);
+
+ $newTokenHash = csrf_hash();
+ $csrfTokenName = csrf_token();
+ $data = [
+ 'lineas' => $resourceData,
+ $csrfTokenName => $newTokenHash
+ ];
+
+ return $this->respond($data);
+ }
+ else if ($type=='interior_rot') {
+
+ $paginas = (object)array(
+ 'negro' => intval($reqData['paginas_negro']) ?? 0,
+ 'color' => intval($reqData['paginas_color']) ?? 0,
+ );
+
+ $resourceData = $this->getCompIntRotData($datosPedido, $papel_generico, $gramaje, $paginas);
+
+ $newTokenHash = csrf_hash();
+ $csrfTokenName = csrf_token();
+ $data = [
+ 'lineas' => $resourceData,
+ $csrfTokenName => $newTokenHash
+ ];
+
+ return $this->respond($data);
+ }
+ else if ($type=='cubierta') {
+
+ $datosPedido->solapas = $reqData['solapas'];
+ $datosPedido->solapas_ancho = $reqData['solapas_ancho'];
+
+ $resourceData = $this->getCompIntData($type, $datosPedido, $papel_generico, $gramaje, $isColor, $isHq);
+
+ $newTokenHash = csrf_hash();
+ $csrfTokenName = csrf_token();
+ $data = [
+ 'lineas' => $resourceData,
+ $csrfTokenName => $newTokenHash
+ ];
+
+ return $this->respond($data);
+ }
+
+
+ }
return $this->respond(Collection::datatable(
$resourceData,
@@ -444,6 +509,210 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
}
}
+ public function getCompIntData($uso, $datosPedido, $papel_generico, $gramaje, $isColor, $isHq)
+ {
+ $tipo = $isColor? ($isHq?'colorhq':'color'): ($isHq?'negrohq':'negro');
+
+ if( $uso == 'cubierta' ){
+ $opciones_papel = array(
+ 'cubierta' => 1,
+ 'color' => 1,
+ 'rotativa' => 0,
+ );
+ }
+ else if ( $uso == 'sobrecubierta' ){
+ $opciones_papel = array(
+ 'sobrecubierta' => 1,
+ 'color' => 1,
+ 'rotativa' => 0,
+ );
+ }
+ else if( $isColor ){
+ $opciones_papel = array(
+ 'color' => 1,
+ 'rotativa' => 0,
+ );
+ }
+ else{
+ $opciones_papel = array(
+ 'bn' => 1,
+ 'rotativa' => 0,
+ );
+ }
+
+
+
+ // Se obtienen los papeles disponibles
+ $papelimpresionmodel = new PapelImpresionModel();
+ $papeles = $papelimpresionmodel->getIdPapelesImpresionForPresupuesto(
+ papel_generico_id: $papel_generico['id'],
+ gramaje: $gramaje,
+ options: $opciones_papel
+ );
+
+ $lineas = array();
+ // Para cada papel, se obtienen las maquinas disponibles
+ foreach ($papeles as $papel) {
+
+ $maquinamodel = new MaquinaModel();
+ $maquinas = $maquinamodel->getMaquinaImpresionForPresupuesto(
+ is_rotativa: 0,
+ tarifa_tipo: $tipo,
+ tirada: $datosPedido->tirada + $datosPedido->merma,
+ papel_impresion_id: $papel->id,
+ );
+
+ // Se recorren las máquinas y se calcula el coste de linea por cada una
+ foreach ($maquinas as $maquina) {
+
+ $tarifamodel = new MaquinasTarifasImpresionModel();
+ $tarifa = $tarifamodel->getTarifa($maquina->maquina_id, $uso, $tipo);
+ if(!is_float($tarifa)){
+ continue;
+ }
+ $linea = PresupuestoService::getCostesLinea($uso, $datosPedido, $maquina, $papel, $opciones_papel, $tarifa);
+ $linea['fields']['maquina'] = $maquina->maquina;
+ $linea['fields']['maquina_id'] = $maquina->maquina_id;
+ $linea['fields']['maquina_velocidad'] = $maquina->velocidad;
+ $linea['fields']['papel_impresion'] = $papel->nombre;
+ $linea['fields']['papel_impresion_id'] = $papel->id;
+ $linea['fields']['paginas'] = $datosPedido->paginas;
+ $linea['fields']['gramaje'] = $gramaje;
+ $linea['fields']['papel_generico_id'] = $papel_generico['id'];
+ $linea['fields']['papel_generico'] = $papel_generico['nombre'];
+ $linea['fields']['tiempo_maquina'] = PresupuestoService::getTiempoMaquina(
+ $linea['fields']['precio_click_pedido'],
+ $linea['fields']['precio_click'],
+ $maquina->velocidad);
+
+ array_push($lineas, $linea);
+ }
+ }
+ return $lineas;
+ }
+
+ public function getCompIntRotData($datosPedido, $papel_generico, $gramaje, $paginas)
+ {
+
+ $uso = 'interior';
+
+ $tipo = $paginas->color>0? 'color': 'negro';
+
+
+ $parametrosRotativa = (object)array(
+ 'a_favor_fibra' => 0, // este parametro se cambia para comprobar
+ // en las dos direcciones (menos en rustica fresada que es siempre 1)
+ 'bnPages' => $paginas->negro,
+ 'colorPages' => $paginas->color,
+ 'rotativa_gota_negro' => 0,
+ 'rotativa_gota_color' => 0,
+ );
+
+ $opciones_papel = array(
+ 'rotativa' => 1,
+ );
+
+ $tipo = array();
+ if( $paginas->color > 0 ){
+ $tipo[] = 'color';
+ $opciones_papel['color'] = 1;
+ }
+ if( $paginas->negro > 0 ){
+ $opciones_papel['bn'] = 1;
+ $tipo[] = 'negro';
+ }
+
+ // Se obtienen los papeles disponibles
+ $papelimpresionmodel = new PapelImpresionModel();
+ $papeles = $papelimpresionmodel->getIdPapelesImpresionForPresupuesto(
+ papel_generico_id: $papel_generico['id'],
+ gramaje: $gramaje,
+ options: $opciones_papel
+ );
+
+ $lineas = array();
+ // Para cada papel, se obtienen las maquinas disponibles
+ foreach ($papeles as $papel) {
+
+ $papelImpresionTipologiaModel = new \App\Models\Configuracion\PapelImpresionTipologiaModel();
+ $datosTipologias = $papelImpresionTipologiaModel
+ ->findTipologiasForPapelImpresion($papel->id, $parametrosRotativa->colorPages>0?'color':'negro')
+ ->get()->getResultObject();
+
+ $parametrosRotativa->rotativa_gota_negro = $datosTipologias[0]->gota_negro;
+ $parametrosRotativa->rotativa_gota_color = $datosTipologias[0]->gota_color;
+ $parametrosRotativa->rotativa_negro = $datosTipologias[0]->negro;
+ $parametrosRotativa->rotativa_cyan = $datosTipologias[0]->cyan;
+ $parametrosRotativa->rotativa_magenta = $datosTipologias[0]->magenta;
+ $parametrosRotativa->rotativa_amarillo = $datosTipologias[0]->amarillo;
+
+ $maquinamodel = new MaquinaModel();
+
+ $maquinas = $maquinamodel->getMaquinaImpresionForPresupuesto(
+ is_rotativa: 1,
+ tarifa_tipo: $tipo,
+ tirada: $datosPedido->tirada + $datosPedido->merma,
+ papel_impresion_id: $papel->id,
+ );
+
+ // Se recorren las máquinas y se calcula el coste de linea por cada una
+ foreach ($maquinas as $maquina) {
+
+ for ($i = 0; $i <= 1; $i++) {
+
+ $parametrosRotativa->a_favor_fibra = $i;
+
+ $tarifamodel = new MaquinasTarifasImpresionModel();
+ $tarifa = $tarifamodel->getTarifa($maquina->maquina_id, $uso, is_array($tipo)?'color':$tipo);
+ if(!is_float($tarifa)){
+ continue;
+ }
+
+ // precio del pliego de impresion
+ $linea['fields'] = PresupuestoService::getCostesLineaRotativa($maquina, $papel, $datosPedido, $parametrosRotativa);
+
+ $precio_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;
+ // Precio papel pedido
+ $linea['fields']['precio_pedido'] = $linea['fields']['precio_libro'] * ($datosPedido->tirada + $datosPedido->merma);
+
+ $linea['fields']['a_favor_fibra'] = $parametrosRotativa->a_favor_fibra;
+ $linea['fields']['maquina'] = $maquina->maquina;
+ $linea['fields']['maquina_id'] = $maquina->maquina_id;
+ $linea['fields']['maquina_velocidad'] = $maquina->velocidad;
+ $linea['fields']['papel_impresion'] = $papel->nombre;
+ $linea['fields']['papel_impresion_id'] = $papel->id;
+ $linea['fields']['paginas'] = $datosPedido->paginas;
+ $linea['fields']['gramaje'] = $gramaje;
+ $linea['fields']['papel_generico_id'] = $papel_generico['id'];
+ $linea['fields']['papel_generico'] = $papel_generico['nombre'];
+
+ $linea['fields']['posicion_formas'] = $parametrosRotativa->a_favor_fibra ? 'h' : 'v';
+ $linea['fields']['num_formas_horizontales'] = floor($linea['fields']['factor_anchura']);
+ $linea['fields']['num_formas_verticales'] = floor($linea['fields']['factor_altura']);
+
+ // impresion
+ $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'],
+ $maquina->velocidad);
+
+ // total linea rotativa
+ $linea['fields']['total_impresion'] = $linea['fields']['precio_pedido'] + $linea['fields']['precio_click_pedido'] + $linea['fields']['precio_tinta'] +
+ $linea['fields']['total_corte'];
+
+ array_push($lineas, $linea);
+ }
+ }
+ }
+ return $lineas;
+ }
+
public function allItemsSelect()
{
if ($this->request->isAJAX()) {
@@ -470,27 +739,86 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
public function menuItems()
{
if ($this->request->isAJAX()) {
-
+
$reqData = $this->request->getPost();
$tipo = $reqData['tipo'] ?? null;
+ $uso = $reqData['uso'] ?? null;
$datos = $reqData['datos'] ?? null;
- $searchStr = goSanitize($this->request->getPost('searchTerm'))[0];
-
-
- if ($tipo == 'gramaje'){
- // En este caso contiene el nombre del papel generico
- $model = new PapelGenericoModel();
- $menu = $model->getGramajeComparador($datos, $searchStr);
- }
-
+ //$searchStr = goSanitize($this->request->getPost('searchTerm'))[0];
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
- $data = [
- 'menu' => $menu,
- $csrfTokenName => $newTokenHash
- ];
+
+ if ($tipo == 'gramaje') {
+ // En este caso contiene el nombre del papel generico
+ $model = new PapelGenericoModel();
+ $menu = $model->getGramajeComparador($datos, $uso );
+
+ $data = [
+ 'menu' => $menu,
+ $csrfTokenName => $newTokenHash
+ ];
+ }
+ elseif ($tipo == 'gramajeLineasPresupuesto') {
+ $tipoLinea = $reqData['tipoLinea'] ?? null;
+ // En este caso contiene el id del papel generico
+ $model = new PapelGenericoModel();
+ $menu = $model->getGramajeLineasPresupuesto($datos, $tipoLinea, $uso );
+
+ $data = [
+ 'menu' => $menu,
+ $csrfTokenName => $newTokenHash
+ ];
+ }
+ elseif ($tipo == 'papelImpresion') {
+ $gramaje = $reqData['gramaje'] ?? null;
+ $tipoLinea = $reqData['tipoLinea'] ?? null;
+ // En este caso contiene el nombre del papel generico
+ // Uso: negro, negrohq, color, colorhq, rot_bn, rot_color,
+ $model = new PapelImpresionModel();
+ $menu = $model->getPapelesImpresionForMenu($datos, $gramaje, $tipoLinea, $uso );
+
+ $data = [
+ 'menu' => $menu,
+ $csrfTokenName => $newTokenHash
+ ];
+ }
+
+ elseif ($tipo == 'maquina') {
+ $is_rotativa = $reqData['is_rotativa'] ?? null;
+ $papel_impresion = $reqData['papel_impresion'] ?? null;
+ $tipo_linea = $reqData['tipoLinea'] ?? null;
+ $ancho = $reqData['ancho'] ?? null;
+ $alto = $reqData['alto'] ?? null;
+ // Datos contiene la tirada
+ // uso: negro, negrohq, color, colorhq,
+ $model = new MaquinaModel();
+ $maquinas = $model->getMaquinaImpresionForPresupuesto($is_rotativa, $uso, $datos, $papel_impresion );
+ $menu = [];
+ foreach ($maquinas as $maquina){
+
+ $formas = PresupuestoService::getNumFormasPlana($tipo_linea, $maquina, floatval($ancho), floatval($alto), true);
+
+ if($formas['num_formas'] != 'n/a'){
+ array_push($menu, $maquina);
+ }
+ }
+
+ $data = [
+ 'menu' => $menu,
+ $csrfTokenName => $newTokenHash
+ ];
+ }
+
+ else{
+
+ $data = [
+ 'tipo' => $tipo,
+ $csrfTokenName => $newTokenHash
+ ];
+ }
+
return $this->respond($data);
} else {
return $this->failUnauthorized('Invalid request', 403);
@@ -525,7 +853,7 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
{
$papelFormatoModel = model('App\Models\Configuracion\PapelFormatoModel');
$data = $papelFormatoModel->getElementsForMenu();
- array_unshift($data, (object)['id'=>'', 'tamanio' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.papelFormatoId'))])]);
+ array_unshift($data, (object)['id' => '', 'tamanio' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.papelFormatoId'))])]);
return $data;
}
@@ -533,7 +861,10 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
{
$model = model('App\Models\Configuracion\PapelGenericoModel');
$data = $model->getPapelForComparador('negro', false, false);
- array_unshift($data, lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.papel'))]));
+ array_unshift($data, (object)array(
+ "id" => 0,
+ "nombre" => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.papel'))])
+ ));
return $data;
}
@@ -541,7 +872,10 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
{
$model = model('App\Models\Configuracion\PapelGenericoModel');
$data = $model->getPapelForComparador('negrohq', false, false);
- array_unshift($data, lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.papel'))]));
+ array_unshift($data, (object)array(
+ "id" => 0,
+ "nombre" => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.papel'))])
+ ));
return $data;
}
@@ -549,7 +883,10 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
{
$model = model('App\Models\Configuracion\PapelGenericoModel');
$data = $model->getPapelForComparador('color', false, false);
- array_unshift($data, lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.papel'))]));
+ array_unshift($data, (object)array(
+ "id" => 0,
+ "nombre" => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.papel'))])
+ ));
return $data;
}
@@ -557,7 +894,10 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
{
$model = model('App\Models\Configuracion\PapelGenericoModel');
$data = $model->getPapelForComparador('colorhq', false, false);
- array_unshift($data, lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.papel'))]));
+ array_unshift($data, (object)array(
+ "id" => 0,
+ "nombre" => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.papel'))])
+ ));
return $data;
}
@@ -565,7 +905,10 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
{
$model = model('App\Models\Configuracion\PapelGenericoModel');
$data = $model->getPapelForComparador('color', true, false);
- array_unshift($data, lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.papel'))]));
+ array_unshift($data, (object)array(
+ "id" => 0,
+ "nombre" => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.papel'))])
+ ));
return $data;
}
@@ -573,394 +916,58 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
{
$model = model('App\Models\Configuracion\PapelGenericoModel');
$data = $model->getPapelForComparador('color', false, true);
- array_unshift($data, lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.papel'))]));
+ array_unshift($data, (object)array(
+ "id" => 0,
+ "nombre" => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.papel'))])
+ ));
return $data;
}
- /*
-
-
-
-
-
- protected function getUbicacionLibroListItems($selId = null)
+ protected function getServiciosPreimpresion()
{
- $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('LgUbicacionesLibros.ubicacionLibro'))])];
- if (!empty($selId)) :
- $ubicacionesLibroModel = model('App\Models\Configuracion\UbicacionesLibroModel');
-
- $selOption = $ubicacionesLibroModel->where('id', $selId)->findColumn('nombre');
- if (!empty($selOption)) :
- $data[$selId] = $selOption[0];
- endif;
- endif;
+ $model = model('App\Models\Tarifas\TarifapreimpresionModel');
+ $data = $model->getServiciosPreimpresionSelector();
+ array_unshift($data, (object)array(
+ "value" => 0,
+ "label" => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.servicioPreimpresion'))])
+ ));
return $data;
}
-
- protected function getFormaPagoListItems()
+ protected function getServiciosEncuadernacion()
{
- $formasPagoModel = model('App\Models\Configuracion\FormasPagoModel');
- $onlyActiveOnes = true;
- $data = $formasPagoModel->getAllForMenu('id, nombre', 'nombre', $onlyActiveOnes);
-
+ $model = model('App\Models\Tarifas\TarifaEncuadernacionModel');
+ $data = $model->getServiciosEncuadernacionSelector();
+ array_unshift($data, (object)array(
+ "value" => 0,
+ "label" => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.servicioEncuadernado'))])
+ ));
return $data;
}
-
- protected function getPapelImpresionListItems4($selId = null)
+ protected function getServiciosAcabado()
{
- $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('PapelImpresions.papelImpresion'))])];
- if (!empty($selId)) :
- $papelImpresionModel = model('App\Models\Presupuestos\PapelImpresionModel');
-
- $selOption = $papelImpresionModel->where('id', $selId)->findColumn('nombre');
- if (!empty($selOption)) :
- $data[$selId] = $selOption[0];
- endif;
- endif;
+ $model = model('App\Models\Tarifas\TarifaacabadoModel');
+ $data = $model->getServiciosAcabadoSelector();
+ array_unshift($data, (object)array(
+ "value" => 0,
+ "label" => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.servicioAcabado'))])
+ ));
return $data;
}
-
- protected function getPresupuestoEstadoListItems($selId = null)
+ protected function getServiciosManipulado()
{
- $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('PresupuestoEstados.presupuestoEstado'))])];
- if (!empty($selId)) :
- $presupuestoEstadoModel = model('App\Models\Presupuestos\PresupuestoEstadoModel');
-
- $selOption = $presupuestoEstadoModel->where('id', $selId)->findColumn('estado');
- if (!empty($selOption)) :
- $data[$selId] = $selOption[0];
- endif;
- endif;
- return $data;
- }
-
-
- protected function getPapelGenericoListItems3($selId = null)
- {
- $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('PapelGenericoes.papelGenerico'))])];
- if (!empty($selId)) :
- $papelGenericoModel = model('App\Models\Presupuestos\PapelGenericoModel');
-
- $selOption = $papelGenericoModel->where('id', $selId)->findColumn('nombre');
- if (!empty($selOption)) :
- $data[$selId] = $selOption[0];
- endif;
- endif;
- return $data;
- }
-
-
- protected function getPapelImpresionListItems2($selId = null)
- {
- $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('PapelImpresions.papelImpresion'))])];
- if (!empty($selId)) :
- $papelImpresionModel = model('App\Models\Presupuestos\PapelImpresionModel');
-
- $selOption = $papelImpresionModel->where('id', $selId)->findColumn('nombre');
- if (!empty($selOption)) :
- $data[$selId] = $selOption[0];
- endif;
- endif;
- return $data;
- }
-
-
- protected function getMaquinaListItems3($selId = null)
- {
- $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Maquinas.maquina'))])];
- if (!empty($selId)) :
- $maquinaModel = model('App\Models\Presupuestos\MaquinaModel');
-
- $selOption = $maquinaModel->where('id', $selId)->findColumn('nombre');
- if (!empty($selOption)) :
- $data[$selId] = $selOption[0];
- endif;
- endif;
- return $data;
- }
-
-
- protected function getMaquinasTarifasImpresionListItems2($selId = null)
- {
- $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('MaquinasTarifasImpresions.maquinasTarifasImpresion'))])];
- if (!empty($selId)) :
- $maquinasTarifasImpresionModel = model('App\Models\Presupuestos\MaquinasTarifasImpresionModel');
-
- $selOption = $maquinasTarifasImpresionModel->where('id', $selId)->findColumn('precio');
- if (!empty($selOption)) :
- $data[$selId] = $selOption[0];
- endif;
- endif;
- return $data;
- }
-
-
- protected function getPapelGenericoListItems2($selId = null)
- {
- $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('PapelGenericoes.papelGenerico'))])];
- if (!empty($selId)) :
- $papelGenericoModel = model('App\Models\Presupuestos\PapelGenericoModel');
-
- $selOption = $papelGenericoModel->where('id', $selId)->findColumn('nombre');
- if (!empty($selOption)) :
- $data[$selId] = $selOption[0];
- endif;
- endif;
- return $data;
- }
-
-
- protected function getMaquinaListItems($selId = null)
- {
- $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Maquinas.maquina'))])];
- if (!empty($selId)) :
- $maquinaModel = model('App\Models\Presupuestos\MaquinaModel');
-
- $selOption = $maquinaModel->where('id', $selId)->findColumn('nombre');
- if (!empty($selOption)) :
- $data[$selId] = $selOption[0];
- endif;
- endif;
+ $model = model('App\Models\Tarifas\TarifaManipuladoModel');
+ $data = $model->getServiciosManipuladoSelector();
+ array_unshift($data, (object)array(
+ "value" => 0,
+ "label" => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.servicioManipulado'))])
+ ));
return $data;
}
- protected function getMaquinaListItems2($selId = null)
- {
- $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Maquinas.maquina'))])];
- if (!empty($selId)) :
- $maquinaModel = model('App\Models\Presupuestos\MaquinaModel');
-
- $selOption = $maquinaModel->where('id', $selId)->findColumn('nombre');
- if (!empty($selOption)) :
- $data[$selId] = $selOption[0];
- endif;
- endif;
- return $data;
- }
-
-
- protected function getTipologiasLibroListItems($selId = null)
- {
- $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('TipologiasLibros.tipologiasLibro'))])];
- if (!empty($selId)) :
- $tipologiasLibroModel = model('App\Models\Presupuestos\TipologiasLibroModel');
-
- $selOption = $tipologiasLibroModel->where('id', $selId)->findColumn('nombre');
- if (!empty($selOption)) :
- $data[$selId] = $selOption[0];
- endif;
- endif;
- return $data;
- }
-
-
- protected function getPapelImpresionListItems3($selId = null)
- {
- $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('PapelImpresions.papelImpresion'))])];
- if (!empty($selId)) :
- $papelImpresionModel = model('App\Models\Presupuestos\PapelImpresionModel');
-
- $selOption = $papelImpresionModel->where('id', $selId)->findColumn('nombre');
- if (!empty($selOption)) :
- $data[$selId] = $selOption[0];
- endif;
- endif;
- return $data;
- }
-
-
- protected function getMaquinasTarifasImpresionListItems4($selId = null)
- {
- $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('MaquinasTarifasImpresions.maquinasTarifasImpresion'))])];
- if (!empty($selId)) :
- $maquinasTarifasImpresionModel = model('App\Models\Presupuestos\MaquinasTarifasImpresionModel');
-
- $selOption = $maquinasTarifasImpresionModel->where('id', $selId)->findColumn('precio');
- if (!empty($selOption)) :
- $data[$selId] = $selOption[0];
- endif;
- endif;
- return $data;
- }
-
-
- protected function getUserListItems($selId = null)
- {
- $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Users.user'))])];
- if (!empty($selId)) :
- $userModel = model('App\Models\Presupuestos\UserModel');
-
- $selOption = $userModel->where('id_user', $selId)->findColumn('first_name');
- if (!empty($selOption)) :
- $data[$selId] = $selOption[0];
- endif;
- endif;
- return $data;
- }
-
-
- protected function getMaquinasTarifasImpresionListItems3($selId = null)
- {
- $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('MaquinasTarifasImpresions.maquinasTarifasImpresion'))])];
- if (!empty($selId)) :
- $maquinasTarifasImpresionModel = model('App\Models\Presupuestos\MaquinasTarifasImpresionModel');
-
- $selOption = $maquinasTarifasImpresionModel->where('id', $selId)->findColumn('id');
- if (!empty($selOption)) :
- $data[$selId] = $selOption[0];
- endif;
- endif;
- return $data;
- }
-
-
- protected function getUserListItems3($selId = null)
- {
- $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Users.user'))])];
- if (!empty($selId)) :
- $userModel = model('App\Models\Presupuestos\UserModel');
-
- $selOption = $userModel->where('id_user', $selId)->findColumn('first_name');
- if (!empty($selOption)) :
- $data[$selId] = $selOption[0];
- endif;
- endif;
- return $data;
- }
-
-
- protected function getPapelImpresionListItems($selId = null)
- {
- $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('PapelImpresions.papelImpresion'))])];
- if (!empty($selId)) :
- $papelImpresionModel = model('App\Models\Presupuestos\PapelImpresionModel');
-
- $selOption = $papelImpresionModel->where('id', $selId)->findColumn('nombre');
- if (!empty($selOption)) :
- $data[$selId] = $selOption[0];
- endif;
- endif;
- return $data;
- }
-
-
- protected function getTiposImpresionListItems($selId = null)
- {
- $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('TiposImpresions.tiposImpresion'))])];
- if (!empty($selId)) :
- $tiposImpresionModel = model('App\Models\Presupuestos\TiposImpresionModel');
-
- $selOption = $tiposImpresionModel->where('id', $selId)->findColumn('nombre');
- if (!empty($selOption)) :
- $data[$selId] = $selOption[0];
- endif;
- endif;
- return $data;
- }
-
-
- protected function getMaquinasTarifasImpresionListItems($selId = null)
- {
- $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('MaquinasTarifasImpresions.maquinasTarifasImpresion'))])];
- if (!empty($selId)) :
- $maquinasTarifasImpresionModel = model('App\Models\Presupuestos\MaquinasTarifasImpresionModel');
-
- $selOption = $maquinasTarifasImpresionModel->where('id', $selId)->findColumn('precio');
- if (!empty($selOption)) :
- $data[$selId] = $selOption[0];
- endif;
- endif;
- return $data;
- }
-
-
- protected function getPapelGenericoListItems4($selId = null)
- {
- $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('PapelGenericoes.papelGenerico'))])];
- if (!empty($selId)) :
- $papelGenericoModel = model('App\Models\Presupuestos\PapelGenericoModel');
-
- $selOption = $papelGenericoModel->where('id', $selId)->findColumn('nombre');
- if (!empty($selOption)) :
- $data[$selId] = $selOption[0];
- endif;
- endif;
- return $data;
- }
-
-
-
- protected function getMaquinaListItems4($selId = null)
- {
- $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Maquinas.maquina'))])];
- if (!empty($selId)) :
- $maquinaModel = model('App\Models\Presupuestos\MaquinaModel');
-
- $selOption = $maquinaModel->where('id', $selId)->findColumn('nombre');
- if (!empty($selOption)) :
- $data[$selId] = $selOption[0];
- endif;
- endif;
- return $data;
- }
-
-
- protected function getUserListItems2($selId = null)
- {
- $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Users.user'))])];
- if (!empty($selId)) :
- $userModel = model('App\Models\Presupuestos\UserModel');
-
- $selOption = $userModel->where('id_user', $selId)->findColumn('first_name');
- if (!empty($selOption)) :
- $data[$selId] = $selOption[0];
- endif;
- endif;
- return $data;
- }
-
-
- protected function getPapelGenericoListItems($selId = null)
- {
- $data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('PapelGenericoes.papelGenerico'))])];
- if (!empty($selId)) :
- $papelGenericoModel = model('App\Models\Presupuestos\PapelGenericoModel');
-
- $selOption = $papelGenericoModel->where('id', $selId)->findColumn('nombre');
- if (!empty($selOption)) :
- $data[$selId] = $selOption[0];
- endif;
- endif;
- return $data;
- }
-
-
- protected function getPaginasCubiertaOptions()
- {
- $paginasCubiertaOptions = [
- '' => lang('Basic.global.pleaseSelect'),
- '4x0' => '4x0',
- '4x4' => '4x4',
- ];
- return $paginasCubiertaOptions;
- }
-
-
-
- protected function getPaginasPortadaOptions()
- {
- $paginasPortadaOptions = [
- '' => lang('Basic.global.pleaseSelect'),
- '4x0' => '4x0',
- '4x4' => '4x4',
- ];
- return $paginasPortadaOptions;
- }
- */
}
diff --git a/ci4/app/Controllers/Presupuestos/Cosidotapablandasolapas.php b/ci4/app/Controllers/Presupuestos/Cosidotapablandasolapas.php
deleted file mode 100644
index de7fdbf3..00000000
--- a/ci4/app/Controllers/Presupuestos/Cosidotapablandasolapas.php
+++ /dev/null
@@ -1,19 +0,0 @@
-> Libros >> Cosido tapa blanda con solapas [en desarrollo].';
- }
-}
-
\ No newline at end of file
diff --git a/ci4/app/Controllers/Presupuestos/Js_loader.php b/ci4/app/Controllers/Presupuestos/Js_loader.php
index f753fee7..89baad3c 100644
--- a/ci4/app/Controllers/Presupuestos/Js_loader.php
+++ b/ci4/app/Controllers/Presupuestos/Js_loader.php
@@ -16,10 +16,9 @@ class Js_loader extends BaseController
function comparadorCosidoTapablanda_js()
{
- $this->load->view('themes/backend/vuexy/form/presupuestos/cosidotapablanda/comparador.js', $data);
+ $this->load->view('themes/backend/vuexy/form/presupuestos/cosidotapablanda/comparador.js');
$this->output->set_content_type('text/javascript');
}
-
}
\ No newline at end of file
diff --git a/ci4/app/Controllers/Presupuestos/PresupuestoAcabados.php b/ci4/app/Controllers/Presupuestos/PresupuestoAcabados.php
new file mode 100644
index 00000000..d5374629
--- /dev/null
+++ b/ci4/app/Controllers/Presupuestos/PresupuestoAcabados.php
@@ -0,0 +1,121 @@
+request->isAJAX()) {
+ $reqData = $this->request->getPost();
+ if (!isset($reqData['draw']) || !isset($reqData['columns'])) {
+ $errstr = 'No data available in response to this specific request.';
+ $response = $this->respond(Collection::datatable([], 0, 0, $errstr), 400, $errstr);
+ return $response;
+ }
+ $start = $reqData['start'] ?? 0;
+ $length = $reqData['length'] ?? 5;
+ $requestedOrder = $reqData['order']['0']['column'] ?? 1;
+ $order = PresupuestoAcabadosModel::SORTABLE[$requestedOrder >= 0 ? $requestedOrder : 1];
+ $dir = $reqData['order']['0']['dir'] ?? 'asc';
+
+ $id_P = $reqData['id_presupuesto'] ?? -1;
+
+ $resourceData = $this->model->getResource($id_P)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
+
+ return $this->respond(Collection::datatable(
+ $resourceData,
+ $this->model->getResource()->countAllResults(),
+ $this->model->getResource($id_P)->countAllResults()
+ ));
+ } else {
+ return $this->failUnauthorized('Invalid request', 403);
+ }
+ }
+
+ public function datatable_editor() {
+ if ($this->request->isAJAX()) {
+
+ include(APPPATH . "ThirdParty/DatatablesEditor/DataTables.php");
+
+ // Build our Editor instance and process the data coming from _POST
+ $response = Editor::inst( $db, 'presupuesto_acabados' )
+ ->fields(
+ Field::inst( 'tarifa_acabado_id' )
+ ->validator( 'Validate::notEmpty',array(
+ 'message' => 'Selecciones servicios de acabado' )
+ ),
+ Field::inst( 'precio_unidad' )
+ ->validator( 'Validate::notEmpty',array(
+ 'message' => 'Falta precio unitario' )
+ ),
+ Field::inst( 'precio_total' )
+ ->validator( 'Validate::notEmpty',array(
+ 'message' => 'Falta precio total' )
+ ),
+
+ Field::inst( 'presupuesto_id' ),
+
+ )
+ ->validator( function($editor, $action, $data){
+ if ($action === Editor::ACTION_CREATE || $action === Editor::ACTION_EDIT){
+ //return $response;
+ /*foreach ($data['data'] as $pkey => $values ){
+ // No se pueden duplicar valores al crear o al editar
+ if (!empty($response)){
+ return $response;
+ }
+ }*/
+ }
+ })
+ ->debug(true)
+ ->process( $_POST )
+ ->data();
+
+ $newTokenHash = csrf_hash();
+ $csrfTokenName = csrf_token();
+
+ $response[$csrfTokenName] = $newTokenHash;
+
+ echo json_encode($response);
+
+ } else {
+ return $this->failUnauthorized('Invalid request', 403);
+ }
+ }
+
+
+
+}
diff --git a/ci4/app/Controllers/Presupuestos/PresupuestoEncuadernaciones.php b/ci4/app/Controllers/Presupuestos/PresupuestoEncuadernaciones.php
new file mode 100644
index 00000000..c7a7687c
--- /dev/null
+++ b/ci4/app/Controllers/Presupuestos/PresupuestoEncuadernaciones.php
@@ -0,0 +1,119 @@
+request->isAJAX()) {
+ $reqData = $this->request->getPost();
+ if (!isset($reqData['draw']) || !isset($reqData['columns'])) {
+ $errstr = 'No data available in response to this specific request.';
+ $response = $this->respond(Collection::datatable([], 0, 0, $errstr), 400, $errstr);
+ return $response;
+ }
+ $start = $reqData['start'] ?? 0;
+ $length = $reqData['length'] ?? 5;
+ $requestedOrder = $reqData['order']['0']['column'] ?? 1;
+ $order = PresupuestoEncuadernacionesModel::SORTABLE[$requestedOrder >= 0 ? $requestedOrder : 1];
+ $dir = $reqData['order']['0']['dir'] ?? 'asc';
+
+ $id_P = $reqData['id_presupuesto'] ?? -1;
+
+ $resourceData = $this->model->getResource($id_P)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
+
+ return $this->respond(Collection::datatable(
+ $resourceData,
+ $this->model->getResource()->countAllResults(),
+ $this->model->getResource($id_P)->countAllResults()
+ ));
+ } else {
+ return $this->failUnauthorized('Invalid request', 403);
+ }
+ }
+
+ public function datatable_editor() {
+ if ($this->request->isAJAX()) {
+
+ include(APPPATH . "ThirdParty/DatatablesEditor/DataTables.php");
+
+ // Build our Editor instance and process the data coming from _POST
+ $response = Editor::inst( $db, 'presupuesto_acabados' )
+ ->fields(
+ Field::inst( 'tarifa_encuadernado_id' )
+ ->validator( 'Validate::notEmpty',array(
+ 'message' => 'Selecciones servicios de acabado' )
+ ),
+ Field::inst( 'precio_unidad' )
+ ->validator( 'Validate::notEmpty',array(
+ 'message' => 'Falta precio unitario' )
+ ),
+ Field::inst( 'precio_total' )
+ ->validator( 'Validate::notEmpty',array(
+ 'message' => 'Falta precio total' )
+ ),
+
+ Field::inst( 'presupuesto_id' ),
+
+ )
+ ->validator( function($editor, $action, $data){
+ if ($action === Editor::ACTION_CREATE || $action === Editor::ACTION_EDIT){
+ //return $response;
+ /*foreach ($data['data'] as $pkey => $values ){
+ // No se pueden duplicar valores al crear o al editar
+ if (!empty($response)){
+ return $response;
+ }
+ }*/
+ }
+ })
+ ->debug(true)
+ ->process( $_POST )
+ ->data();
+
+ $newTokenHash = csrf_hash();
+ $csrfTokenName = csrf_token();
+
+ $response[$csrfTokenName] = $newTokenHash;
+
+ echo json_encode($response);
+
+ } else {
+ return $this->failUnauthorized('Invalid request', 403);
+ }
+ }
+
+
+
+}
diff --git a/ci4/app/Controllers/Presupuestos/PresupuestoManipulados.php b/ci4/app/Controllers/Presupuestos/PresupuestoManipulados.php
new file mode 100644
index 00000000..4dcfed56
--- /dev/null
+++ b/ci4/app/Controllers/Presupuestos/PresupuestoManipulados.php
@@ -0,0 +1,123 @@
+request->isAJAX()) {
+ $reqData = $this->request->getPost();
+ if (!isset($reqData['draw']) || !isset($reqData['columns'])) {
+ $errstr = 'No data available in response to this specific request.';
+ $response = $this->respond(Collection::datatable([], 0, 0, $errstr), 400, $errstr);
+ return $response;
+ }
+ $start = $reqData['start'] ?? 0;
+ $length = $reqData['length'] ?? 5;
+ $requestedOrder = $reqData['order']['0']['column'] ?? 1;
+ $order = PresupuestoManipuladosModel::SORTABLE[$requestedOrder >= 0 ? $requestedOrder : 1];
+ $dir = $reqData['order']['0']['dir'] ?? 'asc';
+
+ $id_P = $reqData['id_presupuesto'] ?? -1;
+
+ $resourceData = $this->model->getResource($id_P)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
+
+ return $this->respond(Collection::datatable(
+ $resourceData,
+ $this->model->getResource()->countAllResults(),
+ $this->model->getResource($id_P)->countAllResults()
+ ));
+ } else {
+ return $this->failUnauthorized('Invalid request', 403);
+ }
+ }
+
+ public function datatable_editor() {
+ if ($this->request->isAJAX()) {
+
+ include(APPPATH . "ThirdParty/DatatablesEditor/DataTables.php");
+
+ // Build our Editor instance and process the data coming from _POST
+ $response = Editor::inst( $db, 'presupuesto_manipulados' )
+ ->fields(
+ Field::inst( 'tarifa_manipulado_id' )
+ ->validator( 'Validate::notEmpty',array(
+ 'message' => 'Selecciones servicios de acabado' )
+ ),
+ Field::inst( 'precio_unidad' )
+ ->validator( 'Validate::notEmpty',array(
+ 'message' => 'Falta precio unitario' )
+ ),
+ Field::inst( 'precio_total' )
+ ->validator( 'Validate::notEmpty',array(
+ 'message' => 'Falta precio total' )
+ ),
+
+ Field::inst( 'presupuesto_id' ),
+
+ )
+ ->validator( function($editor, $action, $data){
+ if ($action === Editor::ACTION_CREATE || $action === Editor::ACTION_EDIT){
+ //return $response;
+ /*foreach ($data['data'] as $pkey => $values ){
+ // No se pueden duplicar valores al crear o al editar
+ if (!empty($response)){
+ return $response;
+ }
+ }*/
+ }
+ })
+ ->debug(true)
+ ->process( $_POST )
+ ->data();
+
+ $newTokenHash = csrf_hash();
+ $csrfTokenName = csrf_token();
+
+ $response[$csrfTokenName] = $newTokenHash;
+
+ echo json_encode($response);
+
+ } else {
+ return $this->failUnauthorized('Invalid request', 403);
+ }
+ }
+
+
+
+}
diff --git a/ci4/app/Controllers/Presupuestos/PresupuestoPreimpresiones.php b/ci4/app/Controllers/Presupuestos/PresupuestoPreimpresiones.php
new file mode 100644
index 00000000..dfd9a7f3
--- /dev/null
+++ b/ci4/app/Controllers/Presupuestos/PresupuestoPreimpresiones.php
@@ -0,0 +1,117 @@
+request->isAJAX()) {
+ $reqData = $this->request->getPost();
+ if (!isset($reqData['draw']) || !isset($reqData['columns'])) {
+ $errstr = 'No data available in response to this specific request.';
+ $response = $this->respond(Collection::datatable([], 0, 0, $errstr), 400, $errstr);
+ return $response;
+ }
+ $start = $reqData['start'] ?? 0;
+ $length = $reqData['length'] ?? 5;
+ $requestedOrder = $reqData['order']['0']['column'] ?? 1;
+ $order = PresupuestoPreimpresionesModel::SORTABLE[$requestedOrder >= 0 ? $requestedOrder : 1];
+ $dir = $reqData['order']['0']['dir'] ?? 'asc';
+
+ $id_P = $reqData['id_presupuesto'] ?? -1;
+
+ $resourceData = $this->model->getResource($id_P)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
+
+ return $this->respond(Collection::datatable(
+ $resourceData,
+ $this->model->getResource()->countAllResults(),
+ $this->model->getResource($id_P)->countAllResults()
+ ));
+ } else {
+ return $this->failUnauthorized('Invalid request', 403);
+ }
+ }
+
+ public function datatable_editor() {
+ if ($this->request->isAJAX()) {
+
+ include(APPPATH . "ThirdParty/DatatablesEditor/DataTables.php");
+
+ // Build our Editor instance and process the data coming from _POST
+ $response = Editor::inst( $db, 'presupuesto_preimpresiones' )
+ ->fields(
+ Field::inst( 'tarifa_preimpresion_id' )
+ ->validator( 'Validate::notEmpty',array(
+ 'message' => 'Selecciones servicios de acabado' )
+ ),
+ Field::inst( 'precio_unidad' )
+ ->validator( 'Validate::notEmpty',array(
+ 'message' => 'Falta precio unitario' )
+ ),
+ Field::inst( 'precio_total' )
+ ->validator( 'Validate::notEmpty',array(
+ 'message' => 'Falta precio total' )
+ ),
+
+ Field::inst( 'presupuesto_id' ),
+
+ )
+ ->validator( function($editor, $action, $data){
+ if ($action === Editor::ACTION_CREATE || $action === Editor::ACTION_EDIT){
+ //return $response;
+ /*foreach ($data['data'] as $pkey => $values ){
+ // No se pueden duplicar valores al crear o al editar
+ if (!empty($response)){
+ return $response;
+ }
+ }*/
+ }
+ })
+ ->debug(true)
+ ->process( $_POST )
+ ->data();
+
+ $newTokenHash = csrf_hash();
+ $csrfTokenName = csrf_token();
+
+ $response[$csrfTokenName] = $newTokenHash;
+
+ echo json_encode($response);
+
+ } else {
+ return $this->failUnauthorized('Invalid request', 403);
+ }
+ }
+
+
+
+}
diff --git a/ci4/app/Controllers/Tarifas/Tarifaencuadernacionlineas.php b/ci4/app/Controllers/Tarifas/Tarifaencuadernacionlineas.php
index 33e35632..416776b0 100644
--- a/ci4/app/Controllers/Tarifas/Tarifaencuadernacionlineas.php
+++ b/ci4/app/Controllers/Tarifas/Tarifaencuadernacionlineas.php
@@ -215,19 +215,19 @@ class Tarifaencuadernacionlineas extends \App\Controllers\GoBaseResourceControll
// Build our Editor instance and process the data coming from _POST
$response = Editor::inst($db, 'tarifa_encuadernacion_lineas')
->fields(
- Field::inst('paginas_min')
+ Field::inst('paginas_libro_min')
->validator('Validate::numeric', array(
- 'message' => lang('TarifaAcabadoLineas.validation.paginas_min.decimal'))
+ 'message' => lang('TarifaAcabadoLineas.validation.paginas_libro_min.decimal'))
)
->validator('Validate::notEmpty', array(
- 'message' => lang('TarifaAcabadoLineas.validation.paginas_min.required'))
+ 'message' => lang('TarifaAcabadoLineas.validation.paginas_libro_min.required'))
),
- Field::inst('paginas_max')
+ Field::inst('paginas_libro_max')
->validator('Validate::numeric', array(
- 'message' => lang('TarifaAcabadoLineas.validation.paginas_max.decimal'))
+ 'message' => lang('TarifaAcabadoLineas.validation.paginas_libro_max.decimal'))
)
->validator('Validate::notEmpty', array(
- 'message' => lang('TarifaAcabadoLineas.validation.paginas_max.required'))
+ 'message' => lang('TarifaAcabadoLineas.validation.paginas_libro_max.required'))
),
Field::inst('precio_min')
->validator('Validate::numeric', array(
@@ -264,8 +264,8 @@ class Tarifaencuadernacionlineas extends \App\Controllers\GoBaseResourceControll
foreach ($data['data'] as $pkey => $values) {
// Si no se quiere borrar...
if ($data['data'][$pkey]['is_deleted'] != 1) {
- $process_data['paginas_min'] = $data['data'][$pkey]['paginas_min'];
- $process_data['paginas_max'] = $data['data'][$pkey]['paginas_max'];
+ $process_data['paginas_libro_min'] = $data['data'][$pkey]['paginas_libro_min'];
+ $process_data['paginas_libro_max'] = $data['data'][$pkey]['paginas_libro_max'];
$response = $this->model->checkIntervals($process_data, $pkey, $data['data'][$pkey]['tirada_encuadernacion_id']);
// No se pueden duplicar valores al crear o al editar
if (!empty($response)) {
diff --git a/ci4/app/Controllers/Tarifas/Tarifaenvio.php b/ci4/app/Controllers/Tarifas/Tarifaenvio.php
deleted file mode 100644
index 8d0c0046..00000000
--- a/ci4/app/Controllers/Tarifas/Tarifaenvio.php
+++ /dev/null
@@ -1,35 +0,0 @@
-testLineasIntPlana();
+ }
+
+ public function getPapelesHQ(){
+ $model = model('App\Models\Configuracion\PapelGenericoModel');
+ $data = $model->getPapelForComparador('colorhq', false, false);
+
+ var_dump($data);
+ }
+
+ public function getGramaje(){
+ $model = new PapelGenericoModel();
+ $data = $model->getGramajeComparador("AHUESADO OFFSET", "bnhq" );
+
+ var_dump($data);
+ }
+
+ public function testGetPrecioPliegoRotativa()
+ {
+ $paginas=240;
+
+ $papel_impresion = (object)array(
+ 'id' => 198,
+ 'gramaje' => 90,
+ 'precio_tonelada'=> 1600
+ );
+
+
+ $maquina = (object)array(
+ //'id' => 48,
+ 'alto' => 800,
+ 'ancho' => 520,
+ );
+
+ $precio = PresupuestoService::getPrecioPliego($maquina, $papel_impresion, $paginas);
+
+ var_dump($precio);
+
+ }
+
+ public function testGetMaquinasFromTarifas()
+ {
+ $maquinamodel = new MaquinaModel();
+
+ //$tarifa_tipo = ['negro', 'color'];
+ //$tarifa_tipo = 'color';
+ $tarifa_tipo = 'negro';
+ $papel_impresion_id = 5;
+ $maquina = $maquinamodel->getMaquinaImpresionForPresupuesto(1, $tarifa_tipo, 100, $papel_impresion_id);
echo '
';
- $resourceData = $model->getResource("", 113)->get()->getResultObject();
- var_dump($resourceData);
+ var_dump($maquina);
echo '';
}
+
+ public static function testLineasIntPlana()
+ {
+ $uso = 'interior';
+ $tipo = 'colorhq';
+ $datosPedido = (object)array(
+ 'paginas' => 200,
+ 'tirada' => 500,
+ 'merma' => 10,
+ 'merma_portada' => 10,
+ 'ancho' => 165,
+ 'alto' => 148,
+ 'isCosido' => true,
+ );
+
+ $maquina_model = new \App\Models\Configuracion\MaquinaModel();
+
+ $opciones_papel = array(
+ 'color' => 1,
+ 'cubierta' => 0,
+ 'sobrecubierta' => 0,
+ 'rotativa' => 0,
+ );
+ $papelimpresionmodel = new \App\Models\Configuracion\PapelImpresionModel();
+ $papeles = $papelimpresionmodel->getIdPapelesImpresionForPresupuesto(
+ papel_generico_id: 4,
+ gramaje: 90,
+ options: $opciones_papel
+ );
+ foreach ($papeles as $papel) {
+ echo '-------------------------------';
+ $maquinas = $maquina_model->getMaquinaImpresionForPresupuesto(
+ is_rotativa: $papel->rotativa,
+ tarifa_tipo: 'colorhq',
+ tirada: $datosPedido->tirada + $datosPedido->merma,
+ papel_impresion_id: $papel->id,
+ );
+
+ foreach ($maquinas as $maquina) {
+
+ echo '----------------------------
';
+ var_dump($maquina->maquina);
+ var_dump($papel->nombre);
+ $tarifa = (new \App\Models\Configuracion\MaquinasTarifasImpresionModel())->getTarifa($maquina->maquina_id, $uso, $tipo);
+ $linea = PresupuestoService::getCostesLinea($uso, $datosPedido, $maquina, $papel, $opciones_papel, $tarifa);
+ echo '';
+ var_dump($linea);
+ echo '
';
+ }
+ }
+ }
+
+
+ public static function testLineasIntPlanaCubierta()
+ {
+ echo '';
+ $uso = 'cubierta';
+ $tipo = 'color';
+ $datosPedido = (object)array(
+ 'paginas' => 200,
+ 'tirada' => 500,
+ 'merma' => 10,
+ 'merma_portada' => 10,
+ 'ancho' => 165,
+ 'alto' => 148,
+ 'isCosido' => true,
+ 'solapas' => 0,
+ 'solapas_ancho' => 0,
+ );
+
+ $maquina_model = new \App\Models\Configuracion\MaquinaModel();
+
+ $opciones_papel = array(
+ 'color' => 1,
+ 'cubierta' => 1,
+ 'sobrecubierta' => 0,
+ 'rotativa' => 0,
+ );
+ $papelimpresionmodel = new \App\Models\Configuracion\PapelImpresionModel();
+ $papeles = $papelimpresionmodel->getIdPapelesImpresionForPresupuesto(
+ papel_generico_id: 3,
+ gramaje: 100,
+ options: $opciones_papel
+ );
+ foreach ($papeles as $papel) {
+ echo '-------------------------------';
+ var_dump($papel);
+ $maquinas = $maquina_model->getMaquinaImpresionForPresupuesto(
+ is_rotativa: $papel->rotativa,
+ tarifa_tipo: 'color',
+ tirada: $datosPedido->tirada + $datosPedido->merma_portada,
+ papel_impresion_id: $papel->id,
+ );
+
+ foreach ($maquinas as $maquina) {
+
+ echo '----------------------------
';
+ var_dump($maquina->maquina);
+ var_dump($papel->nombre);
+ $tarifa = (new \App\Models\Configuracion\MaquinasTarifasImpresionModel())->getTarifa($maquina->maquina_id, $uso, $tipo);
+ $linea = PresupuestoService::getCostesLinea($uso, $datosPedido, $maquina, $papel, $opciones_papel, $tarifa);
+
+ var_dump($linea);
+
+ }
+ }
+ echo '';
+ }
+
+
+
+ public static function testLineasIntRotativa()
+ {
+
+ $uso = 'interior';
+ $tipo = 'negro';
+
+
+
+ $datosPedido = (object)array(
+ 'paginas' => 240,
+ 'tirada' => 100,
+ 'merma' => 10,
+ 'merma_portada' => 10,
+ 'ancho' => 150,
+ 'alto' => 210,
+ 'isCosido' => true,
+ );
+
+ $parametrosRotativa = (object)array(
+ 'a_favor_fibra' => 0,
+ 'bnPages' => 240,
+ 'colorPages' => 0,
+ 'rotativa_gota_negro' => 0,
+ 'rotativa_gota_color' => 0,
+ );
+
+ $maquina_model = new \App\Models\Configuracion\MaquinaModel();
+
+ $opciones_papel = array(
+ 'bn' => 1,
+ 'cubierta' => 0,
+ 'sobrecubierta' => 0,
+ 'rotativa' => 1,
+ );
+ $papelimpresionmodel = new \App\Models\Configuracion\PapelImpresionModel();
+ $papeles = $papelimpresionmodel->getIdPapelesImpresionForPresupuesto(
+ papel_generico_id: 4,
+ gramaje: 90,
+ options: $opciones_papel
+ );
+
+
+ foreach ($papeles as $papel) {
+
+ $papelImpresionTipologiaModel = new \App\Models\Configuracion\PapelImpresionTipologiaModel();
+ $datosTipologias = $papelImpresionTipologiaModel
+ ->findTipologiasForPapelImpresion($papel->id, $parametrosRotativa->colorPages>0?'color':'negro')
+ ->get()->getResultObject();
+ echo '';
+ var_dump($papel->id);
+ var_dump($datosTipologias);
+ echo '
';
+ $parametrosRotativa->rotativa_gota_negro = $datosTipologias[0]->gota_negro;
+ $parametrosRotativa->rotativa_gota_color = $datosTipologias[0]->gota_color;
+ $parametrosRotativa->rotativa_negro = $datosTipologias[0]->negro;
+ $parametrosRotativa->rotativa_cyan = $datosTipologias[0]->cyan;
+ $parametrosRotativa->rotativa_magenta = $datosTipologias[0]->magenta;
+ $parametrosRotativa->rotativa_amarillo = $datosTipologias[0]->amarillo;
+
+ echo '-------------------------------';
+ $maquinas = $maquina_model->getMaquinaImpresionForPresupuesto(
+ is_rotativa: $papel->rotativa,
+ tarifa_tipo: 'negro',
+ tirada: $datosPedido->tirada + $datosPedido->merma,
+ papel_impresion_id: $papel->id,
+ );
+
+
+
+ foreach ($maquinas as $maquina) {
+
+ echo '----------------------------
';
+ var_dump($maquina->maquina);
+ var_dump($papel->nombre);
+
+ //$linea = PresupuestoService::getCostesLineaRotativa($maquina, $datosPedido, $parametrosRotativa);
+ echo '';
+ var_dump($linea);
+ echo '
';
+ }
+ }
+ }
+
+ public static function testLineasCubierta()
+ {
+ $uso = 'cubierta';
+ $tipo = 'color';
+
+ $datosPedido = (object)array(
+ 'paginas' => 240,
+ 'tirada' => 100,
+ 'merma' => 10,
+ 'merma_portada' => 10,
+ 'ancho' => 150,
+ 'alto' => 210,
+ 'isCosido' => true,
+ 'solapas' => false,
+ );
+
+ $opciones_papel = array(
+ 'color' => 1,
+ 'cubierta' => 1,
+ );
+
+
+ // Se obtienen los papeles disponibles
+ $papelimpresionmodel = new \App\Models\Configuracion\PapelImpresionModel();
+ $papeles = $papelimpresionmodel->getIdPapelesImpresionForPresupuesto(
+ papel_generico_id: 3, // Blanco offset
+ gramaje: 100,
+ options: $opciones_papel
+ );
+
+ echo '';
+ var_dump($papeles);
+ echo '
';
+
+ $lineas = array();
+ // Para cada papel, se obtienen las maquinas disponibles
+ foreach ($papeles as $papel) {
+
+ $maquinamodel = new \App\Models\Configuracion\MaquinaModel();
+ $maquinas = $maquinamodel->getMaquinaImpresionForPresupuesto(
+ is_rotativa: 0,
+ tarifa_tipo: $tipo,
+ tirada: $datosPedido->tirada + $datosPedido->merma,
+ papel_impresion_id: $papel->id,
+ );
+
+ echo '';
+ echo '-------------------------------';
+ echo '
';
+
+ echo '';
+ var_dump($maquinas);
+ echo '
';
+
+ // Se recorren las máquinas y se calcula el coste de linea por cada una
+ foreach ($maquinas as $maquina) {
+
+ echo '';
+ echo '$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$';
+ echo '
';
+
+ $tarifamodel = new \App\Models\Configuracion\MaquinasTarifasImpresionModel();
+ $tarifa = $tarifamodel->getTarifa($maquina->maquina_id, $uso, $tipo);
+
+ echo '';
+ var_dump($tarifa);
+ echo '
';
+
+ if(!is_float($tarifa)){
+ continue;
+ }
+ $linea = PresupuestoService::getCostesLinea($uso, $datosPedido, $maquina, $papel, $opciones_papel, $tarifa);
+ $linea['fields']['maquina'] = $maquina->maquina;
+ $linea['fields']['maquina_id'] = $maquina->maquina_id;
+ $linea['fields']['papel_impresion'] = $papel->nombre;
+ $linea['fields']['papel_impresion_id'] = $papel->id;
+ $linea['fields']['paginas'] = $datosPedido->paginas;
+ $linea['fields']['gramaje'] = 100;
+ $linea['fields']['papel_generico_id'] = 3;
+ $linea['fields']['papel_generico'] = 'Blanco offset';
+
+ array_push($lineas, $linea);
+ }
+ }
+
+ echo '';
+ var_dump($lineas);
+ echo '
';
+
+
+ }
}
\ No newline at end of file
diff --git a/ci4/app/Entities/Configuracion/FormasPagoEntity.php b/ci4/app/Entities/Configuracion/FormasPagoEntity.php
deleted file mode 100644
index d29181c6..00000000
--- a/ci4/app/Entities/Configuracion/FormasPagoEntity.php
+++ /dev/null
@@ -1,15 +0,0 @@
- null,
- "nombre" => null,
- "created_at" => null,
- "updated_at" => null,
- ];
- protected $casts = [];
-}
diff --git a/ci4/app/Entities/Configuracion/Maquina.php b/ci4/app/Entities/Configuracion/Maquina.php
index c88ba673..97b3674a 100644
--- a/ci4/app/Entities/Configuracion/Maquina.php
+++ b/ci4/app/Entities/Configuracion/Maquina.php
@@ -28,8 +28,8 @@ class Maquina extends \CodeIgniter\Entity\Entity
"velocidad_corte" => 0.0,
"precio_hora_corte" => 0.0,
"metrosxminuto" => 0.0,
- "forzar_num_formas_horizontales_portada" => null,
- "forzar_num_formas_verticales_portada" => null,
+ "forzar_num_formas_horizontales_cubierta" => null,
+ "forzar_num_formas_verticales_cubierta" => null,
"observaciones" => "",
"is_deleted" => 0,
"created_at" => null,
@@ -56,8 +56,8 @@ class Maquina extends \CodeIgniter\Entity\Entity
"precio_tinta_color" => "float",
"velocidad_corte" => "float",
"precio_hora_corte" => "float",
- "forzar_num_formas_horizontales_portada" => "?int",
- "forzar_num_formas_verticales_portada" => "?int",
+ "forzar_num_formas_horizontales_cubierta" => "?int",
+ "forzar_num_formas_verticales_cubierta" => "?int",
"is_deleted" => "int",
"user_created_id" => "int",
"user_updated_id" => "int",
diff --git a/ci4/app/Entities/Configuracion/MaquinasCallesEntity.php b/ci4/app/Entities/Configuracion/MaquinasCallesEntity.php
index 5bca1d7c..57f17c59 100644
--- a/ci4/app/Entities/Configuracion/MaquinasCallesEntity.php
+++ b/ci4/app/Entities/Configuracion/MaquinasCallesEntity.php
@@ -8,8 +8,7 @@ class MaquinasCallesEntity extends \CodeIgniter\Entity\Entity
protected $attributes = [
"id" => null,
"maquina_id" => null,
- "formas_min" => null,
- "formas_max" => null,
+ "formas" => null,
"internas" => 3.32,
"externas" => 1.66,
"user_created_id" => 0,
@@ -20,8 +19,7 @@ class MaquinasCallesEntity extends \CodeIgniter\Entity\Entity
];
protected $casts = [
"maquina_id" => "int",
- "formas_min" => "int",
- "formas_max" => "int",
+ "formas" => "int",
"internas" => "float",
"externas" => "float",
"user_created_id" => "int",
diff --git a/ci4/app/Entities/Presupuestos/PresupuestoAcabadosEntity.php b/ci4/app/Entities/Presupuestos/PresupuestoAcabadosEntity.php
new file mode 100644
index 00000000..8a4bf9ed
--- /dev/null
+++ b/ci4/app/Entities/Presupuestos/PresupuestoAcabadosEntity.php
@@ -0,0 +1,23 @@
+ null,
+ "presupuesto_id" => null,
+ "tarifa_acabado_id" => null,
+ "precio_unidad" => null,
+ "precio_total" => null,
+ "created_at" => null,
+ "updated_at" => null,
+ ];
+ protected $casts = [
+ "presupuesto_id" => "int",
+ "tarifa_acabado_id" => "int",
+ "precio_unidad" => "float",
+ "precio_total" => "float",
+ ];
+}
diff --git a/ci4/app/Entities/Presupuestos/PresupuestoEncuadernacionesEntity.php b/ci4/app/Entities/Presupuestos/PresupuestoEncuadernacionesEntity.php
new file mode 100644
index 00000000..e1ce106d
--- /dev/null
+++ b/ci4/app/Entities/Presupuestos/PresupuestoEncuadernacionesEntity.php
@@ -0,0 +1,23 @@
+ null,
+ "presupuesto_id" => null,
+ "tarifa_encuadernado_id" => null,
+ "precio_unidad" => null,
+ "precio_total" => null,
+ "created_at" => null,
+ "updated_at" => null,
+ ];
+ protected $casts = [
+ "presupuesto_id" => "int",
+ "tarifa_encuadernado_id" => "int",
+ "precio_unidad" => "float",
+ "precio_total" => "float",
+ ];
+}
diff --git a/ci4/app/Entities/Presupuestos/PresupuestoEntity.php b/ci4/app/Entities/Presupuestos/PresupuestoEntity.php
index c5b91ca7..bbe09e43 100644
--- a/ci4/app/Entities/Presupuestos/PresupuestoEntity.php
+++ b/ci4/app/Entities/Presupuestos/PresupuestoEntity.php
@@ -50,10 +50,11 @@ class PresupuestoEntity extends \CodeIgniter\Entity\Entity
"merma" => null,
"merma_portada" => 6.0,
"imagenes_bn_interior" => false,
- "comentarios" => null,
+ "comentarios_cliente" => null,
"comentarios_safekat" => null,
"comentarios_pdf" => null,
"comentarios_tarifa" => null,
+ "comentarios_produccion" => null,
"en_produccion" => false,
"en_espera" => false,
"modo_comparador" => false,
diff --git a/ci4/app/Entities/Presupuestos/PresupuestoManipuladosEntity.php b/ci4/app/Entities/Presupuestos/PresupuestoManipuladosEntity.php
new file mode 100644
index 00000000..8b2830c7
--- /dev/null
+++ b/ci4/app/Entities/Presupuestos/PresupuestoManipuladosEntity.php
@@ -0,0 +1,23 @@
+ null,
+ "presupuesto_id" => null,
+ "tarifa_manipulado_id" => null,
+ "precio_unidad" => null,
+ "precio_total" => null,
+ "created_at" => null,
+ "updated_at" => null,
+ ];
+ protected $casts = [
+ "presupuesto_id" => "int",
+ "tarifa_manipulado_id" => "int",
+ "precio_unidad" => "float",
+ "precio_total" => "float",
+ ];
+}
diff --git a/ci4/app/Entities/Presupuestos/PresupuestoPreimpresionesEntity.php b/ci4/app/Entities/Presupuestos/PresupuestoPreimpresionesEntity.php
new file mode 100644
index 00000000..8a56a8fc
--- /dev/null
+++ b/ci4/app/Entities/Presupuestos/PresupuestoPreimpresionesEntity.php
@@ -0,0 +1,23 @@
+ null,
+ "presupuesto_id" => null,
+ "tarifa_preimpresion_id" => null,
+ "precio_unidad" => null,
+ "precio_total" => null,
+ "created_at" => null,
+ "updated_at" => null,
+ ];
+ protected $casts = [
+ "presupuesto_id" => "int",
+ "tarifa_preimpresion_id" => "int",
+ "precio_unidad" => "float",
+ "precio_total" => "float",
+ ];
+}
diff --git a/ci4/app/Entities/Tarifas/TarifaEncuadernacionLinea.php b/ci4/app/Entities/Tarifas/TarifaEncuadernacionLinea.php
index cef07060..be10cf9c 100644
--- a/ci4/app/Entities/Tarifas/TarifaEncuadernacionLinea.php
+++ b/ci4/app/Entities/Tarifas/TarifaEncuadernacionLinea.php
@@ -8,10 +8,13 @@ class TarifaEncuadernacionLinea extends \CodeIgniter\Entity\Entity
protected $attributes = [
"id" => null,
"tirada_encuadernacion_id" => 0,
- "paginas_min" => 0,
- "paginas_max" => 0,
+ "paginas_libro_min" => 0,
+ "paginas_libro_max" => 0,
+ "dimensiones_id" => 0,
"precio_min" => 0,
"precio_max" => 0,
+ "tirada_min" => 0,
+ "tirada_max" => 0,
"margen" => 0,
"user_created_id" => 0,
"user_updated_id" => 0,
@@ -21,10 +24,13 @@ class TarifaEncuadernacionLinea extends \CodeIgniter\Entity\Entity
];
protected $casts = [
"tirada_encuadernacion_id" => "int",
- "paginas_min" => "float",
- "paginas_max" => "float",
+ "dimensiones_id" => "int",
+ "paginas_libro_min" => "float",
+ "paginas_libro_max" => "float",
"precio_min" => "float",
"precio_max" => "float",
+ "tirada_min" => "float",
+ "tirada_max" => "float",
"margen" => "float",
"user_created_id" => "int",
"user_updated_id" => "int",
diff --git a/ci4/app/Language/en/Basic.php b/ci4/app/Language/en/Basic.php
index 9162821a..5e06aaf9 100644
--- a/ci4/app/Language/en/Basic.php
+++ b/ci4/app/Language/en/Basic.php
@@ -12,6 +12,8 @@ return [
'Close' => 'Close',
'Dashboard' => 'Dashboard',
'Delete' => 'Delete',
+ 'Clone' => 'Clone',
+ 'Print' => 'Print',
'Error' => 'Error',
'Groups' => 'Groups',
'Home' => 'Home',
diff --git a/ci4/app/Language/en/Maquinas.php b/ci4/app/Language/en/Maquinas.php
index 443c0bdd..5445dfdf 100644
--- a/ci4/app/Language/en/Maquinas.php
+++ b/ci4/app/Language/en/Maquinas.php
@@ -54,12 +54,12 @@ return [
'greater_than' => 'The field {field} must be greater than {param}',
],
- 'forzar_num_formas_horizontales_portada' => [
+ 'forzar_num_formas_horizontales_cubierta' => [
'integer' => 'The {field} field must contain an integer.',
],
- 'forzar_num_formas_verticales_portada' => [
+ 'forzar_num_formas_verticales_cubierta' => [
'integer' => 'The {field} field must contain an integer.',
],
diff --git a/ci4/app/Language/en/MaquinasCalles.php b/ci4/app/Language/en/MaquinasCalles.php
index 743baada..704e28f4 100644
--- a/ci4/app/Language/en/MaquinasCalles.php
+++ b/ci4/app/Language/en/MaquinasCalles.php
@@ -6,20 +6,12 @@ return [
'id' => 'ID',
'moduleTitle' => 'Streets config',
'deleteLine' => 'the selected register',
- 'formas_min' => 'Shapes mín.',
- 'formas_max' => 'Shapes max.',
+ 'formas' => 'Shapes',
'internas' => 'Internal streets',
'externas' => 'External streets',
'validation' => [
- 'error_calle_overlap' => 'The range [Shapes mín, Shapes max] is overlapped with another one.',
- 'error_calle_range' => 'The field Shapes min. must be lower than the field Shapes max.',
- 'formas_min' => [
- 'integer' => 'Must be a integer number.',
- 'required' => 'Required.',
-
- ],
-
- 'formas_max' => [
+ 'error_formas_exists' => 'The shape value for another line already exists',
+ 'formas' => [
'integer' => 'Must be a integer number.',
'required' => 'Required.',
diff --git a/ci4/app/Language/en/Presupuestos.php b/ci4/app/Language/en/Presupuestos.php
index a5ae9bb9..dc64feb9 100644
--- a/ci4/app/Language/en/Presupuestos.php
+++ b/ci4/app/Language/en/Presupuestos.php
@@ -10,6 +10,7 @@ return [
'datosPresupuesto' => 'Budget information',
'datosLibro' => 'Book information',
+ 'datosServicios' => 'Other Services',
'datosPresupuestoCliente' => 'Client budget data (comparator)',
'id' => 'Budget Number',
@@ -45,7 +46,7 @@ return [
'recogerEnTaller' => 'Pick up in workshop',
'marcapaginas' => 'Bookmark',
'merma' => 'Weakening',
- 'mermaportada' => 'Cover weakening',
+ 'mermacubierta' => 'Cover weakening',
'tipoImpresion' => 'Printing type',
'papelesComparadorCosidoTapaBlanda' => 'Interior and cover papers',
'posicionPagColor' => 'Color pages position',
@@ -58,6 +59,27 @@ return [
'retractilado5' => 'Shrink-wrapping in packs of 5',
'Guardas' => 'Endpapers',
'fajaColor' => 'Print color band ',
+ 'compInteriorPlana' => 'Interior in flat machine',
+ 'compInteriorRotativa' => 'Interior in rotary',
+ 'compCubiertaSobrecubierta' => 'Cover and dust jacket',
+ 'tipo' => 'Type',
+ 'marca' => 'Brand',
+ 'maquina' => 'Machine',
+ 'numeroPliegos' => 'Sheets No.',
+ 'pliegosPedido' => 'Sheets order',
+ 'precioPliego' => 'Sheets price',
+ 'libro' => 'Book',
+ 'totalPapelPedido' => 'Total paper order',
+ 'lomo' => 'Spine',
+ 'peso' => 'Weight',
+ 'click' => 'Click',
+ 'totalClicks' => 'Total clicks',
+ 'precioPagNegro' => 'Pages black price',
+ 'precioPagColor' => 'Pages color price',
+ 'totalTinta' => 'Total ink',
+ 'totalCorte' => 'Total cut',
+ 'total' => 'Total',
+ 'aFavorFibra' => 'In fiber direction',
'cubierta' => 'Cover',
'sobrecubierta' => 'Dust jacket',
'encuadernacion' => 'Binding',
@@ -65,6 +87,55 @@ return [
'solapasAnchoCubierta' => 'Cover dust jacket width',
'1cara' => '1 side',
'2caras' => '2 sides',
+ 'bn' => 'BW',
+ 'bnhq' => 'BWHQ',
+ 'color' => 'Colour',
+ 'colorhq' => 'ColourHQ',
+ 'rotativa' => 'Rotary',
+ 'si' => 'Yes',
+ 'no' => 'No',
+ 'insertarLinea' => 'Insert Line',
+ 'plana' => 'flat',
+ 'rotativa' => 'rotary',
+ 'lineasPresupuesto' => 'Budget Lines',
+ 'tiempo' => 'Time',
+
+ 'porDefecto' => 'Deafult',
+ 'tipoImpresion' => 'Print',
+ 'numPagColor' => 'No Color Pages',
+ 'saturacion' => 'Saturation',
+ 'cobNegro' => 'Cov. % Black',
+ 'cobCyan' => 'Cov. % Cyan',
+ 'cobMagenta' => 'Cov. % Magenta',
+ 'cobAmarillo' => 'Cov. % Yellow',
+ 'gotaNegro' => 'Black drop',
+ 'gotaColor' => 'Color drop',
+ 'totalLinea' => 'TOTAL LINE',
+ 'verCalculos' => 'Calculations',
+ 'metrosMinuto' => 'Meters x min.',
+ 'resolucion' => 'Resolution (dpi)',
+ 'areaPaginas' => 'Pages area (in)',
+ 'gotasNegro' => 'No black drops',
+ 'gotasCyan' => 'No color drops',
+ 'gotasMagenta' => 'No magenta drops',
+ 'gotasAmarillo' => 'No yellow drops',
+ 'precioPagNegro' => 'Price black pages',
+ 'precioPagColor' => 'Price color pages',
+ 'factorAltura' => 'Height factor',
+ 'factorAnchura' => 'Width factor',
+ 'paginasPliego' => 'Pages/sheet',
+ 'metrosPapelLibro' => 'M. Paper Book',
+ 'metrosPapelTotal' => 'M. Paper Total',
+ 'clicksLibro' => 'Clicks/Book',
+ 'gTintaNegro' => 'G. Black Ink',
+ 'gTintaCyan' => 'G. Cyan Ink',
+ 'gTintaMagenta' => 'G. Magenta Ink',
+ 'gTintaAmarillo' => 'G. Yellow Ink',
+ 'clicksPedido' => 'Clicks Order',
+ 'totalClicks' => 'Total Clicks',
+ 'totalTinta' => 'Total Ink',
+ 'totalCorte' => 'Total Cut',
+ 'totalImpresion' => 'TOTAL PRINT',
/* '4x0' => '4x0',
'4x4' => '4x4',
diff --git a/ci4/app/Language/es/App.php b/ci4/app/Language/es/App.php
index 1a9d22be..64450f72 100644
--- a/ci4/app/Language/es/App.php
+++ b/ci4/app/Language/es/App.php
@@ -745,7 +745,6 @@ return [
"menu_libros_fresasdo_tapa_blanda" => "Fresado tapa blanda",
"menu_libros_cosido_tapa_dura" => "Cosidos tapa dura",
"menu_libros_cosido_tapa_blanda" => "Cosidos tapa blanda",
- "menu_libros_cosido_tapa_blanda_solapas" => "Cosidos tapa blanda con solapas",
"menu_libros_grapados" => "Grapados",
"menu_libros_espiral_tapa_dura" => "Espiral tapa dura",
"menu_libros_espiral_tapa_blanda" => "Espiral tapa blanda",
diff --git a/ci4/app/Language/es/Basic.php b/ci4/app/Language/es/Basic.php
index 2c68ade2..2d385ad2 100644
--- a/ci4/app/Language/es/Basic.php
+++ b/ci4/app/Language/es/Basic.php
@@ -14,6 +14,8 @@ return [
'Clone' => 'Duplicar',
'Dashboard' => 'Panel de control',
'Delete' => 'Borrar',
+ 'Clone' => 'Duplicar',
+ 'Print' => 'Imprimir',
'Error' => 'Error',
'Groups' => 'Grupos',
'Home' => 'Inicio',
diff --git a/ci4/app/Language/es/Maquinas.php b/ci4/app/Language/es/Maquinas.php
index a58cfc6c..34c932e9 100644
--- a/ci4/app/Language/es/Maquinas.php
+++ b/ci4/app/Language/es/Maquinas.php
@@ -12,8 +12,8 @@ return [
'createdAt' => 'Created At',
'deletedAt' => 'Deleted At',
'duracionJornada' => 'Duracion Jornada',
- 'forzarNumFormasHorizontalesPortada' => 'Forzar Num Formas Horizontales Portada',
- 'forzarNumFormasVerticalesPortada' => 'Forzar Num Formas Verticales Portada',
+ 'forzarNumFormasHorizontalesPortada' => 'Forzar Num Formas Horizontales Cubierta',
+ 'forzarNumFormasVerticalesPortada' => 'Forzar Num Formas Verticales Cubierta',
'id' => 'ID',
'impresion' => 'impresion',
'isDeleted' => 'Is Deleted',
@@ -54,12 +54,12 @@ return [
'greater_than' => 'El campo {field} debe ser mayor que {param}',
],
- 'forzar_num_formas_horizontales_portada' => [
+ 'forzar_num_formas_horizontales_cubierta' => [
'integer' => 'El campo {field} debe contener un número entero.',
],
- 'forzar_num_formas_verticales_portada' => [
+ 'forzar_num_formas_verticales_cubierta' => [
'integer' => 'El campo {field} debe contener un número entero.',
],
diff --git a/ci4/app/Language/es/MaquinasCalles.php b/ci4/app/Language/es/MaquinasCalles.php
index dbb8c939..dbf93d8a 100644
--- a/ci4/app/Language/es/MaquinasCalles.php
+++ b/ci4/app/Language/es/MaquinasCalles.php
@@ -6,20 +6,12 @@ return [
'id' => 'ID',
'moduleTitle' => 'Configuración Calles',
'deleteLine' => 'el registro seleccionado',
- 'formas_min' => 'Formas mín.',
- 'formas_max' => 'Formas max.',
+ 'formas' => 'Formas',
'internas' => 'Calles internas',
'externas' => 'Calles externas',
'validation' => [
- 'error_calle_overlap' => 'El rango [Formas mín, Formas max] se solapa con otro existente para el tipo seleccionado.',
- 'error_calle_range' => 'El campo Formas mín. debe ser menor que el campo Formas max.',
- 'formas_min' => [
- 'integer' => 'Debe contener un número entero.',
- 'required' => 'Requerido.',
-
- ],
-
- 'formas_max' => [
+ 'error_formas_exists' => 'Ya existe el valor de forma para otra línea',
+ 'formas' => [
'integer' => 'Debe contener un número entero.',
'required' => 'Requerido.',
diff --git a/ci4/app/Language/es/Presupuestos.php b/ci4/app/Language/es/Presupuestos.php
index 30fffaec..f7fbe29a 100644
--- a/ci4/app/Language/es/Presupuestos.php
+++ b/ci4/app/Language/es/Presupuestos.php
@@ -1,75 +1,75 @@
'Presupuesto Libro Cosido Tapa Blanda',
+ 'moduleTitleCosidoTB' => 'Presupuesto Libro Cosido Tapa Blanda',
- 'presupuestoCosidotapablandaList' => 'Lista presupuestos Libros Cosido Tapa Blanda',
- 'presupuesto' => 'Presupuesto',
+ 'presupuestoCosidotapablandaList' => 'Lista presupuestos Libros Cosido Tapa Blanda',
+ 'presupuesto' => 'Presupuesto',
- 'datosPresupuesto' => 'Datos generales del presupuesto',
- 'datosLibro' => 'Datos del libro',
- 'datosPresupuestoCliente' => 'Datos presupuesto cliente (comparador)',
+ 'datosPresupuesto' => 'Datos generales del presupuesto',
+ 'datosLibro' => 'Datos del libro',
+ 'datosServicios' => 'Otros Servicios',
+ 'datosPresupuestoCliente' => 'Datos presupuesto cliente (comparador)',
- 'id' => 'Número Presupuesto',
- 'created_at' => 'Fecha',
- 'clienteId' => 'Cliente',
- 'comercial' => 'Comercial',
- 'titulo' => 'Título',
- 'paisId' => 'País',
- 'incRei' => 'Incidencia \ Reimpresión',
- 'paginas' => 'Paginas',
- 'tirada' => 'Tirada',
- 'totalPedido' => 'Total Presupuesto',
- 'presupuestoEstado' => 'Estado',
- 'presupuestoEstadoBorrador' => 'Borrador',
- 'presupuestoEstadoAceptado' => 'Aceptado',
- 'incidencia' => 'Incidencia',
- 'reimpresion' => 'Reimpresion',
- 'sinCargo' => 'Sin cargo',
- 'autor' => 'Autor',
- 'coleccion' => 'Colección',
- 'numeroEdicion' => 'Número de edición',
- 'isbn' => 'ISBN',
- 'referenciaCliente' => 'Referencia del cliente',
- 'papelFormatoId' => "Tamaño",
- 'papelFormatoPersonalizado' => 'Tamaño personalizado',
- 'papelFormatoAncho' => 'Ancho',
- 'papelFormatoAlto' => 'Alto',
- 'cosido' => 'Cosido',
- 'ferro' => 'Ferro',
- 'ferroDigital' => 'Ferro Digital',
- 'prototipo' => 'Prototipo',
- 'imagenesBnInterior' => 'Imágenes B/N interior',
- 'recogerEnTaller' => 'Recoger en taller',
- 'marcapaginas' => 'Marcapáginas',
- 'merma' => 'Merma',
- 'mermaportada' => 'Merma portada',
- 'tipoImpresion' => 'Tipo de impresión',
- 'papelesComparadorCosidoTapaBlanda' => 'Papeles interior y cubierta',
- 'posicionPagColor' => 'Posición páginas a color',
- 'colorPageInstructions' => 'Introduzca la posición de las páginas a color dentro del libro. Ej: 3,5,7 ó 4-10,20,155',
- 'numeroPaginas' => 'Nº Páginas',
- 'papel' => 'Papel',
- 'gramaje' => 'Gramaje',
- 'opcionesPresupuesto' => 'Opciones presupuesto',
- 'retractilado' => 'Retractilado individual',
- 'retractilado5' => 'Retractilado de 5',
- 'Guardas' => 'Guardas',
- 'fajaColor' => 'Imprimir faja a color',
- 'compInteriorPlana' => 'Interior en plana',
- 'compInteriorRotativa' => 'Interior en rotativa',
- 'compCubiertaSobrecubierta' => 'Cubierta y sobrecubierta',
- 'tipo' => 'Tipo',
- 'marca' => 'Marca',
- 'maquina' => 'Máquina',
- 'numeroPliegos' => 'Nº Pliegos',
- 'pliegosPedido' => 'Pliegos pedido',
- 'precioPliego' => 'Precio pliegos',
- 'libro' => 'Libro',
+ 'id' => 'Número Presupuesto',
+ 'created_at' => 'Fecha',
+ 'clienteId' => 'Cliente',
+ 'comercial' => 'Comercial',
+ 'titulo' => 'Título',
+ 'paisId' => 'País',
+ 'incRei' => 'Incidencia \ Reimpresión',
+ 'paginas' => 'Paginas',
+ 'tirada' => 'Tirada',
+ 'totalPedido' => 'Total Presupuesto',
+ 'presupuestoEstado' => 'Estado',
+ 'presupuestoEstadoBorrador' => 'Borrador',
+ 'presupuestoEstadoAceptado' => 'Aceptado',
+ 'incidencia' => 'Incidencia',
+ 'reimpresion' => 'Reimpresion',
+ 'sinCargo' => 'Sin cargo',
+ 'autor' => 'Autor',
+ 'coleccion' => 'Colección',
+ 'numeroEdicion' => 'Número de edición',
+ 'isbn' => 'ISBN',
+ 'referenciaCliente' => 'Referencia del cliente',
+ 'papelFormatoId' => "Tamaño",
+ 'papelFormatoPersonalizado' => 'Tamaño personalizado',
+ 'papelFormatoAncho' => 'Ancho',
+ 'papelFormatoAlto' => 'Alto',
+ 'cosido' => 'Cosido',
+ 'ferro' => 'Ferro',
+ 'ferroDigital' => 'Ferro Digital',
+ 'prototipo' => 'Prototipo',
+ 'imagenesBnInterior' => 'Imágenes B/N interior',
+ 'recogerEnTaller' => 'Recoger en taller',
+ 'marcapaginas' => 'Marcapáginas',
+ 'merma' => 'Merma',
+ 'mermacubierta' => 'Merma cubierta',
+ 'tipoImpresion' => 'Tipo de impresión',
+ 'papelesComparadorCosidoTapaBlanda' => 'Papeles interior y cubierta',
+ 'posicionPagColor' => 'Posición páginas a color',
+ 'colorPageInstructions' => 'Introduzca la posición de las páginas a color dentro del libro. Ej: 3,5,7 ó 4-10,20,155',
+ 'numeroPaginas' => 'Nº Páginas',
+ 'papel' => 'Papel',
+ 'gramaje' => 'Gramaje',
+ 'opcionesPresupuesto' => 'Opciones presupuesto',
+ 'retractilado' => 'Retractilado individual',
+ 'retractilado5' => 'Retractilado de 5',
+ 'Guardas' => 'Guardas',
+ 'fajaColor' => 'Imprimir faja a color',
+ 'compInteriorPlana' => 'Interior en plana',
+ 'compInteriorRotativa' => 'Interior en rotativa',
+ 'compCubiertaSobrecubierta' => 'Cubierta y sobrecubierta',
+ 'tipo' => 'Tipo',
+ 'marca' => 'Marca',
+ 'maquina' => 'Máquina',
+ 'numeroPliegos' => 'Nº Pliegos',
+ 'pliegosPedido' => 'Pliegos pedido',
+ 'precioPliego' => 'Precio pliegos',
+ 'libro' => 'Libro',
'totalPapelPedido' => 'Total papel pedido',
- 'lomo' => 'Lomo',
+ 'lomo' => 'Lomo',
'peso' => 'Peso',
'click' => 'Click',
'totalClicks' => 'Total clicks',
@@ -78,6 +78,7 @@ return [
'totalTinta' => 'Total tinta',
'totalCorte' => 'Total corte',
'total' => 'Total',
+ 'aFavorFibra' => 'A favor de fibra',
'cubierta' => 'Cubierta',
'sobrecubierta' => 'Sobrecubierta',
'encuadernacion' => 'Encuadernación',
@@ -85,7 +86,281 @@ return [
'solapasAnchoCubierta' => 'Ancho solapas cubierta',
'1cara' => '1 cara',
'2caras' => '2 caras',
+ 'bn' => 'BN',
+ 'bnhq' => 'BNHQ',
+ 'color' => 'Color',
+ 'colorhq' => 'ColorHQ',
+ 'rotativa' => 'Rotativa',
+ 'si' => 'Si',
+ 'no' => 'No',
+ 'insertarLinea' => 'Insertar Línea',
+ 'plana' => 'plana',
+ 'rotativa' => 'rotativa',
+ 'lineasPresupuesto' => 'Líneas Presupuesto',
+ 'tiempo' => 'Tiempo',
+ 'porDefecto' => 'Por defecto',
+ 'tipoImpresion' => 'Impresion',
+ 'numPagColor' => 'Nº Paginas Color',
+ 'saturacion' => 'Saturación',
+ 'cobNegro' => 'Cob. % Negro',
+ 'cobCyan' => 'Cob. % Cyan',
+ 'cobMagenta' => 'Cob. % Magenta',
+ 'cobAmarillo' => 'Cob. % Amarillo',
+ 'gotaNegro' => 'Gota negro',
+ 'gotaColor' => 'Gota color',
+ 'totalLinea' => 'TOTAL LÍNEA',
+ 'verCalculos' => 'Cálculos',
+ 'metrosMinuto' => 'Metros x min.',
+ 'resolucion' => 'Resolución (dpi)',
+ 'areaPaginas' => 'Área páginas (in)',
+ 'gotasNegro' => 'Nº gotas negro',
+ 'gotasCyan' => 'Nº gotas cyan',
+ 'gotasMagenta' => 'Nº gotas magenta',
+ 'gotasAmarillo' => 'Nº gotas amarillo',
+ 'precioPagNegro' => 'Precio pág. Negro',
+ 'precioPagColor' => 'Precio pág. Color',
+ 'factorAltura' => 'Factor altura',
+ 'factorAnchura' => 'Factor anchura',
+ 'paginasPliego' => 'Páginas/pliego',
+ 'metrosPapelLibro' => 'M. Papel Libro',
+ 'metrosPapelTotal' => 'M. Papel Total',
+ 'clicksLibro' => 'Clicks/Libro',
+ 'gTintaNegro' => 'G. tinta Negro',
+ 'gTintaCyan' => 'G. tinta Cyan',
+ 'gTintaMagenta' => 'G. tinta Magenta',
+ 'gTintaAmarillo' => 'G. tinta Amarillo',
+ 'clicksPedido' => 'Clicks Pedido',
+ 'totalClicks' => 'Total Clicks',
+ 'totalTinta' => 'Total Tinta',
+ 'totalCorte' => 'Total Corte',
+ 'totalImpresion' => 'TOTAL IMPRES.',
+ 'velocidadCorte' => 'Velocidad corte',
+ 'precioHoraCorte' => 'Precio hora corte',
+ 'tiempoCorte' => 'Tiempo corte',
+ 'gTintaNegroPed' => 'G.T. Negro Ped.',
+ 'gTintaCyanPed' => 'G.T. Cyan Ped.',
+ 'gTintaMagentaPed' => 'G.T. Magenta Ped.',
+ 'gTintaAmarilloPed' => 'G.T. Amarillo Ped.',
+
+ 'servicioAcabado' => 'Servicio de acabado',
+ 'servicioPreimpresion' => 'Servicio de preimpresión',
+ 'servicioEncuadernado' => 'Servicio de encuadernado',
+ 'servicioManipulado' => 'Servicio de manipulado',
+ 'comentarios' => 'Comentarios',
+ 'comentariosCliente' => 'Comentarios cliente',
+ 'comentariosSafekat' => 'Comentarios Safekat',
+ 'comentariosPresupuesto' => 'Comentarios Presupuesto',
+ 'comentariosProduccion' => 'Comentarios Produccion',
+ 'resumen' => 'Resumen del presupuesto',
+ 'confirmar' => 'Confirmar presupuesto',
+
+ // Servicios
+ 'precioUnidad' => 'Precio unitario',
+ 'precioTotal' => 'Precio total',
+
+
+ 'validation' => [
+ 'decimal' => 'El campo {field} debe contener un número decimal.',
+ 'requerido' => 'El campo {field} esta requerido.',
+ 'max_length' => 'El campo {field} no puede exceder los {param} caracteres de longitud.',
+ ],
+
+
+ /* '4x0' => '4x0',
+ '4x4' => '4x4',
+ 'aprobadoAt' => 'Aprobado At',
+ 'aprobadoJsonData' => 'Aprobado Json Data',
+ 'aprobadoUserId' => 'Aprobado User',
+ 'autor' => 'Autor',
+ 'baseImponible' => 'Base Imponible',
+ 'catalogoId' => 'Catalogo ID',
+ 'causaCancelacion' => 'Causa Cancelacion',
+ 'coleccion' => 'Coleccion',
+ 'comentarios' => 'Comentarios',
+ 'comentariosPdf' => 'Comentarios Pdf',
+ 'comentariosSafekat' => 'Comentarios Safekat',
+ 'comentariosTarifa' => 'Comentarios Tarifa',
+ 'comparadorJsonData' => 'Comparador Json Data',
+ 'cosido' => 'Cosido',
+ 'createdAt' => 'Created At',
+ 'cubiertas' => 'Cubiertas',
+ 'cubiertasAncho' => 'Cubiertas Ancho',
+ 'deletedAt' => 'Deleted At',
+ 'descuento' => 'Descuento',
+ 'enEspera' => 'EN Espera',
+ 'enProduccion' => 'EN Produccion',
+ 'enviosRecogeCliente' => 'Envios Recoge Cliente',
+ 'estadoId' => 'Estado',
+ 'facturaId' => 'Factura ID',
+ 'fechaEncuardenadoAt' => 'Fecha Encuardenado At',
+ 'fechaEntregaRealAt' => 'Fecha Entrega Real At',
+ 'fechaEntregaRealWarning' => 'Fecha Entrega Real Warning',
+ 'fechaExternoAt' => 'Fecha Externo At',
+ 'fechaFerroSubidoAt' => 'Fecha Ferro Subido At',
+ 'fechaImpresionAt' => 'Fecha Impresion At',
+ 'ferro' => 'Ferro',
+ 'ferroDigital' => 'Ferro Digital',
+ 'formaPagoId' => 'Forma Pago',
+ 'forzarTotal' => 'Forzar Total',
+ 'imagenesBnInterior' => 'Imagenes Bn Interior',
+ 'isDeleted' => 'Is Deleted',
+ 'isbn' => 'Isbn',
+ 'isdig' => 'Isdig',
+ 'lomo' => 'Lomo',
+ 'marcapaginas' => 'Marcapaginas',
+ 'margen' => 'Margen',
+ 'margenExtra' => 'Margen Extra',
+ 'margenManual' => 'Margen Manual',
+ 'merma' => 'Merma',
+ 'mermaPortada' => 'Merma Portada',
+ 'modoComparador' => 'Modo Comparador',
+ 'moduleTitle' => 'Presupuestos',
+ 'numeroEdicion' => 'Numero Edicion',
+ 'paginasColor' => 'Paginas Color',
+ 'paginasColorCheckImpresionTotal' => 'Paginas Color Check Impresion Total',
+ 'paginasColorCheckPapelTotal' => 'Paginas Color Check Papel Total',
+ 'paginasColorClick' => 'Paginas Color Click',
+ 'paginasColorFormaId' => 'Paginas Color Forma ID',
+ 'paginasColorGramaje' => 'Paginas Color Gramaje',
+ 'paginasColorLibro' => 'Paginas Color Libro',
+ 'paginasColorMano' => 'Paginas Color Mano',
+ 'paginasColorMaquinaId' => 'Paginas Color Maquina',
+ 'paginasColorPapelId' => 'Paginas Color Papel',
+ 'paginasColorPapelImpresionId' => 'Paginas Color Papel Impresion',
+ 'paginasColorPedido' => 'Paginas Color Pedido',
+ 'paginasColorPeso' => 'Paginas Color Peso',
+ 'paginasColorPliegosLibro' => 'Paginas Color Pliegos Libro',
+ 'paginasColorPliegosPedido' => 'Paginas Color Pliegos Pedido',
+ 'paginasColorPliegosPrecio' => 'Paginas Color Pliegos Precio',
+ 'paginasColorPosicion' => 'Paginas Color Posicion',
+ 'paginasColorPrecio' => 'Paginas Color Precio',
+ 'paginasColorTarifaImpresionId' => 'Paginas Color Tarifa Impresion',
+ 'paginasCubierta' => 'Paginas Cubierta',
+ 'paginasCubiertaCheckImpresionTotal' => 'Paginas Cubierta Check Impresion Total',
+ 'paginasCubiertaCheckPapelTotal' => 'Paginas Cubierta Check Papel Total',
+ 'paginasCubiertaClick' => 'Paginas Cubierta Click',
+ 'paginasCubiertaFormaId' => 'Paginas Cubierta Forma ID',
+ 'paginasCubiertaGramaje' => 'Paginas Cubierta Gramaje',
+ 'paginasCubiertaLibro' => 'Paginas Cubierta Libro',
+ 'paginasCubiertaMano' => 'Paginas Cubierta Mano',
+ 'paginasCubiertaMaquinaId' => 'Paginas Cubierta Maquina',
+ 'paginasCubiertaPapelId' => 'Paginas Cubierta Papel',
+ 'paginasCubiertaPapelImpresionId' => 'Paginas Cubierta Papel Impresion',
+ 'paginasCubiertaPedido' => 'Paginas Cubierta Pedido',
+ 'paginasCubiertaPeso' => 'Paginas Cubierta Peso',
+ 'paginasCubiertaPliegosLibro' => 'Paginas Cubierta Pliegos Libro',
+ 'paginasCubiertaPliegosPedido' => 'Paginas Cubierta Pliegos Pedido',
+ 'paginasCubiertaPliegosPrecio' => 'Paginas Cubierta Pliegos Precio',
+ 'paginasCubiertaPrecio' => 'Paginas Cubierta Precio',
+ 'paginasCubiertaTarifaImpresionId' => 'Paginas Cubierta Tarifa Impresion',
+ 'paginasNegro' => 'Paginas Negro',
+ 'paginasNegroCheckImpresionTotal' => 'Paginas Negro Check Impresion Total',
+ 'paginasNegroCheckPapelTotal' => 'Paginas Negro Check Papel Total',
+ 'paginasNegroClick' => 'Paginas Negro Click',
+ 'paginasNegroFormaId' => 'Paginas Negro Forma ID',
+ 'paginasNegroGramaje' => 'Paginas Negro Gramaje',
+ 'paginasNegroHq' => 'Paginas Negro Hq',
+ 'paginasNegroLibro' => 'Paginas Negro Libro',
+ 'paginasNegroMano' => 'Paginas Negro Mano',
+ 'paginasNegroMaquinaId' => 'Paginas Negro Maquina',
+ 'paginasNegroPapelId' => 'Paginas Negro Papel',
+ 'paginasNegroPapelImpresionId' => 'Paginas Negro Papel Impresion',
+ 'paginasNegroPedido' => 'Paginas Negro Pedido',
+ 'paginasNegroPeso' => 'Paginas Negro Peso',
+ 'paginasNegroPliegosLibro' => 'Paginas Negro Pliegos Libro',
+ 'paginasNegroPliegosPedido' => 'Paginas Negro Pliegos Pedido',
+ 'paginasNegroPliegosPrecio' => 'Paginas Negro Pliegos Precio',
+ 'paginasNegroPrecio' => 'Paginas Negro Precio',
+ 'paginasNegroTarifaImpresionId' => 'Paginas Negro Tarifa Impresion',
+ 'paginasPortada' => 'Paginas Portada',
+ 'paginasPortadaCheckImpresionTotal' => 'Paginas Portada Check Impresion Total',
+ 'paginasPortadaCheckPapelTotal' => 'Paginas Portada Check Papel Total',
+ 'paginasPortadaClick' => 'Paginas Portada Click',
+ 'paginasPortadaFormaId' => 'Paginas Portada Forma ID',
+ 'paginasPortadaGramaje' => 'Paginas Portada Gramaje',
+ 'paginasPortadaLibro' => 'Paginas Portada Libro',
+ 'paginasPortadaMano' => 'Paginas Portada Mano',
+ 'paginasPortadaMaquinaId' => 'Paginas Portada Maquina',
+ 'paginasPortadaPapelId' => 'Paginas Portada Papel',
+ 'paginasPortadaPapelImpresionId' => 'Paginas Portada Papel Impresion',
+ 'paginasPortadaPedido' => 'Paginas Portada Pedido',
+ 'paginasPortadaPeso' => 'Paginas Portada Peso',
+ 'paginasPortadaPliegosLibro' => 'Paginas Portada Pliegos Libro',
+ 'paginasPortadaPliegosPedido' => 'Paginas Portada Pliegos Pedido',
+ 'paginasPortadaPliegosPrecio' => 'Paginas Portada Pliegos Precio',
+ 'paginasPortadaPrecio' => 'Paginas Portada Precio',
+ 'paginasPortadaTarifaImpresionId' => 'Paginas Portada Tarifa Impresion',
+ 'papelFormatoAlto' => 'Papel Formato Alto',
+ 'papelFormatoAncho' => 'Papel Formato Ancho',
+ 'papelFormatoId' => 'Papel Formato',
+ 'papelFormatoPersonalizado' => 'Papel Formato Personalizado',
+ 'pedidoEsperaFecha' => 'Pedido Espera Fecha',
+ 'pedidoEsperaUserId' => 'Pedido Espera User',
+ 'pedidoLibroConjuntoId' => 'Pedido Libro Conjunto ID',
+ 'presupuesto' => 'Presupuesto',
+ 'presupuestoList' => 'Presupuesto List',
+ 'presupuestos' => 'Presupuestos',
+ 'recogerEnTaller' => 'Recoger EN Taller',
+ 'referenciaCliente' => 'Referencia Cliente',
+ 'responsable' => 'Responsable',
+ 'serieId' => 'Serie ID',
+ 'solapas' => 'Solapas',
+ 'solapasAncho' => 'Solapas Ancho',
+ 'tarifaClienteId' => 'Tarifa Cliente ID',
+ 'tipoImpresionId' => 'Tipo Impresion',
+ 'tipologiaId' => 'Tipologia',
+ 'tiradaAlternativaJsonData' => 'Tirada Alternativa Json Data',
+ 'total' => 'Total',
+ 'totalAcabado' => 'Total Acabado',
+ 'totalCalculado' => 'Total Calculado',
+ 'totalClick' => 'Total Click',
+ 'totalConfirmado' => 'Total Confirmado',
+ 'totalConfirmadoUpdateAt' => 'Total Confirmado Update At',
+ 'totalConfirmadoUserId' => 'Total Confirmado User',
+ 'totalDescuento' => 'Total Descuento',
+ 'totalEnvios' => 'Total Envios',
+ 'totalManipulado' => 'Total Manipulado',
+ 'totalMargen' => 'Total Margen',
+ 'totalMargenExtra' => 'Total Margen Extra',
+ 'totalPeso' => 'Total Peso',
+ 'totalPreimpresion' => 'Total Preimpresion',
+ 'totalPreimpresionMargen' => 'Total Preimpresion Margen',
+ 'totalPresupuesto' => 'Total Presupuesto',
+ 'ubicacionId' => 'Ubicacion',
+ 'updatedAt' => 'Updated At',
+ 'userCreatedId' => 'User Created',
+ 'userUpdateId' => 'User Update',
+ 'version' => 'Version',
+ 'wsExternoJsonData' => 'Ws Externo Json Data',
+ 'validation' => [
+ 'aprobado_at' => [
+ 'valid_date' => 'The {field} field must contain a valid date.',
+
+ ],
+
+ 'aprobado_json_data' => [
+ 'max_length' => 'The {field} field cannot exceed {param} characters in length.',
+
+ ],
+
+ 'base_imponible' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
+
+ ],
+
+ 'catalogo_id' => [
+ 'integer' => 'The {field} field must contain an integer.',
+
+ ],
+
+ 'causa_cancelacion' => [
+ 'max_length' => 'The {field} field cannot exceed {param} characters in length.',
+
+ ],
+
+
+
/* '4x0' => '4x0',
'4x4' => '4x4',
'aprobadoAt' => 'Aprobado At',
@@ -278,570 +553,570 @@ return [
],
- 'coleccion' => [
- 'max_length' => 'The {field} field cannot exceed {param} characters in length.',
+ 'coleccion' => [
+ 'max_length' => 'The {field} field cannot exceed {param} characters in length.',
- ],
+ ],
- 'comparador_json_data' => [
- 'max_length' => 'The {field} field cannot exceed {param} characters in length.',
+ 'comparador_json_data' => [
+ 'max_length' => 'The {field} field cannot exceed {param} characters in length.',
- ],
+ ],
- 'factura_id' => [
- 'integer' => 'The {field} field must contain an integer.',
+ 'factura_id' => [
+ 'integer' => 'The {field} field must contain an integer.',
- ],
+ ],
- 'fecha_encuardenado_at' => [
- 'valid_date' => 'The {field} field must contain a valid date.',
+ 'fecha_encuardenado_at' => [
+ 'valid_date' => 'The {field} field must contain a valid date.',
- ],
+ ],
- 'fecha_entrega_real_at' => [
- 'valid_date' => 'The {field} field must contain a valid date.',
+ 'fecha_entrega_real_at' => [
+ 'valid_date' => 'The {field} field must contain a valid date.',
- ],
+ ],
- 'fecha_externo_at' => [
- 'valid_date' => 'The {field} field must contain a valid date.',
+ 'fecha_externo_at' => [
+ 'valid_date' => 'The {field} field must contain a valid date.',
- ],
+ ],
- 'fecha_ferro_subido_at' => [
- 'valid_date' => 'The {field} field must contain a valid date.',
+ 'fecha_ferro_subido_at' => [
+ 'valid_date' => 'The {field} field must contain a valid date.',
- ],
+ ],
- 'fecha_impresion_at' => [
- 'valid_date' => 'The {field} field must contain a valid date.',
+ 'fecha_impresion_at' => [
+ 'valid_date' => 'The {field} field must contain a valid date.',
- ],
+ ],
- 'inc_rei' => [
- 'integer' => 'The {field} field must contain an integer.',
+ 'inc_rei' => [
+ 'integer' => 'The {field} field must contain an integer.',
- ],
+ ],
- 'isbn' => [
- 'max_length' => 'The {field} field cannot exceed {param} characters in length.',
+ 'isbn' => [
+ 'max_length' => 'The {field} field cannot exceed {param} characters in length.',
- ],
+ ],
- 'lomo' => [
- 'integer' => 'The {field} field must contain an integer.',
+ 'lomo' => [
+ 'integer' => 'The {field} field must contain an integer.',
- ],
+ ],
- 'margen' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'margen' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'margen_manual' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'margen_manual' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'numero_edicion' => [
- 'max_length' => 'The {field} field cannot exceed {param} characters in length.',
+ 'numero_edicion' => [
+ 'max_length' => 'The {field} field cannot exceed {param} characters in length.',
- ],
+ ],
- 'paginas_color' => [
- 'integer' => 'The {field} field must contain an integer.',
+ 'paginas_color' => [
+ 'integer' => 'The {field} field must contain an integer.',
- ],
+ ],
- 'paginas_color_click' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_color_click' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_color_forma_id' => [
- 'integer' => 'The {field} field must contain an integer.',
+ 'paginas_color_forma_id' => [
+ 'integer' => 'The {field} field must contain an integer.',
- ],
+ ],
- 'paginas_color_gramaje' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_color_gramaje' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_color_libro' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_color_libro' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_color_mano' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_color_mano' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_color_pedido' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_color_pedido' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_color_peso' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_color_peso' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_color_pliegos_libro' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_color_pliegos_libro' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_color_pliegos_pedido' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_color_pliegos_pedido' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_color_pliegos_precio' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_color_pliegos_precio' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_color_posicion' => [
- 'max_length' => 'The {field} field cannot exceed {param} characters in length.',
+ 'paginas_color_posicion' => [
+ 'max_length' => 'The {field} field cannot exceed {param} characters in length.',
- ],
+ ],
- 'paginas_color_precio' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_color_precio' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_cubierta_click' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_cubierta_click' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_cubierta_forma_id' => [
- 'integer' => 'The {field} field must contain an integer.',
+ 'paginas_cubierta_forma_id' => [
+ 'integer' => 'The {field} field must contain an integer.',
- ],
+ ],
- 'paginas_cubierta_gramaje' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_cubierta_gramaje' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_cubierta_libro' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_cubierta_libro' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_cubierta_mano' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_cubierta_mano' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_cubierta_pedido' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_cubierta_pedido' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_cubierta_peso' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_cubierta_peso' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_cubierta_pliegos_libro' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_cubierta_pliegos_libro' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_cubierta_pliegos_pedido' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_cubierta_pliegos_pedido' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_cubierta_pliegos_precio' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_cubierta_pliegos_precio' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_cubierta_precio' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_cubierta_precio' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_negro' => [
- 'integer' => 'The {field} field must contain an integer.',
+ 'paginas_negro' => [
+ 'integer' => 'The {field} field must contain an integer.',
- ],
+ ],
- 'paginas_negro_click' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_negro_click' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_negro_forma_id' => [
- 'integer' => 'The {field} field must contain an integer.',
+ 'paginas_negro_forma_id' => [
+ 'integer' => 'The {field} field must contain an integer.',
- ],
+ ],
- 'paginas_negro_gramaje' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_negro_gramaje' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_negro_libro' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_negro_libro' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_negro_mano' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_negro_mano' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_negro_pedido' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_negro_pedido' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_negro_peso' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_negro_peso' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_negro_pliegos_libro' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_negro_pliegos_libro' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_negro_pliegos_pedido' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_negro_pliegos_pedido' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_negro_pliegos_precio' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_negro_pliegos_precio' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_negro_precio' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_negro_precio' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_portada_click' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_portada_click' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_portada_forma_id' => [
- 'integer' => 'The {field} field must contain an integer.',
+ 'paginas_portada_forma_id' => [
+ 'integer' => 'The {field} field must contain an integer.',
- ],
+ ],
- 'paginas_portada_gramaje' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_portada_gramaje' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_portada_libro' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_portada_libro' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_portada_mano' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_portada_mano' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_portada_peso' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_portada_peso' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_portada_pliegos_libro' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_portada_pliegos_libro' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_portada_pliegos_pedido' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_portada_pliegos_pedido' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_portada_pliegos_precio' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_portada_pliegos_precio' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'paginas_portada_precio' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'paginas_portada_precio' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'papel_formato_alto' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'papel_formato_alto' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'papel_formato_ancho' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'papel_formato_ancho' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'pedido_espera_fecha' => [
- 'valid_date' => 'The {field} field must contain a valid date.',
+ 'pedido_espera_fecha' => [
+ 'valid_date' => 'The {field} field must contain a valid date.',
- ],
+ ],
- 'pedido_libro_conjunto_id' => [
- 'integer' => 'The {field} field must contain an integer.',
+ 'pedido_libro_conjunto_id' => [
+ 'integer' => 'The {field} field must contain an integer.',
- ],
+ ],
- 'responsable' => [
- 'max_length' => 'The {field} field cannot exceed {param} characters in length.',
+ 'responsable' => [
+ 'max_length' => 'The {field} field cannot exceed {param} characters in length.',
- ],
+ ],
- 'serie_id' => [
- 'integer' => 'The {field} field must contain an integer.',
+ 'serie_id' => [
+ 'integer' => 'The {field} field must contain an integer.',
- ],
+ ],
- 'tarifa_cliente_id' => [
- 'integer' => 'The {field} field must contain an integer.',
+ 'tarifa_cliente_id' => [
+ 'integer' => 'The {field} field must contain an integer.',
- ],
+ ],
- 'tirada_alternativa_json_data' => [
- 'max_length' => 'The {field} field cannot exceed {param} characters in length.',
+ 'tirada_alternativa_json_data' => [
+ 'max_length' => 'The {field} field cannot exceed {param} characters in length.',
- ],
+ ],
- 'total' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'total' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'total_acabado' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'total_acabado' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'total_calculado' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'total_calculado' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'total_click' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'total_click' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'total_confirmado' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'total_confirmado' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'total_confirmado_update_at' => [
- 'valid_date' => 'The {field} field must contain a valid date.',
+ 'total_confirmado_update_at' => [
+ 'valid_date' => 'The {field} field must contain a valid date.',
- ],
+ ],
- 'total_descuento' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'total_descuento' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'total_envios' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'total_envios' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'total_manipulado' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'total_manipulado' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'total_margen' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'total_margen' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'total_margen_extra' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'total_margen_extra' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'total_pedido' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'total_pedido' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'total_peso' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'total_peso' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'total_preimpresion' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'total_preimpresion' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'total_preimpresion_margen' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'total_preimpresion_margen' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'total_presupuesto' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
+ 'total_presupuesto' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
- ],
+ ],
- 'user_update_id' => [
- 'integer' => 'The {field} field must contain an integer.',
+ 'user_update_id' => [
+ 'integer' => 'The {field} field must contain an integer.',
- ],
+ ],
- 'ws_externo_json_data' => [
- 'max_length' => 'The {field} field cannot exceed {param} characters in length.',
+ 'ws_externo_json_data' => [
+ 'max_length' => 'The {field} field cannot exceed {param} characters in length.',
- ],
+ ],
- 'autor' => [
- 'max_length' => 'The {field} field cannot exceed {param} characters in length.',
- 'required' => 'The {field} field is required.',
+ 'autor' => [
+ 'max_length' => 'The {field} field cannot exceed {param} characters in length.',
+ 'required' => 'The {field} field is required.',
- ],
+ ],
- 'comentarios' => [
- 'max_length' => 'The {field} field cannot exceed {param} characters in length.',
- 'required' => 'The {field} field is required.',
+ 'comentarios' => [
+ 'max_length' => 'The {field} field cannot exceed {param} characters in length.',
+ 'required' => 'The {field} field is required.',
- ],
+ ],
- 'comentarios_pdf' => [
- 'max_length' => 'The {field} field cannot exceed {param} characters in length.',
- 'required' => 'The {field} field is required.',
+ 'comentarios_pdf' => [
+ 'max_length' => 'The {field} field cannot exceed {param} characters in length.',
+ 'required' => 'The {field} field is required.',
- ],
+ ],
- 'comentarios_safekat' => [
- 'max_length' => 'The {field} field cannot exceed {param} characters in length.',
- 'required' => 'The {field} field is required.',
+ 'comentarios_safekat' => [
+ 'max_length' => 'The {field} field cannot exceed {param} characters in length.',
+ 'required' => 'The {field} field is required.',
- ],
+ ],
- 'comentarios_tarifa' => [
- 'max_length' => 'The {field} field cannot exceed {param} characters in length.',
- 'required' => 'The {field} field is required.',
+ 'comentarios_tarifa' => [
+ 'max_length' => 'The {field} field cannot exceed {param} characters in length.',
+ 'required' => 'The {field} field is required.',
- ],
+ ],
- 'cubiertas_ancho' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
- 'required' => 'The {field} field is required.',
+ 'cubiertas_ancho' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
+ 'required' => 'The {field} field is required.',
- ],
+ ],
- 'descuento' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
- 'required' => 'The {field} field is required.',
+ 'descuento' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
+ 'required' => 'The {field} field is required.',
- ],
+ ],
- 'forzar_total' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
- 'required' => 'The {field} field is required.',
+ 'forzar_total' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
+ 'required' => 'The {field} field is required.',
- ],
+ ],
- 'is_deleted' => [
- 'integer' => 'The {field} field must contain an integer.',
- 'required' => 'The {field} field is required.',
+ 'is_deleted' => [
+ 'integer' => 'The {field} field must contain an integer.',
+ 'required' => 'The {field} field is required.',
- ],
+ ],
- 'margen_extra' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
- 'required' => 'The {field} field is required.',
+ 'margen_extra' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
+ 'required' => 'The {field} field is required.',
- ],
+ ],
- 'merma' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
- 'required' => 'The {field} field is required.',
+ 'merma' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
+ 'required' => 'The {field} field is required.',
- ],
+ ],
- 'merma_portada' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
- 'required' => 'The {field} field is required.',
+ 'merma_portada' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
+ 'required' => 'The {field} field is required.',
- ],
+ ],
- 'paginas' => [
- 'integer' => 'The {field} field must contain an integer.',
- 'required' => 'The {field} field is required.',
+ 'paginas' => [
+ 'integer' => 'The {field} field must contain an integer.',
+ 'required' => 'The {field} field is required.',
- ],
+ ],
- 'paginas_cubierta' => [
- 'in_list' => 'The {field} field must be one of: {param}.',
- 'required' => 'The {field} field is required.',
+ 'paginas_cubierta' => [
+ 'in_list' => 'The {field} field must be one of: {param}.',
+ 'required' => 'The {field} field is required.',
- ],
+ ],
- 'paginas_portada' => [
- 'in_list' => 'The {field} field must be one of: {param}.',
- 'required' => 'The {field} field is required.',
+ 'paginas_portada' => [
+ 'in_list' => 'The {field} field must be one of: {param}.',
+ 'required' => 'The {field} field is required.',
- ],
+ ],
- 'paginas_portada_pedido' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
- 'required' => 'The {field} field is required.',
+ 'paginas_portada_pedido' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
+ 'required' => 'The {field} field is required.',
- ],
+ ],
- 'referencia_cliente' => [
- 'max_length' => 'The {field} field cannot exceed {param} characters in length.',
- 'required' => 'The {field} field is required.',
+ 'referencia_cliente' => [
+ 'max_length' => 'The {field} field cannot exceed {param} characters in length.',
+ 'required' => 'The {field} field is required.',
- ],
+ ],
- 'solapas_ancho' => [
- 'decimal' => 'The {field} field must contain a decimal number.',
- 'required' => 'The {field} field is required.',
+ 'solapas_ancho' => [
+ 'decimal' => 'The {field} field must contain a decimal number.',
+ 'required' => 'The {field} field is required.',
- ],
+ ],
- 'tirada' => [
- 'integer' => 'The {field} field must contain an integer.',
- 'required' => 'The {field} field is required.',
+ 'tirada' => [
+ 'integer' => 'The {field} field must contain an integer.',
+ 'required' => 'The {field} field is required.',
- ],
+ ],
- 'titulo' => [
- 'max_length' => 'The {field} field cannot exceed {param} characters in length.',
- 'required' => 'The {field} field is required.',
+ 'titulo' => [
+ 'max_length' => 'The {field} field cannot exceed {param} characters in length.',
+ 'required' => 'The {field} field is required.',
- ],
+ ],
- 'user_created_id' => [
- 'integer' => 'The {field} field must contain an integer.',
- 'required' => 'The {field} field is required.',
+ 'user_created_id' => [
+ 'integer' => 'The {field} field must contain an integer.',
+ 'required' => 'The {field} field is required.',
- ],
+ ],
- 'version' => [
- 'integer' => 'The {field} field must contain an integer.',
- 'required' => 'The {field} field is required.',
+ 'version' => [
+ 'integer' => 'The {field} field must contain an integer.',
+ 'required' => 'The {field} field is required.',
- ],
+ ],
- ], */
+ ], */
];
diff --git a/ci4/app/Language/es/TarifaEncuadernacionLineas.php b/ci4/app/Language/es/TarifaEncuadernacionLineas.php
index d941975d..48ee2062 100644
--- a/ci4/app/Language/es/TarifaEncuadernacionLineas.php
+++ b/ci4/app/Language/es/TarifaEncuadernacionLineas.php
@@ -8,6 +8,8 @@ return [
'deleteLine' => 'el registro seleccionado',
'precioMax' => 'Precio Max',
'precioMin' => 'Precio Min',
+ 'tiradaMax' => 'Tirada Max',
+ 'tiradaMin' => 'Tirada Min',
'precioUnidad' => 'Precio Unidad',
'paginasMax' => 'Páginas Max',
'paginasMin' => 'Páginas Min',
@@ -19,23 +21,26 @@ return [
'error_paginas_range' => 'El campo Páginas Min debe ser menor que el campo Páginas Max',
'precio_max' => [
'decimal' => 'El campo {field} debe contener un número decimal.',
- 'required' => 'The {field} field is required.',
-
+ 'required' => 'El campo {field} es obligatorio.',
],
-
'precio_min' => [
'decimal' => 'El campo {field} debe contener un número decimal.',
- 'required' => 'The {field} field is required.',
-
+ 'required' => 'El campo {field} es obligatorio.',
],
-
- 'paginas_max' => [
+ 'tirada_max' => [
+ 'decimal' => 'El campo {field} debe contener un número decimal.',
+ 'required' => 'El campo {field} es obligatorio.',
+ ],
+ 'tirada_min' => [
+ 'decimal' => 'El campo {field} debe contener un número decimal.',
+ 'required' => 'El campo {field} es obligatorio.',
+ ],
+ 'paginas_libro_max' => [
'decimal' => 'El campo {field} debe contener un número decimal.',
'required' => 'The {field} field is required.',
-
],
- 'paginas_min' => [
+ 'paginas_libro_min' => [
'decimal' => 'El campo {field} debe contener un número decimal.',
'required' => 'The {field} field is required.',
diff --git a/ci4/app/Language/es/Tarifaacabado.php b/ci4/app/Language/es/Tarifaacabado.php
index fdb1d0e9..c7024dc1 100644
--- a/ci4/app/Language/es/Tarifaacabado.php
+++ b/ci4/app/Language/es/Tarifaacabado.php
@@ -12,7 +12,7 @@ return [
'precioMin' => 'Precio Mínimo',
'importeFijo' => 'Importe Fijo',
'mostrar_en_presupuesto' => 'Mostrar en presupuesto',
- 'tarifaacabado' => 'Tarifas Acabado',
+ 'tarifaacabado' => 'Tarifa Acabado',
'tarifaacabadoList' => 'Lista Tarifas Acabado',
'tarifasacabado' => 'Tarifas Acabado',
'updatedAt' => 'Actualizado en',
diff --git a/ci4/app/Models/Configuracion/FormasPagoModel.php b/ci4/app/Models/Configuracion/FormasPagoModel.php
deleted file mode 100644
index 5230e7fd..00000000
--- a/ci4/app/Models/Configuracion/FormasPagoModel.php
+++ /dev/null
@@ -1,33 +0,0 @@
- [
- "label" => "FormasPagoes.nombre",
- "rules" => "trim|required|max_length[255]",
- ],
- ];
-
- protected $validationMessages = [
- "nombre" => [
- "max_length" => "FormasPagoes.validation.nombre.max_length",
- "required" => "FormasPagoes.validation.nombre.required",
- ],
- ];
-}
diff --git a/ci4/app/Models/Configuracion/MaquinaModel.php b/ci4/app/Models/Configuracion/MaquinaModel.php
index bb5dbdb3..ac68b85a 100644
--- a/ci4/app/Models/Configuracion/MaquinaModel.php
+++ b/ci4/app/Models/Configuracion/MaquinaModel.php
@@ -1,4 +1,5 @@
"t1.orden_planning",
10 => "t1.min",
11 => "t1.max",
-
-
+
+
];
protected $allowedFields = [
@@ -52,8 +53,8 @@ class MaquinaModel extends \App\Models\GoBaseModel
"velocidad_corte",
"precio_hora_corte",
"metrosxminuto",
- "forzar_num_formas_horizontales_portada",
- "forzar_num_formas_verticales_portada",
+ "forzar_num_formas_horizontales_cubierta",
+ "forzar_num_formas_verticales_cubierta",
"observaciones",
"deleted_at",
"is_deleted",
@@ -94,11 +95,11 @@ class MaquinaModel extends \App\Models\GoBaseModel
"label" => "Maquinas.duracionJornada",
"rules" => "required|integer",
],
- "forzar_num_formas_horizontales_portada" => [
+ "forzar_num_formas_horizontales_cubierta" => [
"label" => "Maquinas.forzarNumFormasHorizontalesPortada",
"rules" => "integer|permit_empty",
],
- "forzar_num_formas_verticales_portada" => [
+ "forzar_num_formas_verticales_cubierta" => [
"label" => "Maquinas.forzarNumFormasVerticalesPortada",
"rules" => "integer|permit_empty",
],
@@ -175,11 +176,11 @@ class MaquinaModel extends \App\Models\GoBaseModel
"integer" => "Maquinas.validation.duracion_jornada.integer",
"required" => "Maquinas.validation.duracion_jornada.required",
],
- "forzar_num_formas_horizontales_portada" => [
- "integer" => "Maquinas.validation.forzar_num_formas_horizontales_portada.integer",
+ "forzar_num_formas_horizontales_cubierta" => [
+ "integer" => "Maquinas.validation.forzar_num_formas_horizontales_cubierta.integer",
],
- "forzar_num_formas_verticales_portada" => [
- "integer" => "Maquinas.validation.forzar_num_formas_verticales_portada.integer",
+ "forzar_num_formas_verticales_cubierta" => [
+ "integer" => "Maquinas.validation.forzar_num_formas_verticales_cubierta.integer",
],
"max" => [
"integer" => "Maquinas.validation.max.integer",
@@ -252,14 +253,15 @@ class MaquinaModel extends \App\Models\GoBaseModel
return $result;
}
- public function getIdMaquinasForPapelImpresion($papel_impresion_id, $rotativa){
+ public function getIdMaquinasForPapelImpresion($papel_impresion_id, $rotativa)
+ {
$builder = $this->db
->table($this->table . " t1")
->select(
- "'".$papel_impresion_id."'". " as papel_impresion_id, t1.id AS maquina_id, '0' as active"
- );
+ "'" . $papel_impresion_id . "'" . " as papel_impresion_id, t1.id AS maquina_id, '0' as active"
+ );
$builder->where("t1.is_rotativa", $rotativa);
-
+
return $builder;
}
@@ -275,62 +277,107 @@ class MaquinaModel extends \App\Models\GoBaseModel
$builder = $this->db
->table($this->table . " t1")
->select(
- "t1.id AS id, t1.nombre AS nombre, t1.is_padre AS is_padre, t1.tipo AS tipo, t1.velocidad AS velocidad, t1.ancho AS ancho, t1.alto AS alto, t1.ancho_impresion AS ancho_impresion, t1.alto_impresion AS alto_impresion, t1.alto_click AS alto_click, t1.min AS min, t1.max AS max, t1.duracion_jornada AS duracion_jornada, t1.orden_planning AS orden_planning, t1.is_rotativa AS is_rotativa, t1.precio_tinta_negro AS precio_tinta_negro, t1.is_tinta AS is_tinta, t1.precio_tinta_color AS precio_tinta_color, t1.velocidad_corte AS velocidad_corte, t1.precio_hora_corte AS precio_hora_corte, t1.metrosxminuto AS metrosxminuto, t1.forzar_num_formas_horizontales_portada AS forzar_num_formas_horizontales_portada, t1.forzar_num_formas_verticales_portada AS forzar_num_formas_verticales_portada, t1.observaciones AS observaciones, t2.nombre AS padre"
+ "t1.id AS id, t1.nombre AS nombre, t1.is_padre AS is_padre, t1.tipo AS tipo, t1.velocidad AS velocidad, t1.ancho AS ancho, t1.alto AS alto, t1.ancho_impresion AS ancho_impresion, t1.alto_impresion AS alto_impresion, t1.alto_click AS alto_click, t1.min AS min, t1.max AS max, t1.duracion_jornada AS duracion_jornada, t1.orden_planning AS orden_planning, t1.is_rotativa AS is_rotativa, t1.precio_tinta_negro AS precio_tinta_negro, t1.is_tinta AS is_tinta, t1.precio_tinta_color AS precio_tinta_color, t1.velocidad_corte AS velocidad_corte, t1.precio_hora_corte AS precio_hora_corte, t1.metrosxminuto AS metrosxminuto, t1.forzar_num_formas_horizontales_cubierta AS forzar_num_formas_horizontales_cubierta, t1.forzar_num_formas_verticales_cubierta AS forzar_num_formas_verticales_cubierta, t1.observaciones AS observaciones, t2.nombre AS padre"
);
$builder->join("lg_maquinas t2", "t1.padre_id = t2.id", "left");
//JJO
- $builder->where("t1.is_deleted", 0);
+ $builder->where("t1.is_deleted", 0);
return empty($search)
? $builder
: $builder
- ->groupStart()
- ->like("t1.id", $search)
- ->orLike("t1.nombre", $search)
- ->orLike("t1.tipo", $search)
- ->orLike("t1.velocidad", $search)
- ->orLike("t1.ancho", $search)
- ->orLike("t1.alto", $search)
- ->orLike("t1.ancho_impresion", $search)
- ->orLike("t1.alto_impresion", $search)
- ->orLike("t1.alto_click", $search)
- ->orLike("t1.min", $search)
- ->orLike("t1.max", $search)
- ->orLike("t1.duracion_jornada", $search)
- ->orLike("t1.orden_planning", $search)
- ->orLike("t1.precio_tinta_negro", $search)
- ->orLike("t1.precio_tinta_color", $search)
- ->orLike("t1.velocidad_corte", $search)
- ->orLike("t1.precio_hora_corte", $search)
- ->orLike("t1.metrosxminuto", $search)
- ->orLike("t1.forzar_num_formas_horizontales_portada", $search)
- ->orLike("t1.forzar_num_formas_verticales_portada", $search)
- ->orLike("t1.observaciones", $search)
- ->orLike("t2.id", $search)
- ->orLike("t1.id", $search)
- ->orLike("t1.nombre", $search)
- ->orLike("t1.tipo", $search)
- ->orLike("t1.velocidad", $search)
- ->orLike("t1.ancho", $search)
- ->orLike("t1.alto", $search)
- ->orLike("t1.ancho_impresion", $search)
- ->orLike("t1.alto_impresion", $search)
- ->orLike("t1.alto_click", $search)
- ->orLike("t1.padre_id", $search)
- ->orLike("t1.min", $search)
- ->orLike("t1.max", $search)
- ->orLike("t1.duracion_jornada", $search)
- ->orLike("t1.orden_planning", $search)
- ->orLike("t1.precio_tinta_negro", $search)
- ->orLike("t1.precio_tinta_color", $search)
- ->orLike("t1.velocidad_corte", $search)
- ->orLike("t1.precio_hora_corte", $search)
- ->orLike("t1.metrosxminuto", $search)
- ->orLike("t1.forzar_num_formas_horizontales_portada", $search)
- ->orLike("t1.forzar_num_formas_verticales_portada", $search)
- ->orLike("t1.observaciones", $search)
- ->orLike("t2.nombre", $search)
- ->groupEnd();
+ ->groupStart()
+ ->like("t1.id", $search)
+ ->orLike("t1.nombre", $search)
+ ->orLike("t1.tipo", $search)
+ ->orLike("t1.velocidad", $search)
+ ->orLike("t1.ancho", $search)
+ ->orLike("t1.alto", $search)
+ ->orLike("t1.ancho_impresion", $search)
+ ->orLike("t1.alto_impresion", $search)
+ ->orLike("t1.alto_click", $search)
+ ->orLike("t1.min", $search)
+ ->orLike("t1.max", $search)
+ ->orLike("t1.duracion_jornada", $search)
+ ->orLike("t1.orden_planning", $search)
+ ->orLike("t1.precio_tinta_negro", $search)
+ ->orLike("t1.precio_tinta_color", $search)
+ ->orLike("t1.velocidad_corte", $search)
+ ->orLike("t1.precio_hora_corte", $search)
+ ->orLike("t1.metrosxminuto", $search)
+ ->orLike("t1.forzar_num_formas_horizontales_cubierta", $search)
+ ->orLike("t1.forzar_num_formas_verticales_cubierta", $search)
+ ->orLike("t1.observaciones", $search)
+ ->orLike("t2.id", $search)
+ ->orLike("t1.id", $search)
+ ->orLike("t1.nombre", $search)
+ ->orLike("t1.tipo", $search)
+ ->orLike("t1.velocidad", $search)
+ ->orLike("t1.ancho", $search)
+ ->orLike("t1.alto", $search)
+ ->orLike("t1.ancho_impresion", $search)
+ ->orLike("t1.alto_impresion", $search)
+ ->orLike("t1.alto_click", $search)
+ ->orLike("t1.padre_id", $search)
+ ->orLike("t1.min", $search)
+ ->orLike("t1.max", $search)
+ ->orLike("t1.duracion_jornada", $search)
+ ->orLike("t1.orden_planning", $search)
+ ->orLike("t1.precio_tinta_negro", $search)
+ ->orLike("t1.precio_tinta_color", $search)
+ ->orLike("t1.velocidad_corte", $search)
+ ->orLike("t1.precio_hora_corte", $search)
+ ->orLike("t1.metrosxminuto", $search)
+ ->orLike("t1.forzar_num_formas_horizontales_cubierta", $search)
+ ->orLike("t1.forzar_num_formas_verticales_cubierta", $search)
+ ->orLike("t1.observaciones", $search)
+ ->orLike("t2.nombre", $search)
+ ->groupEnd();
+ }
+
+ public function getMaquinaImpresionForPresupuesto($is_rotativa, $tarifa_tipo, $tirada, $papel_impresion_id = -1)
+ {
+ /*
+ 1.-> tarifa_Tipo impresion
+ 2.-> Maquina
+ 3.-> Papeles impresion asociados a esa maquina
+ 4.-> papeles genericos que aparecen en esos papeles impresion
+ */
+ $builder = $this->db
+ ->table($this->table . " t1")
+ ->distinct('t1.id')
+ ->select(
+ "t1.id AS maquina_id, t1.nombre AS maquina, t1.ancho_impresion AS ancho_impresion,
+ t1.alto_impresion AS alto_impresion, t1.ancho AS ancho, t1.alto AS alto,
+ t1.is_rotativa AS is rotativa, t1.alto_click AS alto_click, t1.velocidad AS velocidad,
+ t1.precio_tinta_negro AS precio_tinta_negro, t1.precio_tinta_color AS precio_tinta_color,
+ t1.velocidad_corte AS velocidad_corte, t1.precio_hora_corte AS precio_hora_corte,
+ t1.forzar_num_formas_horizontales_cubierta AS forzar_num_formas_horizontales_cubierta,
+ t1.forzar_num_formas_verticales_cubierta AS forzar_num_formas_verticales_cubierta"
+ )
+ ->join("lg_maquinas_tarifas_impresion t2", "t1.id = t2.maquina_id", "left")
+ ->join("lg_maquina_papel_impresion t3", "t1.id = t3.maquina_id", "left")
+
+
+ ->where("t1.is_deleted", 0)
+ ->where("t1.tipo", "impresion")
+ ->where("t1.is_rotativa", $is_rotativa)
+ ->where("t2.is_deleted", 0)
+ ->where("t3.papel_impresion_id", $papel_impresion_id)
+ ->where("t3.active", 1)
+ ->where("t1.min <=", $tirada)
+ ->where("t1.max >=", $tirada);
+
+ if(is_array($tarifa_tipo)){
+ foreach($tarifa_tipo as $tarifa){
+ $builder->where("EXISTS (SELECT * FROM lg_maquinas_tarifas_impresion t2 WHERE t1.id=t2.maquina_id AND t2.tipo='{$tarifa}' AND t2.is_deleted=0)");
+ }
+ }
+ else{
+ $builder->where("t2.tipo", $tarifa_tipo);
+ }
+
+ return $builder->orderBy("t1.id", "asc")->get()->getResultObject();
}
}
diff --git a/ci4/app/Models/Configuracion/MaquinasCallesModel.php b/ci4/app/Models/Configuracion/MaquinasCallesModel.php
index aca7e2d6..6b84efc0 100644
--- a/ci4/app/Models/Configuracion/MaquinasCallesModel.php
+++ b/ci4/app/Models/Configuracion/MaquinasCallesModel.php
@@ -13,16 +13,14 @@ class MaquinasCallesModel extends \App\Models\GoBaseModel
protected $useAutoIncrement = true;
const SORTABLE = [
- 0 => "t1.formas_min",
- 1 => "t1.formas_max",
- 2 => "t1.internas",
- 3 => "t1.externas",
+ 0 => "t1.formas",
+ 1 => "t1.internas",
+ 2 => "t1.externas",
];
protected $allowedFields = [
"maquina_id",
- "formas_min",
- "formas_max",
+ "formas",
"internas",
"externas",
"user_created_id",
@@ -43,10 +41,7 @@ class MaquinasCallesModel extends \App\Models\GoBaseModel
public static $labelField = "maquina_id";
protected $validationRules = [
- "formas_min" => [
- "rules" => "required|int",
- ],
- "formas_max" => [
+ "formas" => [
"rules" => "required|int",
],
"internas" => [
@@ -70,8 +65,8 @@ class MaquinasCallesModel extends \App\Models\GoBaseModel
$builder = $this->db
->table($this->table . " t1")
->select(
- "t1.id AS id, t1.maquina_id as maquina, t1.formas_min AS formas_min,
- t1.formas_max AS formas_max, t1.internas AS internas, t1.externas AS externas,"
+ "t1.id AS id, t1.maquina_id as maquina, t1.formas AS formas,
+ t1.internas AS internas, t1.externas AS externas,"
);
//JJO
@@ -82,29 +77,39 @@ class MaquinasCallesModel extends \App\Models\GoBaseModel
? $builder
: $builder
->groupStart()
- ->like("t1.formas_min", $search)
- ->orLike("t1.formas_max", $search)
+ ->like("t1.formas", $search)
->orLike("t1.internas", $search)
->orLike("t1.externas", $search)
- ->orLike("t1.formas_min", $search)
- ->orLike("t1.formas_max", $search)
+ ->orLike("t1.formas", $search)
->orLike("t1.internas", $search)
->orLike("t1.externas", $search)
->groupEnd();
}
- public function checkIntervals($data = [], $id = null){
+ public function getCallesForMaquina($maquina_id=-1, $num_formas = 0)
+ {
+ $builder = $this->db
+ ->table($this->table . " t1")
+ ->select(
+ "t1.formas AS formas,
+ t1.internas AS internas, t1.externas AS externas,"
+ );
+
+ //JJO
+ $builder->where('t1.maquina_id', $maquina_id);
+ $builder->where('t1.formas', $num_formas);
+ $builder->where("t1.is_deleted", 0);
+
+ return $builder->get()->getResultObject();
+ }
+
+ public function checkDuplicatedFormas($data = [], $id = null){
helper('general');
-
- if(floatval($data["formas_min"])>= floatval($data["formas_max"])){
- return lang('MaquinasCalles.validation.error_calle_range');
- }
-
-
+
$rows = $this->db
->table($this->table)
- ->select("id, formas_min, formas_max")
+ ->select("id, formas")
->where("is_deleted", 0)
->where("maquina_id", $data['maquina_id'])
->get()->getResultObject();
@@ -116,9 +121,8 @@ class MaquinasCallesModel extends \App\Models\GoBaseModel
continue;
}
}
- if(check_overlap(floatval($data["formas_min"]), floatval($data["formas_max"]),
- $row->formas_min, $row->formas_max)){
- return lang('MaquinasCalles.validation.error_calle_overlap');
+ if(intval($data["formas"]) == $row->formas){
+ return lang('MaquinasCalles.validation.error_formas_exists');
}
}
}
diff --git a/ci4/app/Models/Configuracion/MaquinasPapelesImpresionModel.php b/ci4/app/Models/Configuracion/MaquinasPapelesImpresionModel.php
index f9d7a36e..f75dd5dd 100644
--- a/ci4/app/Models/Configuracion/MaquinasPapelesImpresionModel.php
+++ b/ci4/app/Models/Configuracion/MaquinasPapelesImpresionModel.php
@@ -29,6 +29,11 @@ class MaquinasPapelesImpresionModel extends \App\Models\GoBaseModel
const SORTABLE_2 = [
0 => "t1.active",
1 => "t2.nombre",
+ 2 => "t2.ancho",
+ 3 => "t2.alto",
+ 4 => "t2.ancho_impresion",
+ 5 => "t2.alto_impresion",
+
];
diff --git a/ci4/app/Models/Configuracion/MaquinasTarifasImpresionModel.php b/ci4/app/Models/Configuracion/MaquinasTarifasImpresionModel.php
index 62b3e037..2dc1c9f7 100644
--- a/ci4/app/Models/Configuracion/MaquinasTarifasImpresionModel.php
+++ b/ci4/app/Models/Configuracion/MaquinasTarifasImpresionModel.php
@@ -1,4 +1,5 @@
db
->table($this->table . " t1")
@@ -97,24 +98,45 @@ class MaquinasTarifasImpresionModel extends \App\Models\GoBaseModel
);
//JJO
- $builder->where('maquina_id', $maquina_id);
+ $builder->where('maquina_id', $maquina_id);
$builder->where("t1.is_deleted", 0);
-
+
$builder->join("lg_maquinas t2", "t1.maquina_id = t2.id", "left");
return empty($search)
? $builder
: $builder
- ->groupStart()
- ->like("t1.id", $search)
- ->orLike("t1.tipo", $search)
- ->orLike("t1.precio", $search)
- ->orLike("t1.uso", $search)
- ->orLike("t1.id", $search)
- ->orLike("t1.maquina_id", $search)
- ->orLike("t1.tipo", $search)
- ->orLike("t1.precio", $search)
- ->orLike("t1.uso", $search)
- ->groupEnd();
+ ->groupStart()
+ ->like("t1.id", $search)
+ ->orLike("t1.tipo", $search)
+ ->orLike("t1.precio", $search)
+ ->orLike("t1.uso", $search)
+ ->orLike("t1.id", $search)
+ ->orLike("t1.maquina_id", $search)
+ ->orLike("t1.tipo", $search)
+ ->orLike("t1.precio", $search)
+ ->orLike("t1.uso", $search)
+ ->groupEnd();
+ }
+
+ public function getTarifa($maquina_id = -1, $uso = " ", $tipo = " ")
+ {
+ $builder = $this->db
+ ->table($this->table . " t1")
+ ->select(
+ "t1.precio AS precio"
+ );
+
+ //JJO
+ $builder->where('maquina_id', $maquina_id);
+ $builder->where('tipo', $tipo);
+ $builder->where('uso', $uso);
+ $builder->where("t1.is_deleted", 0);
+
+ $tarifas = $builder->get()->getResultArray();
+ if (count($tarifas)>0){
+ return floatval($tarifas[0]['precio']);
+ }
+ return $tarifas;
}
}
diff --git a/ci4/app/Models/Configuracion/PapelGenericoModel.php b/ci4/app/Models/Configuracion/PapelGenericoModel.php
index 1df24bcc..17b68119 100644
--- a/ci4/app/Models/Configuracion/PapelGenericoModel.php
+++ b/ci4/app/Models/Configuracion/PapelGenericoModel.php
@@ -104,8 +104,9 @@ class PapelGenericoModel extends \App\Models\GoBaseModel
$builder = $this->db
->table($this->table . " t1")
->select(
- "t1.nombre AS papel_generico"
+ "t1.id as id, t1.nombre AS nombre"
)
+ ->distinct('t1.id')
->join("lg_papel_impresion t2", "t2.papel_generico_id = t1.id", "left")
->join("lg_maquina_papel_impresion t3", "t3.papel_impresion_id = t2.id", "left")
->join("lg_maquinas t4", "t3.maquina_id = t4.id", "left")
@@ -113,6 +114,7 @@ class PapelGenericoModel extends \App\Models\GoBaseModel
->where("t1.is_deleted", 0)
->where("t2.is_deleted", 0)
+ ->where("t3.active", 1)
->where("t4.is_deleted", 0)
->where("t4.tipo", "impresion")
->where("t5.tipo", $tipo);
@@ -121,15 +123,72 @@ class PapelGenericoModel extends \App\Models\GoBaseModel
if($is_cubierta==true){
$builder->where("t2.cubierta", 1);
}
- else if($is_sobrecubierta==true){
+ }
+ if(!is_null($is_sobrecubierta)){
+ if($is_sobrecubierta==true){
$builder->where("t2.sobrecubierta", 1);
}
}
- return array_unique(array_column($builder->orderBy("t1.nombre", "asc")->get()->getResultArray(), 'papel_generico'));
+ return $builder->orderBy("t1.nombre", "asc")->get()->getResultObject();
}
- public function getGramajeComparador(string $papel_generico_nombre="")
+ public function getGramajeComparador(string $papel_generico_nombre="", $uso="")
+ {
+ if($uso == 'cubierta' || $uso == 'sobrecubierta')
+ $tipo = 'color';
+ else
+ $tipo=$uso; // color y colorhq valen para los dos
+ if($uso == 'bn')
+ $tipo="negro";
+ if($uso == 'bnhq')
+ $tipo="negrohq";
+
+ $builder = $this->db
+ ->table($this->table . " t1")
+ ->select(
+ "t2.gramaje AS text"
+ )
+ ->join("lg_papel_impresion t2", "t2.papel_generico_id = t1.id", "left")
+ ->join("lg_maquina_papel_impresion t3", "t3.papel_impresion_id = t2.id", "left")
+ ->join("lg_maquinas t4", "t3.maquina_id = t4.id", "left")
+ ->join("lg_maquinas_tarifas_impresion t5", "t5.maquina_id = t4.id", "left")
+
+ ->where("t1.is_deleted", 0)
+ ->where("t2.is_deleted", 0)
+ ->where("t2.isActivo", 1)
+ ->where("t3.active", 1)
+ ->where("t4.is_deleted", 0)
+ ->where("t4.tipo", "impresion")
+ ->where("t5.tipo", $tipo)
+ ->where("t1.nombre", $papel_generico_nombre);
+
+ if($uso == 'bn' || $uso == 'bnhq')
+ $builder->where("t2.bn", 1);
+ else if ($uso == 'color' || $uso == 'colorhq')
+ $builder->where("t2.color", 1);
+ else if ($uso == 'cubierta')
+ $builder->where("t2.cubierta", 1);
+ else if ($uso == 'sobrecubierta')
+ $builder->where("t2.sobrecubierta", 1);
+
+ $values = $builder->orderBy("t2.gramaje", "asc")->get()->getResultObject();
+ $id = 1;
+ foreach ($values as $value){
+ $value->id = $id;
+ $id++;
+ }
+ $values_array = array_map( function( $value ) {
+ return $value->text;
+ }, $values );
+ $unique_values = array_unique($values_array);
+ return array_values(array_intersect_key($values, $unique_values));
+
+ }
+
+ //tipo: negro, negrohq, color, colorhq
+ //uso: interior, rotativa, cubierta, sobrecubierta
+ public function getGramajeLineasPresupuesto($papel_generico_id=0, $tipo="", $uso="")
{
$builder = $this->db
->table($this->table . " t1")
@@ -137,11 +196,33 @@ class PapelGenericoModel extends \App\Models\GoBaseModel
"t2.gramaje AS text"
)
->join("lg_papel_impresion t2", "t2.papel_generico_id = t1.id", "left")
+ ->join("lg_maquina_papel_impresion t3", "t3.papel_impresion_id = t2.id", "left")
+ ->join("lg_maquinas t4", "t3.maquina_id = t4.id", "left")
+ ->join("lg_maquinas_tarifas_impresion t5", "t5.maquina_id = t4.id", "left")
->where("t1.is_deleted", 0)
->where("t2.is_deleted", 0)
- ->where("t1.nombre", $papel_generico_nombre);
+ ->where("t2.isActivo", 1)
+ ->where("t3.active", 1)
+ ->where("t4.is_deleted", 0)
+ ->where("t4.tipo", "impresion")
+ ->where("t5.tipo", $tipo)
+ ->where("t1.id", $papel_generico_id);
+ if($tipo == 'negro' || $tipo == 'negrohq')
+ $builder->where("t2.bn", 1);
+ else if ($tipo == 'color' || $tipo == 'colorhq')
+ $builder->where("t2.color", 1);
+ if ($uso == 'cubierta')
+ $builder->where("t2.cubierta", 1);
+ else if ($uso == 'sobrecubierta')
+ $builder->where("t2.sobrecubierta", 1);
+ if($uso=='rotativa')
+ $builder->where("t2.rotativa", 1);
+ else
+ $builder->where("t2.rotativa", 0);
+
+
$values = $builder->orderBy("t2.gramaje", "asc")->get()->getResultObject();
$id = 1;
foreach ($values as $value){
diff --git a/ci4/app/Models/Configuracion/PapelImpresionMargenModel.php b/ci4/app/Models/Configuracion/PapelImpresionMargenModel.php
index 1c320067..a986b135 100644
--- a/ci4/app/Models/Configuracion/PapelImpresionMargenModel.php
+++ b/ci4/app/Models/Configuracion/PapelImpresionMargenModel.php
@@ -1,4 +1,5 @@
where('papel_impresion_id', $papel_impresion_id);
+ $builder->where('papel_impresion_id', $papel_impresion_id);
$builder->where("t1.is_deleted", 0);
return empty($search)
? $builder
: $builder
- ->groupStart()
- ->like("t1.paginas_min", $search)
- ->orLike("t1.paginas_max", $search)
- ->orLike("t1.margen", $search)
- ->orLike("t1.paginas_min", $search)
- ->orLike("t1.paginas_max", $search)
- ->orLike("t1.margen", $search)
- ->groupEnd();
+ ->groupStart()
+ ->like("t1.paginas_min", $search)
+ ->orLike("t1.paginas_max", $search)
+ ->orLike("t1.margen", $search)
+ ->orLike("t1.paginas_min", $search)
+ ->orLike("t1.paginas_max", $search)
+ ->orLike("t1.margen", $search)
+ ->groupEnd();
}
- public function checkIntervals($data = [], $id_linea = null, $papel_impresion_id = null){
-
+ public function checkIntervals($data = [], $id_linea = null, $papel_impresion_id = null)
+ {
+
helper('general');
- if(floatval($data["paginas_min"])>= floatval($data["paginas_max"])){
+ if (floatval($data["paginas_min"]) >= floatval($data["paginas_max"])) {
return lang('PapelImpresionMargenes.validation.error_paginas_range');
}
@@ -119,17 +121,38 @@ class PapelImpresionMargenModel extends \App\Models\GoBaseModel
foreach ($rows as $row) {
- if (!is_null($id_linea)){
- if($row->id == $id_linea){
+ if (!is_null($id_linea)) {
+ if ($row->id == $id_linea) {
continue;
}
}
- if(check_overlap(floatval($data["paginas_min"]), floatval($data["paginas_max"]),
- $row->paginas_min, $row->paginas_max)){
- return lang('PapelImpresionMargenes.validation.error_paginas_overlap');
+ if (check_overlap(
+ floatval($data["paginas_min"]),
+ floatval($data["paginas_max"]),
+ $row->paginas_min,
+ $row->paginas_max
+ )) {
+ return lang('PapelImpresionMargenes.validation.error_paginas_overlap');
}
}
return "";
}
+
+ public function getMargenFormPags($papel_impresion_id = -1, $num_paginas = 0)
+ {
+ $builder = $this->db
+ ->table($this->table . " t1")
+ ->select(
+ "t1.margen AS margen"
+ );
+ //JJO
+ $builder->where('papel_impresion_id', $papel_impresion_id);
+ $builder->where("t1.is_deleted", 0);
+ $builder->where("t1.paginas_min <=", $num_paginas);
+ $builder->where("t1.paginas_max >=", $num_paginas);
+
+
+ return $builder->get()->getResultArray();
+ }
}
diff --git a/ci4/app/Models/Configuracion/PapelImpresionModel.php b/ci4/app/Models/Configuracion/PapelImpresionModel.php
index 2a7e1411..4e53176b 100644
--- a/ci4/app/Models/Configuracion/PapelImpresionModel.php
+++ b/ci4/app/Models/Configuracion/PapelImpresionModel.php
@@ -209,4 +209,122 @@ class PapelImpresionModel extends \App\Models\GoBaseModel
return $builder;
}
+
+ /**
+ * @param null $papel_generico_id
+ * @param null $gramaje
+ * @param mixed $options
+ * array con las opciones para bn,color,cubierta,sobrecubierta,rotativa
+ * @param mixed $is_activo=true
+ *
+ * @return [type]
+ */
+ public function getIdPapelesImpresionForPresupuesto($papel_generico_id = null, $gramaje = null, $options=[]){
+ $bn = array_key_exists('bn', $options) ? $options['bn'] : null;
+ $color = array_key_exists('color', $options)? $options['color'] : null;
+ $cubierta = array_key_exists('cubierta', $options)? $options['cubierta'] : null;
+ $sobrecubierta = array_key_exists('sobrecubierta', $options)? $options['sobrecubierta'] : null;
+ $rotativa = array_key_exists('rotativa', $options)? $options['rotativa'] : null;
+
+ $builder = $this->db
+ ->table($this->table . " t1")
+ ->distinct("t1.id")
+ ->select(
+ "t1.id AS id, t1.nombre AS nombre, t1.papel_generico_id AS papel_generico_id,
+ t1.gramaje as gramaje, t1.espesor AS espesor, t1.precio_tonelada AS precio_tonelada, t1.rotativa AS rotativa");
+
+ $builder->where("t1.is_deleted", 0);
+ $builder->where("t1.isActivo", 1);
+
+ $builder->where("t1.papel_generico_id", $papel_generico_id);
+ $builder->where("t1.gramaje", $gramaje);
+
+ if(!is_null($bn)){
+ $builder->where("t1.bn", $bn);
+ }
+ if(!is_null($color)){
+ $builder->where("t1.color", $color);
+ }
+ if(!is_null($cubierta)){
+ $builder->where("t1.cubierta", $cubierta);
+ }
+ if(!is_null($sobrecubierta)){
+ $builder->where("t1.sobrecubierta", $sobrecubierta);
+ }
+ if(!is_null($rotativa)){
+ $builder->where("t1.rotativa", $rotativa);
+ }
+
+ return $builder->orderBy("t1.id", "asc")->get()->getResultObject();
+ }
+
+ //tipo: negro, negrohq, color, colorhq
+ //uso: interior, rotativa, cubierta, sobrecubierta
+ public function getPapelesImpresionForMenu($papel_generico = null, $gramaje = null, $tipo = null, $uso=""){
+ $builder = $this->db
+ ->table($this->table . " t1")
+ ->distinct("t1.id")
+ ->join("lg_papel_generico t2", "t1.papel_generico_id = t2.id", "left")
+ ->join("lg_maquina_papel_impresion t3", "t1.id = t3.papel_impresion_id", "left")
+ ->join("lg_maquinas t4", "t3.maquina_id = t4.id", "left")
+ ->join("lg_maquinas_tarifas_impresion t5", "t4.id = t5.maquina_id", "left")
+ ->select(
+ "t1.id AS id, t1.nombre AS text");
+
+ $builder->where("t1.is_deleted", 0);
+ $builder->where("t1.isActivo", 1);
+ $builder->where("t2.is_deleted", 0);
+ $builder->where("t3.active", 1);
+ $builder->where("t4.is_deleted", 0);
+ $builder->where("t4.tipo", 'impresion');
+ $builder->where("t5.is_deleted", 0);
+ $builder->where("t5.tipo", $tipo);
+
+ $builder->where("t2.id", $papel_generico);
+ $builder->where("t1.gramaje", $gramaje);
+
+ if($tipo == 'negro' || $tipo == 'negrohq')
+ $builder->where("t1.bn", 1);
+ else if ($tipo == 'color' || $tipo == 'colorhq')
+ $builder->where("t1.color", 1);
+ if ($uso == 'cubierta')
+ $builder->where("t1.cubierta", 1);
+ else if ($uso == 'sobrecubierta')
+ $builder->where("t1.sobrecubierta", 1);
+ if($uso=='rotativa')
+ $builder->where("t1.rotativa", 1);
+ else
+ $builder->where("t1.rotativa", 0);
+/*
+ if($tipo=='negro' || $tipo=='negrohq'){
+ $builder->where("t1.bn", 1);
+ $builder->where("t1.rotativa", 0);
+ }
+ elseif($tipo=='color' || $tipo=='colorhq'){
+ $builder->where("t1.color", 1);
+ $builder->where("t1.rotativa", 0);
+ }
+ elseif($tipo=='cubierta'){
+ $builder->where("t1.cubierta", 1);
+ $builder->where("t1.color", 1);
+ $builder->where("t1.rotativa", 0);
+ }
+ elseif($tipo=='sobrecubierta'){
+ $builder->where("t1.sobrecubierta", 1);
+ $builder->where("t1.color", 1);
+ $builder->where("t1.rotativa", 0);
+ }
+ elseif($tipo=='rot_bn'){
+ $builder->where("t1.bn", 1);
+ $builder->where("t1.rotativa", 1);
+ }
+ elseif($tipo=='rot_color'){
+ $builder->where("t1.color", 1);
+ $builder->where("t1.rotativa", 1);
+ }
+*/
+
+
+ return $builder->orderBy("t1.id", "asc")->get()->getResultObject();
+ }
}
diff --git a/ci4/app/Models/Configuracion/PapelImpresionTipologiaModel.php b/ci4/app/Models/Configuracion/PapelImpresionTipologiaModel.php
index 356c4d9f..f5e47534 100644
--- a/ci4/app/Models/Configuracion/PapelImpresionTipologiaModel.php
+++ b/ci4/app/Models/Configuracion/PapelImpresionTipologiaModel.php
@@ -109,18 +109,21 @@ class PapelImpresionTipologiaModel extends \App\Models\GoBaseModel
return $result;
}
- public function findTipologiasForPapelImpresion(int $papelImpresionID){
+ public function findTipologiasForPapelImpresion(int $papelImpresionID, $tipo=null){
$builder = $this->db
->table($this->table )
->select("*")
->where("papel_impresion_id", $papelImpresionID);
-
+
+ if(!is_null($tipo)){
+ $builder->where("tipo", $tipo);
+ }
return $builder;
-
}
+
public function removeForPapelImpresion($papel_impresion_id){
$builder = $this->db
->table($this->table . " t1")
diff --git a/ci4/app/Models/Presupuestos/PresupuestoAcabadosModel.php b/ci4/app/Models/Presupuestos/PresupuestoAcabadosModel.php
new file mode 100644
index 00000000..ed32bfb4
--- /dev/null
+++ b/ci4/app/Models/Presupuestos/PresupuestoAcabadosModel.php
@@ -0,0 +1,68 @@
+ "t2.nombre",
+ 1 => "t1.precio_unidad",
+ 2 => "t1.precio_total"
+ ];
+
+ protected $allowedFields = ["presupuesto_id", "tarifa_acabado_id", "nombre", "precio_total", "precio_unidad"];
+ protected $returnType = "App\Entities\Presupuestos\PresupuestoAcabadosEntity";
+
+ protected $useTimestamps = true;
+ protected $useSoftDeletes = false;
+
+ protected $createdField = "created_at";
+ protected $updatedField = "updated_at";
+
+ public static $labelField = "nombre";
+
+ protected $validationRules = [
+ "precio_total" => [
+ "label" => "Presupuestos.precioTotal",
+ "rules" => "decimal|required",
+ ],
+ ];
+
+ protected $validationMessages = [
+ "precio_total" => [
+ "decimal" => "Presupuestos.validation.decimal",
+ "requerido" => "Presupuestos.validation.decimal",
+ ],
+ ];
+
+
+ /**
+ * Get resource data.
+ *
+ * @param string $search
+ *
+ * @return \CodeIgniter\Database\BaseBuilder
+ */
+ public function getResource($presupuesto_id = -1)
+ {
+ $builder = $this->db
+ ->table($this->table . " t1")
+ ->select(
+ "t1.id AS id, t1.tarifa_acabado_id AS tarifa_acabado_id, t1.precio_unidad AS precio_unidad, t1.precio_total AS precio_total, t2.nombre AS nombre"
+ );
+
+ $builder->where('t1.presupuesto_id', $presupuesto_id);
+ $builder->join("lg_tarifa_acabado t2", "t1.tarifa_acabado_id = t2.id", "left");
+
+ return $builder;
+ }
+}
diff --git a/ci4/app/Models/Presupuestos/PresupuestoEncuadernacionesModel.php b/ci4/app/Models/Presupuestos/PresupuestoEncuadernacionesModel.php
new file mode 100644
index 00000000..0ad3cf6e
--- /dev/null
+++ b/ci4/app/Models/Presupuestos/PresupuestoEncuadernacionesModel.php
@@ -0,0 +1,68 @@
+ "t2.nombre",
+ 1 => "t1.precio_unidad",
+ 2 => "t1.precio_total"
+ ];
+
+ protected $allowedFields = ["presupuesto_id", "tarifa_encuadernado_id", "nombre", "precio_total", "precio_unidad"];
+ protected $returnType = "App\Entities\Presupuestos\PresupuestoEncuadernacionesEntity";
+
+ protected $useTimestamps = true;
+ protected $useSoftDeletes = false;
+
+ protected $createdField = "created_at";
+ protected $updatedField = "updated_at";
+
+ public static $labelField = "nombre";
+
+ protected $validationRules = [
+ "precio_total" => [
+ "label" => "Presupuestos.precioTotal",
+ "rules" => "decimal|required",
+ ],
+ ];
+
+ protected $validationMessages = [
+ "precio_total" => [
+ "decimal" => "Presupuestos.validation.decimal",
+ "requerido" => "Presupuestos.validation.decimal",
+ ],
+ ];
+
+
+ /**
+ * Get resource data.
+ *
+ * @param string $search
+ *
+ * @return \CodeIgniter\Database\BaseBuilder
+ */
+ public function getResource($presupuesto_id = -1)
+ {
+ $builder = $this->db
+ ->table($this->table . " t1")
+ ->select(
+ "t1.id AS id, t1.tarifa_encuadernado_id AS tarifa_encuadernado_id, t1.precio_unidad AS precio_unidad, t1.precio_total AS precio_total, t2.nombre AS nombre"
+ );
+
+ $builder->where('t1.presupuesto_id', $presupuesto_id);
+ $builder->join("tarifa_encuadernacion t2", "t1.tarifa_encuadernado_id = t2.id", "left");
+
+ return $builder;
+ }
+}
diff --git a/ci4/app/Models/Presupuestos/PresupuestoManipuladosModel.php b/ci4/app/Models/Presupuestos/PresupuestoManipuladosModel.php
new file mode 100644
index 00000000..e45976e8
--- /dev/null
+++ b/ci4/app/Models/Presupuestos/PresupuestoManipuladosModel.php
@@ -0,0 +1,68 @@
+ "t2.nombre",
+ 1 => "t1.precio_unidad",
+ 2 => "t1.precio_total"
+ ];
+
+ protected $allowedFields = ["presupuesto_id", "tarifa_manipulado_id", "nombre", "precio_total", "precio_unidad"];
+ protected $returnType = "App\Entities\Presupuestos\PresupuestoManipuladosEntity";
+
+ protected $useTimestamps = true;
+ protected $useSoftDeletes = false;
+
+ protected $createdField = "created_at";
+ protected $updatedField = "updated_at";
+
+ public static $labelField = "nombre";
+
+ protected $validationRules = [
+ "precio_total" => [
+ "label" => "Presupuestos.precioTotal",
+ "rules" => "decimal|required",
+ ],
+ ];
+
+ protected $validationMessages = [
+ "precio_total" => [
+ "decimal" => "Presupuestos.validation.decimal",
+ "requerido" => "Presupuestos.validation.decimal",
+ ],
+ ];
+
+
+ /**
+ * Get resource data.
+ *
+ * @param string $search
+ *
+ * @return \CodeIgniter\Database\BaseBuilder
+ */
+ public function getResource($presupuesto_id = -1)
+ {
+ $builder = $this->db
+ ->table($this->table . " t1")
+ ->select(
+ "t1.id AS id, t1.tarifa_manipulado_id AS tarifa_manipulado_id, t1.precio_unidad AS precio_unidad, t1.precio_total AS precio_total, t2.nombre AS nombre"
+ );
+
+ $builder->where('t1.presupuesto_id', $presupuesto_id);
+ $builder->join("lg_tarifa_manipulado t2", "t1.tarifa_manipulado_id = t2.id", "left");
+
+ return $builder;
+ }
+}
diff --git a/ci4/app/Models/Presupuestos/PresupuestoModel.php b/ci4/app/Models/Presupuestos/PresupuestoModel.php
index 39ea2f6f..3bdc5f1b 100644
--- a/ci4/app/Models/Presupuestos/PresupuestoModel.php
+++ b/ci4/app/Models/Presupuestos/PresupuestoModel.php
@@ -71,10 +71,11 @@ class PresupuestoModel extends \App\Models\GoBaseModel
"merma",
"merma_portada",
"imagenes_bn_interior",
- "comentarios",
+ "comentarios_cliente",
"comentarios_safekat",
"comentarios_pdf",
"comentarios_tarifa",
+ "comentarios_produccion",
"en_produccion",
"en_espera",
"modo_comparador",
@@ -234,8 +235,8 @@ class PresupuestoModel extends \App\Models\GoBaseModel
"label" => "Presupuestos.coleccion",
"rules" => "trim|max_length[255]",
],
- "comentarios" => [
- "label" => "Presupuestos.comentarios",
+ "comentarios_cliente" => [
+ "label" => "Presupuestos.comentarios_cliente",
"rules" => "trim|required|max_length[16313]",
],
"comentarios_pdf" => [
@@ -250,6 +251,10 @@ class PresupuestoModel extends \App\Models\GoBaseModel
"label" => "Presupuestos.comentariosTarifa",
"rules" => "trim|required|max_length[16313]",
],
+ "comentarios_produccion" => [
+ "label" => "Presupuestos.comentariosProduccion",
+ "rules" => "trim|required|max_length[16313]",
+ ],
"comparador_json_data" => [
"label" => "Presupuestos.comparadorJsonData",
"rules" => "trim|max_length[16313]",
@@ -671,21 +676,25 @@ class PresupuestoModel extends \App\Models\GoBaseModel
"coleccion" => [
"max_length" => "Presupuestos.validation.coleccion.max_length",
],
- "comentarios" => [
- "max_length" => "Presupuestos.validation.comentarios.max_length",
- "required" => "Presupuestos.validation.comentarios.required",
+ "comentarios_cliente" => [
+ "max_length" => "Presupuestos.validation.max_length",
+ "required" => "Presupuestos.validation.required",
],
"comentarios_pdf" => [
- "max_length" => "Presupuestos.validation.comentarios_pdf.max_length",
- "required" => "Presupuestos.validation.comentarios_pdf.required",
+ "max_length" => "Presupuestos.validation.max_length",
+ "required" => "Presupuestos.validation.required",
],
"comentarios_safekat" => [
- "max_length" => "Presupuestos.validation.comentarios_safekat.max_length",
- "required" => "Presupuestos.validation.comentarios_safekat.required",
+ "max_length" => "Presupuestos.validation.max_length",
+ "required" => "Presupuestos.validation.required",
],
"comentarios_tarifa" => [
- "max_length" => "Presupuestos.validation.comentarios_tarifa.max_length",
- "required" => "Presupuestos.validation.comentarios_tarifa.required",
+ "max_length" => "Presupuestos.validation.max_length",
+ "required" => "Presupuestos.validation.required",
+ ],
+ "comentarios_produccion" => [
+ "max_length" => "Presupuestos.validation.max_length",
+ "required" => "Presupuestos.validation.required",
],
"comparador_json_data" => [
"max_length" => "Presupuestos.validation.comparador_json_data.max_length",
diff --git a/ci4/app/Models/Presupuestos/PresupuestoPreimpresionesModel.php b/ci4/app/Models/Presupuestos/PresupuestoPreimpresionesModel.php
new file mode 100644
index 00000000..2cc3627b
--- /dev/null
+++ b/ci4/app/Models/Presupuestos/PresupuestoPreimpresionesModel.php
@@ -0,0 +1,68 @@
+ "t2.nombre",
+ 1 => "t1.precio_unidad",
+ 2 => "t1.precio_total"
+ ];
+
+ protected $allowedFields = ["presupuesto_id", "tarifa_preimpresion_id", "nombre", "precio_total", "precio_unidad"];
+ protected $returnType = "App\Entities\Presupuestos\PresupuestoPreimpresionesEntity";
+
+ protected $useTimestamps = true;
+ protected $useSoftDeletes = false;
+
+ protected $createdField = "created_at";
+ protected $updatedField = "updated_at";
+
+ public static $labelField = "nombre";
+
+ protected $validationRules = [
+ "precio_total" => [
+ "label" => "Presupuestos.precioTotal",
+ "rules" => "decimal|required",
+ ],
+ ];
+
+ protected $validationMessages = [
+ "precio_total" => [
+ "decimal" => "Presupuestos.validation.decimal",
+ "requerido" => "Presupuestos.validation.decimal",
+ ],
+ ];
+
+
+ /**
+ * Get resource data.
+ *
+ * @param string $search
+ *
+ * @return \CodeIgniter\Database\BaseBuilder
+ */
+ public function getResource($presupuesto_id = -1)
+ {
+ $builder = $this->db
+ ->table($this->table . " t1")
+ ->select(
+ "t1.id AS id, t1.tarifa_preimpresion_id AS tarifa_preimpresion_id, t1.precio_unidad AS precio_unidad, t1.precio_total AS precio_total, t2.nombre AS nombre"
+ );
+
+ $builder->where('t1.presupuesto_id', $presupuesto_id);
+ $builder->join("lg_tarifa_preimpresion t2", "t1.tarifa_preimpresion_id = t2.id", "left");
+
+ return $builder;
+ }
+}
diff --git a/ci4/app/Models/Tarifas/TarifaEncuadernacionLineaModel.php b/ci4/app/Models/Tarifas/TarifaEncuadernacionLineaModel.php
index 2c2381aa..ecabd071 100644
--- a/ci4/app/Models/Tarifas/TarifaEncuadernacionLineaModel.php
+++ b/ci4/app/Models/Tarifas/TarifaEncuadernacionLineaModel.php
@@ -13,18 +13,21 @@ class TarifaEncuadernacionLineaModel extends \App\Models\GoBaseModel
protected $useAutoIncrement = true;
const SORTABLE = [
- 0 => "t1.paginas_min",
- 1 => "t1.paginas_max",
+ 0 => "t1.paginas_libro_min",
+ 1 => "t1.paginas_libro_max",
2 => "t1.precio_min",
3 => "t1.precio_max",
];
protected $allowedFields = [
"tirada_encuadernacion_id",
- "paginas_min",
- "paginas_max",
+ "paginas_libro_min",
+ "paginas_libro_max",
+ "dimensiones_id",
"precio_min",
"precio_max",
+ "tirada_min",
+ "tirada_max",
"user_created_id",
"is_deleted",
@@ -49,11 +52,19 @@ class TarifaEncuadernacionLineaModel extends \App\Models\GoBaseModel
"label" => "TarifaEncuadernacionLineas.precioMin",
"rules" => "required|decimal",
],
- "paginas_max" => [
+ "tirada_max" => [
+ "label" => "TarifaEncuadernacionLineas.tiradaMax",
+ "rules" => "required|decimal",
+ ],
+ "tirada_min" => [
+ "label" => "TarifaEncuadernacionLineas.tiradaMin",
+ "rules" => "required|decimal",
+ ],
+ "paginas_libro_max" => [
"label" => "TarifaEncuadernacionLineas.paginasMax",
"rules" => "required|decimal",
],
- "paginas_min" => [
+ "paginas_libro_min" => [
"label" => "TarifaEncuadernacionLineas.paginasMin",
"rules" => "required|decimal",
],
@@ -72,13 +83,21 @@ class TarifaEncuadernacionLineaModel extends \App\Models\GoBaseModel
"decimal" => "TarifaEncuadernacionLineas.validation.precio_min.decimal",
"required" => "TarifaEncuadernacionLineas.validation.precio_min.required",
],
- "paginas_max" => [
- "decimal" => "TarifaEncuadernacionLineas.validation.paginas_max.decimal",
- "required" => "TarifaEncuadernacionLineas.validation.paginas_max.required",
+ "tirada_max" => [
+ "decimal" => "TarifaEncuadernacionLineas.validation.tirada_max.decimal",
+ "required" => "TarifaEncuadernacionLineas.validation.tirada_max.required",
],
- "paginas_min" => [
- "decimal" => "TarifaEncuadernacionLineas.validation.paginas_min.decimal",
- "required" => "TarifaEncuadernacionLineas.validation.paginas_min.required",
+ "tirada_min" => [
+ "decimal" => "TarifaEncuadernacionLineas.validation.tirada_min.decimal",
+ "required" => "TarifaEncuadernacionLineas.validation.tirada_min.required",
+ ],
+ "paginas_libro_max" => [
+ "decimal" => "TarifaEncuadernacionLineas.validation.paginas_libro_max.decimal",
+ "required" => "TarifaEncuadernacionLineas.validation.paginas_libro_max.required",
+ ],
+ "paginas_libro_min" => [
+ "decimal" => "TarifaEncuadernacionLineas.validation.paginas_libro_min.decimal",
+ "required" => "TarifaEncuadernacionLineas.validation.paginas_libro_min.required",
],
"margen" => [
"decimal" => "TarifaEncuadernacionLineas.validation.margen.decimal",
@@ -98,7 +117,7 @@ class TarifaEncuadernacionLineaModel extends \App\Models\GoBaseModel
$builder = $this->db
->table($this->table . " t1")
->select(
- "t1.id AS id, t1.tirada_encuadernacion_id AS tirada_encuadernacion_id, t1.paginas_min AS paginas_min, t1.paginas_max AS paginas_max, t1.precio_min AS precio_min, t1.precio_max AS precio_max, t1.margen AS margen, t2.id AS tarifa_encuadernacion"
+ "t1.id AS id, t1.tirada_encuadernacion_id AS tirada_encuadernacion_id, t1.paginas_libro_min AS paginas_libro_min, t1.paginas_libro_max AS paginas_libro_max, t1.precio_min AS precio_min, t1.precio_max AS precio_max, t1.tirada_min AS tirada_min, t1.tirada_max AS tirada_max, t1.margen AS margen, t2.id AS tarifa_encuadernacion"
);
//JJO
$builder->where('tirada_encuadernacion_id', $tirada_encuadernacion_id);
@@ -113,16 +132,12 @@ class TarifaEncuadernacionLineaModel extends \App\Models\GoBaseModel
->groupStart()
->like("t1.id", $search)
->orLike("t1.tirada_encuadernacion_id", $search)
- ->orLike("t1.paginas_min", $search)
- ->orLike("t1.paginas_max", $search)
- ->orLike("t1.precio_min", $search)
- ->orLike("t1.precio_max", $search)
- ->orLike("t1.id", $search)
- ->orLike("t1.tirada_encuadernacion_id", $search)
- ->orLike("t1.paginas_min", $search)
- ->orLike("t1.paginas_max", $search)
+ ->orLike("t1.paginas_libro_min", $search)
+ ->orLike("t1.paginas_libro_max", $search)
->orLike("t1.precio_min", $search)
->orLike("t1.precio_max", $search)
+ ->orLike("t1.tirada_min", $search)
+ ->orLike("t1.tirada_max", $search)
->groupEnd();
}
@@ -130,13 +145,13 @@ class TarifaEncuadernacionLineaModel extends \App\Models\GoBaseModel
helper('general');
- if(floatval($data["paginas_min"])>= floatval($data["paginas_max"])){
+ if(floatval($data["paginas_libro_min"])>= floatval($data["paginas_libro_max"])){
return lang('TarifaEncuadernacionLineas.validation.error_paginas_range');
}
$rows = $this->db
->table($this->table)
- ->select("id, paginas_min, paginas_max")
+ ->select("id, paginas_libro_min, paginas_libro_max")
->where("is_deleted", 0)
->where("tirada_encuadernacion_id", $tirada_encuadernacion_id)
->get()->getResultObject();
@@ -148,8 +163,8 @@ class TarifaEncuadernacionLineaModel extends \App\Models\GoBaseModel
continue;
}
}
- if(check_overlap(floatval($data["paginas_min"]), floatval($data["paginas_max"]),
- $row->paginas_min, $row->paginas_max)){
+ if(check_overlap(floatval($data["paginas_libro_min"]), floatval($data["paginas_libro_max"]),
+ $row->paginas_libro_min, $row->paginas_libro_max)){
return lang('TarifaEncuadernacionLineas.validation.error_paginas_overlap');
}
}
diff --git a/ci4/app/Models/Tarifas/TarifaEncuadernacionModel.php b/ci4/app/Models/Tarifas/TarifaEncuadernacionModel.php
index 05be7bda..5604acee 100644
--- a/ci4/app/Models/Tarifas/TarifaEncuadernacionModel.php
+++ b/ci4/app/Models/Tarifas/TarifaEncuadernacionModel.php
@@ -94,4 +94,22 @@ class TarifaEncuadernacionModel extends \App\Models\GoBaseModel
->like("t1.nombre", $search)
->groupEnd();
}
+
+ public function getServiciosEncuadernacionSelector()
+ {
+ /*
+ Todos los servicios de encuadernacion activas que se pueden usar en presupuestos
+ */
+ $builder = $this->db
+ ->table($this->table . " t1")
+ ->select(
+ "t1.id as value, t1.nombre AS label"
+ )
+ ->where("t1.is_deleted", 0)
+ ->where("t1.mostrar_en_presupuesto", 1);
+
+ return $builder->orderBy("t1.nombre", "asc")->get()->getResultObject();
+ }
+
+
}
diff --git a/ci4/app/Models/Tarifas/TarifaManipuladoModel.php b/ci4/app/Models/Tarifas/TarifaManipuladoModel.php
index 8afc3ab4..33c1607f 100644
--- a/ci4/app/Models/Tarifas/TarifaManipuladoModel.php
+++ b/ci4/app/Models/Tarifas/TarifaManipuladoModel.php
@@ -93,4 +93,20 @@ class TarifaManipuladoModel extends \App\Models\GoBaseModel
->like("t1.nombre", $search)
->groupEnd();
}
+
+ public function getServiciosManipuladoSelector()
+ {
+ /*
+ Todos los servicios de manipulado activas que se pueden usar en presupuestos
+ */
+ $builder = $this->db
+ ->table($this->table . " t1")
+ ->select(
+ "t1.id as value, t1.nombre AS label"
+ )
+ ->where("t1.is_deleted", 0)
+ ->where("t1.mostrar_en_presupuesto", 1);
+
+ return $builder->orderBy("t1.nombre", "asc")->get()->getResultObject();
+ }
}
diff --git a/ci4/app/Models/Tarifas/TarifaacabadoModel.php b/ci4/app/Models/Tarifas/TarifaacabadoModel.php
index 8d9d209d..ddadf1d5 100644
--- a/ci4/app/Models/Tarifas/TarifaacabadoModel.php
+++ b/ci4/app/Models/Tarifas/TarifaacabadoModel.php
@@ -94,4 +94,22 @@ class TarifaacabadoModel extends \App\Models\GoBaseModel
->like("t1.nombre", $search)
->groupEnd();
}
+
+ public function getServiciosAcabadoSelector()
+ {
+ /*
+ Todos los servicios de acabado activos que se pueden usar en presupuestos
+ */
+ $builder = $this->db
+ ->table($this->table . " t1")
+ ->select(
+ "t1.id as value, t1.nombre AS label"
+ )
+ ->where("t1.is_deleted", 0)
+ ->where("t1.mostrar_en_presupuesto", 1);
+
+ return $builder->orderBy("t1.nombre", "asc")->get()->getResultObject();
+ }
+
+
}
diff --git a/ci4/app/Models/Tarifas/TarifapreimpresionModel.php b/ci4/app/Models/Tarifas/TarifapreimpresionModel.php
index 0de5263f..7d94e40d 100644
--- a/ci4/app/Models/Tarifas/TarifapreimpresionModel.php
+++ b/ci4/app/Models/Tarifas/TarifapreimpresionModel.php
@@ -79,4 +79,22 @@ class TarifapreimpresionModel extends \App\Models\GoBaseModel
"decimal" => "Tarifapreimpresion.validation.margen.decimal",
],
];
+
+ public function getServiciosPreimpresionSelector()
+ {
+ /*
+ Todos los servicios de preimpresion activas que se pueden usar en presupuestos
+ */
+ $builder = $this->db
+ ->table($this->table . " t1")
+ ->select(
+ "t1.id as value, t1.nombre AS label"
+ )
+ ->where("t1.is_deleted", 0)
+ ->where("t1.mostrar_en_presupuesto", 1);
+
+ return $builder->orderBy("t1.nombre", "asc")->get()->getResultObject();
+ }
+
+
}
diff --git a/ci4/app/Services/PresupuestoService.php b/ci4/app/Services/PresupuestoService.php
index 6c2eb28d..81ddd6a3 100644
--- a/ci4/app/Services/PresupuestoService.php
+++ b/ci4/app/Services/PresupuestoService.php
@@ -4,24 +4,416 @@ namespace App\Services;
use CodeIgniter\Config\BaseService;
-use App\Models\Configuracion\PapelGenericoModel;
+
+
class PresupuestoService extends BaseService
{
- public static function example(){
- return 'Hola';
+ /**
+ * CONSTANTES USADAS PARA LOS CALCULOS
+ */
+
+ const MARGEN_PAGINAS_ROTATIVA = 15.0;
+
+
+ /**
+ * @param mixed $uso
+ * contiene algun parametro de la lista ['interior,'cubierta','sobrecubierta']
+ * @param mixed $tipo
+ * contiene algun parametro de la lista ['negro','color','negrohq','bicolor','colorhq']
+ * @param mixed $datosPedido
+ * objeto con la siguiente extructura:
+ * -> paginas: numero de paginas por libro
+ * -> tirada: numero de unidades a imprimir
+ * -> merma: unidades que se añaden a la tirada
+ *
+ * @param mixed $maquina
+ * objeto con la siguiente estructura:
+ * -> id: el id de la maquina
+ * -> nombre: nombre de la maquina
+ * -> ancho_impresion: valor maximo del ancho para imprimir
+ * -> alto_impresion: valor maximo del alto para imprimir
+ * @param mixed $papel_impresion
+ * @param mixed $tarifa
+ *
+ * @return [type]
+ */
+ public static function getCostesLinea($uso, $datosPedido, $maquina, $papel_impresion, $opciones_papel, $tarifa)
+ {
+ $response['fields'] = [];
+
+ if ($uso!='rotativa') {
+ $formas = PresupuestoService::getNumFormasPlana($uso, $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;
+ }
+
+ // precio del pliego de impresion
+ $precio_pliego_impresion = PresupuestoService::getPrecioPliego($maquina, $papel_impresion, $datosPedido->paginas);
+ $precio_click = 0;
+ $precio_click_pedido = 0;
+ $pliegos_libro = 0;
+
+ $cubierta = array_key_exists('cubierta', $opciones_papel) ? $opciones_papel['cubierta'] : 0;
+ $sobrecubierta = array_key_exists('sobrecubierta', $opciones_papel) ? $opciones_papel['sobrecubierta'] : 0;
+ $rotativa = array_key_exists('rotativa', $opciones_papel) ? $opciones_papel['rotativa'] : 0;
+
+ //interior (bn o color)
+ if ($cubierta == 0 && $sobrecubierta == 0 && $rotativa == 0) {
+ // precio papel
+ $pliegos_libro = ($datosPedido->paginas / 2.0) / $response['fields']['num_formas']['value'];
+ $pliegos_pedido = $pliegos_libro * ($datosPedido->tirada + $datosPedido->merma);
+ $precio_libro = $pliegos_libro * $precio_pliego_impresion;
+ $precio_pedido = $precio_libro * ($datosPedido->tirada + $datosPedido->merma);
+
+ $mano = PresupuestoService::computeLomoInterior($datosPedido->paginas, $papel_impresion->espesor);
+
+ // peso
+ $peso = PresupuestoService::computePeso(
+ ancho: $datosPedido->isCosido ? $datosPedido->ancho / 2.0 : $datosPedido->ancho,
+ alto: $datosPedido->alto,
+ gramaje: $papel_impresion->gramaje,
+ paginas: $datosPedido->paginas
+ );
+
+ // impresion
+ $precio_click = $tarifa;
+ $precio_click_pedido = $pliegos_pedido * 2 * $precio_click;
+
+ }
+ // cubierta o sobrecubierta (siempre a color)
+ else if (($cubierta == 1 || $sobrecubierta == 1) && $rotativa == 0) {
+ // precio papel
+ $pliegos_libro = 1.0 / $response['fields']['num_formas']['value'];
+ // En cubierta y sobrecubierta siempre el mínimo pliego es 1
+ $pliegos_libro = $pliegos_libro<1?1:$pliegos_libro;
+ $pliegos_pedido = $pliegos_libro * ($datosPedido->tirada + $datosPedido->merma);
+ $precio_libro = $pliegos_libro * $precio_pliego_impresion;
+ $precio_pedido = $precio_libro * ($datosPedido->tirada + $datosPedido->merma);
+
+ $mano = PresupuestoService::computeLomoPortada($papel_impresion->espesor);
+
+ // peso
+ $ancho_total = $datosPedido->solapas? $datosPedido->ancho + $datosPedido->solapas_ancho:$datosPedido->ancho;
+ $peso = PresupuestoService::computePeso($ancho_total, $datosPedido->alto, $papel_impresion->gramaje);
+
+ // impresion
+ if ($tarifa) {
+ $precio_click = $tarifa;
+ $precio_click_pedido = $pliegos_pedido * $precio_click;
+
+ // dos caras
+ if($datosPedido->paginas > 2) {
+ $precio_click_pedido *= 2.0;
+ }
+ }
+ }
+
+
+ // response
+ $response['fields']['pliegos_libro'] = $pliegos_libro;
+ $response['fields']['pliegos_pedido'] = $pliegos_pedido;
+ $response['fields']['precios_pliegos'] = $precio_pliego_impresion;
+ $response['fields']['precio_libro'] = $precio_libro;
+ $response['fields']['precio_pedido'] = $precio_pedido;
+ $response['fields']['mano'] = $mano;
+ $response['fields']['peso'] = $peso;
+ $response['fields']['precio_click'] = $precio_click;
+ $response['fields']['precio_click_pedido'] = $precio_click_pedido;
+
+ $response['fields']['dimensiones_maquina'] = [$maquina->ancho, $maquina->alto];
+ $response['fields']['dimensiones_maquina_impresion'] = [$maquina->ancho_impresion, $maquina->alto_impresion];
+ $response['fields']['dimensiones_maquina_click'] = [$maquina->ancho_impresion, $maquina->alto_click];
+ $response['fields']['dimensiones_libro'] = [$datosPedido->ancho, $datosPedido->alto];
+
+ //$response['fields']['datos_rotativa'] = $datos_rotativa;
+
+ return $response;
}
- /*
+
/**
- * getPapelForMenu.
- * Devuelve la lista de papeles disponibles
- *
- * @param mixed $tipo_impresion
- * @param mixed $dimensiones
- * @return mixed
+ * Devuelve los calculos para la linea de rotativa.
*/
- public static function test(){
+ public static function getCostesLineaRotativa($maquina, $papel_impresion, $datosPedido, $parametrosRotativa)
+ {
+ $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;
+ }
+ }
+
+ // 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'] * ($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);
+
+ // calculo de corte
+ $data['tiempo_corte'] = $maquina->velocidad_corte > 0 ? round($metros_papel_total / $maquina->velocidad_corte, 2) : 0;
+ $data['total_corte'] = round(($data['tiempo_corte'] / 60.0) * $maquina->precio_hora_corte, 2);
+
+ $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
+ );
+
+ return $data;
}
+
+
+ public static function getNumFormasPlana($uso, $maquina, $ancho, $alto, $isCosido)
+ {
+ // El ancho si es cosido es el doble
+ if($uso != 'cubierta' && $uso != 'sobrecubierta'){
+ $anchoForCalculo = $isCosido ? $ancho * 2 : $ancho;
+ }
+ else{
+ $anchoForCalculo = $ancho;
+ }
+
+ if($uso == 'cubierta' || $uso == 'sobrecubierta') {
+ if(property_exists($maquina, 'forzar_num_formas_horizontales_cubierta') &&
+ property_exists($maquina, 'forzar_num_formas_horizontales_cubierta')){
+
+ if($maquina->forzar_num_formas_horizontales_cubierta > 0 &&
+ $maquina->forzar_num_formas_horizontales_cubierta > 0){
+
+ $h1_temp = $maquina->forzar_num_formas_horizontales_cubierta;
+ $h2_temp = $maquina->forzar_num_formas_verticales_cubierta;
+ //$num_formas = $h1_temp * $h2_temp;
+ }
+ else{
+ $h1_temp == 0;
+ $h2_temp == 0;
+ }
+ }
+ else{
+ $h1_temp == 0;
+ $h2_temp == 0;
+ }
+ }
+ // No es cubierta ni sobrecubierta
+ else{
+ // horizontales
+ $h1_temp = floor($maquina->ancho_impresion / $anchoForCalculo);
+ $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_impresion / $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_impresion / $anchoForCalculo);
+ $formas_v = $h2 * $v2; //p2
+
+
+ // Se calcula el numero de formas
+ if($uso != 'cubierta' && $uso != 'sobrecubierta'){
+ $num_formas = ($formas_h > $formas_v) ? $formas_h : $formas_v;
+ $num_formas = $isCosido ? $num_formas * 2 : $num_formas;
+ }
+ else{
+ $num_formas = $h1*$h2;
+ }
+
+
+ // 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) {
+ $response['num_formas']['posicion_formas'] = 'h';
+ $response['num_formas']['num_formas_horizontales'] = $h1;
+ $response['num_formas']['num_formas_verticales'] = $v1;
+ $response['num_formas']['value'] = $num_formas;
+ } else {
+ $response['num_formas']['posicion_formas'] = 'v';
+ $response['num_formas']['num_formas_horizontales'] = $h2;
+ $response['num_formas']['num_formas_verticales'] = $v2;
+ $response['num_formas']['value'] = $num_formas;
+ }
+
+ if($uso == 'cubierta' || $uso == 'sobrecubierta') {
+ if(property_exists($maquina, 'forzar_num_formas_horizontales_cubierta') &&
+ property_exists($maquina, 'forzar_num_formas_horizontales_cubierta')){
+
+ $response['num_formas']['num_formas_verticales'] = $h2;
+ }
+ }
+
+ return $response;
+ }
+
+
+ public static function getPrecioPliego($maquina, $papel_impresion, $paginas)
+ {
+ $margen = (new \App\Models\Configuracion\PapelImpresionMargenModel())->getMargenFormPags($papel_impresion->id, $paginas);
+ if (count($margen) > 0) {
+ $peso_por_pliego = $maquina->alto * $maquina->ancho * $papel_impresion->gramaje / 1000000;
+ $precio_pliego = ($peso_por_pliego * $papel_impresion->precio_tonelada / 1000000.0) * (1 + (floatval($margen[0]['margen']) / 100.0));
+
+ return round($precio_pliego, 6);
+ }
+ return -1;
+ }
+
+ public static function getTiempoMaquina($totalClicks, $precioClick, $velocidadMaquina) {
+ try {
+
+ if($precioClick>0 && $velocidadMaquina>0)
+ $minutos = (1.0*$totalClicks/$precioClick)/$velocidadMaquina;
+ else
+ $minutos = 0;
+
+ return gmdate("H:i:s", round($minutos*60,0));
+
+ } catch (Exception $e) {
+ return gmdate("H:i:s", round(0,0));
+ }
+ }
+
+
+ /**
+ * Devuelve la dimensión del lomo interior.
+ */
+ private static function computeLomoInterior($paginas = null, $espesor = null)
+ {
+ $lomo = 0;
+
+ if (!is_null($paginas) && !is_null($espesor)) {
+
+ $lomo += (($espesor * $paginas / 2.0) + 1) / 1000.0;
+ }
+
+ return $lomo;
+ }
+
+ /**
+ * Calcula la dimensión del lomo para portada y cubierta
+ */
+ private static function computeLomoPortada($espesor)
+ {
+ return ($espesor * 2.0) / 1000.0;
+ }
+
+ /**
+ * Devuelve el peso de un pedido.
+ */
+ private static function computePeso($ancho, $alto, $gramaje, $paginas = null)
+ {
+ $peso = ($ancho / 1000.0) * ($alto / 1000.0) * $gramaje;
+
+ if (!is_null($paginas)) {
+ if ($paginas > 0) {
+ $peso *= ($paginas / 2.0);
+ }
+ }
+
+ return $peso;
+ }
+
+
}
-
\ No newline at end of file
diff --git a/ci4/app/Views/themes/_commonPartialsBs/_confirm2delete.php b/ci4/app/Views/themes/_commonPartialsBs/_confirm2delete.php
index 50e7ee0b..56322188 100644
--- a/ci4/app/Views/themes/_commonPartialsBs/_confirm2delete.php
+++ b/ci4/app/Views/themes/_commonPartialsBs/_confirm2delete.php
@@ -13,7 +13,7 @@
diff --git a/ci4/app/Views/themes/_commonPartialsBs/datatables.php b/ci4/app/Views/themes/_commonPartialsBs/datatables.php
index 6ee8d97d..c8224ef3 100644
--- a/ci4/app/Views/themes/_commonPartialsBs/datatables.php
+++ b/ci4/app/Views/themes/_commonPartialsBs/datatables.php
@@ -175,6 +175,12 @@
$(this).find('.btn-confirm').attr('href', $(e.relatedTarget).data('href'));
});
+ $('#confirm2delete').keypress(function(e) { // Attach the form handler to the keypress event
+ if (e.keyCode == 13) { // If the the enter key was pressed.
+ $('#confirmDelete').click(); // Trigger the button(elementId) click event.
+ }
+ });
+
function toggleAllCheckboxes($cssClass, $io=null) {
$('.'+$cssClass).prop('checked', $io);
}
diff --git a/ci4/app/Views/themes/backend/vuexy/form/configuracion/formas-pago/_formaPagoFormItems.php b/ci4/app/Views/themes/backend/vuexy/form/configuracion/formas-pago/_formaPagoFormItems.php
deleted file mode 100644
index 205027a8..00000000
--- a/ci4/app/Views/themes/backend/vuexy/form/configuracion/formas-pago/_formaPagoFormItems.php
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/ci4/app/Views/themes/backend/vuexy/form/configuracion/formas-pago/viewFormaPagoForm.php b/ci4/app/Views/themes/backend/vuexy/form/configuracion/formas-pago/viewFormaPagoForm.php
deleted file mode 100644
index 1ddbfce1..00000000
--- a/ci4/app/Views/themes/backend/vuexy/form/configuracion/formas-pago/viewFormaPagoForm.php
+++ /dev/null
@@ -1,26 +0,0 @@
-= $this->include("themes_commonPartialsBs/select2bs5") ?>
-= $this->include("themes_commonPartialsBs/sweetalert") ?>
-= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>
-= $this->section("content") ?>
-
-= $this->endSection() ?>
diff --git a/ci4/app/Views/themes/backend/vuexy/form/configuracion/formas-pago/viewFormaPagoList.php b/ci4/app/Views/themes/backend/vuexy/form/configuracion/formas-pago/viewFormaPagoList.php
deleted file mode 100644
index 07526fb2..00000000
--- a/ci4/app/Views/themes/backend/vuexy/form/configuracion/formas-pago/viewFormaPagoList.php
+++ /dev/null
@@ -1,141 +0,0 @@
-=$this->include('themes_commonPartialsBs/datatables') ?>
-=$this->include('themes_commonPartialsBs/sweetalert') ?>
-=$this->extend('themes'.config('Basics')->theme['name'].'/AdminLayout/defaultLayout') ?>
-=$this->section('content'); ?>
-
-
-
-
-
-
- = view('themes_commonPartialsBs/_alertBoxes'); ?>
-
-
-
-
-
-
-
-
-=$this->endSection() ?>
-
-
-=$this->section('additionalInlineJs') ?>
-
- const lastColNr2 = $(".using-exportable-data-table").find("tr:first th").length - 1;
- theTable = $('.using-exportable-data-table').DataTable({
- "responsive": true,
- "paging": true,
- "lengthMenu": [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
- "pageLength": 10,
- "lengthChange": true,
- "searching": true,
- "ordering": true,
- "info": true,
- "dom": 'lfrtipB', // 'lfBrtip', // you can try different layout combinations by uncommenting one or the other
- // "dom": '<"top"lf><"clear">rt<"bottom"ipB><"clear">', // remember to comment this line if you uncomment the above
- "buttons": [
- 'copy', 'csv', 'excel', 'print', {
- extend: 'pdfHtml5',
- orientation: 'landscape',
- pageSize: 'A4'
- }
- ],
- "autoWidth": true,
- "scrollX": true,
- "stateSave": true,
- "language": {
- url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/= config('Basics')->i18n ?>.json"
- },
- "columnDefs": [
- {
- orderable: false,
- searchable: false,
- targets: [0,lastColNr2]
- }
- ]
- });
-
-
-
-
- $(document).on('click', '.btn-delete', function(e) {
- e.preventDefault();
- const dataHref = $(this).data('href');
- Swal.fire({
- title: "= lang('Basic.global.sweet.sureToDeleteTitle', [lang('FormasPagoes.forma pago')]) ?>",
- text: "= lang('Basic.global.sweet.sureToDeleteText') ?>",
- icon: 'warning',
- showCancelButton: true,
- confirmButtonColor: '#3085d6',
- confirmButtonText: '= lang('Basic.global.sweet.deleteConfirmationButton') ?>',
- cancelButtonText: '= lang('Basic.global.Cancel') ?>',
- cancelButtonColor: '#d33'
- }).then((result) => {
- if (result.value) {
- window.location.href = `${dataHref}`;
- }
- });
- });
-
-
-=$this->endSection() ?>
-
-
-=$this->section('css') ?>
-
-=$this->endSection() ?>
-
-
-= $this->section('additionalExternalJs') ?>
-
-
-
-
-
-
-
-=$this->endSection() ?>
-
diff --git a/ci4/app/Views/themes/backend/vuexy/form/configuracion/maquinas/_maquinaFormItems.php b/ci4/app/Views/themes/backend/vuexy/form/configuracion/maquinas/_maquinaFormItems.php
index 62e8bedd..292c590a 100644
--- a/ci4/app/Views/themes/backend/vuexy/form/configuracion/maquinas/_maquinaFormItems.php
+++ b/ci4/app/Views/themes/backend/vuexy/form/configuracion/maquinas/_maquinaFormItems.php
@@ -101,16 +101,16 @@
= lang('Maquinas.forzarNumFormasHorizontalesPortada') ?>
+ name="forzar_num_formas_horizontales_cubierta" maxLength="11" class="form-control"
+ value="= old('forzar_num_formas_horizontales_cubierta', $maquina->forzar_num_formas_horizontales_cubierta) ?>">
+ name="forzar_num_formas_verticales_cubierta" maxLength="11" class="form-control"
+ value="= old('forzar_num_formas_verticales_cubierta', $maquina->forzar_num_formas_verticales_cubierta) ?>">