mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
terminado y arreglado otros bugs
This commit is contained in:
@ -693,6 +693,14 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|||||||
$unidades_calculo,
|
$unidades_calculo,
|
||||||
$direccion['tipo'] == 'cajas' ? 0 : 1
|
$direccion['tipo'] == 'cajas' ? 0 : 1
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (count($coste_envio) > 0) {
|
||||||
|
$coste = floatval($coste_envio[0]->coste);
|
||||||
|
$margen = ($coste * floatval($coste_envio[0]->margen)) / 100.0;
|
||||||
|
$coste -= $margen;
|
||||||
|
$resultado_presupuesto['info']['totales'][$i]['coste_envio'] += $coste;
|
||||||
|
$resultado_presupuesto['info']['totales'][$i]['margen_envio'] += $margen;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch(Exception $e){
|
catch(Exception $e){
|
||||||
return $this->respond([
|
return $this->respond([
|
||||||
@ -701,14 +709,6 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|||||||
$csrfTokenName => $newTokenHash
|
$csrfTokenName => $newTokenHash
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($coste_envio) > 0) {
|
|
||||||
$coste = floatval($coste_envio[0]->coste);
|
|
||||||
$margen = ($coste * floatval($coste_envio[0]->margen)) / 100.0;
|
|
||||||
$coste -= $margen;
|
|
||||||
$resultado_presupuesto['info']['totales'][$i]['coste_envio'] += $coste;
|
|
||||||
$resultado_presupuesto['info']['totales'][$i]['margen_envio'] += $margen;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -782,10 +782,14 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|||||||
if ($servicio->tarifa_id == 3 || $servicio->tarifa_id == 5 || $servicio->tarifa_id == 16) {
|
if ($servicio->tarifa_id == 3 || $servicio->tarifa_id == 5 || $servicio->tarifa_id == 16) {
|
||||||
// Servicios acabado
|
// Servicios acabado
|
||||||
$this->guardarServicio($id, $servicio, 'acabado');
|
$this->guardarServicio($id, $servicio, 'acabado');
|
||||||
} else if ($servicio->tarifa_id == 24 || $servicio->tarifa_id == 9) {
|
} else if ($servicio->tarifa_id == 24 ) {
|
||||||
|
// Servicios preimpresion
|
||||||
|
$this->guardarServicio($id, $servicio, 'preimpresion');
|
||||||
|
} else if ($servicio->tarifa_id == 9) {
|
||||||
// Servicios extra
|
// Servicios extra
|
||||||
$this->guardarServicio($id, $servicio, 'extra');
|
$this->guardarServicio($id, $servicio, 'extra');
|
||||||
} else if ($servicio->tarifa_id == 62) {
|
}
|
||||||
|
else if ($servicio->tarifa_id == 62) {
|
||||||
// Servicios manipulado
|
// Servicios manipulado
|
||||||
$this->guardarServicio($id, $servicio, 'manipulado');
|
$this->guardarServicio($id, $servicio, 'manipulado');
|
||||||
}
|
}
|
||||||
@ -1475,7 +1479,22 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|||||||
$totalServicios += floatval($resultado[0]->total);
|
$totalServicios += floatval($resultado[0]->total);
|
||||||
$margenServicios += floatval($resultado[0]->total) * floatval($resultado[0]->margen) / 100.0;
|
$margenServicios += floatval($resultado[0]->total) * floatval($resultado[0]->margen) / 100.0;
|
||||||
}
|
}
|
||||||
} else if (intval($servicio) == 24 || intval($servicio) == 9) {
|
} else if (intval($servicio) == 24) {
|
||||||
|
// Servicios preimpresion (Ferro)
|
||||||
|
$resultado = PresupuestoCLienteService::getServiciosPreimpresion([
|
||||||
|
'tarifa_id' => $servicio,
|
||||||
|
]);
|
||||||
|
array_push($serviciosAutomaticos, $resultado[0]);
|
||||||
|
if ($resultado[0]->precio <= 0)
|
||||||
|
$error->servicios = lang('Presupuestos.errores.errorPresupuesto');
|
||||||
|
|
||||||
|
$coste_servicios += floatval($resultado[0]->precio);
|
||||||
|
if ($extra_info) {
|
||||||
|
$totalServicios += floatval($resultado[0]->precio);
|
||||||
|
$margenServicios += floatval($resultado[0]->precio) * floatval($resultado[0]->margen) / 100.0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(intval($servicio) == 9) {
|
||||||
// Servicios preimpresion
|
// Servicios preimpresion
|
||||||
$resultado = PresupuestoCLienteService::getServiciosExtra([
|
$resultado = PresupuestoCLienteService::getServiciosExtra([
|
||||||
'tarifa_id' => $servicio,
|
'tarifa_id' => $servicio,
|
||||||
|
|||||||
@ -63,7 +63,7 @@ class PresupuestoServiciosExtraModel extends \App\Models\BaseModel
|
|||||||
else{
|
else{
|
||||||
$ret_array[] = (object)[
|
$ret_array[] = (object)[
|
||||||
'tarifa_id'=> $tarifa_extra_id,
|
'tarifa_id'=> $tarifa_extra_id,
|
||||||
'tarifa_nombre'=> $modelTarifa->getNombreTarifaPreimpresion($tarifa_extra_id)[0]->nombre,
|
'tarifa_nombre'=> $modelTarifa->getNombreTarifaExtra($tarifa_extra_id)[0]->nombre,
|
||||||
'precio' => 0,
|
'precio' => 0,
|
||||||
'margen' => 0,
|
'margen' => 0,
|
||||||
];
|
];
|
||||||
|
|||||||
@ -178,6 +178,13 @@ $('#btnBack').on('click', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function finalizarPresupuesto(confirmar){
|
function finalizarPresupuesto(confirmar){
|
||||||
|
|
||||||
|
let isColor = false;
|
||||||
|
if($('#colorColorDiv').hasClass('checked') || $('#colorColorHqDiv').hasClass('checked'))
|
||||||
|
isColor = true;
|
||||||
|
let isHq = false;
|
||||||
|
if($('#colorNegroDiv').hasClass('checked') || $('#colorColorHqDiv').hasClass('checked'))
|
||||||
|
isHq = true;
|
||||||
|
|
||||||
const paths = window.location.pathname.split("/").filter(path => path !== "");
|
const paths = window.location.pathname.split("/").filter(path => path !== "");
|
||||||
let id=0;
|
let id=0;
|
||||||
@ -197,8 +204,8 @@ function finalizarPresupuesto(confirmar){
|
|||||||
paginasColor: $('#paginasColor').val(),
|
paginasColor: $('#paginasColor').val(),
|
||||||
tipo: $('.custom-option-tipo.checked').attr('id').replace('Div', ''),
|
tipo: $('.custom-option-tipo.checked').attr('id').replace('Div', ''),
|
||||||
tapa: $('#tapaDura').is(':checked') ? 'dura' : 'blanda',
|
tapa: $('#tapaDura').is(':checked') ? 'dura' : 'blanda',
|
||||||
isColor: $('#colorNegroDiv').hasClass('checked') ? 0 : 1,
|
isColor: isColor,
|
||||||
isHq: $('#calidadEstandarDiv').hasClass('checked') ? 0 : 1,
|
isHq: isHq,
|
||||||
papelInterior: $('#papelInterior option:selected').val(),
|
papelInterior: $('#papelInterior option:selected').val(),
|
||||||
papelInteriorNombre: $('#papelInterior option:selected').text().trim(),
|
papelInteriorNombre: $('#papelInterior option:selected').text().trim(),
|
||||||
gramajeInterior: $('#gramajeInterior option:selected').text(),
|
gramajeInterior: $('#gramajeInterior option:selected').text(),
|
||||||
@ -283,6 +290,7 @@ function finalizarPresupuesto(confirmar){
|
|||||||
|
|
||||||
if(Object.keys(response).length > 0) {
|
if(Object.keys(response).length > 0) {
|
||||||
if(response.status > 0){
|
if(response.status > 0){
|
||||||
|
if(confirmar || window.location.href.includes("add"))
|
||||||
window.location.href = response.url + '/' + response.status;
|
window.location.href = response.url + '/' + response.status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -50,13 +50,21 @@
|
|||||||
|
|
||||||
const lastColNr = $('#tableOfPresupuestos').find("tr:first th").length - 1;
|
const lastColNr = $('#tableOfPresupuestos').find("tr:first th").length - 1;
|
||||||
const actionBtns = function(data) {
|
const actionBtns = function(data) {
|
||||||
return `
|
if(data.estado == 'borrador')
|
||||||
<td class="text-right py-0 align-middle">
|
return `
|
||||||
<div class="btn-group btn-group-sm">
|
<td class="text-right py-0 align-middle">
|
||||||
<a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></a>
|
<div class="btn-group btn-group-sm">
|
||||||
<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}" data-bs-toggle="modal" data-bs-target="#confirm2delete"></i></a>
|
<a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></a>
|
||||||
</div>
|
<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}" data-bs-toggle="modal" data-bs-target="#confirm2delete"></i></a>
|
||||||
</td>`;
|
</div>
|
||||||
|
</td>`;
|
||||||
|
else
|
||||||
|
return `
|
||||||
|
<td class="text-right py-0 align-middle">
|
||||||
|
<div class="btn-group btn-group-sm">
|
||||||
|
<a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></a>
|
||||||
|
</div>
|
||||||
|
</td>`;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Setup - add a text input to each footer cell
|
// Setup - add a text input to each footer cell
|
||||||
|
|||||||
@ -51,13 +51,23 @@
|
|||||||
|
|
||||||
const lastColNr = $('#tableOfPresupuestos').find("tr:first th").length - 1;
|
const lastColNr = $('#tableOfPresupuestos').find("tr:first th").length - 1;
|
||||||
const actionBtns = function(data) {
|
const actionBtns = function(data) {
|
||||||
return `
|
if (data.estado == 'aceptado') {
|
||||||
<td class="text-right py-0 align-middle">
|
return `
|
||||||
<div class="btn-group btn-group-sm">
|
<td class="text-right py-0 align-middle">
|
||||||
<a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></a>
|
<div class="btn-group btn-group-sm">
|
||||||
<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}" data-bs-toggle="modal" data-bs-target="#confirm2delete"></i></a>
|
<a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></a>
|
||||||
</div>
|
</div>
|
||||||
</td>`;
|
</td>`;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
return `
|
||||||
|
<td class="text-right py-0 align-middle">
|
||||||
|
<div class="btn-group btn-group-sm">
|
||||||
|
<a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></a>
|
||||||
|
<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}" data-bs-toggle="modal" data-bs-target="#confirm2delete"></i></a>
|
||||||
|
</div>
|
||||||
|
</td>`;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Setup - add a text input to each footer cell
|
// Setup - add a text input to each footer cell
|
||||||
|
|||||||
Reference in New Issue
Block a user