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:
@ -1595,7 +1595,7 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
||||
$presupuestoServiciosExtraModel = model('App\Models\Presupuestos\PresupuestoServiciosExtraModel');
|
||||
foreach ($presupuestoServiciosExtraModel->where('presupuesto_id', $presupuesto->id)->findAll() as $servicioExtra) {
|
||||
$servicioExtra->presupuesto_id = $new_id;
|
||||
$presupuestoServiciosExtraModel->insert($preimpresion);
|
||||
$presupuestoServiciosExtraModel->insert($servicioExtra);
|
||||
}
|
||||
|
||||
$presupuestoDireccionesModel = model('App\Models\Presupuestos\PresupuestoDireccionesModel');
|
||||
|
||||
@ -151,7 +151,7 @@ class ClientePlantillaPreciosLineasModel extends \App\Models\BaseModel
|
||||
|
||||
$builder->join("users t2", "t1.user_updated_id = t2.id", "left");
|
||||
|
||||
$builder->where('t1.deleted_at', 0);
|
||||
$builder->where('t1.deleted_at', null);
|
||||
$builder->where('t1.plantilla_id', $plantilla_id);
|
||||
|
||||
if (empty($search))
|
||||
|
||||
@ -388,7 +388,7 @@ class ClientePreciosModel extends \App\Models\BaseModel
|
||||
|
||||
$builder->join("users t2", "t1.user_updated_id = t2.id", "left");
|
||||
|
||||
$builder->where('t1.deleted_at', 0);
|
||||
$builder->where('t1.deleted_at', null);
|
||||
$builder->where('t1.cliente_id', $cliente_id);
|
||||
|
||||
if (empty($search))
|
||||
|
||||
@ -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
|
||||
|
||||
@ -399,7 +399,9 @@ class PresupuestoAdminEdit {
|
||||
self.tipo_impresion.val(response.data.tipo_impresion);
|
||||
self.POD.val(response.data.POD);
|
||||
|
||||
AutoNumeric.getAutoNumericElement($('#total_aceptado_revisado')[0]).set(response.data.total_aceptado_revisado);
|
||||
const totalAceptadoRevisado = response.data.total_aceptado_revisado != null ?
|
||||
response.data.total_aceptado_revisado : response.data.resumen.total_aceptado;
|
||||
AutoNumeric.getAutoNumericElement($('#total_aceptado_revisado')[0]).set(totalAceptadoRevisado);
|
||||
|
||||
$('#aprobado_by_at').html(response.data.aprobado_by_at);
|
||||
|
||||
|
||||
@ -414,6 +414,9 @@ class Resumen {
|
||||
if (total_aceptado_revisado && total_aceptado_revisado != 0) {
|
||||
data.total_aceptado_revisado = total_aceptado_revisado;
|
||||
}
|
||||
else{
|
||||
data.total_aceptado_revisado = data.total_aceptado;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user