mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'dev/new_preview' into 'main'
Dev/new preview See merge request jjimenez/safekat!112
This commit is contained in:
4
ci4/.env
4
ci4/.env
@ -22,8 +22,8 @@ CI_ENVIRONMENT = development
|
|||||||
# APP
|
# APP
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
|
|
||||||
app.baseURL = 'https://sk-jjo.imnavajas.es'
|
#app.baseURL = 'https://sk-jjo.imnavajas.es'
|
||||||
# app.baseURL = 'https://sk-imn.imnavajas.es'
|
app.baseURL = 'https://sk-imn.imnavajas.es'
|
||||||
# app.baseURL = "http://safekat.test/"
|
# app.baseURL = "http://safekat.test/"
|
||||||
# app.forceGlobalSecureRequests = false
|
# app.forceGlobalSecureRequests = false
|
||||||
|
|
||||||
|
|||||||
@ -154,7 +154,7 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
|||||||
$this->viewData['paisList'] = $this->getPaisListItems();
|
$this->viewData['paisList'] = $this->getPaisListItems();
|
||||||
$this->viewData['papelFormatoList'] = $this->getPapelFormatoListItems($presupuestoEntity->papel_formato_id ?? null);
|
$this->viewData['papelFormatoList'] = $this->getPapelFormatoListItems($presupuestoEntity->papel_formato_id ?? null);
|
||||||
|
|
||||||
|
$this->viewData['POD'] = $this->getPOD();
|
||||||
|
|
||||||
$this->viewData['formAction'] = route_to('createCosidotapablanda');
|
$this->viewData['formAction'] = route_to('createCosidotapablanda');
|
||||||
|
|
||||||
|
|||||||
@ -22,7 +22,7 @@ class PresupuestoModel extends \App\Models\GoBaseModel
|
|||||||
6 => "t1.inc_rei",
|
6 => "t1.inc_rei",
|
||||||
7 => "t1.paginas",
|
7 => "t1.paginas",
|
||||||
8 => "t1.tirada",
|
8 => "t1.tirada",
|
||||||
9 => "t1.total_pedido",
|
9 => "t1.total_presupuesto",
|
||||||
10 => "t6.estado",
|
10 => "t6.estado",
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -314,7 +314,7 @@ class PresupuestoModel extends \App\Models\GoBaseModel
|
|||||||
"t1.id AS id, t1.created_at AS fecha, t2.nombre AS cliente,
|
"t1.id AS id, t1.created_at AS fecha, t2.nombre AS cliente,
|
||||||
CONCAT(t3.first_name, ' ', t3.last_name) AS comercial, t1.titulo AS titulo,
|
CONCAT(t3.first_name, ' ', t3.last_name) AS comercial, t1.titulo AS titulo,
|
||||||
t5.nombre AS pais, t1.inc_rei AS inc_rei, t1.paginas AS paginas, t1.tirada AS tirada,
|
t5.nombre AS pais, t1.inc_rei AS inc_rei, t1.paginas AS paginas, t1.tirada AS tirada,
|
||||||
t1.total_pedido AS total_pedido, t1.total_presupuesto AS total_presupuesto, t6.estado AS estado"
|
t1.total_presupuesto AS total_presupuesto, t1.total_presupuesto AS total_presupuesto, t6.estado AS estado"
|
||||||
);
|
);
|
||||||
$builder->join("clientes t2", "t1.cliente_id = t2.id", "left");
|
$builder->join("clientes t2", "t1.cliente_id = t2.id", "left");
|
||||||
$builder->join("auth_user t3", "t1.user_update_id = t3.id_user", "left");
|
$builder->join("auth_user t3", "t1.user_update_id = t3.id_user", "left");
|
||||||
|
|||||||
@ -118,7 +118,7 @@
|
|||||||
$('.dataTables_processing').hide();
|
$('.dataTables_processing').hide();
|
||||||
const theData = jqXHR.responseJSON;
|
const theData = jqXHR.responseJSON;
|
||||||
drawCallback(theData);
|
drawCallback(theData);
|
||||||
popErrorAlert(jqXHR.responseJSON.messages.error)
|
popErrorAlert(jqXHR.responseJSON.message)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -364,7 +364,7 @@ const actionBtns_lp = function(data) {
|
|||||||
`;
|
`;
|
||||||
};
|
};
|
||||||
|
|
||||||
var tableLineasPresupuesto = new DataTable('#tableLineasPresupuesto',{
|
var tableLineasPresupuesto = new DataTable('#tableLineasPresupuesto',{
|
||||||
scrollX: true,
|
scrollX: true,
|
||||||
searching: false,
|
searching: false,
|
||||||
paging: false,
|
paging: false,
|
||||||
@ -376,6 +376,9 @@ var tableLineasPresupuesto = new DataTable('#tableLineasPresupuesto',{
|
|||||||
language: {
|
language: {
|
||||||
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
||||||
},
|
},
|
||||||
|
initComplete: function (settings, json) {
|
||||||
|
//getVisibleTabs();
|
||||||
|
},
|
||||||
columnDefs: [
|
columnDefs: [
|
||||||
{
|
{
|
||||||
targets: 0,
|
targets: 0,
|
||||||
@ -3282,27 +3285,29 @@ async function fill_bbdd_from_lp(presupuesto_id){
|
|||||||
data.push(linea_data)
|
data.push(linea_data)
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
if(data.lengh > 0){
|
||||||
|
|
||||||
await $.ajax({
|
await $.ajax({
|
||||||
type: 'post',
|
type: 'post',
|
||||||
url: '<?= route_to("updateDataOfCosidotapablanda") ?>',
|
url: '<?= route_to("updateDataOfCosidotapablanda") ?>',
|
||||||
|
|
||||||
data: {
|
data: {
|
||||||
tipo: 'lineasPresupuesto',
|
tipo: 'lineasPresupuesto',
|
||||||
datos: data,
|
datos: data,
|
||||||
presupuesto_id: presupuesto_id,
|
presupuesto_id: presupuesto_id,
|
||||||
<?= csrf_token() ?? "token" ?>: <?= csrf_token() ?>v
|
<?= csrf_token() ?? "token" ?>: <?= csrf_token() ?>v
|
||||||
},
|
},
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success:function(response){
|
success:function(response){
|
||||||
|
|
||||||
token=response.<?= csrf_token() ?>;
|
token=response.<?= csrf_token() ?>;
|
||||||
yeniden(token);
|
yeniden(token);
|
||||||
}
|
}
|
||||||
}).fail(function (jqXHR, textStatus, error) {
|
}).fail(function (jqXHR, textStatus, error) {
|
||||||
// Handle error here
|
// Handle error here
|
||||||
console.log(jqXHR)
|
console.log(jqXHR)
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateLineasPresupuesto(){
|
function updateLineasPresupuesto(){
|
||||||
@ -3341,6 +3346,7 @@ function checkPaginasPresupuesto(){
|
|||||||
|
|
||||||
tableLineasPresupuesto.rows().every( function ( rowIdx, tableLoop, rowLoop ) {
|
tableLineasPresupuesto.rows().every( function ( rowIdx, tableLoop, rowLoop ) {
|
||||||
var rowData = this.data();
|
var rowData = this.data();
|
||||||
|
if((rowData.row_id != 'lp_cubierta') && (rowData.row_id != 'lp_sobrecubierta'))
|
||||||
cantidad_total += rowData.paginas
|
cantidad_total += rowData.paginas
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -739,6 +739,8 @@
|
|||||||
|
|
||||||
getVisibleTabs();
|
getVisibleTabs();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('#tab-pv-bn').on( "click", function() {
|
$('#tab-pv-bn').on( "click", function() {
|
||||||
|
|
||||||
previewInteriorPlana('bn');
|
previewInteriorPlana('bn');
|
||||||
|
|||||||
@ -369,20 +369,32 @@ function getLomoLibro() {
|
|||||||
|
|
||||||
function getObjetoLP(lpName) {
|
function getObjetoLP(lpName) {
|
||||||
|
|
||||||
|
let rowData = null;
|
||||||
|
|
||||||
|
$('#tableLineasPresupuesto').DataTable().rows().every(function (rowIdx, tableLoop, rowLoop) {
|
||||||
|
|
||||||
|
if (this.data().row_id.indexOf(lpName) >= 0) {
|
||||||
|
rowData = this.data();
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(rowData);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
pvObj = {
|
pvObj = {
|
||||||
idIndex: lpName,
|
idIndex: lpName,
|
||||||
gramajeLibro: parseInt($('#lp_' + lpName + '_gramaje').text()),
|
gramajeLibro: parseInt(rowData.gramaje),
|
||||||
manoLP: parseFloat($('#lp_' + lpName + '_lomo').val()),
|
manoLP: parseFloat(rowData.lomo),
|
||||||
lomoLibro: getLomoLibro(),
|
lomoLibro: getLomoLibro(),
|
||||||
anchoSolapa: parseFloat($('#solapas_ancho').val()),
|
anchoSolapa: parseFloat($('#solapas_ancho').val()),
|
||||||
nFormas: parseInt($('#lp_' + lpName + '_formas').val()),
|
nFormas: parseInt(rowData.formas),
|
||||||
nFormasH: parseInt($('#lp_' + lpName + '_formas_h').val()),
|
nFormasH: parseInt(rowData.formas_h),
|
||||||
nFormasV: parseInt($('#lp_' + lpName + '_formas_v').val()),
|
nFormasV: parseInt(rowData.formas_v),
|
||||||
orientacionFormas: $('#lp_' + lpName + '_formas_orientacion').val(),
|
orientacionFormas: rowData.formas_orientacion,
|
||||||
altoMaquina: parseFloat($('#lp_' + lpName + '_maquina_alto').val()),
|
altoMaquina: parseFloat(rowData.maquina_alto),
|
||||||
anchoMaquina: parseFloat($('#lp_' + lpName + '_maquina_ancho').val()),
|
anchoMaquina: parseFloat(rowData.maquina_ancho),
|
||||||
altoImpresion: parseFloat($('#lp_' + lpName + '_maquina_impresion_alto').val()),
|
altoImpresion: parseFloat(rowData.maquina_impresion_alto),
|
||||||
anchoImpresion: parseFloat($('#lp_' + lpName + '_maquina_impresion_ancho').val()),
|
anchoImpresion: parseFloat(rowData.maquina_impresion_ancho),
|
||||||
altoLibro: getDimensionLibro().alto,
|
altoLibro: getDimensionLibro().alto,
|
||||||
anchoLibro: getDimensionLibro().ancho
|
anchoLibro: getDimensionLibro().ancho
|
||||||
};
|
};
|
||||||
@ -393,9 +405,9 @@ function getObjetoLP(lpName) {
|
|||||||
|
|
||||||
// Update preview info fields
|
// Update preview info fields
|
||||||
let pvName = '#pv_' + lpName;
|
let pvName = '#pv_' + lpName;
|
||||||
$(pvName + '_pg').attr("href", $(pvName + '_pg').attr('sk-url') + $('#lp_' + lpName + '_papel').val());
|
$(pvName + '_pg').attr("href", $(pvName + '_pg').attr('sk-url') + rowData.papel);
|
||||||
$(pvName + '_pi').attr("href", $(pvName + '_pi').attr('sk-url') + $('#lp_' + lpName + '_papelImpresion').val());
|
$(pvName + '_pi').attr("href", $(pvName + '_pi').attr('sk-url') + rowData.papel_impresion_id);
|
||||||
$(pvName + '_mi').attr("href", $(pvName + '_mi').attr('sk-url') + $('#lp_' + lpName + '_maquina').val());
|
$(pvName + '_mi').attr("href", $(pvName + '_mi').attr('sk-url') + rowData.maquina_id);
|
||||||
|
|
||||||
$(pvName + '_gramaje').text(pvObj.gramajeLibro);
|
$(pvName + '_gramaje').text(pvObj.gramajeLibro);
|
||||||
$(pvName + '_mano').text(pvObj.manoLP);
|
$(pvName + '_mano').text(pvObj.manoLP);
|
||||||
@ -406,11 +418,11 @@ function getObjetoLP(lpName) {
|
|||||||
$(pvName + '_forma').text(pvObj.anchoForma + "x" + pvObj.altoForma);
|
$(pvName + '_forma').text(pvObj.anchoForma + "x" + pvObj.altoForma);
|
||||||
$(pvName + '_nFormas').text(pvObj.nFormas);
|
$(pvName + '_nFormas').text(pvObj.nFormas);
|
||||||
|
|
||||||
if(pvObj.anchoSolapa != 0){
|
if (pvObj.anchoSolapa != 0) {
|
||||||
$('.pv-solapas').show();
|
$('.pv-solapas').show();
|
||||||
offsetSolapaValor = parseFloat(3); // 3mm
|
offsetSolapaValor = parseFloat(3); // 3mm
|
||||||
|
|
||||||
}else{
|
} else {
|
||||||
$('.pv-solapas').hide();
|
$('.pv-solapas').hide();
|
||||||
offsetSolapaValor = parseFloat(0); // No offset
|
offsetSolapaValor = parseFloat(0); // No offset
|
||||||
}
|
}
|
||||||
@ -430,8 +442,8 @@ function getObjetoLP(lpName) {
|
|||||||
|
|
||||||
case 'rot_bn':
|
case 'rot_bn':
|
||||||
case 'rot_color':
|
case 'rot_color':
|
||||||
if((pvObj.anchoImpresion / pvObj.altoForma) > (pvObj.anchoImpresion / pvObj.anchoForma)){
|
if ((pvObj.anchoImpresion / pvObj.altoForma) > (pvObj.anchoImpresion / pvObj.anchoForma)) {
|
||||||
let auxReg = pvObj.anchoForma;
|
let auxReg = pvObj.anchoForma;
|
||||||
pvObj.anchoForma = pvObj.altoForma;
|
pvObj.anchoForma = pvObj.altoForma;
|
||||||
pvObj.altoForma = auxReg;
|
pvObj.altoForma = auxReg;
|
||||||
}
|
}
|
||||||
@ -439,7 +451,7 @@ function getObjetoLP(lpName) {
|
|||||||
pvObj.altoClick = 305; //parseFloat($('#lp_' + lpName + '_alto_click').val());
|
pvObj.altoClick = 305; //parseFloat($('#lp_' + lpName + '_alto_click').val());
|
||||||
pvObj.nFormasH = Math.trunc(pvObj.anchoImpresion / pvObj.anchoForma);
|
pvObj.nFormasH = Math.trunc(pvObj.anchoImpresion / pvObj.anchoForma);
|
||||||
pvObj.nFormasV = Math.trunc((pvObj.altoImpresion - 3) / (pvObj.altoForma + 4));
|
pvObj.nFormasV = Math.trunc((pvObj.altoImpresion - 3) / (pvObj.altoForma + 4));
|
||||||
console.log( )
|
console.log()
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'bn':
|
case 'bn':
|
||||||
@ -463,6 +475,46 @@ function getObjetoLP(lpName) {
|
|||||||
|
|
||||||
function getVisibleTabs() {
|
function getVisibleTabs() {
|
||||||
|
|
||||||
|
// Clear all existing tabs
|
||||||
|
$('*[id*=tab-pv-]').each(function () {
|
||||||
|
$(this).hide();
|
||||||
|
$(this).children('.active').each(function () {
|
||||||
|
$(this).removeClass('active');
|
||||||
|
});
|
||||||
|
|
||||||
|
/*$("#pv_" + lpName).removeClass("active show");
|
||||||
|
$("#pv_esquema_" + lpName).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':
|
||||||
|
$("#tab-pv-" + tabName).show();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'cubierta':
|
||||||
|
$("#tab-pv-" + tabName).show();
|
||||||
|
$("#tab-pv-esquema-" + tabName).show();
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
$("#tableLineasPresupuesto tbody tr").each(function () {
|
$("#tableLineasPresupuesto tbody tr").each(function () {
|
||||||
let isVisible = $(this).is(":visible");
|
let isVisible = $(this).is(":visible");
|
||||||
let lpName = $(this).attr('id').replace('lp_', '');
|
let lpName = $(this).attr('id').replace('lp_', '');
|
||||||
@ -514,30 +566,8 @@ function getVisibleTabs() {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
$("#tableLineasPresupuesto tbody tr:hidden").each(function () {
|
|
||||||
|
|
||||||
//console.log("Hidden: " + $(this).attr('id'));
|
|
||||||
if ($(this).attr('id').indexOf('cubierta') > -1) {
|
|
||||||
$("#" + $(this).attr('id').replace('lp_', 'tab-pv-')).hide();
|
|
||||||
$("#" + $(this).attr('id').replace('lp_', 'tab-pv-esquema-')).hide();
|
|
||||||
$("#pv_cubierta").removeClass("active show");
|
|
||||||
$("#pv_esquema_cubierta").removeClass("active show");
|
|
||||||
} else if ($(this).attr('id').indexOf('_data') > -1) {
|
|
||||||
// Do nothing here
|
|
||||||
} else if ($(this).attr('id').indexOf('_rot') > -1) {
|
|
||||||
$("#" + $(this).attr('id').replace('lp_rot_', 'tab-pv-rot-')).hide();
|
|
||||||
$("#" + $(this).attr('id').replace('lp_', 'pv_')).removeClass("active show");
|
|
||||||
} else {
|
|
||||||
$("#" + $(this).attr('id').replace('lp_', 'tab-pv-')).hide();
|
|
||||||
$("#" + $(this).attr('id').replace('lp_', 'pv_')).removeClass("active show");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
<?php if(str_contains($formAction,'edit')): ?>
|
<?php if(str_contains($formAction,'edit')): ?>
|
||||||
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosPresupuestoClienteItems") ?>
|
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosPresupuestoClienteItems") ?>
|
||||||
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_lineasPresupuestoItems") ?>
|
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_lineasPresupuestoItems") ?>
|
||||||
|
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_previewItems") ?>
|
||||||
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosServiciosItems") ?>
|
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosServiciosItems") ?>
|
||||||
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosEnvios") ?>
|
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosEnvios") ?>
|
||||||
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_comentariosItems") ?>
|
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_comentariosItems") ?>
|
||||||
|
|||||||
Reference in New Issue
Block a user