Merge branch 'dev/presupuesto_cliente' into 'main'
Dev/presupuesto cliente See merge request jjimenez/safekat!227
@ -546,6 +546,17 @@ $routes->group('cosidotapablanda', ['namespace' => 'App\Controllers\Presupuestos
|
||||
});
|
||||
$routes->resource('cosidotapablanda', ['namespace' => 'App\Controllers\Presupuestos', 'controller' => 'Cosidotapablanda', 'except' => 'show,new,create,update']);
|
||||
|
||||
$routes->group('presupuestocliente', ['namespace' => 'App\Controllers\Presupuestos'], function ($routes) {
|
||||
$routes->get('list/(:num)', 'Presupuestocliente::list/$1', ['as' => 'listarPresupuestoCliente']); // HOMOGENIZAR CON ARGS DINAMICOS!!!
|
||||
$routes->get('add', 'Presupuestocliente::add', ['as' => 'nuevoPresupuestoCliente']);
|
||||
$routes->post('add', 'Presupuestocliente::add', ['as' => 'crearPresupuestoCliente']);
|
||||
$routes->post('edit/(:num)', 'Presupuestocliente::edit/$1', ['as' => 'editarPresupuestoCliente']);
|
||||
$routes->post('datatable', 'Cosidotapablanda::datatable', ['as' => 'tablaPresupuestosCliente']);
|
||||
$routes->post('getgramaje', 'Presupuestocliente::getGramaje', ['as' => 'obtenerGramaje']);
|
||||
$routes->post('presupuesto', 'Presupuestocliente::presupuesto', ['as' => 'presupuestoCliente']);
|
||||
});
|
||||
$routes->resource('presupuestocliente', ['namespace' => 'App\Controllers\Presupuestos', 'controller' => 'Presupuestocliente', 'except' => 'show,new,create,update']);
|
||||
|
||||
$routes->group('serviciosacabados', ['namespace' => 'App\Controllers\Presupuestos'], function ($routes) {
|
||||
$routes->post('datatable', 'Presupuestoacabados::datatable', ['as' => 'dataTableOfPresupuestoAcabados']);
|
||||
$routes->post('edit/(:num)', 'Presupuestoacabados::edit/$1', ['as' => 'updatePresupuestoacabados']);
|
||||
|
||||
@ -82,5 +82,23 @@ class Js_loader extends BaseController
|
||||
return view('themes/backend/vuexy/form/presupuestos/cosidotapablanda/_presupuestos.js');
|
||||
}
|
||||
|
||||
function presupuestoCliente_js()
|
||||
{
|
||||
$this->response->setHeader('Content-Type', 'text/javascript');
|
||||
return view('themes/backend/vuexy/form/presupuestos/cliente/presupuestoCliente.js');
|
||||
}
|
||||
|
||||
function presupuestoClienteTipoLibro_js()
|
||||
{
|
||||
$this->response->setHeader('Content-Type', 'text/javascript');
|
||||
return view('themes/backend/vuexy/form/presupuestos/cliente/tipoLibroItems.js');
|
||||
}
|
||||
|
||||
function presupuestoClienteDisenioLibro_js()
|
||||
{
|
||||
$this->response->setHeader('Content-Type', 'text/javascript');
|
||||
return view('themes/backend/vuexy/form/presupuestos/cliente/disenioLibro.js');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,63 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controllers\Presupuestos;
|
||||
use App\Controllers\BaseController;
|
||||
|
||||
|
||||
class PresupuestoInterfazCliente extends BaseController
|
||||
{
|
||||
function __construct()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
$data['title'] = [
|
||||
'module' => lang("App.settings_title"),
|
||||
'page' => lang("App.settings_subtitle"),
|
||||
'icon' => 'fas fa-sliders-h'
|
||||
];
|
||||
|
||||
$data['breadcrumb'] = [
|
||||
['title' => lang("App.menu_presupuesto"), 'route' => site_url('presupuesto'), 'active' => true]
|
||||
];
|
||||
|
||||
echo view(getenv('theme.path').'form/presupuestos/index', $data);
|
||||
}
|
||||
|
||||
public function tapa_blanda_encolada()
|
||||
{
|
||||
|
||||
$data['title'] = [
|
||||
'module' => lang("App.settings_title"),
|
||||
'page' => lang("App.settings_subtitle"),
|
||||
'icon' => 'fas fa-sliders-h'
|
||||
];
|
||||
|
||||
$data['breadcrumb'] = [
|
||||
['title' => lang("App.menu_presupuesto"), 'route' => site_url('presupuesto'), 'active' => false],
|
||||
['title' => lang("App.menu_presupuesto"), 'route' => site_url('presupuesto/tapa_blanda_encolada'), 'active' => true]
|
||||
];
|
||||
|
||||
echo view(getenv('theme.path').'form/presupuestos/tapa-blanda-encolada', $data);
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function add()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function edit()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
1002
ci4/app/Controllers/Presupuestos/Presupuestocliente.php
Executable file
@ -187,6 +187,8 @@ class LoginAuthFilter implements FilterInterface
|
||||
'datatable_editor_2',
|
||||
'collect',
|
||||
'cast',
|
||||
'getGramaje',
|
||||
'presupuesto',
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@ -280,9 +280,15 @@ return [
|
||||
'decimal' => 'El campo {field} debe contener un número decimal.',
|
||||
'integer' => 'El campo {field} debe contener un número entero.',
|
||||
'requerido' => 'El campo {field} es obligatorio.',
|
||||
'requerido_short' => 'Campo obligatorio',
|
||||
'max_length' => 'El campo {field} no puede exceder los {param} caracteres de longitud.',
|
||||
'no_lp_for_merma' => 'Inserte líneas de presupuesto para calcular la merma',
|
||||
'ejemplares_envio' => 'El número de ejemplares enviados no coincide con la tirada',
|
||||
'cliente' => 'Debe seleccionar un cliente',
|
||||
'pais' => 'Debe seleccionar un país',
|
||||
'integer_greatherThan_0' => 'Número entero > 0 requerido',
|
||||
'tirada_no_valida' => "Tirada no valida",
|
||||
'sin_gramaje' => "Seleccione gramaje",
|
||||
],
|
||||
|
||||
'errores' => [
|
||||
@ -297,6 +303,9 @@ return [
|
||||
'formato_papel' => 'Debe seleccionar un formato de papel',
|
||||
'tirada_alt_duplicada' => 'Ya existe una tirada alternativa para ese valor',
|
||||
'tirada_alt_tipo' => 'No se puede calcular una tirada alternativa POD para una presupuesto no POD o viceversa',
|
||||
'noInterior' => 'No se hay resultados para el interior',
|
||||
'noCubiertaSobrecubierta' => 'No se hay resultados para cubierta/sobrecubierta',
|
||||
'errorPresupuesto' => 'Se ha producido un error al calcular el presupuesto. Póngase en contacto con el administrador',
|
||||
],
|
||||
];
|
||||
|
||||
|
||||
@ -93,7 +93,7 @@ class PapelGenericoModel extends \App\Models\GoBaseModel
|
||||
}
|
||||
|
||||
|
||||
public function getPapelForComparador($tipo, $is_cubierta = false, $is_sobrecubierta = false, $rotativa = false, $is_guardas = false)
|
||||
public function getPapelForComparador($tipo, $is_cubierta = false, $is_sobrecubierta = false, $rotativa = false, $is_guardas = false, $mostrar_cliente = null)
|
||||
{
|
||||
/*
|
||||
1.-> Tipo impresion
|
||||
@ -145,6 +145,10 @@ class PapelGenericoModel extends \App\Models\GoBaseModel
|
||||
$builder->where("t2.rotativa", 1);
|
||||
}
|
||||
|
||||
if($mostrar_cliente!=null){
|
||||
$builder->where("t1.show_in_client", $mostrar_cliente);
|
||||
}
|
||||
|
||||
$data = $builder->orderBy("t1.nombre", "asc")->get()->getResultObject();
|
||||
//var_dump($this->db->getLastQuery());
|
||||
return $data;
|
||||
|
||||
404
ci4/app/Services/PresupuestoClienteService.php
Normal file
@ -0,0 +1,404 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
|
||||
use CodeIgniter\Config\BaseService;
|
||||
|
||||
use App\Services\PresupuestoService;
|
||||
|
||||
|
||||
class PresupuestoClienteService extends BaseService
|
||||
{
|
||||
public static function obtenerInterior($data)
|
||||
{
|
||||
|
||||
$rotativa = [];
|
||||
$plana = PresupuestoClienteService::obtenerPresupuestoClienteInterior($data);
|
||||
if (!$data['excluirRotativa'] && !$data['isHq'])
|
||||
$rotativa = PresupuestoClienteService::obtenerPresupuestoClienteInteriorRotativa($data);
|
||||
|
||||
$total_plana = -1;
|
||||
if (count($plana[0]) > 0 || count($plana[1]) > 0) {
|
||||
$total_plana = 0.0;
|
||||
foreach ($plana as $linea) {
|
||||
if (count($linea) > 0)
|
||||
$total_plana += floatval($linea['total_impresion']);
|
||||
}
|
||||
}
|
||||
|
||||
$total_rotativa = -1;
|
||||
if (!$data['excluirRotativa'] && count($rotativa) > 0) {
|
||||
$total_rotativa = floatval($rotativa['total_impresion']);
|
||||
}
|
||||
if ($total_plana < 0 && $total_rotativa < 0)
|
||||
return [];
|
||||
else {
|
||||
if ($total_plana > $total_rotativa)
|
||||
return $plana;
|
||||
else
|
||||
return [$rotativa];
|
||||
}
|
||||
}
|
||||
|
||||
public static function obtenerCubierta($data)
|
||||
{
|
||||
|
||||
$uso = $data['uso'];
|
||||
$tipo_impresion_id = $data['tipo_impresion_id'];
|
||||
$datosPedido = $data['datosPedido'];
|
||||
$papel_generico = $data['papel_generico'];
|
||||
$gramaje = $data['gramaje'];
|
||||
$isColor = $data['isColor'];
|
||||
$isHq = $data['isHq'];
|
||||
$cliente_id = $data['cliente_id'];
|
||||
$paginas_color = $data['paginas_color'];
|
||||
|
||||
$lineas_cubierta = [];
|
||||
|
||||
for ($i = 0; $i < 2; $i++) {
|
||||
|
||||
$lineas = PresupuestoService::obtenerComparadorPlana([
|
||||
'uso' => $uso,
|
||||
'tipo_impresion_id' => $tipo_impresion_id,
|
||||
'datosPedido' => $datosPedido,
|
||||
'papel_generico' => $papel_generico,
|
||||
'gramaje' => $gramaje,
|
||||
'isColor' => $isColor,
|
||||
'isHq' => $isHq,
|
||||
'cliente_id' => $cliente_id,
|
||||
'a_favor_fibra' => $i
|
||||
]);
|
||||
|
||||
if (count($lineas) > 0) {
|
||||
$lineas_cubierta = array_merge($lineas_cubierta, $lineas);
|
||||
}
|
||||
}
|
||||
if (count($lineas_cubierta) > 0) {
|
||||
|
||||
usort(
|
||||
$lineas_cubierta,
|
||||
function ($a, $b) {
|
||||
$result = 0;
|
||||
if (floatval($a['fields']['total_impresion']) > floatval($b['fields']['total_impresion']))
|
||||
$result = 1;
|
||||
else if (floatval($a['fields']['total_impresion']) < floatval($b['fields']['total_impresion']))
|
||||
$result = -1;
|
||||
return $result;
|
||||
}
|
||||
);
|
||||
$lineas_cubierta = $lineas_cubierta[0]['fields'];
|
||||
$lineas_cubierta['tipo_linea'] = 'lp_cubierta';
|
||||
}
|
||||
return $lineas_cubierta;
|
||||
}
|
||||
|
||||
public static function obtenerSobrecubierta($data)
|
||||
{
|
||||
|
||||
$uso = $data['uso'];
|
||||
$tipo_impresion_id = $data['tipo_impresion_id'];
|
||||
$datosPedido = $data['datosPedido'];
|
||||
$papel_generico = $data['papel_generico'];
|
||||
$gramaje = $data['gramaje'];
|
||||
$isColor = $data['isColor'];
|
||||
$isHq = $data['isHq'];
|
||||
$cliente_id = $data['cliente_id'];
|
||||
$paginas_color = $data['paginas_color'];
|
||||
|
||||
$lineas_sobrecubierta = [];
|
||||
|
||||
for ($i = 0; $i < 2; $i++) {
|
||||
|
||||
$lineas = PresupuestoService::obtenerComparadorPlana([
|
||||
'uso' => $uso,
|
||||
'tipo_impresion_id' => $tipo_impresion_id,
|
||||
'datosPedido' => $datosPedido,
|
||||
'papel_generico' => $papel_generico,
|
||||
'gramaje' => $gramaje,
|
||||
'isColor' => $isColor,
|
||||
'isHq' => $isHq,
|
||||
'cliente_id' => $cliente_id,
|
||||
'a_favor_fibra' => $i
|
||||
]);
|
||||
|
||||
if (count($lineas) > 0) {
|
||||
$lineas_sobrecubierta = array_merge($lineas_sobrecubierta, $lineas);
|
||||
}
|
||||
}
|
||||
if (count($lineas_sobrecubierta) > 0) {
|
||||
|
||||
usort(
|
||||
$lineas_sobrecubierta,
|
||||
function ($a, $b) {
|
||||
$result = 0;
|
||||
if (floatval($a['fields']['total_impresion']) > floatval($b['fields']['total_impresion']))
|
||||
$result = 1;
|
||||
else if (floatval($a['fields']['total_impresion']) < floatval($b['fields']['total_impresion']))
|
||||
$result = -1;
|
||||
return $result;
|
||||
}
|
||||
);
|
||||
$lineas_sobrecubierta = $lineas_sobrecubierta[0]['fields'];
|
||||
$lineas_sobrecubierta['tipo_linea'] = 'lp_sobrecubierta';
|
||||
}
|
||||
return $lineas_sobrecubierta;
|
||||
}
|
||||
|
||||
public static function obtenerGuardas($data)
|
||||
{
|
||||
|
||||
$uso = $data['uso'];
|
||||
$tipo_impresion_id = $data['tipo_impresion_id'];
|
||||
$datosPedido = $data['datosPedido'];
|
||||
$papel_generico = $data['papel_generico'];
|
||||
$gramaje = $data['gramaje'];
|
||||
$isColor = $data['isColor'];
|
||||
$isHq = $data['isHq'];
|
||||
$cliente_id = $data['cliente_id'];
|
||||
|
||||
$lineas_guardas = [];
|
||||
|
||||
for ($i = 0; $i < 2; $i++) {
|
||||
|
||||
$lineas = PresupuestoService::obtenerComparadorPlana([
|
||||
'uso' => $uso,
|
||||
'tipo_impresion_id' => $tipo_impresion_id,
|
||||
'datosPedido' => $datosPedido,
|
||||
'papel_generico' => $papel_generico,
|
||||
'gramaje' => $gramaje,
|
||||
'isColor' => $isColor,
|
||||
'isHq' => $isHq,
|
||||
'cliente_id' => $cliente_id,
|
||||
'a_favor_fibra' => $i
|
||||
]);
|
||||
|
||||
if (count($lineas) > 0) {
|
||||
$lineas_guardas = array_merge($lineas_guardas, $lineas);
|
||||
}
|
||||
}
|
||||
if (count($lineas_guardas) > 0) {
|
||||
|
||||
usort(
|
||||
$lineas_guardas,
|
||||
function ($a, $b) {
|
||||
$result = 0;
|
||||
if (floatval($a['fields']['total_impresion']) > floatval($b['fields']['total_impresion']))
|
||||
$result = 1;
|
||||
else if (floatval($a['fields']['total_impresion']) < floatval($b['fields']['total_impresion']))
|
||||
$result = -1;
|
||||
return $result;
|
||||
}
|
||||
);
|
||||
$lineas_guardas = $lineas_guardas[0]['fields'];
|
||||
$lineas_guardas['tipo_linea'] = 'lp_guardas';
|
||||
}
|
||||
return $lineas_guardas;
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtiene las lineas de plana en el presupuesto de cliente
|
||||
* Selecciona entre las más económicas
|
||||
* Parámetros:
|
||||
* - uso: en este caso esta variable está fija a 'interior'
|
||||
* - tipo: tipo de impresión
|
||||
* - datosPedido: datos del pedido
|
||||
* * paginas: número de páginas
|
||||
* * tirada: número de ejemplares
|
||||
* * merma: merma
|
||||
* * ancho: ancho del libro
|
||||
* * alto: alto del libro
|
||||
* * isCosido: si está cosido
|
||||
* - cliente_id: id del cliente
|
||||
* - papel_generico: papel genérico (array con id y nombre)
|
||||
* - isColor: si es a color
|
||||
* - isHq: si es alta calidad
|
||||
* - paginas_color: número de páginas a color
|
||||
*/
|
||||
private static function obtenerPresupuestoClienteInterior($data)
|
||||
{
|
||||
|
||||
$uso = $data['uso'];
|
||||
$tipo_impresion_id = $data['tipo_impresion_id'];
|
||||
$datosPedido = $data['datosPedido'];
|
||||
$papel_generico = $data['papel_generico'];
|
||||
$gramaje = $data['gramaje'];
|
||||
$isColor = $data['isColor'];
|
||||
$isHq = $data['isHq'];
|
||||
$cliente_id = $data['cliente_id'];
|
||||
$paginas_color = $data['paginas_color'];
|
||||
|
||||
$paginas_negro = $datosPedido->paginas - $paginas_color;
|
||||
|
||||
|
||||
$linea_negro_plana = [];
|
||||
$linea_color_plana = [];
|
||||
|
||||
// Negro
|
||||
if ($datosPedido->paginas > $paginas_color) {
|
||||
|
||||
$datosPedido->paginas = $paginas_negro;
|
||||
for ($i = 0; $i < 2; $i++) {
|
||||
|
||||
$lineas = PresupuestoService::obtenerComparadorPlana([
|
||||
'uso' => $uso,
|
||||
'tipo_impresion_id' => $tipo_impresion_id,
|
||||
'datosPedido' => $datosPedido,
|
||||
'papel_generico' => $papel_generico,
|
||||
'gramaje' => $gramaje,
|
||||
'isColor' => false,
|
||||
'isHq' => $isHq,
|
||||
'cliente_id' => $cliente_id,
|
||||
'a_favor_fibra' => $i
|
||||
]);
|
||||
|
||||
if (count($lineas) > 0) {
|
||||
$linea_negro_plana = array_merge($linea_color_plana, $lineas);
|
||||
}
|
||||
}
|
||||
if (count($linea_negro_plana) > 0) {
|
||||
|
||||
usort(
|
||||
$linea_negro_plana,
|
||||
function ($a, $b) {
|
||||
$result = 0;
|
||||
if (floatval($a['fields']['total_impresion']) > floatval($b['fields']['total_impresion']))
|
||||
$result = 1;
|
||||
else if (floatval($a['fields']['total_impresion']) < floatval($b['fields']['total_impresion']))
|
||||
$result = -1;
|
||||
return $result;
|
||||
}
|
||||
);
|
||||
$linea_negro_plana = $linea_negro_plana[0]['fields'];
|
||||
$linea_negro_plana['tipo_linea'] = $isHq ? 'lp_bnhq' : 'lp_bn';
|
||||
}
|
||||
}
|
||||
|
||||
// Color
|
||||
if ($paginas_color > 0) {
|
||||
|
||||
for ($i = 0; $i < 2; $i++) {
|
||||
|
||||
$lineas = PresupuestoService::obtenerComparadorPlana([
|
||||
'uso' => $uso,
|
||||
'tipo_impresion_id' => $tipo_impresion_id,
|
||||
'datosPedido' => $datosPedido,
|
||||
'papel_generico' => $papel_generico,
|
||||
'gramaje' => $gramaje,
|
||||
'isColor' => true,
|
||||
'isHq' => $isHq,
|
||||
'cliente_id' => $cliente_id,
|
||||
'a_favor_fibra' => $i
|
||||
]);
|
||||
|
||||
if (count($lineas) > 0) {
|
||||
$linea_color_plana = array_merge($linea_color_plana, $lineas);
|
||||
}
|
||||
}
|
||||
if (count($linea_color_plana) > 0) {
|
||||
|
||||
usort(
|
||||
$linea_color_plana,
|
||||
function ($a, $b) {
|
||||
$result = 0;
|
||||
if (floatval($a['fields']['total_impresion']) > floatval($b['fields']['total_impresion']))
|
||||
$result = 1;
|
||||
else if (floatval($a['fields']['total_impresion']) < floatval($b['fields']['total_impresion']))
|
||||
$result = -1;
|
||||
return $result;
|
||||
}
|
||||
);
|
||||
$linea_color_plana = $linea_color_plana[0]['fields'];
|
||||
$linea_negro_plana['tipo_linea'] = $isHq ? 'lp_colorhq' : 'lp_color';
|
||||
}
|
||||
}
|
||||
return [$linea_negro_plana, $linea_color_plana];
|
||||
}
|
||||
|
||||
public static function getServiciosEncuadernacionDefault($data){
|
||||
|
||||
$tipo_impresion_id = $data['tipo_impresion_id'] ?? -1;
|
||||
$tirada = $data['tirada'] ?? -1;
|
||||
$paginas = $data['paginas'] ?? -1;
|
||||
$ancho = $data['ancho'] ?? -1;
|
||||
$alto = $data['alto'] ?? -1;
|
||||
$POD = $data['POD'] ?? -1;
|
||||
$solapas = $data['solapas'] ?? -1;
|
||||
|
||||
$model = model('App\Models\Presupuestos\PresupuestoEncuadernacionesModel');
|
||||
$values = $model->initPresupuesto($tipo_impresion_id, $solapas, $tirada, $paginas, $ancho, $alto, $POD);
|
||||
return $values;
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtiene las lineas de rotativa en el presupuesto de cliente
|
||||
* Selecciona entre las más económicas
|
||||
* Parámetros:
|
||||
* - uso: en este caso esta variable está fija a 'interior'
|
||||
* - tipo: tipo de impresión
|
||||
* - datosPedido: datos del pedido
|
||||
* * paginas: número de páginas
|
||||
* * tirada: número de ejemplares
|
||||
* * merma: merma
|
||||
* * ancho: ancho del libro
|
||||
* * alto: alto del libro
|
||||
* * isCosido: si está cosido
|
||||
* - cliente_id: id del cliente
|
||||
* - papel_generico: papel genérico (array con id y nombre)
|
||||
* - isColor: si es a color
|
||||
* - isHq: si es alta calidad
|
||||
* - paginas_color: número de páginas a color
|
||||
*/
|
||||
private static function obtenerPresupuestoClienteInteriorRotativa($data)
|
||||
{
|
||||
$datosPedido = $data['datosPedido'];
|
||||
$papel_generico = $data['papel_generico'];
|
||||
$gramaje = $data['gramaje'];
|
||||
$cliente_id = $data['cliente_id'];
|
||||
$paginas_color = $data['paginas_color'];
|
||||
|
||||
$paginas = (object) array(
|
||||
'negro' => $datosPedido->paginas - $paginas_color,
|
||||
'color' => $paginas_color
|
||||
);
|
||||
|
||||
$linea_rotativa = [];
|
||||
|
||||
for ($i = 0; $i < 2; $i++) {
|
||||
|
||||
$datosPedido->a_favor_fibra = $i;
|
||||
|
||||
$lineas = PresupuestoService::obtenerComparadorRotativa([
|
||||
'paginas' => $paginas,
|
||||
'datosPedido' => $datosPedido,
|
||||
'papel_generico' => $papel_generico,
|
||||
'gramaje' => $gramaje,
|
||||
'cliente_id' => $cliente_id,
|
||||
'datosTipolog' => null
|
||||
]);
|
||||
|
||||
if (count($lineas) > 0) {
|
||||
$linea_rotativa = array_merge($linea_rotativa, $lineas);
|
||||
}
|
||||
}
|
||||
if (count($linea_rotativa) > 0) {
|
||||
|
||||
usort(
|
||||
$linea_rotativa,
|
||||
function ($a, $b) {
|
||||
$result = 0;
|
||||
if (floatval($a['fields']['total_impresion']) > floatval($b['fields']['total_impresion']))
|
||||
$result = 1;
|
||||
else if (floatval($a['fields']['total_impresion']) < floatval($b['fields']['total_impresion']))
|
||||
$result = -1;
|
||||
return $result;
|
||||
}
|
||||
);
|
||||
$linea_rotativa = $linea_rotativa[0]['fields'];
|
||||
$linea_rotativa['tipo_linea'] = $paginas_color > 0 ? 'lp_rot_color' : 'lp_rot_bn';
|
||||
}
|
||||
|
||||
return $linea_rotativa;
|
||||
}
|
||||
}
|
||||
@ -33,7 +33,7 @@ class PresupuestoService extends BaseService
|
||||
const SANGRE_FORMAS = 5.0;
|
||||
const SANGRE_FORMAS_CUBIERTA = 20.0;
|
||||
|
||||
|
||||
|
||||
public static function getLineaPresupuestoPlana($data)
|
||||
{
|
||||
|
||||
|
||||
@ -0,0 +1,94 @@
|
||||
<div class="col-12 pb-2">
|
||||
|
||||
<input hidden readonly style="background: #E8E8E8;" id="id" name="id" maxLength="12" class="form-control" value="<?= old('id', $presupuestoEntity->id) ?>">
|
||||
|
||||
<div class="row g-2">
|
||||
|
||||
<div class="col-sm-6 mb-3">
|
||||
<label for="titulo" class="form-label">
|
||||
<?=lang('Presupuestos.titulo') ?>*
|
||||
</label>
|
||||
<input type="text" id="titulo" name="titulo" maxLength="300" class="form-control" value="<?=old('titulo', $presupuestoEntity->titulo) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="col-sm-6 mb-3">
|
||||
<label for="autor" class="form-label">
|
||||
<?=lang('Presupuestos.autor') ?>
|
||||
</label>
|
||||
<input type="text" id="autor" name="autor" maxLength="150" class="form-control" value="<?=old('autor', $presupuestoEntity->autor) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="col-sm-6 mb-3">
|
||||
<label for="coleccion" class="form-label">
|
||||
<?=lang('Presupuestos.coleccion') ?>
|
||||
</label>
|
||||
<input type="text" id="coleccion" name="coleccion" maxLength="255" class="form-control" value="<?=old('coleccion', $presupuestoEntity->coleccion) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="col-sm-6 mb-3">
|
||||
<label for="numeroEdicion" class="form-label">
|
||||
<?=lang('Presupuestos.numeroEdicion') ?>
|
||||
</label>
|
||||
<input type="text" id="numeroEdicion" name="numero_edicion" maxLength="50" class="form-control" value="<?=old('numero_edicion', $presupuestoEntity->numero_edicion) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
|
||||
<div class="col-sm-6 mb-3">
|
||||
<label for="numeroEdicion" class="form-label">
|
||||
<?=lang('Presupuestos.numeroEdicion') ?>
|
||||
</label>
|
||||
<input type="text" id="numeroEdicion" name="numero_edicion" maxLength="50" class="form-control" value="<?=old('numero_edicion', $presupuestoEntity->numero_edicion) ?>">
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6 mb-3">
|
||||
<label for="isbn" class="form-label">
|
||||
<?=lang('Presupuestos.isbn') ?>
|
||||
</label>
|
||||
<input type="text" id="isbn" name="isbn" maxLength="50" class="form-control" value="<?=old('isbn', $presupuestoEntity->isbn) ?>">
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6 mb-3">
|
||||
<label for="paisId" class="form-label">
|
||||
<?=lang('Presupuestos.paisId') ?>*
|
||||
</label>
|
||||
<select id="paisId" name="pais_id" class="form-control select2bs" style="width: 100%;" >
|
||||
<?php foreach ($datosPresupuesto->paisList as $item) : ?>
|
||||
<option value="<?=$item->id ?>"<?=$item->id==$presupuestoEntity->pais_id ? ' selected':'' ?>>
|
||||
<?=$item->nombre ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<hr> <!-- Separador -->
|
||||
|
||||
|
||||
<div class="col-sm-6 mb-3">
|
||||
<label for="clienteId" class="form-label">
|
||||
<?= lang('Presupuestos.clienteId') ?>*
|
||||
</label>
|
||||
<select id="clienteId" name="clienteId" class="form-control select2bs2" style="width: 100%;">
|
||||
|
||||
<?php if (isset($datosPresupuesto->clienteList) && is_array($datosPresupuesto->clienteList) && !empty($datosPresupuesto->clienteList)) :
|
||||
foreach ($datosPresupuesto->clienteList as $k => $v) : ?>
|
||||
<option value="<?= $k ?>" <?= $k == $presupuestoEntity->cliente_id ? ' selected' : '' ?>>
|
||||
<?= $v ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-sm-6 mb-3">
|
||||
<label for="referenciaCliente" class="form-label">
|
||||
<?=lang('Presupuestos.referenciaCliente') ?>
|
||||
</label>
|
||||
<input type="text" id="referenciaCliente" name="referencia_cliente" maxLength="100" class="form-control" value="<?=old('referencia_cliente', $presupuestoEntity->referencia_cliente) ?>">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div><!--//.col -->
|
||||
|
||||
|
||||
@ -0,0 +1,574 @@
|
||||
<div class="col-12 pb-2">
|
||||
|
||||
<input hidden readonly style="background: #E8E8E8;" id="id" name="id" maxLength="12" class="form-control" value="<?= old('id', $presupuestoEntity->id) ?>">
|
||||
|
||||
<div class="row g-2">
|
||||
|
||||
<h3 id="tituloDisenioLibro">Fresado</h3>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12 mb-3">
|
||||
<label for="titulo" class="form-label">
|
||||
<?= lang('Presupuestos.titulo') ?>*
|
||||
</label>
|
||||
<input type="text" id="titulo" name="titulo" maxLength="300" class="form-control" value="<?= old('titulo', $presupuestoEntity->titulo) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-6 mb-3">
|
||||
<label for="clienteId" class="form-label">
|
||||
<?= lang('Presupuestos.clienteId') ?>*
|
||||
</label>
|
||||
<select id="clienteId" name="clienteId" class="form-control select2bs2" style="width: 100%;">
|
||||
|
||||
<?php if (isset($datosPresupuesto->clienteList) && is_array($datosPresupuesto->clienteList) && !empty($datosPresupuesto->clienteList)) :
|
||||
foreach ($datosPresupuesto->clienteList as $k => $v) : ?>
|
||||
<option value="<?= $k ?>" <?= $k == $presupuestoEntity->cliente_id ? ' selected' : '' ?>>
|
||||
<?= $v ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-sm-6 mb-3">
|
||||
<label for="referenciaCliente" class="form-label">
|
||||
<?= lang('Presupuestos.referenciaCliente') ?>
|
||||
</label>
|
||||
<input type="text" id="referenciaCliente" name="referencia_cliente" maxLength="100" class="form-control" value="<?= old('referencia_cliente', $presupuestoEntity->referencia_cliente) ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="tapaDiv" class="row mt-3">
|
||||
|
||||
<div class="col-sm-3 mb-md-0 mb-2" id="tapaBlandaDiv">
|
||||
<div id="tapaBlandaInnerDiv" class="form-check custom-option custom-option-tapa custom-option-basic checked">
|
||||
<label class="form-check-label custom-option-content" for="tapaBlanda">
|
||||
<input name="tapaBlanda" class="form-check-input elementos-libro calcular-presupuesto" type="radio" value="" id="tapaBlanda" checked="">
|
||||
<span class="custom-option-header">
|
||||
<span class="h6 mb-0">Tapa blanda</span>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tapaDuraDiv" class="col-sm-3 mb-md-0 mb-2">
|
||||
<div class="form-check custom-option custom-option-tapa custom-option-basic">
|
||||
<label class="form-check-label custom-option-content" for="tapaDura">
|
||||
<input name="tapaDura" class="form-check-input elementos-libro calcular-presupuesto" type="radio" value="" id="tapaDura">
|
||||
<span class="custom-option-header">
|
||||
<span class="h6 mb-0">Tapa Dura</span>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div> <!--//.row -->
|
||||
|
||||
<div class="divider divider-dark text-start mb-1">
|
||||
<div class="divider-text">
|
||||
<h5>Datos presupuesto</h5>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-3 mb-3">
|
||||
<label for="tirada" class="form-label">
|
||||
<?= lang('Presupuestos.tirada') ?> 1
|
||||
</label>
|
||||
<input type="number" class="calcular-presupuesto" id="tirada" name="tirada" maxLength="8" step="1" class="form-control" value="<?= old(0, $presupuestoEntity->tirada) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="col-sm-3 mb-3">
|
||||
<label for="tirada2" class="form-label">
|
||||
<?= lang('Presupuestos.tirada') ?> 2
|
||||
</label>
|
||||
<input type="number" class="calcular-presupuesto" id="tirada2" name="tirada2" maxLength="8" step="1" class="form-control" value="<?= old(0, $presupuestoEntity->tirada2) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="col-sm-3 mb-3">
|
||||
<label for="tirada3" class="form-label">
|
||||
<?= lang('Presupuestos.tirada') ?> 3
|
||||
</label>
|
||||
<input type="number" class="calcular-presupuesto" id="tirada3" name="tirada3" maxLength="8" step="1" class="form-control" value="<?= old(0, $presupuestoEntity->tirada3) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="col-sm-3 mb-3">
|
||||
<label for="tirada4" class="form-label">
|
||||
<?= lang('Presupuestos.tirada') ?> 4
|
||||
</label>
|
||||
<input type="number" class="calcular-presupuesto" id="tirada4" name="tirada4" maxLength="8" step="1" class="form-control" value="<?= old(0, $presupuestoEntity->tirada4) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div> <!--//.row -->
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-3 mb-3">
|
||||
<label for="paginas" class="form-label">
|
||||
<?= lang('Presupuestos.paginas') ?>
|
||||
</label>
|
||||
<input type="number" class="calcular-presupuesto" id="paginas" name="paginas" maxLength="8" step="1" class="form-control" value="<?= old(0, $presupuestoEntity->paginas) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div> <!--//.row -->
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div id="tamanioLibroDiv" class="col-sm-3 mb-3" <?= $presupuestoEntity->papel_formato_personalizado == false ? '' : 'style="display: none"'; ?>>
|
||||
<label id="label_papelFormatoId" for="papelFormatoId" class="form-label">
|
||||
Tamaño Libro*
|
||||
</label>
|
||||
|
||||
<select id="papelFormatoId" name="papel_formato_id" tabindex="3" class="form-control select2bs2 calcular-presupuesto" style="width: 100%;">
|
||||
|
||||
<?php if (isset($datosPresupuesto->papelFormatoList) && is_array($datosPresupuesto->papelFormatoList) && !empty($datosPresupuesto->papelFormatoList)) :
|
||||
foreach ($datosPresupuesto->papelFormatoList as $formato) : ?>
|
||||
<option value="<?= $formato->id ?>" <?= $formato->id == $presupuestoEntity->papel_formato_id ? ' selected' : '' ?>>
|
||||
<?= $formato->tamanio ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div id="anchoLibroDiv" class="col-sm-3 mb-3" <?= $presupuestoEntity->papel_formato_personalizado == true ? '' : 'style="display: none"'; ?>>
|
||||
<div class="mb-1">
|
||||
<label class="form-label" for="papelFormatoAncho">Ancho Libro</label>
|
||||
<input type="number" id="papelFormatoAncho" name="papel_formato_ancho" maxLength="8" step="1" class="form-control formato_libro calcular-presupuesto" value="<?= old('papel_formato_ancho', $presupuestoEntity->papel_formato_ancho) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
<div id="altoLibroDiv" class="col-sm-3 mb-3" <?= $presupuestoEntity->papel_formato_personalizado == true ? '' : 'style="display: none"'; ?>>
|
||||
<div class="mb-1">
|
||||
<label class="form-label" for="papelFormatoAlto">Alto Libro</label>
|
||||
<input type="number" id="papelFormatoAlto" name="papel_formato_alto" maxLength="8" step="1" class="form-control formato_libro calcular-presupuesto" value="<?= old('papel_formato_alto', $presupuestoEntity->papel_formato_alto) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
<div class="col-sm-3 mb-3 d-flex align-items-end">
|
||||
<div class="form-check form-switch mb-2">
|
||||
<input class="form-check-input" type="checkbox" id="papelFormatoPersonalizado" name="papel_formato_personalizado" value="1" <?= $presupuestoEntity->papel_formato_personalizado == true ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label" for="papelFormatoPersonalizado"><?= lang('Presupuestos.papelFormatoPersonalizado') ?></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div> <!--//.row -->
|
||||
|
||||
<div class="divider divider-dark text-start mb-1">
|
||||
<div class="divider-text">
|
||||
<h5>Interior</h5>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="errorInterior" class="fv-plugins-message-container invalid-feedback" style="display: none;">
|
||||
<div>No existe combinación con las opciones seleccionadas. Pruebe con otro papel/gramaje</div>
|
||||
</div>
|
||||
|
||||
<h6> Color del interior </h6>
|
||||
<div class="row">
|
||||
|
||||
<div class="col col-sm-2 d-flex justify-content-center">
|
||||
<div id="colorNegroDiv" class="form-check change-tipo-impresion custom-option-color custom-option custom-option-image custom-option-image-radio">
|
||||
<label class="form-check-label custom-option-content" for="colorNegro">
|
||||
<span class="custom-option-body">
|
||||
<img style="height:120px;width:120px" src="<?= site_url("assets/img/grises.png") ?>" alt="">
|
||||
</span>
|
||||
</label>
|
||||
<input name="colorNegro" class="form-check-input calcular-presupuesto" type="radio" value="colorNegro" id="colorNegro" checked="">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col col-sm-2 d-flex justify-content-center">
|
||||
<div id="colorColorDiv" class="form-check change-tipo-impresion custom-option-color custom-option custom-option-image custom-option-image-radio">
|
||||
<label class="form-check-label custom-option-content" for="colorColor">
|
||||
<span class="custom-option-body">
|
||||
<img style="height:120px;width:120px" src="<?= site_url("assets/img//gamacolor.png") ?>" alt="">
|
||||
</span>
|
||||
</label>
|
||||
<input name="colorColor" class="form-check-input calcular-presupuesto" type="radio" value="colorColor" id="colorColor">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div> <!--//.row -->
|
||||
|
||||
<div id="pagColorDiv" class="row">
|
||||
<div class="col-sm-3 mb-3">
|
||||
<label for="paginasColor" class="form-label">
|
||||
Páginas a color
|
||||
</label>
|
||||
<input type="number" class="calcular-presupuesto" id="paginasColor" name="paginasColor" maxLength="8" step="1" class="form-control" value="">
|
||||
</div><!--//.mb-3 -->
|
||||
</div>
|
||||
|
||||
<h6> Calidad </h6>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-3 mb-md-0 mb-2">
|
||||
<div id="calidadEstandarDiv" class="form-check change-tipo-impresion custom-option custom-option-calidad custom-option-basic checked">
|
||||
<label class="form-check-label custom-option-content" for="calidadEstandar">
|
||||
<input name="calidadEstandar" class="form-check-input calcular-presupuesto" type="radio" value="" id="calidadEstandar" checked="">
|
||||
<span class="custom-option-header">
|
||||
<span class="h6 mb-0">Estándar</span>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<div id="calidadPremiumDiv" class="form-check change-tipo-impresion custom-option custom-option-calidad custom-option-basic">
|
||||
<label class="form-check-label custom-option-content" for="calidadPremium">
|
||||
<input name="calidadPremium" class="form-check-input calcular-presupuesto" type="radio" value="" id="calidadPremium">
|
||||
<span class="custom-option-header">
|
||||
<span class="h6 mb-0">Premium</span>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div> <!--//.row -->
|
||||
|
||||
<h6> Papel </h6>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-4 mb-md-0 mb-2">
|
||||
<label for="papelInterior" class="form-label">Tipo de papel</label>
|
||||
<select id="papelInterior" name="papelInterior" class="form-control select2bs2 calcular-presupuesto" style="width: 100%;"></select>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-2 mb-md-0 mb-2">
|
||||
<label for="gramajeInterior" class="form-label">Gramaje (g/m2)</label>
|
||||
<select id="gramajeInterior" name="gramajeInterior" class="form-control select2bs2 calcular-presupuesto" style="width: 100%;">
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<h6> Opciones extra </h6>
|
||||
<div class="row">
|
||||
<div class="col-sm-3 mb-3 d-flex align-items-end">
|
||||
<div class="form-check form-switch mb-2">
|
||||
<input class="form-check-input calcular-presupuesto" type="checkbox" id="excluirRotativa" name="excluir_rotativa" value="0" <?= $presupuestoEntity->excluir_rotativa == true ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label" for="excluirRotativa">Excluir rotativa</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--SECCION DE CUBIERTA -->
|
||||
<div class="divider divider-dark text-start mb-1">
|
||||
<div class="divider-text">
|
||||
<h5>Cubierta</h5>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="errorCubierta" class="fv-plugins-message-container invalid-feedback" style="display: none;">
|
||||
<div>No existe combinación con las opciones seleccionadas. Pruebe con otro papel/gramaje</div>
|
||||
</div>
|
||||
|
||||
<h6> Papel </h6>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-4 mb-md-0 mb-2">
|
||||
<label for="papelCubierta" class="form-label">Tipo de papel</label>
|
||||
<select id="papelCubierta" name="papelCubierta" class="form-control select2bs2 calcular-presupuesto" style="width: 100%;">
|
||||
<?php if (isset($datosPresupuesto->papelCubierta) && is_array($datosPresupuesto->papelCubierta) && !empty($datosPresupuesto->papelCubierta)) :
|
||||
foreach ($datosPresupuesto->papelCubierta as $k => $v) : ?>
|
||||
<option value="<?= $v->id ?>">
|
||||
<?= $v->nombre ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-2 mb-md-0 mb-2">
|
||||
<label for="gramajeCubierta" class="form-label">Gramaje (g/m2)</label>
|
||||
<select id="gramajeCubierta" name="gramajeCubierta" class="form-control select2bs2 calcular-presupuesto" style="width: 100%;">
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-4 mb-md-0 mb-2">
|
||||
<label for="carasCubierta" class="form-label">Caras impresas cubierta</label>
|
||||
<select id="carasCubierta" name="carasCubierta" class="form-control select2bs2 calcular-presupuesto" style="width: 100%;">
|
||||
<option value="2">
|
||||
<p><?= lang('Presupuestos.unaCara') ?></p>
|
||||
</option>
|
||||
<option value="4">
|
||||
<p><?= lang('Presupuestos.dosCaras') ?></p>
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<h6 class='solapas-cubierta'> Opciones extra </h6>
|
||||
|
||||
<div class="row solapas-cubierta">
|
||||
|
||||
<div class="col-sm-3 mb-md-0 mb-2 d-flex align-items-end">
|
||||
<div class="form-check form-switch mb-2">
|
||||
<input class="form-check-input calcular-presupuesto" type="checkbox" id="solapasCubierta" name="solapasCubierta" value="0">
|
||||
<label class="form-check-label" for="solapasCubierta">Solapas cubierta</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="tamanioSolapasCubierta" class="col-sm-3 mb-md-0 mb-2" style="display: none;">
|
||||
<label for="anchoSolapasCubierta" class="form-label">Tamaño</label>
|
||||
<input type="number" id="anchoSolapasCubierta" name="anchoSolapasCubierta" maxLength="8" step="1" class="form-control calcular-presupuesto" value="">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-4 mb-md-0 mb-2">
|
||||
<label for="acabadosCubierta" class="form-label">Acabados cubierta</label>
|
||||
<select id="acabadosCubierta" name="acabadosCubierta" class="form-control select2bs2 calcular-presupuesto" style="width: 100%;">
|
||||
<?php if (isset($datosPresupuesto->acabadosCubierta) && is_array($datosPresupuesto->acabadosCubierta) && !empty($datosPresupuesto->acabadosCubierta)) :
|
||||
foreach ($datosPresupuesto->acabadosCubierta as $acabado) : ?>
|
||||
<option value="<?= $acabado->id ?>" <?= $acabado->id == $presupuestoEntity->acabado_cubierta_id ? ' selected' : '' ?>>
|
||||
<?= $acabado->label ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!--SECCION DE SOBRECUBIERTA -->
|
||||
<div class="divider divider-dark text-start mb-1 sobrecubierta">
|
||||
<div class="divider-text">
|
||||
<h5>Sobrecubierta</h5>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="errorSobrecubierta" class="fv-plugins-message-container invalid-feedback" style="display: none;">
|
||||
<div>No existe combinación con las opciones seleccionadas. Pruebe con otro papel/gramaje</div>
|
||||
</div>
|
||||
|
||||
<div class="row sobrecubierta">
|
||||
<div class="col-sm-3 mb-md-0 mb-2 d-flex align-items-end">
|
||||
<div class="form-check form-switch mb-2">
|
||||
<input class="form-check-input" type="checkbox" id="enableSobrecubierta" name="enableSobrecubierta" value="0">
|
||||
<label class="form-check-label" for="enableSobrecubierta">Añadir sobrecubierta</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h6 class="sobrecubierta enable-sobrecubierta" style="display: none;"> Papel </h6>
|
||||
<div class="row sobrecubierta enable-sobrecubierta">
|
||||
|
||||
<div class="col-sm-4 mb-md-0 mb-2">
|
||||
<label for="papelSobrecubierta" class="form-label">Tipo de papel</label>
|
||||
<select id="papelSobrecubierta" name="papelSobrecubierta" class="form-control select2bs2 calcular-presupuesto input-sobrecubierta" style="width: 100%;">
|
||||
<?php if (isset($datosPresupuesto->papelSobrecubierta) && is_array($datosPresupuesto->papelSobrecubierta) && !empty($datosPresupuesto->papelSobrecubierta)) :
|
||||
foreach ($datosPresupuesto->papelSobrecubierta as $k => $v) : ?>
|
||||
<option value="<?= $v->id ?>">
|
||||
<?= $v->nombre ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-2 mb-md-0 mb-2">
|
||||
<label for="gramajeSobrecubierta" class="form-label">Gramaje (g/m2)</label>
|
||||
<select id="gramajeSobrecubierta" name="gramajeSobrecubierta" class="form-control select2bs2 calcular-presupuesto input-sobrecubierta" style="width: 100%;">
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<h6 class="sobrecubierta enable-sobrecubierta" style="display: none;"> Opciones extra </h6>
|
||||
|
||||
<div class="row sobrecubierta enable-sobrecubierta" style="display: none;">
|
||||
|
||||
<div class="col-sm-3 mb-md-0 mb-2 d-flex align-items-end">
|
||||
<div class="form-check form-switch mb-2">
|
||||
<input class="form-check-input calcular-presupuesto input-sobrecubierta" type="checkbox" id="solapasSobrecubierta" name="solapasSobrecubierta" value="0">
|
||||
<label class="form-check-label" for="solapasSobrecubierta">Solapas sobrecubierta</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="tamanioSolapasSobrecubierta" class="col-sm-3 mb-md-0 mb-2" style="display: none;">
|
||||
<label for="anchoSolapasSobrecubierta" class="form-label">Tamaño</label>
|
||||
<input type="number" id="anchoSolapasSobrecubierta" name="anchoSolapasSobrecubierta" maxLength="8" step="1" class="form-control input-sobrecubierta calcular-presupuesto" value="">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row sobrecubierta enable-sobrecubierta" style="display: none;">
|
||||
|
||||
<div class="col-sm-4 mb-md-0 mb-2">
|
||||
<label for="acabadosSobrecubierta" class="form-label">Acabados sobrecubierta</label>
|
||||
<select id="acabadosSobrecubierta" name="acabadosSobrecubierta" class="form-control select2bs2 calcular-presupuesto" style="width: 100%;">
|
||||
<?php if (isset($datosPresupuesto->acabadosSobrecubierta) && is_array($datosPresupuesto->acabadosSobrecubierta) && !empty($datosPresupuesto->acabadosSobrecubierta)) :
|
||||
foreach ($datosPresupuesto->acabadosSobrecubierta as $acabado) : ?>
|
||||
<option value="<?= $acabado->id ?>" <?= $acabado->id == $presupuestoEntity->acabado_sobrecubierta_id ? ' selected' : '' ?>>
|
||||
<?= $acabado->label ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!--SECCION DE GUARDAS -->
|
||||
<div class="divider divider-dark text-start mb-1 guardas">
|
||||
<div class="divider-text">
|
||||
<h5>Guardas</h5>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="errorGuardas" class="fv-plugins-message-container invalid-feedback" style="display: none;">
|
||||
<div>No existe combinación con las opciones seleccionadas. Pruebe con otro papel/gramaje</div>
|
||||
</div>
|
||||
|
||||
<div class="row guardas">
|
||||
<div class="col-sm-4 mb-md-0 mb-2">
|
||||
<label for="impresionGuardas" class="form-label">Impresión de guardas</label>
|
||||
<select id="impresionGuardas" name="impresionGuardas" class="form-control select2bs2 comp_guardas_items calcular-presupuesto" style="width: 100%;">
|
||||
<option value="0">
|
||||
<p><?= lang('Presupuestos.sinImpresion') ?></p>
|
||||
</option>
|
||||
<option value="4">
|
||||
<p><?= lang('Presupuestos.unaCara') ?></p>
|
||||
</option>
|
||||
<option value="8">
|
||||
<p><?= lang('Presupuestos.dosCaras') ?></p>
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row guardas">
|
||||
<div class="col-sm-4 mb-md-0 mb-2">
|
||||
<label for="papelGuardas" class="form-label">Tipo de papel</label>
|
||||
<select id="papelGuardas" name="papelGuardas" class="form-control select2bs2 calcular-presupuesto" style="width: 100%;">
|
||||
<?php if (isset($datosPresupuesto->papelGuardas) && is_array($datosPresupuesto->papelGuardas) && !empty($datosPresupuesto->papelGuardas)) :
|
||||
foreach ($datosPresupuesto->papelGuardas as $k => $v) : ?>
|
||||
<option value="<?= $v->id ?>">
|
||||
<?= $v->nombre ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!--SECCION DE SERVICIOS EXTRA -->
|
||||
<div class="divider divider-dark text-start mb-1">
|
||||
<div class="divider-text">
|
||||
<h5>Servicios Extra</h5>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-12 col-lg-3 px-4">
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<label for="retractilado" class="form-check-label">
|
||||
<input type="checkbox" id="retractilado" name="retractilado" serv_id="3" value="1" class="form-check-input servicio-extra calcular-presupuesto" <?= $presupuestoEntity->retractilado == true ? 'checked' : ''; ?>>
|
||||
<?= lang('Presupuestos.retractilado') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
<div class="col-md-12 col-lg-3 px-4">
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<label for="retractilado5" class="form-check-label">
|
||||
<input type="checkbox" id="retractilado5" name="retractilado_5" serv_id="5" value="1" class="form-check-input servicio-extra calcular-presupuesto" <?= $presupuestoEntity->retractilado5 == true ? 'checked' : ''; ?>>
|
||||
<?= lang('Presupuestos.retractilado5') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
|
||||
<div class="col-md-12 col-lg-3 px-4">
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<label for="fajaColor" class="form-check-label">
|
||||
<input type="checkbox" id="fajaColor" name="faja_color" value="1" serv_id="16" class="form-check-input servicio-extra calcular-presupuesto" <?= $presupuestoEntity->faja_color == true ? 'checked' : ''; ?>>
|
||||
<?= lang('Presupuestos.fajaColor') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
<div class="col-md-12 col-lg-3 px-4">
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<label for="prototipo" class="form-check-label">
|
||||
<input type="checkbox" id="prototipo" name="prototipo" value="1" serv_id="9" class="form-check-input servicio-extra calcular-presupuesto" <?= $presupuestoEntity->prototipo == true ? 'checked' : ''; ?>>
|
||||
<?= lang('Presupuestos.prototipo') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
<div class="mb-3">
|
||||
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
<div class="col-md-12 col-lg-3 px-4">
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<label for="ferro" class="form-check-label">
|
||||
<input type="checkbox" id="ferro" name="ferro" value="1" serv_id="24" class="form-check-input servicio-extra calcular-presupuesto" <?= $presupuestoEntity->ferro == true ? 'checked' : ''; ?>>
|
||||
<?= lang('Presupuestos.ferro') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
</div><!--//.row -->
|
||||
|
||||
<!--SECCION DE OTRAS OPCIONES -->
|
||||
<div class="divider divider-dark text-start mb-1">
|
||||
<div class="divider-text">
|
||||
<h5>Otras opciones</h5>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-2 mb-md-0 mb-2">
|
||||
<label for="ivaReducido" class="form-label">I.V.A. reducido</label>
|
||||
<select id="ivaReducido" name="ivaReducido" class="form-control select2bs2 calcular-presupuesto" style="width: 100%;">
|
||||
<option value="1">
|
||||
<p><?= lang('SI') ?></p>
|
||||
</option>
|
||||
<option value="0">
|
||||
<p><?= lang('NO') ?></p>
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<p class="mt-2">Se verificará que el pedido cumpla con los requisitos establecidos en el Artículo 91 de la Ley 37/1992, sobre inserción de publicidad, antes de proceder con su producción, lo que garantiza la aplicación del IVA reducido del 4%.</p>
|
||||
</div>
|
||||
|
||||
</div><!--//.col -->
|
||||
</div>
|
||||
|
||||
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
window.routes_disenio_libro = {
|
||||
obtenerGramaje: "<?= route_to('obtenerGramaje') ?>",
|
||||
presupuestoCliente: "<?= route_to('presupuestoCliente') ?>",
|
||||
}
|
||||
<?= $this->endSection() ?>
|
||||
@ -0,0 +1,100 @@
|
||||
<div class="col-12 pb-2">
|
||||
<div class="tipo_libro">
|
||||
<div class="row row-cols-3 mb-6 d-flex justify-content-center d-flex justify-content-center">
|
||||
|
||||
<div class="container col-md-4 mb-6 d-flex justify-content-center" style="margin-bottom: 40px;">
|
||||
<div>
|
||||
<div style="max-width:200px;max-height:200px;padding-right:0px" id="cosidoDiv"
|
||||
class="form-check checked custom-option-tipo custom-option custom-option-image custom-option-image-radio">
|
||||
<label style="max-width:200px;max-height:200px;" class="form-check-label custom-option-content"
|
||||
for="tipoCosido">
|
||||
<span class="custom-option-body">
|
||||
<img style="max-width:200px;max-height:200px;"
|
||||
src="<?= site_url("assets/img/libro_cosido.png") ?>" alt="radioImg">
|
||||
</span>
|
||||
</label>
|
||||
<input name="cosido" class="form-check-input elementos-libro calcular-presupuesto" type="radio" value="tipoCosido"
|
||||
id="tipoCosido" checked="">
|
||||
</div>
|
||||
<h4 class="text-center">Rústica cosido</h4>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container col-md-4 mb-6 d-flex justify-content-center" style="margin-bottom: 40px;">
|
||||
<div>
|
||||
<div style="max-width:200px;max-height:200px;padding-right:0px" id="fresadoDiv"
|
||||
class="form-check custom-option-tipo custom-option custom-option-image custom-option-image-radio">
|
||||
<label style="max-width:200px;max-height:200px;" class="form-check-label custom-option-content"
|
||||
for="tipoFresado">
|
||||
<span class="custom-option-body">
|
||||
<img style="max-width:200px;max-height:200px;"
|
||||
src="<?= site_url("assets/img/libro_fresado.png") ?>" alt="radioImg2">
|
||||
</span>
|
||||
</label>
|
||||
<input name="fresado" class="form-check-input elementos-libro calcular-presupuesto" type="radio" value="tipoFresado"
|
||||
id="tipoFresado">
|
||||
</div>
|
||||
<h4 class="text-center">Rústica fresado</h4>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container col-md-4 mb-6 d-flex justify-content-center" style="margin-bottom: 40px;">
|
||||
<div>
|
||||
<div style="max-width:200px;max-height:200px;padding-right:0px" id="grapadoDiv"
|
||||
class="form-check custom-option-tipo custom-option custom-option-image custom-option-image-radio">
|
||||
<label style="max-width:200px;max-height:200px;" class="form-check-label custom-option-content"
|
||||
for="tipoGrapado">
|
||||
<span class="custom-option-body">
|
||||
<img style="max-width:200px;max-height:200px;"
|
||||
src="<?= site_url("assets/img/libro_grapado.png") ?>" alt="radioImg3">
|
||||
</span>
|
||||
</label>
|
||||
<input name="grapado" class="form-check-input elementos-libro calcular-presupuesto" type="radio" value="tipoGrapado"
|
||||
id="tipoGrapado">
|
||||
</div>
|
||||
<h4 class="text-center">Cosido con grapas</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row row-cols-3 d-flex justify-content-center d-flex justify-content-center"
|
||||
style="margin-bottom: 40px;">
|
||||
<div class="col-md-4 mb-6 d-flex justify-content-center">
|
||||
<div>
|
||||
<div style="max-width:200px;max-height:200px;padding-right:0px" id="espiralDiv"
|
||||
class="form-check custom-option-tipo custom-option custom-option-image custom-option-image-radio">
|
||||
<label style="max-width:200px;max-height:200px;" class="form-check-label custom-option-content"
|
||||
for="tipoEspiral">
|
||||
<span class="custom-option-body">
|
||||
<img style="max-width:200px;max-height:200px;"
|
||||
src="<?= site_url("assets/img/libro_espiral.png") ?>" alt="radioImg4">
|
||||
</span>
|
||||
</label>
|
||||
<input name="espiral" class="form-check-input elementos-libro calcular-presupuesto" type="radio" value="tipoEspiral"
|
||||
id="tipoEspiral">
|
||||
</div>
|
||||
<h4 class="text-center">Espiral</h4>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4 mb-6 d-flex justify-content-center" style="margin-bottom: 40px;">
|
||||
<div>
|
||||
<div style="max-width:200px;max-height:200px;padding-right:0px" id="wireoDiv"
|
||||
class="form-check custom-option-tipo custom-option custom-option-image custom-option-image-radio">
|
||||
<label style="max-width:200px;max-height:200px;" class="form-check-label custom-option-content"
|
||||
for="tipoWireO">
|
||||
<span class="custom-option-body">
|
||||
<img style="max-width:200px;max-height:200px;"
|
||||
src="<?= site_url("assets/img/libro_wire-o.png") ?>" alt="radioImg5">
|
||||
</span>
|
||||
</label>
|
||||
<input name="wireo" class="form-check-input elementos-libro calcular-presupuesto" type="radio" value="tipoWireO"
|
||||
id="tipoWireO">
|
||||
</div>
|
||||
<h4 class="text-center">Wire-o</h4>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -0,0 +1,714 @@
|
||||
$('#papelFormatoPersonalizado').on('change', function () {
|
||||
if ($(this).is(":checked")) {
|
||||
$('#tamanioLibroDiv').hide();
|
||||
$('#anchoLibroDiv').show();
|
||||
$('#altoLibroDiv').show();
|
||||
$('#papelFormatoId').val('');
|
||||
} else {
|
||||
$('#tamanioLibroDiv').show();
|
||||
$('#anchoLibroDiv').hide();
|
||||
$('#altoLibroDiv').hide();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Init custom option check
|
||||
function initTapaCheck() {
|
||||
const _this = this
|
||||
|
||||
const tapaOptionList = [].slice.call(document.querySelectorAll('.custom-option-tapa .form-check-input'))
|
||||
tapaOptionList.map(function (customOptionEL) {
|
||||
// Update custom options check on page load
|
||||
_this.updateTapaCheck(customOptionEL)
|
||||
|
||||
// Update custom options check on click
|
||||
customOptionEL.addEventListener('click', e => {
|
||||
_this.updateTapaCheck(customOptionEL)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function updateTapaCheck(el) {
|
||||
if (el.checked) {
|
||||
// If custom option element is radio, remove checked from the siblings (closest `.row`)
|
||||
if (el.type === 'radio') {
|
||||
const customRadioOptionList = [].slice.call(el.closest('.row').querySelectorAll('.custom-option-tapa'))
|
||||
customRadioOptionList.map(function (customRadioOptionEL) {
|
||||
customRadioOptionEL.closest('.custom-option-tapa').classList.remove('checked')
|
||||
})
|
||||
}
|
||||
el.closest('.custom-option-tapa').classList.add('checked')
|
||||
if (el.closest('.custom-option-tapa').id == 'tapaBlandaInnerDiv') {
|
||||
$('#tapaBlanda').prop('checked', true);
|
||||
$('#tapaDura').prop('checked', false);
|
||||
}
|
||||
else {
|
||||
$('#tapaBlanda').prop('checked', false);
|
||||
$('#tapaDura').prop('checked', true);
|
||||
}
|
||||
} else {
|
||||
el.closest('.custom-option-tapa').classList.remove('checked')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function initColorCheck() {
|
||||
const _this = this
|
||||
|
||||
const custopOptionList = [].slice.call(document.querySelectorAll('.custom-option-color .form-check-input'))
|
||||
custopOptionList.map(function (customOptionEL) {
|
||||
// Update custom options check on page load
|
||||
_this.updateColorCheck(customOptionEL)
|
||||
|
||||
// Update custom options check on click
|
||||
customOptionEL.addEventListener('click', e => {
|
||||
_this.updateColorCheck(customOptionEL)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function updateColorCheck(el) {
|
||||
if (el.checked) {
|
||||
// If custom option element is radio, remove checked from the siblings (closest `.row`)
|
||||
if (el.type === 'radio') {
|
||||
const customRadioOptionList = [].slice.call(el.closest('.row').querySelectorAll('.custom-option-color'))
|
||||
customRadioOptionList.map(function (customRadioOptionEL) {
|
||||
customRadioOptionEL.closest('.custom-option-color').classList.remove('checked')
|
||||
})
|
||||
}
|
||||
el.closest('.custom-option-color').classList.add('checked')
|
||||
if (el.closest('.custom-option-color').id == 'colorNegroDiv') {
|
||||
$('#colorNegro').prop('checked', true);
|
||||
$('#colorColor').prop('checked', false);
|
||||
}
|
||||
else {
|
||||
$('#colorNegro').prop('checked', false);
|
||||
$('#colorColor').prop('checked', true);
|
||||
}
|
||||
|
||||
} else {
|
||||
el.closest('.custom-option-color').classList.remove('checked')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function initCalidadCheck() {
|
||||
const _this = this
|
||||
|
||||
const calidadOptionList = [].slice.call(document.querySelectorAll('.custom-option-calidad .form-check-input'))
|
||||
calidadOptionList.map(function (customOptionEL) {
|
||||
// Update custom options check on page load
|
||||
_this.updateCalidadCheck(customOptionEL)
|
||||
|
||||
// Update custom options check on click
|
||||
customOptionEL.addEventListener('click', e => {
|
||||
_this.updateCalidadCheck(customOptionEL)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function updateCalidadCheck(el) {
|
||||
if (el.checked) {
|
||||
// If custom option element is radio, remove checked from the siblings (closest `.row`)
|
||||
if (el.type === 'radio') {
|
||||
const customRadioOptionList = [].slice.call(el.closest('.row').querySelectorAll('.custom-option-calidad'))
|
||||
customRadioOptionList.map(function (customRadioOptionEL) {
|
||||
customRadioOptionEL.closest('.custom-option-calidad').classList.remove('checked')
|
||||
})
|
||||
}
|
||||
el.closest('.custom-option-calidad').classList.add('checked')
|
||||
if (el.closest('.custom-option-calidad').id == 'calidadEstandarDiv') {
|
||||
$('#calidadEstandar').prop('checked', true);
|
||||
$('#calidadPremium').prop('checked', false);
|
||||
}
|
||||
else {
|
||||
$('#calidadEstandar').prop('checked', false);
|
||||
$('#calidadPremium').prop('checked', true);
|
||||
}
|
||||
} else {
|
||||
el.closest('.custom-option-calidad').classList.remove('checked')
|
||||
}
|
||||
}
|
||||
|
||||
$('#enableSobrecubierta').on('change', function () {
|
||||
if ($(this).is(":checked")) {
|
||||
$('.enable-sobrecubierta').show();
|
||||
} else {
|
||||
$('#gramajeSobrecubierta').val('').trigger('change');
|
||||
$('#paperSobrecubierta').val('').trigger('change');
|
||||
$('#acabadosSobrecubierta').val('').trigger('change');
|
||||
$('#solapasSobrecubierta').prop('checked', false).trigger('change');
|
||||
$('#tamanioSolapasSobrecubierta').val();
|
||||
$('.enable-sobrecubierta').hide();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function initDisenioLibro() {
|
||||
initTapaCheck();
|
||||
initColorCheck();
|
||||
initCalidadCheck();
|
||||
|
||||
$('.elementos-libro').trigger('change');
|
||||
$('.change-tipo-impresion').trigger('change');
|
||||
|
||||
$('#papelInterior').trigger('change');
|
||||
$('#papelCubierta').val('').trigger('change');
|
||||
$('#papelSobrecubierta').val('').trigger('change');
|
||||
|
||||
|
||||
|
||||
$('#enableSobrecubierta').trigger('change');
|
||||
}
|
||||
|
||||
$('.change-tipo-impresion').on('change', function () {
|
||||
|
||||
isColor = $('#colorNegroDiv').hasClass('checked') ? false : true;
|
||||
isHq = $('#calidadEstandarDiv').hasClass('checked') ? false : true;
|
||||
|
||||
//si es color hay que mostrar el numero de paginas a color
|
||||
if (isColor) {
|
||||
$('#pagColorDiv').show();
|
||||
$('#paginasColor').val('0');
|
||||
}
|
||||
else {
|
||||
$('#pagColorDiv').hide();
|
||||
$('#paginasColor').val('0');
|
||||
}
|
||||
|
||||
var data = [];
|
||||
|
||||
if (!isColor && !isHq) {
|
||||
data = window.datosPresupuesto.papelInteriorNegro;
|
||||
}
|
||||
else if (!isColor && isHq) {
|
||||
data = window.datosPresupuesto.papelInteriorNegroHq;
|
||||
}
|
||||
else if (isColor && !isHq) {
|
||||
data = window.datosPresupuesto.papelInteriorColor;
|
||||
}
|
||||
else if (isColor && isHq) {
|
||||
data = window.datosPresupuesto.papelInteriorColorHq;
|
||||
}
|
||||
|
||||
var dropdown = $("#papelInterior");
|
||||
dropdown.empty();
|
||||
$.each(data, function () {
|
||||
dropdown.append($("<option />").val(this.id).text(this.nombre));
|
||||
});
|
||||
//Se quita la seleccion del dropdown
|
||||
dropdown.val('').trigger('change');
|
||||
$('#gramajeInterior').val('').trigger('change');
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('#tirada').on('change', function () {
|
||||
|
||||
const valInterior = $('#gramajeInterior option:selected').val();
|
||||
const valCubierta = $('#gramajeCubierta option:selected').val();
|
||||
const valSobrecubierta = $('#gramajeSobrecubierta option:selected').val();
|
||||
|
||||
|
||||
$('#papelInterior').trigger('change');
|
||||
$('#papelCubierta').trigger('change');
|
||||
$('#papelSobrecubierta').trigger('change');
|
||||
});
|
||||
|
||||
|
||||
$('#papelInterior').on('change', function () {
|
||||
isColor = $('#colorNegroDiv').hasClass('checked') ? false : true;
|
||||
isHq = $('#calidadEstandarDiv').hasClass('checked') ? false : true;
|
||||
|
||||
if ($('#papelInterior option:selected').val() != undefined) {
|
||||
var uso = 'bn';
|
||||
|
||||
if (!isColor && !isHq) {
|
||||
uso = 'bn';
|
||||
}
|
||||
else if (!isColor && isHq) {
|
||||
uso = 'bnhq';
|
||||
}
|
||||
else if (isColor && !isHq) {
|
||||
uso = 'color';
|
||||
}
|
||||
else if (isColor && isHq) {
|
||||
uso = 'colorhq';
|
||||
}
|
||||
datos = {
|
||||
tirada: $('#tirada').val(),
|
||||
merma: 0,
|
||||
uso: uso,
|
||||
papel: $('#papelInterior option:selected').text()
|
||||
};
|
||||
datos = Object.assign(datos, window.token_ajax)
|
||||
|
||||
const valInterior = $('#gramajeInterior option:selected').val();
|
||||
|
||||
$.ajax({
|
||||
url: window.routes_disenio_libro.obtenerGramaje,
|
||||
type: 'POST',
|
||||
data: datos,
|
||||
success: function (response) {
|
||||
|
||||
$('#gramajeInterior').empty();
|
||||
$(response.menu).each(function (index, element) {
|
||||
$('#gramajeInterior').append($("<option />").val(element.id).text(element.text));
|
||||
});
|
||||
|
||||
if (valInterior != undefined)
|
||||
$('#gramajeInterior option[value=' + valInterior + ']').prop('selected', true).trigger('change');
|
||||
else
|
||||
$('#gramajeInterior').val('').trigger('change');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('#papelCubierta').on('change', function () {
|
||||
isColor = true;
|
||||
isHq = true;
|
||||
|
||||
if ($('#papelCubierta option:selected').val() != undefined) {
|
||||
var uso = 'cubierta';
|
||||
|
||||
datos = {
|
||||
tirada: $('#tirada').val(),
|
||||
merma: 0,
|
||||
uso: uso,
|
||||
papel: $('#papelCubierta option:selected').text().trim()
|
||||
};
|
||||
datos = Object.assign(datos, window.token_ajax)
|
||||
|
||||
const valCubierta = $('#gramajeCubierta option:selected').val();
|
||||
|
||||
$.ajax({
|
||||
url: window.routes_disenio_libro.obtenerGramaje,
|
||||
type: 'POST',
|
||||
data: datos,
|
||||
success: function (response) {
|
||||
|
||||
$('#gramajeCubierta').empty();
|
||||
$(response.menu).each(function (index, element) {
|
||||
$('#gramajeCubierta').append($("<option />").val(element.id).text(element.text));
|
||||
});
|
||||
|
||||
if (valCubierta != undefined)
|
||||
$('#gramajeCubierta option[value=' + valCubierta + ']').prop('selected', true).trigger('change');
|
||||
else
|
||||
$('#gramajeCubierta').val('').trigger('change');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('#papelSobrecubierta').on('change', function () {
|
||||
isColor = true;
|
||||
isHq = true;
|
||||
|
||||
if ($('#papelSobrecubierta option:selected').val() != undefined) {
|
||||
var uso = 'sobrecubierta';
|
||||
|
||||
datos = {
|
||||
tirada: $('#tirada').val(),
|
||||
merma: 0,
|
||||
uso: uso,
|
||||
papel: $('#papelSobrecubierta option:selected').text().trim()
|
||||
};
|
||||
datos = Object.assign(datos, window.token_ajax)
|
||||
|
||||
const valSobrecubierta = $('#gramajeSobrecubierta option:selected').val();
|
||||
|
||||
$.ajax({
|
||||
url: window.routes_disenio_libro.obtenerGramaje,
|
||||
type: 'POST',
|
||||
data: datos,
|
||||
success: function (response) {
|
||||
|
||||
$('#gramajeSobrecubierta').empty();
|
||||
$(response.menu).each(function (index, element) {
|
||||
$('#gramajeSobrecubierta').append($("<option />").val(element.id).text(element.text));
|
||||
});
|
||||
|
||||
if (valSobrecubierta != undefined)
|
||||
$('#gramajeSobrecubierta option[value=' + valCubierta + ']').prop('selected', true).trigger('change');
|
||||
else
|
||||
$('#gramajeSobrecubierta').val('').trigger('change');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('#solapasCubierta').on('change', function () {
|
||||
if ($(this).is(":checked")) {
|
||||
$('#tamanioSolapasCubierta').show();
|
||||
} else {
|
||||
$('#tamanioSolapasCubierta').hide();
|
||||
}
|
||||
});
|
||||
|
||||
$('#solapasSobrecubierta').on('change', function () {
|
||||
if ($(this).is(":checked")) {
|
||||
$('#tamanioSolapasSobrecubierta').show();
|
||||
} else {
|
||||
$('#tamanioSolapasSobrecubierta').hide();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Funcion que comprueba que están rellenos todos los datos necesarios para calcular el presupuesto
|
||||
function checkValues() {
|
||||
|
||||
const tirada = $('#tirada').val();
|
||||
const paginas = $('#paginas').val();
|
||||
const papelInterior = $('#papelInterior option:selected').val();
|
||||
const gramajeInterior = $('#gramajeInterior option:selected').text();
|
||||
const papelCubierta = $('#papelCubierta option:selected').val();
|
||||
const gramajeCubierta = $('#gramajeCubierta option:selected').text();
|
||||
const papelFormatoAlto = $('#altoLibro').val();
|
||||
const papelFormatoAncho = $('#anchoLibro').val();
|
||||
const clienteId = $('#clienteId').val();
|
||||
|
||||
if(clienteId == '' || isNaN(clienteId) || parseInt(clienteId) <= 0){
|
||||
return false;
|
||||
}
|
||||
|
||||
if (tirada == '' || isNaN(tirada) || parseInt(tirada) <= 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (paginas == '' || isNaN(paginas) || parseInt(paginas) <= 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (papelInterior == '' || gramajeInterior == '') {
|
||||
return false;
|
||||
}
|
||||
if (papelCubierta == '' || gramajeCubierta == '') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($('#papelFormatoId').val() == '' ||
|
||||
($('#papelFormatoPersonalizado').is(':checked') &&
|
||||
((papelFormatoAncho == '' || isNaN(papelFormatoAncho) || parseInt(papelFormatoAncho) <= 0) ||
|
||||
(papelFormatoAlto == '' || isNaN(papelFormatoAlto) || parseInt(papelFormatoAlto) <= 0))
|
||||
)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
function getTiradas() {
|
||||
let tiradas = [];
|
||||
tiradas.push(parseInt($('#tirada').val()));
|
||||
if ($('#tirada2').val().length > 0 && parseInt($('#tirada2').val()) > 0)
|
||||
tiradas.push(parseInt($('#tirada2').val()));
|
||||
if ($('#tirada3').val().length > 0 && parseInt($('#tirada3').val()) > 0)
|
||||
tiradas.push(parseInt($('#tirada3').val()));
|
||||
if ($('#tirada4').val().length > 0 && parseInt($('#tirada4').val()) > 0)
|
||||
tiradas.push(parseInt($('#tirada4').val()));
|
||||
return tiradas;
|
||||
}
|
||||
|
||||
|
||||
function getDimensionLibro() {
|
||||
|
||||
var ancho = 0;
|
||||
var alto = 0;
|
||||
|
||||
if ($('#papelFormatoId option:selected').length > 0) {
|
||||
var selectedText = $('#papelFormatoId option:selected').text();
|
||||
if (selectedText.length > 0) {
|
||||
ancho = parseFloat(selectedText.trim().split(" x ")[0]);
|
||||
alto = parseFloat(selectedText.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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$('#retractilado').on('change', function () {
|
||||
if ($(this).is(':checked')) {
|
||||
if ($('#retractilado5').is(':checked'))
|
||||
$('#retractilado5').prop('checked', false);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('#retractilado5').on('change', function () {
|
||||
if ($(this).is(':checked')) {
|
||||
if ($('#retractilado').is(':checked'))
|
||||
$('#retractilado').prop('checked', false);
|
||||
}
|
||||
});
|
||||
|
||||
$('.elementos-libro').on('change', function () {
|
||||
// Libro cosido
|
||||
if ($('#cosidoDiv').hasClass('checked')) {
|
||||
$('#tituloDisenioLibro').text("Rústica cosido");
|
||||
if ($('#tapaBlandaInnerDiv').hasClass('checked')) {
|
||||
// Cosido tapa blanda
|
||||
$('.guardas').hide();
|
||||
$('.solapas-cubierta').show();
|
||||
$('.sobrecubierta').show();
|
||||
$('#enableSobrecubierta').trigger('change');
|
||||
}
|
||||
else {
|
||||
// Cosido tapa dura
|
||||
$('.guardas').show();
|
||||
numCarasGuardas(2);
|
||||
$('.solapas-cubierta').hide();
|
||||
$('.sobrecubierta').show();
|
||||
$('#enableSobrecubierta').trigger('change');
|
||||
}
|
||||
}
|
||||
// Libro fresado
|
||||
else if ($('#fresadoDiv').hasClass('checked')) {
|
||||
$('#tituloDisenioLibro').text("Rústica fresado");
|
||||
if ($('#tapaBlandaInnerDiv').hasClass('checked')) {
|
||||
// fresado tapa blanda
|
||||
$('.guardas').hide();
|
||||
$('.solapas-cubierta').show();
|
||||
$('.sobrecubierta').show();
|
||||
$('#enableSobrecubierta').trigger('change');
|
||||
}
|
||||
else {
|
||||
// fresado tapa dura
|
||||
$('.guardas').show();
|
||||
numCarasGuardas(2);
|
||||
$('.solapas-cubierta').hide();
|
||||
$('.sobrecubierta').show();
|
||||
$('#enableSobrecubierta').trigger('change');
|
||||
}
|
||||
}
|
||||
// Libro grapado
|
||||
else if ($('#grapadoDiv').hasClass('checked')) {
|
||||
$('#tituloDisenioLibro').text("Cosido con grapas");
|
||||
if ($('#tapaBlandaInnerDiv').hasClass('checked')) {
|
||||
// grapado tapa blanda
|
||||
$('.guardas').hide();
|
||||
$('.solapas-cubierta').show();
|
||||
$('.sobrecubierta').hide();
|
||||
$('#enableSobrecubierta').prop('checked', false);
|
||||
}
|
||||
}
|
||||
// Libro wire-o
|
||||
else if ($('#wireoDiv').hasClass('checked')) {
|
||||
$('#tituloDisenioLibro').text("Wire-O");
|
||||
if ($('#tapaBlandaInnerDiv').hasClass('checked')) {
|
||||
// wire-o tapa blanda
|
||||
$('.guardas').hide();
|
||||
$('.solapas-cubierta').show();
|
||||
$('.sobrecubierta').hide();
|
||||
$('#enableSobrecubierta').prop('checked', false);
|
||||
}
|
||||
else {
|
||||
// wire-o tapa dura
|
||||
$('.guardas').show();
|
||||
numCarasGuardas(1);
|
||||
$('.solapas-cubierta').hide();
|
||||
$('.sobrecubierta').hide();
|
||||
$('#enableSobrecubierta').prop('checked', false);
|
||||
}
|
||||
}
|
||||
// Libro espiral
|
||||
else if ($('#espiralDiv').hasClass('checked')) {
|
||||
$('#tituloDisenioLibro').text("Espiral");
|
||||
if ($('#tapaBlandaInnerDiv').hasClass('checked')) {
|
||||
// espiral tapa blanda
|
||||
$('.guardas').hide();
|
||||
$('.solapas-cubierta').show();
|
||||
$('.sobrecubierta').hide();
|
||||
$('#enableSobrecubierta').prop('checked', false);
|
||||
}
|
||||
else {
|
||||
// espiral tapa dura
|
||||
$('.espiral').show();
|
||||
numCarasGuardas(1);
|
||||
$('.solapas-cubierta').hide();
|
||||
$('.sobrecubierta').hide();
|
||||
$('#enableSobrecubierta').prop('checked', false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function numCarasGuardas(numCaras) {
|
||||
if (numCaras == 1) {
|
||||
$("#impresionGuardas option[value='8']").remove();
|
||||
}
|
||||
else {
|
||||
if ($("#impresionGuardas option[value='8']").length == 0)
|
||||
$("#impresionGuardas").append('<option value="8">' + window.Presupuestos.dosCaras + '</option>');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$('.calcular-presupuesto').on('change', function () {
|
||||
|
||||
// se obtiene el id del elemento que ha disparado el evento
|
||||
if($(this).hasClass('input-sobrecubierta')){
|
||||
if($('#papelSobrecubierta option:selected').val() == '' || $('#gramajeSobrecubierta option:selected').val() == ''){
|
||||
return;
|
||||
}
|
||||
}
|
||||
calcularPresupuesto();
|
||||
});
|
||||
|
||||
|
||||
async function calcularPresupuesto() {
|
||||
|
||||
// se obtiene la propiedad serv_id de los checkboxes seleccionados de la clase .servicio-extra
|
||||
if (!checkValues()) {
|
||||
return;
|
||||
}
|
||||
|
||||
let servicios = [];
|
||||
$('.servicio-extra:checked').each(function () {
|
||||
servicios.push($(this).attr('serv_id'));
|
||||
})
|
||||
|
||||
let datos = {
|
||||
tamanio: getDimensionLibro(),
|
||||
tirada: getTiradas(),
|
||||
paginas: $('#paginas').val(),
|
||||
paginasColor: $('#paginasColor').val(),
|
||||
tipo: $('.custom-option-tipo.checked').attr('id').replace('Div', ''),
|
||||
tapa: $('#tapaDura').is(':checked') ? 'dura' : 'blanda',
|
||||
isColor: $('#colorNegroDiv').hasClass('checked') ? 0 : 1,
|
||||
isHq: $('#calidadEstandarDiv').hasClass('checked') ? 0 : 1,
|
||||
papelInterior: $('#papelInterior option:selected').val(),
|
||||
papelInteriorNombre: $('#papelInterior option:selected').text().trim(),
|
||||
gramajeInterior: $('#gramajeInterior option:selected').text(),
|
||||
excluirRotativa: $('#excluirRotativa').is(':checked')? 1 : 0,
|
||||
papelCubierta: $('#papelCubierta option:selected').val(),
|
||||
papelCubiertaNombre: $('#papelCubierta option:selected').text().trim(),
|
||||
gramajeCubierta: $('#gramajeCubierta option:selected').text(),
|
||||
carasCubierta: $('#carasCubierta').val(),
|
||||
acabadoCubierta: $('#acabadosCubierta').val(),
|
||||
clienteId: $('#clienteId').val(),
|
||||
servicios: servicios,
|
||||
}
|
||||
// Si hay solapas de cubierta
|
||||
if ($('#solapasCubierta').is(':checked')) {
|
||||
datos.solapasCubierta = $('#anchoSolapasCubierta').val()
|
||||
}
|
||||
|
||||
// Si hay sobrecubierta
|
||||
if ($('.enable-sobrecubierta').is(':visible')) {
|
||||
if($('#papelSobrecubierta option:selected').val()>0 && $('#gramajeSobrecubierta option:selected').val()>0){
|
||||
|
||||
datos.sobrecubierta = {
|
||||
papel: $('#papelSobrecubierta option:selected').val(),
|
||||
papel_nombre: $('#papelSobrecubierta option:selected').text().trim(),
|
||||
gramaje: $('#gramajeSobrecubierta option:selected').text(),
|
||||
acabado: $('#acabadosSobrecubierta').val()
|
||||
}
|
||||
if ($('#solapasSobrecubierta').is(':checked')) {
|
||||
datos.sobrecubierta.solapas = $('#anchoSolapasSobrecubierta').val()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($('.guardas').is(':visible')) {
|
||||
datos.guardas = {
|
||||
papel: $('#papelGuardas option:selected').val(),
|
||||
papel_nombre: $('#papelGuardas option:selected').text().trim(),
|
||||
gramaje: 170,
|
||||
caras: $('#impresionGuardas option:selected').val()
|
||||
}
|
||||
}
|
||||
|
||||
datos = Object.assign(datos, window.token_ajax)
|
||||
|
||||
|
||||
$('#loader').show();
|
||||
|
||||
$.ajax({
|
||||
url: window.routes_disenio_libro.presupuestoCliente,
|
||||
type: 'POST',
|
||||
data: datos,
|
||||
success: function (response) {
|
||||
error = false;
|
||||
if(response.errors.interior.length > 0){
|
||||
$('#errorInterior').show();
|
||||
error = true;
|
||||
}
|
||||
else
|
||||
$('#errorInterior').hide();
|
||||
if(response.errors.cubierta.length > 0){
|
||||
$('#errorCubierta').show();
|
||||
error = true;
|
||||
}
|
||||
else
|
||||
$('#errorCubierta').hide();
|
||||
|
||||
if(response.errors.sobrecubierta.length > 0){
|
||||
$('#errorSobrecubierta').show();
|
||||
error = true;
|
||||
}
|
||||
else
|
||||
$('#errorSobrecubierta').hide();
|
||||
|
||||
|
||||
if(response.errors.guardas.length > 0){
|
||||
$('#errorGuardas').show();
|
||||
error = true;
|
||||
}
|
||||
else
|
||||
$('#errorGuardas').hide();
|
||||
|
||||
if(response.errors.servicios.length > 0 || response.errors.serviciosDefecto.length > 0){
|
||||
error = true;
|
||||
$('#errorGeneral').show();
|
||||
}
|
||||
else{
|
||||
$('#errorGeneral').hide();
|
||||
}
|
||||
|
||||
console.log(response);
|
||||
$('#loader').hide();
|
||||
if(error){
|
||||
$('#precios > tbody').empty();
|
||||
$('#precios').hide();
|
||||
}
|
||||
else{
|
||||
$('#precios > tbody').empty();
|
||||
|
||||
for (i = 0; i < response.tiradas.length; i++) {
|
||||
$('#precios > tbody').append('<tr class="table-light"><td>' + response.tiradas[i] + '</td><td>' + response.precio_u[i] + '€</td></tr>');
|
||||
}
|
||||
$('#precios').show();
|
||||
}
|
||||
|
||||
},
|
||||
error: function (error) {
|
||||
$('#loader').hide();
|
||||
$('#precios > tbody').empty();
|
||||
$('#precios').hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
<div id="loader" style="display: none; position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-index: 9999;">
|
||||
<div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);">
|
||||
<img src="<?= site_url("assets/img/loader.gif") ?>" alt="Loading..."/>
|
||||
</div>
|
||||
</div>
|
||||
@ -0,0 +1,320 @@
|
||||
/**
|
||||
* Cliente presupuesto Wizard
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
(function () {
|
||||
|
||||
|
||||
// Init custom option check
|
||||
//window.Helpers.initCustomOptionCheck();
|
||||
// Vertical Wizard
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
const clientePresupuestoWizard = document.querySelector('#wizard-presupuesto-cliente');
|
||||
if (typeof clientePresupuestoWizard !== undefined && clientePresupuestoWizard !== null) {
|
||||
// Wizard form
|
||||
const clientePresupuestoWizardForm = clientePresupuestoWizard.querySelector('#presupuesto-cliente-form');
|
||||
// Wizard steps
|
||||
const clientePresupuestoWizardFormStep2 = clientePresupuestoWizardForm.querySelector('#tipo-libro');
|
||||
const clientePresupuestoWizardFormStep3 = clientePresupuestoWizardForm.querySelector('#disenio-libro');
|
||||
const clientePresupuestoWizardFormStep4 = clientePresupuestoWizardForm.querySelector('#direcciones-libro');
|
||||
const clientePresupuestoWizardFormStep5 = clientePresupuestoWizardForm.querySelector('#resumen-libro');
|
||||
// Wizard next prev button
|
||||
const clientePresupuestoWizardNext = [].slice.call(clientePresupuestoWizardForm.querySelectorAll('.btn-next'));
|
||||
const clientePresupuestoWizardPrev = [].slice.call(clientePresupuestoWizardForm.querySelectorAll('.btn-prev'));
|
||||
|
||||
let validationStepper = new Stepper(clientePresupuestoWizard, {
|
||||
linear: true
|
||||
});
|
||||
|
||||
// select2 (clienteId)
|
||||
const clienteId = $('#clienteId');
|
||||
|
||||
clienteId.on('change.select2', function () {
|
||||
// Revalidate the clienteId field when an option is chosen
|
||||
FormValidation2.revalidateField('clienteId');
|
||||
});
|
||||
|
||||
// Deal Details
|
||||
const FormValidation2 = FormValidation.formValidation(clientePresupuestoWizardFormStep2, {
|
||||
fields: {
|
||||
},
|
||||
plugins: {
|
||||
trigger: new FormValidation.plugins.Trigger(),
|
||||
bootstrap5: new FormValidation.plugins.Bootstrap5({
|
||||
// Use this for enabling/changing valid/invalid class
|
||||
// eleInvalidClass: '',
|
||||
eleValidClass: '',
|
||||
rowSelector: '.col-sm-3'
|
||||
}),
|
||||
autoFocus: new FormValidation.plugins.AutoFocus(),
|
||||
submitButton: new FormValidation.plugins.SubmitButton()
|
||||
}
|
||||
}).on('core.form.valid', function () {
|
||||
// Jump to the next step when all fields in the current step are valid
|
||||
validationStepper.next();
|
||||
});
|
||||
|
||||
// Deal Usage
|
||||
const FormValidation3 = FormValidation.formValidation(clientePresupuestoWizardFormStep3, {
|
||||
fields: {
|
||||
titulo: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: window.Presupuestos.validation.requerido_short
|
||||
},
|
||||
}
|
||||
},
|
||||
clienteId: {
|
||||
validators: {
|
||||
callback: {
|
||||
message: window.Presupuestos.validation.cliente,
|
||||
callback: function (input) {
|
||||
// Get the selected options
|
||||
const options = $("#clienteId").select2('data');
|
||||
const hasValidOption = options.some(option => parseInt(option.id) > 0);
|
||||
return options !== null && options.length > 0 && hasValidOption;
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
tirada: {
|
||||
validators: {
|
||||
callback: {
|
||||
message: window.Presupuestos.validation.integer_greatherThan_0,
|
||||
callback: function (input) {
|
||||
const value = $("#tirada").val();
|
||||
return value.length > 0 && Number.isInteger(parseInt(value)) && parseInt(value) > 0;
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
paginas: {
|
||||
validators: {
|
||||
callback: {
|
||||
message: window.Presupuestos.validation.integer_greatherThan_0,
|
||||
callback: function (input) {
|
||||
const value = $("#paginas").val();
|
||||
return value.length > 0 && Number.isInteger(parseInt(value)) && parseInt(value) > 0;
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
paginasColor: {
|
||||
validators: {
|
||||
callback: {
|
||||
message: window.Presupuestos.validation.integer_greatherThan_0,
|
||||
callback: function (input) {
|
||||
if ($('#pagColorDiv').is(':hidden'))
|
||||
return true;
|
||||
else {
|
||||
const value = $("#paginasColor").val();
|
||||
return value.length > 0 && Number.isInteger(parseInt(value)) && parseInt(value) > 0;
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
gramajeInterior: {
|
||||
validators: {
|
||||
callback: {
|
||||
callback: function (input) {
|
||||
const value = $("#tirada").val();
|
||||
if ($('#gramajeInterior option:selected').text().length == 0) {
|
||||
if(value.length > 0 && Number.isInteger(parseInt(value)) && parseInt(value) > 0){
|
||||
return {
|
||||
valid: false,
|
||||
message: window.Presupuestos.validation.sin_gramaje,
|
||||
}
|
||||
}
|
||||
return {
|
||||
valid: value.length > 0 && Number.isInteger(parseInt(value)) && parseInt(value) > 0,
|
||||
message: window.Presupuestos.validation.tirada_no_valida,
|
||||
}
|
||||
}
|
||||
return true;
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
gramajeCubierta: {
|
||||
validators: {
|
||||
callback: {
|
||||
message: window.Presupuestos.validation.tirada_no_valida,
|
||||
callback: function (input) {
|
||||
const value = $("#tirada").val();
|
||||
if ($('#gramajeCubierta option:selected').text().length == 0) {
|
||||
return value.length > 0 && Number.isInteger(parseInt(value)) && parseInt(value) > 0;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
},
|
||||
callback: {
|
||||
message: window.Presupuestos.validation.sin_gramaje,
|
||||
callback: function (input) {
|
||||
if ($('#gramajeCubierta option:selected').text().length == 0) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
gramajeSobrecubierta: {
|
||||
validators: {
|
||||
callback: {
|
||||
message: window.Presupuestos.validation.tirada_no_valida,
|
||||
callback: function (input) {
|
||||
const value = $("#tirada").val();
|
||||
if ($('#gramajeSobrecubierta option:selected').text().length == 0) {
|
||||
return value.length > 0 && Number.isInteger(parseInt(value)) && parseInt(value) > 0;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
trigger: new FormValidation.plugins.Trigger(),
|
||||
bootstrap5: new FormValidation.plugins.Bootstrap5({
|
||||
// Use this for enabling/changing valid/invalid class
|
||||
// eleInvalidClass: '',
|
||||
eleValidClass: '',
|
||||
rowSelector: function (field, ele) {
|
||||
// field is the field name
|
||||
// ele is the field element
|
||||
switch (field) {
|
||||
case 'gramajeInterior':
|
||||
case 'gramajeCubierta':
|
||||
case 'gramajeSobrecubierta':
|
||||
return '.col-sm-2';
|
||||
|
||||
case 'titulo':
|
||||
return '.col-sm-12';
|
||||
|
||||
case 'clienteId':
|
||||
return '.col-sm-6';
|
||||
|
||||
default:
|
||||
return '.col-sm-3';
|
||||
}
|
||||
}
|
||||
}),
|
||||
autoFocus: new FormValidation.plugins.AutoFocus(),
|
||||
submitButton: new FormValidation.plugins.SubmitButton()
|
||||
}
|
||||
}).on('core.form.valid', function () {
|
||||
validationStepper.next();
|
||||
});
|
||||
|
||||
const tirada = $('#tirada');
|
||||
tirada.on('change', function () {
|
||||
// Revalidate the clienteId field when an option is chosen
|
||||
FormValidation2.revalidateField('gramajeInterior');
|
||||
FormValidation2.revalidateField('gramajeCubierta');
|
||||
FormValidation2.revalidateField('gramajeSobrecubierta');
|
||||
});
|
||||
|
||||
// Deal Usage
|
||||
const FormValidation4 = FormValidation.formValidation(clientePresupuestoWizardFormStep4, {
|
||||
fields: {
|
||||
|
||||
},
|
||||
plugins: {
|
||||
trigger: new FormValidation.plugins.Trigger(),
|
||||
bootstrap5: new FormValidation.plugins.Bootstrap5({
|
||||
// Use this for enabling/changing valid/invalid class
|
||||
// eleInvalidClass: '',
|
||||
eleValidClass: '',
|
||||
rowSelector: '.col-md-12'
|
||||
}),
|
||||
autoFocus: new FormValidation.plugins.AutoFocus(),
|
||||
submitButton: new FormValidation.plugins.SubmitButton()
|
||||
}
|
||||
}).on('core.form.valid', function () {
|
||||
validationStepper.next();
|
||||
});
|
||||
|
||||
// Deal Usage
|
||||
const FormValidation5 = FormValidation.formValidation(clientePresupuestoWizardFormStep5, {
|
||||
fields: {
|
||||
// * Validate the fields here based on your requirements
|
||||
},
|
||||
plugins: {
|
||||
trigger: new FormValidation.plugins.Trigger(),
|
||||
bootstrap5: new FormValidation.plugins.Bootstrap5({
|
||||
// Use this for enabling/changing valid/invalid class
|
||||
// eleInvalidClass: '',
|
||||
eleValidClass: '',
|
||||
rowSelector: '.col-md-12'
|
||||
}),
|
||||
autoFocus: new FormValidation.plugins.AutoFocus(),
|
||||
submitButton: new FormValidation.plugins.SubmitButton()
|
||||
}
|
||||
}).on('core.form.valid', function () {
|
||||
// You can submit the form
|
||||
// clientePresupuestoWizardForm.submit()
|
||||
// or send the form data to server via an Ajax request
|
||||
// To make the demo simple, I just placed an alert
|
||||
alert('Submitted..!!');
|
||||
});
|
||||
|
||||
clientePresupuestoWizardNext.forEach(item => {
|
||||
item.addEventListener('click', event => {
|
||||
// When click the Next button, we will validate the current step
|
||||
switch (validationStepper._currentIndex) {
|
||||
case 0:
|
||||
FormValidation2.validate();
|
||||
break;
|
||||
|
||||
case 1:
|
||||
FormValidation3.validate();
|
||||
break;
|
||||
|
||||
case 2:
|
||||
FormValidation4.validate();
|
||||
break;
|
||||
|
||||
case 3:
|
||||
FormValidation5.validate();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
clientePresupuestoWizardPrev.forEach(item => {
|
||||
item.addEventListener('click', event => {
|
||||
switch (validationStepper._currentIndex) {
|
||||
case 4:
|
||||
validationStepper.previous();
|
||||
break;
|
||||
|
||||
case 3:
|
||||
validationStepper.previous();
|
||||
break;
|
||||
|
||||
case 2:
|
||||
validationStepper.previous();
|
||||
break;
|
||||
|
||||
case 1:
|
||||
validationStepper.previous();
|
||||
break;
|
||||
|
||||
case 0:
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
||||
|
||||
@ -0,0 +1,52 @@
|
||||
// Init custom option check
|
||||
function initTipoLibroCheck()
|
||||
{
|
||||
const _this = this
|
||||
|
||||
const custopOptionList = [].slice.call(document.querySelectorAll('.custom-option-tipo .form-check-input'))
|
||||
custopOptionList.map(function (customOptionEL) {
|
||||
// Update custom options check on page load
|
||||
_this.updateTipoLibroCheck(customOptionEL)
|
||||
|
||||
// Update custom options check on click
|
||||
customOptionEL.addEventListener('click', e => {
|
||||
_this.updateTipoLibroCheck(customOptionEL)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function updateTipoLibroCheck(el)
|
||||
{
|
||||
if (el.checked) {
|
||||
// If custom option element is radio, remove checked from the siblings (closest `.row`)
|
||||
if (el.type === 'radio') {
|
||||
const customRadioOptionList = [].slice.call(el.closest('.tipo_libro').querySelectorAll('.custom-option-tipo'))
|
||||
customRadioOptionList.map(function (customRadioOptionEL) {
|
||||
customRadioOptionEL.closest('.custom-option-tipo').classList.remove('checked')
|
||||
})
|
||||
}
|
||||
el.closest('.custom-option-tipo').classList.add('checked')
|
||||
if(el.closest('.custom-option-tipo').id == 'grapadoDiv') {
|
||||
$('#tapaDuraDiv').hide();
|
||||
$('#tapaBlanda').prop('checked', true);
|
||||
}
|
||||
else {
|
||||
$('#tapaDuraDiv').show();
|
||||
}
|
||||
} else {
|
||||
el.closest('.custom-option-tipo').classList.remove('checked')
|
||||
}
|
||||
}
|
||||
|
||||
initTipoLibroCheck();
|
||||
|
||||
|
||||
function getUpdatePapelInterior() {
|
||||
var impresionInterior = $('input[name="impresionInterior"]:checked').val();
|
||||
if(impresionInterior == 'color') {
|
||||
$('#colorInteriorDiv').show();
|
||||
}
|
||||
else {
|
||||
$('#colorInteriorDiv').hide();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,240 @@
|
||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
|
||||
<?= $this->include("themes/_commonPartialsBs/sweetalert") ?>
|
||||
<?= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
||||
|
||||
|
||||
<?= $this->section("content") ?>
|
||||
|
||||
<div class="container-xxl flex-grow-1 container-p-y">
|
||||
<div class="col-12">
|
||||
<h3 class="card-title"><?= $boxTitle ?? $pageTitle ?></h3>
|
||||
<?= csrf_field() ?>
|
||||
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
|
||||
<?= view("themes/backend/vuexy/form/presupuestos/cliente/loader") ?>
|
||||
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
|
||||
|
||||
|
||||
<!-- Create Deal Wizard -->
|
||||
<div id="wizard-presupuesto-cliente" class="bs-stepper vertical mt-2 linear">
|
||||
<div class="bs-stepper-header">
|
||||
|
||||
<div class="step active" data-target="#tipo-libro">
|
||||
<button type="button" class="step-trigger" aria-selected="false" disabled="disabled">
|
||||
<span class="bs-stepper-circle"><i class="ti ti-book ti-sm"></i></span>
|
||||
<span class="bs-stepper-label">
|
||||
<span class="bs-stepper-title">Tipo de libro</span>
|
||||
<span class="bs-stepper-subtitle">Cosido, Fresado, ...</span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="line"></div>
|
||||
|
||||
<div class="step" data-target="#disenio-libro">
|
||||
<button type="button" class="step-trigger" aria-selected="false" disabled="disabled">
|
||||
<span class="bs-stepper-circle"><i class="ti ti-book ti-sm"></i></span>
|
||||
<span class="bs-stepper-label">
|
||||
<span class="bs-stepper-title">Diseño del libro</span>
|
||||
<span class="bs-stepper-subtitle">Detalles técnicos del libro</span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="line"></div>
|
||||
|
||||
<div class="step" data-target="#direcciones-libro">
|
||||
<button type="button" class="step-trigger" aria-selected="false" disabled="disabled">
|
||||
<span class="bs-stepper-circle"><i class="ti ti-map-pins ti-sm"></i></span>
|
||||
<span class="bs-stepper-label">
|
||||
<span class="bs-stepper-title">Direcciones</span>
|
||||
<span class="bs-stepper-subtitle">Dirección envío, facturación</span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="line"></div>
|
||||
|
||||
<div class="step" data-target="#resumen-libro">
|
||||
<button type="button" class="step-trigger" aria-selected="false" disabled="disabled">
|
||||
<span class="bs-stepper-circle"><i class="ti ti-checkbox ti-sm"></i></span>
|
||||
<span class="bs-stepper-label">
|
||||
<span class="bs-stepper-title">Resumen del presupuesto</span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div id="errorGeneral" class="fv-plugins-message-container invalid-feedback" style="display: none;">
|
||||
<p>Se ha producido un error al calcular el presupuesto. Póngase en contacto con el administrador</p>
|
||||
</div>
|
||||
|
||||
<table id="precios" class="table table-sm" style="display: none;">
|
||||
<caption>Precio/Unidad por tirada</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="bs-stepper-content">
|
||||
<form id="presupuesto-cliente-form" onsubmit="return false">
|
||||
|
||||
|
||||
<!-- Tipo Libro -->
|
||||
<div id="tipo-libro" class="content active dstepper-block fv-plugins-bootstrap5 fv-plugins-framework">
|
||||
<div class="row g-3">
|
||||
|
||||
|
||||
<?= view("themes/backend/vuexy/form/presupuestos/cliente/_tipoLibroItems") ?>
|
||||
|
||||
<div class="col-12 d-flex justify-content-between mt-4">
|
||||
<button class="btn btn-label-secondary btn-prev waves-effect">
|
||||
<i class="ti ti-arrow-left ti-xs me-sm-1 me-0"></i>
|
||||
<span class="align-middle d-sm-inline-block d-none">Anterior</span>
|
||||
</button>
|
||||
<button class="btn btn-primary btn-next waves-effect waves-light">
|
||||
<span class="align-middle d-sm-inline-block d-none me-sm-1">Siguiente</span>
|
||||
<i class="ti ti-arrow-right ti-xs"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Diseño Libro -->
|
||||
<div id="disenio-libro" class="content dstepper-block fv-plugins-bootstrap5 fv-plugins-framework">
|
||||
<div class="row g-3">
|
||||
|
||||
<?= view("themes/backend/vuexy/form/presupuestos/cliente/_disenioLibroItems") ?>
|
||||
|
||||
<div class="col-12 d-flex justify-content-between mt-4">
|
||||
<button class="btn btn-label-secondary btn-prev waves-effect">
|
||||
<i class="ti ti-arrow-left ti-xs me-sm-1 me-0"></i>
|
||||
<span class="align-middle d-sm-inline-block d-none">Anterior</span>
|
||||
</button>
|
||||
<button class="btn btn-primary btn-next waves-effect waves-light">
|
||||
<span class="align-middle d-sm-inline-block d-none me-sm-1">Siguiente</span>
|
||||
<i class="ti ti-arrow-right ti-xs"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Deal Usage -->
|
||||
<div id="direcciones-libro" class="content fv-plugins-bootstrap5 fv-plugins-framework">
|
||||
<div class="row g-3">
|
||||
|
||||
|
||||
|
||||
<div class="col-12 d-flex justify-content-between mt-4">
|
||||
<button class="btn btn-label-secondary btn-prev waves-effect">
|
||||
<i class="ti ti-arrow-left ti-xs me-sm-1 me-0"></i>
|
||||
<span class="align-middle d-sm-inline-block d-none">Anterior</span>
|
||||
</button>
|
||||
<button class="btn btn-primary btn-next waves-effect waves-light">
|
||||
<span class="align-middle d-sm-inline-block d-none me-sm-1">Siguiente</span>
|
||||
<i class="ti ti-arrow-right ti-xs"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Review & Complete -->
|
||||
<div id="resumen-libro" class="content fv-plugins-bootstrap5 fv-plugins-framework">
|
||||
<div class="row g-3">
|
||||
|
||||
</div>
|
||||
<div class="col-12 d-flex justify-content-between mt-4">
|
||||
<button class="btn btn-label-secondary btn-prev waves-effect">
|
||||
<i class="ti ti-arrow-left ti-xs me-sm-1 me-0"></i>
|
||||
<span class="align-middle d-sm-inline-block d-none">Anterior</span>
|
||||
</button>
|
||||
<button class="btn btn-success btn-submit btn-next waves-effect waves-light">
|
||||
<span class="align-middle d-sm-inline-block d-none me-sm-1">Submit</span><i class="ti ti-check ti-xs"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div><!--//.col -->
|
||||
<div class="pt-4">
|
||||
<input type="submit" class="btn btn-primary float-start me-sm-3 me-1" name="save" id="saveForm" value="<?= lang("Basic.global.Save") ?>" />
|
||||
</div>
|
||||
</div><!--//.row -->
|
||||
<?= view("themes/_commonPartialsBs/_modalConfirmDialog") ?>
|
||||
<?= view("themes/_commonPartialsBs/_modalMessageDialog") ?>
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
|
||||
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
window.datosPresupuesto = <?= json_encode($datosPresupuesto) ?>;
|
||||
window.token_ajax= {<?= csrf_token() ?? "token" ?>: <?= csrf_token() ?>v};
|
||||
|
||||
$('#clienteId').select2({
|
||||
allowClear: false,
|
||||
ajax: {
|
||||
url: '<?= route_to("menuItemsOfClientes") ?>',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
|
||||
data: function(params) {
|
||||
return {
|
||||
id: 'id',
|
||||
text: 'nombre',
|
||||
searchTerm: params.term,
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
};
|
||||
},
|
||||
delay: 60,
|
||||
processResults: function(response) {
|
||||
yeniden(response.<?= csrf_token() ?>);
|
||||
return {
|
||||
results: response.menu
|
||||
};
|
||||
},
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
|
||||
initDisenioLibro();
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?= $this->section('css') ?>
|
||||
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/bs-stepper/bs-stepper.css') ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/formvalidation/dist/css/formValidation.min.css') ?>" />
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/bs-stepper/bs-stepper.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/formvalidation/dist/js/FormValidation.min.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/formvalidation/dist/js/plugins/Bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/formvalidation/dist/js/plugins/AutoFocus.min.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/dataTables.buttons.min.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.html5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.print.min.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/datatables-sk/plugins/select/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>
|
||||
<script src="<?= site_url('js_loader/translate_js/Presupuestos') ?>"></script>
|
||||
<script src="<?= site_url('js_loader/presupuestoCliente_js') ?>"></script>
|
||||
<script src="<?= site_url('js_loader/presupuestoClienteTipoLibro_js') ?>"></script>
|
||||
<script src="<?= site_url('js_loader/presupuestoClienteDisenioLibro_js') ?>"></script>
|
||||
<?= $this->endSection() ?>
|
||||
@ -689,7 +689,6 @@
|
||||
ajax: {
|
||||
url: '<?= route_to("menuItemsOfCosidotapablanda") ?>',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
|
||||
data: function (params) {
|
||||
return {
|
||||
|
||||
@ -1,616 +0,0 @@
|
||||
<?php $menus = getMenuControl(); ?>
|
||||
|
||||
<!-- Menu -->
|
||||
<aside id="layout-menu" class="layout-menu menu-vertical menu bg-menu-theme">
|
||||
<div class="app-brand">
|
||||
<a href="<?= site_url('home') ?>" class="app-brand-link">
|
||||
<span class="app-brand-logo">
|
||||
<img src="<?= site_url('themes/vuexy/img/branding/logo.png') ?>" width="150px">
|
||||
</span>
|
||||
</a>
|
||||
<a href="javascript:void(0);" class="layout-menu-toggle menu-link text-large ms-auto">
|
||||
<i class="ti menu-toggle-icon d-none d-xl-block ti-sm align-middle"></i>
|
||||
<i class="ti ti-x d-block d-xl-none ti-sm align-middle"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="menu-inner-shadow"></div>
|
||||
|
||||
<ul class="menu-inner py-1">
|
||||
|
||||
<li class="menu-item active">
|
||||
<a href="<?= site_url("") ?>" class="menu-link">
|
||||
<i class="menu-icon tf-icons ti ti-smart-home"></i>
|
||||
<div data-i18n="<?= lang("App.menu_dashboard") ?>"><?= lang("App.menu_dashboard") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?php if (allowMenuSection($menus, ['Cliente', 'Tarifacliente'], 'index')): ?>
|
||||
<!-- Clientes -->
|
||||
<li class="menu-item">
|
||||
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||
<i class="menu-icon tf-icons ti ti-users"></i>
|
||||
<div data-i18n="<?= lang("App.menu_clientes") ?>"><?= lang("App.menu_clientes") ?></div>
|
||||
</a>
|
||||
<ul class="menu-sub">
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Cliente')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("clientes/cliente") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_clientes") ?>"><?= lang("App.menu_clientes") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("clientes/clienteplantillaprecios") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_plantillas_tarifas_clientes") ?>"><?= lang("App.menu_plantillas_tarifas_clientes") ?></div>
|
||||
</a>
|
||||
</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; ?>
|
||||
|
||||
<?php if (allowMenuSection($menus,
|
||||
['Calendario', 'Correo', 'Formaspago', 'Imposiciones', 'Tipologias',
|
||||
'Maquina', 'Papelesgenerico', 'Papelesimpresion', 'Seriefactura', 'Serviciocliente',
|
||||
'Tamanioformatos', 'Tamaniolibros', 'Tareaservicio', 'Tiposimpresion', 'Trabajo'
|
||||
],
|
||||
'index')): ?>
|
||||
<li class="menu-item">
|
||||
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||
<i class="menu-icon tf-icons ti ti-users"></i>
|
||||
<div data-i18n="<?= lang("App.menu_configuration") ?>"><?= lang("App.menu_configuration") ?></div>
|
||||
</a>
|
||||
<ul class="menu-sub">
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Calendario')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("configuracion/calendario") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_calendario") ?>"><?= lang("App.menu_calendario") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Correo')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("configuracion/correo") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_correo") ?>"><?= lang("App.menu_correo") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Formaspago')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("configuracion/formaspago") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_formaspago") ?>"><?= lang("App.menu_formaspago") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Imposiciones')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("configuracion/imposiciones") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_imposiciones") ?>"><?= lang("App.menu_imposiciones") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Tipologias')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("configuracion/tipologias") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_tipologias") ?>"><?= lang("App.menu_tipologias") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Maquina')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("configuracion/maquina") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_maquina") ?>"><?= lang("App.menu_maquina") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Papelesgenericos')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("configuracion/papelesgenericos") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_papelgenerico") ?>"><?= lang("App.menu_papelgenerico") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Papelesimpresion')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("configuracion/papelesimpresion") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_papelimpresion") ?>"><?= lang("App.menu_papelimpresion") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Seriefactura')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("configuracion/seriefactura") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_seriefactura") ?>"><?= lang("App.menu_seriefactura") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Serviciocliente')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("configuracion/serviciocliente") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_serviciocliente") ?>"><?= lang("App.menu_serviciocliente") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Tamanioformatos')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("configuracion/tamanioformatos") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_tamanioformatos") ?>"><?= lang("App.menu_tamanioformatos") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Tamaniolibros')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("configuracion/tamaniolibros") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_tamaniolibros") ?>"><?= lang("App.menu_tamaniolibros") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Tareasservicio')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("configuracion/tareasservicio") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_tareasservicio") ?>"><?= lang("App.menu_tareasservicio") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Tiposimpresion')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("configuracion/tiposimpresion") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_tiposimpresion") ?>"><?= lang("App.menu_tiposimpresion") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Trabajo')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("configuracion/trabajo") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_trabajo") ?>"><?= lang("App.menu_trabajo") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* MENU DIGITALIZACIÓN
|
||||
*/
|
||||
if (count(getArrayItem($menus, 'name', 'Digitalizacion')) > 0): ?>
|
||||
<!-- Digitalization -->
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("serviciosdigitalizacion/digitalizacion") ?>" class="menu-link">
|
||||
<i class="menu-icon tf-icons ti ti-file-dollar"></i>
|
||||
<div data-i18n="<?= lang("App.menu_digitalizacion") ?>"><?= lang("App.menu_digitalizacion") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<?php
|
||||
/**
|
||||
* MENU LOGISTICA
|
||||
*/
|
||||
if (count(getArrayItem($menus, 'name', 'Logistica')) > 0): ?>
|
||||
<!-- Logistic -->
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("envioslogistica/logistica") ?>" class="menu-link">
|
||||
<i class="menu-icon tf-icons ti ti-file-dollar"></i>
|
||||
<div class="<?= lang("App.menu_logistica") ?>"><?= lang("App.menu_logistica") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* MENU FACTURACION
|
||||
*/
|
||||
if (allowMenuSection($menus, ['Albaran', 'Factura'], 'index')): ?>
|
||||
<!-- Invoicing -->
|
||||
<li class="menu-item">
|
||||
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||
<i class="menu-icon tf-icons ti ti-file-dollar"></i>
|
||||
<div data-i18n="<?= lang("App.menu_facturación") ?>"><?= lang("App.menu_facturación") ?></div>
|
||||
</a>
|
||||
<ul class="menu-sub">
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Albaran')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("facturacion/albaran") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_albaran") ?>"><?= lang("App.menu_albaran") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Factura')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("facturacion/factura") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_facturas") ?>"><?= lang("App.menu_facturas") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* MENU INFORMES
|
||||
*/
|
||||
if (count(getArrayItem($menus, 'name', 'Informe')) > 0): ?>
|
||||
<!-- Informs -->
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("informes/informe") ?>" class="menu-link">
|
||||
<i class="menu-icon tf-icons ti ti-file-dollar"></i>
|
||||
<div data-i18n="<?= lang("App.menu_informes") ?>"><?= lang("App.menu_informes") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* MENU PEDIDO
|
||||
*/
|
||||
if (count(getArrayItem($menus, 'name', 'Pedido')) > 0): ?>
|
||||
<!-- Orders -->
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("pedidos/pedido") ?>" class="menu-link">
|
||||
<i class="menu-icon tf-icons ti ti-file-dollar"></i>
|
||||
<div data-i18n="<?= lang("App.menu_pedidos") ?>"><?= lang("App.menu_pedidos") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* MENU PRESUPUESTO
|
||||
*/
|
||||
if (allowMenuSection($menus, ['Presupuesto', 'Presupuestomaquetacion'], 'index')): ?>
|
||||
<!-- Budgets -->
|
||||
<li class="menu-item">
|
||||
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||
<i class="menu-icon tf-icons ti ti-file-dollar"></i>
|
||||
<div data-i18n="<?= lang("App.menu_presupuestos") ?>"><?= lang("App.menu_presupuestos") ?></div>
|
||||
</a>
|
||||
<ul class="menu-sub">
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Albaran')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("presupuestos/presupuesto") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_presupuestos") ?>"><?= lang("App.menu_presupuestos") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Factura')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("presupuestos/presupuestomaquetacion") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_presupuestomaquetacion") ?>"><?= lang("App.menu_presupuestomaquetacion") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* MENU PRODUCCION
|
||||
*/
|
||||
if
|
||||
(allowMenuSection($menus, ['Ordenmaquina', 'Ordentrabajo', 'Ordentrabajomaquetacion', 'Pedidoproduccion'], 'index')): ?>
|
||||
<!-- Production -->
|
||||
<li class="menu-item">
|
||||
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||
<i class="menu-icon tf-icons ti ti-file-dollar"></i>
|
||||
<div data-i18n="<?= lang("App.menu_produccion") ?>"><?= lang("App.menu_produccion") ?></div>
|
||||
</a>
|
||||
<ul class="menu-sub">
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Ordenmaquina')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("produccion/ordenmaquina") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_ordenmaquina") ?>"><?= lang("App.menu_ordenmaquina") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Ordentrabajo')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("produccion/ordentrabajo") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_ordentrabajo") ?>"><?= lang("App.menu_ordentrabajo") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Ordentrabajomaquetacion')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("produccion/ordentrabajomaquetacion") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_ordentrabajomaquetacion") ?>"><?= lang("App.menu_ordentrabajomaquetacion") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Pedidoproduccion')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("produccion/pedidoproduccion") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_pedidoproduccion") ?>"><?= lang("App.menu_pedidoproduccion") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* MENU PROVEEDORES
|
||||
*/
|
||||
if (count(getArrayItem($menus, 'name', 'Proveedores')) > 0): ?>
|
||||
<!-- Providers -->
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("compras/proveedores") ?>" class="menu-link">
|
||||
<i class="menu-icon tf-icons ti ti-file-dollar"></i>
|
||||
<div data-i18n="<?= lang("App.menu_proveedores") ?>"><?= lang("App.menu_proveedores") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* MENU TARIFAS
|
||||
*/
|
||||
if (allowMenuSection($menus,
|
||||
['Tarifaacabado', 'Tarifasenvios', 'Tarifaimpresion', 'Tarifamanipulado', 'Tarifaencuadernacion',
|
||||
'Tarifapapelcompra', 'Tarifapapeldefecto', 'Tarifapreimpresion', 'Tarifaextra'
|
||||
], 'index')): ?>
|
||||
<!-- Prices -->
|
||||
<li class="menu-item">
|
||||
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||
<i class="menu-icon tf-icons ti ti-file-dollar"></i>
|
||||
<div data-i18n="<?= lang("App.menu_tarifas") ?>"><?= lang("App.menu_tarifas") ?></div>
|
||||
</a>
|
||||
<ul class="menu-sub">
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Tarifaacabado')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("tarifas/tarifaacabado") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_tarifaacabado") ?>"><?= lang("App.menu_tarifaacabado") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Tarifasenvios')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("tarifas/tarifasenvios") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_tarifaenvio") ?>"><?= lang("App.menu_tarifaenvio") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Tarifaimpresion')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("tarifas/tarifaimpresion") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_tarifaimpresion") ?>"><?= lang("App.menu_tarifaimpresion") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Tarifamanipulado')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("tarifas/tarifamanipulado") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_tarifamanipulado") ?>"><?= lang("App.menu_tarifamanipulado") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Tarifaencuadernacion')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("tarifas/tarifaencuadernacion") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_tarifaencuadernacion") ?>"><?= lang("App.menu_tarifaencuadernacion") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Tarifapapelcompra')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("tarifas/tarifapapelcompra") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_tarifapapelcompra") ?>"><?= lang("App.menu_tarifapapelcompra") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Tarifapapeldefecto')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("tarifas/tarifapapeldefecto") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_tarifapapeldefecto") ?>"><?= lang("App.menu_tarifapapeldefecto") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Tarifapreimpresion')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("tarifas/tarifapreimpresion") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_tarifapreimpresion") ?>"><?= lang("App.menu_tarifapreimpresion") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Tarifaextra')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("tarifas/tarifaextra") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_tarifaextra") ?>"><?= lang("App.menu_tarifaextra") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* MENU USUARIOS
|
||||
*/
|
||||
if (allowMenuSection($menus, ['Users', 'Group'], 'index')): ?>
|
||||
<!-- Users -->
|
||||
<li class="menu-item">
|
||||
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||
<i class="menu-icon tf-icons ti ti-file-dollar"></i>
|
||||
<div data-i18n="<?= lang("App.menu_users") ?>"><?= lang("App.menu_users") ?></div>
|
||||
</a>
|
||||
<ul class="menu-sub">
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Users')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("usuarios/users") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_users") ?>"><?= lang("App.menu_users") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Group')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("usuarios/group") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_permission_group") ?>"><?= lang("App.menu_permission_group") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* MENU ACTIVIDAD
|
||||
*/
|
||||
if (count(getArrayItem($menus, 'name', 'Activity')) > 0): ?>
|
||||
<!-- Activity -->
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("activity") ?>" class="menu-link">
|
||||
<i class="menu-icon tf-icons ti ti-article""></i>
|
||||
<div data-i18n="<?= lang("App.menu_activity") ?>"><?= lang("App.menu_activity") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* MENU AJUSTES
|
||||
*/
|
||||
if (count(getArrayItem($menus, 'name', 'Settings')) > 0): ?>
|
||||
<!-- Settings -->
|
||||
<li class="menu-header small text-uppercase">
|
||||
<span class="menu-header-text">Ajustes del Sistema</span>
|
||||
</li>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("settings")?>" class="menu-link">
|
||||
<i class="menu-icon tf-icons ti ti-settings""></i>
|
||||
<div data-i18n="<?= lang("App.menu_settings") ?>"><?= lang("App.menu_settings") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
</ul>
|
||||
</aside>
|
||||
<!-- / Menu -->
|
||||
|
||||
<?php /*
|
||||
|
||||
|
||||
<!--Sidebar-->
|
||||
<div class="quixnav">
|
||||
<div class="quixnav-scroll">
|
||||
<ul class="metismenu" id="menu">
|
||||
|
||||
<!---
|
||||
<?php if (count(getArrayItem($menus,'name','Notification')) > 0): ?>
|
||||
<li><a class="has-arrow" href="Javascript:void()" aria-expanded="false"><i class="fas fa-bell"></i><span class="nav-text"><?= lang("App.menu_notification") ?></span></a>
|
||||
<ul aria-expanded="false">
|
||||
<?php if (count(getArrayItem($menus,'methods','index',true)) > 0): ?>
|
||||
<li><a href="<?= site_url("notification")?>"><?= lang("App.menu_list") ?></a></li>
|
||||
<?php endif; ?>
|
||||
<?php if (count(getArrayItem($menus,'methods','add',true)) > 0): ?>
|
||||
<li><a href="<?= site_url("notification/add")?>"><?= lang("App.menu_add") ?></a></li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php if (count(getArrayItem($menus,'name','Settings')) > 0): ?>
|
||||
<li class="nav-label"><?= lang("App.menu_settings") ?></li>
|
||||
<?php if (count(getArrayItem($menus,'methods','index',true)) > 0): ?>
|
||||
<li><a href="<?= site_url("settings")?>" aria-expanded="false"><i class="fas fa-sliders-h"></i><span class="nav-text"><?= lang("App.menu_general") ?></span></a></li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (count(getArrayItem($menus,'methods','template',true)) > 0): ?>
|
||||
<li><a href="<?= site_url("settings/template")?>" aria-expanded="false"><i class="fas fa-mail-bulk"></i><span class="nav-text"><?= lang("App.menu_template") ?></span></a></li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<li class="nav-label"></li>
|
||||
--->
|
||||
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
*/
|
||||
?>
|
||||
@ -813,6 +813,22 @@
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<!---
|
||||
/**
|
||||
* JJO
|
||||
*/
|
||||
|
||||
<li class="menu-header small text-uppercase">
|
||||
<span class="menu-header-text">Test JJO</span>
|
||||
</li>
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to('nuevoPresupuestoCliente' ) ?>" class="menu-link">
|
||||
<i class="menu-icon tf-icons ti ti-settings"></i>
|
||||
<div data-i18n="Test">Test</div>
|
||||
</a>
|
||||
</li>
|
||||
--->
|
||||
|
||||
|
||||
</ul>
|
||||
</aside>
|
||||
|
||||
BIN
httpdocs/assets/img/gamacolor.png
Normal file
|
After Width: | Height: | Size: 65 KiB |
BIN
httpdocs/assets/img/grises.png
Normal file
|
After Width: | Height: | Size: 46 KiB |
BIN
httpdocs/assets/img/libro_cosido.png
Normal file
|
After Width: | Height: | Size: 1.2 MiB |
BIN
httpdocs/assets/img/libro_espiral.png
Normal file
|
After Width: | Height: | Size: 935 KiB |
BIN
httpdocs/assets/img/libro_fresado.png
Normal file
|
After Width: | Height: | Size: 4.5 MiB |
BIN
httpdocs/assets/img/libro_grapado.png
Normal file
|
After Width: | Height: | Size: 4.8 MiB |
BIN
httpdocs/assets/img/libro_wire-o.png
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
BIN
httpdocs/assets/img/loader.gif
Normal file
|
After Width: | Height: | Size: 46 KiB |
@ -18871,7 +18871,7 @@ html:not([dir=rtl]) .app-brand-text {
|
||||
border: 1px solid #c9c8ce;
|
||||
}
|
||||
.custom-option.custom-option-image {
|
||||
border-width: 1px !important;
|
||||
border-width: 3px !important;
|
||||
}
|
||||
.custom-option.custom-option-image .custom-option-body img {
|
||||
border-radius: 0.375rem;
|
||||
|
||||