mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'dev/presupuestos3_lp_2' into 'dev/presupuestos3'
Dev/presupuestos3 lp 2 See merge request jjimenez/safekat!71
This commit is contained in:
@ -24,7 +24,7 @@ if (session()->has('error')) {
|
||||
|
||||
<?= $this->section('additionalInlineJs') ?>
|
||||
|
||||
function popAlert(message, alertClass, alertIcon){
|
||||
function popAlert(message, alertClass, alertIcon, containerId = 'sk-alert'){
|
||||
var htmlString = `
|
||||
<div class="alert ${alertClass} d-flex align-items-baseline" role="alert">
|
||||
<span class="alert-icon alert-icon-lg text-primary me-2">
|
||||
@ -34,24 +34,26 @@ function popAlert(message, alertClass, alertIcon){
|
||||
<h5 class="alert-heading mb-2">${message}</h5>
|
||||
</div>
|
||||
</div>`;
|
||||
$(window).scrollTop(0);
|
||||
$('#sk-alert').hide().empty().html(htmlString).fadeIn("slow", function(){
|
||||
if(containerId == 'sk-alert'){
|
||||
$(window).scrollTop(0);
|
||||
}
|
||||
$('#' + containerId).hide().empty().html(htmlString).fadeIn("slow", function(){
|
||||
setTimeout(function(){
|
||||
$('#sk-alert').fadeOut("slow");
|
||||
$('#' + containerId).fadeOut("slow");
|
||||
}, 5000);
|
||||
});
|
||||
}
|
||||
|
||||
function popSuccessAlert(successMsg){
|
||||
popAlert(successMsg, "alert-success", "ti-check");
|
||||
function popSuccessAlert(successMsg, containerId = 'sk-alert'){
|
||||
popAlert(successMsg, "alert-success", "ti-check", containerId);
|
||||
}
|
||||
|
||||
function popWarningAlert(warningMsg){
|
||||
popAlert(warningMsg, "alert-warning", "ti-bell");
|
||||
function popWarningAlert(warningMsg, containerId = 'sk-alert'){
|
||||
popAlert(warningMsg, "alert-warning", "ti-bell", containerId);
|
||||
}
|
||||
|
||||
function popErrorAlert(errorMsg){
|
||||
popAlert(errorMsg, "alert-danger", "ti-ban");
|
||||
function popErrorAlert(errorMsg, containerId = 'sk-alert'){
|
||||
popAlert(errorMsg, "alert-danger", "ti-ban", containerId);
|
||||
}
|
||||
|
||||
<?php if (isset($successMessage) && $successMessage){ ?>
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
<label for="paginas" class="form-label">
|
||||
<?= lang('Presupuestos.paginas') ?>*
|
||||
</label>
|
||||
<input type="number" id="paginas" name="paginas" maxLength="11" class="form-control" value="<?= old('paginas', $presupuestoEntity->paginas) ?>">
|
||||
<input type="number" id="paginas" name="paginas" tabindex="1" maxLength="11" class="form-control" value="<?= old('paginas', $presupuestoEntity->paginas) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div>
|
||||
@ -29,7 +29,7 @@
|
||||
<div class="mb-3">
|
||||
|
||||
<div class="form-check form-switch mb-2">
|
||||
<input class="form-check-input" type="checkbox" id="solapas" name="solapas" value="1" <?= $presupuestoEntity->solapas == true ? 'checked' : ''; ?>>
|
||||
<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="papelFormatoPersonalizado"><?= lang('Presupuestos.solapasCubierta') ?></label>
|
||||
</div>
|
||||
|
||||
@ -44,7 +44,7 @@
|
||||
<label for="tirada" class="form-label">
|
||||
<?= lang('Presupuestos.tirada') ?>*
|
||||
</label>
|
||||
<input type="number" id="tirada" name="tirada" maxLength="11" class="form-control" value="<?= old('tirada', $presupuestoEntity->tirada) ?>">
|
||||
<input type="number" id="tirada" name="tirada" tabindex="2" maxLength="11" class="form-control" value="<?= old('tirada', $presupuestoEntity->tirada) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
@ -55,7 +55,7 @@
|
||||
<?= lang('Presupuestos.papelFormatoId') ?>*
|
||||
</label>
|
||||
|
||||
<select id="papelFormatoId" name="papel_formato_id" class="form-control select2bs2" style="width: 100%;">
|
||||
<select id="papelFormatoId" name="papel_formato_id" tabindex="3" class="form-control select2bs2" style="width: 100%;">
|
||||
|
||||
<?php if (isset($papelFormatoList) && is_array($papelFormatoList) && !empty($papelFormatoList)) :
|
||||
foreach ($papelFormatoList as $formato) : ?>
|
||||
@ -95,7 +95,7 @@
|
||||
<label for="merma" class="form-label">
|
||||
<?= lang('Presupuestos.merma') ?>*
|
||||
</label>
|
||||
<input type="number" id="merma" name="merma" maxLength="8" step="1" class="form-control" value="<?= old('merma', $presupuestoEntity->merma) ?>">
|
||||
<input type="number" id="merma" name="merma" maxLength="8" tabindex="4" step="1" class="form-control" value="<?= old('merma', $presupuestoEntity->merma) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
@ -104,7 +104,7 @@
|
||||
<label for="mermacubierta" class="form-label">
|
||||
<?= lang('Presupuestos.mermacubierta') ?>*
|
||||
</label>
|
||||
<input type="number" id="mermacubierta" name="merma_cubierta" placeholder="10" maxLength="8" step="1" class="form-control" value="<?= old('merma_cubierta', $presupuestoEntity->merma_cubierta) ?>">
|
||||
<input type="number" id="mermacubierta" name="merma_cubierta" tabindex="5" placeholder="10" maxLength="8" step="1" class="form-control" value="<?= old('merma_cubierta', $presupuestoEntity->merma_cubierta) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
|
||||
@ -9,6 +9,9 @@
|
||||
<div id="accordionDatosPresupuestoClienteTip" class="accordion-collapse collapse show" data-bs-parent="#accordionDatosPresupuestoCliente">
|
||||
<div class="accordion-body">
|
||||
|
||||
<!----------------------------------------------------------------------------->
|
||||
<div id="divAlarmasComparador"></div>
|
||||
<!----------------------------------------------------------------------------->
|
||||
|
||||
<div class="divider divider-dark text-start mb-1">
|
||||
<div class="divider-text">
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -151,50 +151,6 @@ $('.accordion-button').on('click', function (e) {
|
||||
/*******************************
|
||||
* Metodos
|
||||
*******************************/
|
||||
$('.insertarLinea').on("click", function (e) {
|
||||
|
||||
if(e.target.id.includes("Plana")){
|
||||
// Se borran todas las líneas que no sean cubierta y sobrecubierta
|
||||
$('#tableLineasPresupuesto').DataTable()
|
||||
.rows( function ( idx, data, node ) {
|
||||
return data[0] !== 'cubierta' && data[0] !== 'sobrecubierta';
|
||||
} )
|
||||
.remove()
|
||||
.draw();
|
||||
|
||||
var rows = $("#tableCompIntPlana").DataTable().rows( '.selected' ).data().toArray();
|
||||
console.log(rows);
|
||||
for(row of rows){
|
||||
$('#tableLineasPresupuesto').DataTable().row.add({
|
||||
'tipo': row['tipo'],
|
||||
'paginas': row['paginas'],
|
||||
'papel': row['papel'],
|
||||
'gramaje': row['gramaje'],
|
||||
'marca': row['marca'],
|
||||
'maquina': row['maquina'],
|
||||
'tiempo': row['tiempoMaquina'],
|
||||
'numeroPliegos': row['numeroPliegos'],
|
||||
'pliegosPedido': row['pliegosPedido'],
|
||||
'precioPliego': row['precioPliego'],
|
||||
'libro': row['libro'],
|
||||
'totalPapelPedido': row['totalPapelPedido'],
|
||||
'chekPapel': true,
|
||||
'lomo': row['lomo'],
|
||||
'peso': row['peso'],
|
||||
'click': row['click'],
|
||||
'totalClicks': row['totalClicks'],
|
||||
'chekClicks': true,
|
||||
'maquinaId': row['maquinaId'],
|
||||
'maquinaVelocidad': row['maquinaVelocidad'],
|
||||
'papelGenericoId': row['papelGenericoId'],
|
||||
'papelImpresionId': row['papelImpresionId'],
|
||||
}
|
||||
).draw();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function getRowFromLineaInt(tipo, linea) {
|
||||
|
||||
return {
|
||||
@ -252,19 +208,11 @@ function getRowFromLineaRot(linea) {
|
||||
'tiempoMaquina': linea.fields.tiempo_maquina,
|
||||
'papelGenericoId': linea.fields.papel_generico_id,
|
||||
'papelImpresionId': linea.fields.papel_impresion_id,
|
||||
'paginasColor': linea.fields.paginas_color,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function checkDatosPedidoForComp() {
|
||||
|
||||
if (parseInt($('#paginas').val()) > 0 &&
|
||||
parseInt($('#tirada').val()) > 0 &&
|
||||
($('#papelFormatoId').select2('data').length > 0 ||
|
||||
(parseInt($('#papelFormatoAncho').val()) > 0 && parseInt($('#papelFormatoAlto').val()) > 0)))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -530,12 +478,20 @@ function getIDsComparador(is_color, is_hq){
|
||||
function getDimensionLibro(){
|
||||
var ancho = 0;
|
||||
var alto = 0;
|
||||
|
||||
|
||||
if($('#papelFormatoId').select2('data').length > 0){
|
||||
ancho = parseFloat($('#papelFormatoId').select2('data')[0].text.trim().split(" x ")[0]);
|
||||
alto = parseFloat($('#papelFormatoId').select2('data')[0].text.trim().split(" x ")[1]);
|
||||
if($('#papelFormatoId').select2('data')[0].id.length > 0){
|
||||
ancho = parseFloat($('#papelFormatoId').select2('data')[0].text.trim().split(" x ")[0]);
|
||||
alto = parseFloat($('#papelFormatoId').select2('data')[0].text.trim().split(" x ")[1]);
|
||||
}
|
||||
else if(document.getElementById('papelFormatoPersonalizado').checked){
|
||||
ancho = parseFloat(document.getElementById('papelFormatoAncho').value);
|
||||
alto = parseFloat(document.getElementById('papelFormatoAlto').value);
|
||||
}
|
||||
}
|
||||
else{
|
||||
|
||||
else if(document.getElementById('papelFormatoPersonalizado').checked){
|
||||
ancho = parseFloat(document.getElementById('papelFormatoAncho').value);
|
||||
alto = parseFloat(document.getElementById('papelFormatoAlto').value);
|
||||
}
|
||||
|
||||
@ -184,7 +184,7 @@
|
||||
info: false,
|
||||
ordering: false,
|
||||
responsive: true,
|
||||
select: true,
|
||||
select: false,
|
||||
language: {
|
||||
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
||||
},
|
||||
@ -239,7 +239,7 @@
|
||||
info: false,
|
||||
ordering: false,
|
||||
responsive: true,
|
||||
select: true,
|
||||
select: false,
|
||||
language: {
|
||||
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
||||
},
|
||||
@ -281,11 +281,12 @@
|
||||
{ 'data': 'maquinaVelocidad'},
|
||||
{ 'data': 'tiempoMaquina'},
|
||||
{ 'data': 'papelGenericoId'},
|
||||
{ 'data': 'papelImpresionId'}
|
||||
{ 'data': 'papelImpresionId'},
|
||||
{ 'data': 'paginasColor'},
|
||||
],
|
||||
columnDefs: [
|
||||
{
|
||||
target: [21,22,23,24,25],
|
||||
target: [21,22,23,24,25,26],
|
||||
visible: false,
|
||||
searchable: false
|
||||
},
|
||||
@ -299,7 +300,7 @@
|
||||
info: false,
|
||||
ordering: false,
|
||||
responsive: true,
|
||||
select: true,
|
||||
select: false,
|
||||
language: {
|
||||
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
||||
},
|
||||
@ -358,7 +359,7 @@
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('.comp_negro_items').on('change', function (e) {
|
||||
|
||||
@ -485,7 +486,6 @@
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$('.comp_cubierta_items').on('change', function (){
|
||||
|
||||
@ -550,38 +550,17 @@
|
||||
|
||||
$('#tipoImpresion').on("change", function () {
|
||||
updatePapelesComparador();
|
||||
|
||||
$('#title_int_rot').html('<?= lang("Presupuestos.compInteriorRotativa") ?>');
|
||||
$('#title_int_plana').html('<?= lang("Presupuestos.compInteriorPlana") ?>');
|
||||
$('#paginas').change();
|
||||
|
||||
$('#tableCompIntRotativa').DataTable().clear().draw();
|
||||
$('#total_comp_rot').html("0.00");
|
||||
|
||||
if (($('#tipoImpresion').select2('data')[0].id == 'negro' ||
|
||||
$('#tipoImpresion').select2('data')[0].id == 'color')){
|
||||
|
||||
$('#tableCompIntRotativa').DataTable().clear().draw();
|
||||
$('#total_comp_rot').html("0.00");
|
||||
|
||||
if( $('#tableCompIntPlana').DataTable().rows().count() > 0 &&
|
||||
$('#tableCompIntPlana').DataTable().cell(0, 0).data().includes('hq')) {
|
||||
$('#tableCompIntPlana').DataTable().clear().draw();
|
||||
$('#total_comp_plana').html("0.00");
|
||||
|
||||
$('#tableCompIntPlana').DataTable().clear().draw();
|
||||
$('#total_comp_plana').html("0.00");
|
||||
}
|
||||
|
||||
}
|
||||
else if (($('#tipoImpresion').select2('data')[0].id == 'negrohq' ||
|
||||
$('#tipoImpresion').select2('data')[0].id == 'colorhq')){
|
||||
|
||||
$('#tableCompIntRotativa').DataTable().clear().draw();
|
||||
$('#total_comp_rot').html("0.00");
|
||||
|
||||
if($('#tableCompIntPlana').DataTable().rows().count() > 0 &&
|
||||
!$('#tableCompIntPlana').DataTable().cell(0, 0).data().includes('hq')) {
|
||||
|
||||
$('#tableCompIntPlana').DataTable().clear().draw();
|
||||
$('#total_comp_plana').html("0.00");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -591,11 +570,16 @@
|
||||
|
||||
if ($(''+ elementos.papel).select2('data').length > 0 &&
|
||||
$(''+ elementos.gramaje).select2('data').length > 0 &&
|
||||
parseInt($(''+ elementos.paginas).val()) > 0 &&
|
||||
checkDatosPedidoForComp()) {
|
||||
|
||||
getLineasIntPlana(is_color, is_hq).then((result) =>{
|
||||
getLineasIntRot(is_hq);
|
||||
|
||||
// Para rotativa, si es color el papel y el gramaje tiene que ser igual
|
||||
if(!is_color || ($('#compPapelNegro').select2('data')[0].id == $('#compPapelColor').select2('data')[0].id &&
|
||||
$('#compGramajeNegro').select2('data')[0].text.trim() == $('#compGramajeColor').select2('data')[0].text.trim()))
|
||||
{
|
||||
getLineasIntRot(is_hq);
|
||||
}
|
||||
});
|
||||
}
|
||||
else{
|
||||
@ -835,10 +819,9 @@
|
||||
function checkComparadorInt(is_color, is_hq) {
|
||||
|
||||
elementos = getIDsComparador(is_color, is_hq)
|
||||
|
||||
|
||||
if ($(''+ elementos.papel).select2('data').length > 0 &&
|
||||
$(''+ elementos.gramaje).select2('data').length > 0 &&
|
||||
parseInt($(''+ elementos.paginas).val()) > 0 &&
|
||||
checkDatosPedidoForComp()) {
|
||||
|
||||
getLineasIntPlana(is_color, is_hq).then((result) =>{
|
||||
@ -1069,8 +1052,37 @@
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function checkDatosPedidoForComp() {
|
||||
|
||||
const dimension = getDimensionLibro();
|
||||
|
||||
if (parseInt($('#paginas').val()) <= 0){
|
||||
popErrorAlert('<?=lang('Presupuestos.errores.paginas') ?>', 'divAlarmasComparador');
|
||||
return false;
|
||||
}
|
||||
if (parseInt($('#tirada').val()) <= 0){
|
||||
popErrorAlert('<?=lang('Presupuestos.errores.tiradas') ?>', 'divAlarmasComparador');
|
||||
return false;
|
||||
}
|
||||
if('ancho' in dimension && 'alto' in dimension){
|
||||
|
||||
if(dimension.alto < 60 || dimension.ancho < 60 || isNaN(dimension.alto) || isNaN(dimension.ancho) ){
|
||||
popErrorAlert('<?=lang('Presupuestos.errores.dimension') ?>', 'divAlarmasComparador');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else{
|
||||
popErrorAlert('<?=lang('Presupuestos.errores.dimension') ?>', 'divAlarmasComparador');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
|
||||
<?=$this->section('css') ?>
|
||||
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/datatables-editor/editor.dataTables.min.css') ?>">
|
||||
@ -1088,5 +1100,4 @@
|
||||
<script src="<?= site_url('themes/vuexy/js/datatables-editor/dataTables.editor.min.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/autosize/autosize.js') ?>"></script>
|
||||
<script src="<?= site_url('js_loader/comparadorCosidoTapaBlanda_js') ?>"></script>
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
Reference in New Issue
Block a user