mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'dev/sobrecubierta' into 'main'
arreglados bug en el tamanio, al guardar cuando hay tamanio personalizado en... See merge request jjimenez/safekat!160
This commit is contained in:
9
.idea/deployment.xml
generated
9
.idea/deployment.xml
generated
@ -1,8 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="PublishConfigData" autoUpload="Always" serverName="SK-IMN" remoteFilesAllowedToDisappearOnAutoupload="false" confirmBeforeUploading="false">
|
||||
<component name="PublishConfigData" autoUpload="Always" serverName="SK-DEV" remoteFilesAllowedToDisappearOnAutoupload="false" confirmBeforeUploading="false">
|
||||
<option name="confirmBeforeUploading" value="false" />
|
||||
<serverData>
|
||||
<paths name="SK-DEV">
|
||||
<serverdata>
|
||||
<mappings>
|
||||
<mapping deploy="/" local="$PROJECT_DIR$" web="/" />
|
||||
</mappings>
|
||||
</serverdata>
|
||||
</paths>
|
||||
<paths name="SK-IMN">
|
||||
<serverdata>
|
||||
<mappings>
|
||||
|
||||
0
.idea/modules.xml
generated
Normal file → Executable file
0
.idea/modules.xml
generated
Normal file → Executable file
0
.idea/phpunit.xml
generated
Normal file → Executable file
0
.idea/phpunit.xml
generated
Normal file → Executable file
0
.idea/safekat.iml
generated
Normal file → Executable file
0
.idea/safekat.iml
generated
Normal file → Executable file
7
.idea/webServers.xml
generated
7
.idea/webServers.xml
generated
@ -23,6 +23,13 @@
|
||||
</advancedOptions>
|
||||
</fileTransfer>
|
||||
</webServer>
|
||||
<webServer id="85f139d9-24ee-421b-b3fa-c8b68aa8f4ef" name="SK-DEV" url="http://sk-dev.imnavajas.es">
|
||||
<fileTransfer host="sk-dev.imnavajas.es" port="21">
|
||||
<advancedOptions>
|
||||
<advancedOptions dataProtectionLevel="Private" passiveMode="true" shareSSLContext="true" />
|
||||
</advancedOptions>
|
||||
</fileTransfer>
|
||||
</webServer>
|
||||
</option>
|
||||
<groups>
|
||||
<group>
|
||||
|
||||
@ -100,6 +100,10 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
// JJO
|
||||
$sanitizedData['user_created_id'] = $session->id_user;
|
||||
|
||||
if ($sanitizedData['papel_formato_id'] == null) {
|
||||
$sanitizedData['papel_formato_id'] = 0;
|
||||
}
|
||||
|
||||
$noException = true;
|
||||
if ($successfulResult = $this->canValidate($this->model->validationRulesAdd, $this->model->validationMessagesAdd)) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||
|
||||
@ -218,6 +222,17 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
$sanitizedData['papel_formato_personalizado'] = false;
|
||||
}
|
||||
|
||||
if ($this->request->getPost('papel_formato_id') == null) {
|
||||
$sanitizedData['papel_formato_id'] = 0;
|
||||
}
|
||||
|
||||
if ($this->request->getPost('solapas') == null) {
|
||||
$sanitizedData['solapas'] = 0;
|
||||
}
|
||||
if ($this->request->getPost('solapas_sobrecubierta') == null) {
|
||||
$sanitizedData['solapas'] = 0;
|
||||
}
|
||||
|
||||
$noException = true;
|
||||
if($sanitizedData['papel_formato_id'] == null && $sanitizedData['papel_formato_ancho'] == null
|
||||
&& $sanitizedData['papel_formato_alto'] == null){
|
||||
@ -329,6 +344,10 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
$this->viewData['papelGenericoRotativaNegroList'] = $this->getPapelGenericoRotativaNegro();
|
||||
$this->viewData['papelGenericoRotativaColorList'] = $this->getPapelGenericoRotativaColor();
|
||||
|
||||
// Acabados exteriores
|
||||
$this->viewData['acabadosCubierta'] = $this->getAcabadosCubierta();
|
||||
$this->viewData['acabadosSobrecubierta'] = $this->getAcabadosSobrecubierta();
|
||||
|
||||
// Lineas Presupuesto
|
||||
$this->viewData['lineasPresupuesto'] = (new PresupuestoLineaModel())->getLineasPresupuesto($id);
|
||||
|
||||
@ -552,11 +571,8 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
$datosPedido->solapas_ancho = $reqData['solapas_ancho'];
|
||||
$datosPedido->lomo = $reqData['lomo'];
|
||||
|
||||
if($type=='sobrecubierta')
|
||||
$datosPedido->lomo_cubierta = $reqData['lomo_cubierta'];
|
||||
|
||||
$datosPedido->anchoExteriores = PresupuestoService::getAnchoTotalExteriores($tipo_impresion_id, $datosPedido);
|
||||
$datosPedido->altoExteriores = PresupuestoService::getAltoTotalExteriores($tipo_impresion_id, $datosPedido);
|
||||
$datosPedido->anchoExteriores = PresupuestoService::getAnchoTotalExteriores($type, $tipo_impresion_id, $datosPedido);
|
||||
$datosPedido->altoExteriores = PresupuestoService::getAltoTotalExteriores($type, $tipo_impresion_id, $datosPedido);
|
||||
// Cubierta y sobrecubierta siempre color HQ
|
||||
$resourceData = $this->getCompIntData($type, $datosPedido, $papel_generico, $gramaje, $isColor, 1, $cliente_id);
|
||||
|
||||
@ -787,8 +803,10 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
$linea = PresupuestoService::getCostesLinea($uso, $datosPedido, $maquina, $papel, $opciones_papel, $tarifa);
|
||||
}
|
||||
|
||||
if(array_key_exists('error', $linea))
|
||||
if(array_key_exists('error', $linea)){
|
||||
//array_push($lineas, $linea); for debug
|
||||
continue;
|
||||
}
|
||||
|
||||
if($maquina->is_inkjet){
|
||||
// calculo de tintas
|
||||
@ -1206,15 +1224,26 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
}
|
||||
|
||||
|
||||
protected function getPapelFormatoListItems($selId = null)
|
||||
protected function getAcabadosCubierta()
|
||||
{
|
||||
$papelFormatoModel = model('App\Models\Configuracion\PapelFormatoModel');
|
||||
$data = $papelFormatoModel->getElementsForMenu();
|
||||
$model = model('App\Models\Tarifas\TarifaacabadoModel');
|
||||
$data = $model->getServiciosAcabadoCubierta();
|
||||
array_shift($data);
|
||||
array_unshift($data, (object)['id' => '', 'tamanio' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.papelFormatoId'))])]);
|
||||
array_unshift($data, (object)['id' => '', 'label' => lang('Basic.global.None')]);
|
||||
return $data;
|
||||
}
|
||||
|
||||
protected function getAcabadosSobrecubierta()
|
||||
{
|
||||
$model = model('App\Models\Tarifas\TarifaacabadoModel');
|
||||
$data = $model->getServiciosAcabadoSobrecubierta();
|
||||
array_shift($data);
|
||||
array_unshift($data, (object)['id' => '', 'label' => lang('Basic.global.None')]);
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
protected function getPapelGenericoRotativaNegro()
|
||||
{
|
||||
@ -1330,10 +1359,15 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
{
|
||||
$model = model('App\Models\Tarifas\TarifaEncuadernacionModel');
|
||||
$data = $model->getServiciosEncuadernacionSelector();
|
||||
/*array_unshift($data, (object)array(
|
||||
"value" => 0,
|
||||
"label" => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.servicioEncuadernado'))])
|
||||
));*/
|
||||
return $data;
|
||||
}
|
||||
|
||||
protected function getPapelFormatoListItems($selId = null)
|
||||
{
|
||||
$papelFormatoModel = model('App\Models\Configuracion\PapelFormatoModel');
|
||||
$data = $papelFormatoModel->getElementsForMenu();
|
||||
array_shift($data);
|
||||
array_unshift($data, (object)['id' => '', 'tamanio' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.papelFormatoId'))])]);
|
||||
return $data;
|
||||
}
|
||||
|
||||
@ -1341,10 +1375,6 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
{
|
||||
$model = model('App\Models\Tarifas\TarifaacabadoModel');
|
||||
$data = $model->getServiciosAcabadoSelector();
|
||||
/*array_unshift($data, (object)array(
|
||||
"value" => 0,
|
||||
"label" => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.servicioAcabado'))])
|
||||
));*/
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
@ -42,15 +42,14 @@ class Presupuestoacabados extends \App\Controllers\GoBaseResourceController
|
||||
endif;
|
||||
|
||||
$postData = $this->request->getJSON();
|
||||
$tarifas = array_column($postData->datos, 'tarifa_id');
|
||||
if(count($tarifas)>0){
|
||||
$this->model->deleteServiciosNotInArray($requestedId, $tarifas);
|
||||
if(count($postData->datos)>0){
|
||||
$this->model->deleteServiciosNotInArray($requestedId, $postData->datos);
|
||||
}
|
||||
else{
|
||||
$this->model->deleteAllServicios($requestedId);
|
||||
}
|
||||
|
||||
if(count($tarifas)>0){
|
||||
if(count($postData->datos)>0){
|
||||
$this->model->updateTarifas($requestedId, $postData->datos);
|
||||
}
|
||||
|
||||
|
||||
@ -84,10 +84,19 @@ class Tarifaacabado extends \App\Controllers\GoBaseResourceController
|
||||
|
||||
// JJO
|
||||
$sanitizedData['user_created_id'] = $session->id_user;
|
||||
|
||||
if ($this->request->getPost('mostrar_en_presupuesto') == null) {
|
||||
$sanitizedData['mostrar_en_presupuesto'] = false;
|
||||
}
|
||||
|
||||
if ($this->request->getPost('acabado_cubierta') == null) {
|
||||
$sanitizedData['acabado_cubierta'] = false;
|
||||
}
|
||||
|
||||
if ($this->request->getPost('acabado_sobrecubierta') == null) {
|
||||
$sanitizedData['acabado_sobrecubierta'] = false;
|
||||
}
|
||||
|
||||
$noException = true;
|
||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||
|
||||
@ -166,9 +175,18 @@ class Tarifaacabado extends \App\Controllers\GoBaseResourceController
|
||||
|
||||
// JJO
|
||||
$sanitizedData['user_updated_id'] = $session->id_user;
|
||||
|
||||
if ($this->request->getPost('mostrar_en_presupuesto') == null) {
|
||||
$sanitizedData['mostrar_en_presupuesto'] = false;
|
||||
}
|
||||
|
||||
if ($this->request->getPost('acabado_cubierta') == null) {
|
||||
$sanitizedData['acabado_cubierta'] = false;
|
||||
}
|
||||
|
||||
if ($this->request->getPost('acabado_sobrecubierta') == null) {
|
||||
$sanitizedData['acabado_sobrecubierta'] = false;
|
||||
}
|
||||
|
||||
|
||||
$noException = true;
|
||||
|
||||
@ -18,7 +18,11 @@ class Test extends BaseController
|
||||
public function index()
|
||||
{
|
||||
echo '<pre>';
|
||||
\var_dump($this->get_precio_tarifa(18,300,10,150,210,-1,30));
|
||||
$model = model('App\Models\Presupuestos\PresupuestoAcabadosModel');
|
||||
$tarifas = [
|
||||
(object)['tarifa_id'=>1, "cubierta"=>0, "sobrecubierta"=>0]
|
||||
];
|
||||
var_dump($model->deleteServiciosNotInArray(44, $tarifas));
|
||||
echo '</pre>';
|
||||
/*
|
||||
|
||||
@ -179,6 +183,13 @@ class Test extends BaseController
|
||||
var_dump($data);
|
||||
}
|
||||
|
||||
public function getPapelesSobrecubierta(){
|
||||
$model = model('App\Models\Configuracion\PapelGenericoModel');
|
||||
$data = $model->getPapelForComparador('colorhq', false, true, false);
|
||||
|
||||
var_dump($data);
|
||||
}
|
||||
|
||||
public function getPapelesGuardas(){
|
||||
$model = model('App\Models\Configuracion\PapelGenericoModel');
|
||||
$data = $model->getPapelForComparador('color', false, false, false, true);
|
||||
@ -514,6 +525,99 @@ class Test extends BaseController
|
||||
echo '</pre>';
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static function testLineasSobrecubierta()
|
||||
{
|
||||
$uso = 'sobrecubierta';
|
||||
$tipo = 'colorhq';
|
||||
|
||||
$datosPedido = (object)array(
|
||||
'paginas' => 240,
|
||||
'tirada' => 100,
|
||||
'merma' => 10,
|
||||
'merma_portada' => 10,
|
||||
'ancho' => 150,
|
||||
'alto' => 210,
|
||||
'isCosido' => true,
|
||||
'solapas' => false,
|
||||
);
|
||||
|
||||
$opciones_papel = array(
|
||||
'sobrecubierta' => 1,
|
||||
'rotativa' => 0,
|
||||
);
|
||||
|
||||
|
||||
// Se obtienen los papeles disponibles
|
||||
$papelimpresionmodel = new \App\Models\Configuracion\PapelImpresionModel();
|
||||
$papeles = $papelimpresionmodel->getIdPapelesImpresionForPresupuesto(
|
||||
papel_generico_id: 1, // Blanco offset
|
||||
gramaje: 200,
|
||||
options: $opciones_papel
|
||||
);
|
||||
|
||||
echo '<pre>';
|
||||
var_dump($papeles);
|
||||
echo '</pre>';
|
||||
|
||||
$lineas = array();
|
||||
// Para cada papel, se obtienen las maquinas disponibles
|
||||
foreach ($papeles as $papel) {
|
||||
|
||||
$maquinamodel = new \App\Models\Configuracion\MaquinaModel();
|
||||
$maquinas = $maquinamodel->getMaquinaImpresionForPresupuesto(
|
||||
is_rotativa: 0,
|
||||
tarifa_tipo: $tipo,
|
||||
uso_tarifa: 'sobrecubierta',
|
||||
tirada: $datosPedido->tirada + $datosPedido->merma,
|
||||
papel_impresion_id: $papel->id,
|
||||
);
|
||||
|
||||
echo '<pre>';
|
||||
echo '-------------------------------';
|
||||
echo '</pre>';
|
||||
|
||||
echo '<pre>';
|
||||
var_dump($maquinas);
|
||||
echo '</pre>';
|
||||
|
||||
// Se recorren las máquinas y se calcula el coste de linea por cada una
|
||||
foreach ($maquinas as $maquina) {
|
||||
|
||||
echo '<pre>';
|
||||
echo '$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$';
|
||||
echo '</pre>';
|
||||
|
||||
$tarifamodel = new \App\Models\Configuracion\MaquinasTarifasImpresionModel();
|
||||
$tarifa = $tarifamodel->getTarifa($maquina->maquina_id, $uso, $tipo);
|
||||
|
||||
echo '<pre>';
|
||||
var_dump($tarifa);
|
||||
echo '</pre>';
|
||||
|
||||
if(!is_float($tarifa)){
|
||||
continue;
|
||||
}
|
||||
$linea = PresupuestoService::getCostesLinea($uso, $datosPedido, $maquina, $papel, $opciones_papel, $tarifa);
|
||||
$linea['fields']['maquina'] = $maquina->maquina;
|
||||
$linea['fields']['maquina_id'] = $maquina->maquina_id;
|
||||
$linea['fields']['papel_impresion'] = $papel->nombre;
|
||||
$linea['fields']['papel_impresion_id'] = $papel->id;
|
||||
$linea['fields']['paginas'] = $datosPedido->paginas;
|
||||
$linea['fields']['gramaje'] = 100;
|
||||
$linea['fields']['papel_generico_id'] = 3;
|
||||
$linea['fields']['papel_generico'] = 'Blanco offset';
|
||||
|
||||
array_push($lineas, $linea);
|
||||
}
|
||||
}
|
||||
|
||||
echo '<pre>';
|
||||
var_dump($lineas);
|
||||
echo '</pre>';
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
0
ci4/app/Entities/Clientes/ClientePreciosEntity.php
Normal file → Executable file
0
ci4/app/Entities/Clientes/ClientePreciosEntity.php
Normal file → Executable file
@ -12,6 +12,8 @@ class PresupuestoAcabadosEntity extends \CodeIgniter\Entity\Entity
|
||||
"precio_unidad" => null,
|
||||
"precio_total" => null,
|
||||
"margen" => null,
|
||||
"cubierta" => null,
|
||||
"sobrecubierta" => null,
|
||||
"created_at" => null,
|
||||
"updated_at" => null,
|
||||
];
|
||||
@ -21,5 +23,7 @@ class PresupuestoAcabadosEntity extends \CodeIgniter\Entity\Entity
|
||||
"precio_unidad" => "float",
|
||||
"precio_total" => "float",
|
||||
"margen" => "float",
|
||||
"cubierta" => "int",
|
||||
"sobrecubierta" => "int",
|
||||
];
|
||||
}
|
||||
|
||||
@ -39,6 +39,8 @@ class PresupuestoEntity extends \CodeIgniter\Entity\Entity
|
||||
"tirada" => null,
|
||||
"solapas" => false,
|
||||
"solapas_ancho" => 0.0,
|
||||
"solapas_sobrecubierta" => false,
|
||||
"solapas_ancho_sobrecubierta" => 0.0,
|
||||
"cosido" => false,
|
||||
"sobrecubiertas" => false,
|
||||
"sobrecubiertas_ancho" => 0.0,
|
||||
@ -80,6 +82,8 @@ class PresupuestoEntity extends \CodeIgniter\Entity\Entity
|
||||
"total_descuentoPercent" => null,
|
||||
"total_presupuesto" => null,
|
||||
"total_precio_unidad" => null,
|
||||
"acabado_cubierta_id" => null,
|
||||
"acabado_sobrecubierta_id" => null,
|
||||
];
|
||||
protected $casts = [
|
||||
"cliente_id" => "int",
|
||||
@ -107,6 +111,8 @@ class PresupuestoEntity extends \CodeIgniter\Entity\Entity
|
||||
"tirada" => "int",
|
||||
"solapas" => "boolean",
|
||||
"solapas_ancho" => "float",
|
||||
"solapas_sobrecubierta" => "boolean",
|
||||
"solapas_ancho_sobrecubierta" => "float",
|
||||
"cosido" => "boolean",
|
||||
"sobrecubiertas" => "boolean",
|
||||
"sobrecubiertas_ancho" => "float",
|
||||
@ -135,5 +141,7 @@ class PresupuestoEntity extends \CodeIgniter\Entity\Entity
|
||||
"total_descuentoPercent" => "?float",
|
||||
"total_presupuesto" => "?float",
|
||||
"total_precio_unidad" => "?float",
|
||||
"acabado_cubierta_id" => "int",
|
||||
"acabado_sobrecubierta_id" => "int",
|
||||
];
|
||||
}
|
||||
|
||||
@ -11,6 +11,8 @@ class TarifaacabadoEntity extends \CodeIgniter\Entity\Entity
|
||||
"precio_min" => 0,
|
||||
"importe_fijo" => 0,
|
||||
"mostrar_en_presupuesto" => 1,
|
||||
"acabado_cubierta" => 0,
|
||||
"acabado_sobrecubierta" => 0,
|
||||
"user_created_id" => 0,
|
||||
"user_updated_id" => 0,
|
||||
"is_deleted" => 0,
|
||||
@ -21,7 +23,6 @@ class TarifaacabadoEntity extends \CodeIgniter\Entity\Entity
|
||||
protected $casts = [
|
||||
"precio_min" => "float",
|
||||
"importe_fijo" => "float",
|
||||
"mostrar_en_presupuesto" => "int",
|
||||
"user_created_id" => "int",
|
||||
"user_updated_id" => "int",
|
||||
"is_deleted" => "int",
|
||||
|
||||
@ -44,6 +44,9 @@ return [
|
||||
'papelFormatoPersonalizado' => 'Tamaño personalizado',
|
||||
'papelFormatoAncho' => 'Ancho',
|
||||
'papelFormatoAlto' => 'Alto',
|
||||
'acabadosExteriores' => 'Acabados exteriores',
|
||||
'acabadoCubierta' => 'Acabado Cubierta',
|
||||
'acabadoSobrecubierta' => 'Acabado Sobrecubierta',
|
||||
'cosido' => 'Cosido',
|
||||
'ferro' => 'Ferro',
|
||||
'ferroDigital' => 'Ferro Digital',
|
||||
@ -95,7 +98,9 @@ return [
|
||||
'sobrecubierta' => 'Sobrecubierta',
|
||||
'encuadernacion' => 'Encuadernación',
|
||||
'solapasCubierta' => 'Solapas cubierta',
|
||||
'solapasAnchoCubierta' => 'Ancho solapas cubierta',
|
||||
'solapasSobrecubierta' => 'Solapas sobrecub.',
|
||||
'solapasAnchoCubierta' => 'Ancho solapas cub.',
|
||||
'solapasAnchoSobrecubierta' => 'Ancho solapas sobrecub.',
|
||||
'sinImpresion' => 'Sin impresion',
|
||||
'1cara' => '1 cara',
|
||||
'2caras' => '2 caras',
|
||||
@ -193,11 +198,13 @@ return [
|
||||
'previewMaquina' => 'Máquina',
|
||||
'previewConfiguracionGuardas' => 'Configuración de guardas',
|
||||
'previewConfiguracionCubierta' => 'Configuración de cubierta',
|
||||
'previewConfiguracionSobrecubierta' => 'Configuración de sobrecubierta',
|
||||
'previewEsquemaCubierta' => 'Esquema de cubierta',
|
||||
'previewConfiguracionEsquemaCubierta' => 'Configuración esquema de cubierta',
|
||||
'previewMaquinaPlana' => 'Configuración del papel: Plana',
|
||||
'previewMaquinaRotativa' => 'Configuración del papel: Rotativa',
|
||||
'previewCubierta' => 'Configuración del papel: Cubierta',
|
||||
'previewSobrecubierta' => 'Configuración del papel: Sobrecubierta',
|
||||
'previewPapelGenerico' => 'Papel Genérico',
|
||||
'previewPapelCompra' => 'Papel de Compra',
|
||||
'previewAreaImpresion' => 'Área de Impresión',
|
||||
|
||||
@ -12,6 +12,8 @@ return [
|
||||
'precioMin' => 'Precio Mínimo',
|
||||
'importeFijo' => 'Importe Fijo',
|
||||
'mostrar_en_presupuesto' => 'Mostrar en presupuesto',
|
||||
"acabado_cubierta" => "Acabado cubierta",
|
||||
"acabado_sobrecubierta" => "Acabado sobrecubierta",
|
||||
'tarifaacabado' => 'Tarifa Acabado',
|
||||
'tarifaacabadoList' => 'Lista Tarifas Acabado',
|
||||
'tarifasacabado' => 'Tarifas Acabado',
|
||||
|
||||
0
ci4/app/Models/Clientes/ClientePreciosModel.php
Normal file → Executable file
0
ci4/app/Models/Clientes/ClientePreciosModel.php
Normal file → Executable file
@ -127,21 +127,11 @@ class PapelGenericoModel extends \App\Models\GoBaseModel
|
||||
$builder->where("t2.cubierta", 1);
|
||||
$builder->where("t5.uso", 'cubierta');
|
||||
}
|
||||
else{
|
||||
if(!$is_guardas){
|
||||
$builder->where("t2.cubierta", 0);
|
||||
}
|
||||
}
|
||||
|
||||
if($is_sobrecubierta==true){
|
||||
$builder->where("t2.sobrecubierta", 1);
|
||||
$builder->where("t5.uso", 'sobrecubierta');
|
||||
}
|
||||
else{
|
||||
if(!$is_guardas){
|
||||
$builder->where("t2.sobrecubierta", 0);
|
||||
}
|
||||
}
|
||||
|
||||
if($is_cubierta==false && $is_sobrecubierta==false){
|
||||
$builder->where("t5.uso", 'interior');
|
||||
|
||||
@ -19,7 +19,7 @@ class PresupuestoAcabadosModel extends \App\Models\GoBaseModel
|
||||
2 => "t1.precio_total"
|
||||
];
|
||||
|
||||
protected $allowedFields = ["presupuesto_id", "tarifa_acabado_id", "nombre", "precio_total", "precio_unidad", "margen"];
|
||||
protected $allowedFields = ["presupuesto_id", "tarifa_acabado_id", "nombre", "precio_total", "precio_unidad", "margen", "cubierta", "sobrecubierta"];
|
||||
protected $returnType = "App\Entities\Presupuestos\PresupuestoAcabadosEntity";
|
||||
|
||||
protected $useTimestamps = true;
|
||||
@ -98,13 +98,33 @@ class PresupuestoAcabadosModel extends \App\Models\GoBaseModel
|
||||
->delete();
|
||||
}
|
||||
|
||||
public function deleteServiciosNotInArray($presupuesto_id, $tarifas_id){
|
||||
public function deleteServiciosNotInArray($presupuesto_id, $tarifas){
|
||||
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1");
|
||||
$builder->select("*");
|
||||
$builder->where('presupuesto_id', $presupuesto_id);
|
||||
$results = $builder->get()->getResultObject();
|
||||
|
||||
$ids_for_delete = [];
|
||||
foreach($results as $result){
|
||||
$found = false;
|
||||
foreach($tarifas as $tarifa){
|
||||
if($tarifa->tarifa_id == $result->tarifa_acabado_id &&
|
||||
$tarifa->cubierta == $result->cubierta &&
|
||||
$tarifa->sobrecubierta == $result->sobrecubierta)
|
||||
$found = true;
|
||||
}
|
||||
if(!$found){
|
||||
array_push($ids_for_delete, $result->id);
|
||||
}
|
||||
}
|
||||
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1");
|
||||
$builder->where('presupuesto_id', $presupuesto_id);
|
||||
foreach($tarifas_id as $id){
|
||||
$builder->where('tarifa_acabado_id !=', $id);
|
||||
foreach($ids_for_delete as $id){
|
||||
$builder->orWhere('id', $id);
|
||||
}
|
||||
$builder->delete();
|
||||
}
|
||||
@ -118,6 +138,8 @@ class PresupuestoAcabadosModel extends \App\Models\GoBaseModel
|
||||
$builder->select("id");
|
||||
$builder->where('presupuesto_id', $presupuesto_id);
|
||||
$builder->where('tarifa_acabado_id', $tarifa->tarifa_id);
|
||||
$builder->where('cubierta', $tarifa->cubierta);
|
||||
$builder->where('sobrecubierta', $tarifa->sobrecubierta);
|
||||
$result = $builder->get()->getResultObject();
|
||||
if(count($result)>0){
|
||||
$this->db
|
||||
@ -127,6 +149,8 @@ class PresupuestoAcabadosModel extends \App\Models\GoBaseModel
|
||||
->set('precio_unidad', $tarifa->precio_unidad)
|
||||
->set('precio_total', $tarifa->precio_total)
|
||||
->set('margen', $tarifa->margen)
|
||||
->set('cubierta', $tarifa->cubierta)
|
||||
->set('sobrecubierta', $tarifa->sobrecubierta)
|
||||
->update();
|
||||
|
||||
|
||||
@ -139,6 +163,8 @@ class PresupuestoAcabadosModel extends \App\Models\GoBaseModel
|
||||
->set('precio_unidad', $tarifa->precio_unidad)
|
||||
->set('precio_total', $tarifa->precio_total)
|
||||
->set('margen', $tarifa->margen)
|
||||
->set('cubierta', $tarifa->cubierta)
|
||||
->set('sobrecubierta', $tarifa->sobrecubierta)
|
||||
->insert();
|
||||
}
|
||||
}
|
||||
@ -157,7 +183,7 @@ class PresupuestoAcabadosModel extends \App\Models\GoBaseModel
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.id AS id, t1.tarifa_acabado_id AS tarifa_acabado_id, t1.precio_unidad AS precio_unidad,
|
||||
t1.precio_total AS precio_total, t1.margen AS margen, t2.nombre AS nombre"
|
||||
t1.precio_total AS precio_total, t1.margen AS margen, t2.nombre AS nombre, t1.cubierta AS cubierta, t1.sobrecubierta AS sobrecubierta"
|
||||
);
|
||||
|
||||
$builder->where('t1.presupuesto_id', $presupuesto_id);
|
||||
|
||||
@ -253,7 +253,7 @@ class PresupuestoEncuadernacionesModel extends \App\Models\GoBaseModel
|
||||
|
||||
array_push($ret_array,
|
||||
(object)[
|
||||
'tarifa_id'=> $tarifa['tarifa_id'],
|
||||
'tarifa_id'=> $tarifa_proveedor->tarifa_enc_id,
|
||||
'tarifa_nombre'=> $tarifa_proveedor->tarifa_enc_nombre,
|
||||
'precio_unidad'=> $result_data[0],
|
||||
'total'=> $result_data[1],
|
||||
|
||||
@ -60,6 +60,8 @@ class PresupuestoModel extends \App\Models\GoBaseModel
|
||||
"tirada",
|
||||
"solapas",
|
||||
"solapas_ancho",
|
||||
"solapas_sobrecubierta",
|
||||
"solapas_ancho_sobrecubierta",
|
||||
"cosido",
|
||||
"sobrecubiertas",
|
||||
"sobrecubiertas_ancho",
|
||||
@ -98,6 +100,8 @@ class PresupuestoModel extends \App\Models\GoBaseModel
|
||||
"total_descuentoPercent",
|
||||
"total_presupuesto",
|
||||
"total_precio_unidad",
|
||||
"acabado_cubierta_id",
|
||||
"acabado_sobrecubierta_id",
|
||||
];
|
||||
protected $returnType = "App\Entities\Presupuestos\PresupuestoEntity";
|
||||
|
||||
|
||||
@ -137,6 +137,10 @@ class TarifaEncuadernacionModel extends \App\Models\GoBaseModel
|
||||
|
||||
public function getTarifaPresupuestoEncuadernacion($tarifa_id, $paginas, $tirada, $ancho, $alto, $proveedor_id=-1){
|
||||
|
||||
// para los apaisados
|
||||
$dim_h = $ancho<$alto?$ancho:$alto;
|
||||
$dim_v = $ancho<$alto?$alto:$ancho;
|
||||
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
@ -159,10 +163,10 @@ class TarifaEncuadernacionModel extends \App\Models\GoBaseModel
|
||||
$builder->where('t2.tirada_max >=', $tirada);
|
||||
$builder->where('t3.paginas_libro_min <=', $paginas);
|
||||
$builder->where('t3.paginas_libro_max >=', $paginas);
|
||||
$builder->where('t4.ancho_min <=', $ancho);
|
||||
$builder->where('t4.ancho_max >=', $ancho);
|
||||
$builder->where('t4.alto_min <=', $alto);
|
||||
$builder->where('t4.alto_max >=', $alto);
|
||||
$builder->where('t4.ancho_min <=', $dim_h);
|
||||
$builder->where('t4.ancho_max >', $dim_h);
|
||||
$builder->where('t4.alto_min <=', $dim_v);
|
||||
$builder->where('t4.alto_max >=', $dim_v);
|
||||
|
||||
if($proveedor_id != -1){
|
||||
$builder->where('t2.proveedor_id', $proveedor_id);
|
||||
|
||||
@ -24,6 +24,8 @@ class TarifaacabadoModel extends \App\Models\GoBaseModel
|
||||
"precio_min",
|
||||
"importe_fijo",
|
||||
"mostrar_en_presupuesto",
|
||||
"acabado_cubierta",
|
||||
"acabado_sobrecubierta",
|
||||
"deleted_at",
|
||||
"is_deleted",
|
||||
"user_created_id",
|
||||
@ -81,7 +83,8 @@ class TarifaacabadoModel extends \App\Models\GoBaseModel
|
||||
public function getResource(string $search = "")
|
||||
{
|
||||
$builder = $this->db->table($this->table . " t1")->select(
|
||||
"t1.id AS id, t1.nombre AS nombre, t1.precio_min AS precio_min, t1.importe_fijo AS importe_fijo, t1.mostrar_en_presupuesto AS mostrar_en_presupuesto"
|
||||
"t1.id AS id, t1.nombre AS nombre, t1.precio_min AS precio_min, t1.importe_fijo AS importe_fijo,
|
||||
t1.mostrar_en_presupuesto AS mostrar_en_presupuesto, t1.acabado_cubierta AS acabado_cubierta, t1.acabado_sobrecubierta AS acabado_sobrecubierta"
|
||||
);
|
||||
|
||||
//JJO
|
||||
@ -117,7 +120,7 @@ class TarifaacabadoModel extends \App\Models\GoBaseModel
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.id AS tarifa_acabado_id, t1.nombre AS tarifa_acabado_nombre, t1.precio_min AS tarifa_precio_min, t1.importe_fijo AS tarifa_importe_fijo,
|
||||
t2.id AS tarifa_linea_id, t2.tirada_min AS tirada_min, t2.tirada_max AS tirada_max,
|
||||
t1.acabado_cubierta AS acabado_cubierta, t1.acabado_sobrecubierta AS acabado_sobrecubierta, t2.id AS tarifa_linea_id, t2.tirada_min AS tirada_min, t2.tirada_max AS tirada_max,
|
||||
t2.precio_min AS precio_min, t2.precio_max AS precio_max, t2.margen AS margen"
|
||||
)
|
||||
->join("tarifa_acabado_lineas t2", "t1.id = t2.tarifa_acabado_id", "left")
|
||||
@ -148,4 +151,33 @@ class TarifaacabadoModel extends \App\Models\GoBaseModel
|
||||
return $builder->orderBy("t1.nombre", "asc")->get()->getResultObject();
|
||||
}
|
||||
|
||||
|
||||
public function getServiciosAcabadoCubierta()
|
||||
{
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.id as id, t1.nombre AS label"
|
||||
)
|
||||
->where("t1.is_deleted", 0)
|
||||
->where("t1.mostrar_en_presupuesto", 1)
|
||||
->where("t1.acabado_cubierta", 1);
|
||||
|
||||
return $builder->orderBy("t1.id", "asc")->get()->getResultObject();
|
||||
}
|
||||
|
||||
|
||||
public function getServiciosAcabadoSobrecubierta()
|
||||
{
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.id as id, t1.nombre AS label"
|
||||
)
|
||||
->where("t1.is_deleted", 0)
|
||||
->where("t1.mostrar_en_presupuesto", 1)
|
||||
->where("t1.acabado_sobrecubierta", 1);
|
||||
|
||||
return $builder->orderBy("t1.id", "asc")->get()->getResultObject();
|
||||
}
|
||||
}
|
||||
|
||||
@ -541,8 +541,9 @@ class PresupuestoService extends BaseService
|
||||
|
||||
/**
|
||||
* Devuelve el ancho de la cubierta/sobrecubierta, incluido el lomo.
|
||||
* El $uso tiene que ser "cubierta" o "sobrecubierta"
|
||||
*/
|
||||
public static function getAnchoTotalExteriores($tipo_impresion_id, $datosPedido=null)
|
||||
public static function getAnchoTotalExteriores($uso="cubierta", $tipo_impresion_id, $datosPedido=null)
|
||||
{
|
||||
$ancho_total = 0;
|
||||
|
||||
@ -550,8 +551,7 @@ class PresupuestoService extends BaseService
|
||||
// Tapa blanda (cosido y fresado)
|
||||
if($tipo_impresion_id == 2 || $tipo_impresion_id == 4){
|
||||
$ancho_total = floatval($datosPedido->ancho)*2 + floatval($datosPedido->lomo);
|
||||
$ancho_total += property_exists($datosPedido, 'lomo_cubierta')?$datosPedido->lomo_cubierta:0;
|
||||
|
||||
|
||||
// añadimos ancho de las solapas
|
||||
// si se añaden solapas hay que sumar 3mm de los dobleces
|
||||
if ($datosPedido->solapas) {
|
||||
@ -563,9 +563,14 @@ class PresupuestoService extends BaseService
|
||||
// Tapa dura cosido y fresado
|
||||
else if($tipo_impresion_id == 1 || $tipo_impresion_id == 3){
|
||||
$ancho_total = floatval($datosPedido->ancho)*2 + floatval($datosPedido->lomo);
|
||||
$ancho_total += property_exists($datosPedido, 'lomo_cubierta')?$datosPedido->lomo_cubierta:0;
|
||||
// Se añaden 20mm de sangre por cada lado + 2 * 0.6mm de portada y contraportada -> total 41.2
|
||||
$ancho_total += (1.2+2*self::SANGRE_FORMAS_CUBIERTA);
|
||||
// si es cubierta
|
||||
// Se añaden 20mm de sangre por cada lado + 2 * 6mm de vuelo portada y contraportada -> total 52
|
||||
if($uso=="cubierta")
|
||||
$ancho_total += (12+2*self::SANGRE_FORMAS_CUBIERTA);
|
||||
// si es sobrecubierta
|
||||
// Se añaden 5mm de sangre por cada lado + 2 * 6mm de vuelo portada y contraportada -> total 52
|
||||
else
|
||||
$ancho_total += (12+2*self::SANGRE_FORMAS);
|
||||
}
|
||||
else{
|
||||
// En cualquier otro caso se le suma 5mm de sangre por cada lado
|
||||
@ -576,9 +581,9 @@ class PresupuestoService extends BaseService
|
||||
}
|
||||
|
||||
/**
|
||||
* Devuelve el ancho de la cubierta/sobrecubierta, incluido el lomo.
|
||||
* Devuelve el alto de la cubierta/sobrecubierta
|
||||
*/
|
||||
public static function getAltoTotalExteriores($tipo_impresion_id, $datosPedido=null)
|
||||
public static function getAltoTotalExteriores($uso="cubierta", $tipo_impresion_id, $datosPedido=null)
|
||||
{
|
||||
$alto_total = 0;
|
||||
|
||||
@ -586,8 +591,14 @@ class PresupuestoService extends BaseService
|
||||
$alto_total = floatval($datosPedido->alto);
|
||||
// Tapa dura (cosido y fresado)
|
||||
if($tipo_impresion_id == 1 || $tipo_impresion_id == 3){
|
||||
// Se añaden 20mm de sangre por cada lado + 0.7mm extra que sobresale -> total 40.7
|
||||
$alto_total += (0.7+2*self::SANGRE_FORMAS_CUBIERTA);
|
||||
// Se añaden 20mm de sangre por cada lado + 7mm extra que sobresale -> total 47
|
||||
if($uso=="cubierta")
|
||||
$alto_total += (7+2*self::SANGRE_FORMAS_CUBIERTA);
|
||||
// si es sobrecubierta
|
||||
// Se añaden 5mm de sangre por cada lado + 7mm de vuelo -> total 52
|
||||
else
|
||||
$alto_total += (7+2*self::SANGRE_FORMAS);
|
||||
|
||||
}
|
||||
// En cualquier otro caso se le suma 5mm de sangre por cada lado
|
||||
else{
|
||||
|
||||
0
ci4/app/Views/themes/backend/vuexy/form/clientes/cliente/convert2templateModal.php
Normal file → Executable file
0
ci4/app/Views/themes/backend/vuexy/form/clientes/cliente/convert2templateModal.php
Normal file → Executable file
@ -15,8 +15,7 @@
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="mb-1">
|
||||
<label for="paginas" class="form-label">
|
||||
<?= lang('Presupuestos.paginas') ?>*
|
||||
</label>
|
||||
@ -24,37 +23,21 @@
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<?php if($tipo_impresion_id != 1 && $tipo_impresion_id != 3 && $tipo_impresion_id != 5 && $tipo_impresion_id != 7): ?>
|
||||
<div class="row">
|
||||
|
||||
<div class="mb-3">
|
||||
|
||||
<div class="form-check form-switch mb-2">
|
||||
<input class="form-check-input" type="checkbox" id="solapas" name="solapas" tabindex="6" value="1" <?= $presupuestoEntity->solapas == true ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label" for="solapas"><?= lang('Presupuestos.solapasCubierta') ?></label>
|
||||
</div>
|
||||
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</div><!--//.col -->
|
||||
|
||||
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<div class="mb-3">
|
||||
<div class="mb-1">
|
||||
<label for="tirada" class="form-label">
|
||||
<?= lang('Presupuestos.tirada') ?>*
|
||||
</label>
|
||||
<input type="number" id="tirada" name="tirada" tabindex="2" maxLength="11" class="form-control" value="<?= old('tirada', $presupuestoEntity->tirada) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div><!--//.col -->
|
||||
|
||||
|
||||
<div class="col-md-12 col-lg-4 px-4">
|
||||
<div class="mb-3">
|
||||
<div class="mb-1">
|
||||
<label id="label_papelFormatoId" for="papelFormatoId" class="form-label">
|
||||
<?= lang('Presupuestos.papelFormatoId') ?>*
|
||||
</label>
|
||||
@ -72,30 +55,24 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-6">
|
||||
<div class="mb-3">
|
||||
<input <?= $presupuestoEntity->papel_formato_personalizado == true ? '' : 'style="display: none"'; ?> type="number" id="papelFormatoAncho" name="papel_formato_ancho" maxLength="8" step="0.01" class="form-control" value="<?= old('papel_formato_ancho', $presupuestoEntity->papel_formato_ancho) ?>">
|
||||
<div class="mb-1">
|
||||
<input <?= $presupuestoEntity->papel_formato_personalizado == true ? '' : 'style="display: none"'; ?> type="number" id="papelFormatoAncho" name="papel_formato_ancho" maxLength="8" step="0.01" class="form-control formato_libro" value="<?= old('papel_formato_ancho', $presupuestoEntity->papel_formato_ancho) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
<div class="col-md-12 col-lg-6">
|
||||
<div class="mb-3">
|
||||
<input <?= $presupuestoEntity->papel_formato_personalizado == true ? '' : 'style="display: none"'; ?> type="number" id="papelFormatoAlto" name="papel_formato_alto" maxLength="8" step="0.01" class="form-control" value="<?= old('papel_formato_alto', $presupuestoEntity->papel_formato_alto) ?>">
|
||||
<div class="mb-1">
|
||||
<input <?= $presupuestoEntity->papel_formato_personalizado == true ? '' : 'style="display: none"'; ?> type="number" id="papelFormatoAlto" name="papel_formato_alto" maxLength="8" step="0.01" class="form-control formato_libro" value="<?= old('papel_formato_alto', $presupuestoEntity->papel_formato_alto) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
</div>
|
||||
|
||||
|
||||
<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><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<div class="mb-3">
|
||||
<div class="mb-1">
|
||||
<label for="merma" class="form-label">
|
||||
<?= lang('Presupuestos.merma') ?>*
|
||||
</label>
|
||||
@ -104,7 +81,7 @@
|
||||
</div><!--//.col -->
|
||||
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<div class="mb-3">
|
||||
<div class="mb-1">
|
||||
<label for="mermacubierta" class="form-label">
|
||||
<?= lang('Presupuestos.mermacubierta') ?>*
|
||||
</label>
|
||||
@ -114,36 +91,133 @@
|
||||
|
||||
</div> <!--//.row -->
|
||||
|
||||
|
||||
|
||||
<!-- Fila 2 -->
|
||||
<div class="row">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<?php if($tipo_impresion_id != 1 && $tipo_impresion_id != 3 && $tipo_impresion_id != 5 && $tipo_impresion_id != 7): ?>
|
||||
<?php if($presupuestoEntity->solapas == true): ?>
|
||||
<div class="row" id="div_solapas_ancho">
|
||||
<?php else: ?>
|
||||
<div class="row" id="div_solapas_ancho" style="display:none;">
|
||||
<?php endif; ?>
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="solapas_ancho" class="form-label">
|
||||
<?= lang('Presupuestos.solapasAnchoCubierta') ?>*
|
||||
<?php if($tipo_impresion_id != 1 && $tipo_impresion_id != 3 && $tipo_impresion_id != 5 && $tipo_impresion_id != 7): ?>
|
||||
<div class="row">
|
||||
<div class="mb-1">
|
||||
<div class="form-check form-switch mb-2">
|
||||
<input class="form-check-input solapas_cubierta" type="checkbox" id="solapas" name="solapas" tabindex="6" value="1" <?= $presupuestoEntity->solapas == true ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label" for="solapas"><?= lang('Presupuestos.solapasCubierta') ?></label>
|
||||
</div>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<div class="row">
|
||||
<div class="mb-1">
|
||||
<div class="form-check form-switch mb-2">
|
||||
<input class="form-check-input solapas_sobrecubierta" type="checkbox" id="solapas_sobrecubierta" name="solapas_sobrecubierta" tabindex="6" value="1" <?= $presupuestoEntity->solapas_sobrecubierta == true ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label" for="solapas_sobrecubierta"><?= lang('Presupuestos.solapasSobrecubierta') ?></label>
|
||||
</div>
|
||||
</div><!--//.mb-3 -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<div class="row">
|
||||
<div class="mb-1">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Fila 3 -->
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<?php if($tipo_impresion_id != 1 && $tipo_impresion_id != 3 && $tipo_impresion_id != 5 && $tipo_impresion_id != 7): ?>
|
||||
<?php if($presupuestoEntity->solapas == true): ?>
|
||||
<div class="mb-1" id="div_solapas_ancho">
|
||||
<?php else: ?>
|
||||
<div class="mb-1" id="div_solapas_ancho" style="display:none;">
|
||||
<?php endif; ?>
|
||||
|
||||
<label for="solapas_ancho" class="form-label">
|
||||
<?= lang('Presupuestos.solapasAnchoCubierta') ?>*
|
||||
</label>
|
||||
<input type="number" id="solapas_ancho" name="solapas_ancho" placeholder="0" maxLength="8" step="1" class="form-control solapas_cubierta" value="<?= old('solapas_ancho', $presupuestoEntity->solapas_ancho) ?>">
|
||||
</div><!--//.mb-1 -->
|
||||
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<?php if($presupuestoEntity->solapas_sobrecubierta == true): ?>
|
||||
<div class="mb-1" id="div_solapas_ancho_sobrecubierta">
|
||||
<?php else: ?>
|
||||
<div class="mb-1" id="div_solapas_ancho_sobrecubierta" style="display:none;">
|
||||
<?php endif; ?>
|
||||
<label for="solapas_ancho_sobrecubierta" class="form-label">
|
||||
<?= lang('Presupuestos.solapasAnchoSobrecubierta') ?>*
|
||||
</label>
|
||||
<input type="number" id="solapas_ancho" name="solapas_ancho" placeholder="6.00" maxLength="8" step="0.01" class="form-control" value="<?= old('solapas_ancho', $presupuestoEntity->solapas_ancho) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
<input type="number" id="solapas_ancho_sobrecubierta" name="solapas_ancho_sobrecubierta" placeholder="0" maxLength="8" step="1" class="form-control solapas_sobrecubierta" value="<?= old('solapas_ancho', $presupuestoEntity->solapas_ancho_sobrecubierta) ?>">
|
||||
</div><!--//.mb-1 -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!----------------------------------------------------------------------------->
|
||||
<?php if(str_contains($formAction,'edit')): ?>
|
||||
|
||||
<div class="divider divider-dark text-start mb-1">
|
||||
<div class="divider-text">
|
||||
<h5><?= lang("Presupuestos.acabadosExteriores") ?></h5>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<div class="row">
|
||||
<div class="mb-1">
|
||||
<label id="label_acabado_cubierta_id" for="acabado_cubierta_id" class="form-label">
|
||||
<?= lang('Presupuestos.acabadoCubierta') ?>*
|
||||
</label>
|
||||
<select id="acabado_cubierta_id" name="acabado_cubierta_id" tabindex="3" class="form-control select2bs2" style="width: 100%;">
|
||||
<?php if (isset($acabadosCubierta) && is_array($acabadosCubierta) && !empty($acabadosCubierta)) :
|
||||
foreach ($acabadosCubierta as $acabado) : ?>
|
||||
<option value="<?= $acabado->id ?>" <?= $acabado->id == $presupuestoEntity->acabado_cubierta_id ? ' selected' : '' ?>>
|
||||
<?= $acabado->label ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<div class="row">
|
||||
<div class="mb-1">
|
||||
<label id="label_acabado_sobrecubierta_id" for="acabado_sobrecubierta_id" class="form-label">
|
||||
<?= lang('Presupuestos.acabadoSobrecubierta') ?>*
|
||||
</label>
|
||||
<select id="acabado_sobrecubierta_id" name="acabado_sobrecubierta_id" tabindex="3" class="form-control select2bs2" style="width: 100%;">
|
||||
<?php if (isset($acabadosSobrecubierta) && is_array($acabadosSobrecubierta) && !empty($acabadosSobrecubierta)) :
|
||||
foreach ($acabadosSobrecubierta as $acabado) : ?>
|
||||
<option value="<?= $acabado->id ?>" <?= $acabado->id == $presupuestoEntity->acabado_sobrecubierta_id ? ' selected' : '' ?>>
|
||||
<?= $acabado->label ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!----------------------------------------------------------------------------->
|
||||
<div class="divider divider-dark text-start mb-1">
|
||||
<div class="divider-text">
|
||||
<h5><?= lang("Presupuestos.opcionesPresupuesto") ?></h5>
|
||||
@ -279,6 +353,14 @@ $('#paginas').on("change", function () {
|
||||
}
|
||||
});
|
||||
|
||||
$('.solapas_cubierta').on('change', function(){
|
||||
$('#compGramajeCubierta').trigger('change')
|
||||
})
|
||||
|
||||
$('.solapas_sobrecubierta').on('change', function(){
|
||||
$('#compGramajeSobrecubierta').trigger('change')
|
||||
})
|
||||
|
||||
$('#tirada').on("change", function () {
|
||||
|
||||
calcular_mermas()
|
||||
@ -306,7 +388,7 @@ function calcular_mermas(){
|
||||
merma_lineas = []
|
||||
tableLineasPresupuesto.rows().every( function ( rowIdx, tableLoop, rowLoop ) {
|
||||
var rowData = this.data();
|
||||
if(rowData.row_id != 'lp_cubierta' && rowData.row_id != 'lp_sobrecubierta'){
|
||||
if(rowData.row_id != 'lp_guardas' && rowData.row_id != 'lp_cubierta' && rowData.row_id != 'lp_sobrecubierta'){
|
||||
const formas_linea = <?php echo $isCosido; ?>==0?parseInt(rowData.formas):parseInt(rowData.formas)/2
|
||||
if(formas_linea > tirada)
|
||||
merma_lineas.push(formas_linea-tirada)
|
||||
@ -359,7 +441,7 @@ $('#papelFormatoPersonalizado').on("click",function(){
|
||||
document.getElementById("papelFormatoAncho").style.display = "block";
|
||||
document.getElementById("papelFormatoAlto").style.display = "block";
|
||||
$('#papelFormatoId').next(".select2-container").hide();
|
||||
$('#papelFormatoId').val('').change();
|
||||
$('#papelFormatoId').val(0).change();
|
||||
document.getElementById("label_papelFormatoId").innerHTML =
|
||||
"<?=lang('Presupuestos.papelFormatoId') ?> (" +
|
||||
"<?=lang('Presupuestos.papelFormatoAncho') ?> x <?=lang('Presupuestos.papelFormatoAncho') ?>)*";
|
||||
@ -404,36 +486,60 @@ $('#papelFormatoPersonalizado').on("click",function(){
|
||||
});
|
||||
|
||||
|
||||
$('#papelFormatoId').on('select2:select', function (e){
|
||||
$('#papelFormatoId').on('select2:select', event_change_formato)
|
||||
$('.formato_libro').on('change', event_change_formato)
|
||||
|
||||
function event_change_formato(){
|
||||
ancho_libro = getDimensionLibro().ancho;
|
||||
alto_libro = getDimensionLibro().alto;
|
||||
|
||||
checkPaginasPresupuesto()
|
||||
updateLineasPresupuesto()
|
||||
// Si es negro o color
|
||||
if ($('#tipoImpresion').select2('data')[0].id == 'negro' ||
|
||||
$('#tipoImpresion').select2('data')[0].id == 'color') {
|
||||
$('#compPaginasNegro').trigger('change')
|
||||
}
|
||||
// Si es negrohq o colorhq
|
||||
if ($('#tipoImpresion').select2('data')[0].id == 'negrohq' ||
|
||||
$('#tipoImpresion').select2('data')[0].id == 'colorhq') {
|
||||
$('#compPaginasNegrohq').trigger('change');
|
||||
}
|
||||
|
||||
$('#compPapelCubierta').trigger('change');
|
||||
$('#compPapelSobrecubierta').trigger('change');
|
||||
|
||||
update_servicios(false)
|
||||
})
|
||||
}
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
$('#papelFormatoAncho').on('change', function (e){
|
||||
ancho_libro = getDimensionLibro().ancho;
|
||||
alto_libro = getDimensionLibro().alto;
|
||||
})
|
||||
|
||||
$('#papelFormatoAlto').on('change', function (e){
|
||||
ancho_libro = getDimensionLibro().ancho;
|
||||
alto_libro = getDimensionLibro().alto;
|
||||
})
|
||||
|
||||
<?php if($tipo_impresion_id != 1 && $tipo_impresion_id != 3 && $tipo_impresion_id != 5 && $tipo_impresion_id != 7): ?>
|
||||
$("#solapas").on("click", function () {
|
||||
var e = document.getElementById('div_solapas_ancho');
|
||||
if (document.getElementById('solapas').checked) {
|
||||
e.style.display = "flex";
|
||||
e.style.display = "block";
|
||||
}
|
||||
else {
|
||||
e.style.display = "none";
|
||||
$('#solapas_ancho').val(0)
|
||||
}
|
||||
|
||||
$('#serv_default').click()
|
||||
});
|
||||
<?php endif; ?>
|
||||
|
||||
$("#solapas_sobrecubierta").on("click", function () {
|
||||
var e = document.getElementById('div_solapas_ancho_sobrecubierta');
|
||||
if (document.getElementById('solapas_sobrecubierta').checked) {
|
||||
e.style.display = "block";
|
||||
}
|
||||
else {
|
||||
e.style.display = "none";
|
||||
$('#solapas_ancho_sobrecubierta').val(0)
|
||||
}
|
||||
|
||||
$('#serv_default').click()
|
||||
});
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
@ -215,6 +215,41 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<p><?= lang('PapelImpresion.sobrecubierta') ?></p>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<select id="compSobrecubierta" name="comp_sobrecubierta" class="form-control select2bs2 comp_sobrecubierta_items" style="width: 100%;">
|
||||
<option value="0">
|
||||
<p><?= lang('Presupuestos.no') ?></p>
|
||||
</option>
|
||||
<option value="1">
|
||||
<p><?= lang('Presupuestos.si') ?></p>
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<select id="compPapelSobrecubierta" name="comp_papel_sobrecubierta" class="form-control select2bs2 comp_sobrecubierta_items" disabled style="width: 100%;">
|
||||
<?php if (isset($papelGenericoSobrecubiertaList) && is_array($papelGenericoSobrecubiertaList) && !empty($papelGenericoSobrecubiertaList)) :
|
||||
foreach ($papelGenericoSobrecubiertaList as $k => $v) : ?>
|
||||
<option value="<?= $v->id ?>">
|
||||
<?= $v->nombre ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<select id="compGramajeSobrecubierta" name="comp_gramaje_sobrecubierta" class="form-control select2bs2 comp_sobrecubierta_items" disabled style="width: 100%;">
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<hr class="my-1">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if($tipo_impresion_id == 1 || $tipo_impresion_id == 3 || $tipo_impresion_id == 5 || $tipo_impresion_id == 7): ?>
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
@ -409,7 +444,7 @@
|
||||
<div class="card accordion-item active">
|
||||
<h2 class="accordion-header" id="headingThree">
|
||||
<button id="accordion-button-cubierta" type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionCompCubiertaSobrecubiertaTip" aria-expanded="false" aria-controls="accordionCompCubiertaSobrecubiertaTip">
|
||||
<h6 id="title_cubierta"><?= lang("Presupuestos.cubierta") ?></h6>
|
||||
<h6 id="title_cubierta"><?= lang("Presupuestos.compCubiertaSobrecubierta") ?></h6>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
@ -441,7 +476,7 @@
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td class="dt-result dt-result-text" colspan="14"><?= lang('Presupuestos.total') ?> <?= lang("Presupuestos.compInteriorPlana") ?>:</td>
|
||||
<td class="dt-result dt-result-text" colspan="14"><?= lang('Presupuestos.total') ?> <?= lang("Presupuestos.compCubiertaSobrecubierta") ?>:</td>
|
||||
<td id="total_comp_cubierta" class="dt-result dt-result-value" colspan="2"> 0.00 </td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
@ -451,7 +486,7 @@
|
||||
<button type="button" name="insertarCubiertaBtn"
|
||||
id="insertarCubiertaBtn"
|
||||
class="btn btn-primary float-end me-sm-3 me-1 mb-3 insertarLinea d-none">
|
||||
<?= lang('Presupuestos.insertarLinea').' '.strtoupper(lang('Presupuestos.cubierta')) ?>
|
||||
<?= lang('Presupuestos.insertarLinea').' '.strtoupper(lang('Presupuestos.compCubiertaSobrecubierta')) ?>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@ -682,9 +717,19 @@
|
||||
allowClear: false,
|
||||
});
|
||||
|
||||
$('#compPapelSobrecubierta').select2({
|
||||
allowClear: false,
|
||||
});
|
||||
|
||||
$('#compGramajeSobrecubierta').select2({
|
||||
allowClear: false,
|
||||
minimumResultsForSearch: Infinity,
|
||||
});
|
||||
|
||||
$('#encuadernacion').select2({
|
||||
allowClear: false,
|
||||
});
|
||||
|
||||
|
||||
<?php if($tipo_impresion_id == 1 || $tipo_impresion_id == 3 || $tipo_impresion_id == 5 || $tipo_impresion_id == 7): ?>
|
||||
$('#compCarasCubierta').select2({
|
||||
@ -711,6 +756,22 @@
|
||||
computarPaginasColor($('#compPosPaginasColor').val());
|
||||
}
|
||||
|
||||
$('#compSobrecubierta').on('change', function(){
|
||||
if ($('#compSobrecubierta').val()==1){
|
||||
value = false
|
||||
}
|
||||
else{
|
||||
value = 'disabled'
|
||||
$('#compPapelSobrecubierta').val(0)
|
||||
$('#compGramajeSobrecubierta').val('')
|
||||
$('#compGramajeSobrecubierta').select2("destroy")
|
||||
$('#compGramajeSobrecubierta').select2({allowClear: false, minimumResultsForSearch: Infinity})
|
||||
|
||||
}
|
||||
$('#compPapelSobrecubierta').prop('disabled', value);
|
||||
$('#compGramajeSobrecubierta').prop('disabled', value);
|
||||
})
|
||||
|
||||
function init_lineas_comparador(){
|
||||
var comp_data = <?php echo json_encode($comp_data); ?>
|
||||
|
||||
@ -772,6 +833,20 @@
|
||||
}catch(e){}
|
||||
}catch(e){}
|
||||
|
||||
try{
|
||||
$("#compSobrecubierta").val(parseInt(comp_data.sobrecubierta.imprimir)).change();
|
||||
try{
|
||||
$("#compPapelSobrecubierta").val(parseInt(comp_data.sobrecubierta.papel_id)).trigger('select2:select');
|
||||
|
||||
try{
|
||||
var newState = new Option(comp_data.sobrecubierta.gramaje, comp_data.sobrecubierta.gramaje, true, true);
|
||||
// Append it to the select
|
||||
$("#compGramajeSobrecubierta").append(newState).trigger('change');
|
||||
$('#compGramajeSobrecubierta').prop('disabled', false);
|
||||
}catch(e){}
|
||||
}catch(e){}
|
||||
}catch(e){}
|
||||
|
||||
try{
|
||||
$("#compCarasGuardas").val(parseInt(comp_data.guardas.paginas_impresion)).change();
|
||||
$("#compPapelGuardas").val(parseInt(comp_data.guardas.papel_id)).trigger('change');
|
||||
@ -902,7 +977,7 @@
|
||||
searching: false,
|
||||
paging: false,
|
||||
info: false,
|
||||
ordering: false,
|
||||
ordering: true,
|
||||
responsive: true,
|
||||
select: false,
|
||||
language: {
|
||||
@ -945,7 +1020,8 @@
|
||||
visible: false,
|
||||
searchable: false
|
||||
},
|
||||
]
|
||||
],
|
||||
"order": [ [0, 'asc'],[15, 'asc'] ]
|
||||
});
|
||||
|
||||
<?php if($tipo_impresion_id == 1 || $tipo_impresion_id == 3 || $tipo_impresion_id == 5 || $tipo_impresion_id == 7): ?>
|
||||
@ -1243,7 +1319,7 @@
|
||||
alto: dimension.alto,
|
||||
lomo: getLomoLineasPresupuesto(),
|
||||
solapas: $('#solapas').is(':checked')?1:0,
|
||||
solapas_ancho: parseInt($('#solapas_ancho').val()),
|
||||
solapas_ancho: $('#solapas').is(':checked')?parseInt($('#solapas_ancho').val()):0,
|
||||
papel_generico_id: $('#compPapelCubierta').select2('data')[0].id,
|
||||
papel_generico: $('#compPapelCubierta').select2('data')[0].text.trim(),
|
||||
gramaje: $('#compGramajeCubierta').select2('data')[0].text.trim() ,
|
||||
@ -1260,22 +1336,28 @@
|
||||
clearCubierta();
|
||||
|
||||
if(data.lineas.length >0){
|
||||
|
||||
fillCubierta(data);
|
||||
selectCubiertaLineas();
|
||||
$('#title_cubierta').html('<?= lang("Presupuestos.cubierta") ?>' + ' (' + tableCompCubierta.rows().count() + ')');
|
||||
tableCompCubierta.order([0, 'asc']).draw()
|
||||
$('#title_cubierta').html('<?= lang("Presupuestos.compCubiertaSobrecubierta") ?>' + (tableCompCubierta.rows().count()>0 ?(' (' + tableCompCubierta.rows().count() + ')'):''));
|
||||
$('#insertarCubiertaBtn').removeClass('d-none')
|
||||
if(actualizarLinea){
|
||||
var rows = $("#tableCompCubierta").DataTable().rows( '.selected' ).data().toArray();
|
||||
for(row of rows){
|
||||
fill_lp_cubierta(row, true);
|
||||
if (row.tipo=='cubierta')
|
||||
fill_lp_cubierta(row, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
$('#title_cubierta').html('<?= lang("Presupuestos.cubierta") ?>');
|
||||
$('#insertarCubiertaBtn').addClass('d-none')
|
||||
$('#total_comp_cubierta').html('0.00')
|
||||
$('#title_cubierta').html('<?= lang("Presupuestos.compCubiertaSobrecubierta") ?>' + (tableCompCubierta.rows().count()>0 ?(' (' + tableCompCubierta.rows().count() + ')'):''));
|
||||
if(tableCompCubierta.rows().count()==0){
|
||||
$('#insertarCubiertaBtn').addClass('d-none')
|
||||
$('#total_comp_cubierta').html('0.00')
|
||||
}
|
||||
else{
|
||||
selectCubiertaLineas();
|
||||
}
|
||||
|
||||
}
|
||||
yeniden(data.<?= csrf_token() ?>);
|
||||
@ -1289,6 +1371,88 @@
|
||||
|
||||
else{
|
||||
clearCubierta();
|
||||
}
|
||||
}
|
||||
|
||||
$('.comp_sobrecubierta_items').on('change', function (){
|
||||
|
||||
checkComparadorSobrecubierta()
|
||||
});
|
||||
|
||||
|
||||
function checkComparadorSobrecubierta(actualizarLinea = false){
|
||||
|
||||
if ($('#compSobrecubierta option:selected').val() == 1 &&
|
||||
$('#compPapelSobrecubierta').select2('data').length > 0 &&
|
||||
$('#compGramajeSobrecubierta').select2('data').length > 0 ){
|
||||
|
||||
|
||||
const dimension = getDimensionLibro();
|
||||
|
||||
let datos = {
|
||||
tipo_impresion_id: <?php echo $tipo_impresion_id ?>,
|
||||
type: 'sobrecubierta',
|
||||
paginas: 4,
|
||||
tirada: parseInt($('#tirada').val()),
|
||||
merma: parseInt($('#mermacubierta').val()),
|
||||
color: 1,
|
||||
ancho: dimension.ancho,
|
||||
alto: dimension.alto,
|
||||
lomo: getLomoLineasPresupuesto() + getLomoCubiertaLineasPresupuesto(),
|
||||
solapas: $('#solapas_sobrecubierta').is(':checked')?1:0,
|
||||
solapas_ancho: $('#solapas_sobrecubierta').is(':checked')?parseInt($('#solapas_ancho_sobrecubierta').val()):0,
|
||||
papel_generico_id: $('#compPapelSobrecubierta').select2('data')[0].id,
|
||||
papel_generico: $('#compPapelSobrecubierta').select2('data')[0].text.trim(),
|
||||
gramaje: $('#compGramajeSobrecubierta').select2('data')[0].text.trim() ,
|
||||
cliente_id: $('#clienteId').find(":selected").val(),
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/cosidotapablanda/datatable",
|
||||
data: datos,
|
||||
success: function (data) {
|
||||
|
||||
clearSobrecubierta();
|
||||
|
||||
if(data.lineas.length >0){
|
||||
|
||||
fillSobrecubierta(data);
|
||||
selectCubiertaLineas();
|
||||
tableCompCubierta.order([ [0, 'asc'],[15, 'asc'] ]).draw()
|
||||
$('#title_cubierta').html('<?= lang("Presupuestos.compCubiertaSobrecubierta") ?>' + (tableCompCubierta.rows().count()>0 ?(' (' + tableCompCubierta.rows().count() + ')'):''));
|
||||
$('#insertarCubiertaBtn').removeClass('d-none')
|
||||
if(actualizarLinea){
|
||||
var rows = $("#tableCompCubierta").DataTable().rows( '.selected' ).data().toArray();
|
||||
for(row of rows){
|
||||
if (row.tipo=='sobrecubierta')
|
||||
fill_lp_sobrecubierta(row, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
$('#title_cubierta').html('<?= lang("Presupuestos.compCubiertaSobrecubierta") ?>' + (tableCompCubierta.rows().count()>0 ?(' (' + tableCompCubierta.rows().count() + ')'):''));
|
||||
if(tableCompCubierta.rows().count()==0){
|
||||
$('#insertarCubiertaBtn').addClass('d-none')
|
||||
$('#total_comp_cubierta').html('0.00')
|
||||
}
|
||||
else{
|
||||
selectCubiertaLineas();
|
||||
}
|
||||
|
||||
}
|
||||
yeniden(data.<?= csrf_token() ?>);
|
||||
return true;
|
||||
},
|
||||
error: function(e){
|
||||
return false;
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
else{
|
||||
clearSobrecubierta();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1612,8 +1776,7 @@
|
||||
$('#compGramajeCubierta').prop('disabled', true);
|
||||
}
|
||||
else{
|
||||
$('#insertarCubiertaBtn').addClass('d-none')
|
||||
$('#total_comp_cubierta').html('0.00')
|
||||
clearCubierta();
|
||||
$('#compGramajeCubierta').empty().trigger("change");
|
||||
$('#compGramajeCubierta').val('').trigger('change');
|
||||
$('#compGramajeCubierta').prop('disabled', false);
|
||||
@ -1649,6 +1812,53 @@
|
||||
}
|
||||
});
|
||||
|
||||
$('#compPapelSobrecubierta').on('select2:open', function (e){
|
||||
$('#compGramajeSobrecubierta').val(0).trigger('change');
|
||||
$('#compGramajeSobrecubierta').select2("destroy")
|
||||
$('#compGramajeSobrecubierta').select2({allowClear: false, minimumResultsForSearch: Infinity})
|
||||
})
|
||||
|
||||
|
||||
$('#compPapelSobrecubierta').on('select2:select', function (e){
|
||||
if($('#compPapelSobrecubierta').select2('data')[0].id=='0'){
|
||||
|
||||
$('#compGramajeSobrecubierta').prop('disabled', true);
|
||||
}
|
||||
else{
|
||||
clearSobrecubierta();
|
||||
$('#compGramajeSobrecubierta').prop('disabled', false);
|
||||
$('#compPapelSobrecubierta').find('option[value="0"]').remove();
|
||||
$('#compGramajeSobrecubierta').select2({
|
||||
allowClear: false,
|
||||
minimumResultsForSearch: Infinity,
|
||||
ajax: {
|
||||
url: '<?= route_to("menuItemsOfCosidotapablanda") ?>',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
|
||||
data: function (params) {
|
||||
return {
|
||||
tipo: 'gramaje',
|
||||
uso: 'sobrecubierta',
|
||||
tirada: parseInt($('#tirada').val()),
|
||||
merma: parseInt($('#mermacubierta').val()),
|
||||
datos: $('#compPapelSobrecubierta').select2('data')[0].text.trim() ,
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
};
|
||||
},
|
||||
delay: 60,
|
||||
processResults: function (response) {
|
||||
yeniden(response.<?= csrf_token() ?>);
|
||||
return {
|
||||
results: response.menu
|
||||
};
|
||||
},
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function checkDatosPedidoForComp() {
|
||||
|
||||
|
||||
@ -259,13 +259,15 @@
|
||||
$(document).on('click', '.btn-delete-serv', function(e) {
|
||||
const dataId = $(this).attr('data-id');
|
||||
const rowId = $(this).closest('td').parent()[0].sectionRowIndex;
|
||||
|
||||
var dataText = null;
|
||||
|
||||
var table = "";
|
||||
if($(this).closest('table').attr('id').includes('tableOfServiciosEncuadernacion')){
|
||||
table = "tableOfServiciosEncuadernacion";
|
||||
}
|
||||
else if($(this).closest('table').attr('id').includes('tableOfServiciosAcabado')){
|
||||
table = "tableOfServiciosAcabado";
|
||||
dataText = $(this).attr('data-text');
|
||||
}
|
||||
else if($(this).closest('table').attr('id').includes('tableOfServiciosManipulado')){
|
||||
table = "tableOfServiciosManipulado";
|
||||
@ -278,11 +280,18 @@
|
||||
}
|
||||
|
||||
if(table != ""){
|
||||
if(dataText==null){
|
||||
$('#' + table).DataTable().rows( function ( idx, data, node ) {
|
||||
return data[0] === dataId;
|
||||
} )
|
||||
.remove()
|
||||
.draw();
|
||||
}
|
||||
$('#' + table).DataTable().rows( function ( idx, data, node ) {
|
||||
return data[0] === dataId;
|
||||
} )
|
||||
.remove()
|
||||
.draw();
|
||||
return ((data[0] === dataId) && (data[1]=== dataText));
|
||||
} )
|
||||
.remove()
|
||||
.draw();
|
||||
}
|
||||
|
||||
check_serv_enc_error()
|
||||
@ -528,13 +537,20 @@
|
||||
|
||||
serviciosacabadosList.forEach((element) =>{
|
||||
|
||||
nombre_completo = element.nombre
|
||||
if (element.cubierta == 1){
|
||||
nombre_completo += ' (<?= lang("Presupuestos.cubierta") ?>)'
|
||||
}
|
||||
else if (element.sobrecubierta == 1){
|
||||
nombre_completo += ' (<?= lang("Presupuestos.sobrecubierta") ?>)'
|
||||
}
|
||||
tableServiciosAcabado.row.add([
|
||||
element.tarifa_acabado_id,
|
||||
element.nombre,
|
||||
nombre_completo,
|
||||
'<span id="precio_unidad_acabado_' + element.tarifa_acabado_id + '">' + parseFloat(element.precio_unidad).toFixed(2) + '</span>',
|
||||
'<input class="update-totales" id="precio_total_acabado_' + element.tarifa_acabado_id +'" value="' + parseFloat(element.precio_total).toFixed(2) + '"></input>',
|
||||
'<span style="display: none;" class="update-totales" id="acabado_margen_' + element.tarifa_acabado_id + '">' + parseFloat(element.margen).toFixed(2) + '</span>',
|
||||
'<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete-serv mx-2" data-id="' + element.tarifa_acabado_id +'"></i></a>'
|
||||
'<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete-serv mx-2" data-id="' + element.tarifa_acabado_id +'" data-text="' + nombre_completo + '"></i></a>'
|
||||
]).draw(false)
|
||||
|
||||
})
|
||||
@ -561,7 +577,7 @@
|
||||
$('#serv-acabado-error').html(htmlString)
|
||||
}
|
||||
|
||||
function get_tarifas_acabado(tarifa_id = -1){
|
||||
function get_tarifas_acabado(tarifa_id = -1, uso=null){
|
||||
|
||||
if(parseInt($('#tirada').val())>0){
|
||||
var tirada = parseInt($('#tirada').val())
|
||||
@ -586,13 +602,17 @@
|
||||
|
||||
data.values.forEach((row) => {
|
||||
|
||||
nombre = row.tarifa_nombre
|
||||
if(uso!= null)
|
||||
nombre += ' (' + uso + ')'
|
||||
|
||||
tableServiciosAcabado.row.add([
|
||||
row.tarifa_id,
|
||||
row.tarifa_nombre,
|
||||
nombre,
|
||||
'<span id="precio_unidad_acabado_' + row.tarifa_id + '">' + parseFloat(row.precio_unidad).toFixed(2) + '</span>',
|
||||
'<input class="update-totales" id="precio_total_acabado_' + row.tarifa_id +'" value="' + parseFloat(row.total).toFixed(2) + '"></input>',
|
||||
'<span style="display: none;" class="update-totales" id="acabado_margen_' + row.tarifa_id + '">' + parseFloat(row.margen).toFixed(2) + '</span>',
|
||||
'<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete-serv mx-2" data-id="' + row.tarifa_id +'"></i></a>'
|
||||
'<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete-serv mx-2" data-id="' + row.tarifa_id +'" data-text="' + nombre +'"></i></a>'
|
||||
]).draw(false)
|
||||
});
|
||||
|
||||
@ -659,7 +679,14 @@
|
||||
const tarifa_text = $('#add_servicio_acabado_list').select2('data')[0].text.trim()
|
||||
|
||||
if( $('#add_servicio_acabado_list').select2('data')[0].text.trim().length > 0){
|
||||
if($('#tableOfServiciosAcabado tr > td:contains(' + tarifa_text + ')').length == 0)
|
||||
found = false
|
||||
var rows = $("#tableOfServiciosAcabado").DataTable().rows( ).data().toArray();
|
||||
for(row of rows){
|
||||
if(row[1]== tarifa_text)
|
||||
found = true
|
||||
continue
|
||||
}
|
||||
if(!found)
|
||||
get_tarifas_acabado($('#add_servicio_acabado_list').select2('data')[0].id);
|
||||
else{
|
||||
popErrorAlert("<?= lang("Presupuestos.errores.error_servicios_duplicados") ?>", 'serv-acabado-alert')
|
||||
@ -668,6 +695,18 @@
|
||||
check_serv_acabado_error()
|
||||
})
|
||||
|
||||
function insertar_acabado_exterior($servicio_id, $uso="cubierta"){
|
||||
|
||||
const tarifa_text = $('#add_servicio_acabado_list option[value="' + $servicio_id + '"]').text().trim() + ' (' +$uso + ')'
|
||||
|
||||
if($('#tableOfServiciosAcabado tr > td:contains(' + tarifa_text + ')').length == 0)
|
||||
get_tarifas_acabado($servicio_id, $uso);
|
||||
else{
|
||||
|
||||
}
|
||||
check_serv_acabado_error()
|
||||
}
|
||||
|
||||
function get_datos_acabado(){
|
||||
|
||||
var datosAcabado = []
|
||||
@ -680,6 +719,16 @@
|
||||
case 0:
|
||||
values['tarifa_id'] = $(this).text()
|
||||
break
|
||||
case 1:
|
||||
if($(this).text().includes(' (<?= lang("Presupuestos.cubierta") ?>)'))
|
||||
values['cubierta'] = 1
|
||||
else
|
||||
values['cubierta'] = 0
|
||||
if($(this).text().includes(' (<?= lang("Presupuestos.sobrecubierta") ?>)'))
|
||||
values['sobrecubierta'] = 1
|
||||
else
|
||||
values['sobrecubierta'] = 0
|
||||
break
|
||||
case 2:
|
||||
values['precio_unidad'] = $(this).text()
|
||||
break
|
||||
|
||||
@ -58,6 +58,7 @@
|
||||
<option value="lp_rot_bn"><?= lang('Presupuestos.rotativa_bn') ?></option>
|
||||
<option value="lp_rot_color"><?= lang('Presupuestos.rotativa_color') ?></option>
|
||||
<option value="lp_cubierta"><?= lang('Presupuestos.cubierta') ?></option>
|
||||
<option value="lp_sobrecubierta"><?= lang('Presupuestos.sobrecubierta') ?></option>
|
||||
<option value="lp_guardas"><?= lang('Presupuestos.Guardas') ?></option>
|
||||
</select>
|
||||
</div>
|
||||
@ -81,6 +82,7 @@ const papelGenericoCubiertaList = <?php echo json_encode($papelGenericoCubiertaL
|
||||
const papelGenericoSobrecubiertaList = <?php echo json_encode($papelGenericoSobrecubiertaList); ?>;
|
||||
const papelGenericoRotativaNegroList = <?php echo json_encode($papelGenericoRotativaNegroList); ?>;
|
||||
const papelGenericoRotativaColorList = <?php echo json_encode($papelGenericoRotativaColorList); ?>;
|
||||
|
||||
<?php if($tipo_impresion_id == 1 || $tipo_impresion_id == 3 || $tipo_impresion_id == 5 || $tipo_impresion_id == 7): ?>
|
||||
const papelGenericoGuardasList = <?php echo json_encode($papelGenericoGuardasList); ?>;
|
||||
<?php endif; ?>
|
||||
@ -545,6 +547,9 @@ var tableLineasPresupuesto = new DataTable('#tableLineasPresupuesto',{
|
||||
return select;
|
||||
|
||||
}
|
||||
else{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
{data: 'papel',
|
||||
@ -947,6 +952,9 @@ function clear_cubierta(){
|
||||
clear_lp_cubierta(true);
|
||||
}
|
||||
|
||||
function clear_sobrecubierta(){
|
||||
clear_lp_sobrecubierta(true);
|
||||
}
|
||||
|
||||
|
||||
$('.insertarLinea').on("click", function (e) {
|
||||
@ -995,7 +1003,21 @@ $('.insertarLinea').on("click", function (e) {
|
||||
|
||||
var rows = $("#tableCompCubierta").DataTable().rows( '.selected' ).data().toArray();
|
||||
for(row of rows){
|
||||
fill_lp_cubierta(row, true);
|
||||
if(row.tipo == 'cubierta'){
|
||||
fill_lp_cubierta(row, true);
|
||||
if($('#acabado_cubierta_id').val() > 0)
|
||||
insertar_acabado_exterior($('#acabado_cubierta_id').val(), '<?= lang("Presupuestos.cubierta") ?>')
|
||||
}
|
||||
}
|
||||
|
||||
clear_sobrecubierta();
|
||||
|
||||
for(row of rows){
|
||||
if(row.tipo == 'sobrecubierta'){
|
||||
fill_lp_sobrecubierta(row, true);
|
||||
if($('#acabado_sobrecubierta_id').val() > 0)
|
||||
insertar_acabado_exterior($('#acabado_sobrecubierta_id').val(), '<?= lang("Presupuestos.sobrecubierta") ?>')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1168,6 +1190,25 @@ $('#btn_addLinea').on("click", function (e) {
|
||||
eventos_lp_cubierta()
|
||||
break
|
||||
|
||||
case 'lp_sobrecubierta':
|
||||
var hayLinea = false
|
||||
for(let number=0;number<dataRows.length;number++){
|
||||
if(dataRows[number].row_id == 'lp_sobrecubierta'){
|
||||
hayLinea = true
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
if(hayLinea){
|
||||
popErrorAlert('<?=lang('Presupuestos.errores.lineaDuplicada') ?>', 'divAlarmasLineasPresupuesto');
|
||||
break
|
||||
}
|
||||
|
||||
var data = processRowData({tipo_maquina: 'toner'}, 'lp_sobrecubierta', 'lp-sobrecubierta');
|
||||
tableLineasPresupuesto.row.add(data).draw()
|
||||
eventos_lp_sobrecubierta()
|
||||
break
|
||||
|
||||
case 'lp_guardas':
|
||||
var hayLinea = false
|
||||
for(let number=0;number<dataRows.length;number++){
|
||||
@ -3359,7 +3400,7 @@ function calcularPresupuesto_cubierta(fromComparador=false, input_data={}){
|
||||
paginas_negro: 0,
|
||||
paginas_color: 0,
|
||||
solapas: $('#solapas').is(':checked')?1:0,
|
||||
solapas_ancho: parseInt($('#solapas_ancho').val()),
|
||||
solapas_ancho: $('#solapas').is(':checked')?parseInt($('#solapas_ancho').val()):0,
|
||||
tirada: parseInt($('#tirada').val()),
|
||||
merma: parseInt($('#mermacubierta').val()),
|
||||
ancho: dimension.ancho,
|
||||
@ -3454,6 +3495,8 @@ function fill_lp_cubierta(row, fromComparador=false){
|
||||
|
||||
$('#lp_cubierta_checkPapel').change()
|
||||
|
||||
check_update_sobrecubierta()
|
||||
|
||||
calcular_mermas()
|
||||
updateTotales(true, false, false)
|
||||
updateTablaEnvios()
|
||||
@ -3486,12 +3529,290 @@ function check_update_cubierta(){
|
||||
}
|
||||
|
||||
|
||||
|
||||
<!------------------------------------------->
|
||||
<!-- Código JS para sobrecubierta. -->
|
||||
<!------------------------------------------->
|
||||
|
||||
async function set_lp_sobrecubierta_gramaje(){
|
||||
|
||||
await $.ajax({
|
||||
type: 'post',
|
||||
url: '<?= route_to("menuItemsOfCosidotapablanda") ?>',
|
||||
beforeSend: function() {
|
||||
clear_lp_sobrecubierta(true)
|
||||
},
|
||||
data: {
|
||||
tipo: 'gramajeLineasPresupuesto',
|
||||
uso: 'sobrecubierta',
|
||||
datos: $('#lp_sobrecubierta_papel option:selected').val() ,
|
||||
tipoLinea: "colorhq",
|
||||
<?= csrf_token() ?? "token" ?>: <?= csrf_token() ?>v
|
||||
},
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
yeniden(data.<?= csrf_token() ?>);
|
||||
$.each(data.menu, function(item){
|
||||
var option = $('<option/>', {'value':data.menu[item].id, 'text':data.menu[item].text})
|
||||
$('#lp_sobrecubierta_gramaje').append(option);
|
||||
});
|
||||
$('#lp_sobrecubierta_gramaje').val('')
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
async function set_lp_sobrecubierta_papelImpresion(){
|
||||
|
||||
await $.ajax({
|
||||
type: 'post',
|
||||
url: '<?= route_to("menuItemsOfCosidotapablanda") ?>',
|
||||
beforeSend: function() {
|
||||
$('#lp_sobrecubierta_papelImpresion').empty()
|
||||
$('#lp_sobrecubierta_maquina').empty()
|
||||
clear_lp_sobrecubierta(false)
|
||||
},
|
||||
data: {
|
||||
tipo: 'papelImpresion',
|
||||
uso: 'sobrecubierta',
|
||||
datos: $('#lp_sobrecubierta_papel option:selected').val() ,
|
||||
gramaje: $('#lp_sobrecubierta_gramaje option:selected').text().trim() ,
|
||||
tipoLinea: "colorhq",
|
||||
<?= csrf_token() ?? "token" ?>: <?= csrf_token() ?>v
|
||||
},
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
yeniden(data.<?= csrf_token() ?>);
|
||||
$.each(data.menu, function(item){
|
||||
var option = $('<option/>', {'value':data.menu[item].id, 'text':data.menu[item].text})
|
||||
$('#lp_sobrecubierta_papelImpresion').append(option);
|
||||
});
|
||||
$('#lp_sobrecubierta_papelImpresion').val('')
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
async function set_lp_sobrecubierta_maquina(){
|
||||
|
||||
await $.ajax({
|
||||
type: 'post',
|
||||
url: '<?= route_to("menuItemsOfCosidotapablanda") ?>',
|
||||
beforeSend: function() {
|
||||
$('#lp_sobrecubierta_maquina').empty()
|
||||
clear_lp_sobrecubierta(false)
|
||||
},
|
||||
data: {
|
||||
tipo: 'maquina',
|
||||
uso: 'colorhq',
|
||||
tipoLinea: "sobrecubierta",
|
||||
uso_tarifa: "sobrecubierta",
|
||||
is_rotativa: 0,
|
||||
ancho: getDimensionLibro().ancho,
|
||||
alto: getDimensionLibro().alto,
|
||||
datos: parseInt($('#tirada').val()) + parseInt($('#merma').val()),
|
||||
papel_impresion: $('#lp_sobrecubierta_papelImpresion option:selected').val() ,
|
||||
<?= csrf_token() ?? "token" ?>: <?= csrf_token() ?>v
|
||||
},
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
yeniden(data.<?= csrf_token() ?>);
|
||||
$.each(data.menu, function(item){
|
||||
var option = $('<option/>', {'value':data.menu[item].maquina_id, 'text':data.menu[item].maquina})
|
||||
$('#lp_sobrecubierta_maquina').append(option);
|
||||
});
|
||||
$('#lp_sobrecubierta_maquina').val('')
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function clear_lp_sobrecubierta(clear_selectors){
|
||||
$(".lp-sobrecubierta-input" ).val("0")
|
||||
if(clear_selectors)
|
||||
$( ".lp-sobrecubierta-select").empty()
|
||||
}
|
||||
|
||||
|
||||
function change_lp_sobrecubierta_maquina(){
|
||||
|
||||
calcularPresupuesto_sobrecubierta();
|
||||
}
|
||||
|
||||
|
||||
function calcularPresupuesto_sobrecubierta(fromComparador=false, input_data={}){
|
||||
|
||||
const dimension = getDimensionLibro();
|
||||
|
||||
if(Object.keys(input_data).length == 0){
|
||||
|
||||
input_data = {
|
||||
paginas:4,
|
||||
papel_generico_id: $('#lp_sobrecubierta_papel option:selected').val(),
|
||||
papel_generico: $('#lp_sobrecubierta_papel option:selected').text().trim(),
|
||||
gramaje: $('#lp_sobrecubierta_gramaje option:selected').text().trim(),
|
||||
maquina_id: $('#lp_sobrecubierta_maquina option:selected').val(),
|
||||
papel_impresion_id: $('#lp_sobrecubierta_papelImpresion option:selected').val()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
let datos = {
|
||||
tipo_impresion_id: <?php echo $tipo_impresion_id ?>,
|
||||
type: 'sobrecubierta',
|
||||
color: 1,
|
||||
hq: 1,
|
||||
paginas: input_data.paginas,
|
||||
paginas_negro: 0,
|
||||
paginas_color: 0,
|
||||
solapas: $('#solapas_sobrecubierta').is(':checked')?1:0,
|
||||
solapas_ancho: $('#solapas_sobrecubierta').is(':checked')?parseInt($('#solapas_ancho_sobrecubierta').val()):0,
|
||||
tirada: parseInt($('#tirada').val()),
|
||||
merma: parseInt($('#mermacubierta').val()),
|
||||
ancho: dimension.ancho,
|
||||
alto: dimension.alto,
|
||||
lomo: getLomoLineasPresupuesto() + getLomoCubiertaLineasPresupuesto,
|
||||
papel_generico_id: input_data.papel_generico_id,
|
||||
papel_generico: input_data.papel_generico,
|
||||
gramaje: input_data.gramaje,
|
||||
cliente_id: $('#clienteId').find(":selected").val(),
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/cosidotapablanda/datatable",
|
||||
data: datos,
|
||||
success: function (data) {
|
||||
|
||||
if(data.lineas.length >0){
|
||||
// Se cogen los valores de la linea con los datos correspondientes
|
||||
$.each(data.lineas, function(key, value) {
|
||||
if(value.fields.maquina_id === input_data.maquina_id &&
|
||||
value.fields.papel_generico_id === input_data.papel_generico_id &&
|
||||
value.fields.papel_impresion_id === input_data.papel_impresion_id) {
|
||||
|
||||
if(Object.keys(input_data).length == 0){
|
||||
value.fields.check_papel_total = $('#lp_sobrecubierta' + '_checkPapel').is(":checked")?1:0
|
||||
value.fields.check_impresion_total = $('#lp_sobrecubierta' + '_checkClicks').is(":checked")?1:0
|
||||
}
|
||||
else{
|
||||
value.fields.check_papel_total = 1
|
||||
value.fields.check_impresion_total = 1
|
||||
}
|
||||
fill_lp_sobrecubierta(value.fields);
|
||||
return false;
|
||||
}
|
||||
clear_lp_sobrecubierta(false);
|
||||
});
|
||||
|
||||
}
|
||||
else{
|
||||
|
||||
}
|
||||
yeniden(data.<?= csrf_token() ?>);
|
||||
|
||||
},
|
||||
error: function(e){
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
function fill_lp_sobrecubierta(row, fromComparador=false){
|
||||
|
||||
if(fromComparador){
|
||||
|
||||
var input_data = {
|
||||
paginas: row.paginas,
|
||||
papel_generico_id: row.papelGenericoId,
|
||||
gramaje: row.gramaje,
|
||||
papel_impresion_id: row.papelImpresionId,
|
||||
maquina_id: row.maquinaId,
|
||||
}
|
||||
|
||||
calcularPresupuesto_sobrecubierta(false, input_data);
|
||||
|
||||
}
|
||||
else{
|
||||
|
||||
var portadaObjeto = {
|
||||
anchoLibro:row.dimensiones_libro[0],
|
||||
altoLibro:row.dimensiones_libro[1],
|
||||
solapas:$('#solapas_ancho').val(),
|
||||
lomo:row.mano};
|
||||
|
||||
// Si viene de hacerlo a mano...
|
||||
data = processRowData(row, 'lp_sobrecubierta', 'lp-sobrecubierta');
|
||||
|
||||
var row = tableLineasPresupuesto.row('#lp_sobrecubierta');
|
||||
if(row.length>0)
|
||||
tableLineasPresupuesto.row('#lp_sobrecubierta').data(data).draw()
|
||||
else{
|
||||
tableLineasPresupuesto.row.add(data).draw()
|
||||
row = tableLineasPresupuesto.row('#lp_sobrecubierta');
|
||||
}
|
||||
row.child(format(row.data())).show();
|
||||
|
||||
eventos_lp_sobrecubierta()
|
||||
|
||||
$('#lp_sobrecubierta_checkPapel').change()
|
||||
|
||||
calcular_mermas()
|
||||
updateTotales(true, false, false)
|
||||
updateTablaEnvios()
|
||||
|
||||
}
|
||||
|
||||
$("#tableLineasPresupuesto").DataTable().columns.adjust();
|
||||
|
||||
}
|
||||
|
||||
function eventos_lp_sobrecubierta(){
|
||||
|
||||
$('#lp_sobrecubierta_papel').bind("focus", {clear_selectors: true}, clear_lp_sobrecubierta);
|
||||
$('#lp_sobrecubierta_gramaje').bind("focus", set_lp_sobrecubierta_gramaje);
|
||||
$('#lp_sobrecubierta_papelImpresion').focus("focus", set_lp_sobrecubierta_papelImpresion);
|
||||
$('#lp_sobrecubierta_maquina').bind("focus", set_lp_sobrecubierta_maquina);
|
||||
$('#lp_sobrecubierta_maquina').bind("change", change_lp_sobrecubierta_maquina);
|
||||
$('#lp_sobrecubierta_vercalculos').bind("click", {rowId: 'lp_sobrecubierta'}, verCalculosInkjet);
|
||||
$('#lp_sobrecubierta_checkPapel').bind("change", {id_linea: 'lp_sobrecubierta'}, update_total_linea);
|
||||
$('#lp_sobrecubierta_checkClicks').bind("change", {id_linea: 'lp_sobrecubierta'}, update_total_linea);
|
||||
}
|
||||
|
||||
|
||||
function check_update_sobrecubierta(){
|
||||
let row = tableLineasPresupuesto.row('#lp_sobrecubierta');
|
||||
if(row.length>0){
|
||||
calcularPresupuesto_sobrecubierta()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function getLomoLineasPresupuesto(){
|
||||
let lomoTotal = 0
|
||||
try{
|
||||
tableLineasPresupuesto.rows().every( function ( rowIdx, tableLoop, rowLoop ) {
|
||||
var rowData = this.data();
|
||||
lomoTotal += parseFloat(rowData.lomo)
|
||||
if(rowData.row_id != 'lp_cubierta' && rowData.tipo != 'lp_sobrecubierta')
|
||||
lomoTotal += parseFloat(rowData.lomo)
|
||||
})
|
||||
}
|
||||
catch(error){
|
||||
lomoTotal = 0
|
||||
}
|
||||
return lomoTotal
|
||||
}
|
||||
|
||||
function getLomoCubiertaLineasPresupuesto(){
|
||||
let lomoTotal = 0
|
||||
try{
|
||||
tableLineasPresupuesto.rows().every( function ( rowIdx, tableLoop, rowLoop ) {
|
||||
var rowData = this.data();
|
||||
if(rowData.row_id == 'lp_cubierta')
|
||||
lomoTotal += parseFloat(rowData.lomo)
|
||||
})
|
||||
}
|
||||
catch(error){
|
||||
@ -3903,6 +4224,9 @@ function fill_lp_from_bbdd(){
|
||||
case 'lp_cubierta':
|
||||
eventos_lp_cubierta()
|
||||
break
|
||||
case 'lp_sobrecubierta':
|
||||
eventos_lp_sobrecubierta()
|
||||
break
|
||||
case 'lp_guardas':
|
||||
eventos_lp_guardas()
|
||||
lp['paginas_impresion'] = lp.paginas_impresion
|
||||
|
||||
@ -121,7 +121,18 @@
|
||||
<?= lang("Presupuestos.previewEsquemaCubierta") ?>
|
||||
</button>
|
||||
</li>
|
||||
|
||||
<li id="tab-pv-sobrecubierta" class="nav-item" style="display: none">
|
||||
<button
|
||||
type="button"
|
||||
class="nav-link"
|
||||
role="tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#pv_sobrecubierta"
|
||||
aria-controls="pv_sobrecubierta"
|
||||
aria-selected="false">
|
||||
<?= lang("Presupuestos.previewConfiguracionSobrecubierta") ?>
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content border border-container">
|
||||
@ -814,6 +825,87 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pv_sobrecubierta" role="tabpanel">
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
<div class="p-4 mb-3 pb-3">
|
||||
<!-- Configuraciones -->
|
||||
<div class="row g-3 mb-3">
|
||||
<div class="col-12">
|
||||
<a id="pv_sobrecubierta_pg" href="#" sk-url="<?= site_url('configuracion/papelesgenericos/edit/'); ?>" target="_blank">
|
||||
<div class="d-grid">
|
||||
<button type="button" class="btn btn-label-primary">
|
||||
<?= lang("Presupuestos.previewPapelGenerico") ?>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<a id="pv_sobrecubierta_pi" href="#" sk-url="<?= site_url('configuracion/papelesimpresion/edit/'); ?>" target="_blank">
|
||||
<div class="d-grid">
|
||||
<button type="button" class="btn btn-label-primary">
|
||||
<?= lang("Presupuestos.previewPapelCompra") ?>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<a id="pv_sobrecubierta_mi" href="#" sk-url="<?= site_url('configuracion/maquinas/edit/'); ?>" target="_blank">
|
||||
<div class="d-grid">
|
||||
<button type="button" class="btn btn-label-primary">
|
||||
<?= lang("Presupuestos.previewAreaImpresion") ?>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="mx-n4"/>
|
||||
|
||||
<!-- Detalles del presupuesto -->
|
||||
<h6><?= lang("Presupuestos.previewDetalles") ?></h6>
|
||||
<dl class="row mb-0">
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewGramaje") ?></dt>
|
||||
<dd id="pv_sobrecubierta_gramaje" class="col-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewMano") ?></dt>
|
||||
<dd id="pv_sobrecubierta_mano" class="col-sm-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold pv-solapas"><?= lang("Presupuestos.previewSolapas") ?></dt>
|
||||
<dd id="pv_sobrecubierta_solapas" class="col-sm-6 text-left pv-solapas">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewMaquina") ?></dt>
|
||||
<dd id="pv_sobrecubierta_maquina" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewAreaImpresion") ?></dt>
|
||||
<dd id="pv_sobrecubierta_maquina_impresion" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewLibro") ?></dt>
|
||||
<dd id="pv_sobrecubierta_libro" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewForma") ?></dt>
|
||||
<dd id="pv_sobrecubierta_forma" class="col-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewFormas") ?></dt>
|
||||
<dd id="pv_sobrecubierta_nFormas" class="col-6 text-left">TBD</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-9">
|
||||
<div class="p-4 mb-3 pb-3">
|
||||
<!-- Configuraciones -->
|
||||
<h6><?= lang("Presupuestos.previewSobrecubierta") ?></h6>
|
||||
|
||||
<div id="pv-cubierta-container">
|
||||
<div id="pv_sobrecubierta_shape" class="draw-shapes"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -883,6 +975,12 @@ $('#tab-pv-esquema-cubierta').on( "click", function() {
|
||||
|
||||
} );
|
||||
|
||||
$('#tab-pv-sobrecubierta').on( "click", function() {
|
||||
|
||||
previewInteriorPlana('sobrecubierta', <?php echo $isCosido; ?>, <?php echo $isTapaDura; ?>);
|
||||
|
||||
} );
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
|
||||
@ -329,10 +329,30 @@ function clearIntLineas(is_color) {
|
||||
|
||||
function clearCubierta() {
|
||||
|
||||
$('#tableCompCubierta').DataTable().clear().draw();
|
||||
$('#insertarCubiertaBtn').css('display', 'none');
|
||||
var tabla = $('#tableCompCubierta').DataTable();
|
||||
tabla
|
||||
.rows(function (idx, data, node) {
|
||||
return data['tipo'] === 'cubierta';
|
||||
})
|
||||
.remove()
|
||||
.draw();
|
||||
if(tabla.rows().count()==0)
|
||||
$('#insertarCubiertaBtn').css('display', 'none');
|
||||
}
|
||||
|
||||
function clearSobrecubierta() {
|
||||
|
||||
|
||||
var tabla = $('#tableCompCubierta').DataTable();
|
||||
tabla
|
||||
.rows(function (idx, data, node) {
|
||||
return data['tipo'] === 'sobrecubierta';
|
||||
})
|
||||
.remove()
|
||||
.draw();
|
||||
if(tabla.rows().count()==0)
|
||||
$('#insertarCubiertaBtn').css('display', 'none');
|
||||
}
|
||||
|
||||
function clearGuardas() {
|
||||
|
||||
@ -397,13 +417,33 @@ function selectCubiertaLineas() {
|
||||
|
||||
$("#tableCompCubierta").DataTable().rows('.selected').deselect();
|
||||
|
||||
let value_total = 0.00;
|
||||
cubierta_selected = false;
|
||||
sobrecubierta_selected = false;
|
||||
|
||||
if ($("#tableCompCubierta").DataTable().rows().count() > 0) {
|
||||
|
||||
$("#tableCompCubierta").DataTable().row(0).nodes().to$().toggleClass('selected');
|
||||
value_total = parseFloat($("#tableCompCubierta").DataTable().rows(0).data()[0]['total'])
|
||||
};
|
||||
$("#tableCompCubierta").DataTable().rows().every(function (rowIdx, tableLoop, rowLoop) {
|
||||
if (!cubierta_selected && $('#tableCompCubierta').DataTable().cell(rowIdx, 0).data() === 'cubierta') {
|
||||
$("#tableCompCubierta").DataTable().row(rowIdx).nodes().to$().toggleClass('selected');
|
||||
cubierta_selected = true;
|
||||
}
|
||||
if (!sobrecubierta_selected && $('#tableCompCubierta').DataTable().cell(rowIdx, 0).data() === 'sobrecubierta') {
|
||||
$("#tableCompCubierta").DataTable().row(rowIdx).nodes().to$().toggleClass('selected');
|
||||
sobrecubierta_selected = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var table = $("#tableCompCubierta").DataTable();
|
||||
var rows = table.rows('.selected').indexes();
|
||||
var data = table.rows(rows).data();
|
||||
|
||||
var value_total = 0.00;
|
||||
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
|
||||
value_total += parseFloat(data[i]['total'])
|
||||
}
|
||||
|
||||
|
||||
$('#total_comp_cubierta').html(value_total.toFixed(2));
|
||||
@ -552,6 +592,19 @@ function fillCubierta(data) {
|
||||
})
|
||||
}
|
||||
|
||||
function fillSobrecubierta(data) {
|
||||
|
||||
let sorted = data.lineas.sort(
|
||||
(p1, p2) => ((p1.fields.precio_pedido + p1.fields.precio_click_pedido) < (p2.fields.precio_pedido + p2.fields.precio_click_pedido)) ?
|
||||
-1 : ((p1.fields.precio_pedido + p1.fields.precio_click_pedido) > (p2.fields.precio_pedido + p2.fields.precio_click_pedido)) ? 1 : 0);
|
||||
sorted.forEach(function (linea) {
|
||||
if (typeof linea.error == "undefined")
|
||||
$('#tableCompCubierta').DataTable().row
|
||||
.add(getRowFromLineaInt('sobrecubierta', linea))
|
||||
.draw()
|
||||
})
|
||||
}
|
||||
|
||||
function fillGuardas(data) {
|
||||
|
||||
let sorted = data.lineas.sort(
|
||||
@ -658,6 +711,20 @@ function generateCompJSON() {
|
||||
}
|
||||
$.extend(data, cubierta_obj);
|
||||
|
||||
try {
|
||||
sobrecubierta_obj = {
|
||||
"sobrecubierta": {
|
||||
'imprimir': $('#compSobrecubierta option:selected').val(),
|
||||
'papel_id': $('#compPapelSobrecubierta').select2('data')[0].id,
|
||||
'gramaje': $('#compGramajeSobrecubierta').select2('data')[0].text.trim(),
|
||||
},
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
sobrecubierta_obj = {}
|
||||
}
|
||||
$.extend(data, sobrecubierta_obj);
|
||||
|
||||
if($('#compCarasGuardas').length>0){
|
||||
try {
|
||||
guardas_obj = {
|
||||
|
||||
@ -6,7 +6,7 @@ function previewInteriorPlana(lpTagName, isCosido, isTapaDura) {
|
||||
|
||||
// Local parameters
|
||||
let guardaV = 0;
|
||||
guardaH = 0;
|
||||
let guardaH = 0;
|
||||
let styleText = {size: 12, family: 'Public Sans'};
|
||||
|
||||
// Get the preview Object parameters
|
||||
@ -497,12 +497,10 @@ function portadaTapaBlanda(lpTagName, isCosido, isTapaDura) {
|
||||
|
||||
|
||||
function getLomoLibro() {
|
||||
let _anchoLomo = 0;
|
||||
$("#tableLineasPresupuesto tbody tr:visible td input[id*='_lomo']").each(function () {
|
||||
_anchoLomo += parseFloat($(this).val());
|
||||
});
|
||||
const anchoLomoInputs = $("#tableLineasPresupuesto tbody tr:visible td input[id*='_lomo']");
|
||||
const anchoLomo = Array.from(anchoLomoInputs).reduce((sum, input) => sum + parseFloat($(input).val()), 0);
|
||||
|
||||
return parseFloat(_anchoLomo.toFixed(2));
|
||||
return parseFloat(anchoLomo.toFixed(2));
|
||||
}
|
||||
|
||||
|
||||
@ -512,7 +510,7 @@ function getObjetoLP(lpName, _isCosido, _isTapaDura) {
|
||||
|
||||
$('#tableLineasPresupuesto').DataTable().rows().every(function (rowIdx, tableLoop, rowLoop) {
|
||||
|
||||
let lineaPresupuestoId = this.data().row_id;
|
||||
let lineaPresupuestoId = this.data().row_id.replace('lp_', '');
|
||||
|
||||
switch (lpName) {
|
||||
case 'bn':
|
||||
@ -523,12 +521,13 @@ function getObjetoLP(lpName, _isCosido, _isTapaDura) {
|
||||
case 'rot_bn':
|
||||
case 'rot_color':
|
||||
case 'guardas':
|
||||
if (lineaPresupuestoId.indexOf(lpName) >= 0) {
|
||||
case 'sobrecubierta':
|
||||
if (lineaPresupuestoId === lpName) {
|
||||
rowData = this.data();
|
||||
}
|
||||
break;
|
||||
case 'ec':
|
||||
if (lineaPresupuestoId.indexOf('cubierta') >= 0) {
|
||||
if (lineaPresupuestoId === 'cubierta') {
|
||||
rowData = this.data();
|
||||
}
|
||||
break;
|
||||
@ -537,7 +536,6 @@ function getObjetoLP(lpName, _isCosido, _isTapaDura) {
|
||||
break;
|
||||
}
|
||||
|
||||
//console.log(rowData);
|
||||
});
|
||||
|
||||
|
||||
@ -546,7 +544,7 @@ function getObjetoLP(lpName, _isCosido, _isTapaDura) {
|
||||
gramajeLibro: parseInt(rowData.gramaje),
|
||||
manoLP: parseFloat(rowData.lomo),
|
||||
lomoLibro: getLomoLibro(),
|
||||
anchoSolapa: parseFloat($('#solapas_ancho').val()),
|
||||
anchoSolapa: $('#solapas').is(':checked') ? parseFloat($('#solapas_ancho').val()) : parseFloat(0),
|
||||
nFormas: parseInt(rowData.formas),
|
||||
nFormasH: parseInt(rowData.formas_h),
|
||||
nFormasV: parseInt(rowData.formas_v),
|
||||
@ -559,7 +557,7 @@ function getObjetoLP(lpName, _isCosido, _isTapaDura) {
|
||||
anchoLibro: getDimensionLibro().ancho
|
||||
};
|
||||
|
||||
console.log(pvObj);
|
||||
//console.log(pvObj);
|
||||
|
||||
// Printing shape definition
|
||||
pvObj.anchoForma = (_isCosido) ? 2 * pvObj.anchoLibro : pvObj.anchoLibro;
|
||||
@ -603,9 +601,29 @@ function getObjetoLP(lpName, _isCosido, _isTapaDura) {
|
||||
pvObj.anchoForma = ((2 * pvObj.anchoLibro) + (2 * (pvObj.anchoSolapa + offsetSolapaValor)) + (2 * sangre) + pvObj.lomoLibro);
|
||||
pvObj.altoForma += (2 * sangre);
|
||||
}
|
||||
|
||||
// Update labels
|
||||
$(pvName + '_forma').text(pvObj.anchoForma + "x" + pvObj.altoForma);
|
||||
break;
|
||||
|
||||
case 'sobrecubierta':
|
||||
let sangre = parseFloat(5); // mm
|
||||
let anchoSolapaSobrecubierta = $('#solapas_sobrecubierta').is(':checked') ? parseFloat($('#solapas_ancho_sobrecubierta').val()) : parseFloat(0); // mm
|
||||
if(_isTapaDura){
|
||||
let anchoPliegue = parseFloat(6); // mm
|
||||
let altoPliegue = parseFloat(7); // mm
|
||||
pvObj.anchoForma = ((2 * pvObj.anchoLibro) + (2 * anchoPliegue) + (2 * (anchoSolapaSobrecubierta + offsetSolapaValor)) + (2 * sangre) + pvObj.lomoLibro);
|
||||
pvObj.altoForma += altoPliegue + (2 * sangre);
|
||||
}else{
|
||||
pvObj.anchoForma = ((2 * pvObj.anchoLibro) + (2 * (anchoSolapaSobrecubierta + offsetSolapaValor)) + (2 * sangre) + pvObj.lomoLibro);
|
||||
pvObj.altoForma += (2 * sangre);
|
||||
}
|
||||
|
||||
// Update labels
|
||||
$(pvName + '_solapas').text(anchoSolapaSobrecubierta);
|
||||
anchoSolapaSobrecubierta != 0 ? $('.pv-solapas').show() : $('.pv-solapas').hide();
|
||||
$(pvName + '_forma').text(pvObj.anchoForma + "x" + pvObj.altoForma);
|
||||
break;
|
||||
case 'ec':
|
||||
$(pvName + '_pg').attr("href", $(pvName + '_pg').attr('sk-url') + rowData.papel);
|
||||
$(pvName + '_pi').attr("href", $(pvName + '_pi').attr('sk-url') + rowData.papel_impresion_id);
|
||||
@ -648,48 +666,25 @@ function getObjetoLP(lpName, _isCosido, _isTapaDura) {
|
||||
|
||||
|
||||
function getVisibleTabs() {
|
||||
const table = $('#tableLineasPresupuesto').DataTable();
|
||||
|
||||
// Clear all existing tabs
|
||||
$('*[id*=tab-pv-]').each(function () {
|
||||
$(this).hide();
|
||||
$(this).children('.active').each(function () {
|
||||
$(this).removeClass('active');
|
||||
});
|
||||
|
||||
$('*[id*=pv_]').each(function () {
|
||||
$(this).removeClass("active show");
|
||||
});
|
||||
|
||||
});
|
||||
$('*[id*=tab-pv-]').hide().find('.active').removeClass('active');
|
||||
$('*[id*=pv_]').removeClass('active show');
|
||||
|
||||
// Enable active tabs
|
||||
$('#tableLineasPresupuesto').DataTable().rows().every(function (rowIdx, tableLoop, rowLoop) {
|
||||
let lpName = this.data().row_id.replace('lp_', '');
|
||||
let tabName = lpName.replace('_', '-');
|
||||
//console.log(lpName);
|
||||
switch (lpName) {
|
||||
case 'bn':
|
||||
case 'bnhq':
|
||||
case 'color':
|
||||
case 'colorhq':
|
||||
case 'rot_bn':
|
||||
case 'rot_color':
|
||||
case 'guardas':
|
||||
$("#tab-pv-" + tabName).show();
|
||||
break;
|
||||
table.rows().every(function () {
|
||||
const lpName = this.data().row_id.replace('lp_', '');
|
||||
const tabName = lpName.replace('_', '-');
|
||||
|
||||
case 'cubierta':
|
||||
$("#tab-pv-" + tabName).show();
|
||||
$("#tab-pv-esquema-" + tabName).show();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
if (['bn', 'bnhq', 'color', 'colorhq', 'rot_bn', 'rot_color', 'guardas', 'cubierta', 'sobrecubierta'].includes(lpName)) {
|
||||
$(`#tab-pv-${tabName}`).show();
|
||||
if (lpName === 'cubierta') {
|
||||
$(`#tab-pv-${tabName}`).show();
|
||||
$(`#tab-pv-esquema-${tabName}`).show();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -181,8 +181,8 @@
|
||||
<!------------------------------------------->
|
||||
<!-- Acciones antes de submit... -->
|
||||
<!------------------------------------------->
|
||||
const url = window.location.href;
|
||||
const url_parts = url.split('/');
|
||||
const url = window.location.href;
|
||||
const url_parts = url.split('/');
|
||||
|
||||
<?php if (str_contains($formAction, 'edit')): ?>
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
@ -26,7 +26,6 @@
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
|
||||
<label for="mostrar_en_presupuesto" class="form-check-label">
|
||||
<input type="checkbox" id="mostrar_en_presupuesto" name="mostrar_en_presupuesto" value="1" class="form-check-input" <?= $tarifaacabadoEntity->mostrar_en_presupuesto == true ? 'checked' : ''; ?>>
|
||||
<?= lang('Tarifaacabado.mostrar_en_presupuesto') ?>
|
||||
@ -34,6 +33,24 @@
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<label for="acabado_cubierta" class="form-check-label">
|
||||
<input type="checkbox" id="acabado_cubierta" name="acabado_cubierta" value="1" class="form-check-input" <?= $tarifaacabadoEntity->acabado_cubierta == true ? 'checked' : ''; ?>>
|
||||
<?= lang('Tarifaacabado.acabado_cubierta') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<label for="acabado_sobrecubierta" class="form-check-label">
|
||||
<input type="checkbox" id="acabado_sobrecubierta" name="acabado_sobrecubierta" value="1" class="form-check-input" <?= $tarifaacabadoEntity->acabado_sobrecubierta == true ? 'checked' : ''; ?>>
|
||||
<?= lang('Tarifaacabado.acabado_sobrecubierta') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div><!--//.col -->
|
||||
|
||||
</div><!-- //.row -->
|
||||
@ -20,6 +20,8 @@
|
||||
<th><?= lang('Tarifaacabado.precioMin') ?></th>
|
||||
<th><?= lang('Tarifaacabado.importeFijo') ?></th>
|
||||
<th><?= lang('Tarifaacabado.mostrar_en_presupuesto') ?></th>
|
||||
<th><?= lang('Tarifaacabado.acabado_cubierta') ?></th>
|
||||
<th><?= lang('Tarifaacabado.acabado_sobrecubierta') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -91,12 +93,14 @@
|
||||
{ 'data': 'precio_min' },
|
||||
{ 'data': 'importe_fijo' },
|
||||
{ 'data': 'mostrar_en_presupuesto' },
|
||||
{ 'data': 'acabado_cubierta' },
|
||||
{ 'data': 'acabado_sobrecubierta' },
|
||||
{ 'data': actionBtns }
|
||||
]
|
||||
});
|
||||
|
||||
theTable.on( 'draw.dt', function () {
|
||||
const boolCols = [3];
|
||||
const boolCols = [3, 4, 5];
|
||||
for (let coln of boolCols) {
|
||||
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
|
||||
cell.innerHTML = cell.innerHTML == '1' ? '<i class="ti ti-check"></i>' : '';
|
||||
|
||||
0
httpdocs/themes/vuexy/img/safekat/presupuestos/icon_guardas.png
Normal file → Executable file
0
httpdocs/themes/vuexy/img/safekat/presupuestos/icon_guardas.png
Normal file → Executable file
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
0
httpdocs/themes/vuexy/img/safekat/presupuestos/icon_inkjet_bn.png
Normal file → Executable file
0
httpdocs/themes/vuexy/img/safekat/presupuestos/icon_inkjet_bn.png
Normal file → Executable file
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
0
httpdocs/themes/vuexy/img/safekat/presupuestos/icon_inkjet_color.png
Normal file → Executable file
0
httpdocs/themes/vuexy/img/safekat/presupuestos/icon_inkjet_color.png
Normal file → Executable file
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 7.1 KiB |
0
sk-commit.bat
Normal file → Executable file
0
sk-commit.bat
Normal file → Executable file
0
sk-new-branch.bat
Normal file → Executable file
0
sk-new-branch.bat
Normal file → Executable file
Reference in New Issue
Block a user