Merge branch 'dev/presupuestos3' into 'main'

Dev/presupuestos3

See merge request jjimenez/safekat!75
This commit is contained in:
Ignacio Martinez Navajas
2023-11-14 12:08:11 +00:00
108 changed files with 38175 additions and 3205 deletions

4
.idea/php.xml generated
View File

@ -10,7 +10,9 @@
<option name="highlightLevel" value="WARNING" />
<option name="transferred" value="true" />
</component>
<component name="PhpProjectSharedConfiguration" php_language_level="7.3" />
<component name="PhpProjectSharedConfiguration" php_language_level="8.0">
<option name="suggestChangeDefaultLanguageLevel" value="false" />
</component>
<component name="PhpStanOptionsConfiguration">
<option name="transferred" value="true" />
</component>

View File

@ -22,8 +22,8 @@ CI_ENVIRONMENT = development
# APP
#--------------------------------------------------------------------
app.baseURL = 'https://sk-jjo.imnavajas.es'
#app.baseURL = 'https://sk-imn.imnavajas.es'
app.baseURL = 'https://sk-jjo.imnavajas.es'
# app.baseURL = 'https://sk-imn.imnavajas.es'
# app.baseURL = "http://safekat.test/"
# app.forceGlobalSecureRequests = false

View File

@ -43,6 +43,7 @@ class Autoload extends AutoloadConfig
public $psr4 = [
APP_NAMESPACE => APPPATH, // For custom app namespace
'Config' => APPPATH . 'Config',
'Dompdf' => APPPATH . 'ThirdParty/dompdf/src',
];
/**

View File

@ -50,7 +50,6 @@ $routes->delete('api/user/(:segment)', 'Api::user/delete/$1');
* Route Definitions
* --------------------------------------------------------------------
*/
$routes->group('tarifaacabado', ['namespace' => 'App\Controllers\Tarifas'], function ($routes) {
$routes->get('', 'Tarifaacabado::index', ['as' => 'tarifaAcabadoList']);
$routes->get('index', 'Tarifaacabado::index', ['as' => 'tarifaAcabadoIndex']);
@ -472,13 +471,41 @@ $routes->group('cosidotapablanda', ['namespace' => 'App\Controllers\Presupuestos
$routes->post('add', 'Cosidotapablanda::add', ['as' => 'createCosidotapablanda']);
$routes->post('create', 'Cosidotapablanda::create', ['as' => 'ajaxCreateCosidotapablanda']);
$routes->put('(:num)/update', 'Cosidotapablanda::update/$1', ['as' => 'ajaxUpdateCosidotapablanda']);
$routes->post('(:num)/edit', 'Cosidotapablanda::edit/$1', ['as' => 'updateCosidotapablanda']);
$routes->post('edit/(:num)', 'Cosidotapablanda::edit/$1', ['as' => 'updateCosidotapablanda']);
$routes->post('datatable', 'Cosidotapablanda::datatable', ['as' => 'dataTableOfCosidotapablanda']);
$routes->post('datatable_2', 'Cosidotapablanda::datatable_2', ['as' => 'updateDataOfCosidotapablanda']);
$routes->post('allmenuitems', 'Cosidotapablanda::allItemsSelect', ['as' => 'select2ItemsOfCosidotapablanda']);
$routes->post('menuitems', 'Cosidotapablanda::menuItems', ['as' => 'menuItemsOfCosidotapablanda']);
});
$routes->resource('cosidotapablanda', ['namespace' => 'App\Controllers\Presupuestos', 'controller' => 'Cosidotapablanda', 'except' => 'show,new,create,update']);
$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']);
});
$routes->group('printpresupuestos', ['namespace' => 'App\Controllers\Pdf'], function ($routes) {
$routes->get('', 'PrintPresupuestos::index', ['as' => 'viewPresupuesto']);
$routes->get('generar', 'PrintPresupuestos::generar', ['as' => 'presupuestoToPdf']);
});
/*
* --------------------------------------------------------------------
* Additional Routing

View File

@ -312,11 +312,16 @@ class Cliente extends \App\Controllers\GoBaseResourceController
$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);
try{
$menu = $this->model->getSelect2MenuItems($columns2select, $columns2select[1], $onlyActiveOnes, $searchStr);
$nonItem = new \stdClass;
$nonItem->id = '';
$nonItem->text = '- ' . lang('Basic.global.None') . ' -';
array_unshift($menu, $nonItem);
}
catch(Exception $e){
$menu = [];
}
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();

View File

@ -1,46 +0,0 @@
<?php
namespace App\Controllers\Clientes;
use App\Controllers\BaseController;
class Tarifacliente extends BaseController
{
function __construct()
{
}
public function index()
{
$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 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);
}
}

View File

@ -1,232 +0,0 @@
<?php namespace App\Controllers\Configuracion;
use App\Entities\Configuracion\FormasPagoEntity;
class Formaspago extends \App\Controllers\GoBaseController
{
use \CodeIgniter\API\ResponseTrait;
protected static $primaryModelName = 'App\Models\Configuracion\FormasPagoModel';
protected static $singularObjectNameCc = 'formaPago';
protected static $singularObjectName = 'Forma Pago';
protected static $pluralObjectName = 'Formas Pago';
protected static $controllerSlug = 'formaspago';
protected static $viewPath = 'themes/backend/vuexy/form/configuracion/formas-pago/';
protected $indexRoute = 'formaPagoList';
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
{
$this->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);
}
}
}

View File

@ -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;

View File

@ -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,

View File

@ -255,18 +255,28 @@ abstract class GoBaseResourceController extends \CodeIgniter\RESTful\ResourceCon
/**
* Convenience method to validate form submission
* JJO: Se le añade las reglas y los mensajes custom
* @return bool
*/
protected function canValidate()
protected function canValidate($customValidationRules = null, $customValidationMessages = null)
{
$validationRules = $this->model->validationRules ?? $this->formValidationRules ?? null;
if($customValidationRules == null){
$validationRules = $this->model->validationRules ?? $this->formValidationRules ?? null;
}
else{
$validationRules = $customValidationRules;
}
if ($validationRules == null) {
return true;
}
$validationErrorMessages = $this->model->validationMessages ?? $this->formValidationErrorMessagess ?? null;;
if($customValidationMessages == null){
$validationErrorMessages = $this->model->validationMessages ?? $this->formValidationErrorMessagess ?? null;;
}
else{
$validationErrorMessages = $customValidationMessages;
}
if ($validationErrorMessages != null) {
$valid = $this->validate($validationRules, $validationErrorMessages);

View File

@ -0,0 +1,32 @@
<?php
namespace App\Controllers;
use App\Controllers\BaseController;
class Js_loader extends BaseController
{
function __construct()
{
}
function comparadorCosidoTapaBlanda_js()
{
$this->response->setHeader('Content-Type', 'text/javascript');
return view('themes/backend/vuexy/form/presupuestos/cosidotapablanda/comparador.js');
}
function previsualizador_js()
{
$this->response->setHeader('Content-Type', 'text/javascript');
return view('themes/backend/vuexy/form/presupuestos/cosidotapablanda/previews.js');
}
}

View File

@ -0,0 +1,27 @@
<?php
namespace App\Controllers\Pdf;
use App\Controllers\BaseController;
class PrintPresupuestos extends BaseController
{
function __construct()
{
}
public function index()
{
//return view('pdf_view');
return view(getenv('theme.path').'pdfs/presupuesto');
}
public function generar(){
$dompdf = new \Dompdf\Dompdf(['isRemoteEnabled' => true]);
//$dompdf->loadHtml(view('pdf_view'));
$dompdf->loadHtml(view(getenv('theme.path').'pdfs/presupuesto'));
$dompdf->setPaper('A4', 'portrait');
$dompdf->render();
$dompdf->stream('presupuesto-demo.pdf');
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +0,0 @@
<?php
namespace App\Controllers\Presupuestos;
use App\Controllers\BaseController;
class Cosidotapablandasolapas extends BaseController
{
function __construct()
{
}
public function index()
{
echo 'Presupuesto >> Libros >> Cosido tapa blanda con solapas [en desarrollo].';
}
}

View File

@ -1,25 +0,0 @@
<?php
namespace App\Controllers\Presupuestos;
use App\Controllers\BaseController;
class Js_loader extends BaseController
{
function __construct()
{
}
function comparadorCosidoTapablanda_js()
{
$this->load->view('themes/backend/vuexy/form/presupuestos/cosidotapablanda/comparador.js', $data);
$this->output->set_content_type('text/javascript');
}
}

View File

@ -0,0 +1,121 @@
<?php namespace App\Controllers\Presupuestos;
use App\Controllers\GoBaseResourceController;
use App\Models\Collection;
use App\Models\Presupuestos\PresupuestoAcabadosModel;
use DataTables\Editor;
use DataTables\Editor\Field;
use DataTables\Editor\Validate;
class PresupuestoAcabados extends \App\Controllers\GoBaseResourceController
{
protected $modelName = PresupuestoAcabadosModel::class;
protected $format = 'json';
protected static $singularObjectName = 'Presupuesto acabado';
protected static $singularObjectNameCc = 'presupuestoAcabado';
protected static $pluralObjectName = 'Presupuestos acabado';
protected static $pluralObjectNameCc = 'presupuestosAcabado';
protected static $controllerSlug = 'presupuesto-acabados';
protected static $viewPath = 'themes/backend/vuexy/form/presupuestos/';
protected $indexRoute = 'contactoDeClienteList';
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
}
public function datatable()
{
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;
}
$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);
}
}
}

View File

@ -0,0 +1,119 @@
<?php namespace App\Controllers\Presupuestos;
use App\Controllers\GoBaseResourceController;
use App\Models\Collection;
use App\Models\Presupuestos\PresupuestoEncuadernacionesModel;
use DataTables\Editor;
use DataTables\Editor\Field;
use DataTables\Editor\Validate;
class PresupuestoEncuadernaciones extends \App\Controllers\GoBaseResourceController
{
protected $modelName = PresupuestoEncuadernacionesModel::class;
protected $format = 'json';
protected static $singularObjectName = 'Presupuesto encuadernaciones';
protected static $singularObjectNameCc = 'presupuestoEncuadernaciones';
protected static $pluralObjectName = 'Presupuestos encuadernaciones';
protected static $pluralObjectNameCc = 'presupuestosEncuadernaciones';
protected static $controllerSlug = 'presupuesto-encuadernaciones';
protected static $viewPath = 'themes/backend/vuexy/form/presupuestos/';
protected $indexRoute = 'contactoDeClienteList';
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
}
public function datatable()
{
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;
}
$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);
}
}
}

View File

@ -0,0 +1,123 @@
<?php namespace App\Controllers\Presupuestos;
use App\Controllers\GoBaseResourceController;
use App\Models\Collection;
use App\Entities\Clientes\ClienteContactoEntity;
use App\Models\Clientes\ClienteModel;
use App\Models\Presupuestos\PresupuestoManipuladosModel;
use DataTables\Editor;
use DataTables\Editor\Field;
use DataTables\Editor\Validate;
class PresupuestoManipulados extends \App\Controllers\GoBaseResourceController
{
protected $modelName = PresupuestoManipuladosModel::class;
protected $format = 'json';
protected static $singularObjectName = 'Presupuesto manipulado';
protected static $singularObjectNameCc = 'presupuestoManipulado';
protected static $pluralObjectName = 'Presupuestos manipulado';
protected static $pluralObjectNameCc = 'presupuestosManipulado';
protected static $controllerSlug = 'presupuesto-manipulado';
protected static $viewPath = 'themes/backend/vuexy/form/presupuestos/';
protected $indexRoute = 'contactoDeClienteList';
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
}
public function datatable()
{
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;
}
$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);
}
}
}

View File

@ -0,0 +1,117 @@
<?php namespace App\Controllers\Presupuestos;
use App\Models\Collection;
use App\Models\Presupuestos\PresupuestoPreimpresionesModel;
use DataTables\Editor;
use DataTables\Editor\Field;
use DataTables\Editor\Validate;
class PresupuestoPreimpresiones extends \App\Controllers\GoBaseResourceController
{
protected $modelName = PresupuestoPreimpresionesModel::class;
protected $format = 'json';
protected static $singularObjectName = 'Presupuesto preimpresion';
protected static $singularObjectNameCc = 'presupuestoPreimpresion';
protected static $pluralObjectName = 'Presupuestos preimpresion';
protected static $pluralObjectNameCc = 'presupuestosPreimpresion';
protected static $controllerSlug = 'presupuesto-preimpresiones';
protected static $viewPath = 'themes/backend/vuexy/form/presupuestos/';
protected $indexRoute = 'contactoDeClienteList';
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
}
public function datatable()
{
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;
}
$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);
}
}
}

View File

@ -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)) {

View File

@ -1,35 +0,0 @@
<?php
namespace App\Controllers\Tarifas;
use App\Controllers\BaseController;
class Tarifaenvio extends BaseController
{
function __construct()
{
}
public function index()
{
echo 'Tarifa envio';
}
public function delete()
{
}
public function add()
{
}
public function edit()
{
}
}

View File

@ -2,12 +2,14 @@
namespace App\Controllers;
use App\Models\Configuracion\MaquinasCallesModel;
use App\Controllers\BaseController;
use App\Models\Configuracion\MaquinasTarifasImpresionModel;
use App\Models\Configuracion\PapelGenericoModel;
use App\Models\Configuracion\MaquinaModel;
use App\Services\PresupuestoService;
class Test extends BaseController
{
function __construct()
{
@ -15,11 +17,370 @@ class Test extends BaseController
public function index()
{
$model = new MaquinasCallesModel();
$this->getLP();
}
public function timeToSeconds(){
$time = '99:59:59';
$time_parts = explode(":", $time);
$seconds = $time_parts[2] + $time_parts[1] * 60 + $time_parts[0] * 3600;
echo "Time in seconds: " . $seconds;
}
public function getLP(){
$lp_model = model('App\Models\Presupuestos\PresupuestoLineaModel');
$data = $lp_model->getLineasPresupuesto(8);
$papel_imp_model = model('App\Models\Configuracion\PapelImpresionModel');
$maquina_model = model('App\Models\Configuracion\MaquinaModel');
foreach($data as $linea){
$linea->papel_impresion_id = $papel_imp_model->getValue_Nombre($linea->papel_impresion_id)[0];
$linea->maquina_id = $maquina_model->getValue_Nombre($linea->maquina_id)[0];
var_dump($linea->papel_impresion_id);
var_dump($linea->maquina_id);
}
}
public function createLP(){
$lp_model = model('App\Models\Presupuestos\PresupuestoLineaModel');
$lp_model->createForPresupuesto(8);
}
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 '<pre>';
$resourceData = $model->getResource("", 113)->get()->getResultObject();
var_dump($resourceData);
var_dump($maquina);
echo '</pre>';
}
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 '----------------------------<br>';
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 '<pre>';
var_dump($linea);
echo '</pre>';
}
}
}
public static function testLineasIntPlanaCubierta()
{
echo '<pre>';
$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 '----------------------------<br>';
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 '</pre>';
}
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 '<pre>';
var_dump($papel->id);
var_dump($datosTipologias);
echo '</pre>';
$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 '----------------------------<br>';
var_dump($maquina->maquina);
var_dump($papel->nombre);
//$linea = PresupuestoService::getCostesLineaRotativa($maquina, $datosPedido, $parametrosRotativa);
echo '<pre>';
var_dump($linea);
echo '</pre>';
}
}
}
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 '<pre>';
var_dump($papeles);
echo '</pre>';
$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 '<pre>';
echo '-------------------------------';
echo '</pre>';
echo '<pre>';
var_dump($maquinas);
echo '</pre>';
// Se recorren las máquinas y se calcula el coste de linea por cada una
foreach ($maquinas as $maquina) {
echo '<pre>';
echo '$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$';
echo '</pre>';
$tarifamodel = new \App\Models\Configuracion\MaquinasTarifasImpresionModel();
$tarifa = $tarifamodel->getTarifa($maquina->maquina_id, $uso, $tipo);
echo '<pre>';
var_dump($tarifa);
echo '</pre>';
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 '<pre>';
var_dump($lineas);
echo '</pre>';
}
}

View File

@ -1,15 +0,0 @@
<?php
namespace App\Entities\Configuracion;
use CodeIgniter\Entity;
class FormasPagoEntity extends \CodeIgniter\Entity\Entity
{
protected $attributes = [
"id" => null,
"nombre" => null,
"created_at" => null,
"updated_at" => null,
];
protected $casts = [];
}

View File

@ -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",

View File

@ -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",

View File

@ -0,0 +1,23 @@
<?php
namespace App\Entities\Presupuestos;
use CodeIgniter\Entity;
class PresupuestoAcabadosEntity extends \CodeIgniter\Entity\Entity
{
protected $attributes = [
"id" => 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",
];
}

View File

@ -0,0 +1,23 @@
<?php
namespace App\Entities\Presupuestos;
use CodeIgniter\Entity;
class PresupuestoEncuadernacionesEntity extends \CodeIgniter\Entity\Entity
{
protected $attributes = [
"id" => 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",
];
}

View File

@ -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,
@ -175,6 +176,8 @@ class PresupuestoEntity extends \CodeIgniter\Entity\Entity
"deleted_at" => null,
"created_at" => null,
"updated_at" => null,
"comp_tipo_impresion" => null,
"comp_pos_paginas_color" => null,
];
protected $casts = [
"version" => "int",

View File

@ -0,0 +1,127 @@
<?php
namespace App\Entities\Presupuestos;
use CodeIgniter\Entity;
class PresupuestoLineaEntity extends \CodeIgniter\Entity\Entity
{
protected $attributes = [
"id" => null,
"presupuesto_id" => null,
"tipo" => null,
"paginas" => 0,
"paginas_color_posicion" => null,
"solapas_ancho" => 0.0,
"papel_id" => null,
"papel_impresion_id" => null,
"formas" => null,
"gramaje" => null,
"pliegos_libro" => null,
"pliegos_pedido" => null,
"pliegos_precio" => null,
"libro" => null,
"pedido" => null,
"mano" => null,
"peso" => null,
"maquina_id" => null,
"tarifa_impresion_id" => null,
"click" => null,
"precio" => null,
"rotativa_impresion" => null,
"rotativa_pag_color" => 0,
"rotativa_set_values" => false,
"rotativa_negro" => 0.0,
"rotativa_cyan" => 0.0,
"rotativa_magenta" => 0.0,
"rotativa_amarillo" => 0.0,
"rotativa_gota_negro" => 0.0,
"rotativa_gota_color" => 0.0,
"rotativa_saturacion" => 100.0,
"rotativa_a_favor_fibra" => true,
"rotativa_mxm" => null,
"rotativa_area_paginas" => null,
"rotativa_num_gotas_negro" => 0,
"rotativa_num_gotas_cyan" => 0,
"rotativa_num_gotas_magenta" => 0,
"rotativa_num_gotas_amarillo" => 0,
"rotativa_peso_gotas_negro" => 0,
"rotativa_peso_gotas_cyan" => 0,
"rotativa_peso_gotas_magenta" => 0,
"rotativa_peso_gotas_amarillo" => 0,
"rotativa_precio_pag_negro" => null,
"rotativa_precio_pag_color" => null,
"rotativa_factor_altura" => null,
"rotativa_factor_anchura" => null,
"rotativa_pag_por_pliego" => null,
"rotativa_metros_libro" => null,
"rotativa_metros_total" => null,
"rotativa_clicks_libro" => null,
"rotativa_clicks_total" => null,
"rotativa_precio_tinta" => null,
"rotativa_total_impresion" => null,
"rotativa_velocidad_corte" => 0,
"rotativa_tiempo_corte" => 0,
"rotativa_precio_hora_corte" => 0,
"rotativa_total_corte" => 0,
"isActiva" => false,
"check_impresion_total" => false,
"check_papel_total" => false,
];
protected $casts = [
"presupuesto_id" => "int",
"paginas" => "int",
"solapas_ancho" => "float",
"papel_id" => "?int",
"papel_impresion_id" => "?int",
"gramaje" => "?float",
"pliegos_libro" => "?float",
"pliegos_pedido" => "?float",
"pliegos_precio" => "?float",
"libro" => "?float",
"pedido" => "?float",
"mano" => "?float",
"peso" => "?float",
"maquina_id" => "?int",
"tarifa_impresion_id" => "?int",
"click" => "?float",
"precio" => "?float",
"rotativa_pag_color" => "int",
"rotativa_set_values" => "boolean",
"rotativa_negro" => "float",
"rotativa_cyan" => "float",
"rotativa_magenta" => "float",
"rotativa_amarillo" => "float",
"rotativa_gota_negro" => "float",
"rotativa_gota_color" => "float",
"rotativa_saturacion" => "float",
"rotativa_a_favor_fibra" => "boolean",
"rotativa_mxm" => "?float",
"rotativa_area_paginas" => "float",
"rotativa_num_gotas_negro" => "float",
"rotativa_num_gotas_cyan" => "float",
"rotativa_num_gotas_magenta" => "float",
"rotativa_num_gotas_amarillo" => "float",
"rotativa_peso_gotas_negro" => "float",
"rotativa_peso_gotas_cyan" => "float",
"rotativa_peso_gotas_magenta" => "float",
"rotativa_peso_gotas_amarillo" => "float",
"rotativa_precio_pag_negro" => "float",
"rotativa_precio_pag_color" => "float",
"rotativa_factor_altura" => "float",
"rotativa_factor_anchura" => "float",
"rotativa_pag_por_pliego" => "float",
"rotativa_metros_libro" => "float",
"rotativa_metros_total" => "float",
"rotativa_clicks_libro" => "float",
"rotativa_clicks_total" => "float",
"rotativa_precio_tinta" => "float",
"rotativa_total_impresion" => "float",
"rotativa_velocidad_corte" => "float",
"rotativa_tiempo_corte" => "float",
"rotativa_precio_hora_corte" => "float",
"rotativa_total_corte" => "float",
"isActiva" => "boolean",
"check_impresion_total" => "boolean",
"check_papel_total" => "boolean",
];
}

View File

@ -0,0 +1,23 @@
<?php
namespace App\Entities\Presupuestos;
use CodeIgniter\Entity;
class PresupuestoManipuladosEntity extends \CodeIgniter\Entity\Entity
{
protected $attributes = [
"id" => 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",
];
}

View File

@ -0,0 +1,23 @@
<?php
namespace App\Entities\Presupuestos;
use CodeIgniter\Entity;
class PresupuestoPreimpresionesEntity extends \CodeIgniter\Entity\Entity
{
protected $attributes = [
"id" => 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",
];
}

View File

@ -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",

View File

@ -12,6 +12,8 @@ return [
'Close' => 'Close',
'Dashboard' => 'Dashboard',
'Delete' => 'Delete',
'Clone' => 'Clone',
'Print' => 'Print',
'Error' => 'Error',
'Groups' => 'Groups',
'Home' => 'Home',

View File

@ -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.',
],

View File

@ -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.',

View File

@ -10,6 +10,7 @@ return [
'datosPresupuesto' => 'Budget information',
'datosLibro' => 'Book information',
'datosServicios' => 'Other Services',
'datosPresupuestoCliente' => 'Client budget data (comparator)',
'id' => 'Budget Number',
@ -21,7 +22,8 @@ return [
'incRei' => 'Incident \ Reprint',
'paginas' => 'Pages',
'tirada' => 'Print',
'totalPapelPedido' => 'Total paper budget',
'totalPedido' => 'Total paper budget',
'totalPresupuesto' => 'Total Budget',
'presupuestoEstado' => 'State',
'presupuestoEstadoBorrador' => 'Draft',
'presupuestoEstadoAceptado' => 'Acepted',
@ -45,7 +47,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 +60,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 +88,74 @@ return [
'solapasAnchoCubierta' => 'Cover dust jacket width',
'1cara' => '1 side',
'2caras' => '2 sides',
'bn' => 'BW',
'bnhq' => 'BWHQ',
'color' => 'Colour',
'colorhq' => 'ColourHQ',
'rotativa' => 'Rotary',
'rotativa_bn' => 'Rot. BW',
'rotativa_color' => 'Rot. Colour',
'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',
'addLineaPresupuesto' => 'Add line...',
'validation' => [
'decimal' => 'The {field} field must contain a decimal number.',
'integer' => 'The {field} field must contain an integer.',
'requerido' => 'The {field} field is required.',
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
],
'errores' => [
'paginas' => 'The field pages must be greater than zero',
'tiradas' => 'The field print must be greater than zero',
'dimension' => 'The book dimension must be greater than 60mm',
'lineaDuplicada' => 'That type of line already exists in the budget.',
'errorRotColor' => 'Papers and weights must be the same in color and BW',
],
/* '4x0' => '4x0',
'4x4' => '4x4',
@ -250,7 +341,9 @@ return [
'catalogo_id' => [
'integer' => 'The {field} field must contain an integer.',
'decimal' => 'The {field} field must contain a decimal number.',
'max_length' => 'The {field} field cannot exceed {param} characters in length.',
'required' => 'The {field} field is required.',
],
'causa_cancelacion' => [

View File

@ -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",

View File

@ -10,8 +10,12 @@ return [
'Cancel' => 'Cancelar',
'ChangePassword' => 'Cambiar contraseña',
'Close' => 'Cerrar',
'Print' => 'Imprimir',
'Clone' => 'Duplicar',
'Dashboard' => 'Panel de control',
'Delete' => 'Borrar',
'Clone' => 'Duplicar',
'Print' => 'Imprimir',
'Error' => 'Error',
'Groups' => 'Grupos',
'Home' => 'Inicio',

View File

@ -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.',
],

View File

@ -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.',

File diff suppressed because it is too large Load Diff

View File

@ -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.',

View File

@ -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',

View File

@ -1,33 +0,0 @@
<?php
namespace App\Models\Configuracion;
class FormasPagoModel extends \App\Models\GoBaseModel
{
protected $table = "lg_formas_pago";
/**
* Whether primary key uses auto increment.
*
* @var bool
*/
protected $useAutoIncrement = true;
protected $allowedFields = ["nombre"];
protected $returnType = "App\Entities\Configuracion\FormasPagoEntity";
public static $labelField = "nombre";
protected $validationRules = [
"nombre" => [
"label" => "FormasPagoes.nombre",
"rules" => "trim|required|max_length[255]",
],
];
protected $validationMessages = [
"nombre" => [
"max_length" => "FormasPagoes.validation.nombre.max_length",
"required" => "FormasPagoes.validation.nombre.required",
],
];
}

View File

@ -1,4 +1,5 @@
<?php
namespace App\Models\Configuracion;
class MaquinaModel extends \App\Models\GoBaseModel
@ -26,8 +27,8 @@ class MaquinaModel extends \App\Models\GoBaseModel
9 => "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,120 @@ 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, $uso_tarifa = 'interior', $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.uso='{$uso_tarifa}' AND t2.is_deleted=0)");
}
}
else{
$builder->where("t2.tipo", $tarifa_tipo);
$builder->where("t2.uso", $uso_tarifa);
}
return $builder->orderBy("t1.id", "asc")->get()->getResultObject();
}
public function getNombre($id){
$builder = $this->db
->table($this->table . " t1")
->select(
"t1.nombre AS text");
$builder->where("t1.id", $id);
return $builder->orderBy("t1.id", "asc")->get()->getResultObject();
}
}

View File

@ -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');
}
}
}

View File

@ -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",
];

View File

@ -1,4 +1,5 @@
<?php
namespace App\Models\Configuracion;
class MaquinasTarifasImpresionModel extends \App\Models\GoBaseModel
@ -59,7 +60,7 @@ class MaquinasTarifasImpresionModel extends \App\Models\GoBaseModel
],
];
public function findAllWithMaquinas(string $selcols = "*", int $limit = null, int $offset = 0)
{
$sql =
@ -88,7 +89,7 @@ class MaquinasTarifasImpresionModel extends \App\Models\GoBaseModel
*
* @return \CodeIgniter\Database\BaseBuilder
*/
public function getResource(string $search = "", $maquina_id=-1)
public function getResource(string $search = "", $maquina_id = -1)
{
$builder = $this->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.id AS id, 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 [$tarifas[0]['id'], floatval($tarifas[0]['precio'])];
}
return $tarifas;
}
}

View File

@ -93,7 +93,7 @@ class PapelGenericoModel extends \App\Models\GoBaseModel
}
public function getPapelForComparador($tipo, $is_cubierta = null, $is_sobrecubierta = null)
public function getPapelForComparador($tipo, $is_cubierta = null, $is_sobrecubierta = null, $rotativa = null)
{
/*
1.-> Tipo impresion
@ -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,87 @@ 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'));
if(!is_null($rotativa)){
if($rotativa==true){
$builder->where("t2.rotativa", 1);
}
}
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);
$uso_tarifa = 'interior';
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'){
$uso_tarifa = 'cubierta';
$builder->where("t2.cubierta", 1);
}
else if ($uso == 'sobrecubierta'){
$uso_tarifa = 'sobrecubierta';
$builder->where("t2.sobrecubierta", 1);
}
$builder->where("t5.uso", $uso_tarifa);
$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 +211,44 @@ 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);
$uso_tarifa = 'interior';
if ($uso == 'cubierta'){
$uso_tarifa = 'cubierta';
$builder->where("t2.cubierta", 1);
}
else if ($uso == 'sobrecubierta'){
$uso_tarifa = 'sobrecubierta';
$builder->where("t2.sobrecubierta", 1);
}
else{
if($tipo == 'negro' || $tipo == 'negrohq')
$builder->where("t2.bn", 1);
else if ($tipo == 'color' || $tipo == 'colorhq')
$builder->where("t2.color", 1);
}
if($uso=='rotativa')
$builder->where("t2.rotativa", 1);
else
$builder->where("t2.rotativa", 0);
$builder->where("t5.uso", $uso_tarifa);
$values = $builder->orderBy("t2.gramaje", "asc")->get()->getResultObject();
$id = 1;
foreach ($values as $value){

View File

@ -1,4 +1,5 @@
<?php
namespace App\Models\Configuracion;
class PapelImpresionMargenModel extends \App\Models\GoBaseModel
@ -86,27 +87,28 @@ class PapelImpresionMargenModel extends \App\Models\GoBaseModel
t1.paginas_max AS paginas_max, t1.margen AS margen"
);
//JJO
$builder->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();
}
}

View File

@ -209,4 +209,106 @@ 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 ($uso == 'cubierta')
$builder->where("t1.cubierta", 1);
else if ($uso == 'sobrecubierta')
$builder->where("t1.sobrecubierta", 1);
else{
if($tipo == 'negro' || $tipo == 'negrohq')
$builder->where("t1.bn", 1);
else if ($tipo == 'color' || $tipo == 'colorhq')
$builder->where("t1.color", 1);
}
if($uso=='rotativa')
$builder->where("t1.rotativa", 1);
else
$builder->where("t1.rotativa", 0);
return $builder->orderBy("t1.id", "asc")->get()->getResultObject();
}
public function getNombre($id){
$builder = $this->db
->table($this->table . " t1")
->select(
"t1.nombre AS text");
$builder->where("t1.id", $id);
return $builder->orderBy("t1.id", "asc")->get()->getResultObject();
}
}

View File

@ -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")

View File

@ -0,0 +1,68 @@
<?php
namespace App\Models\Presupuestos;
class PresupuestoAcabadosModel extends \App\Models\GoBaseModel
{
protected $table = "presupuesto_acabados";
/**
* Whether primary key uses auto increment.
*
* @var bool
*/
protected $useAutoIncrement = true;
const SORTABLE = [
0 => "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;
}
}

View File

@ -0,0 +1,68 @@
<?php
namespace App\Models\Presupuestos;
class PresupuestoEncuadernacionesModel extends \App\Models\GoBaseModel
{
protected $table = "presupuesto_encuadernaciones";
/**
* Whether primary key uses auto increment.
*
* @var bool
*/
protected $useAutoIncrement = true;
const SORTABLE = [
0 => "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;
}
}

View File

@ -0,0 +1,344 @@
<?php
namespace App\Models\Presupuestos;
class PresupuestoLineaModel extends \App\Models\GoBaseModel
{
protected $table = "presupuesto_linea";
/**
* Whether primary key uses auto increment.
*
* @var bool
*/
protected $useAutoIncrement = true;
protected $allowedFields = [
"presupuesto_id",
"tipo",
"paginas",
"paginas_color_posicion",
"solapas_ancho",
"papel_id",
"papel_impresion_id",
"formas",
"gramaje",
"pliegos_libro",
"pliegos_pedido",
"pliegos_precio",
"libro",
"pedido",
"mano",
"peso",
"maquina_id",
"tarifa_impresion_id",
"click",
"precio",
"rotativa_impresion",
"rotativa_pag_color",
"rotativa_set_values",
"rotativa_negro",
"rotativa_cyan",
"rotativa_magenta",
"rotativa_amarillo",
"rotativa_gota_negro",
"rotativa_gota_color",
"rotativa_saturacion",
"rotativa_a_favor_fibra",
"rotativa_mxm",
"rotativa_area_paginas",
"rotativa_num_gotas_negro",
"rotativa_num_gotas_cyan",
"rotativa_num_gotas_magenta",
"rotativa_num_gotas_amarillo",
"rotativa_peso_gotas_negro",
"rotativa_peso_gotas_cyan",
"rotativa_peso_gotas_magenta",
"rotativa_peso_gotas_amarillo",
"rotativa_precio_pag_negro",
"rotativa_precio_pag_color",
"rotativa_factor_altura",
"rotativa_factor_anchura",
"rotativa_pag_por_pliego",
"rotativa_metros_libro",
"rotativa_metros_total",
"rotativa_clicks_libro",
"rotativa_clicks_total",
"rotativa_precio_tinta",
"rotativa_total_impresion",
"rotativa_velocidad_corte",
"rotativa_tiempo_corte",
"rotativa_precio_hora_corte",
"rotativa_total_corte",
'check_impresion_total',
'check_papel_total',
"isActiva",
];
protected $returnType = "App\Entities\Presupuestos\PresupuestoLineaEntity";
public static $labelField = "presupuesto_id";
protected $validationRules = [
"click" => [
"label" => "PresupuestoLineas.click",
"rules" => "decimal|permit_empty",
],
"formas" => [
"label" => "PresupuestoLineas.formas",
"rules" => "trim|max_length[16313]",
],
"gramaje" => [
"label" => "PresupuestoLineas.gramaje",
"rules" => "decimal|permit_empty",
],
"libro" => [
"label" => "PresupuestoLineas.libro",
"rules" => "decimal|permit_empty",
],
"mano" => [
"label" => "PresupuestoLineas.mano",
"rules" => "decimal|permit_empty",
],
"paginas" => [
"label" => "PresupuestoLineas.paginas",
"rules" => "required|integer",
],
"paginas_color_posicion" => [
"label" => "PresupuestoLineas.paginasColorPosicion",
"rules" => "trim|max_length[16313]",
],
"pedido" => [
"label" => "PresupuestoLineas.pedido",
"rules" => "decimal|permit_empty",
],
"peso" => [
"label" => "PresupuestoLineas.peso",
"rules" => "decimal|permit_empty",
],
"pliegos_libro" => [
"label" => "PresupuestoLineas.pliegosLibro",
"rules" => "decimal|permit_empty",
],
"pliegos_pedido" => [
"label" => "PresupuestoLineas.pliegosPedido",
"rules" => "decimal|permit_empty",
],
"pliegos_precio" => [
"label" => "PresupuestoLineas.pliegosPrecio",
"rules" => "decimal|permit_empty",
],
"precio" => [
"label" => "PresupuestoLineas.precio",
"rules" => "decimal|permit_empty",
],
"rotativa_amarillo" => [
"label" => "PresupuestoLineas.rotativaAmarillo",
"rules" => "required|decimal",
],
"rotativa_area_paginas" => [
"label" => "PresupuestoLineas.rotativaAreaPaginas",
"rules" => "required|decimal",
],
"rotativa_clicks_libro" => [
"label" => "PresupuestoLineas.rotativaClicksLibro",
"rules" => "required|decimal",
],
"rotativa_clicks_total" => [
"label" => "PresupuestoLineas.rotativaClicksTotal",
"rules" => "required|decimal",
],
"rotativa_cyan" => [
"label" => "PresupuestoLineas.rotativaCyan",
"rules" => "required|decimal",
],
"rotativa_factor_altura" => [
"label" => "PresupuestoLineas.rotativaFactorAltura",
"rules" => "required|decimal",
],
"rotativa_factor_anchura" => [
"label" => "PresupuestoLineas.rotativaFactorAnchura",
"rules" => "required|decimal",
],
"rotativa_gota_color" => [
"label" => "PresupuestoLineas.rotativaGotaColor",
"rules" => "required|decimal",
],
"rotativa_gota_negro" => [
"label" => "PresupuestoLineas.rotativaGotaNegro",
"rules" => "required|decimal",
],
"rotativa_impresion" => [
"label" => "PresupuestoLineas.rotativaImpresion",
"rules" => "required|in_list[negro,color]",
],
"rotativa_magenta" => [
"label" => "PresupuestoLineas.rotativaMagenta",
"rules" => "required|decimal",
],
"rotativa_metros_libro" => [
"label" => "PresupuestoLineas.rotativaMetrosLibro",
"rules" => "required|decimal",
],
"rotativa_metros_total" => [
"label" => "PresupuestoLineas.rotativaMetrosTotal",
"rules" => "required|decimal",
],
"rotativa_mxm" => [
"label" => "PresupuestoLineas.rotativaMxm",
"rules" => "decimal|permit_empty",
],
"rotativa_negro" => [
"label" => "PresupuestoLineas.rotativaNegro",
"rules" => "required|decimal",
],
"rotativa_num_gotas_amarillo" => [
"label" => "PresupuestoLineas.rotativaNumGotasAmarillo",
"rules" => "required|decimal",
],
"rotativa_num_gotas_cyan" => [
"label" => "PresupuestoLineas.rotativaNumGotasCyan",
"rules" => "required|decimal",
],
"rotativa_num_gotas_magenta" => [
"label" => "PresupuestoLineas.rotativaNumGotasMagenta",
"rules" => "required|decimal",
],
"rotativa_num_gotas_negro" => [
"label" => "PresupuestoLineas.rotativaNumGotasNegro",
"rules" => "required|decimal",
],
"rotativa_pag_color" => [
"label" => "PresupuestoLineas.rotativaPagColor",
"rules" => "required|integer",
],
"rotativa_pag_por_pliego" => [
"label" => "PresupuestoLineas.rotativaPagPorPliego",
"rules" => "required|decimal",
],
"rotativa_peso_gotas_amarillo" => [
"label" => "PresupuestoLineas.rotativaPesoGotasAmarillo",
"rules" => "required|decimal",
],
"rotativa_peso_gotas_cyan" => [
"label" => "PresupuestoLineas.rotativaPesoGotasCyan",
"rules" => "required|decimal",
],
"rotativa_peso_gotas_magenta" => [
"label" => "PresupuestoLineas.rotativaPesoGotasMagenta",
"rules" => "required|decimal",
],
"rotativa_peso_gotas_negro" => [
"label" => "PresupuestoLineas.rotativaPesoGotasNegro",
"rules" => "required|decimal",
],
"rotativa_precio_hora_corte" => [
"label" => "PresupuestoLineas.rotativaPrecioHoraCorte",
"rules" => "required|decimal",
],
"rotativa_precio_pag_color" => [
"label" => "PresupuestoLineas.rotativaPrecioPagColor",
"rules" => "required|decimal",
],
"rotativa_precio_pag_negro" => [
"label" => "PresupuestoLineas.rotativaPrecioPagNegro",
"rules" => "required|decimal",
],
"rotativa_precio_tinta" => [
"label" => "PresupuestoLineas.rotativaPrecioTinta",
"rules" => "required|decimal",
],
"rotativa_saturacion" => [
"label" => "PresupuestoLineas.rotativaSaturacion",
"rules" => "required|decimal",
],
"rotativa_tiempo_corte" => [
"label" => "PresupuestoLineas.rotativaTiempoCorte",
"rules" => "required|decimal",
],
"rotativa_total_corte" => [
"label" => "PresupuestoLineas.rotativaTotalCorte",
"rules" => "required|decimal",
],
"rotativa_total_impresion" => [
"label" => "PresupuestoLineas.rotativaTotalImpresion",
"rules" => "required|decimal",
],
"rotativa_velocidad_corte" => [
"label" => "PresupuestoLineas.rotativaVelocidadCorte",
"rules" => "required|decimal",
],
"solapas_ancho" => [
"label" => "PresupuestoLineas.solapasAncho",
"rules" => "required|decimal",
],
"tipo" => [
"label" => "PresupuestoLineas.tipo",
"rules" => "required|in_list[bn,bnhq,color,colorhq,cubierta,sobrecubierta,rot_bn,rot_color]",
],
];
public function findAllWithAllRelations(string $selcols = "*", int $limit = null, int $offset = 0)
{
$sql =
"SELECT t1." .
$selcols .
", t2.id AS presupuesto, t3.nombre AS papel, t4.nombre AS papel_impresion, t5.nombre AS maquina, t6.tipo AS tarifa_impresion FROM " .
$this->table .
" t1 LEFT JOIN presupuestos t2 ON t1.presupuesto_id = t2.id LEFT JOIN lg_papel_generico t3 ON t1.papel_id = t3.id LEFT JOIN lg_papel_impresion t4 ON t1.papel_impresion_id = t4.id LEFT JOIN lg_maquinas t5 ON t1.maquina_id = t5.id LEFT JOIN lg_maquinas_tarifas_impresion t6 ON t1.tarifa_impresion_id = t6.id";
if (!is_null($limit) && intval($limit) > 0) {
$sql .= " LIMIT " . intval($limit);
}
if (!is_null($offset) && intval($offset) > 0) {
$sql .= " OFFSET " . intval($offset);
}
$query = $this->db->query($sql);
$result = $query->getResultObject();
return $result;
}
public function createForPresupuesto($presupuesto_id){
$tipos = ['bn','bnhq','color','colorhq','cubierta','sobrecubierta','rot_bn','rot_color'];
foreach($tipos as $tipo){
$builder = $this->db
->table($this->table . " t1");
$data = [
'presupuesto_id' => $presupuesto_id,
'tipo' => $tipo,
];
$builder->insert($data);
}
}
public function getLineasPresupuesto($presupuesto_id = -1)
{
$builder = $this->db
->table($this->table . " t1")
->select(
"*"
)
->where("t1.presupuesto_id", $presupuesto_id)
->where("t1.isActiva", 1);
return $builder->orderBy("t1.id", "asc")->get()->getResultObject();
}
public function updateLineasPresupuesto($presupuesto_id = -1, $datos=[])
{
foreach($datos as $linea){
$this->db
->table($this->table . " t1")
->where("t1.presupuesto_id", $presupuesto_id)
->where("t1.tipo", $linea["tipo"])
->update($linea);
}
}
}

View File

@ -0,0 +1,68 @@
<?php
namespace App\Models\Presupuestos;
class PresupuestoManipuladosModel extends \App\Models\GoBaseModel
{
protected $table = "presupuesto_manipulados";
/**
* Whether primary key uses auto increment.
*
* @var bool
*/
protected $useAutoIncrement = true;
const SORTABLE = [
0 => "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;
}
}

View File

@ -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",
@ -193,6 +194,8 @@ class PresupuestoModel extends \App\Models\GoBaseModel
"pedido_espera_fecha",
"pedido_espera_user_id",
"is_deleted",
"comp_tipo_impresion",
"comp_pos_paginas_color",
];
protected $returnType = "App\Entities\Presupuestos\PresupuestoEntity";
@ -205,802 +208,76 @@ class PresupuestoModel extends \App\Models\GoBaseModel
public static $labelField = "titulo";
protected $validationRules = [
"aprobado_at" => [
"label" => "Presupuestos.aprobadoAt",
"rules" => "valid_date|permit_empty",
],
"aprobado_json_data" => [
"label" => "Presupuestos.aprobadoJsonData",
"rules" => "trim|max_length[16313]",
],
protected $validationRulesAdd = [
"autor" => [
"label" => "Presupuestos.autor",
"rules" => "trim|required|max_length[150]",
],
"base_imponible" => [
"label" => "Presupuestos.baseImponible",
"rules" => "decimal|permit_empty",
],
"catalogo_id" => [
"label" => "Presupuestos.catalogoId",
"rules" => "integer|permit_empty",
],
"causa_cancelacion" => [
"label" => "Presupuestos.causaCancelacion",
"rules" => "trim|max_length[16313]",
],
"coleccion" => [
"label" => "Presupuestos.coleccion",
"rules" => "trim|max_length[255]",
],
"comentarios" => [
"label" => "Presupuestos.comentarios",
"rules" => "trim|required|max_length[16313]",
],
"comentarios_pdf" => [
"label" => "Presupuestos.comentariosPdf",
"rules" => "trim|required|max_length[16313]",
],
"comentarios_safekat" => [
"label" => "Presupuestos.comentariosSafekat",
"rules" => "trim|required|max_length[16313]",
],
"comentarios_tarifa" => [
"label" => "Presupuestos.comentariosTarifa",
"rules" => "trim|required|max_length[16313]",
],
"comparador_json_data" => [
"label" => "Presupuestos.comparadorJsonData",
"rules" => "trim|max_length[16313]",
],
"sobrecubiertas_ancho" => [
"label" => "Presupuestos.sobrecubiertasAncho",
"rules" => "required|decimal",
],
"descuento" => [
"label" => "Presupuestos.descuento",
"rules" => "required|decimal",
],
"fecha_encuardenado_at" => [
"label" => "Presupuestos.fechaEncuardenadoAt",
"rules" => "valid_date|permit_empty",
],
"fecha_entrega_real_at" => [
"label" => "Presupuestos.fechaEntregaRealAt",
"rules" => "valid_date|permit_empty",
],
"fecha_externo_at" => [
"label" => "Presupuestos.fechaExternoAt",
"rules" => "valid_date|permit_empty",
],
"fecha_ferro_subido_at" => [
"label" => "Presupuestos.fechaFerroSubidoAt",
"rules" => "valid_date|permit_empty",
],
"fecha_impresion_at" => [
"label" => "Presupuestos.fechaImpresionAt",
"rules" => "valid_date|permit_empty",
],
"forzar_total" => [
"label" => "Presupuestos.forzarTotal",
"rules" => "required|decimal",
"titulo" => [
"label" => "Presupuestos.titulo",
"rules" => "trim|required|max_length[30]",
],
"inc_rei" => [
"label" => "Presupuestos.incRei",
"rules" => "integer|permit_empty",
],
"is_deleted" => [
"label" => "Presupuestos.isDeleted",
"rules" => "required|integer",
],
"isbn" => [
"label" => "Presupuestos.isbn",
"rules" => "trim|max_length[50]",
],
"lomo" => [
"label" => "Presupuestos.lomo",
"rules" => "integer|permit_empty",
],
"margen" => [
"label" => "Presupuestos.margen",
"rules" => "decimal|permit_empty",
],
"margen_extra" => [
"label" => "Presupuestos.margenExtra",
"rules" => "required|decimal",
],
"margen_manual" => [
"label" => "Presupuestos.margenManual",
"rules" => "decimal|permit_empty",
],
"merma" => [
"label" => "Presupuestos.merma",
"rules" => "required|decimal",
],
"merma_portada" => [
"label" => "Presupuestos.mermaPortada",
"rules" => "required|decimal",
"coleccion" => [
"label" => "Presupuestos.incRei",
"rules" => "trim|max_length[255]",
],
"numero_edicion" => [
"label" => "Presupuestos.numeroEdicion",
"rules" => "trim|max_length[50]",
],
"paginas" => [
"label" => "Presupuestos.paginas",
"rules" => "required|integer",
"isbn" => [
"label" => "Presupuestos.isbn",
"rules" => "trim|max_length[50]",
],
"paginas_color" => [
"label" => "Presupuestos.paginasColor",
"rules" => "integer|permit_empty",
"pais_id" => [
"label" => "Presupuestos.paisId",
"rules" => "required|integer|greater_than[0]",
],
"paginas_color_click" => [
"label" => "Presupuestos.paginasColorClick",
"rules" => "decimal|permit_empty",
],
"paginas_color_forma_id" => [
"label" => "Presupuestos.paginasColorFormaId",
"rules" => "integer|permit_empty",
],
"paginas_color_gramaje" => [
"label" => "Presupuestos.paginasColorGramaje",
"rules" => "decimal|permit_empty",
],
"paginas_color_libro" => [
"label" => "Presupuestos.paginasColorLibro",
"rules" => "decimal|permit_empty",
],
"paginas_color_mano" => [
"label" => "Presupuestos.paginasColorMano",
"rules" => "decimal|permit_empty",
],
"paginas_color_pedido" => [
"label" => "Presupuestos.paginasColorPedido",
"rules" => "decimal|permit_empty",
],
"paginas_color_peso" => [
"label" => "Presupuestos.paginasColorPeso",
"rules" => "decimal|permit_empty",
],
"paginas_color_pliegos_libro" => [
"label" => "Presupuestos.paginasColorPliegosLibro",
"rules" => "decimal|permit_empty",
],
"paginas_color_pliegos_pedido" => [
"label" => "Presupuestos.paginasColorPliegosPedido",
"rules" => "decimal|permit_empty",
],
"paginas_color_pliegos_precio" => [
"label" => "Presupuestos.paginasColorPliegosPrecio",
"rules" => "decimal|permit_empty",
],
"paginas_color_posicion" => [
"label" => "Presupuestos.paginasColorPosicion",
"rules" => "trim|max_length[16313]",
],
"paginas_color_precio" => [
"label" => "Presupuestos.paginasColorPrecio",
"rules" => "decimal|permit_empty",
],
"paginas_sobrecubierta" => [
"label" => "Presupuestos.paginasCubierta",
"rules" => "required|in_list[4x0,4x4]",
],
"paginas_sobrecubierta_click" => [
"label" => "Presupuestos.paginasCubiertaClick",
"rules" => "decimal|permit_empty",
],
"paginas_sobrecubierta_forma_id" => [
"label" => "Presupuestos.paginasCubiertaFormaId",
"rules" => "integer|permit_empty",
],
"paginas_sobrecubierta_gramaje" => [
"label" => "Presupuestos.paginasCubiertaGramaje",
"rules" => "decimal|permit_empty",
],
"paginas_sobrecubierta_libro" => [
"label" => "Presupuestos.paginasCubiertaLibro",
"rules" => "decimal|permit_empty",
],
"paginas_sobrecubierta_mano" => [
"label" => "Presupuestos.paginasCubiertaMano",
"rules" => "decimal|permit_empty",
],
"paginas_sobrecubierta_pedido" => [
"label" => "Presupuestos.paginasCubiertaPedido",
"rules" => "decimal|permit_empty",
],
"paginas_sobrecubierta_peso" => [
"label" => "Presupuestos.paginasCubiertaPeso",
"rules" => "decimal|permit_empty",
],
"paginas_sobrecubierta_pliegos_libro" => [
"label" => "Presupuestos.paginasCubiertaPliegosLibro",
"rules" => "decimal|permit_empty",
],
"paginas_sobrecubierta_pliegos_pedido" => [
"label" => "Presupuestos.paginasCubiertaPliegosPedido",
"rules" => "decimal|permit_empty",
],
"paginas_sobrecubierta_pliegos_precio" => [
"label" => "Presupuestos.paginasCubiertaPliegosPrecio",
"rules" => "decimal|permit_empty",
],
"paginas_sobrecubierta_precio" => [
"label" => "Presupuestos.paginasCubiertaPrecio",
"rules" => "decimal|permit_empty",
],
"paginas_negro" => [
"label" => "Presupuestos.paginasNegro",
"rules" => "integer|permit_empty",
],
"paginas_negro_click" => [
"label" => "Presupuestos.paginasNegroClick",
"rules" => "decimal|permit_empty",
],
"paginas_negro_forma_id" => [
"label" => "Presupuestos.paginasNegroFormaId",
"rules" => "integer|permit_empty",
],
"paginas_negro_gramaje" => [
"label" => "Presupuestos.paginasNegroGramaje",
"rules" => "decimal|permit_empty",
],
"paginas_negro_libro" => [
"label" => "Presupuestos.paginasNegroLibro",
"rules" => "decimal|permit_empty",
],
"paginas_negro_mano" => [
"label" => "Presupuestos.paginasNegroMano",
"rules" => "decimal|permit_empty",
],
"paginas_negro_pedido" => [
"label" => "Presupuestos.paginasNegroPedido",
"rules" => "decimal|permit_empty",
],
"paginas_negro_peso" => [
"label" => "Presupuestos.paginasNegroPeso",
"rules" => "decimal|permit_empty",
],
"paginas_negro_pliegos_libro" => [
"label" => "Presupuestos.paginasNegroPliegosLibro",
"rules" => "decimal|permit_empty",
],
"paginas_negro_pliegos_pedido" => [
"label" => "Presupuestos.paginasNegroPliegosPedido",
"rules" => "decimal|permit_empty",
],
"paginas_negro_pliegos_precio" => [
"label" => "Presupuestos.paginasNegroPliegosPrecio",
"rules" => "decimal|permit_empty",
],
"paginas_negro_precio" => [
"label" => "Presupuestos.paginasNegroPrecio",
"rules" => "decimal|permit_empty",
],
"paginas_cubierta" => [
"label" => "Presupuestos.paginasPortada",
"rules" => "required|in_list[4x0,4x4]",
],
"paginas_cubierta_click" => [
"label" => "Presupuestos.paginasPortadaClick",
"rules" => "decimal|permit_empty",
],
"paginas_cubierta_forma_id" => [
"label" => "Presupuestos.paginasPortadaFormaId",
"rules" => "integer|permit_empty",
],
"paginas_cubierta_gramaje" => [
"label" => "Presupuestos.paginasPortadaGramaje",
"rules" => "decimal|permit_empty",
],
"paginas_cubierta_libro" => [
"label" => "Presupuestos.paginasPortadaLibro",
"rules" => "decimal|permit_empty",
],
"paginas_cubierta_mano" => [
"label" => "Presupuestos.paginasPortadaMano",
"rules" => "decimal|permit_empty",
],
"paginas_cubierta_pedido" => [
"label" => "Presupuestos.paginasPortadaPedido",
"rules" => "required|decimal",
],
"paginas_cubierta_peso" => [
"label" => "Presupuestos.paginasPortadaPeso",
"rules" => "decimal|permit_empty",
],
"paginas_cubierta_pliegos_libro" => [
"label" => "Presupuestos.paginasPortadaPliegosLibro",
"rules" => "decimal|permit_empty",
],
"paginas_cubierta_pliegos_pedido" => [
"label" => "Presupuestos.paginasPortadaPliegosPedido",
"rules" => "decimal|permit_empty",
],
"paginas_cubierta_pliegos_precio" => [
"label" => "Presupuestos.paginasPortadaPliegosPrecio",
"rules" => "decimal|permit_empty",
],
"paginas_cubierta_precio" => [
"label" => "Presupuestos.paginasPortadaPrecio",
"rules" => "decimal|permit_empty",
],
"papel_formato_alto" => [
"label" => "Presupuestos.papelFormatoAlto",
"rules" => "decimal|permit_empty",
],
"papel_formato_ancho" => [
"label" => "Presupuestos.papelFormatoAncho",
"rules" => "decimal|permit_empty",
],
"pedido_espera_fecha" => [
"label" => "Presupuestos.pedidoEsperaFecha",
"rules" => "valid_date|permit_empty",
"cliente_id" => [
"label" => "Presupuestos.clienteId",
"rules" => "required|integer|greater_than[0]",
],
"referencia_cliente" => [
"label" => "Presupuestos.referenciaCliente",
"rules" => "trim|required|max_length[100]",
],
"responsable" => [
"label" => "Presupuestos.responsable",
"rules" => "trim|max_length[32]",
],
"serie_id" => [
"label" => "Presupuestos.serieId",
"rules" => "integer|permit_empty",
],
"solapas_ancho" => [
"label" => "Presupuestos.solapasAncho",
"rules" => "required|decimal",
],
"tarifa_cliente_id" => [
"label" => "Presupuestos.tarifaClienteId",
"rules" => "integer|permit_empty",
],
"tirada" => [
"label" => "Presupuestos.tirada",
"rules" => "required|integer",
],
"tirada_alternativa_json_data" => [
"label" => "Presupuestos.tiradaAlternativaJsonData",
"rules" => "trim|max_length[16313]",
],
"titulo" => [
"label" => "Presupuestos.titulo",
"rules" => "trim|required|max_length[300]",
],
"total" => [
"label" => "Presupuestos.total",
"rules" => "decimal|permit_empty",
],
"total_acabado" => [
"label" => "Presupuestos.totalAcabado",
"rules" => "decimal|permit_empty",
],
"total_calculado" => [
"label" => "Presupuestos.totalCalculado",
"rules" => "decimal|permit_empty",
],
"total_click" => [
"label" => "Presupuestos.totalClick",
"rules" => "decimal|permit_empty",
],
"total_confirmado" => [
"label" => "Presupuestos.totalConfirmado",
"rules" => "decimal|permit_empty",
],
"total_confirmado_update_at" => [
"label" => "Presupuestos.totalConfirmadoUpdateAt",
"rules" => "valid_date|permit_empty",
],
"total_descuento" => [
"label" => "Presupuestos.totalDescuento",
"rules" => "decimal|permit_empty",
],
"total_envios" => [
"label" => "Presupuestos.totalEnvios",
"rules" => "decimal|permit_empty",
],
"total_manipulado" => [
"label" => "Presupuestos.totalManipulado",
"rules" => "decimal|permit_empty",
],
"total_margen" => [
"label" => "Presupuestos.totalMargen",
"rules" => "decimal|permit_empty",
],
"total_margen_extra" => [
"label" => "Presupuestos.totalMargenExtra",
"rules" => "decimal|permit_empty",
],
"total_pedido" => [
"label" => "Presupuestos.totalPedido",
"rules" => "decimal|permit_empty",
],
"total_peso" => [
"label" => "Presupuestos.totalPeso",
"rules" => "decimal|permit_empty",
],
"total_preimpresion" => [
"label" => "Presupuestos.totalPreimpresion",
"rules" => "decimal|permit_empty",
],
"total_preimpresion_margen" => [
"label" => "Presupuestos.totalPreimpresionMargen",
"rules" => "decimal|permit_empty",
],
"total_presupuesto" => [
"label" => "Presupuestos.totalPresupuesto",
"rules" => "decimal|permit_empty",
],
"user_created_id" => [
"label" => "Presupuestos.userCreatedId",
"rules" => "required|integer",
],
"user_update_id" => [
"label" => "Presupuestos.userUpdateId",
"rules" => "integer|permit_empty",
],
"version" => [
"label" => "Presupuestos.version",
"rules" => "required|integer",
"rules" => "trim|max_length[100]",
],
];
protected $validationMessages = [
"aprobado_at" => [
"valid_date" => "Presupuestos.validation.aprobado_at.valid_date",
],
"aprobado_json_data" => [
"max_length" => "Presupuestos.validation.aprobado_json_data.max_length",
],
protected $validationMessagesAdd = [
"autor" => [
"max_length" => "Presupuestos.validation.autor.max_length",
"required" => "Presupuestos.validation.autor.required",
],
"base_imponible" => [
"decimal" => "Presupuestos.validation.base_imponible.decimal",
],
"catalogo_id" => [
"integer" => "Presupuestos.validation.catalogo_id.integer",
],
"causa_cancelacion" => [
"max_length" => "Presupuestos.validation.causa_cancelacion.max_length",
],
"coleccion" => [
"max_length" => "Presupuestos.validation.coleccion.max_length",
],
"comentarios" => [
"max_length" => "Presupuestos.validation.comentarios.max_length",
"required" => "Presupuestos.validation.comentarios.required",
],
"comentarios_pdf" => [
"max_length" => "Presupuestos.validation.comentarios_pdf.max_length",
"required" => "Presupuestos.validation.comentarios_pdf.required",
],
"comentarios_safekat" => [
"max_length" => "Presupuestos.validation.comentarios_safekat.max_length",
"required" => "Presupuestos.validation.comentarios_safekat.required",
],
"comentarios_tarifa" => [
"max_length" => "Presupuestos.validation.comentarios_tarifa.max_length",
"required" => "Presupuestos.validation.comentarios_tarifa.required",
],
"comparador_json_data" => [
"max_length" => "Presupuestos.validation.comparador_json_data.max_length",
],
"sobrecubiertas_ancho" => [
"decimal" => "Presupuestos.validation.sobrecubiertas_ancho.decimal",
"required" => "Presupuestos.validation.sobrecubiertas_ancho.required",
],
"descuento" => [
"decimal" => "Presupuestos.validation.descuento.decimal",
"required" => "Presupuestos.validation.descuento.required",
],
"fecha_encuardenado_at" => [
"valid_date" => "Presupuestos.validation.fecha_encuardenado_at.valid_date",
],
"fecha_entrega_real_at" => [
"valid_date" => "Presupuestos.validation.fecha_entrega_real_at.valid_date",
],
"fecha_externo_at" => [
"valid_date" => "Presupuestos.validation.fecha_externo_at.valid_date",
],
"fecha_ferro_subido_at" => [
"valid_date" => "Presupuestos.validation.fecha_ferro_subido_at.valid_date",
],
"fecha_impresion_at" => [
"valid_date" => "Presupuestos.validation.fecha_impresion_at.valid_date",
],
"forzar_total" => [
"decimal" => "Presupuestos.validation.forzar_total.decimal",
"required" => "Presupuestos.validation.forzar_total.required",
],
"inc_rei" => [
"integer" => "Presupuestos.validation.inc_rei.integer",
],
"is_deleted" => [
"integer" => "Presupuestos.validation.is_deleted.integer",
"required" => "Presupuestos.validation.is_deleted.required",
],
"isbn" => [
"max_length" => "Presupuestos.validation.isbn.max_length",
],
"lomo" => [
"integer" => "Presupuestos.validation.lomo.integer",
],
"margen" => [
"decimal" => "Presupuestos.validation.margen.decimal",
],
"margen_extra" => [
"decimal" => "Presupuestos.validation.margen_extra.decimal",
"required" => "Presupuestos.validation.margen_extra.required",
],
"margen_manual" => [
"decimal" => "Presupuestos.validation.margen_manual.decimal",
],
"merma" => [
"decimal" => "Presupuestos.validation.merma.decimal",
"required" => "Presupuestos.validation.merma.required",
],
"merma_portada" => [
"decimal" => "Presupuestos.validation.merma_portada.decimal",
"required" => "Presupuestos.validation.merma_portada.required",
],
"numero_edicion" => [
"max_length" => "Presupuestos.validation.numero_edicion.max_length",
],
"paginas" => [
"integer" => "Presupuestos.validation.paginas.integer",
"required" => "Presupuestos.validation.paginas.required",
],
"paginas_color" => [
"integer" => "Presupuestos.validation.paginas_color.integer",
],
"paginas_color_click" => [
"decimal" => "Presupuestos.validation.paginas_color_click.decimal",
],
"paginas_color_forma_id" => [
"integer" => "Presupuestos.validation.paginas_color_forma_id.integer",
],
"paginas_color_gramaje" => [
"decimal" => "Presupuestos.validation.paginas_color_gramaje.decimal",
],
"paginas_color_libro" => [
"decimal" => "Presupuestos.validation.paginas_color_libro.decimal",
],
"paginas_color_mano" => [
"decimal" => "Presupuestos.validation.paginas_color_mano.decimal",
],
"paginas_color_pedido" => [
"decimal" => "Presupuestos.validation.paginas_color_pedido.decimal",
],
"paginas_color_peso" => [
"decimal" => "Presupuestos.validation.paginas_color_peso.decimal",
],
"paginas_color_pliegos_libro" => [
"decimal" => "Presupuestos.validation.paginas_color_pliegos_libro.decimal",
],
"paginas_color_pliegos_pedido" => [
"decimal" => "Presupuestos.validation.paginas_color_pliegos_pedido.decimal",
],
"paginas_color_pliegos_precio" => [
"decimal" => "Presupuestos.validation.paginas_color_pliegos_precio.decimal",
],
"paginas_color_posicion" => [
"max_length" => "Presupuestos.validation.paginas_color_posicion.max_length",
],
"paginas_color_precio" => [
"decimal" => "Presupuestos.validation.paginas_color_precio.decimal",
],
"paginas_sobrecubierta" => [
"in_list" => "Presupuestos.validation.paginas_sobrecubierta.in_list",
"required" => "Presupuestos.validation.paginas_sobrecubierta.required",
],
"paginas_sobrecubierta_click" => [
"decimal" => "Presupuestos.validation.paginas_sobrecubierta_click.decimal",
],
"paginas_sobrecubierta_forma_id" => [
"integer" => "Presupuestos.validation.paginas_sobrecubierta_forma_id.integer",
],
"paginas_sobrecubierta_gramaje" => [
"decimal" => "Presupuestos.validation.paginas_sobrecubierta_gramaje.decimal",
],
"paginas_sobrecubierta_libro" => [
"decimal" => "Presupuestos.validation.paginas_sobrecubierta_libro.decimal",
],
"paginas_sobrecubierta_mano" => [
"decimal" => "Presupuestos.validation.paginas_sobrecubierta_mano.decimal",
],
"paginas_sobrecubierta_pedido" => [
"decimal" => "Presupuestos.validation.paginas_sobrecubierta_pedido.decimal",
],
"paginas_sobrecubierta_peso" => [
"decimal" => "Presupuestos.validation.paginas_sobrecubierta_peso.decimal",
],
"paginas_sobrecubierta_pliegos_libro" => [
"decimal" => "Presupuestos.validation.paginas_sobrecubierta_pliegos_libro.decimal",
],
"paginas_sobrecubierta_pliegos_pedido" => [
"decimal" => "Presupuestos.validation.paginas_sobrecubierta_pliegos_pedido.decimal",
],
"paginas_sobrecubierta_pliegos_precio" => [
"decimal" => "Presupuestos.validation.paginas_sobrecubierta_pliegos_precio.decimal",
],
"paginas_sobrecubierta_precio" => [
"decimal" => "Presupuestos.validation.paginas_sobrecubierta_precio.decimal",
],
"paginas_negro" => [
"integer" => "Presupuestos.validation.paginas_negro.integer",
],
"paginas_negro_click" => [
"decimal" => "Presupuestos.validation.paginas_negro_click.decimal",
],
"paginas_negro_forma_id" => [
"integer" => "Presupuestos.validation.paginas_negro_forma_id.integer",
],
"paginas_negro_gramaje" => [
"decimal" => "Presupuestos.validation.paginas_negro_gramaje.decimal",
],
"paginas_negro_libro" => [
"decimal" => "Presupuestos.validation.paginas_negro_libro.decimal",
],
"paginas_negro_mano" => [
"decimal" => "Presupuestos.validation.paginas_negro_mano.decimal",
],
"paginas_negro_pedido" => [
"decimal" => "Presupuestos.validation.paginas_negro_pedido.decimal",
],
"paginas_negro_peso" => [
"decimal" => "Presupuestos.validation.paginas_negro_peso.decimal",
],
"paginas_negro_pliegos_libro" => [
"decimal" => "Presupuestos.validation.paginas_negro_pliegos_libro.decimal",
],
"paginas_negro_pliegos_pedido" => [
"decimal" => "Presupuestos.validation.paginas_negro_pliegos_pedido.decimal",
],
"paginas_negro_pliegos_precio" => [
"decimal" => "Presupuestos.validation.paginas_negro_pliegos_precio.decimal",
],
"paginas_negro_precio" => [
"decimal" => "Presupuestos.validation.paginas_negro_precio.decimal",
],
"paginas_cubierta" => [
"in_list" => "Presupuestos.validation.paginas_cubierta.in_list",
"required" => "Presupuestos.validation.paginas_cubierta.required",
],
"paginas_cubierta_click" => [
"decimal" => "Presupuestos.validation.paginas_cubierta_click.decimal",
],
"paginas_cubierta_forma_id" => [
"integer" => "Presupuestos.validation.paginas_cubierta_forma_id.integer",
],
"paginas_cubierta_gramaje" => [
"decimal" => "Presupuestos.validation.paginas_cubierta_gramaje.decimal",
],
"paginas_cubierta_libro" => [
"decimal" => "Presupuestos.validation.paginas_cubierta_libro.decimal",
],
"paginas_cubierta_mano" => [
"decimal" => "Presupuestos.validation.paginas_cubierta_mano.decimal",
],
"paginas_cubierta_pedido" => [
"decimal" => "Presupuestos.validation.paginas_cubierta_pedido.decimal",
"required" => "Presupuestos.validation.paginas_cubierta_pedido.required",
],
"paginas_cubierta_peso" => [
"decimal" => "Presupuestos.validation.paginas_cubierta_peso.decimal",
],
"paginas_cubierta_pliegos_libro" => [
"decimal" => "Presupuestos.validation.paginas_cubierta_pliegos_libro.decimal",
],
"paginas_cubierta_pliegos_pedido" => [
"decimal" => "Presupuestos.validation.paginas_cubierta_pliegos_pedido.decimal",
],
"paginas_cubierta_pliegos_precio" => [
"decimal" => "Presupuestos.validation.paginas_cubierta_pliegos_precio.decimal",
],
"paginas_cubierta_precio" => [
"decimal" => "Presupuestos.validation.paginas_cubierta_precio.decimal",
],
"papel_formato_alto" => [
"decimal" => "Presupuestos.validation.papel_formato_alto.decimal",
],
"papel_formato_ancho" => [
"decimal" => "Presupuestos.validation.papel_formato_ancho.decimal",
],
"pedido_espera_fecha" => [
"valid_date" => "Presupuestos.validation.pedido_espera_fecha.valid_date",
],
"referencia_cliente" => [
"max_length" => "Presupuestos.validation.referencia_cliente.max_length",
"required" => "Presupuestos.validation.referencia_cliente.required",
],
"responsable" => [
"max_length" => "Presupuestos.validation.responsable.max_length",
],
"serie_id" => [
"integer" => "Presupuestos.validation.serie_id.integer",
],
"solapas_ancho" => [
"decimal" => "Presupuestos.validation.solapas_ancho.decimal",
"required" => "Presupuestos.validation.solapas_ancho.required",
],
"tarifa_cliente_id" => [
"integer" => "Presupuestos.validation.tarifa_cliente_id.integer",
],
"tirada" => [
"integer" => "Presupuestos.validation.tirada.integer",
"required" => "Presupuestos.validation.tirada.required",
],
"tirada_alternativa_json_data" => [
"max_length" => "Presupuestos.validation.tirada_alternativa_json_data.max_length",
"max_length" => "Presupuestos.validation.max_length",
"required" => "Presupuestos.validation.requerido",
],
"titulo" => [
"max_length" => "Presupuestos.validation.titulo.max_length",
"required" => "Presupuestos.validation.titulo.required",
"max_length" => "Presupuestos.validation.max_length",
"required" => "Presupuestos.validation.requerido",
],
"total" => [
"decimal" => "Presupuestos.validation.total.decimal",
"inc_rei" => [
"integer" => "Presupuestos.validation.integer",
],
"total_acabado" => [
"decimal" => "Presupuestos.validation.total_acabado.decimal",
"coleccion" => [
"max_length" => "Presupuestos.validation.max_length",
],
"total_calculado" => [
"decimal" => "Presupuestos.validation.total_calculado.decimal",
"numero_edicion" => [
"max_length" => "Presupuestos.validation.max_length",
],
"total_click" => [
"decimal" => "Presupuestos.validation.total_click.decimal",
"isbn" => [
"max_length" => "Presupuestos.validation.max_length",
],
"total_confirmado" => [
"decimal" => "Presupuestos.validation.total_confirmado.decimal",
"pais_id" => [
"required" => "Presupuestos.validation.requerido",
],
"total_confirmado_update_at" => [
"valid_date" => "Presupuestos.validation.total_confirmado_update_at.valid_date",
],
"total_descuento" => [
"decimal" => "Presupuestos.validation.total_descuento.decimal",
],
"total_envios" => [
"decimal" => "Presupuestos.validation.total_envios.decimal",
],
"total_manipulado" => [
"decimal" => "Presupuestos.validation.total_manipulado.decimal",
],
"total_margen" => [
"decimal" => "Presupuestos.validation.total_margen.decimal",
],
"total_margen_extra" => [
"decimal" => "Presupuestos.validation.total_margen_extra.decimal",
],
"total_pedido" => [
"decimal" => "Presupuestos.validation.total_pedido.decimal",
],
"total_peso" => [
"decimal" => "Presupuestos.validation.total_peso.decimal",
],
"total_preimpresion" => [
"decimal" => "Presupuestos.validation.total_preimpresion.decimal",
],
"total_preimpresion_margen" => [
"decimal" => "Presupuestos.validation.total_preimpresion_margen.decimal",
],
"total_presupuesto" => [
"decimal" => "Presupuestos.validation.total_presupuesto.decimal",
],
"user_created_id" => [
"integer" => "Presupuestos.validation.user_created_id.integer",
"required" => "Presupuestos.validation.user_created_id.required",
],
"user_update_id" => [
"integer" => "Presupuestos.validation.user_update_id.integer",
],
"version" => [
"integer" => "Presupuestos.validation.version.integer",
"required" => "Presupuestos.validation.version.required",
"cliente_id" => [
"required" => "Presupuestos.validation.requerido",
],
"referencia_cliente" => [
"max_length" => "Presupuestos.validation.max_length",
],
];
public function findAllWithAllRelations(string $selcols = "*", int $limit = null, int $offset = 0)
{
@ -1038,13 +315,15 @@ class PresupuestoModel extends \App\Models\GoBaseModel
"t1.id AS id, t1.created_at AS fecha, t2.nombre AS cliente,
CONCAT(t3.first_name, ' ', t3.last_name) AS comercial, t1.titulo AS titulo,
t5.nombre AS pais, t1.inc_rei AS inc_rei, t1.paginas AS paginas, t1.tirada AS tirada,
t1.total_pedido AS total_pedido, t6.estado AS estado"
t1.total_pedido AS total_pedido, t1.total_presupuesto AS total_presupuesto, t6.estado AS estado"
);
$builder->join("clientes t2", "t1.cliente_id = t2.id", "left");
$builder->join("auth_user t3", "t1.user_update_id = t3.id_user", "left");
$builder->join("lg_paises t5", "t1.pais_id = t5.id", "left");
$builder->join("presupuesto_estados t6", "t1.estado_id = t6.id", "left");
$builder->where("t1.is_deleted", 0);
return empty($search)
? $builder
: $builder

View File

@ -0,0 +1,68 @@
<?php
namespace App\Models\Presupuestos;
class PresupuestoPreimpresionesModel extends \App\Models\GoBaseModel
{
protected $table = "presupuesto_preimpresiones";
/**
* Whether primary key uses auto increment.
*
* @var bool
*/
protected $useAutoIncrement = true;
const SORTABLE = [
0 => "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;
}
}

View File

@ -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');
}
}

View File

@ -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();
}
}

View File

@ -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();
}
}

View File

@ -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();
}
}

View File

@ -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();
}
}

View File

@ -4,24 +4,418 @@ 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['velocidad_corte'] = $maquina->velocidad_corte;
$data['precio_hora_corte'] = $maquina->precio_hora_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;
}
}

View File

@ -24,7 +24,7 @@ if (session()->has('error')) {
<?= $this->section('additionalInlineJs') ?>
function popAlert(message, alertClass, alertIcon){
function popAlert(message, alertClass, alertIcon, containerId = 'sk-alert'){
var htmlString = `
<div class="alert ${alertClass} d-flex align-items-baseline" role="alert">
<span class="alert-icon alert-icon-lg text-primary me-2">
@ -34,24 +34,26 @@ function popAlert(message, alertClass, alertIcon){
<h5 class="alert-heading mb-2">${message}</h5>
</div>
</div>`;
$(window).scrollTop(0);
$('#sk-alert').hide().empty().html(htmlString).fadeIn("slow", function(){
if(containerId == 'sk-alert'){
$(window).scrollTop(0);
}
$('#' + containerId).hide().empty().html(htmlString).fadeIn("slow", function(){
setTimeout(function(){
$('#sk-alert').fadeOut("slow");
$('#' + containerId).fadeOut("slow");
}, 5000);
});
}
function popSuccessAlert(successMsg){
popAlert(successMsg, "alert-success", "ti-check");
function popSuccessAlert(successMsg, containerId = 'sk-alert'){
popAlert(successMsg, "alert-success", "ti-check", containerId);
}
function popWarningAlert(warningMsg){
popAlert(warningMsg, "alert-warning", "ti-bell");
function popWarningAlert(warningMsg, containerId = 'sk-alert'){
popAlert(warningMsg, "alert-warning", "ti-bell", containerId);
}
function popErrorAlert(errorMsg){
popAlert(errorMsg, "alert-danger", "ti-ban");
function popErrorAlert(errorMsg, containerId = 'sk-alert'){
popAlert(errorMsg, "alert-danger", "ti-ban", containerId);
}
<?php if (isset($successMessage) && $successMessage){ ?>

View File

@ -13,7 +13,7 @@
<div class="modal-footer">
<button type="button" class="btn btn-default"
data-bs-dismiss="modal"><?= lang('Basic.global.deleteConfirmationCancel') ?></button>
<a href="javascript:void(0);" class="btn btn-danger btn-confirm btn-remove"><?= lang('Basic.global.deleteConfirmationButton') ?></a>
<a id="confirmDelete" href="javascript:void(0);" class="btn btn-danger btn-confirm btn-remove"><?= lang('Basic.global.deleteConfirmationButton') ?></a>
</div><!--//.modal-footer -->
</div><!--//.modal-content -->
</div><!--//.modal-dialog -->

View File

@ -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);
}

View File

@ -1,12 +0,0 @@
<div class="row">
<div class="col-md-12 col-lg-12 px-4">
<div class="mb-3">
<label for="nombre" class="form-label">
<?=lang('FormasPagoes.nombre') ?>*
</label>
<input type="text" id="nombre" name="nombre" required maxLength="255" class="form-control" value="<?=old('nombre', $formasPagoEntity->nombre) ?>">
</div><!--//.mb-3 -->
</div><!--//.col -->
</div><!-- //.row -->

View File

@ -1,26 +0,0 @@
<?= $this->include("themes_commonPartialsBs/select2bs5") ?>
<?= $this->include("themes_commonPartialsBs/sweetalert") ?>
<?= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>
<?= $this->section("content") ?>
<div class="row">
<div class="col-12">
<div class="card card-info">
<div class="card-header">
<h3 class="card-title"><?= $boxTitle ?? $pageTitle ?></h3>
</div><!--//.card-header -->
<form id="formaPagoForm" method="post" action="<?= $formAction ?>">
<?= csrf_field() ?>
<div class="card-body">
<?= view("themes_commonPartialsBs/_alertBoxes") ?>
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
<?= view("themes/backend/vuexy/form/configuracion/formas-pago/_formaPagoFormItems") ?>
</div><!-- /.card-body -->
<div class="card-footer">
<?= anchor(route_to("formaPagoList2"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary float-start"]) ?>
<input type="submit" class="btn btn-primary float-end" name="save" value="<?= lang("Basic.global.Save") ?>">
</div><!-- /.card-footer -->
</form>
</div><!-- //.card -->
</div><!--//.col -->
</div><!--//.row -->
<?= $this->endSection() ?>

View File

@ -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'); ?>
<div class="row">
<div class="col-md-12">
<div class="card card-info">
<div class="card-header">
<h3 class="card-title"><?=lang('FormasPagoes.formaPagoList') ?></h3>
</div><!--//.card-header -->
<div class="card-body">
<?= view('themes_commonPartialsBs/_alertBoxes'); ?>
<table id="tableOfFormaspago" class="table table-striped table-hover using-exportable-data-table" style="width: 100%;">
<thead>
<tr>
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
<th><?= lang('FormasPagoes.id') ?></th>
<th><?= lang('FormasPagoes.nombre') ?></th>
<th><?= lang('FormasPagoes.createdAt') ?></th>
<th><?= lang('FormasPagoes.updatedAt') ?></th>
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($formaPagoList as $item ) : ?>
<tr>
<td class="align-middle text-center text-nowrap">
<?=anchor(route_to('editFormaPago', $item->id), lang('Basic.global.edit'), ['class'=>'btn btn-sm btn-warning btn-edit me-1', 'data-id'=>$item->id,]); ?>
<?=anchor('#confirm2delete', lang('Basic.global.Delete'), ['class'=>'btn btn-sm btn-danger btn-delete ms-1', 'data-href'=>route_to('deleteFormaPago', $item->id)]); ?>
</td>
<td class="align-middle text-center">
<?=$item->id ?>
</td>
<td class="align-middle">
<?= empty($item->nombre) || strlen($item->nombre) < 51 ? esc($item->nombre) : character_limiter(esc($item->nombre), 50) ?>
</td>
<td class="align-middle text-nowrap">
<?= empty($item->created_at) ? '' : date('mm/dd/YYYY H:i', strtotime($item->created_at)) ?>
</td>
<td class="align-middle text-nowrap">
<?= empty($item->updated_at) ? '' : date('mm/dd/YYYY H:i', strtotime($item->updated_at)) ?>
</td>
<td class="align-middle text-center text-nowrap">
<?=anchor(route_to('editFormaPago', $item->id), lang('Basic.global.edit'), ['class'=>'btn btn-sm btn-warning btn-edit me-1', 'data-id'=>$item->id,]); ?>
<?=anchor('#confirm2delete', lang('Basic.global.Delete'), ['class'=>'btn btn-sm btn-danger btn-delete ms-1', 'data-href'=>route_to('deleteFormaPago', $item->id)]); ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div><!--//.card-body -->
<div class="card-footer">
<?=anchor(route_to('newFormaPago'), lang('Basic.global.addNew').' '.lang('FormasPagoes.formaPago'), ['class'=>'btn btn-primary float-end']); ?>
</div><!--//.card-footer -->
</div><!--//.card -->
</div><!--//.col -->
</div><!--//.row -->
<?=$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') ?>
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.2.3/css/buttons.bootstrap5.min.css">
<?=$this->endSection() ?>
<?= $this->section('additionalExternalJs') ?>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.print.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.0/jszip.min.js" integrity="sha512-xcHCGC5tQ0SHlRX8Anbz6oy/OullASJkEhb4gjkneVpGE3/QGYejf14CUO5n5q5paiHfRFTa9HKgByxzidw2Bw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.5/pdfmake.min.js" integrity="sha512-rDbVu5s98lzXZsmJoMa0DjHNE+RwPJACogUCLyq3Xxm2kJO6qsQwjbE5NDk2DqmlKcxDirCnU1wAzVLe12IM3w==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.5/vfs_fonts.js" integrity="sha512-cktKDgjEiIkPVHYbn8bh/FEyYxmt4JDJJjOCu5/FQAkW4bc911XtKYValiyzBiJigjVEvrIAyQFEbRJZyDA1wQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<?=$this->endSection() ?>

View File

@ -101,16 +101,16 @@
<?= lang('Maquinas.forzarNumFormasHorizontalesPortada') ?>
</label>
<input type="number" id="forzarNumFormasHorizontalesPortada"
name="forzar_num_formas_horizontales_portada" maxLength="11" class="form-control"
value="<?= old('forzar_num_formas_horizontales_portada', $maquina->forzar_num_formas_horizontales_portada) ?>">
name="forzar_num_formas_horizontales_cubierta" maxLength="11" class="form-control"
value="<?= old('forzar_num_formas_horizontales_cubierta', $maquina->forzar_num_formas_horizontales_cubierta) ?>">
</div>
<div class="col-md-3">
<label for="forzarNumFormasVerticalesPortada" class="form-label">
<?= lang('Maquinas.forzarNumFormasVerticalesPortada') ?>
</label>
<input type="number" id="forzarNumFormasVerticalesPortada"
name="forzar_num_formas_verticales_portada" maxLength="11" class="form-control"
value="<?= old('forzar_num_formas_verticales_portada', $maquina->forzar_num_formas_verticales_portada) ?>">
name="forzar_num_formas_verticales_cubierta" maxLength="11" class="form-control"
value="<?= old('forzar_num_formas_verticales_cubierta', $maquina->forzar_num_formas_verticales_cubierta) ?>">
</div>
<div class="col-md-12">
<label for="observaciones" class="form-label">

View File

@ -78,8 +78,7 @@
<table id="tableOfCalles" class="table table-striped table-hover" style="width: 100%;">
<thead>
<tr>
<th><?= lang('MaquinasCalles.formas_min') ?></th>
<th><?= lang('MaquinasCalles.formas_max') ?></th>
<th><?= lang('MaquinasCalles.formas') ?></th>
<th><?= lang('MaquinasCalles.internas') ?></th>
<th><?= lang('MaquinasCalles.externas') ?></th>
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
@ -479,13 +478,14 @@
processing: true,
autoWidth: true,
responsive: true,
lengthMenu: [ 5, 10, 25],
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250],
order: [[ 1, "asc" ]],
pageLength: 10,
pageLength: 25,
lengthChange: true,
searching: true,
paging: true,
info: true,
stateSave: true,
dom: "lftp",
ajax : $.fn.dataTable.pipeline( {
url: '<?= route_to('dataTableOfMaquinasPapelesImpresion') ?>',
@ -522,8 +522,11 @@
columnDefs: [
{
orderable: false,
searchable: false,
targets: [lastColNr2]
},
{
searchable: false,
targets: [0,3,4,5,6,7,8,lastColNr2]
}
],
rowCallback: function (row, data) {
@ -532,13 +535,7 @@
},
language: {
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
},
columnDefs: [
{
searchable: false,
targets: [0,3,4,5,6,7,8]
}
],
}
} );
@ -657,9 +654,7 @@
table : "#tableOfCalles",
idSrc: 'id',
fields: [ {
name: "formas_min"
}, {
name: "formas_max"
name: "formas"
}, {
name: "internas"
}, {
@ -728,8 +723,7 @@
async: true,
}),
columns : [
{ 'data': 'formas_min' },
{ 'data': 'formas_max' },
{ 'data': 'formas' },
{ 'data': 'internas' },
{ 'data': 'externas' },
{ data: actionBtns,

View File

@ -0,0 +1,173 @@
<div class="accordion mt-3" id="accordionComentarios">
<div class="card accordion-item active">
<h2 class="accordion-header" id="headingOne">
<button type="button" class="accordion-button" data-bs-toggle="collapse"
data-bs-target="#accordionComentariosTip" aria-expanded="false"
aria-controls="accordionComentariosTip">
<h4><?= lang("Presupuestos.comentarios") ?></h4>
</button>
</h2>
<div id="accordionComentariosTip" class="accordion-collapse collapse show"
data-bs-parent="#accordionComentarios">
<div class="accordion-body">
<div class="nav-align-top mb-4">
<ul class="nav nav-pills mb-3" role="tablist">
<li class="nav-item">
<button
type="button"
class="nav-link active"
role="tab"
data-bs-toggle="tab"
data-bs-target="#comentarios-cliente"
aria-controls="comentarios-cliente"
aria-selected="true">
<?= lang("Presupuestos.comentariosCliente") ?>
<span
id="mostrar_comentarios_cliente"
style="display: none"
class="badge rounded-pill badge-center h-px-20 w-px-20 bg-warning ms-1">
!
</span>
</button>
</li>
<li class="nav-item">
<button
type="button"
class="nav-link"
role="tab"
data-bs-toggle="tab"
data-bs-target="#comentarios-safekat"
aria-controls="comentarios-safekat"
aria-selected="false">
<?= lang("Presupuestos.comentariosSafekat") ?>
<span
id="mostrar_comentarios_safekat"
style="display: none"
class="badge rounded-pill badge-center h-px-20 w-px-20 bg-warning ms-1">
!
</span>
</button>
</li>
<li class="nav-item">
<button
type="button"
class="nav-link"
role="tab"
data-bs-toggle="tab"
data-bs-target="#comentarios-presupuesto"
aria-controls="comentarios-presupuesto"
aria-selected="false">
<?= lang("Presupuestos.comentariosPresupuesto") ?>
<span
id="mostrar_comentarios_pdf"
style="display: none"
class="badge rounded-pill badge-center h-px-20 w-px-20 bg-warning ms-1">
!
</span>
</button>
</li>
<li class="nav-item">
<button
type="button"
class="nav-link"
role="tab"
data-bs-toggle="tab"
data-bs-target="#comentarios-produccion"
aria-controls="comentarios-produccion"
aria-selected="false">
<?= lang("Presupuestos.comentariosProduccion") ?>
<span
id="mostrar_comentarios_produccion"
style="display: none"
class="badge rounded-pill badge-center h-px-20 w-px-20 bg-warning ms-1">
!
</span>
</button>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane fade show active" id="comentarios-cliente" role="tabpanel">
<div class="row">
<div class="col-md-12 col-lg-12 px-4">
<div class="mb-3">
<textarea
rows="3"
id="comentariosCliente"
name="comentarios_cliente"
style="height: 10em;"
class="form-control"><?= old('comentarios', $presupuestoEntity->comentarios_cliente) ?></textarea>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="comentarios-safekat" role="tabpanel">
<div class="row">
<div class="col-md-12 col-lg-12 px-4">
<div class="mb-3">
<textarea
rows="3"
id="comentariosSafekat"
name="comentarios_safekat"
style="height: 10em;"
class="form-control"><?=old('comentarios_safekat', $presupuestoEntity->comentarios_safekat) ?></textarea>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="comentarios-presupuesto" role="tabpanel">
<div class="row">
<div class="col-md-12 col-lg-12 px-4">
<div class="mb-3">
<textarea
rows="3"
id="comentariosPdf"
name="comentarios_pdf"
style="height: 10em;"
class="form-control"><?=old('comentarios_pdf', $presupuestoEntity->comentarios_pdf) ?></textarea>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="comentarios-produccion" role="tabpanel">
<div class="row">
<div class="col-md-12 col-lg-12 px-4">
<div class="mb-3">
<textarea
rows="3"
id="comentariosProduccion"
name="comentarios_produccion"
style="height: 10em;"
class="form-control"><?=old('comentarios_pdf', $presupuestoEntity->comentarios_produccion) ?></textarea>
</div>
</div>
</div>
</div>
</div>
</div>
</div> <!-- //.accordion-body -->
</div> <!-- //.accordion-collapse -->
</div> <!-- //.accordion-item -->
</div> <!-- //.accordion -->
<!------------------------------------------------------->
<!-- Código JS comportamiento ?????. -->
<!------------------------------------------------------->
<?= $this->section("additionalInlineJs") ?>
$("textarea[name*='comentarios_']").each(function(){
if (!$.trim($(this).val())) {
// textarea is empty or contains only white-space
$("#mostrar_" + $(this).attr('name')).hide();
}else{
$("#mostrar_" + $(this).attr('name')).show();
}
});
<?= $this->endSection() ?>

View File

@ -204,26 +204,11 @@
<div class="mb-3">
<label for="comentarios" class="form-label">
<?=lang('Presupuestos.comentarios') ?>*
</label>
<textarea rows="3" id="comentarios" name="comentarios" required style="height: 10em;" class="form-control"><?=old('comentarios', $presupuestoEntity->comentarios) ?></textarea>
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="comentariosSafekat" class="form-label">
<?=lang('Presupuestos.comentariosSafekat') ?>*
</label>
<textarea rows="3" id="comentariosSafekat" name="comentarios_safekat" required style="height: 10em;" class="form-control"><?=old('comentarios_safekat', $presupuestoEntity->comentarios_safekat) ?></textarea>
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="comentariosPdf" class="form-label">
<?=lang('Presupuestos.comentariosPdf') ?>*
</label>
<textarea rows="3" id="comentariosPdf" name="comentarios_pdf" required style="height: 10em;" class="form-control"><?=old('comentarios_pdf', $presupuestoEntity->comentarios_pdf) ?></textarea>
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="comentariosTarifa" class="form-label">

View File

@ -19,7 +19,7 @@
<label for="paginas" class="form-label">
<?= lang('Presupuestos.paginas') ?>*
</label>
<input type="number" id="paginas" name="paginas" maxLength="11" class="form-control" value="<?= old('paginas', $presupuestoEntity->paginas) ?>">
<input type="number" id="paginas" name="paginas" tabindex="1" maxLength="11" class="form-control" value="<?= old('paginas', $presupuestoEntity->paginas) ?>">
</div><!--//.mb-3 -->
</div>
@ -29,7 +29,7 @@
<div class="mb-3">
<div class="form-check form-switch mb-2">
<input class="form-check-input" type="checkbox" id="solapas" name="solapas" value="1" <?= $presupuestoEntity->solapas == true ? 'checked' : ''; ?>>
<input class="form-check-input" type="checkbox" id="solapas" name="solapas" tabindex="6" value="1" <?= $presupuestoEntity->solapas == true ? 'checked' : ''; ?>>
<label class="form-check-label" for="papelFormatoPersonalizado"><?= lang('Presupuestos.solapasCubierta') ?></label>
</div>
@ -44,7 +44,7 @@
<label for="tirada" class="form-label">
<?= lang('Presupuestos.tirada') ?>*
</label>
<input type="number" id="tirada" name="tirada" maxLength="11" class="form-control" value="<?= old('tirada', $presupuestoEntity->tirada) ?>">
<input type="number" id="tirada" name="tirada" tabindex="2" maxLength="11" class="form-control" value="<?= old('tirada', $presupuestoEntity->tirada) ?>">
</div><!--//.mb-3 -->
</div><!--//.col -->
@ -55,7 +55,7 @@
<?= lang('Presupuestos.papelFormatoId') ?>*
</label>
<select id="papelFormatoId" name="papel_formato_id" class="form-control select2bs2" style="width: 100%;">
<select id="papelFormatoId" name="papel_formato_id" tabindex="3" class="form-control select2bs2" style="width: 100%;">
<?php if (isset($papelFormatoList) && is_array($papelFormatoList) && !empty($papelFormatoList)) :
foreach ($papelFormatoList as $formato) : ?>
@ -95,16 +95,16 @@
<label for="merma" class="form-label">
<?= lang('Presupuestos.merma') ?>*
</label>
<input type="number" id="merma" name="merma" maxLength="8" step="0.01" class="form-control" value="<?= old('merma', $presupuestoEntity->merma) ?>">
<input type="number" id="merma" name="merma" maxLength="8" tabindex="4" step="1" class="form-control" value="<?= old('merma', $presupuestoEntity->merma) ?>">
</div><!--//.mb-3 -->
</div><!--//.col -->
<div class="col-md-12 col-lg-2 px-4">
<div class="mb-3">
<label for="mermaportada" class="form-label">
<?= lang('Presupuestos.mermaportada') ?>*
<label for="mermacubierta" class="form-label">
<?= lang('Presupuestos.mermacubierta') ?>*
</label>
<input type="number" id="mermaportada" name="merma_sobrecubierta" placeholder="6.00" maxLength="8" step="0.01" class="form-control" value="<?= old('merma_sobrecubierta', $presupuestoEntity->merma_sobrecubierta) ?>">
<input type="number" id="mermacubierta" name="merma_cubierta" tabindex="5" placeholder="10" maxLength="8" step="1" class="form-control" value="<?= old('merma_cubierta', $presupuestoEntity->merma_cubierta) ?>">
</div><!--//.mb-3 -->
</div><!--//.col -->
@ -116,7 +116,11 @@
</div>
<div class="row" id="div_solapas_ancho" style="display:none;">
<?php if($presupuestoEntity->solapas == true): ?>
<div class="row" id="div_solapas_ancho">
<?php else: ?>
<div class="row" id="div_solapas_ancho" style="display:none;">
<?php endif; ?>
<div class="col-md-12 col-lg-2 px-4">
<div class="mb-3">
<label for="solapas_ancho" class="form-label">
@ -259,4 +263,32 @@
</div> <!-- //.accordion-body -->
</div> <!-- //.accordion-collapse -->
</div> <!-- //.accordion-item -->
</div> <!-- //.accordion -->
</div> <!-- //.accordion -->
<!------------------------------------------->
<!-- Código JS comportamiento general pag. -->
<!------------------------------------------->
<?= $this->section("additionalInlineJs") ?>
$('#papelFormatoPersonalizado').on("click",function(){
var checkbox = document.getElementById('papelFormatoPersonalizado');
if(checkbox.checked == true){
document.getElementById("papelFormatoAncho").style.display = "block";
document.getElementById("papelFormatoAlto").style.display = "block";
$('#papelFormatoId').next(".select2-container").hide();
$('#papelFormatoId').val('').change();
document.getElementById("label_papelFormatoId").innerHTML =
"<?=lang('Presupuestos.papelFormatoId') ?> (" +
"<?=lang('Presupuestos.papelFormatoAncho') ?> x <?=lang('Presupuestos.papelFormatoAncho') ?>)*";
}
else{
document.getElementById("papelFormatoAncho").value= "";
document.getElementById("papelFormatoAlto").value= "";
document.getElementById("papelFormatoAncho").style.display = "none";
document.getElementById("papelFormatoAlto").style.display = "none";
$('#papelFormatoId').next(".select2-container").show();
document.getElementById("label_papelFormatoId").innerHTML =
"<?=lang('Presupuestos.papelFormatoId') ?>*";
}
});
<?= $this->endSection() ?>

View File

@ -25,7 +25,11 @@
<label for="created_at" class="form-label">
<?= lang('Presupuestos.created_at') ?>
</label>
<input readonly style="background: #E8E8E8;" id="created_at" name="created_at" maxLength="12" class="form-control" value="<?= old('created_at', (isset($presupuestoEntity->created_at)) ? $presupuestoEntity->created_at : date("d/m/Y")) ?>">
<?php if(str_contains($formAction,'edit')): ?>
<input readonly style="background: #E8E8E8;" id="updated_at" name="updated_at" maxLength="12" class="form-control" value="<?= old('created_at', (isset($presupuestoEntity->updated_at)) ? date ('d/m/Y', strtotime($presupuestoEntity->updated_at)) : "") ?>">
<?php else: ?>
<input readonly style="background: #E8E8E8;" id="created_at" name="created_at" maxLength="12" class="form-control" value="<?= old('created_at', (isset($presupuestoEntity->created_at)) ? date ('d/m/Y', strtotime($presupuestoEntity->created_at)) : "") ?>">
<?php endif; ?>
</div><!--//.mb-3 -->
</div><!--//.col -->
@ -34,7 +38,10 @@
<label for="estadoId" class="form-label">
<?= lang('Presupuestos.presupuestoEstado') ?>
</label>
<input readonly style="background: #E8E8E8 ;" id="estadoId" name="estado_id" maxLength="12" class="form-control" value="<?= old('estadoId', (isset($presupuestoEntity->estadoId)) ? $presupuestoEntity->estadoId : lang('Presupuestos.presupuestoEstadoBorrador')) ?>">
<select disabled id="estadoId" name="estado_id" maxLength="11" style="background-color: #E8E8E8;" class="form-control" value="<?= old(1, $presupuestoEntity->estado_id) ?>">
<option value=1><?=lang('Presupuestos.presupuestoEstadoBorrador') ?></option>
<option value=2><?=lang('Presupuestos.presupuestoEstadoAceptado') ?></option>
</select>
</div><!--//.mb-3 -->
</div><!--//.col -->
@ -47,7 +54,7 @@
<?php if (isset($incReiList) && is_array($incReiList) && !empty($incReiList)) : ?>
<option> </option>
<?php foreach ($incReiList as $k => $v) : ?>
<option value="<?= $k ?>" <?= $k == $presupuestoEntity->estado_id ? ' selected' : '' ?>>
<option value="<?= $k ?>" <?= $k == $presupuestoEntity->inc_rei ? ' selected' : '' ?>>
<?= $v ?>
</option>
<?php endforeach;

View File

@ -0,0 +1,712 @@
<div class="accordion mt-3" id="accordionDatosServicios">
<div class="card accordion-item active">
<h2 class="accordion-header" id="headingOne">
<button type="button" class="accordion-button" data-bs-toggle="collapse"
data-bs-target="#accordionDatosServiciosTip" aria-expanded="false"
aria-controls="accordionDatosServiciosTip">
<h4><?= lang("Presupuestos.datosServicios") ?></h4>
</button>
</h2>
<div id="accordionDatosServiciosTip" class="accordion-collapse collapse show"
data-bs-parent="#accordionDatosServicios">
<div class="accordion-body">
<div class="nav-align-top mb-4">
<ul class="nav nav-pills mb-3" role="tablist">
<li class="nav-item">
<button
type="button"
class="nav-link active"
role="tab"
data-bs-toggle="tab"
data-bs-target="#servicios-acabado"
aria-controls="servicios-acabado"
aria-selected="true">
<?= lang("Presupuestos.servicioAcabado") ?>
</button>
</li>
<li class="nav-item">
<button
type="button"
class="nav-link"
role="tab"
data-bs-toggle="tab"
data-bs-target="#servicios-preimpresion"
aria-controls="servicios-preimpresion"
aria-selected="false">
<?= lang("Presupuestos.servicioPreimpresion") ?>
</button>
</li>
<li class="nav-item">
<button
type="button"
class="nav-link"
role="tab"
data-bs-toggle="tab"
data-bs-target="#servicios-encuadernacion"
aria-controls="servicios-encuadernacion"
aria-selected="false">
<?= lang("Presupuestos.servicioEncuadernado") ?>
</button>
</li>
<li class="nav-item">
<button
type="button"
class="nav-link"
role="tab"
data-bs-toggle="tab"
data-bs-target="#servicios-manipulado"
aria-controls="servicios-manipulado"
aria-selected="false">
<?= lang("Presupuestos.servicioManipulado") ?>
</button>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane fade show active" id="servicios-acabado" role="tabpanel">
<table id="tableOfServiciosAcabado" class="table table-striped table-hover" style="width: 100%;">
<thead>
<tr>
<th><?= lang('Tarifaacabado.tarifaacabado') ?></th>
<th><?= lang('Presupuestos.precioUnidad') ?></th>
<th><?= lang('Presupuestos.precioTotal') ?></th>
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<div class="tab-pane fade" id="servicios-preimpresion" role="tabpanel">
<table id="tableOfServiciosPreimpresion" class="table table-striped table-hover" style="width: 100%;">
<thead>
<tr>
<th><?= lang('Tarifapreimpresion.tarifapreimpresion') ?></th>
<th><?= lang('Presupuestos.precioUnidad') ?></th>
<th><?= lang('Presupuestos.precioTotal') ?></th>
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<div class="tab-pane fade" id="servicios-encuadernacion" role="tabpanel">
<table id="tableOfServiciosEncuadernacion" class="table table-striped table-hover" style="width: 100%;">
<thead>
<tr>
<th><?= lang('Tarifaencuadernacion.tarifaencuadernacion') ?></th>
<th><?= lang('Presupuestos.precioUnidad') ?></th>
<th><?= lang('Presupuestos.precioTotal') ?></th>
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<div class="tab-pane fade" id="servicios-manipulado" role="tabpanel">
<table id="tableOfServiciosManipulado" class="table table-striped table-hover" style="width: 100%;">
<thead>
<tr>
<th><?= lang('Tarifamanipulado.tarifamanipulado') ?></th>
<th><?= lang('Presupuestos.precioUnidad') ?></th>
<th><?= lang('Presupuestos.precioTotal') ?></th>
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div> <!-- //.accordion-body -->
</div> <!-- //.accordion-collapse -->
</div> <!-- //.accordion-item -->
</div> <!-- //.accordion -->
<!------------------------------------------------------->
<!-- Código JS comportamiento tabla servicios acabado. -->
<!------------------------------------------------------->
<?= $this->section("additionalInlineJs") ?>
const lastColNr = $('#tableOfServiciosAcabado').find("tr:first th").length - 1;
const url = window.location.href;
const url_parts = url.split('/');
if(url_parts[url_parts.length-2] == 'edit'){
id = url_parts[url_parts.length-1];
}
else{
id = 200000; // id=-1
}
const actionBtns = function(data) {
return `
<span class="edit"><a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></a></span>
<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}" data-bs-toggle="modal" data-bs-target="#confirm2delete"></i></a>
<span class="cancel"></span>
`;
};
editor = new $.fn.dataTable.Editor( {
ajax: {
url: "<?= route_to('editorOfPresupuestoAcabados') ?>",
headers: {
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v,
},
},
table : "#tableOfServiciosAcabado",
idSrc: 'id',
fields: [ {
"name": "tarifa_acabado_id",
"type": "select"
}, {
"name": "precio_unidad"
}, {
"name": "precio_total"
}, {
"name": "presupuesto_id",
"type": "hidden"
},
]
} );
// Generación de la lista de servicios de acabado (id, nombre)
const acabadosList = <?php echo json_encode($serviciosAcabado); ?>;
editor.field( 'tarifa_acabado_id' ).update( acabadosList );
editor.on( 'preSubmit', function ( e, d, type ) {
if ( type === 'create'){
d.data[0]['presupuesto_id'] = id;
}
else if(type === 'edit' ) {
for (v in d.data){
d.data[v]['presupuesto_id'] = id;
}
}
});
editor.on( 'postSubmit', function ( e, json, data, action ) {
yeniden(json.<?= csrf_token() ?>);
});
editor.on( 'submitSuccess', function ( e, json, data, action ) {
theTable.clearPipeline();
theTable.draw();
});
// Activate an inline edit on click of a table cell
$('#tableOfServiciosAcabado').on( 'click', 'tbody span.edit', function (e) {
editor.inline(
theTable.cells(this.parentNode.parentNode, '*').nodes(),
{
cancelHtml: '<a href="javascript:void(0);"><i class="ti ti-x"></i></a>',
cancelTrigger: 'span.cancel',
submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>',
submitTrigger: 'span.edit',
submit: 'allIfChanged'
}
);
} );
// Delete row
$(document).on('click', '.btn-delete', function(e) {
$(".btn-remove").attr('data-id', $(this).attr('data-id'));
});
$(document).on('click', '.btn-remove', function(e) {
const dataId = $(this).attr('data-id');
const row = $(this).closest('tr');
if ($.isNumeric(dataId)) {
$.ajax({
url: `/serviciosacabados/delete/${dataId}`,
method: 'GET',
}).done((data, textStatus, jqXHR) => {
$('#confirm2delete').modal('toggle');
theTable.clearPipeline();
theTable.row($(row)).invalidate().draw();
popSuccessAlert(data.msg ?? jqXHR.statusText);
}).fail((jqXHR, textStatus, errorThrown) => {
popErrorAlert(jqXHR.responseJSON.messages.error)
})
}
});
var theTable = $('#tableOfServiciosAcabado').DataTable( {
serverSide: true,
processing: true,
autoWidth: true,
responsive: true,
lengthMenu: [ 5, 10, 25],
order: [[ 0, "asc" ], [ 1, "asc" ]],
pageLength: 10,
lengthChange: true,
searching: false,
paging: true,
info: false,
dom: '<"mt-4"><"float-start"l><t><"mt-4 mb-3"p>',
ajax : $.fn.dataTable.pipeline( {
url: '<?= route_to('dataTableOfPresupuestoAcabados') ?>',
data: {
id_presupuesto: id,
},
method: 'POST',
headers: {'X-Requested-With': 'XMLHttpRequest'},
async: true,
}),
columns: [
{'data': 'tarifa_acabado_id',
render: function(data, type, row, meta) {
var value = acabadosList.find(element => element.value === data);
return value['label'];
},
},
{ 'data': 'precio_unidad' },
{ 'data': 'precio_total' },
{
data: actionBtns,
className: 'row-edit dt-center'
}
],
columnDefs: [
{
orderable: false,
searchable: false,
targets: [lastColNr]
},
{
"orderData": [ 0, 1 ],
"targets": 0
},
],
language: {
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
},
buttons: [ {
className: 'btn btn-primary float-end me-sm-3 me-1',
extend: "createInline",
editor: editor,
formOptions: {
submitTrigger: -1,
submitHtml: '<i class="ti ti-device-floppy"/>'
}
} ]
} );
<?= $this->endSection() ?>
<!-------------------------------------------------------------->
<!-- Código JS comportamiento tabla servicios encuadernacion. -->
<!-------------------------------------------------------------->
<?= $this->section("additionalInlineJs") ?>
const lastColNr2 = $('#tableOfServiciosEncuadernacion').find("tr:first th").length - 1;
editor2 = new $.fn.dataTable.Editor( {
ajax: {
url: "<?= route_to('editorOfPresupuestoEncuadernaciones') ?>",
headers: {
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v,
},
},
table : "#tableOfServiciosEncuadernacion",
idSrc: 'id',
fields: [ {
"name": "tarifa_encuadernado_id",
"type": "select"
}, {
"name": "precio_unidad"
}, {
"name": "precio_total"
}, {
"name": "presupuesto_id",
"type": "hidden"
},
]
} );
// Generación de la lista de servicios de acabado (id, nombre)
const encuadernadosList = <?php echo json_encode($serviciosEncuadernacion); ?>;
editor2.field( 'tarifa_encuadernado_id' ).update( encuadernadosList );
editor2.on( 'preSubmit', function ( e, d, type ) {
if ( type === 'create'){
d.data[0]['presupuesto_id'] = id;
}
else if(type === 'edit' ) {
for (v in d.data){
d.data[v]['presupuesto_id'] = id;
}
}
});
editor2.on( 'postSubmit', function ( e, json, data, action ) {
yeniden(json.<?= csrf_token() ?>);
});
editor2.on( 'submitSuccess', function ( e, json, data, action ) {
theTable2.clearPipeline();
theTable2.draw();
});
// Activate an inline edit on click of a table cell
$('#tableOfServiciosEncuadernacion').on( 'click', 'tbody span.edit', function (e) {
editor2.inline(
theTable2.cells(this.parentNode.parentNode, '*').nodes(),
{
cancelHtml: '<a href="javascript:void(0);"><i class="ti ti-x"></i></a>',
cancelTrigger: 'span.cancel',
submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>',
submitTrigger: 'span.edit',
submit: 'allIfChanged'
}
);
} );
var theTable2 = $('#tableOfServiciosEncuadernacion').DataTable( {
serverSide: true,
processing: true,
autoWidth: true,
responsive: true,
lengthMenu: [ 5, 10, 25],
order: [[ 0, "asc" ], [ 1, "asc" ]],
pageLength: 10,
lengthChange: true,
searching: false,
paging: true,
info: false,
dom: '<"mt-4"><"float-start"l><t><"mt-4 mb-3"p>',
ajax : $.fn.dataTable.pipeline( {
url: '<?= route_to('dataTableOfPresupuestoEncuadernaciones') ?>',
data: {
id_presupuesto: id,
},
method: 'POST',
headers: {'X-Requested-With': 'XMLHttpRequest'},
async: true,
}),
columns: [
{'data': 'tarifa_encuadernado_id',
render: function(data, type, row, meta) {
var value = encuadernadosList.find(element => element.value === data);
return value['label'];
},
},
{ 'data': 'precio_unidad' },
{ 'data': 'precio_total' },
{
data: actionBtns,
className: 'row-edit dt-center'
}
],
columnDefs: [
{
orderable: false,
searchable: false,
targets: [lastColNr2]
},
{
"orderData": [ 0, 1 ],
"targets": 0
},
],
language: {
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
},
buttons: [ {
className: 'btn btn-primary float-end me-sm-3 me-1',
extend: "createInline",
editor: editor2,
formOptions: {
submitTrigger: -1,
submitHtml: '<i class="ti ti-device-floppy"/>'
}
} ]
} );
<?= $this->endSection() ?>
<!-------------------------------------------------------------->
<!-- Código JS comportamiento tabla servicios manipulados. -->
<!-------------------------------------------------------------->
<?= $this->section("additionalInlineJs") ?>
const lastColNr3 = $('#tableOfServiciosManipulado').find("tr:first th").length - 1;
editor3 = new $.fn.dataTable.Editor( {
ajax: {
url: "<?= route_to('editorOfPresupuestoManipulados') ?>",
headers: {
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v,
},
},
table : "#tableOfServiciosManipulado",
idSrc: 'id',
fields: [ {
"name": "tarifa_manipulado_id",
"type": "select"
}, {
"name": "precio_unidad"
}, {
"name": "precio_total"
}, {
"name": "presupuesto_id",
"type": "hidden"
},
]
} );
// Generación de la lista de servicios de acabado (id, nombre)
const manipuladosList = <?php echo json_encode($serviciosManipulado); ?>;
editor3.field( 'tarifa_manipulado_id' ).update( manipuladosList );
editor3.on( 'preSubmit', function ( e, d, type ) {
if ( type === 'create'){
d.data[0]['presupuesto_id'] = id;
}
else if(type === 'edit' ) {
for (v in d.data){
d.data[v]['presupuesto_id'] = id;
}
}
});
editor3.on( 'postSubmit', function ( e, json, data, action ) {
yeniden(json.<?= csrf_token() ?>);
});
editor3.on( 'submitSuccess', function ( e, json, data, action ) {
theTable3.clearPipeline();
theTable3.draw();
});
// Activate an inline edit on click of a table cell
$('#tableOfServiciosManipulado').on( 'click', 'tbody span.edit', function (e) {
editor3.inline(
theTable3.cells(this.parentNode.parentNode, '*').nodes(),
{
cancelHtml: '<a href="javascript:void(0);"><i class="ti ti-x"></i></a>',
cancelTrigger: 'span.cancel',
submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>',
submitTrigger: 'span.edit',
submit: 'allIfChanged'
}
);
} );
// Delete row
var theTable3 = $('#tableOfServiciosManipulado').DataTable( {
serverSide: true,
processing: true,
autoWidth: true,
responsive: true,
lengthMenu: [ 5, 10, 25],
order: [[ 0, "asc" ], [ 1, "asc" ]],
pageLength: 10,
lengthChange: true,
searching: false,
paging: true,
info: false,
dom: '<"mt-4"><"float-start"l><t><"mt-4 mb-3"p>',
ajax : $.fn.dataTable.pipeline( {
url: '<?= route_to('dataTableOfPresupuestoManipulados') ?>',
data: {
id_presupuesto: id,
},
method: 'POST',
headers: {'X-Requested-With': 'XMLHttpRequest'},
async: true,
}),
columns: [
{'data': 'tarifa_manipulado_id',
render: function(data, type, row, meta) {
var value = manipuladosList.find(element => element.value === data);
return value['label'];
},
},
{ 'data': 'precio_unidad' },
{ 'data': 'precio_total' },
{
data: actionBtns,
className: 'row-edit dt-center'
}
],
columnDefs: [
{
orderable: false,
searchable: false,
targets: [lastColNr3]
},
{
"orderData": [ 0, 1 ],
"targets": 0
},
],
language: {
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
},
buttons: [ {
className: 'btn btn-primary float-end me-sm-3 me-1',
extend: "createInline",
editor: editor3,
formOptions: {
submitTrigger: -1,
submitHtml: '<i class="ti ti-device-floppy"/>'
}
} ]
} );
<?= $this->endSection() ?>
<!-------------------------------------------------------------->
<!-- Código JS comportamiento tabla servicios preimpresion. -->
<!-------------------------------------------------------------->
<?= $this->section("additionalInlineJs") ?>
const lastColNr4 = $('#tableOfServiciosPreimpresion').find("tr:first th").length - 1;
editor4 = new $.fn.dataTable.Editor( {
ajax: {
url: "<?= route_to('editorOfPresupuestoPreimpresiones') ?>",
headers: {
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v,
},
},
table : "#tableOfServiciosPreimpresion",
idSrc: 'id',
fields: [ {
"name": "tarifa_preimpresion_id",
"type": "select"
}, {
"name": "precio_unidad"
}, {
"name": "precio_total"
}, {
"name": "presupuesto_id",
"type": "hidden"
},
]
} );
// Generación de la lista de servicios de acabado (id, nombre)
const preimpresionesList = <?php echo json_encode($serviciosPreimpresion); ?>;
editor4.field( 'tarifa_preimpresion_id' ).update( preimpresionesList );
editor4.on( 'preSubmit', function ( e, d, type ) {
if ( type === 'create'){
d.data[0]['presupuesto_id'] = id;
}
else if(type === 'edit' ) {
for (v in d.data){
d.data[v]['presupuesto_id'] = id;
}
}
});
editor4.on( 'postSubmit', function ( e, json, data, action ) {
yeniden(json.<?= csrf_token() ?>);
});
editor4.on( 'submitSuccess', function ( e, json, data, action ) {
theTable4.clearPipeline();
theTable4.draw();
});
// Activate an inline edit on click of a table cell
$('#tableOfServiciosPreimpresion').on( 'click', 'tbody span.edit', function (e) {
editor4.inline(
theTable4.cells(this.parentNode.parentNode, '*').nodes(),
{
cancelHtml: '<a href="javascript:void(0);"><i class="ti ti-x"></i></a>',
cancelTrigger: 'span.cancel',
submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>',
submitTrigger: 'span.edit',
submit: 'allIfChanged'
}
);
} );
// Delete row
var theTable4 = $('#tableOfServiciosPreimpresion').DataTable( {
serverSide: true,
processing: true,
autoWidth: true,
responsive: true,
lengthMenu: [ 5, 10, 25],
order: [[ 0, "asc" ], [ 1, "asc" ]],
pageLength: 10,
lengthChange: true,
searching: false,
paging: true,
info: false,
dom: '<"mt-4"><"float-start"l><t><"mt-4 mb-3"p>',
ajax : $.fn.dataTable.pipeline( {
url: '<?= route_to('dataTableOfPresupuestoPreimpresiones') ?>',
data: {
id_presupuesto: id,
},
method: 'POST',
headers: {'X-Requested-With': 'XMLHttpRequest'},
async: true,
}),
columns: [
{'data': 'tarifa_preimpresion_id',
render: function(data, type, row, meta) {
var value = preimpresionesList.find(element => element.value === data);
return value['label'];
},
},
{ 'data': 'precio_unidad' },
{ 'data': 'precio_total' },
{
data: actionBtns,
className: 'row-edit dt-center'
}
],
columnDefs: [
{
orderable: false,
searchable: false,
targets: [lastColNr4]
},
{
"orderData": [ 0, 1 ],
"targets": 0
},
],
language: {
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
},
buttons: [ {
className: 'btn btn-primary float-end me-sm-3 me-1',
extend: "createInline",
editor: editor4,
formOptions: {
submitTrigger: -1,
submitHtml: '<i class="ti ti-device-floppy"/>'
}
} ]
} );
<?= $this->endSection() ?>

View File

@ -0,0 +1,381 @@
<div class="accordion mt-3" id="accordionPreview">
<div class="card accordion-item active">
<h2 class="accordion-header" id="headingOne">
<button type="button" class="accordion-button" data-bs-toggle="collapse"
data-bs-target="#accordionPreviewTip" aria-expanded="false"
aria-controls="accordionPreviewTip">
<h4><?= lang("Presupuestos.preview") ?></h4>
</button>
</h2>
<div id="accordionPreviewTip" class="accordion-collapse collapse show"
data-bs-parent="#accordionPreview">
<div class="accordion-body">
<div class="nav-align-top mb-4">
<ul class="nav nav-pills mb-3" role="tablist">
<li id="tab-preview-maquina" class="nav-item">
<button
type="button"
class="nav-link active"
role="tab"
data-bs-toggle="tab"
data-bs-target="#preview-maquina"
aria-controls="preview-maquina"
aria-selected="true">
<?= lang("Presupuestos.previewMaquina") ?>
</button>
</li>
<li id="tab-preview-cubierta" class="nav-item">
<button
type="button"
class="nav-link"
role="tab"
data-bs-toggle="tab"
data-bs-target="#preview-cubierta"
aria-controls="preview-cubierta"
aria-selected="false">
<?= lang("Presupuestos.previewCubierta") ?>
</button>
</li>
<li id="tab-preview-portada" class="nav-item">
<button
type="button"
class="nav-link"
role="tab"
data-bs-toggle="tab"
data-bs-target="#preview-portada"
aria-controls="preview-portada"
aria-selected="false">
<?= lang("Presupuestos.previewPortada") ?>
</button>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane fade show active" id="preview-maquina" role="tabpanel">
<div class="row">
<div class="col-3">
<div class="p-4 mb-3 pb-3" >
<!-- Configuraciones -->
<h6>Configuración del papel: Rotativa</h6>
<div class="row g-3 mb-3">
<div class="col-12">
<a href="#">
<div class="d-grid">
<button type="button" class="btn btn-label-primary">Papel
generico
</button>
</div>
</a>
</div>
<div class="col-12">
<a href="#">
<div class="d-grid">
<button type="button" class="btn btn-label-primary">Papel de
compra
</button>
</div>
</a>
</div>
<div class="col-12">
<a href="#">
<div class="d-grid">
<button type="button" class="btn btn-label-primary">Máquina
</button>
</div>
</a>
</div>
</div>
<hr class="mx-n4"/>
<!-- Detalles del presupuesto -->
<h6>Detalles del trabajo</h6>
<dl class="row mb-0">
<dt class="col-6 fw-normal">Gramaje:</dt>
<dd class="col-6 text-left">TBD</dd>
<dt class="col-sm-6 fw-normal">Mano:</dt>
<dd class="col-sm-6 text-success text-left">TBD</dd>
<dt class="col-6 fw-normal">Máquina:</dt>
<dd class="col-6 text-left">TBDxTBD</dd>
<dt class="col-6 fw-normal">Máquina impresión:</dt>
<dd class="col-6 text-left">TBDxTBD</dd>
<dt class="col-6 fw-normal">Libro:</dt>
<dd class="col-6 text-left">TBDxTBD</dd>
<dt class="col-6 fw-normal">Formas:</dt>
<dd class="col-6 text-left">TBD</dd>
</dl>
</div>
</div>
<div class="col-9">
<div class="p-4 mb-3 pb-3">
<!-- Configuraciones -->
<h6>Posición de formas</h6>
<div id="shape-container">
<div id="draw-maquina" class="draw-shapes"></div>
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="preview-cubierta" role="tabpanel">
<div class="row">
<div class="col-3">
<div class="p-4 mb-3 pb-3" >
<!-- Configuraciones -->
<h6>Configuración del papel: Cubierta</h6>
<div class="row g-3 mb-3">
<div class="col-12">
<a href="#">
<div class="d-grid">
<button type="button" class="btn btn-label-primary">Papel
generico
</button>
</div>
</a>
</div>
<div class="col-12">
<a href="#">
<div class="d-grid">
<button type="button" class="btn btn-label-primary">Papel de
compra
</button>
</div>
</a>
</div>
<div class="col-12">
<a href="#">
<div class="d-grid">
<button type="button" class="btn btn-label-primary">Máquina
</button>
</div>
</a>
</div>
</div>
<hr class="mx-n4"/>
<!-- Detalles del presupuesto -->
<h6>Detalles del trabajo</h6>
<dl class="row mb-0">
<dt class="col-6 fw-normal">Gramaje:</dt>
<dd class="col-6 text-left">TBD</dd>
<dt class="col-sm-6 fw-normal">Mano:</dt>
<dd class="col-sm-6 text-success text-left">TBD</dd>
<dt class="col-6 fw-normal">Máquina:</dt>
<dd class="col-6 text-left">TBDxTBD</dd>
<dt class="col-6 fw-normal">Máquina impresión:</dt>
<dd class="col-6 text-left">TBDxTBD</dd>
<dt class="col-6 fw-normal">Libro:</dt>
<dd class="col-6 text-left">TBDxTBD</dd>
<dt class="col-6 fw-normal">Formas:</dt>
<dd class="col-6 text-left">TBD</dd>
</dl>
</div>
</div>
<div class="col-9">
<div class="p-4 mb-3 pb-3">
<!-- Configuraciones -->
<h6>Posición de formas</h6>
<div id="shape-container" >
<div id="draw-cubierta" class="draw-shapes"></div>
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="preview-portada" role="tabpanel">
<div class="row">
<div class="col-3">
<div class="p-4 mb-3 pb-3" >
<!-- Configuraciones -->
<h6>Configuración de portada</h6>
<div class="row g-3 mb-3">
<div class="col-12">
<a href="#">
<div class="d-grid">
<button type="button" class="btn btn-label-primary">Papel
generico
</button>
</div>
</a>
</div>
<div class="col-12">
<a href="#">
<div class="d-grid">
<button type="button" class="btn btn-label-primary">Papel de
compra
</button>
</div>
</a>
</div>
<div class="col-12">
<a href="#">
<div class="d-grid">
<button type="button" class="btn btn-label-primary">Máquina
</button>
</div>
</a>
</div>
</div>
<hr class="mx-n4"/>
<!-- Detalles del presupuesto -->
<h6>Detalles del trabajo</h6>
<dl class="row mb-0">
<dt class="col-6 fw-normal">Libro:</dt>
<dd id='prevLibro' class="col-6 text-left">TBDxTBD</dd>
<dt class="col-6 fw-normal">Lomo:</dt>
<dd id='prevLomo' class="col-6 text-left">TBD</dd>
<dt class="col-6 fw-normal">Solapas:</dt>
<dd id='prevSolapas' class="col-6 text-left">TBD</dd>
</dl>
</div>
</div>
<div class="col-9">
<div class="p-4 mb-3 pb-3">
<!-- Configuraciones -->
<h6>Posición de formas</h6>
<div id="shape-container">
<div id="draw-portada" class="draw-shapes"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div> <!-- //.accordion-body -->
</div> <!-- //.accordion-collapse -->
</div> <!-- //.accordion-item -->
</div> <!-- //.accordion -->
<!------------------------------------------------------->
<!-- Código JS comportamiento ?????. -->
<!------------------------------------------------------->
<?= $this->section("additionalInlineJs") ?>
$('#tab-preview-cubierta').on( "click", function() {
var cubiertaObjeto = {
anchoMaquina: 487,
altoMaquina: 330,
anchoImpresion: 475,
altoImpresion: 310,
anchoLibro:170,
altoLibro:240,
solapas:45,
lomo:25};
previewCubierta(cubiertaObjeto);
} );
$('#tab-preview-portada').on( "click", function() {
var portadaObjeto = {
anchoLibro:170,
altoLibro:240,
solapas:45,
lomo:25};
previewPortada(portadaObjeto);
} );
var elem = document.getElementById('draw-maquina');
var twoMaquina = new Two({fitted: true}).appendTo(elem);
var origin = new Two.Vector(twoMaquina.width/2, twoMaquina.height/2);
var sizeX = 148;
var sizeY = 98;
var AIx = 355;
var AIy = 250;
var styles = {
size: 14,
family: 'Lato'
};
//var texts = [];
var areaMaquina = twoMaquina.makeRectangle(origin.x, origin.y, 360, 255);
areaMaquina.stroke = 'black';
areaMaquina.linewidth = 1;
var areaImpresion = twoMaquina.makeRectangle(origin.x, origin.y, AIx, AIy);
areaImpresion.stroke = 'red';
areaImpresion.linewidth = 1;
var forma1 = twoMaquina.makeRectangle(origin.x - (AIx/4), origin.y - (AIy/4), sizeX, sizeY);
forma1.stroke = 'blue';
forma1.fill = 'blue';
forma1.linewidth = 1;
var forma2 = twoMaquina.makeRectangle(origin.x + (AIx/4), origin.y - (AIy/4), sizeX, sizeY);
forma2.stroke = 'grey';
forma2.fill = 'grey';
forma2.linewidth = 1;
var forma3 = twoMaquina.makeRectangle(origin.x - (AIx/4), origin.y + (AIy/4), sizeX, sizeY);
forma3.stroke = 'blue';
forma3.fill = 'blue';
forma3.linewidth = 1;
var forma4 = twoMaquina.makeRectangle(origin.x + (AIx/4), origin.y + (AIy/4), sizeX, sizeY);
forma4.stroke = 'grey';
forma4.fill = 'grey';
forma4.linewidth = 1;
var arrowX = twoMaquina.makeArrow(origin.x -200, origin.y, origin.x+200, origin.y, 0);
arrowX.stroke = 'green';
arrowX.dashes = [5, 5];
arrowX.linewidth = 1;
var arrowY = twoMaquina.makeArrow(origin.x, origin.y-200, origin.x, origin.y+200, 0);
arrowY.stroke = 'pink';
arrowY.dashes = [5, 5];
arrowY.linewidth = 2;
//group = twoMaquina.makeGroup(areaMaquina, areaImpresion, ...texts);
//group.position.set(twoMaquina.width / 2, twoMaquina.height / 2);
//group.center();
twoMaquina.update();
<?= $this->endSection() ?>

View File

@ -0,0 +1,81 @@
<div class="accordion mt-3 col-xl-6" id="accordionResumen">
<div class="card accordion-item active">
<h2 class="accordion-header" id="headingOne">
<button type="button" class="accordion-button" data-bs-toggle="collapse"
data-bs-target="#accordionResumenTip" aria-expanded="false"
aria-controls="accordionResumenTip">
<h4><?= lang("Presupuestos.resumen") ?></h4>
</button>
</h2>
<div id="accordionResumenTip" class="accordion-collapse collapse show"
data-bs-parent="#accordionResumen">
<div class="accordion-body">
<div class="col-xl-12">
<div class="border rounded p-4 mb-3 pb-3">
<!-- Price Details -->
<h6>Detalles del presupuesto</h6>
<dl class="row mb-0">
<dt class="col-6 fw-normal text-end">Coste papel</dt>
<dd class="col-6 text-end">NaN €</dd>
<dt class="col-6 fw-normal text-end">Margen papel</dt>
<dd class="col-6 text-end">NaN €</dd>
<dt class="col-6 fw-normal text-end">Coste impresión</dt>
<dd class="col-6 text-end">NaN €</dd>
<dt class="col-6 fw-normal text-end">Margen impresión</dt>
<dd class="col-6 text-end">NaN €</dd>
<dt class="col-6 fw-normal text-end">Coste servicios</dt>
<dd class="col-6 text-end">NaN €</dd>
<dt class="col-6 fw-normal text-end">Margen servicios</dt>
<dd class="col-6 text-end">NaN €</dd>
<dt class="col-6 fw-normal text-end">Costes</dt>
<dd class="col-6 text-end">NaN €</dd>
<dt class="col-6 fw-normal text-end">Margen</dt>
<dd class="col-6 text-end">NaN €</dd>
<dt class="col-6 fw-normal text-end">Descuento</dt>
<dd class="col-6 text-end">NaN €</dd>
<dt class="col-6 fw-normal text-end">Precio unidad</dt>
<dd class="col-6 text-end">NaN €</dd>
<dt class="col-6 fw-normal text-end">Coste de envío</dt>
<dd class="col-6 text-end">NaN €</dd>
</dl>
<hr class="mx-n4">
<dl class="row mb-0">
<dt class="col-6 fw-normal text-end">Total impresión</dt>
<dd class="col-6 text-end">NaN €</dd>
<dt class="col-6 text-end">Total presupuesto</dt>
<dd class="col-6 fw-semibold text-end mb-0">NaN €</dd>
</dl>
</div>
<div class="d-grid float-end mb-4">
<div class="form-check form-switch mb-2">
<input class="form-check-input" type="checkbox" id="confirmar_presupuesto" name="solapas" value="1" <?= $presupuestoEntity->confirmarPresupuesto == true ? 'checked' : ''; ?>>
<label class="form-check-label" for="papelFormatoPersonalizado"><?= lang('Presupuestos.confirmar') ?></label>
</div>
</div>
</div>
</div> <!-- //.accordion-body -->
</div> <!-- //.accordion-collapse -->
</div> <!-- //.accordion-item -->
</div> <!-- //.accordion -->
<!------------------------------------------------------->
<!-- Código JS comportamiento ?????. -->
<!------------------------------------------------------->
<?= $this->section("additionalInlineJs") ?>
<?= $this->endSection() ?>

View File

@ -1,6 +1,85 @@
/*******************************
* Eventos asociados a elementos HTML
*******************************/
$('#compPaginasNegro').on("change", function () {
var negro = parseInt(document.getElementById('compPaginasNegro').value);
const paginas = parseInt(document.getElementById('paginas').value);
if (paginas < negro) {
document.getElementById('compPaginasNegro').value = paginas;
negro = paginas;
}
var color = parseInt(document.getElementById('compPaginasColor').value);
if ($('#tipoImpresion').select2('data')[0].id == 'color') {
var newValue = paginas - negro;
if (newValue != color) {
document.getElementById('compPaginasColor').value = newValue >= 0 ? newValue : 0;
$('#compPaginasColor').change();
}
}
});
$('#compPaginasColor').on("change", function () {
const paginas = parseInt(document.getElementById('paginas').value);
var color = parseInt(document.getElementById('compPaginasColor').value);
var negro = parseInt(document.getElementById('compPaginasNegro').value);
if (paginas < color) {
document.getElementById('compPaginasColor').value = paginas;
color = paginas
}
var newValue = paginas - color;
if (newValue != negro) {
document.getElementById('compPaginasNegro').value = newValue >= 0 ? newValue : 0;
$('#compPaginasNegro').change();
}
});
$('#compPaginasNegrohq').on("change", function () {
if (document.getElementById('paginas').value < document.getElementById('compPaginasNegrohq').value) {
document.getElementById('compPaginasNegrohq').value = document.getElementById('paginas').value;
}
if ($('#tipoImpresion').select2('data')[0].id == 'color') {
if (document.getElementById('compPaginasNegrohq').value + document.getElementById('compPaginasColorhq').value > document.getElementById('paginas').value) {
var newValue = document.getElementById('paginas').value - document.getElementById('compPaginasNegrohq').value;
document.getElementById('compPaginasColorhq').value = newValue >= 0 ? newValue : 0;
}
}
});
$('#compPaginasColorhq').on("change", function () {
const paginas = parseInt(document.getElementById('paginas').value);
var color = parseInt(document.getElementById('compPaginasColorhq').value);
var negro = parseInt(document.getElementById('compPaginasNegrohq').value);
if (paginas < color) {
document.getElementById('compPaginasColorhq').value = paginas;
color = paginas
}
var newValue = paginas - color;
if (newValue != negro) {
document.getElementById('compPaginasNegrohq').value = newValue >= 0 ? newValue : 0;
$('#compPaginasNegrohq').change();
}
});
$('#paginas').on("change", function () {
// Si es negro o color
if ($('#tipoImpresion').select2('data')[0].id == 'negro' ||
$('#tipoImpresion').select2('data')[0].id == 'color') {
document.getElementById('compPaginasNegro').value = document.getElementById('paginas').value;
document.getElementById('compPaginasColor').value = 0;
}
// Si es negrohq o colorhq
if ($('#tipoImpresion').select2('data')[0].id == 'negrohq' ||
$('#tipoImpresion').select2('data')[0].id == 'colorhq') {
document.getElementById('compPaginasNegrohq').value = document.getElementById('paginas').value;
document.getElementById('compPaginasColorhq').value = 0;
}
});
$("#solapas").on("click", function () {
var e = document.getElementById('div_solapas_ancho');
if (document.getElementById('solapas').checked) {
@ -11,22 +90,18 @@ $("#solapas").on("click", function () {
}
});
$('#tipoImpresion').on("change", function () {
updatePapelesComparador();
});
$('#tipoImpresion').on("change", function () {
updatePapelesComparador();
});
$('#compRetractilado').on("change", function () {
checkRetractiladoComparador(this);
});
$('#compRetractilado5').on("change", function () {
checkRetractiladoComparador(this);
});
$('#imagenesBnInterior').on("change", function () {
var e = document.getElementById('tipoImpresion');
var optionToHide = e.querySelector("option[value='negro']");
@ -44,6 +119,7 @@ $('#imagenesBnInterior').on("change", function () {
$('#tipoImpresion').select2();
});
$('#compPosPaginasColor').on("keyup", function () {
computarPaginasColor(this.value);
});
@ -52,25 +128,95 @@ $('#compPosPaginasColor').on("keyup", function () {
// Este evento recoloca los headers de las tablas cuando se pulsa el
// boton del acordeon
$('.accordion-button').on('click', function (e) {
$.fn.dataTable.tables({ visible: true, api: true }).columns.adjust();
if(e.target.id.includes("plana")){
$("#tableCompIntPlana").DataTable().columns.adjust();
}
else if(e.target.id.includes("rotativa")){
$("#tableCompIntRotativa").DataTable().columns.adjust();
}
else if(e.target.id.includes("cubierta")){
$("#tableCompCubierta").DataTable().columns.adjust();
}
else if(e.target.id.includes("LineasPresupuesto")){
$("#tableLineasPresupuesto").DataTable().columns.adjust();
}
});
/*******************************
* Metodos
*******************************/
function init_comparador() {
updatePapelesComparador();
const paginasColor = document.getElementById('compCalPaginasColor');
if (paginasColor.value.length > 0) {
computarPaginasColor(paginasColor.value);
}
function getRowFromLineaInt(tipo, linea) {
return {
'tipo': tipo,
'paginas': linea.fields.paginas,
'papel': linea.fields.papel_generico,
'gramaje': linea.fields.gramaje,
'marca': linea.fields.papel_impresion,
'maquina': linea.fields.maquina,
'numeroPliegos': isNaN(parseFloat(linea.fields.pliegos_libro)) ? "" : parseFloat(linea.fields.pliegos_libro).toFixed(2),
'pliegosPedido': isNaN(parseFloat(linea.fields.pliegos_pedido)) ? "" : parseFloat(linea.fields.pliegos_pedido).toFixed(2),
'precioPliego': isNaN(parseFloat(linea.fields.precios_pliegos)) ? "" : parseFloat(linea.fields.precios_pliegos).toFixed(6),
'libro': isNaN(parseFloat(linea.fields.precio_libro)) ? "" : parseFloat(linea.fields.precio_libro).toFixed(2),
'totalPapelPedido': isNaN(parseFloat(linea.fields.precio_pedido)) ? "" : parseFloat(linea.fields.precio_pedido).toFixed(2),
'lomo': isNaN(parseFloat(linea.fields.mano)) ? "" : parseFloat(linea.fields.mano).toFixed(2),
'peso': isNaN(parseFloat(linea.fields.peso)) ? "" : parseFloat(linea.fields.peso).toFixed(2),
'click': isNaN(parseFloat(linea.fields.precio_click)) ? "" : parseFloat(linea.fields.precio_click).toFixed(6),
'totalClicks': isNaN(parseFloat(linea.fields.precio_click_pedido)) ? "" : parseFloat(linea.fields.precio_click_pedido).toFixed(2),
'total': isNaN(parseFloat(linea.fields.precio_pedido) + parseFloat(linea.fields.precio_click_pedido)) ?
"" : (parseFloat(linea.fields.precio_pedido) + parseFloat(linea.fields.precio_click_pedido)).toFixed(2),
'maquinaId': linea.fields.maquina_id,
'maquinaVelocidad': linea.fields.maquina_velocidad,
'tiempoMaquina': linea.fields.tiempo_maquina,
'papelGenericoId': linea.fields.papel_generico_id,
'papelImpresionId': linea.fields.papel_impresion_id,
'tarifa_impresion_id': linea.fields.tarifa_impresion_id,
}
}
function getRowFromLineaRot(linea) {
return {
'tipo': 'rotativa',
'paginas': linea.fields.paginas,
'papel': linea.fields.papel_generico,
'gramaje': linea.fields.gramaje,
'marca': linea.fields.papel_impresion,
'aFavorFibra':linea.fields.a_favor_fibra==1?'si':'no',
'maquina': linea.fields.maquina,
'numeroPliegos': isNaN(parseFloat(linea.fields.pliegos_libro)) ? "" : parseFloat(linea.fields.pliegos_libro).toFixed(2),
'pliegosPedido': isNaN(parseFloat(linea.fields.pliegos_pedido)) ? "" : parseFloat(linea.fields.pliegos_pedido).toFixed(2),
'precioPliego': isNaN(parseFloat(linea.fields.precios_pliegos)) ? "" : parseFloat(linea.fields.precios_pliegos).toFixed(6),
'libro': isNaN(parseFloat(linea.fields.precio_libro)) ? "" : parseFloat(linea.fields.precio_libro).toFixed(2),
'totalPapelPedido': isNaN(parseFloat(linea.fields.precio_pedido)) ? "" : parseFloat(linea.fields.precio_pedido).toFixed(2),
'lomo': isNaN(parseFloat(linea.fields.mano)) ? "" : parseFloat(linea.fields.mano).toFixed(2),
'peso': isNaN(parseFloat(linea.fields.peso)) ? "" : parseFloat(linea.fields.peso).toFixed(2),
'click': isNaN(parseFloat(linea.fields.precio_click)) ? "" : parseFloat(linea.fields.precio_click).toFixed(6),
'totalClicks': isNaN(parseFloat(linea.fields.precio_click_pedido)) ? "" : parseFloat(linea.fields.precio_click_pedido).toFixed(2),
'precioPagNegro': isNaN(parseFloat(linea.fields.precio_pagina_negro)) ? "" : parseFloat(linea.fields.precio_pagina_negro).toFixed(6),
'precioPagColor': isNaN(parseFloat(linea.fields.precio_pagina_color)) ? "" : parseFloat(linea.fields.precio_pagina_color).toFixed(6),
'totalTinta':isNaN(parseFloat(linea.fields.precio_tinta)) ? "" : parseFloat(linea.fields.precio_tinta).toFixed(2),
'totalCorte':isNaN(parseFloat(linea.fields.total_corte)) ? "" : parseFloat(linea.fields.total_corte).toFixed(2),
'total': isNaN(parseFloat(linea.fields.total_impresion)) ? "" : (parseFloat(linea.fields.total_impresion)).toFixed(2),
'maquinaId': linea.fields.maquina_id,
'maquinaVelocidad': linea.fields.maquina_velocidad,
'tiempoMaquina': linea.fields.tiempo_maquina,
'papelGenericoId': linea.fields.papel_generico_id,
'papelImpresionId': linea.fields.papel_impresion_id,
'paginasColor': linea.fields.paginas_color,
'tarifa_impresion_id': linea.fields.tarifa_impresion_id,
}
}
function computarPaginasColor(string) {
@ -100,6 +246,7 @@ function computarPaginasColor(string) {
autosize.update(calPagesTextarea);
}
function checkRetractiladoComparador(element) {
switch (element.id) {
@ -145,6 +292,7 @@ function updatePapelesComparador() {
case "negrohq":
Array.from(elements_color).forEach(element => {
element.style.display = "none";
});
Array.from(elements_negro).forEach(element => {
element.style.display = "none";
@ -190,8 +338,325 @@ function updatePapelesComparador() {
default:
break;
}
}
function clearIntLineas(is_color){
//$("#tableCompIntPlana").DataTable().rows( '.selected' ).deselect();
var tabla = $('#tableCompIntPlana').DataTable();
tabla
.rows( function ( idx, data, node ) {
return data['tipo'].includes(is_color?'color':'bn');
} )
.remove()
.draw();
//$('#tableCompIntPlana').DataTable().clear().draw();
$('#insertarPlanaBtn').css('display', 'none');
}
function clearCubierta(){
$('#tableCompCubierta').DataTable().clear().draw();
$('#insertarCubiertaBtn').css('display', 'none');
}
function clearIntRot(){
$('#errorComRot').html('');
$('#tableCompIntRotativa').DataTable().clear().draw();
$('#insertarRotativaBtn').css('display', 'none');
}
function selectIntLineas(){
var negro_selected = false;
var color_selected = false;
$("#tableCompIntPlana").DataTable().rows( '.selected' ).deselect();
$("#tableCompIntPlana").DataTable().rows().every( function ( rowIdx, tableLoop, rowLoop ) {
if( !negro_selected && $('#tableCompIntPlana').DataTable().cell(rowIdx, 0).data().includes('bn') ){
$("#tableCompIntPlana").DataTable().row( rowIdx ).nodes().to$().toggleClass( 'selected' );
negro_selected = true;
}
if( !color_selected && $('#tableCompIntPlana').DataTable().cell(rowIdx, 0).data().includes('color') ){
$("#tableCompIntPlana").DataTable().row( rowIdx ).nodes().to$().toggleClass( 'selected' );
color_selected = true;
}
});
var table = $("#tableCompIntPlana").DataTable();
var rows = table.rows( '.selected' ).indexes();
var data = table.rows( rows ).data();
var value_total = 0.00;
for (let i = 0; i < data.length ; i++) {
value_total += parseFloat(data[i]['total'])
}
$('#total_comp_plana').html(value_total.toFixed(2));
}
function selectIntRotLineas(){
$("#tableCompIntRotativa").DataTable().rows( '.selected' ).deselect();
let value_total = 0.00;
if($("#tableCompIntRotativa").DataTable().rows().count()>0) {
$("#tableCompIntRotativa").DataTable().row( 0 ).nodes().to$().toggleClass( 'selected' );
value_total = parseFloat($("#tableCompIntRotativa").DataTable().rows( 0 ).data()[0]['total'])
};
$('#total_comp_rot').html(value_total.toFixed(2));
}
function selectCubiertaLineas(){
$("#tableCompCubierta").DataTable().rows( '.selected' ).deselect();
let value_total = 0.00;
if($("#tableCompCubierta").DataTable().rows().count()>0) {
$("#tableCompCubierta").DataTable().row( 0 ).nodes().to$().toggleClass( 'selected' );
value_total = parseFloat($("#tableCompCubierta").DataTable().rows( 0 ).data()[0]['total'])
};
$('#total_comp_cubierta').html(value_total.toFixed(2));
}
function getIDsComparador(is_color, is_hq){
if(!is_color){
if(is_hq){
var papel = '#compPapelNegrohq';
var gramaje = '#compGramajeNegrohq';
var paginas = '#compPaginasNegrohq';
}
else{
var papel = '#compPapelNegro';
var gramaje = '#compGramajeNegro';
var paginas = '#compPaginasNegro';
}
}
else{
if(is_hq){
var papel = '#compPapelColorhq';
var gramaje = '#compGramajeColorhq';
var paginas = '#compPaginasColorhq';
}
else{
var papel = '#compPapelColor';
var gramaje = '#compGramajeColor';
var paginas = '#compPaginasColor';
}
}
return{
papel: papel,
gramaje: gramaje,
paginas: paginas,
}
}
function getDimensionLibro(){
var ancho = 0;
var alto = 0;
if($('#papelFormatoId').select2('data').length > 0){
if($('#papelFormatoId').select2('data')[0].id.length > 0){
ancho = parseFloat($('#papelFormatoId').select2('data')[0].text.trim().split(" x ")[0]);
alto = parseFloat($('#papelFormatoId').select2('data')[0].text.trim().split(" x ")[1]);
}
else if(document.getElementById('papelFormatoPersonalizado').checked){
ancho = parseFloat(document.getElementById('papelFormatoAncho').value);
alto = parseFloat(document.getElementById('papelFormatoAlto').value);
}
}
else if(document.getElementById('papelFormatoPersonalizado').checked){
ancho = parseFloat(document.getElementById('papelFormatoAncho').value);
alto = parseFloat(document.getElementById('papelFormatoAlto').value);
}
return {
ancho: ancho,
alto: alto
}
}
function checkInputsForRotativa(){
// Si es color, el gramaje y el papel tiene que ser el mismo
try{
if ($('#tipoImpresion').select2('data')[0].id == 'color') {
if($('#compPapelNegro').select2('data')[0].id == $('#compPapelColor').select2('data')[0].id &&
$('#compGramajeNegro').select2('data')[0].text.trim() == $('#compGramajeColor').select2('data')[0].text.trim() ){
return true;
}
}
else if ($('#tipoImpresion').select2('data')[0].id == 'negro') {
if($('#compPapelNegro').select2('data')[0].id.length>0 &&
$('#compGramajeNegro').select2('data')[0].text.length>0){
return true;
}
}
}
catch(error){
return false;
}
return false;
}
function fillIntPlana(data, is_color, is_hq){
let sorted = data.lineas.sort(
(p1, p2) => ((p1.fields.precio_pedido+p1.fields.precio_click_pedido) < (p2.fields.precio_pedido+p2.fields.precio_click_pedido)) ?
-1 : ((p1.fields.precio_pedido+p1.fields.precio_click_pedido) > (p2.fields.precio_pedido+p2.fields.precio_click_pedido)) ? 1 : 0);
sorted.forEach(function(linea) {
if(typeof linea.error == "undefined")
$('#tableCompIntPlana').DataTable().row
.add(getRowFromLineaInt(is_color?(is_hq?'colorhq':'color'):(is_hq?'bnhq':'bn'), linea))
.draw()
})
}
function fillIntRot(data){
let sorted = data.lineas.sort(
(p1, p2) => ((p1.fields.precio_pedido+p1.fields.precio_click_pedido) < (p2.fields.precio_pedido+p2.fields.precio_click_pedido)) ?
-1 : ((p1.fields.precio_pedido+p1.fields.precio_click_pedido) > (p2.fields.precio_pedido+p2.fields.precio_click_pedido)) ? 1 : 0);
sorted.forEach(function(linea) {
if(typeof linea.error == "undefined"){
$('#tableCompIntRotativa').DataTable().row
.add(getRowFromLineaRot(linea))
.draw()
}
})
}
function fillCubierta(data, is_color, is_hq){
let sorted = data.lineas.sort(
(p1, p2) => ((p1.fields.precio_pedido+p1.fields.precio_click_pedido) < (p2.fields.precio_pedido+p2.fields.precio_click_pedido)) ?
-1 : ((p1.fields.precio_pedido+p1.fields.precio_click_pedido) > (p2.fields.precio_pedido+p2.fields.precio_click_pedido)) ? 1 : 0);
sorted.forEach(function(linea) {
if(typeof linea.error == "undefined")
$('#tableCompCubierta').DataTable().row
.add(getRowFromLineaInt('cubierta', linea))
.draw()
})
}
function clearCompTable(){
$('#insertarPlanaBtn').addClass('d-none')
$('#insertarRotativaBtn').addClass('d-none')
$('#total_comp_plana').html('0.00')
$('#total_comp_rot').html('0.00')
}
function generateCompJSON(){
data = {}
if( $('#tipoImpresion').select2('data')[0].id == 'negro' || $('#tipoImpresion').select2('data')[0].id == 'color')
{
try{
bn_obj = {
"bn":{
'paginas': $('#compPaginasNegro').val(),
'papel_id': $('#compPapelNegro').select2('data')[0].id,
'gramaje': $('#compGramajeNegro').select2('data')[0].text.trim(),
}
}
}
catch (e){
bn_obj = {}
}
$.extend( data, bn_obj );
}
if( $('#tipoImpresion').select2('data')[0].id == 'negrohq' || $('#tipoImpresion').select2('data')[0].id == 'colorhq')
{
try{
bnhq_obj = {
"bnhq":{
'paginas': $('#compPaginasNegrohq').val(),
'papel_id': $('#compPapelNegrohq').select2('data')[0].id,
'gramaje': $('#compGramajeNegrohq').select2('data')[0].text.trim(),
}
}
}
catch (e){
bnhq_obj = {}
}
$.extend( data, bnhq_obj );
}
if($('#tipoImpresion').select2('data')[0].id == 'color')
{
try{
color_obj = {
"color":{
'paginas': $('#compPaginasColor').val(),
'papel_id': $('#compPapelColor').select2('data')[0].id,
'gramaje': $('#compGramajeColor').select2('data')[0].text.trim(),
},
}
}
catch (e){
color_obj = {}
}
$.extend( data, color_obj );
}
if($('#tipoImpresion').select2('data')[0].id == 'colorhq')
{
try{
colorhq_obj = {
"colorhq":{
'paginas': $('#compPaginasColorhq').val(),
'papel_id': $('#compPapelColorhq').select2('data')[0].id,
'gramaje': $('#compGramajeColorhq').select2('data')[0].text.trim(),
},
}
}
catch (e){
colorhq_obj = {}
}
$.extend( data, colorhq_obj );
}
try{
cubierta_obj = {
"cubierta":{
'paginas': $('#compCarasCubierta').select2('data')[0].id,
'papel_id': $('#compPapelCubierta').select2('data')[0].id,
'gramaje': $('#compGramajeCubierta').select2('data')[0].text.trim(),
},
}
}
catch (e){
cubierta_obj = {}
}
$.extend( data, cubierta_obj );
data_str = JSON.stringify(data)
$('#comparador_json_data').val(data_str)
}

View File

@ -0,0 +1,108 @@
// Global parameters
var _offsetSolapas = 2; // millimeters
var styles = {
size: 13,
family: 'Public Sans',
}
function previewCubierta(cubiertaObj) {
// Local parameters
let fullBookWith = ((2 * cubiertaObj.anchoLibro) + (2 * (cubiertaObj.solapas + _offsetSolapas)) + cubiertaObj.lomo);
// Clear the canvas element
$('#draw-cubierta').empty();
// Get the element for placing the graphical elements
var divCubierta = document.getElementById('draw-cubierta');
var _previewCubierta = new Two({fitted: true}).appendTo(divCubierta);
// Calculate the center of the canvas element
var origenCubierta = new Two.Vector(_previewCubierta.width / 2, _previewCubierta.height / 2);
var areaMaquinaCubierta = _previewCubierta.makeRectangle(
origenCubierta.x,
origenCubierta.y,
cubiertaObj.anchoMaquina,
cubiertaObj.altoMaquina);
areaMaquinaCubierta.stroke = 'black';
areaMaquinaCubierta.linewidth = 1;
var areaImpresionCubierta = _previewCubierta.makeRectangle(
origenCubierta.x,
origenCubierta.y,
cubiertaObj.anchoImpresion,
cubiertaObj.altoImpresion);
areaImpresionCubierta.stroke = 'red';
areaImpresionCubierta.linewidth = 1;
var formaCubierta = _previewCubierta.makeRectangle(
origenCubierta.x,
origenCubierta.y,
fullBookWith,
cubiertaObj.altoLibro);
formaCubierta.stroke = '#6997D3';
formaCubierta.fill = '#6997D3';
formaCubierta.linewidth = 1;
// Texts
_previewCubierta.makeText(cubiertaObj.altoLibro, origenCubierta.x + (fullBookWith/2 -25), origenCubierta.y, styles);
_previewCubierta.makeText(fullBookWith, origenCubierta.x, origenCubierta.y + (cubiertaObj.altoLibro/2-15) , styles);
_previewCubierta.update();
// Update preview info fields
$('#prevLibro').text(cubiertaObj.anchoLibro + "X" + cubiertaObj.altoLibro );
$('#prevLomo').text(cubiertaObj.lomo);
$('#prevSolapas').text(cubiertaObj.solapas);
}
function previewPortada(portadaObj) {
// Clear the canvas element
$('#draw-portada').empty();
// Get the element for placing the graphical elements
var divPortada = document.getElementById('draw-portada');
var _previewPortada = new Two({fitted: true}).appendTo(divPortada);
// Calculate the center of the canvas element
var origenPortada = new Two.Vector(_previewPortada.width / 2, _previewPortada.height / 2);
var solapas = _previewPortada.makeRectangle(
origenPortada.x,
origenPortada.y,
((2 * portadaObj.anchoLibro) + (2 * (portadaObj.solapas + _offsetSolapas)) + portadaObj.lomo),
portadaObj.altoLibro);
solapas.stroke = '#5FD2B5';
solapas.fill = '#5FD2B5';
solapas.linewidth = 1;
var libro = _previewPortada.makeRectangle(
origenPortada.x,
origenPortada.y,
((2 * portadaObj.anchoLibro) + portadaObj.lomo),
portadaObj.altoLibro);
libro.stroke = '#6997D3';
libro.fill = '#6997D3';
libro.linewidth = 1;
var lomo = _previewPortada.makeRectangle(
origenPortada.x,
origenPortada.y,
portadaObj.lomo,
portadaObj.altoLibro);
lomo.stroke = '#8171D4';
lomo.fill = '#8171D4';
lomo.linewidth = 1;
_previewPortada.update();
// Update preview info fields
$('#prevLibro').text(portadaObj.anchoLibro + "X" + portadaObj.altoLibro );
$('#prevLomo').text(portadaObj.lomo);
$('#prevSolapas').text(portadaObj.solapas);
}

View File

@ -1,9 +1,11 @@
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
<?= $this->include("themes/_commonPartialsBs/sweetalert") ?>
<?= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>
<?= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>
<?= $this->section("content") ?>
<div class="row">
<div class="col-12">
<div class="card card-info">
@ -14,21 +16,36 @@
<?= csrf_field() ?>
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
<input type="hidden" name="tipo_impresion_id" id="tipo_impresion_id" class="form-control" value="<?= $tipo_impresion_id ?>"></input>
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosPresupuestoItems") ?>
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosLibroItems") ?>
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosPresupuestoClienteItems") ?>
<?php if(str_contains($formAction,'edit')): ?>
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosLibroItems") ?>
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosPresupuestoClienteItems") ?>
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_lineasPresupuestoItems") ?>
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosServiciosItems") ?>
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_comentariosItems") ?>
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_resumenPresupuestoItems") ?>
<?php else: ?>
<input type="hidden" name="total_presupuesto" id="total_presupuesto" class="form-control" value="0.0"></input>
<?php endif; ?>
<div class="pt-4">
<input type="submit"
class="btn btn-primary float-start me-sm-3 me-1"
name="save"
value="<?= lang("Basic.global.Save") ?>"
/>
<?= anchor(route_to("cosidotapablandaList"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary float-start",]) ?>
<?php if(str_contains($formAction,'edit')): ?>
<?= anchor(route_to("presupuestoToPdf"), lang("Basic.global.Print"), ["class" => "btn btn-dark float-start me-sm-3 me-1",]) ?>
<?= anchor(route_to("#"), lang("Basic.global.Clone"), ["class" => "btn btn-info float-start me-sm-3 me-1",]) ?>
<?php endif; ?>
<?= anchor(route_to("cosidotapablandaList"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary float-start",]) ?>
</div>
</form>
</div><!-- //.card -->
</div><!--//.col -->
</div><!--//.row -->
<?= view("themes/_commonPartialsBs/_modalConfirmDialog") ?>
<?= $this->endSection() ?>
@ -63,6 +80,9 @@
}
});
/*******************************
* Inicialización de los Select2
*******************************/
$('#incRei').select2({
allowClear: false,
});
@ -71,333 +91,70 @@
allowClear: false,
});
$('#papelFormatoId').select2({
allowClear: false,
});
$('#tipoImpresion').select2({
allowClear: false,
});
$('#compPapelNegro').select2({
allowClear: false,
});
$('#compGramajeNegro').select2({
allowClear: false,
});
$('#compPapelNegrohq').select2({
allowClear: false,
});
$('#compGramajeNegrohq').select2({
allowClear: false,
});
$('#compPapelColor').select2({
allowClear: false,
});
$('#compPapelColorhq').select2({
allowClear: false,
});
$('#compGramajeColor').select2({
allowClear: false,
});
$('#compPapelCubierta').select2({
allowClear: false,
});
$('#compGramajeCubierta').select2({
allowClear: false,
});
$('#encuadernacion').select2({
allowClear: false,
});
$('#compPaginasCubierta').select2({
allowClear: false,
minimumResultsForSearch: Infinity,
});
<?= $this->endSection() ?>
<!------------------------------------------->
<!-- Código JS comportamiento general pag. -->
<!-- Acciones antes de submit... -->
<!------------------------------------------->
<?php if(str_contains($formAction,'edit')): ?>
<?= $this->section("additionalInlineJs") ?>
autosize($('#compCalPaginasColor'));
$('#papelFormatoPersonalizado').on("click",function(){
var checkbox = document.getElementById('papelFormatoPersonalizado');
if(checkbox.checked == true){
document.getElementById("papelFormatoAncho").style.display = "block";
document.getElementById("papelFormatoAlto").style.display = "block";
$('#papelFormatoId').next(".select2-container").hide();
document.getElementById("label_papelFormatoId").innerHTML =
"<?=lang('Presupuestos.papelFormatoId') ?> (" +
"<?=lang('Presupuestos.papelFormatoAncho') ?> x <?=lang('Presupuestos.papelFormatoAncho') ?>)*";
}
else{
document.getElementById("papelFormatoAncho").style.display = "none";
document.getElementById("papelFormatoAlto").style.display = "none";
$('#papelFormatoId').next(".select2-container").show();
document.getElementById("label_papelFormatoId").innerHTML =
"<?=lang('Presupuestos.papelFormatoId') ?>*";
}
});
if(url_parts[url_parts.length-2] == 'edit'){
id = url_parts[url_parts.length-1];
}
else{
id = -1;
}
init_comparador();
var tableCompIntPlana = new DataTable('#tableCompIntPlana',{
scrollX: true,
searching: false,
paging: false,
info: false,
ordering: false,
responsive: true,
language: {
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
},
});
var tableCompIntRotativa = new DataTable('#tableCompIntRotativa',{
scrollX: true,
searching: false,
paging: false,
info: false,
ordering: false,
responsive: true,
language: {
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
},
});
var tableCompIntCubierta = new DataTable('#tableCompCubierta',{
scrollX: true,
searching: false,
paging: false,
info: false,
ordering: false,
responsive: true,
language: {
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
},
});
var tableCompIntSobrecubierta = new DataTable('#tableCompSobrecubierta',{
scrollX: true,
searching: false,
paging: false,
info: false,
ordering: false,
responsive: true,
language: {
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
},
});
$('#compPapelNegro').on('select2:select', function (e){
$('#compGramajeNegro').val(null).trigger('change');
$('#compGramajeNegro').prop('disabled', false);
$('#compPapelNegro').find('option[value="0"]').remove();
$('#compGramajeNegro').select2({
allowClear: true,
minimumResultsForSearch: Infinity,
ajax: {
url: '<?= route_to("menuItemsOfCosidotapablanda") ?>',
type: 'post',
dataType: 'json',
data: function (params) {
return {
tipo: 'gramaje',
datos: $('#compPapelNegro').select2('data')[0].text.trim() ,
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
};
},
delay: 60,
processResults: function (response) {
yeniden(response.<?= csrf_token() ?>);
return {
results: response.menu
};
},
cache: true
$('#presupuestoForm').on( "submit", function( event ) {
event.preventDefault();
$.when(fill_bbdd_from_lp(id).then(function (data, textStatus, jqXHR){
generateCompJSON()
form = $('#presupuestoForm').serialize()
$.ajax({
type: "POST",
url: "<?php echo $formAction; ?>",
data: form,
success: function (data) {
yeniden(data.<?= csrf_token() ?>)
popSuccessAlert(data.mensaje)
}
});
});
$('#compPapelNegrohq').on('select2:select', function (e){
$('#compGramajeNegrohq').val(null).trigger('change');
$('#compGramajeNegrohq').prop('disabled', false);
$('#compPapelNegrohq').find('option[value="0"]').remove();
$('#compGramajeNegrohq').select2({
allowClear: true,
minimumResultsForSearch: Infinity,
ajax: {
url: '<?= route_to("menuItemsOfCosidotapablanda") ?>',
type: 'post',
dataType: 'json',
data: function (params) {
return {
tipo: 'gramaje',
datos: $('#compPapelNegrohq').select2('data')[0].text.trim() ,
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
};
},
delay: 60,
processResults: function (response) {
yeniden(response.<?= csrf_token() ?>);
return {
results: response.menu
};
},
cache: true
}
});
});
$('#compPapelColor').on('select2:select', function (e){
$('#compGramajeColor').val(null).trigger('change');
$('#compGramajeColor').prop('disabled', false);
$('#compPapelColor').find('option[value="0"]').remove();
$('#compGramajeColor').select2({
allowClear: true,
minimumResultsForSearch: Infinity,
ajax: {
url: '<?= route_to("menuItemsOfCosidotapablanda") ?>',
type: 'post',
dataType: 'json',
data: function (params) {
return {
tipo: 'gramaje',
datos: $('#compPapelColor').select2('data')[0].text.trim() ,
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
};
},
delay: 60,
processResults: function (response) {
yeniden(response.<?= csrf_token() ?>);
return {
results: response.menu
};
},
cache: true
}
});
});
$('#compPapelColorhq').on('select2:select', function (e){
$('#compGramajeColorhq').val(null).trigger('change');
$('#compGramajeColorhq').prop('disabled', false);
$('#compPapelColorhq').find('option[value="0"]').remove();
$('#compGramajeColorhq').select2({
allowClear: true,
minimumResultsForSearch: Infinity,
ajax: {
url: '<?= route_to("menuItemsOfCosidotapablanda") ?>',
type: 'post',
dataType: 'json',
data: function (params) {
return {
tipo: 'gramaje',
datos: $('#compPapelColorhq').select2('data')[0].text.trim() ,
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
};
},
delay: 60,
processResults: function (response) {
yeniden(response.<?= csrf_token() ?>);
return {
results: response.menu
};
},
cache: true
}
});
});
$('#compPapelCubierta').on('select2:select', function (e){
$('#compGramajeCubierta').val(null).trigger('change');
$('#compGramajeCubierta').prop('disabled', false);
$('#compPapelCubierta').find('option[value="0"]').remove();
$('#compGramajeCubierta').select2({
allowClear: true,
minimumResultsForSearch: Infinity,
ajax: {
url: '<?= route_to("menuItemsOfCosidotapablanda") ?>',
type: 'post',
dataType: 'json',
data: function (params) {
return {
tipo: 'gramaje',
datos: $('#compPapelCubierta').select2('data')[0].text.trim() ,
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
};
},
delay: 60,
processResults: function (response) {
yeniden(response.<?= csrf_token() ?>);
return {
results: response.menu
};
},
cache: true
}
});
});
}).fail(function (jqXHR, textStatus, error) {
// Handle error here
console.log(jqXHR)
});;
}))
return false; //stop the actual form post !important!
});
<?= $this->endSection() ?>
<?php endif; ?>
<?=$this->section('css') ?>
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/datatables-editor/editor.dataTables.min.css') ?>">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.2.3/css/buttons.bootstrap5.min.css">
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/sk-datatables.css') ?>">
<?=$this->endSection() ?>
<?= $this->section('additionalExternalJs') ?>
<script src="<?= site_url('themes/vuexy/vendor/libs/autosize/autosize.js') ?>"></script>
<script src="<?= site_url('js_loader/comparadorCosidoTapaBlanda_js') ?>"></script>
<?=$this->endSection() ?>
<?= $this->section('additionalExternalJs') ?>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.print.min.js"></script>
<?=$this->endSection() ?>
<script src="https://cdn.datatables.net/select/1.7.0/js/dataTables.select.min.js"></script>
<script src="<?= site_url('themes/vuexy/js/datatables-editor/dataTables.editor.min.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/autosize/autosize.js') ?>"></script>
<?php if(str_contains($formAction,'edit')): ?>
<script src="<?= site_url('js_loader/comparadorCosidoTapaBlanda_js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/two/two.js') ?>"></script>
<?php endif; ?>
<?=$this->endSection() ?>

View File

@ -10,7 +10,7 @@
<div class="card card-info">
<div class="card-header">
<h3 class="card-title"><?=lang('Presupuestos.presupuestoCosidotapablandaList') ?></h3>
<?=anchor(route_to('newCosidotapablanda'), lang('Basic.global.addNew').' '.lang('Presupuestos.presupuesto'), ['class'=>'btn btn-primary float-end']); ?>
<?=anchor(route_to('newCosidotapablanda'), lang('Basic.global.addNew').' '.lang('Presupuestos.presupuesto'), ['class'=>'btn btn-primary ']); ?>
</div><!--//.card-header -->
<div class="card-body">
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
@ -27,7 +27,7 @@
<th><?= lang('Presupuestos.incRei') ?></th>
<th><?= lang('Presupuestos.paginas') ?></th>
<th><?= lang('Presupuestos.tirada') ?></th>
<th><?= lang('Presupuestos.totalPedido') ?></th>
<th><?= lang('Presupuestos.totalPresupuesto') ?></th>
<th><?= lang('Presupuestos.presupuestoEstado') ?></th>
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
</tr>
@ -104,8 +104,15 @@
{ 'data': 'inc_rei' },
{ 'data': 'paginas' },
{ 'data': 'tirada' },
{ 'data': 'total_pedido' },
{ 'data': 'estado' },
{ 'data': 'total_presupuesto' },
{ 'data': 'estado' ,
'render': function ( data, type, row, meta ) {
if(data=='borrador')
return '<?= lang('Presupuestos.presupuestoEstadoBorrador') ?>';
else if(data=='aceptado')
return '<?= lang('Presupuestos.presupuestoEstadoAceptado') ?>';
}
},
{ 'data': actionBtns }
]
});

View File

@ -172,11 +172,11 @@
table : "#tableOfTarifaencuadernacionlineas",
idSrc: 'id',
fields: [ {
name: "paginas_min"
name: "paginas_libro_min"
}, {
name: "precio_max"
}, {
name: "paginas_max"
name: "paginas_libro_max"
}, {
name: "precio_min"
}, {
@ -243,9 +243,9 @@
async: true,
}),
columns: [
{ 'data': 'paginas_min' },
{ 'data': 'paginas_libro_min' },
{ 'data': 'precio_max' },
{ 'data': 'paginas_max' },
{ 'data': 'paginas_libro_max' },
{ 'data': 'precio_min' },
{ 'data': 'margen' },
{

View File

@ -0,0 +1,17 @@
/*
fetch("/presupuestos/cosidotapablanda/datatable", {
method: 'POST',
body: JSON.stringify(data),
headers: { 'X-Requested-With': 'XMLHttpRequest' },
})
.then(response => console.log(response))
//.then(json => console.log(json))
.catch(err => console.log(err));
*/

View File

@ -0,0 +1,36 @@
<?= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>
<?= $this->section("additionalInlineJs") ?>
console.log("Hola")
let datos = {
table_type: 'comp_int_bn',
paginas: 200,
tirada: 100,
merma: 10,
ancho: 98 ,
alto: 148,
papel_generico_id: 4,
papel_generico: 'AHUESADO OFFSET',
gramaje: 80,
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
}
$.ajax({
type:"POST",
url:"cosidotapablanda/datatable",
data:datos, // data recive un objeto con la informacion que se enviara al servidor
success:function(data){ //success es una funcion que se utiliza si el servidor retorna informacion
console.log(data)
yeniden(data.<?= csrf_token() ?>);
},
//dataType: dataType // El tipo de datos esperados del servidor. Valor predeterminado: Intelligent Guess (xml, json, script, text, html).
})
<?=$this->endSection() ?>

View File

@ -29,7 +29,7 @@
/**
* MENU CLIENTES
*/
if (allowMenuSection($menus, ['Cliente', 'Tarifacliente'], 'index')):
if (allowMenuSection($menus, ['Cliente'], 'index')):
?>
<!-- Clientes -->
<li class="menu-item">
@ -47,15 +47,6 @@
</li>
<?php endif; ?>
<?php endif; ?>
<?php if (count($temp = getArrayItem($menus, 'name', 'Tarifacliente')) > 0): ?>
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
<li class="menu-item">
<a href="<?= site_url("clientes/tarifacliente") ?>" class="menu-link">
<div data-i18n="<?= lang("App.menu_tarifacliente") ?>"><?= lang("App.menu_tarifacliente") ?></div>
</a>
</li>
<?php endif; ?>
<?php endif; ?>
</ul>
</li>
<?php endif; ?>

View File

@ -29,7 +29,7 @@
/**
* MENU CLIENTES
*/
if (allowMenuSection($menus, ['Cliente', 'Tarifacliente'], 'index')):
if (allowMenuSection($menus, ['Cliente'], 'index')):
?>
<!-- Clientes -->
<li class="menu-item">
@ -47,15 +47,6 @@
</li>
<?php endif; ?>
<?php endif; ?>
<?php if (count($temp = getArrayItem($menus, 'name', 'Tarifacliente')) > 0): ?>
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
<li class="menu-item">
<a href="<?= site_url("clientes/tarifacliente") ?>" class="menu-link">
<div data-i18n="<?= lang("App.menu_tarifacliente") ?>"><?= lang("App.menu_tarifacliente") ?></div>
</a>
</li>
<?php endif; ?>
<?php endif; ?>
</ul>
</li>
<?php endif; ?>
@ -76,7 +67,7 @@
<?php if (allowMenuSection(
$menus,
['Fresadotapadura', 'Fresadotapablanda', 'Cosidotapadura', 'Cosidotapablanda',
'Cosidotapablandasolapas', 'Grapados', 'Espiraltapadura', 'Espiraltapablanda',
'Grapados', 'Espiraltapadura', 'Espiraltapablanda',
'Wireotapadura', 'Wireotapablanda'],
'index')):
?>
@ -125,16 +116,6 @@
<?php endif; ?>
<?php endif; ?>
<?php if (count($temp = getArrayItem($menus, 'name', 'Cosidotapablandasolapas')) > 0): ?>
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
<li class="menu-item">
<a href="<?= site_url("presupuestos/cosidotapablandasolapas") ?>" class="menu-link">
<div data-i18n="<?= lang("App.menu_libros_cosido_tapa_blanda_solapas") ?>"><?= lang("App.menu_libros_cosido_tapa_blanda_solapas") ?></div>
</a>
</li>
<?php endif; ?>
<?php endif; ?>
<?php if (count($temp = getArrayItem($menus, 'name', 'Grapados')) > 0): ?>
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
<li class="menu-item">

View File

@ -29,7 +29,7 @@
/**
* MENU CLIENTES
*/
if (allowMenuSection($menus, ['Cliente', 'Tarifacliente'], 'index')):
if (allowMenuSection($menus, ['Cliente'], 'index')):
?>
<!-- Clientes -->
<li class="menu-item">
@ -47,15 +47,6 @@
</li>
<?php endif; ?>
<?php endif; ?>
<?php if (count($temp = getArrayItem($menus, 'name', 'Cliente')) > 0): ?>
<?php if (count(getArrayItem($temp, 'methods', 'nuevo', true)) > 0): ?>
<li class="menu-item">
<a href="<?= site_url("clientes/nuevo") ?>" class="menu-link">
<div data-i18n="<?= lang("App.menu_clientes_nuevo") ?>"><?= lang("App.menu_clientes_nuevo") ?></div>
</a>
</li>
<?php endif; ?>
<?php endif; ?>
</ul>
</li>
<?php endif; ?>

File diff suppressed because one or more lines are too long

View File

@ -11,7 +11,8 @@
"google/apiclient": "^2.11.0",
"firebase/php-jwt": "^5.4",
"aws/aws-sdk-php": "^3.206",
"spatie/db-dumper": "^2.21"
"spatie/db-dumper": "^2.21",
"dompdf/dompdf": "^2.0"
},
"require-dev": {
"fakerphp/faker": "^1.9",

276
ci4/composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "ea2c5914ab3f8f7779effd58bed12864",
"content-hash": "9478d2ca5dbbd157209c335eca83612f",
"packages": [
{
"name": "aws/aws-crt-php",
@ -229,6 +229,68 @@
},
"time": "2023-05-21T13:41:12+00:00"
},
{
"name": "dompdf/dompdf",
"version": "v2.0.3",
"source": {
"type": "git",
"url": "https://github.com/dompdf/dompdf.git",
"reference": "e8d2d5e37e8b0b30f0732a011295ab80680d7e85"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/dompdf/dompdf/zipball/e8d2d5e37e8b0b30f0732a011295ab80680d7e85",
"reference": "e8d2d5e37e8b0b30f0732a011295ab80680d7e85",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-mbstring": "*",
"masterminds/html5": "^2.0",
"phenx/php-font-lib": ">=0.5.4 <1.0.0",
"phenx/php-svg-lib": ">=0.3.3 <1.0.0",
"php": "^7.1 || ^8.0"
},
"require-dev": {
"ext-json": "*",
"ext-zip": "*",
"mockery/mockery": "^1.3",
"phpunit/phpunit": "^7.5 || ^8 || ^9",
"squizlabs/php_codesniffer": "^3.5"
},
"suggest": {
"ext-gd": "Needed to process images",
"ext-gmagick": "Improves image processing performance",
"ext-imagick": "Improves image processing performance",
"ext-zlib": "Needed for pdf stream compression"
},
"type": "library",
"autoload": {
"psr-4": {
"Dompdf\\": "src/"
},
"classmap": [
"lib/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-2.1"
],
"authors": [
{
"name": "The Dompdf Community",
"homepage": "https://github.com/dompdf/dompdf/blob/master/AUTHORS.md"
}
],
"description": "DOMPDF is a CSS 2.1 compliant HTML to PDF converter",
"homepage": "https://github.com/dompdf/dompdf",
"support": {
"issues": "https://github.com/dompdf/dompdf/issues",
"source": "https://github.com/dompdf/dompdf/tree/v2.0.3"
},
"time": "2023-02-07T12:51:48+00:00"
},
{
"name": "ezyang/htmlpurifier",
"version": "v4.16.0",
@ -1087,6 +1149,73 @@
},
"time": "2022-12-02T22:17:43+00:00"
},
{
"name": "masterminds/html5",
"version": "2.8.1",
"source": {
"type": "git",
"url": "https://github.com/Masterminds/html5-php.git",
"reference": "f47dcf3c70c584de14f21143c55d9939631bc6cf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Masterminds/html5-php/zipball/f47dcf3c70c584de14f21143c55d9939631bc6cf",
"reference": "f47dcf3c70c584de14f21143c55d9939631bc6cf",
"shasum": ""
},
"require": {
"ext-dom": "*",
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8.35 || ^5.7.21 || ^6 || ^7 || ^8"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.7-dev"
}
},
"autoload": {
"psr-4": {
"Masterminds\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Matt Butcher",
"email": "technosophos@gmail.com"
},
{
"name": "Matt Farina",
"email": "matt@mattfarina.com"
},
{
"name": "Asmir Mustafic",
"email": "goetas@gmail.com"
}
],
"description": "An HTML5 parser and serializer.",
"homepage": "http://masterminds.github.io/html5-php",
"keywords": [
"HTML5",
"dom",
"html",
"parser",
"querypath",
"serializer",
"xml"
],
"support": {
"issues": "https://github.com/Masterminds/html5-php/issues",
"source": "https://github.com/Masterminds/html5-php/tree/2.8.1"
},
"time": "2023-05-10T11:58:31+00:00"
},
{
"name": "monolog/monolog",
"version": "2.9.1",
@ -1430,6 +1559,96 @@
},
"time": "2020-10-15T08:29:30+00:00"
},
{
"name": "phenx/php-font-lib",
"version": "0.5.4",
"source": {
"type": "git",
"url": "https://github.com/dompdf/php-font-lib.git",
"reference": "dd448ad1ce34c63d09baccd05415e361300c35b4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/dompdf/php-font-lib/zipball/dd448ad1ce34c63d09baccd05415e361300c35b4",
"reference": "dd448ad1ce34c63d09baccd05415e361300c35b4",
"shasum": ""
},
"require": {
"ext-mbstring": "*"
},
"require-dev": {
"symfony/phpunit-bridge": "^3 || ^4 || ^5"
},
"type": "library",
"autoload": {
"psr-4": {
"FontLib\\": "src/FontLib"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0"
],
"authors": [
{
"name": "Fabien Ménager",
"email": "fabien.menager@gmail.com"
}
],
"description": "A library to read, parse, export and make subsets of different types of font files.",
"homepage": "https://github.com/PhenX/php-font-lib",
"support": {
"issues": "https://github.com/dompdf/php-font-lib/issues",
"source": "https://github.com/dompdf/php-font-lib/tree/0.5.4"
},
"time": "2021-12-17T19:44:54+00:00"
},
{
"name": "phenx/php-svg-lib",
"version": "0.5.0",
"source": {
"type": "git",
"url": "https://github.com/dompdf/php-svg-lib.git",
"reference": "76876c6cf3080bcb6f249d7d59705108166a6685"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/dompdf/php-svg-lib/zipball/76876c6cf3080bcb6f249d7d59705108166a6685",
"reference": "76876c6cf3080bcb6f249d7d59705108166a6685",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"php": "^7.1 || ^8.0",
"sabberworm/php-css-parser": "^8.4"
},
"require-dev": {
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5"
},
"type": "library",
"autoload": {
"psr-4": {
"Svg\\": "src/Svg"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0"
],
"authors": [
{
"name": "Fabien Ménager",
"email": "fabien.menager@gmail.com"
}
],
"description": "A library to read, parse and export to PDF SVG files.",
"homepage": "https://github.com/PhenX/php-svg-lib",
"support": {
"issues": "https://github.com/dompdf/php-svg-lib/issues",
"source": "https://github.com/dompdf/php-svg-lib/tree/0.5.0"
},
"time": "2022-09-06T12:16:56+00:00"
},
{
"name": "phpoffice/phpspreadsheet",
"version": "1.28.0",
@ -1999,6 +2218,59 @@
},
"time": "2019-03-08T08:55:37+00:00"
},
{
"name": "sabberworm/php-css-parser",
"version": "8.4.0",
"source": {
"type": "git",
"url": "https://github.com/sabberworm/PHP-CSS-Parser.git",
"reference": "e41d2140031d533348b2192a83f02d8dd8a71d30"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sabberworm/PHP-CSS-Parser/zipball/e41d2140031d533348b2192a83f02d8dd8a71d30",
"reference": "e41d2140031d533348b2192a83f02d8dd8a71d30",
"shasum": ""
},
"require": {
"ext-iconv": "*",
"php": ">=5.6.20"
},
"require-dev": {
"codacy/coverage": "^1.4",
"phpunit/phpunit": "^4.8.36"
},
"suggest": {
"ext-mbstring": "for parsing UTF-8 CSS"
},
"type": "library",
"autoload": {
"psr-4": {
"Sabberworm\\CSS\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Raphael Schweikert"
}
],
"description": "Parser for CSS Files written in PHP",
"homepage": "https://www.sabberworm.com/blog/2010/6/10/php-css-parser",
"keywords": [
"css",
"parser",
"stylesheet"
],
"support": {
"issues": "https://github.com/sabberworm/PHP-CSS-Parser/issues",
"source": "https://github.com/sabberworm/PHP-CSS-Parser/tree/8.4.0"
},
"time": "2021-12-11T13:40:54+00:00"
},
{
"name": "spatie/db-dumper",
"version": "2.21.1",
@ -4269,5 +4541,5 @@
"php": "^7.3 || ^8.0"
},
"platform-dev": [],
"plugin-api-version": "2.3.0"
"plugin-api-version": "2.6.0"
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,144 @@
/* cyrillic-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
font-stretch: 100%;
src: url(https://fonts.gstatic.com/s/opensans/v36/memvYaGs126MiZpBA-UvWbX2vVnXBbObj2OVTSKmu1aB.woff2) format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
font-stretch: 100%;
src: url(https://fonts.gstatic.com/s/opensans/v36/memvYaGs126MiZpBA-UvWbX2vVnXBbObj2OVTSumu1aB.woff2) format('woff2');
unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
font-stretch: 100%;
src: url(https://fonts.gstatic.com/s/opensans/v36/memvYaGs126MiZpBA-UvWbX2vVnXBbObj2OVTSOmu1aB.woff2) format('woff2');
unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
font-stretch: 100%;
src: url(https://fonts.gstatic.com/s/opensans/v36/memvYaGs126MiZpBA-UvWbX2vVnXBbObj2OVTSymu1aB.woff2) format('woff2');
unicode-range: U+0370-03FF;
}
/* hebrew */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
font-stretch: 100%;
src: url(https://fonts.gstatic.com/s/opensans/v36/memvYaGs126MiZpBA-UvWbX2vVnXBbObj2OVTS2mu1aB.woff2) format('woff2');
unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
/* vietnamese */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
font-stretch: 100%;
src: url(https://fonts.gstatic.com/s/opensans/v36/memvYaGs126MiZpBA-UvWbX2vVnXBbObj2OVTSCmu1aB.woff2) format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
font-stretch: 100%;
src: url(https://fonts.gstatic.com/s/opensans/v36/memvYaGs126MiZpBA-UvWbX2vVnXBbObj2OVTSGmu1aB.woff2) format('woff2');
unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
font-stretch: 100%;
src: url(https://fonts.gstatic.com/s/opensans/v36/memvYaGs126MiZpBA-UvWbX2vVnXBbObj2OVTS-muw.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 600;
font-stretch: 100%;
src: url(https://fonts.gstatic.com/s/opensans/v36/memvYaGs126MiZpBA-UvWbX2vVnXBbObj2OVTSKmu1aB.woff2) format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 600;
font-stretch: 100%;
src: url(https://fonts.gstatic.com/s/opensans/v36/memvYaGs126MiZpBA-UvWbX2vVnXBbObj2OVTSumu1aB.woff2) format('woff2');
unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 600;
font-stretch: 100%;
src: url(https://fonts.gstatic.com/s/opensans/v36/memvYaGs126MiZpBA-UvWbX2vVnXBbObj2OVTSOmu1aB.woff2) format('woff2');
unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 600;
font-stretch: 100%;
src: url(https://fonts.gstatic.com/s/opensans/v36/memvYaGs126MiZpBA-UvWbX2vVnXBbObj2OVTSymu1aB.woff2) format('woff2');
unicode-range: U+0370-03FF;
}
/* hebrew */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 600;
font-stretch: 100%;
src: url(https://fonts.gstatic.com/s/opensans/v36/memvYaGs126MiZpBA-UvWbX2vVnXBbObj2OVTS2mu1aB.woff2) format('woff2');
unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
/* vietnamese */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 600;
font-stretch: 100%;
src: url(https://fonts.gstatic.com/s/opensans/v36/memvYaGs126MiZpBA-UvWbX2vVnXBbObj2OVTSCmu1aB.woff2) format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 600;
font-stretch: 100%;
src: url(https://fonts.gstatic.com/s/opensans/v36/memvYaGs126MiZpBA-UvWbX2vVnXBbObj2OVTSGmu1aB.woff2) format('woff2');
unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 600;
font-stretch: 100%;
src: url(https://fonts.gstatic.com/s/opensans/v36/memvYaGs126MiZpBA-UvWbX2vVnXBbObj2OVTS-muw.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

View File

@ -0,0 +1,755 @@
/* Presupuesto Safekat */
body {
font-family: 'Open Sans', sans-serif;
}
body table.logo {
width: 100%;
color: black;
}
body table.logo td.logo img {
width: 100%;
}
body table.presupuesto-data {
width: 100%;
font-size: 12px;
}
body table.presupuesto-data th {
background: black;
color: white;
padding: 6px;
}
body table.presupuesto-data th.intro_presupuesto {
width: 20%;
padding-left: 15px;
}
body table.presupuesto-data th.num_presupuesto {
width: 10%;
font-weight: lighter;
}
body table.presupuesto-data th.intro_cliente {
width: 11%;
padding-left: 15px;
}
body table.presupuesto-data th.letra {
font-size: 9px;
}
body table.presupuesto-data th.cliente {
width: 38%;
font-weight: lighter;
text-transform: uppercase;
}
body table.presupuesto-data th.intro_fecha {
width: 10%;
}
body table.presupuesto-data th.fecha {
width: 10%;
text-align: right;
font-weight: lighter;
}
body table.presupuesto-data td {
background: #e3e4e7;
padding-left: 15px;
}
body table.presupuesto-data td.titulo {
padding-top: 5px;
}
body table.presupuesto-data td div.intro-coleccion,
body table.presupuesto-data td div.intro_autor {
font-weight: bold;
padding-bottom: 10px;
}
body table.presupuesto-data td.coleccion,
body table.presupuesto-data td.autor {
padding-top: 3px;
padding-bottom: 10px;
}
body table.impresion {
width: 100%;
font-size: 11px;
margin-bottom: 9px;
margin-top: 8px;
}
body table.impresion th {
color: white;
font-size: 12px;
font-weight: lighter;
background: #8ac948;
padding: 3px;
padding-left: 8px;
}
body table.impresion td {
border-bottom: 1px dotted black;
padding: 3px;
font-family: 'Open Sans', sans-serif;
}
body table.impresion td.t {
width: 18%;
font-weight: bold;
border-right: 1px dotted black;
}
body table.impresion td.t-first {
width: 8%;
font-weight: bold;
border-left: 1px dotted black;
border-right: 1px dotted black;
}
body table.impresion td.t-second {
width: 11%;
font-weight: bold;
border-left: 1px dotted black;
border-right: 1px dotted black;
}
body table.impresion td.v {
width: 12%;
}
body table.impresion td.v-second {
width: 11%;
}
body table.impresion td.v-first {
width: 40%;
}
body table.cubierta {
width: 100%;
font-size: 11px;
margin-bottom: 9px;
}
body table.cubierta th {
background: #0C2C84;
color: white;
font-size: 12px;
font-weight: lighter;
padding: 3px;
padding-left: 8px;
}
body table.cubierta td {
border-bottom: 1px dotted black;
padding: 3px;
}
body table.cubierta td.t {
width: 18%;
font-weight: bold;
border-right: 1px dotted black;
}
body table.cubierta td.t-first,
body table.cubierta td.t-second,
body table.cubierta td.t-third,
body table.cubierta tdv.second {
width: 8%;
font-weight: bold;
border-left: 1px dotted black;
border-right: 1px dotted black;
}
body table.cubierta td.v {
width: 10%;
}
body table.cubierta td.v-third {
width: 12%;
}
body table.cubierta td.v-first {
width: 28%;
}
body table.encuadernacion {
width: 100%;
font-size: 11px;
margin-bottom: 9px;
}
body table.encuadernacion th {
color: white;
font-size: 12px;
font-weight: lighter;
background: #8ac948;
padding: 3px;
padding-left: 8px;
}
body table.encuadernacion td {
border-bottom: 1px dotted black;
padding: 3px;
}
body table.encuadernacion td.t {
width: 18%;
font-weight: bold;
border-right: 1px dotted black;
}
body table.encuadernacion td.v {
width: 46%;
}
body table.encuadernacion td.v-first {
width: 7%;
border-left: 1px dotted black;
border-right: 1px dotted black;
}
body table.encuadernacion tdv.second {
width: 8%;
border-left: 1px dotted black;
border-right: 1px dotted black;
}
body table.encuadernacion td.t-first {
width: 8%;
font-weight: bold;
border-left: 1px dotted black;
border-right: 1px dotted black;
}
body table.encuadernacion td.t-second {
width: 9%;
font-weight: bold;
border-right: 1px dotted black;
}
body table.extras {
width: 100%;
font-size: 11px;
margin-bottom: 9px;
}
body table.extras th {
color: white;
font-size: 12px;
font-weight: lighter;
background: #0C2C84;
padding: 3px;
padding-left: 8px;
}
body table.extras td {
border-bottom: 1px dotted black;
padding: 3px;
}
body table.extras td.t {
width: 18%;
font-weight: bold;
border-right: 1px dotted black;
}
body table.envio {
width: 100%;
font-size: 11px;
margin-bottom: 9px;
}
body table.envio th {
color: white;
font-size: 12px;
font-weight: lighter;
background: #8ac948;
padding: 3px;
padding-left: 8px;
}
body table.envio td {
border-bottom: 1px dotted black;
padding: 3px;
}
body table.envio td.v {
width: 12%;
border-right: 1px dotted black;
}
body table.envio td.t-ejemplares,
body table.envio td.t {
width: 9%;
font-weight: bold;
border-right: 1px dotted black;
}
body table.envio td.t-second {
width: 4%;
border-right: 1px dotted black;
font-weight: bold;
}
body table.envio td.v-second {
width: 5%;
}
body table.envio td.v-first,
body table.envio td.v-third {
width: 12%;
border-right: 1px dotted black;
}
body table.envio td.v-third {
width: 16%;
border-right: 1px dotted black;
}
body table.envio td.t-first,
body table.envio td.t-third,
body table.envio td.t-fourth,
body table.envio td.t-first-direccion,
body table.envio td.t-first {
width: 8%;
font-weight: bold;
border-left: 1px dotted black;
border-right: 1px dotted black;
}
body table.totales {
width: 64%;
text-align: center;
}
body table.totales th {
width: 12%;
font-weight: bold;
font-size: 12px;
text-align: center;
color: white;
background: #0C2C84;
padding: 3px;
}
body table.totales th.u_envio_21 {
width: 16%;
}
body table.totales th.hidden {
background: none;
}
body table.totales td {
font-size: 12px;
font-weight: bold;
text-align: center;
border: 1px dotted #4e4e4e;
border-top: none;
padding: 3px;
}
body table.totales td.tirada {
width: 12%;
border-left: none;
}
body table.totales td.precio,
body table.totales td.u_impresion_4 {
width: 12%;
}
body table.totales td.precio_ud {
width: 12%;
border-right: none;
}
body table.totales td.iva {
border: none;
text-align: right;
font-size: 10px;
}
body table.totales td.hidden {
border: none !important;
}
/* Presupuesto Manual */
table.presupuesto-data td {
background: #e3e4e7;
padding-left: 15px;
}
table.presupuesto-data td.descripcion {
padding-top: 10px;
padding-bottom: 10px;
}
table.presupuesto-manual-lineas {
width: 100%;
margin-top: 20px;
border-spacing: 0;
border-collapse: collapse;
}
table.presupuesto-manual-lineas tr.head-lineas-manual {
background: #688BC0;
color: white;
}
table.presupuesto-manual-lineas th {
font-size: 11pt;
font-weight: lighter;
padding: 5px !important;
color: white;
border-right: 1px solid white;
}
table.presupuesto-manual-lineas td {
padding: 10px !important;
font-size: 9pt;
color: black;
border: 1px dotted #4e4e4e;
border-top: none;
}
table.presupuesto-manual-lineas td.num_unidades {
border-left: none;
}
table.presupuesto-manual-lineas td.concepto {
border-right: none;
}
table.presupuesto-manual-lineas td.precio_unidad {
text-align: right;
}
table.presupuesto-manual-lineas td.total {
border-right: none;
text-align: right;
}
table.totales-manual {
width: 25%;
margin-top: 15px;
text-align: center;
padding: 3px;
}
table.totales-manual th {
font-weight: lighter;
font-size: 10pt;
padding: 5px;
text-align: center;
color: white;
background: #688BC0;
border-right: 1px solid white;
}
table.totales-manual td {
font-size: 9pt;
padding: 5px;
text-align: center;
border: 1px dotted #4e4e4e;
border-top: none;
}
table.totales-manual td.precio {
border-left: none;
border-right: none;
}
table.totales-manual td.iva {
border: none;
text-align: right;
font-size: 8pt;
}
.observaciones {
color: #0C2C84;
font-weight: bold;
margin-bottom: 0px;
}
div.comentarios {
font-size: 9pt;
border: 1px solid #ddd;
margin-top: 5px;
padding-left: 10px;
padding-right: 10px;
}
div.footer {
font-size: 10pt;
text-align: left;
}
div.footer .texto-email {
font-weight: bold;
}
div.footer .texto-asteriscos {
font-size: 11px;
}
div.footer .texto-presupuesto {
color: black;
margin-top: 10px;
font-size: 7pt;
}
div.footer.servicios {
margin-top: 20px;
}
div.footer.tirada {
margin-top: 0px;
}
div.footer.sin-servicios {
margin-top: 82px;
}
/* Presup. y pedido maquetacion */
table.pedido-maquetacion-lineas {
width: 100%;
}
table.pedido-maquetacion-lineas td {
padding: 3px;
}
table.pedido-maquetacion-totales {
margin-top: 10px;
margin-bottom: 60px;
}
table.pedido-maquetacion-totales td.iva_right {
font-size: 10px;
margin-top: 2px;
}
#tablacentral {
border-top-width: 0;
border-left-width: 1px;
border-right-width: 1px;
border-bottom-width: 0;
text-align: center;
font-size: 9pt;
}
#tablanoborde {
border-top-width: 0;
border-left-width: 0;
border-right-width: 0;
border-bottom-width: 0;
}
#tabla {
border-style: solid;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
font-size: 7pt;
font-weight: bold;
}
#tabladato {
font-size: 9pt;
font-weight: normal;
float: center;
}
#tablaesquina {
border-style: solid;
border-top-width: 0;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 0;
}
#tdinteriorabajo {
border-top: none;
border-bottom: 1px solid;
border-left: 1px solid;
border-right: 1px solid;
text-align: center;
font-size: 10px;
height: -40px;
}
#tdinteriorarriba {
border-bottom: none;
border-top: 1px solid;
border-left: 1px solid;
border-right: 1px solid;
font-weight: bold;
font-size: 12px;
height: -40px;
padding-left: 2px;
padding-top: 1px;
}
#tdinteriorarribacliente {
border-top: 1px solid;
border-left: 1px solid;
border-bottom: 1px solid;
border-right: none;
font-weight: bold;
font-size: 12px;
height: -40px;
padding-left: 2px;
padding-top: 1px;
}
#tdinteriorarribaclientedato {
border-top: 1px solid;
border-left: none;
border-bottom: 1px solid;
border-right: 1px solid;
font-size: 12px;
height: -40px;
padding-left: 2px;
padding-top: 1px;
}
#tdniarribaniabajo {
border-bottom: none;
border-top: none;
border-left: 1px solid;
border-right: 1px solid;
font-size: 12px;
text-align: center;
}
#tdniarribaniabajoopciones {
border-bottom: none;
border-top: none;
border-left: 1px solid;
border-right: 1px solid;
font-size: 10px;
}
#tdniarribaniabajo2 {
border-bottom: none;
border-top: 1px solid;
border-left: 1px solid;
border-right: 1px solid;
font-size: 12px;
text-align: center;
font-weight: bold;
}
#tdniarribaniabajo3 {
border-bottom: 1px solid;
border-top: none;
border-left: 1px solid;
border-right: 1px solid;
font-size: 12px;
text-align: center;
}
#subtdabajocentro {
border-bottom: 1px solid;
border-top: none;
border-left: 1px solid;
border-right: 1px solid;
text-align: center;
font-size: 9pt;
}
#subtd {
border-top: none;
border-bottom: 1px solid;
border-left: 1px solid;
border-right: 1px solid;
text-align: center;
font-size: 12px;
}
#subtdcen {
border-top: none;
border-bottom: 1px solid #919191;
border-left: 1px solid #919191;
border-right: 1px solid #919191;
text-align: center;
font-size: 12px;
background-color: #77B2D0;
color: white;
}
#subtdizq {
border-top: none;
border-bottom: 1px solid #919191;
border-right: 1px solid #919191;
text-align: center;
font-size: 12px;
color: white;
background-color: #77B2D0;
}
#subtdder {
border-top: none;
border-bottom: 1px solid #919191;
border-left: 1px solid #919191;
text-align: center;
font-size: 12px;
color: white;
background-color: #77B2D0;
}
#tdarriba {
border-bottom: none;
border-top: 1px solid;
border-left: 1px solid;
border-right: 1px solid;
font-size: 12px;
}
#tdarribaopciones {
border-bottom: none;
border-top: 1px solid;
border-left: 1px solid;
border-right: 1px solid;
font-size: 10px;
}
#tdabajo {
border-bottom: 1px solid;
border-top: none;
border-left: 1px solid;
border-right: 1px solid;
font-size: 12px;
}
#dato {
text-align: center;
font-size: 9pt;
}
#subrayado {
font-size: 9pt;
border-bottom: 1px solid;
}
#td {
font-size: 12px;
}
#tdopciones {
font-size: 10px;
}

View File

@ -40,4 +40,59 @@ table.dataTable.table-hover>tbody>tr.selected:hover>* {
.comparator-table td.dt-result-value {
text-align: left;
}
}
.lp-cell {
padding-left: 1px;
padding-right: 1px;
margin:0;
}
.lp-input {
text-align: center;
min-width: 50px;
width: 100%;
border-radius: 0.25rem !important;
}
.lp-select {
padding-top: 2px;
padding-bottom: 2px;
width: 100%;
font-size:0.7rem !important;
}
.lp-td {
padding-left: 1px;
padding-right: 1px;
margin:0 !important;
}
.lp-header {
text-align: center !important;
padding-left: 1px !important;
padding-right: 1px !important;
padding-top: 1px !important;
padding-bottom: 5px !important;
margin:0 !important;
}
.lp-cell-disabled {
background-color: Gainsboro;
}
.lp-button{
font-size: 1.1em;
padding-left: 3px;
padding-right: 3px;
width: 100%;
height: 25px;
margin-top: 6px;
}
div.draw-shapes {
width: 95%;
height: 500px;
margin: 2.5% auto;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Some files were not shown because too many files have changed in this diff Show More