reparando bugs

This commit is contained in:
jaimejimenezortega
2024-05-22 16:22:55 +02:00
parent 1063c95fc0
commit e4f6295597
7 changed files with 10995 additions and 338 deletions

View File

@ -81,12 +81,12 @@ class PresupuestoEntity extends \CodeIgniter\Entity\Entity
"total_antes_descuento" => null, "total_antes_descuento" => null,
"total_descuento" => null, "total_descuento" => null,
"total_descuentoPercent" => null, "total_descuentoPercent" => null,
"total_presupuesto" => null,
"total_precio_unidad" => null, "total_precio_unidad" => null,
"total_factor" => null, "total_factor" => null,
"total_factor_ponderado" => null, "total_factor_ponderado" => null,
'total_aceptado' => null, 'total_aceptado' => null,
'iva_reducido' => null, 'iva_reducido' => null,
'excluir_rotativa' => null,
"acabado_cubierta_id" => null, "acabado_cubierta_id" => null,
"acabado_sobrecubierta_id" => null, "acabado_sobrecubierta_id" => null,
"is_duplicado" => false, "is_duplicado" => false,
@ -151,6 +151,7 @@ class PresupuestoEntity extends \CodeIgniter\Entity\Entity
"total_factor_ponderado" => "?float", "total_factor_ponderado" => "?float",
'total_aceptado' => "?float", 'total_aceptado' => "?float",
'iva_reducido' => "?boolean", 'iva_reducido' => "?boolean",
'excluir_rotativa' => "?boolean",
"acabado_cubierta_id" => "int", "acabado_cubierta_id" => "int",
"acabado_sobrecubierta_id" => "int", "acabado_sobrecubierta_id" => "int",
"is_duplicado" => "boolean", "is_duplicado" => "boolean",

View File

@ -122,6 +122,7 @@ class PresupuestoModel extends \App\Models\BaseModel
"total_factor_ponderado", "total_factor_ponderado",
'total_aceptado', 'total_aceptado',
'iva_reducido', 'iva_reducido',
'excluir_rotativa',
"acabado_cubierta_id", "acabado_cubierta_id",
"acabado_sobrecubierta_id", "acabado_sobrecubierta_id",
"is_duplicado" "is_duplicado"

View File

@ -172,11 +172,10 @@
<?= $this->section("additionalInlineJs") ?> <?= $this->section("additionalInlineJs") ?>
window.estado = <?= $presupuestoEntity->estado_id ?>; window.estado = <?= $presupuestoEntity->estado_id ?? 1?>;
window.tirada = <?= $presupuestoEntity->selected_tirada ?>; window.tirada = <?= $presupuestoEntity->selected_tirada ?? 0?>;
window.total = <?= $presupuestoEntity->total_aceptado ?>; window.total = <?= $presupuestoEntity->total_aceptado ?? 0?>;
window.total_unidad = <?= $presupuestoEntity->total_precio_unidad ?>; window.total_unidad = <?= $presupuestoEntity->total_precio_unidad ?? 0 ?>;
window.iva_reducido= <?= $presupuestoEntity->iva_reducido ?>;
window.routes_resumen = { window.routes_resumen = {
guardarPresupuesto: "<?= route_to('guardarPresupuesto') ?>", guardarPresupuesto: "<?= route_to('guardarPresupuesto') ?>",
duplicarPresupuesto: "<?= route_to('duplicarPresupuesto') ?>", duplicarPresupuesto: "<?= route_to('duplicarPresupuesto') ?>",

View File

@ -13,7 +13,8 @@
// -------------------------------------------------------------------- // --------------------------------------------------------------------
const clientePresupuestoWizard = document.querySelector('#wizard-presupuesto-cliente'); const clientePresupuestoWizard = document.querySelector('#wizard-presupuesto-cliente');
if (typeof clientePresupuestoWizard !== undefined && clientePresupuestoWizard !== null) { if (typeof clientePresupuestoWizard !== undefined && clientePresupuestoWizard !== null &&
clientePresupuestoWizard.querySelector('#presupuesto-cliente-form').querySelector('#tipo-libro') !== null ) {
// Wizard form // Wizard form
const clientePresupuestoWizardForm = clientePresupuestoWizard.querySelector('#presupuesto-cliente-form'); const clientePresupuestoWizardForm = clientePresupuestoWizard.querySelector('#presupuesto-cliente-form');
// Wizard steps // Wizard steps
@ -38,7 +39,6 @@
}); });
// Deal Details // Deal Details
if(clientePresupuestoWizardFormStep2 !== null){
const FormValidation2 = FormValidation.formValidation(clientePresupuestoWizardFormStep2, { const FormValidation2 = FormValidation.formValidation(clientePresupuestoWizardFormStep2, {
fields: { fields: {
}, },
@ -337,7 +337,7 @@
} }
}); });
}); });
}
} }
})(); })();

View File

@ -78,7 +78,6 @@ function generarResumen(){
$('.resumen-extras').hide(); $('.resumen-extras').hide();
} }
if(window.estado==1){
for (i = 1; i <= 4; i++) { for (i = 1; i <= 4; i++) {
let id = "tiradaPrecio" + i; let id = "tiradaPrecio" + i;
if ($('#' + id).length > 0) { if ($('#' + id).length > 0) {
@ -105,17 +104,7 @@ function generarResumen(){
$('#resumenPrecioU').text(precio_u.toFixed(4) + '€/ud'); $('#resumenPrecioU').text(precio_u.toFixed(4) + '€/ud');
} }
} }
}
else{
let iva = 1.04;
if(window.iva_reducido == 0){
iva = 1.21;
}
let total = window.total*iva;
let p_unidad = total/window.tirada;
$('#resumenTotalIVA').text('Total (I.V.A. ' + (total.toFixed(2)) + '€');
$('#resumenPrecioU').text(p_unidad.toFixed(4) + '€/ud');
}
} }

10667
xdebug.log

File diff suppressed because one or more lines are too long