mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
trabajando en el problema
This commit is contained in:
4
ci4/.env
4
ci4/.env
@ -22,8 +22,8 @@ CI_ENVIRONMENT = development
|
||||
# APP
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
#app.baseURL = 'https://sk-dev.imnavajas.es'
|
||||
app.baseURL = 'https://sk-imn.imnavajas.es'
|
||||
app.baseURL = 'https://sk-dev.imnavajas.es'
|
||||
#app.baseURL = 'https://sk-imn.imnavajas.es'
|
||||
# app.baseURL = 'https://sk-imn.imnavajas.es'
|
||||
# app.baseURL = "http://safekat.test/"
|
||||
# app.forceGlobalSecureRequests = false
|
||||
|
||||
@ -861,7 +861,7 @@ $('.insertarLinea').on("click", function (e) {
|
||||
|
||||
$('#addLineasPresupuesto').on("change", function (e) {
|
||||
|
||||
var data = tableLineasPresupuesto
|
||||
var dataRows = tableLineasPresupuesto
|
||||
.rows()
|
||||
.data();
|
||||
|
||||
@ -870,101 +870,148 @@ $('#addLineasPresupuesto').on("change", function (e) {
|
||||
// (solo una de cada en interior)
|
||||
|
||||
case 'lp_bn':
|
||||
if(data.length>0){
|
||||
if( data.filter(x => x.row_id === 'lp_bn').length>0 ||
|
||||
data.filter(x => x.row_id === 'lp_bnhq').length>0 ||
|
||||
data.filter(x => x.row_id === 'lp_rot_bn').length>0 )
|
||||
|
||||
popErrorAlert('<?=lang('Presupuestos.errores.lineaDuplicada') ?>', 'divAlarmasLineasPresupuesto');
|
||||
var hayLinea = false
|
||||
for(let number=0;number<dataRows.length;number++){
|
||||
if(dataRows[number].row_id == 'lp_bn' ||
|
||||
dataRows[number].row_id == 'lp_bnhq' ||
|
||||
dataRows[number].row_id == 'lp_rot_bn'){
|
||||
hayLinea = true
|
||||
continue
|
||||
}
|
||||
}
|
||||
else{
|
||||
var data = processRowData({tipo_maquina: 'toner'}, 'lp_bn', 'lp-bn');
|
||||
tableLineasPresupuesto.row.add(data).draw(true)
|
||||
eventos_lp_bn()
|
||||
|
||||
if(hayLinea){
|
||||
popErrorAlert('<?=lang('Presupuestos.errores.lineaDuplicada') ?>', 'divAlarmasLineasPresupuesto');
|
||||
break
|
||||
}
|
||||
|
||||
var data = processRowData({tipo_maquina: 'toner'}, 'lp_bn', 'lp-bn');
|
||||
tableLineasPresupuesto.row.add(data).draw(true)
|
||||
eventos_lp_bn()
|
||||
break
|
||||
|
||||
case 'lp_bnhq':
|
||||
if(data.length>0){
|
||||
if( data.filter(x => x.row_id === 'lp_bn').length>0 ||
|
||||
data.filter(x => x.row_id === 'lp_bnhq').length>0 ||
|
||||
data.filter(x => x.row_id === 'lp_rot_bn').length>0 )
|
||||
var hayLinea = false
|
||||
for(let number=0;number<dataRows.length;number++){
|
||||
if(dataRows[number].row_id == 'lp_bn' ||
|
||||
dataRows[number].row_id == 'lp_bnhq' ||
|
||||
dataRows[number].row_id == 'lp_rot_bn'){
|
||||
hayLinea = true
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
popErrorAlert('<?=lang('Presupuestos.errores.lineaDuplicada') ?>', 'divAlarmasLineasPresupuesto');
|
||||
}
|
||||
else{
|
||||
var data = processRowData({tipo_maquina: 'toner'}, 'lp_bnhq', 'lp-bnhq');
|
||||
tableLineasPresupuesto.row.add(data).draw(true)
|
||||
eventos_lp_bnhq()
|
||||
if(hayLinea){
|
||||
popErrorAlert('<?=lang('Presupuestos.errores.lineaDuplicada') ?>', 'divAlarmasLineasPresupuesto');
|
||||
break
|
||||
}
|
||||
|
||||
var data = processRowData({tipo_maquina: 'toner'}, 'lp_bnhq', 'lp-bnhq');
|
||||
tableLineasPresupuesto.row.add(data).draw(true)
|
||||
eventos_lp_bnhq()
|
||||
break
|
||||
|
||||
case 'lp_color':
|
||||
if(data.length>0){
|
||||
if( data.filter(x => x.row_id === 'lp_color').length>0 ||
|
||||
data.filter(x => x.row_id === 'lp_colorhq').length>0 ||
|
||||
data.filter(x => x.row_id === 'lp_rot_color').length>0 )
|
||||
var hayLinea = false
|
||||
for(let number=0;number<dataRows.length;number++){
|
||||
if(dataRows[number].row_id == 'lp_color' ||
|
||||
dataRows[number].row_id == 'lp_colorhq' ||
|
||||
dataRows[number].row_id == 'lp_rot_color'){
|
||||
hayLinea = true
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
popErrorAlert('<?=lang('Presupuestos.errores.lineaDuplicada') ?>', 'divAlarmasLineasPresupuesto');
|
||||
}
|
||||
else{
|
||||
var data = processRowData({tipo_maquina: 'toner'}, 'lp_color', 'lp-color');
|
||||
tableLineasPresupuesto.row.add(data).draw(true)
|
||||
eventos_lp_color()
|
||||
if(hayLinea){
|
||||
popErrorAlert('<?=lang('Presupuestos.errores.lineaDuplicada') ?>', 'divAlarmasLineasPresupuesto');
|
||||
break
|
||||
}
|
||||
|
||||
var data = processRowData({tipo_maquina: 'toner'}, 'lp_color', 'lp-color');
|
||||
tableLineasPresupuesto.row.add(data).draw(true)
|
||||
eventos_lp_color()
|
||||
break
|
||||
|
||||
case 'lp_colorhq':
|
||||
if(data.length>0){
|
||||
if( data.filter(x => x.row_id === 'lp_color').length>0 ||
|
||||
data.filter(x => x.row_id === 'lp_colorhq').length>0 ||
|
||||
data.filter(x => x.row_id === 'lp_rot_color').length>0 )
|
||||
var hayLinea = false
|
||||
for(let number=0;number<dataRows.length;number++){
|
||||
if(dataRows[number].row_id == 'lp_color' ||
|
||||
dataRows[number].row_id == 'lp_colorhq' ||
|
||||
dataRows[number].row_id == 'lp_rot_color'){
|
||||
hayLinea = true
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
popErrorAlert('<?=lang('Presupuestos.errores.lineaDuplicada') ?>', 'divAlarmasLineasPresupuesto');
|
||||
}
|
||||
else{
|
||||
var data = processRowData({tipo_maquina: 'toner'}, 'lp_colorhq', 'lp-colorhq');
|
||||
tableLineasPresupuesto.row.add(data).draw(true)
|
||||
eventos_lp_colorhq()
|
||||
if(hayLinea){
|
||||
popErrorAlert('<?=lang('Presupuestos.errores.lineaDuplicada') ?>', 'divAlarmasLineasPresupuesto');
|
||||
break
|
||||
}
|
||||
|
||||
var data = processRowData({tipo_maquina: 'toner'}, 'lp_colorhq', 'lp-colorhq');
|
||||
tableLineasPresupuesto.row.add(data).draw(true)
|
||||
eventos_lp_colorhq()
|
||||
break
|
||||
|
||||
case 'lp_rot_bn':
|
||||
if(data.length>0){
|
||||
if( data.filter(x => x.row_id === 'lp_bn').length>0 ||
|
||||
data.filter(x => x.row_id === 'lp_bnhq').length>0 ||
|
||||
data.filter(x => x.row_id === 'lp_rot_bn').length>0 )
|
||||
var hayLinea = false
|
||||
for(let number=0;number<dataRows.length;number++){
|
||||
if(dataRows[number].row_id == 'lp_bn' ||
|
||||
dataRows[number].row_id == 'lp_bnhq' ||
|
||||
dataRows[number].row_id == 'lp_rot_bn'){
|
||||
hayLinea = true
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
popErrorAlert('<?=lang('Presupuestos.errores.lineaDuplicada') ?>', 'divAlarmasLineasPresupuesto');
|
||||
}
|
||||
else{
|
||||
var data = processRowData({tipo_maquina: 'toner'}, 'lp_rot_bn', 'lp-rot-bn');
|
||||
tableLineasPresupuesto.row.add(data).draw(true)
|
||||
eventos_lp_rot_bn()
|
||||
if(hayLinea){
|
||||
popErrorAlert('<?=lang('Presupuestos.errores.lineaDuplicada') ?>', 'divAlarmasLineasPresupuesto');
|
||||
break
|
||||
}
|
||||
|
||||
var data = processRowData({tipo_maquina: 'toner'}, 'lp_rot_bn', 'lp-rot-bn');
|
||||
tableLineasPresupuesto.row.add(data).draw(true)
|
||||
eventos_lp_rot_bn()
|
||||
break
|
||||
|
||||
case 'lp_rot_color':
|
||||
if(data.length>0){
|
||||
if( data.filter(x => x.row_id === 'lp_color').length>0 ||
|
||||
data.filter(x => x.row_id === 'lp_colorhq').length>0 ||
|
||||
data.filter(x => x.row_id === 'lp_rot_color').length>0 )
|
||||
var hayLinea = false
|
||||
for(let number=0;number<dataRows.length;number++){
|
||||
if(dataRows[number].row_id == 'lp_color' ||
|
||||
dataRows[number].row_id == 'lp_colorhq' ||
|
||||
dataRows[number].row_id == 'lp_rot_color'){
|
||||
hayLinea = true
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
popErrorAlert('<?=lang('Presupuestos.errores.lineaDuplicada') ?>', 'divAlarmasLineasPresupuesto');
|
||||
}
|
||||
else{
|
||||
var data = processRowData({tipo_maquina: 'toner'}, 'lp_rot_color', 'lp-rot-color');
|
||||
tableLineasPresupuesto.row.add(data).draw(true)
|
||||
eventos_lp_rot_color()
|
||||
if(hayLinea){
|
||||
popErrorAlert('<?=lang('Presupuestos.errores.lineaDuplicada') ?>', 'divAlarmasLineasPresupuesto');
|
||||
break
|
||||
}
|
||||
|
||||
var data = processRowData({tipo_maquina: 'toner'}, 'lp_rot_color', 'lp-rot-color');
|
||||
tableLineasPresupuesto.row.add(data).draw(true)
|
||||
eventos_lp_rot_color()
|
||||
break
|
||||
case 'lp_cubierta':
|
||||
if(data.length>0){
|
||||
if( data.filter(x => x.row_id === 'lp_cubierta').length>0)
|
||||
|
||||
popErrorAlert('<?=lang('Presupuestos.errores.lineaDuplicada') ?>', 'divAlarmasLineasPresupuesto');
|
||||
case 'lp_cubierta':
|
||||
var hayLinea = false
|
||||
for(let number=0;number<dataRows.length;number++){
|
||||
if(dataRows[number].row_id == 'lp_cubierta'){
|
||||
hayLinea = true
|
||||
continue
|
||||
}
|
||||
}
|
||||
else{
|
||||
var data = processRowData({tipo_maquina: 'toner'}, 'lp_cubierta', 'lp-cubierta');
|
||||
tableLineasPresupuesto.row.add(data).draw(true)
|
||||
eventos_lp_cubierta()
|
||||
|
||||
if(hayLinea){
|
||||
popErrorAlert('<?=lang('Presupuestos.errores.lineaDuplicada') ?>', 'divAlarmasLineasPresupuesto');
|
||||
break
|
||||
}
|
||||
|
||||
var data = processRowData({tipo_maquina: 'toner'}, 'lp_cubierta', 'lp-cubierta');
|
||||
tableLineasPresupuesto.row.add(data).draw(true)
|
||||
eventos_lp_cubierta()
|
||||
break
|
||||
default:
|
||||
break
|
||||
@ -1254,6 +1301,10 @@ function fill_lp_bn(row, fromComparator=false){
|
||||
calcular_mermas()
|
||||
updateTotales(true, false, false)
|
||||
updateTablaEnvios()
|
||||
|
||||
|
||||
// Si existe cubierta, hay que actualizar con el valor del lomo
|
||||
check_update_cubierta()
|
||||
}
|
||||
|
||||
$("#tableLineasPresupuesto").DataTable().columns.adjust();
|
||||
@ -2962,6 +3013,7 @@ function calcularPresupuesto_cubierta(fromComparador=false, input_data={}){
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
let datos = {
|
||||
type: 'cubierta',
|
||||
color: 1,
|
||||
@ -2973,7 +3025,7 @@ function calcularPresupuesto_cubierta(fromComparador=false, input_data={}){
|
||||
solapas_ancho: parseInt($('#solapas_ancho').val()),
|
||||
tirada: parseInt($('#tirada').val()),
|
||||
merma: parseInt($('#mermacubierta').val()),
|
||||
ancho: dimension.ancho,
|
||||
ancho: dimension.ancho+getLomoLineasPresupuesto(),
|
||||
alto: dimension.alto,
|
||||
papel_generico_id: input_data.papel_generico_id,
|
||||
papel_generico: input_data.papel_generico,
|
||||
@ -3087,6 +3139,31 @@ function eventos_lp_cubierta(){
|
||||
$('#lp_cubierta_checkClicks').bind("change", {id_linea: 'lp_cubierta'}, update_total_linea);
|
||||
}
|
||||
|
||||
|
||||
function check_update_cubierta(){
|
||||
let row = tableLineasPresupuesto.row('#lp_cubierta');
|
||||
if(row.length>0){
|
||||
calcularPresupuesto_cubierta()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function getLomoLineasPresupuesto(){
|
||||
lomoTotal = 0
|
||||
tableLineasPresupuesto.rows().every( function ( rowIdx, tableLoop, rowLoop ) {
|
||||
var rowData = this.data();
|
||||
lomoTotal += parseFloat(rowData.lomo)
|
||||
})
|
||||
return lomoTotal
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
fill_lp_from_bbdd()
|
||||
|
||||
function fill_lp_from_bbdd(){
|
||||
@ -3361,23 +3438,23 @@ function updateLineasPresupuesto(){
|
||||
|
||||
$('#tableLineasPresupuesto tbody tr:visible ').each(function(){
|
||||
|
||||
if(this.id.endsWith('_bn')){
|
||||
checkComparadorInt(false, false, true);
|
||||
if(this.id.endsWith('lp_bn')){
|
||||
checkComparadorInt(false, false, true, false);
|
||||
}
|
||||
else if(this.id.endsWith('_bnhq')){
|
||||
checkComparadorInt(false, true, true);
|
||||
else if(this.id.endsWith('lp_bnhq')){
|
||||
checkComparadorInt(false, true, true, false);
|
||||
}
|
||||
else if(this.id.endsWith('_color')){
|
||||
checkComparadorInt(true, false, true);
|
||||
else if(this.id.endsWith('lp_color')){
|
||||
checkComparadorInt(true, false, true, false);
|
||||
}
|
||||
else if(this.id.endsWith('_colorhq')){
|
||||
checkComparadorInt(true, true, true);
|
||||
else if(this.id.endsWith('lp_colorhq')){
|
||||
checkComparadorInt(true, true, true, false);
|
||||
}
|
||||
else if(this.id.endsWith('_rot_bn')){
|
||||
checkComparadorInt(false, false, true)
|
||||
else if(this.id.endsWith('lp_rot_bn')){
|
||||
checkComparadorInt(false, false, false, true)
|
||||
}
|
||||
else if(this.id.endsWith('_rot_color')){
|
||||
checkComparadorInt(false,true, true);
|
||||
else if(this.id.endsWith('lp_rot_color')){
|
||||
checkComparadorInt(false,true, false, true);
|
||||
}
|
||||
else if(this.id.endsWith('_cubierta')){
|
||||
checkComparadorCubierta(true)
|
||||
|
||||
Reference in New Issue
Block a user