From 42d66ac61443b581c48b34339c8b6231d85a0b3e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaime=20Jim=C3=A9nez?= <“jaimejimenezortega@gmail.com”>
Date: Thu, 4 Jan 2024 20:38:14 +0100
Subject: [PATCH] =?UTF-8?q?a=C3=B1adir=20lineas=20presupuesto=20desde=20co?=
=?UTF-8?q?mp?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
ci4/.env | 4 +-
.../Presupuestos/Cosidotapablanda.php | 14 +-
ci4/app/Language/en/Presupuestos.php | 2 +
ci4/app/Language/es/Presupuestos.php | 6 +-
ci4/app/Models/Configuracion/MaquinaModel.php | 2 +-
.../cosidotapablanda/_datosEnvios.php | 4 -
.../cosidotapablanda/_datosServiciosItems.php | 2 -
.../_lineasPresupuestoItems.php | 1616 +++++++----------
.../viewCosidotapablandaForm.php | 6 +-
httpdocs/themes/vuexy/css/sk-datatables.css | 4 +-
.../safekat/presupuestos/icon_inkjet_bn.png | Bin 0 -> 5730 bytes
.../presupuestos/icon_inkjet_color.png | Bin 0 -> 7264 bytes
12 files changed, 694 insertions(+), 966 deletions(-)
create mode 100644 httpdocs/themes/vuexy/img/safekat/presupuestos/icon_inkjet_bn.png
create mode 100644 httpdocs/themes/vuexy/img/safekat/presupuestos/icon_inkjet_color.png
diff --git a/ci4/.env b/ci4/.env
index c6225611..7541e4d4 100755
--- a/ci4/.env
+++ b/ci4/.env
@@ -22,8 +22,8 @@ CI_ENVIRONMENT = development
# APP
#--------------------------------------------------------------------
-# app.baseURL = 'https://sk-jjo.imnavajas.es'
-app.baseURL = 'https://sk-imn.imnavajas.es'
+app.baseURL = 'https://sk-jjo.imnavajas.es'
+# app.baseURL = 'https://sk-imn.imnavajas.es'
# app.baseURL = "http://safekat.test/"
# app.forceGlobalSecureRequests = false
diff --git a/ci4/app/Controllers/Presupuestos/Cosidotapablanda.php b/ci4/app/Controllers/Presupuestos/Cosidotapablanda.php
index 77700dd7..2b83b03a 100755
--- a/ci4/app/Controllers/Presupuestos/Cosidotapablanda.php
+++ b/ci4/app/Controllers/Presupuestos/Cosidotapablanda.php
@@ -144,13 +144,16 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
endif; // ($requestMethod === 'post')
+ $this->viewData['tipo_impresion_id'] = 4; // Cosido tapa blanda JJO
$this->viewData['presupuestoEntity'] = isset($sanitizedData) ? new PresupuestoEntity($sanitizedData) : new PresupuestoEntity();
+ $this->viewData['isCosido'] = (new TipoPresupuestoModel())->get_isCosido($this->viewData['tipo_impresion_id']);
+
$this->viewData['clienteList'] = $this->getClienteListItems($presupuestoEntity->cliente_id ?? null);
$this->viewData['incReiList'] = array('incidencia' => lang('Presupuestos.incidencia'), 'reimpresion' => lang('Presupuestos.reimpresion'), 'sin_cargo' => lang('Presupuestos.sinCargo'));
$this->viewData['paisList'] = $this->getPaisListItems();
$this->viewData['papelFormatoList'] = $this->getPapelFormatoListItems($presupuestoEntity->papel_formato_id ?? null);
- $this->viewData['tipo_impresion_id'] = 4; // Cosido tapa blanda JJO
+
$this->viewData['formAction'] = route_to('createCosidotapablanda');
@@ -648,11 +651,15 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
continue;
}
- $linea['fields']['precio_hora'] = $precio_hora;
+ $linea['fields']['tipo_maquina'] = $maquina->is_tinta?'inkjet':'toner';
+ $linea['fields']['precio_hora'] = $precio_hora*$margen_precio_hora/100.0;
$linea['fields']['precio_hora_margen'] = $margen_precio_hora;
$linea['fields']['horas_maquina'] = $tiempo;
$linea['fields']['precio_impresion_horas'] = $precio_hora*$tiempo*1.0;
$linea['fields']['margen_impresion_horas'] = $precio_hora*$tiempo*1.0*$margen_precio_hora/100.0;
+
+ $linea['fields']['total_impresion'] = $linea['fields']['precio_pedido'] + // papel
+ $linea['fields']['precio_impresion_horas']; // impresion
array_push($lineas, $linea);
}
@@ -766,6 +773,7 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
$linea['fields']['maquina'] = $maquina->maquina;
$linea['fields']['maquina_id'] = $maquina->maquina_id;
$linea['fields']['maquina_velocidad'] = $maquina->velocidad;
+ $linea['fields']['tipo_maquina'] = 'inkjet';
$linea['fields']['papel_impresion'] = $papel->nombre;
$linea['fields']['papel_impresion_id'] = $papel->id;
$linea['fields']['paginas'] = $datosPedido->paginas;
@@ -808,7 +816,7 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
continue;
}
- $linea['fields']['precio_hora'] = $precio_hora;
+ $linea['fields']['precio_hora'] = $precio_hora*$margen_precio_hora/100.0;
$linea['fields']['precio_hora_margen'] = $margen_precio_hora;
$linea['fields']['horas_maquina'] = $tiempo;
$linea['fields']['precio_impresion_horas'] = $precio_hora*$tiempo*1.0;
diff --git a/ci4/app/Language/en/Presupuestos.php b/ci4/app/Language/en/Presupuestos.php
index 2b4b89f9..3626c567 100755
--- a/ci4/app/Language/en/Presupuestos.php
+++ b/ci4/app/Language/en/Presupuestos.php
@@ -76,12 +76,14 @@ return [
'click' => 'Click',
'totalClicks' => 'Total clicks',
'horas' => 'Machine hours',
+ 'precioHora' => 'Price hour',
'precioImpresion' => 'Print price',
'precioPagNegro' => 'Pages black price',
'precioPagColor' => 'Pages color price',
'totalTinta' => 'Total ink',
'totalCorte' => 'Total cut',
'total' => 'Total',
+ 'totalLinea' => 'Row Total',
'aFavorFibra' => 'In fiber direction',
'cubierta' => 'Cover',
'sobrecubierta' => 'Dust jacket',
diff --git a/ci4/app/Language/es/Presupuestos.php b/ci4/app/Language/es/Presupuestos.php
index 9ed161c8..cd1ff429 100755
--- a/ci4/app/Language/es/Presupuestos.php
+++ b/ci4/app/Language/es/Presupuestos.php
@@ -69,18 +69,20 @@ return [
'pliegosPedido' => 'Pliegos pedido',
'precioPliego' => 'Precio pliegos',
'libro' => 'Libro',
- 'totalPapelPedido' => 'Total papel pedido',
+ 'totalPapelPedido' => 'Papel pedido',
'lomo' => 'Lomo',
'peso' => 'Peso',
'click' => 'Click',
'totalClicks' => 'Total clicks',
'horas' => 'Horas máquina',
+ 'precioHora' => 'Precio hora',
'precioImpresion' => 'Precio impresión',
'precioPagNegro' => 'Precio pág. negro',
'precioPagColor' => 'Precio pág. color',
'totalTinta' => 'Total tinta',
'totalCorte' => 'Total corte',
'total' => 'Total',
+ 'totalLinea' => 'Total Precio Línea',
'aFavorFibra' => 'A favor de fibra',
'cubierta' => 'Cubierta',
'sobrecubierta' => 'Sobrecubierta',
@@ -106,7 +108,7 @@ return [
'porDefecto' => 'Por defecto',
'tipoImpresion' => 'Impresion',
- 'numPagColor' => 'Nº Paginas Color',
+ 'numPagColor' => 'Nº Pag. Color',
'saturacion' => 'Saturación',
'cobNegro' => 'Cob. % Negro',
'cobCyan' => 'Cob. % Cyan',
diff --git a/ci4/app/Models/Configuracion/MaquinaModel.php b/ci4/app/Models/Configuracion/MaquinaModel.php
index f9cb6f52..25fa6b61 100755
--- a/ci4/app/Models/Configuracion/MaquinaModel.php
+++ b/ci4/app/Models/Configuracion/MaquinaModel.php
@@ -353,7 +353,7 @@ class MaquinaModel extends \App\Models\GoBaseModel
->groupEnd();
}
- public function getMaquinaImpresionForPresupuesto($is_rotativa, $tarifa_tipo, $uso_tarifa = 'interior', $tirada, $papel_impresion_id = -1)
+ public function getMaquinaImpresionForPresupuesto($is_rotativa, $tarifa_tipo, $uso_tarifa , $tirada, $papel_impresion_id = -1)
{
/*
1.-> tarifa_Tipo impresion
diff --git a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosEnvios.php b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosEnvios.php
index a75db67d..81885369 100755
--- a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosEnvios.php
+++ b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosEnvios.php
@@ -135,10 +135,6 @@ $(document).on('click', '.btn-edit-add', function(e) {
$('#add_entregaPieCalle').prop('checked', data.entregaPieCalle==1?true:false)
$newAddDialog.modal('show')
-
-
- console.log(data)
- console.log()
})
diff --git a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosServiciosItems.php b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosServiciosItems.php
index 7f23f7a1..d7800441 100755
--- a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosServiciosItems.php
+++ b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosServiciosItems.php
@@ -249,8 +249,6 @@
})
- const POD = ;
-
$('#serv_default').on('click', function(){
get_tarifas_enc('default').then(
get_tarifas_manipulado('default')
diff --git a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_lineasPresupuestoItems.php b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_lineasPresupuestoItems.php
index e6a5b498..54c898ee 100755
--- a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_lineasPresupuestoItems.php
+++ b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_lineasPresupuestoItems.php
@@ -16,884 +16,37 @@
+
+
+
@@ -923,37 +76,609 @@
= $this->section("additionalInlineJs") ?>
+const papelGenericoNegroList = ;
-$('#lp_bn_papel').val('');
-$('#lp_bnhq_papel').val('');
-$('#lp_color_papel').val('');
-$('#lp_colorhq_papel').val('');
-$('#lp_rot_bn_papel').val('');
-$('#lp_rot_color_papel').val('');
-$('#lp_cubierta_papel').val('');
-$('#lp_sobrecubierta_papel').val('');
+// Formatting function for row details - modify as you need
+function format(d) {
+ var value = '
'+
+ ' | '+
+ ' | '+
+ ' | '+
+ ''+
+ '' +
+ ' | '
+
+
+
+
+ value += '
'
+
+ if(d.maquinaTipo=='inkjet'){
+ value +=
+ '
'+
+ ' | '+
+ ' | '+
+ ' | '+
+ ''+
+ '' +
+
+ ' | ' +
+ '
' +
+ '
'+
+ ' | '+
+ ' | '+
+ ' | '+
+ ''+
+ '' +
+ (d.row_id.includes('rot')?' ' +
+ ' | ' +
+ '
' +
+ '
'+
+ ' | '+
+ ' | '+
+ ' | '+
+ ''+
+ '' +
+ (d.row_id.includes('rot')?' ': ' ') +
+ '= lang('Presupuestos.metrosPapelLibro') ?>' +
+ '' +
+ ' ' +
+ (d.row_id.includes('rot')?' | ' +
+ '
' +
+ '
'+
+ ' | '+
+ ' | '+
+ ' | '+
+ ''+
+ '' +
+ (d.row_id.includes('rot')?' ': ' ') +
+ '= lang('Presupuestos.velocidadCorte') ?>' +
+ '' +
+ ' ' +
+ (d.row_id.includes('rot')?' ': ' ') +
+ '= lang('Presupuestos.precioHoraCorte') ?>' +
+ '' +
+ ' ' +
+ (d.row_id.includes('rot')?' ' +
+ ' | ' +
+ '
'
+ }
+
+ return $(value).toArray();
+}
+
+const lastColNr_lp = $('#tableLineasPresupuesto').find("tr:first th").length - 1;
+
+const actionBtns_lp = function(data) {
+ return `
+
+ `;
+};
+
+var tableLineasPresupuesto = new DataTable('#tableLineasPresupuesto',{
+ scrollX: true,
+ searching: false,
+ paging: false,
+ info: false,
+ ordering: false,
+ responsive: true,
+ select: false,
+ rowId: 'row_id',
+ language: {
+ url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/= config('Basics')->i18n ?>.json"
+ },
+ columnDefs: [
+ {
+ targets: 0,
+ className: 'dt-control',
+ orderable: false,
+ data: null,
+ defaultContent: ''
+ },
+ {
+ targets: [1,2,3,4,5,6,7,8,9],
+ orderable: false,
+ visible: false,
+ },
+ {
+ orderable: false,
+ searchable: false,
+ targets: [lastColNr_lp]
+ },
+ ],
+ columns: [
+ {data: null},
+ {data: 'tarifa_impresion_id'},
+ {data: 'maquina_ancho'},
+ {data: 'maquina_alto'},
+ {data: 'maquina_impresion_ancho'},
+ {data: 'maquina_impresion_alto'},
+ {data: 'formas'},
+ {data: 'formas_v'},
+ {data: 'formas_h'},
+ {data: 'formas_orientacion'},
+ {data: 'icon',
+ render: function ( data, type, row, meta ){
+ return '

'
+ }
+ },
+ {data: 'paginas',
+ render: function ( data, type, row, meta ) {
+ return '
| ';
+ }
+ },
+ {data: 'papel',
+ render: function ( data, type, row, meta ) {
+ var select = $('