mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'main' into feat/sk-40/sk-37
This commit is contained in:
@ -35,9 +35,15 @@
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="8" style="text-align:right">I.V.A.:</td>
|
||||
<td class="autonumeric text-end" id="total-iva-sum"></td>
|
||||
<tr class="d-none">
|
||||
<td colspan="8" style="text-align:right">IVA (4%):</td>
|
||||
<td class="autonumeric text-end" id="total-iva-sum-4"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr class="d-none">
|
||||
<td colspan="8" style="text-align:right">IVA (21%):</td>
|
||||
<td class="autonumeric text-end" id="total-iva-sum-21"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
@ -124,17 +130,26 @@ const actionBtns = function(data) {
|
||||
|
||||
const autoNumericSubtotal = new AutoNumeric('#subtotal-sum', 0, {
|
||||
decimalPlaces: 2,
|
||||
digitGroupSeparator: ',',
|
||||
decimalCharacter: '.',
|
||||
digitGroupSeparator: '.',
|
||||
decimalCharacter: ',',
|
||||
unformatOnSubmit: true,
|
||||
decimalPlacesShownOnFocus: 2,
|
||||
decimalPlacesShownOnBlur: 2,
|
||||
});
|
||||
|
||||
const autoNumericIVA = new AutoNumeric('#total-iva-sum', 0, {
|
||||
const autoNumericIVA_4 = new AutoNumeric('#total-iva-sum-4', 0, {
|
||||
decimalPlaces: 2,
|
||||
digitGroupSeparator: ',',
|
||||
decimalCharacter: '.',
|
||||
digitGroupSeparator: '.',
|
||||
decimalCharacter: ',',
|
||||
unformatOnSubmit: true,
|
||||
decimalPlacesShownOnFocus: 2,
|
||||
decimalPlacesShownOnBlur: 2,
|
||||
});
|
||||
|
||||
const autoNumericIVA_21 = new AutoNumeric('#total-iva-sum-21', 0, {
|
||||
decimalPlaces: 2,
|
||||
digitGroupSeparator: '.',
|
||||
decimalCharacter: ',',
|
||||
unformatOnSubmit: true,
|
||||
decimalPlacesShownOnFocus: 2,
|
||||
decimalPlacesShownOnBlur: 2,
|
||||
@ -142,8 +157,8 @@ const autoNumericIVA = new AutoNumeric('#total-iva-sum', 0, {
|
||||
|
||||
const autoNumericTotal = new AutoNumeric('#total-sum', 0, {
|
||||
decimalPlaces: 2,
|
||||
digitGroupSeparator: ',',
|
||||
decimalCharacter: '.',
|
||||
digitGroupSeparator: '.',
|
||||
decimalCharacter: ',',
|
||||
unformatOnSubmit: true,
|
||||
decimalPlacesShownOnFocus: 2,
|
||||
decimalPlacesShownOnBlur: 2,
|
||||
@ -151,8 +166,8 @@ const autoNumericTotal = new AutoNumeric('#total-sum', 0, {
|
||||
|
||||
const autoNumericPendientePago = new AutoNumeric('#pendiente-pago', 0, {
|
||||
decimalPlaces: 2,
|
||||
digitGroupSeparator: ',',
|
||||
decimalCharacter: '.',
|
||||
digitGroupSeparator: '.',
|
||||
decimalCharacter: ',',
|
||||
unformatOnSubmit: true,
|
||||
decimalPlacesShownOnFocus: 2,
|
||||
decimalPlacesShownOnBlur: 2,
|
||||
@ -448,11 +463,38 @@ var tableLineas = $('#tableOfLineasFactura').DataTable({
|
||||
const table = this.api();
|
||||
|
||||
const totalSubtotal = table.column(8).data().reduce((a, b) => parseFloat(a) + parseFloat(b), 0);
|
||||
const totalIVA = table.column(9).data().reduce((a, b) => parseFloat(a) + parseFloat(b), 0);
|
||||
|
||||
const data_table = table.rows().data();
|
||||
const totalIVA_4 = data_table.reduce((sum, row) => {
|
||||
if (parseInt(row['iva']) === 4) {
|
||||
return sum + parseFloat(row['total_iva']) || 0;
|
||||
}
|
||||
return sum;
|
||||
}, 0);
|
||||
const totalIVA_21 = data_table.reduce((sum, row) => {
|
||||
if (parseInt(row['iva']) === 21) {
|
||||
return sum + parseFloat(row['total_iva']) || 0;
|
||||
}
|
||||
return sum;
|
||||
}, 0);
|
||||
|
||||
const totalTotal = table.column(10).data().reduce((a, b) => parseFloat(a) + parseFloat(b), 0);
|
||||
|
||||
autoNumericSubtotal.set(totalSubtotal);
|
||||
autoNumericIVA.set(totalIVA);
|
||||
autoNumericIVA_4.set(totalIVA_4);
|
||||
if(totalIVA_4 == 0){
|
||||
$('#total-iva-sum-4').closest('tr').addClass('d-none');
|
||||
}
|
||||
else{
|
||||
$('#total-iva-sum-4').closest('tr').removeClass('d-none');
|
||||
}
|
||||
autoNumericIVA_21.set(totalIVA_21);
|
||||
if(totalIVA_21 == 0){
|
||||
$('#total-iva-sum-21').closest('tr').addClass('d-none');
|
||||
}
|
||||
else{
|
||||
$('#total-iva-sum-21').closest('tr').removeClass('d-none');
|
||||
}
|
||||
autoNumericTotal.set(totalTotal);
|
||||
|
||||
var total_pagos = autoNumericTotalCobrado.getNumber();
|
||||
|
||||
@ -190,6 +190,11 @@
|
||||
dataType: 'json',
|
||||
success:function(response){
|
||||
|
||||
if(response.error){
|
||||
console.error(response.error);
|
||||
return;
|
||||
}
|
||||
|
||||
token=response.<?= csrf_token() ?>;
|
||||
yeniden(token);
|
||||
// redirect
|
||||
|
||||
Reference in New Issue
Block a user