mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
funcionalidad completa de ferro prototipo en cliente a excepción de guardar los checks de usar la misma dirección
This commit is contained in:
@ -1561,11 +1561,11 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
}
|
||||
|
||||
if (count($direccionesFP1) > 0) {
|
||||
$this->guardarLineaEnvio($id, $direccionesFP1, $peso_libro, true);
|
||||
$this->guardarLineaEnvio($id, $direccionesFP1, $peso_libro, true, true, 1);
|
||||
|
||||
}
|
||||
if (count($direccionesFP2) > 0) {
|
||||
$this->guardarLineaEnvio($id, $direccionesFP2, $peso_libro, true);
|
||||
$this->guardarLineaEnvio($id, $direccionesFP2, $peso_libro, true, true, 2);
|
||||
}
|
||||
|
||||
if ($confirmar) {
|
||||
@ -1708,6 +1708,11 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
$data['direcciones'] = $this->obtenerDireccionesEnvio($id);
|
||||
}
|
||||
|
||||
$direccionesFerroPrototipo = $this->obtenerDireccionesEnvioFerro($id);
|
||||
if($direccionesFerroPrototipo && count($direccionesFerroPrototipo) > 0) {
|
||||
$data['direccionesFerroPrototipo'] = $direccionesFerroPrototipo;
|
||||
}
|
||||
|
||||
if (intval($presupuesto->estado_id) == 2) {
|
||||
$data['resumen']['base'] = $presupuesto->total_antes_descuento;
|
||||
$data['resumen']['total_envio'] = round(
|
||||
@ -1871,7 +1876,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
}
|
||||
|
||||
|
||||
protected function guardarLineaEnvio($presupuestoId, $direccion, $peso_libro, $coste_cero = false)
|
||||
protected function guardarLineaEnvio($presupuestoId, $direccion, $peso_libro, $coste_cero = false, $is_ferro_prototipo = false, $num_ferro_prototipo = 0)
|
||||
{
|
||||
|
||||
$unidades = intval($direccion['unidades']);
|
||||
@ -1893,6 +1898,10 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
unset($data->id);
|
||||
if($coste_cero) {
|
||||
$data->coste = 0;
|
||||
if($is_ferro_prototipo){
|
||||
$data->is_ferro_prototipo = 1;
|
||||
$data->num_ferro_prototipo = $num_ferro_prototipo;
|
||||
}
|
||||
} else {
|
||||
$data->precio = $data->coste;
|
||||
}
|
||||
@ -3426,7 +3435,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
{
|
||||
$model = model('App\Models\Presupuestos\PresupuestoDireccionesModel');
|
||||
$direcciones = $model->where('presupuesto_id', $id)
|
||||
->where('is_ferro_prototipo', 0)->asArray()->findAll();
|
||||
->where('is_ferro_prototipo', 1)->get()->getResultArray();
|
||||
|
||||
return $direcciones;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user