mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
edicion de facturas terminada a falta de tirada flexible
This commit is contained in:
@ -90,26 +90,24 @@
|
||||
|
||||
|
||||
<div class="row mb-2">
|
||||
<?php if($facturaEntity->serie_id == 7 || $facturaEntity->serie_id == 9): ?>
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<div class="mb-1">
|
||||
<label for="id" class="form-label">
|
||||
<?= ($facturaEntity->factura_retificada_id != null) ? lang('Facturas.facturaRectificada') : lang('Facturas.facturaRectificativa') ?>:
|
||||
</label>
|
||||
<input <?= ($facturaEntity->estado!='borrador')? "disabled":"" ?> id="facturaR" name="facturaR" tabindex="" maxLength="11" class="form-control"
|
||||
value=
|
||||
<?php if($facturaEntity->factura_retificada_id != null && $facturaEntity->factura_retificada_id != null): ?>
|
||||
""
|
||||
<?
|
||||
<?= old('factura_retificada_id', $facturaEntity->factura_retificada_id) ?>
|
||||
?>
|
||||
"
|
||||
value="<?= ($facturaEntity->factura_retificada_id != null) ? old('factura_retificada_id', $facturaEntity->factura_retificada_id): old('numero', $facturaEntity->factura_retificativa_id)?>"
|
||||
>
|
||||
</div>
|
||||
|
||||
<div <?= ($facturaEntity->serie_id == 7 || $facturaEntity->serie_id == 9 || $facturaEntity->factura_rectificada_id != null) ? "":"style='display:none;'" ?> class="col-md-12 col-lg-2 px-4 factura-R">
|
||||
<div class="mb-1">
|
||||
<label for="facturaR" class="form-label factura-R">
|
||||
<?= ($facturaEntity->factura_rectificada_id != null) ? lang('Facturas.facturaRectificada') : lang('Facturas.facturaRectificativa') ?>:
|
||||
</label>
|
||||
<input <?= ($facturaEntity->estado!='borrador')? "disabled":"" ?> id="facturaR" name="<?= ($facturaEntity->factura_rectificada_id != null) ? 'factura_rectificada_id' : 'factura_rectificativa_id' ?>" tabindex="" maxLength="25" class="form-control update-cabecera factura-R"
|
||||
|
||||
<?php if($facturaEntity->factura_rectificada_id == null && $facturaEntity->factura_rectificativa_id == null): ?>
|
||||
value=""
|
||||
<?php else: ?>
|
||||
value="<?= ($facturaEntity->factura_rectificada_id != null) ? old('factura_rectificada_id', $facturaEntity->factura_rectificada_id): old('factura_rectificativa_id', $facturaEntity->factura_rectificativa_id)?>"
|
||||
<?php endif; ?>
|
||||
>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="col-md-12 col-lg-<?= ($facturaEntity->factura_retificada_id != null || $facturaEntity->factura_retificativa_id != null)?"4":"6" ?> px-4">
|
||||
</div>
|
||||
|
||||
<div id="div_cliente" class="col-md-12 col-lg-<?= ($facturaEntity->factura_rectificada_id != null || $facturaEntity->factura_rectificativa_id != null)?"4":"6" ?> px-4">
|
||||
<div class="mb-1">
|
||||
<label for="cliente_nombre" class="form-label">
|
||||
<?= lang('Facturas.razonSocial') ?>
|
||||
@ -359,6 +357,19 @@ $('#duplicar').on('click', function() {
|
||||
|
||||
|
||||
$(".update-cabecera").on("change", function(){
|
||||
|
||||
if($(this).attr('id') == 'serie_id'){
|
||||
var id = $(this).val();
|
||||
if(id == 7 || id == 9){
|
||||
// se muestra el campo de factura rectificada que tiene como clase factura-R
|
||||
$('.factura-R').show();
|
||||
$('#div_cliente').removeClass('col-lg-6').addClass('col-lg-4');
|
||||
} else {
|
||||
// se oculta el campo de factura rectificada
|
||||
$('.factura-R').hide();
|
||||
$('#div_cliente').removeClass('col-lg-4').addClass('col-lg-6');
|
||||
}
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: '<?= route_to('updateCabecera', $facturaEntity->id) ?>',
|
||||
|
||||
@ -49,8 +49,8 @@
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="9" style="text-align:right">Pendiente de pago:</td>
|
||||
<td id="pendiente-pago"></td>
|
||||
<td <?= ($facturaEntity->serie_id == 7 || $facturaEntity->serie_id == 9)? "style='display:none;'":"" ?> colspan="9" style="text-align:right">Pendiente de pago:</td>
|
||||
<td <?= ($facturaEntity->serie_id == 7 || $facturaEntity->serie_id == 9)? "style='display:none;'":"" ?> id="pendiente-pago"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
@ -360,6 +360,9 @@ function updateFooterLineas(table){
|
||||
var total_pagos = parseFloat($('#totalCobrado-sum').html()).toFixed(2);
|
||||
var pendientePago = totalTotal - total_pagos;
|
||||
<?php endif; ?>
|
||||
if(isNaN(pendientePago)){
|
||||
pendientePago = 0;
|
||||
}
|
||||
$('#pendiente-pago').html(pendientePago.toFixed(2));
|
||||
|
||||
$.ajax({
|
||||
|
||||
@ -288,6 +288,10 @@ function updateFooterLineas(table){
|
||||
var total_pagos = parseFloat($('#totalCobrado-sum').html()).toFixed(2);
|
||||
var pendientePago = totalTotal - total_pagos;
|
||||
<?php endif; ?>
|
||||
// Se comprueba si pendientePago es un numero o NAN
|
||||
if(isNaN(pendientePago)){
|
||||
pendientePago = 0;
|
||||
}
|
||||
$('#pendiente-pago').html(pendientePago.toFixed(2));
|
||||
|
||||
$.ajax({
|
||||
|
||||
@ -0,0 +1,22 @@
|
||||
<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>
|
||||
</h2>
|
||||
<div id="accordionRectificadaFacturaTip" class="accordion-collapse collapse show" data-bs-parent="#rectificadaFactura">
|
||||
<div class="accordion-body">
|
||||
|
||||
<p><?= lang("Facturas.facturaPagada") ?></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?=$this->section('additionalInlineJs') ?>
|
||||
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
@ -22,9 +22,12 @@
|
||||
<?php endif; ?>
|
||||
|
||||
<?= view("themes/vuexy/form/facturas/_facturaLineasItems") ?>
|
||||
<?php if($facturaEntity->estado !='borrador' && (strpos($facturaEntity->numero, "REC ") === 0) ) : ?>
|
||||
<?php if($facturaEntity->estado !='borrador' && (strpos($facturaEntity->numero, "REC ") !== 0) ) : ?>
|
||||
<?= view("themes/vuexy/form/facturas/_pagosFacturasItems") ?>
|
||||
<?php endif; ?>
|
||||
<?php if($facturaEntity->estado !='borrador' && (strpos($facturaEntity->numero, "REC ") === 0) ) : ?>
|
||||
<?= view("themes/vuexy/form/facturas/_rectificadaFacturasItems") ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="pt-4">
|
||||
<?php if($facturaEntity->estado =='borrador') : ?>
|
||||
|
||||
Reference in New Issue
Block a user