mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
arreglado el tema de las facturas rectificadas/rectificativas
This commit is contained in:
@ -96,13 +96,12 @@
|
||||
|
||||
<div class="row mb-2">
|
||||
|
||||
<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 <?= ($facturaEntity->serie_id == 7 || $facturaEntity->serie_id == 9 || $facturaEntity->factura_rectificativa_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') ?>:
|
||||
<?= ($facturaEntity->serie_id == 7 || $facturaEntity->serie_id == 9) ? 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"
|
||||
|
||||
<input <?= ($facturaEntity->estado!='borrador')? "disabled":"" ?> id="facturaR" name="<?= ($facturaEntity->serie_id == 7 || $facturaEntity->serie_id == 9) ? '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: ?>
|
||||
|
||||
@ -211,7 +211,7 @@ var editor_lineas = new $.fn.dataTable.Editor( {
|
||||
name: "base",
|
||||
attr: {
|
||||
type: "text",
|
||||
name : "total",
|
||||
name : "base",
|
||||
class :"autonumeric"
|
||||
}
|
||||
}, {
|
||||
@ -224,6 +224,10 @@ var editor_lineas = new $.fn.dataTable.Editor( {
|
||||
name: "id",
|
||||
type: "hidden"
|
||||
},
|
||||
{
|
||||
name: "total",
|
||||
type: "hidden"
|
||||
}
|
||||
]
|
||||
} );
|
||||
|
||||
@ -279,7 +283,8 @@ editor_lineas.on( 'preEdit', function ( e, json, data, id ) {
|
||||
|
||||
editor_lineas.on( 'postSubmit', function ( e, json, data, action ) {
|
||||
|
||||
yeniden(json.<?= csrf_token() ?>);
|
||||
tableLineas.clearPipeline();
|
||||
tableLineas.draw();
|
||||
});
|
||||
|
||||
editor_lineas.on( 'submitSuccess', function ( e, json, data, action ) {
|
||||
@ -495,7 +500,7 @@ var tableLineas = $('#tableOfLineasFactura').DataTable({
|
||||
$('#total-iva-sum-4').closest('tr').addClass('d-none');
|
||||
}
|
||||
else{
|
||||
totalTotal += totalIVA_4;
|
||||
//totalTotal += totalIVA_4;
|
||||
$('#total-iva-sum-4').closest('tr').removeClass('d-none');
|
||||
}
|
||||
autoNumericIVA_21.set(totalIVA_21);
|
||||
@ -503,17 +508,18 @@ var tableLineas = $('#tableOfLineasFactura').DataTable({
|
||||
$('#total-iva-sum-21').closest('tr').addClass('d-none');
|
||||
}
|
||||
else{
|
||||
totalTotal += totalIVA_21;
|
||||
//totalTotal += totalIVA_21;
|
||||
$('#total-iva-sum-21').closest('tr').removeClass('d-none');
|
||||
}
|
||||
autoNumericTotal.set(totalTotal);
|
||||
|
||||
var total_pagos = autoNumericTotalCobrado.getNumber();
|
||||
var pendientePago = totalTotal - total_pagos;
|
||||
|
||||
if (isNaN(pendientePago)) pendientePago = 0;
|
||||
|
||||
autoNumericPendientePago.set(pendientePago);
|
||||
if(!(<?= $facturaEntity->serie_id ?> == 7 || <?= $facturaEntity->serie_id ?> == 9)){
|
||||
var total_pagos = autoNumericTotalCobrado.getNumber();
|
||||
var pendientePago = totalTotal - total_pagos;
|
||||
if (isNaN(pendientePago)) pendientePago = 0;
|
||||
autoNumericPendientePago.set(pendientePago);
|
||||
}
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: '<?= route_to('updateFacturaTotales', $facturaEntity->id) ?>',
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
|
||||
|
||||
<?= view("themes/vuexy/form/facturas/_facturaCabeceraItems") ?>
|
||||
<?php if($facturaEntity->estado =='borrador') : ?>
|
||||
<?php if($facturaEntity->estado =='borrador' && !($facturaEntity->serie_id == 7 || $facturaEntity->serie_id == 9)) : ?>
|
||||
<?= view("themes/vuexy/form/facturas/_addPedidosItems") ?>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user