mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
terminado
This commit is contained in:
@ -518,28 +518,27 @@ var tableLineas = $('#tableOfLineasFactura').DataTable({
|
||||
var pendientePago = totalTotal - total_pagos;
|
||||
if (isNaN(pendientePago)) pendientePago = 0;
|
||||
autoNumericPendientePago.set(pendientePago);
|
||||
|
||||
$.ajax({
|
||||
url: '<?= route_to('updateFacturaTotales', $facturaEntity->id) ?>',
|
||||
method: 'POST',
|
||||
data: {
|
||||
base: totalSubtotal,
|
||||
total: totalTotal,
|
||||
total_pagos: total_pagos,
|
||||
pendiente: pendientePago,
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
}
|
||||
}).done(function (data) {
|
||||
if (data.estado_pago === 'pagada') {
|
||||
$('#estado_pago_text').text('<?= lang('Facturas.pagada') ?>').css('color', 'green');
|
||||
} else {
|
||||
$('#estado_pago_text').text('<?= lang('Facturas.pendiente') ?>').css('color', 'red');
|
||||
}
|
||||
}).fail(function (jqXHR) {
|
||||
popErrorAlert(jqXHR.responseJSON.messages.error);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: '<?= route_to('updateFacturaTotales', $facturaEntity->id) ?>',
|
||||
method: 'POST',
|
||||
data: {
|
||||
base: totalSubtotal,
|
||||
total: totalTotal,
|
||||
total_pagos: total_pagos,
|
||||
pendiente: pendientePago,
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
}
|
||||
}).done(function (data) {
|
||||
if (data.estado_pago === 'pagada') {
|
||||
$('#estado_pago_text').text('<?= lang('Facturas.pagada') ?>').css('color', 'green');
|
||||
} else {
|
||||
$('#estado_pago_text').text('<?= lang('Facturas.pendiente') ?>').css('color', 'red');
|
||||
}
|
||||
}).fail(function (jqXHR) {
|
||||
popErrorAlert(jqXHR.responseJSON.messages.error);
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@ -398,18 +398,31 @@ function updateFooterLineas(table){
|
||||
pendiente: pendientePago
|
||||
}
|
||||
}).done((data, textStatus, jqXHR) => {
|
||||
if(autoNumericPendientePago.getNumber() == 0){
|
||||
$('#addPagoRow').hide();
|
||||
} else {
|
||||
$('#addPagoRow').show();
|
||||
}
|
||||
if(data.estado_pago == 'pagada'){
|
||||
$('#estado_pago_text').text('<?= lang('Facturas.pagada') ?>');
|
||||
$('#estado_pago_text').css('color', 'green');
|
||||
if($('#numero').val().startsWith("REC")){
|
||||
|
||||
if($("#vencimiento-rectificativa").length > 0){
|
||||
$('#estado_pago_text').text('<?= lang('Facturas.pendiente') ?>');
|
||||
$('#estado_pago_text').css('color', 'red');
|
||||
}
|
||||
else{
|
||||
$('#estado_pago_text').text('<?= lang('Facturas.facturaPagada') ?>');
|
||||
$('#estado_pago_text').css('color', 'green');
|
||||
}
|
||||
}
|
||||
else{
|
||||
$('#estado_pago_text').text('<?= lang('Facturas.pendiente') ?>');
|
||||
$('#estado_pago_text').css('color', 'red');
|
||||
if(autoNumericPendientePago.getNumber() == 0){
|
||||
$('#addPagoRow').hide();
|
||||
} else {
|
||||
$('#addPagoRow').show();
|
||||
}
|
||||
if(data.estado_pago == 'pagada'){
|
||||
$('#estado_pago_text').text('<?= lang('Facturas.pagada') ?>');
|
||||
$('#estado_pago_text').css('color', 'green');
|
||||
}
|
||||
else{
|
||||
$('#estado_pago_text').text('<?= lang('Facturas.pendiente') ?>');
|
||||
$('#estado_pago_text').css('color', 'red');
|
||||
}
|
||||
}
|
||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||
popErrorAlert(jqXHR.responseJSON.messages.error)
|
||||
|
||||
@ -1,14 +1,41 @@
|
||||
<div class="accordion accordion-bordered mt-3" id="rectificadaFactura">
|
||||
<div class="card accordion-item active">
|
||||
<h2 class="accordion-header" id="headingrectificadaFactura">
|
||||
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionRectificadaFacturaTip" aria-expanded="false" aria-controls="accordionRectificadaFacturaTip">
|
||||
<h3><?= lang("Facturas.facturaRectificada") ?></h3>
|
||||
<button type="button" class="accordion-button" data-bs-toggle="collapse"
|
||||
data-bs-target="#accordionRectificadaFacturaTip" aria-expanded="false"
|
||||
aria-controls="accordionRectificadaFacturaTip">
|
||||
<h3><?= lang("Facturas.facturaRectificativa") ?></h3>
|
||||
</button>
|
||||
</h2>
|
||||
<div id="accordionRectificadaFacturaTip" class="accordion-collapse collapse show" data-bs-parent="#rectificadaFactura">
|
||||
<div id="accordionRectificadaFacturaTip" class="accordion-collapse collapse show"
|
||||
data-bs-parent="#rectificadaFactura">
|
||||
<div class="accordion-body">
|
||||
|
||||
<p><?= lang("Facturas.facturaPagada") ?></p>
|
||||
|
||||
<?php if (isset($facturaEntity->facturaRectificativaPagada)): ?>
|
||||
<p><?= lang("Facturas.facturaPagada") ?></p>
|
||||
<?php else: ?>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-3 col-lg-3 mb-2">
|
||||
<label for="vencimiento_rectificativa"
|
||||
class="form-label"><?= @lang("Facturas.vencimiento") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="date" class="form-control" placeholder="" name="vencimiento_rectificativa"
|
||||
id="vencimiento-rectificativa" />
|
||||
<button class="btn btn-outline-warning" id="clearRectDate" type="button"><i
|
||||
class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="vencimiento_rectificativa"
|
||||
class="form-label"><?= @lang("Facturas.textoConformarFactura") ?></label>
|
||||
<div class="input-group">
|
||||
<button name="conformarFactura" id="conformarFactura" class="btn btn-success" type="button">
|
||||
<?= lang("Facturas.conformarFactura") ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@ -16,7 +43,7 @@
|
||||
</div>
|
||||
|
||||
|
||||
<?=$this->section('additionalInlineJs') ?>
|
||||
<?= $this->section('additionalInlineJs') ?>
|
||||
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
<?= $this->endSection() ?>
|
||||
@ -139,6 +139,8 @@ function validatedConfirmed(){
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/sk-datatables.css') ?>">
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/datatables-editor/editor.dataTables.min.css') ?>">
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/datetime/1.5.2/css/dataTables.dateTime.min.css">
|
||||
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/flatpickr/flatpickr.css") ?>">
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/sweetalert2/sweetalert2.css') ?>" />
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
@ -154,7 +156,9 @@ function validatedConfirmed(){
|
||||
<script src="<?= site_url('themes/vuexy/js/datatables-editor/dataTables.editor.min.js') ?>"></script>
|
||||
<script type="text/javascript" src="https://cdn.datatables.net/datetime/1.5.2/js/dataTables.dateTime.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/sweetalert2/sweetalert2.js') ?>"></script>
|
||||
|
||||
<script type="module" src="<?= site_url('assets/js/safekat/pages/facturas/facturasEdit.js') ?>"></script>
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user