|
|
|
@ -2203,7 +2203,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|
|
|
$lomo += floatval($linea['mano']);
|
|
|
|
$lomo += floatval($linea['mano']);
|
|
|
|
$info['lomo_interior'] += floatval($linea['mano']);
|
|
|
|
$info['lomo_interior'] += floatval($linea['mano']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($extra_info) {
|
|
|
|
|
|
|
|
$this->calcular_coste_linea(
|
|
|
|
$this->calcular_coste_linea(
|
|
|
|
$linea,
|
|
|
|
$linea,
|
|
|
|
$totalPapel,
|
|
|
|
$totalPapel,
|
|
|
|
@ -2212,7 +2212,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|
|
|
$totalImpresion,
|
|
|
|
$totalImpresion,
|
|
|
|
$margenImpresion
|
|
|
|
$margenImpresion
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -2251,13 +2251,12 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|
|
|
$costeInterior = 0.0;
|
|
|
|
$costeInterior = 0.0;
|
|
|
|
$peso_interior = 0.0;
|
|
|
|
$peso_interior = 0.0;
|
|
|
|
$lomo = 0;
|
|
|
|
$lomo = 0;
|
|
|
|
if ($extra_info) {
|
|
|
|
|
|
|
|
$totalPapel = 0.0;
|
|
|
|
$totalPapel = 0.0;
|
|
|
|
$margenPapel = 0.0;
|
|
|
|
$margenPapel = 0.0;
|
|
|
|
$sumForFactor = 0.0;
|
|
|
|
$sumForFactor = 0.0;
|
|
|
|
$totalImpresion = 0.0;
|
|
|
|
$totalImpresion = 0.0;
|
|
|
|
$margenImpresion = 0.0;
|
|
|
|
$margenImpresion = 0.0;
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach ($interior as $linea) {
|
|
|
|
foreach ($interior as $linea) {
|
|
|
|
if (count($linea) > 0) {
|
|
|
|
if (count($linea) > 0) {
|
|
|
|
$costeInterior += round(floatval($linea['total_impresion']), 2);
|
|
|
|
$costeInterior += round(floatval($linea['total_impresion']), 2);
|
|
|
|
@ -2266,7 +2265,6 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|
|
|
$lomo += floatval($linea['mano']);
|
|
|
|
$lomo += floatval($linea['mano']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$peso_interior += floatval($linea['peso']);
|
|
|
|
$peso_interior += floatval($linea['peso']);
|
|
|
|
if ($extra_info) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->calcular_coste_linea(
|
|
|
|
$this->calcular_coste_linea(
|
|
|
|
$linea,
|
|
|
|
$linea,
|
|
|
|
@ -2276,7 +2274,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|
|
|
$totalImpresion,
|
|
|
|
$totalImpresion,
|
|
|
|
$margenImpresion
|
|
|
|
$margenImpresion
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -2321,8 +2319,6 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|
|
|
$lomo += floatval($cubierta['mano']);
|
|
|
|
$lomo += floatval($cubierta['mano']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($extra_info) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->calcular_coste_linea(
|
|
|
|
$this->calcular_coste_linea(
|
|
|
|
$cubierta,
|
|
|
|
$cubierta,
|
|
|
|
$totalPapel,
|
|
|
|
$totalPapel,
|
|
|
|
@ -2332,7 +2328,6 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|
|
|
$margenImpresion
|
|
|
|
$margenImpresion
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($coste_cubierta <= 0) {
|
|
|
|
if ($coste_cubierta <= 0) {
|
|
|
|
|
|
|
|
|
|
|
|
$errorModel = new ErrorPresupuesto();
|
|
|
|
$errorModel = new ErrorPresupuesto();
|
|
|
|
@ -2382,7 +2377,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|
|
|
return $return_data;
|
|
|
|
return $return_data;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$coste_servicios += round(floatval($acabadoCubierta[0]->total), 2);
|
|
|
|
$coste_servicios += round(floatval($acabadoCubierta[0]->total), 2);
|
|
|
|
if ($extra_info) {
|
|
|
|
|
|
|
|
//$totalServicios += round(floatval($acabadoCubierta[0]->total), 2);
|
|
|
|
//$totalServicios += round(floatval($acabadoCubierta[0]->total), 2);
|
|
|
|
$base = round(floatval($acabadoCubierta[0]->total / (1 + $acabadoCubierta[0]->margen / 100.0)), 2);
|
|
|
|
$base = round(floatval($acabadoCubierta[0]->total / (1 + $acabadoCubierta[0]->margen / 100.0)), 2);
|
|
|
|
$base = round(floatval($base / $cantidad_total), 2) * $cantidad_total;
|
|
|
|
$base = round(floatval($base / $cantidad_total), 2) * $cantidad_total;
|
|
|
|
@ -2390,7 +2385,6 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|
|
|
$margenServicios += round(floatval($acabadoCubierta[0]->total - $base), 2);
|
|
|
|
$margenServicios += round(floatval($acabadoCubierta[0]->total - $base), 2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -2422,13 +2416,12 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|
|
|
return $return_data;
|
|
|
|
return $return_data;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$coste_servicios += round(floatval($resultado[0]->total), 2);
|
|
|
|
$coste_servicios += round(floatval($resultado[0]->total), 2);
|
|
|
|
if ($extra_info) {
|
|
|
|
|
|
|
|
//$totalServicios += round(floatval($resultado[0]->total), 2);
|
|
|
|
//$totalServicios += round(floatval($resultado[0]->total), 2);
|
|
|
|
$base = round(floatval($resultado[0]->total / (1 + $resultado[0]->margen / 100.0)), 2);
|
|
|
|
$base = round(floatval($resultado[0]->total / (1 + $resultado[0]->margen / 100.0)), 2);
|
|
|
|
$base = round(floatval($base / $cantidad_total), 2) * $cantidad_total;
|
|
|
|
$base = round(floatval($base / $cantidad_total), 2) * $cantidad_total;
|
|
|
|
$totalServicios += $base;
|
|
|
|
$totalServicios += $base;
|
|
|
|
$margenServicios += round(floatval($resultado[0]->total - $base), 2);
|
|
|
|
$margenServicios += round(floatval($resultado[0]->total - $base), 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -2458,7 +2451,6 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|
|
|
if (count($linea_sobrecubierta) > 0) {
|
|
|
|
if (count($linea_sobrecubierta) > 0) {
|
|
|
|
$coste_sobrecubierta += round(floatval($linea_sobrecubierta['total_impresion']), 2);
|
|
|
|
$coste_sobrecubierta += round(floatval($linea_sobrecubierta['total_impresion']), 2);
|
|
|
|
$peso_sobrecubierta += round(floatval($linea_sobrecubierta['peso']), 2);
|
|
|
|
$peso_sobrecubierta += round(floatval($linea_sobrecubierta['peso']), 2);
|
|
|
|
if ($extra_info) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->calcular_coste_linea(
|
|
|
|
$this->calcular_coste_linea(
|
|
|
|
$linea_sobrecubierta,
|
|
|
|
$linea_sobrecubierta,
|
|
|
|
@ -2468,7 +2460,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|
|
|
$totalImpresion,
|
|
|
|
$totalImpresion,
|
|
|
|
$margenImpresion
|
|
|
|
$margenImpresion
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($coste_sobrecubierta <= 0) {
|
|
|
|
if ($coste_sobrecubierta <= 0) {
|
|
|
|
|
|
|
|
|
|
|
|
@ -2519,7 +2511,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$coste_servicios += round(floatval($acabadoSobrecubierta[0]->total), 2);
|
|
|
|
$coste_servicios += round(floatval($acabadoSobrecubierta[0]->total), 2);
|
|
|
|
if ($extra_info) {
|
|
|
|
|
|
|
|
//$totalServicios += round(floatval($acabadoSobrecubierta[0]->total), 2);
|
|
|
|
//$totalServicios += round(floatval($acabadoSobrecubierta[0]->total), 2);
|
|
|
|
$base = round(floatval($acabadoSobrecubierta[0]->total / (1 + $acabadoSobrecubierta[0]->margen / 100.0)), 2);
|
|
|
|
$base = round(floatval($acabadoSobrecubierta[0]->total / (1 + $acabadoSobrecubierta[0]->margen / 100.0)), 2);
|
|
|
|
$base = round(floatval($base / $cantidad_total), 2) * $cantidad_total;
|
|
|
|
$base = round(floatval($base / $cantidad_total), 2) * $cantidad_total;
|
|
|
|
@ -2529,7 +2521,6 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Guardas
|
|
|
|
//Guardas
|
|
|
|
$guardas = [];
|
|
|
|
$guardas = [];
|
|
|
|
@ -2567,7 +2558,6 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|
|
|
if (intval($tirada[$t]) == intval($selected_tirada)) {
|
|
|
|
if (intval($tirada[$t]) == intval($selected_tirada)) {
|
|
|
|
$lomo += floatval($guardas['mano']);
|
|
|
|
$lomo += floatval($guardas['mano']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($extra_info) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->calcular_coste_linea(
|
|
|
|
$this->calcular_coste_linea(
|
|
|
|
$guardas,
|
|
|
|
$guardas,
|
|
|
|
@ -2578,7 +2568,6 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|
|
|
$margenImpresion
|
|
|
|
$margenImpresion
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($coste_guardas <= 0) {
|
|
|
|
if ($coste_guardas <= 0) {
|
|
|
|
$errorModel = new ErrorPresupuesto();
|
|
|
|
$errorModel = new ErrorPresupuesto();
|
|
|
|
$errorModel->insertError(
|
|
|
|
$errorModel->insertError(
|
|
|
|
@ -2621,7 +2610,6 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|
|
|
$linea_faja['tipo_linea'] = 'lp_faja';
|
|
|
|
$linea_faja['tipo_linea'] = 'lp_faja';
|
|
|
|
$coste_faja += round(floatval($linea_faja['total_impresion']), 2);
|
|
|
|
$coste_faja += round(floatval($linea_faja['total_impresion']), 2);
|
|
|
|
$peso_faja += floatval($linea_faja['peso']);
|
|
|
|
$peso_faja += floatval($linea_faja['peso']);
|
|
|
|
if ($extra_info) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->calcular_coste_linea(
|
|
|
|
$this->calcular_coste_linea(
|
|
|
|
$linea_faja,
|
|
|
|
$linea_faja,
|
|
|
|
@ -2632,7 +2620,6 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|
|
|
$margenImpresion
|
|
|
|
$margenImpresion
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($coste_faja <= 0) {
|
|
|
|
if ($coste_faja <= 0) {
|
|
|
|
|
|
|
|
|
|
|
|
$errorModel = new ErrorPresupuesto();
|
|
|
|
$errorModel = new ErrorPresupuesto();
|
|
|
|
@ -2681,13 +2668,13 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$coste_servicios += round(floatval($acabadoFaja[0]->total), 2);
|
|
|
|
$coste_servicios += round(floatval($acabadoFaja[0]->total), 2);
|
|
|
|
if ($extra_info) {
|
|
|
|
|
|
|
|
//$totalServicios += round(floatval($acabadoFaja[0]->total), 2);
|
|
|
|
//$totalServicios += round(floatval($acabadoFaja[0]->total), 2);
|
|
|
|
$base = round(floatval($acabadoFaja[0]->total / (1 + $acabadoFaja[0]->margen / 100.0)), 2);
|
|
|
|
$base = round(floatval($acabadoFaja[0]->total / (1 + $acabadoFaja[0]->margen / 100.0)), 2);
|
|
|
|
$base = round(floatval($base / $cantidad_total), 2) * $cantidad_total;
|
|
|
|
$base = round(floatval($base / $cantidad_total), 2) * $cantidad_total;
|
|
|
|
$totalServicios += $base;
|
|
|
|
$totalServicios += $base;
|
|
|
|
$margenServicios += round(floatval($acabadoFaja[0]->total - $base), 2);
|
|
|
|
$margenServicios += round(floatval($acabadoFaja[0]->total - $base), 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -2736,13 +2723,13 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$costeServiciosDefecto += round(floatval($servicio->total), 2);
|
|
|
|
$costeServiciosDefecto += round(floatval($servicio->total), 2);
|
|
|
|
if ($extra_info) {
|
|
|
|
|
|
|
|
//$totalServicios += round(floatval($servicio->total), 2);
|
|
|
|
//$totalServicios += round(floatval($servicio->total), 2);
|
|
|
|
$base = round(floatval($servicio->total / (1 + $servicio->margen / 100.0)), 2);
|
|
|
|
$base = round(floatval($servicio->total / (1 + $servicio->margen / 100.0)), 2);
|
|
|
|
$base = round(floatval($base / $cantidad_total), 2) * $cantidad_total;
|
|
|
|
$base = round(floatval($base / $cantidad_total), 2) * $cantidad_total;
|
|
|
|
$totalServicios += $base;
|
|
|
|
$totalServicios += $base;
|
|
|
|
$margenServicios += round(floatval($servicio->total - $base), 2);
|
|
|
|
$margenServicios += round(floatval($servicio->total - $base), 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$servDefectoMan = PresupuestoCLienteService::getServiciosManipuladoDefault([
|
|
|
|
$servDefectoMan = PresupuestoCLienteService::getServiciosManipuladoDefault([
|
|
|
|
@ -2774,14 +2761,13 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$costeServiciosDefecto += round(floatval($servicio->total), 2);
|
|
|
|
$costeServiciosDefecto += round(floatval($servicio->total), 2);
|
|
|
|
if ($extra_info) {
|
|
|
|
|
|
|
|
//$totalServicios += round(floatval($servicio->total), 2);
|
|
|
|
//$totalServicios += round(floatval($servicio->total), 2);
|
|
|
|
$base = round(floatval($servicio->total / (1 + $servicio->margen / 100.0)), 2);
|
|
|
|
$base = round(floatval($servicio->total / (1 + $servicio->margen / 100.0)), 2);
|
|
|
|
$base = round(floatval($base / $cantidad_total), 2) * $cantidad_total;
|
|
|
|
$base = round(floatval($base / $cantidad_total), 2) * $cantidad_total;
|
|
|
|
$totalServicios += $base;
|
|
|
|
$totalServicios += $base;
|
|
|
|
$margenServicios += round(floatval($servicio->total - $base), 2);
|
|
|
|
$margenServicios += round(floatval($servicio->total - $base), 2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($extra_info) {
|
|
|
|
if ($extra_info) {
|
|
|
|
$sumForFactorPonderado = $sumForFactor;
|
|
|
|
$sumForFactorPonderado = $sumForFactor;
|
|
|
|
@ -2880,13 +2866,13 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$coste_servicios += round(floatval($resultado[0]->total), 2);
|
|
|
|
$coste_servicios += round(floatval($resultado[0]->total), 2);
|
|
|
|
if ($extra_info) {
|
|
|
|
|
|
|
|
//$totalServicios += round(floatval($resultado[0]->total), 2);
|
|
|
|
//$totalServicios += round(floatval($resultado[0]->total), 2);
|
|
|
|
$base = round(floatval($resultado[0]->total / (1 + $resultado[0]->margen / 100.0)), 2);
|
|
|
|
$base = round(floatval($resultado[0]->total / (1 + $resultado[0]->margen / 100.0)), 2);
|
|
|
|
$base = round(floatval($base / $cantidad_total), 2) * $cantidad_total;
|
|
|
|
$base = round(floatval($base / $cantidad_total), 2) * $cantidad_total;
|
|
|
|
$totalServicios += $base;
|
|
|
|
$totalServicios += $base;
|
|
|
|
$margenServicios += round(floatval($resultado[0]->total - $base), 2);
|
|
|
|
$margenServicios += round(floatval($resultado[0]->total - $base), 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if ($servicio->nombre == "ferro" || $servicio->nombre == "prototipo") {
|
|
|
|
} else if ($servicio->nombre == "ferro" || $servicio->nombre == "prototipo") {
|
|
|
|
// Extra
|
|
|
|
// Extra
|
|
|
|
$resultado = PresupuestoCLienteService::getServiciosExtra([
|
|
|
|
$resultado = PresupuestoCLienteService::getServiciosExtra([
|
|
|
|
@ -2913,13 +2899,13 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|
|
|
array_push($serviciosAutomaticos, $resultado[0]);
|
|
|
|
array_push($serviciosAutomaticos, $resultado[0]);
|
|
|
|
|
|
|
|
|
|
|
|
$coste_servicios += round(floatval($resultado[0]->precio), 2);
|
|
|
|
$coste_servicios += round(floatval($resultado[0]->precio), 2);
|
|
|
|
if ($extra_info) {
|
|
|
|
|
|
|
|
//$totalServicios += round(floatval($resultado[0]->precio), 2);
|
|
|
|
//$totalServicios += round(floatval($resultado[0]->precio), 2);
|
|
|
|
$base = round(floatval($resultado[0]->total / (1 + $resultado[0]->margen / 100.0)), 2);
|
|
|
|
$base = round(floatval($resultado[0]->total / (1 + $resultado[0]->margen / 100.0)), 2);
|
|
|
|
$base = round(floatval($base / $cantidad_total), 2) * $cantidad_total;
|
|
|
|
$base = round(floatval($base / $cantidad_total), 2) * $cantidad_total;
|
|
|
|
$totalServicios += $base;
|
|
|
|
$totalServicios += $base;
|
|
|
|
$margenServicios += round(floatval($resultado[0]->total - $base), 2);
|
|
|
|
$margenServicios += round(floatval($resultado[0]->total - $base), 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if ($servicio->nombre == 'solapas_cubierta' || $servicio->nombre == 'solapas_sobrecubierta' || $servicio->nombre == 'solapas_faja') {
|
|
|
|
} else if ($servicio->nombre == 'solapas_cubierta' || $servicio->nombre == 'solapas_sobrecubierta' || $servicio->nombre == 'solapas_faja') {
|
|
|
|
// Servicios manipulado
|
|
|
|
// Servicios manipulado
|
|
|
|
$resultado = PresupuestoCLienteService::getServiciosManipulado([
|
|
|
|
$resultado = PresupuestoCLienteService::getServiciosManipulado([
|
|
|
|
@ -2948,7 +2934,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$coste_servicios += round(floatval($resultado[0]->total), 2);
|
|
|
|
$coste_servicios += round(floatval($resultado[0]->total), 2);
|
|
|
|
if ($extra_info) {
|
|
|
|
|
|
|
|
//$totalServicios += round(floatval($resultado[0]->total), 2);
|
|
|
|
//$totalServicios += round(floatval($resultado[0]->total), 2);
|
|
|
|
$base = round(floatval($resultado[0]->total / (1 + $resultado[0]->margen / 100.0)), 2);
|
|
|
|
$base = round(floatval($resultado[0]->total / (1 + $resultado[0]->margen / 100.0)), 2);
|
|
|
|
$base = round(floatval($base / $cantidad_total), 2) * $cantidad_total;
|
|
|
|
$base = round(floatval($base / $cantidad_total), 2) * $cantidad_total;
|
|
|
|
@ -2956,7 +2942,6 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|
|
|
$margenServicios += round(floatval($resultado[0]->total - $base), 2);
|
|
|
|
$margenServicios += round(floatval($resultado[0]->total - $base), 2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$serviciosExtra = [];
|
|
|
|
$serviciosExtra = [];
|
|
|
|
// funcionalidad para los servicios extra añadidos por el usuario
|
|
|
|
// funcionalidad para los servicios extra añadidos por el usuario
|
|
|
|
@ -2990,14 +2975,13 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|
|
|
array_push($serviciosExtra, $resultado[0]);
|
|
|
|
array_push($serviciosExtra, $resultado[0]);
|
|
|
|
|
|
|
|
|
|
|
|
$coste_servicios += round(floatval($resultado[0]->precio), 2);
|
|
|
|
$coste_servicios += round(floatval($resultado[0]->precio), 2);
|
|
|
|
if ($extra_info) {
|
|
|
|
|
|
|
|
//$totalServicios += round(floatval($resultado[0]->precio), 2);
|
|
|
|
//$totalServicios += round(floatval($resultado[0]->precio), 2);
|
|
|
|
$base = round(floatval($resultado[0]->precio / (1 + $resultado[0]->margen / 100.0)), 2);
|
|
|
|
$base = round(floatval($resultado[0]->precio / (1 + $resultado[0]->margen / 100.0)), 2);
|
|
|
|
$base = round(floatval($base / $cantidad_total), 2) * $cantidad_total;
|
|
|
|
$base = round(floatval($base / $cantidad_total), 2) * $cantidad_total;
|
|
|
|
$totalServicios += $base;
|
|
|
|
$totalServicios += $base;
|
|
|
|
$margenServicios += round(floatval($resultado[0]->precio - $base), 2);
|
|
|
|
$margenServicios += round(floatval($resultado[0]->precio - $base), 2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -3030,14 +3014,13 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$coste_servicios += round(floatval($resultado[0]->total), 2);
|
|
|
|
$coste_servicios += round(floatval($resultado[0]->total), 2);
|
|
|
|
if ($extra_info) {
|
|
|
|
|
|
|
|
//$totalServicios += round(floatval($resultado[0]->total), 2);
|
|
|
|
//$totalServicios += round(floatval($resultado[0]->total), 2);
|
|
|
|
$base = round(floatval($resultado[0]->total / (1 + $resultado[0]->margen / 100.0)), 2);
|
|
|
|
$base = round(floatval($resultado[0]->total / (1 + $resultado[0]->margen / 100.0)), 2);
|
|
|
|
$base = round(floatval($base / $cantidad_total), 2) * $cantidad_total;
|
|
|
|
$base = round(floatval($base / $cantidad_total), 2) * $cantidad_total;
|
|
|
|
$totalServicios += $base;
|
|
|
|
$totalServicios += $base;
|
|
|
|
$margenServicios += round(floatval($resultado[0]->total - $base), 2);
|
|
|
|
$margenServicios += round(floatval($resultado[0]->total - $base), 2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (is_array($sobreCubierta) && ($sobreCubierta['solapas'] > 0 && intval($linea_sobrecubierta['dimension_desarrollo']['ancho']) > 630)) {
|
|
|
|
if (is_array($sobreCubierta) && ($sobreCubierta['solapas'] > 0 && intval($linea_sobrecubierta['dimension_desarrollo']['ancho']) > 630)) {
|
|
|
|
|
|
|
|
|
|
|
|
@ -3068,14 +3051,13 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$coste_servicios += round(floatval($resultado[0]->total), 2);
|
|
|
|
$coste_servicios += round(floatval($resultado[0]->total), 2);
|
|
|
|
if ($extra_info) {
|
|
|
|
|
|
|
|
//$totalServicios += round(floatval($resultado[0]->total), 2);
|
|
|
|
//$totalServicios += round(floatval($resultado[0]->total), 2);
|
|
|
|
$base = round(floatval($resultado[0]->total / (1 + $resultado[0]->margen / 100.0)), 2);
|
|
|
|
$base = round(floatval($resultado[0]->total / (1 + $resultado[0]->margen / 100.0)), 2);
|
|
|
|
$base = round(floatval($base / $cantidad_total), 2) * $cantidad_total;
|
|
|
|
$base = round(floatval($base / $cantidad_total), 2) * $cantidad_total;
|
|
|
|
$totalServicios += $base;
|
|
|
|
$totalServicios += $base;
|
|
|
|
$margenServicios += round(floatval($resultado[0]->total - $base), 2);
|
|
|
|
$margenServicios += round(floatval($resultado[0]->total - $base), 2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (is_array($faja) && $faja !== [] && ($faja['solapas'] > 0 && intval($linea_faja['dimension_desarrollo']['ancho']) > 630)) {
|
|
|
|
if (is_array($faja) && $faja !== [] && ($faja['solapas'] > 0 && intval($linea_faja['dimension_desarrollo']['ancho']) > 630)) {
|
|
|
|
|
|
|
|
|
|
|
|
@ -3106,14 +3088,13 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$coste_servicios += round(floatval($resultado[0]->total), 2);
|
|
|
|
$coste_servicios += round(floatval($resultado[0]->total), 2);
|
|
|
|
if ($extra_info) {
|
|
|
|
|
|
|
|
//$totalServicios += round(floatval($resultado[0]->total), 2);
|
|
|
|
//$totalServicios += round(floatval($resultado[0]->total), 2);
|
|
|
|
$base = round(floatval($resultado[0]->total / (1 + $resultado[0]->margen / 100.0)), 2);
|
|
|
|
$base = round(floatval($resultado[0]->total / (1 + $resultado[0]->margen / 100.0)), 2);
|
|
|
|
$base = round(floatval($base / $cantidad_total), 2) * $cantidad_total;
|
|
|
|
$base = round(floatval($base / $cantidad_total), 2) * $cantidad_total;
|
|
|
|
$totalServicios += $base;
|
|
|
|
$totalServicios += $base;
|
|
|
|
$margenServicios += round(floatval($resultado[0]->total - $base), 2);
|
|
|
|
$margenServicios += round(floatval($resultado[0]->total - $base), 2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*$total_por_tirada = $costeInterior +
|
|
|
|
/*$total_por_tirada = $costeInterior +
|
|
|
|
$coste_cubierta +
|
|
|
|
$coste_cubierta +
|
|
|
|
|