Auth, Login, Home, Venta->Listados->Precios
This commit is contained in:
26
app/src/Model/Venta/Cierre.php
Normal file
26
app/src/Model/Venta/Cierre.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
namespace Incoviba\Model\Venta;
|
||||
|
||||
use DateTimeInterface;
|
||||
use Incoviba\Common\Ideal;
|
||||
use Incoviba\Model;
|
||||
|
||||
class Cierre extends Ideal\Model
|
||||
{
|
||||
public Model\Proyecto $proyecto;
|
||||
public float $precio;
|
||||
public DateTimeInterface $dateTime;
|
||||
public bool $relacionado;
|
||||
public Propietario $propietario;
|
||||
|
||||
public function jsonSerialize(): mixed
|
||||
{
|
||||
return array_merge(parent::jsonSerialize(), [
|
||||
'proyecto_id' => $this->proyecto->id,
|
||||
'precio' => $this->precio,
|
||||
'date_time' => $this->dateTime->format('Y-m-d H:i:s'),
|
||||
'relacionado' => $this->relacionado,
|
||||
'propietario' => $this->propietario->rut
|
||||
]);
|
||||
}
|
||||
}
|
38
app/src/Model/Venta/Cuota.php
Normal file
38
app/src/Model/Venta/Cuota.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
namespace Incoviba\Model\Venta;
|
||||
|
||||
use DateTimeInterface;
|
||||
use Incoviba\Common\Ideal\Model;
|
||||
use Incoviba\Model\Banco;
|
||||
|
||||
class Cuota extends Model
|
||||
{
|
||||
public Pie $pie;
|
||||
public DateTimeInterface $fecha;
|
||||
public float $valor;
|
||||
public ?bool $estado;
|
||||
public ?Banco $banco;
|
||||
public ?DateTimeInterface $fechaPago;
|
||||
public ?bool $abonado;
|
||||
public ?DateTimeInterface $fechaAbonado;
|
||||
public ?float $uf;
|
||||
public ?Pago $pago;
|
||||
public ?int $numero;
|
||||
|
||||
public function jsonSerialize(): mixed
|
||||
{
|
||||
return array_merge(parent::jsonSerialize(), [
|
||||
'pie_id' => $this->pie->id,
|
||||
'fecha' => $this->fecha->format('Y-m-d H:i:s'),
|
||||
'valor' => $this->valor,
|
||||
'estado' => $this->estado ?? false,
|
||||
'banco' => $this->banco,
|
||||
'fecha_pago' => $this->fechaPago->format('Y-m-d H:i:s') ?? '',
|
||||
'abonado' => $this->abonado ?? false,
|
||||
'fecha_abonado' => $this->fechaAbonado->format('Y-m-d H:i:s') ?? '',
|
||||
'uf' => $this->uf ?? 1,
|
||||
'pago' => $this->pago ?? '',
|
||||
'numero' => $this->numero ?? ''
|
||||
]);
|
||||
}
|
||||
}
|
27
app/src/Model/Venta/Datos.php
Normal file
27
app/src/Model/Venta/Datos.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
namespace Incoviba\Model\Venta;
|
||||
|
||||
use JsonSerializable;
|
||||
use Incoviba\Model\Direccion;
|
||||
|
||||
class Datos
|
||||
{
|
||||
public ?string $sexo;
|
||||
public ?string $estado_civil;
|
||||
public ?string $profesion;
|
||||
public ?Direccion $direccion;
|
||||
public ?int $telefono;
|
||||
public ?string $email;
|
||||
|
||||
public function jsonSerialize(): mixed
|
||||
{
|
||||
return [
|
||||
'sexo' => $this->sexo ?? '',
|
||||
'estado_civil' => $this->estado_civil ?? '',
|
||||
'profesion' => $this->profesion ?? '',
|
||||
'direccion' => $this->direccion ?? '',
|
||||
'telefono' => $this->telefono ?? '',
|
||||
'email' => $this->email ?? ''
|
||||
];
|
||||
}
|
||||
}
|
22
app/src/Model/Venta/EstadoPago.php
Normal file
22
app/src/Model/Venta/EstadoPago.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
namespace Incoviba\Model\Venta;
|
||||
|
||||
use DateTimeInterface;
|
||||
use Incoviba\Common\Ideal\Model;
|
||||
|
||||
class EstadoPago extends Model
|
||||
{
|
||||
public Pago $pago;
|
||||
public DateTimeInterface $fecha;
|
||||
public TipoEstadoPago $tipoEstadoPago;
|
||||
|
||||
public function jsonSerialize(): mixed
|
||||
{
|
||||
return array_merge(parent::jsonSerialize(), [
|
||||
'pago_id' => $this->pago->id,
|
||||
'fecha' => $this->fecha->format('Y-m-d'),
|
||||
'tipo_estado_pago_id' => $this->tipoEstadoPago->id
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
21
app/src/Model/Venta/EstadoPrecio.php
Normal file
21
app/src/Model/Venta/EstadoPrecio.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
namespace Incoviba\Model\Venta;
|
||||
|
||||
use DateTimeInterface;
|
||||
use Incoviba\Common\Ideal;
|
||||
|
||||
class EstadoPrecio extends Ideal\Model
|
||||
{
|
||||
public Precio $precio;
|
||||
public TipoEstadoPrecio $tipoEstadoPrecio;
|
||||
public DateTimeInterface $fecha;
|
||||
|
||||
public function jsonSerialize(): mixed
|
||||
{
|
||||
return array_merge(parent::jsonSerialize(), [
|
||||
'precio_id' => $this->precio->id,
|
||||
'tipo_estado_precio' => $this->tipoEstadoPrecio,
|
||||
'fecha' => $this->fecha->format('Y-m-d')
|
||||
]);
|
||||
}
|
||||
}
|
32
app/src/Model/Venta/Pago.php
Normal file
32
app/src/Model/Venta/Pago.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
namespace Incoviba\Model\Venta;
|
||||
|
||||
use DateTimeInterface;
|
||||
use Incoviba\Common\Ideal\Model;
|
||||
use Incoviba\Model\Banco;
|
||||
|
||||
class Pago extends Model
|
||||
{
|
||||
public float $valor;
|
||||
public ?Banco $banco;
|
||||
public ?TipoPago $tipoPago;
|
||||
public ?string $identificador;
|
||||
public ?DateTimeInterface $fecha;
|
||||
public ?float $uf;
|
||||
public ?string $pagador;
|
||||
public ?Pago $asociado;
|
||||
|
||||
public function jsonSerialize(): mixed
|
||||
{
|
||||
return array_merge(parent::jsonSerialize(), [
|
||||
'valor' => $this->valor,
|
||||
'banco' => $this->banco ?? '',
|
||||
'tipo_pago' => $this->tipoPago ?? '',
|
||||
'identificador' => $this->identificador ?? '',
|
||||
'fecha' => $this->fecha->format('Y-m-d H:i:S') ?? '',
|
||||
'uf' => $this->uf ?? 1,
|
||||
'pagador' => $this->pagador ?? '',
|
||||
'asociado' => $this->asociado ?? ''
|
||||
]);
|
||||
}
|
||||
}
|
27
app/src/Model/Venta/Pie.php
Normal file
27
app/src/Model/Venta/Pie.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
namespace Incoviba\Model\Venta;
|
||||
|
||||
use DateTimeInterface;
|
||||
use Incoviba\Common\Ideal\Model;
|
||||
|
||||
class Pie extends Model
|
||||
{
|
||||
public DateTimeInterface $fecha;
|
||||
public float $valor;
|
||||
public ?float $uf;
|
||||
public int $cuotas;
|
||||
public ?Pie $asociado;
|
||||
public ?Pago $reajuste;
|
||||
|
||||
public function jsonSerialize(): mixed
|
||||
{
|
||||
return array_merge(parent::jsonSerialize(), [
|
||||
'fecha' => $this->fecha->format('Y-m-d H:i:s'),
|
||||
'valor' => $this->valor,
|
||||
'uf' => $this->uf ?? 1,
|
||||
'cuotas' => $this->cuotas,
|
||||
'asociado' => $this->asociado ?? '',
|
||||
'reajuste' => $this->reajuste ?? ''
|
||||
]);
|
||||
}
|
||||
}
|
23
app/src/Model/Venta/Precio.php
Normal file
23
app/src/Model/Venta/Precio.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
namespace Incoviba\Model\Venta;
|
||||
|
||||
use Incoviba\Common\Ideal;
|
||||
|
||||
class Precio extends Ideal\Model
|
||||
{
|
||||
public Unidad $unidad;
|
||||
public float $valor;
|
||||
|
||||
public array $estados;
|
||||
public EstadoPrecio $current;
|
||||
|
||||
public function jsonSerialize(): mixed
|
||||
{
|
||||
return array_merge(parent::jsonSerialize(), [
|
||||
'unidad' => $this->unidad,
|
||||
'valor' => $this->valor,
|
||||
'estado_precio' => $this->current ?? [],
|
||||
'estados' => $this->estados ?? null
|
||||
]);
|
||||
}
|
||||
}
|
46
app/src/Model/Venta/Propietario.php
Normal file
46
app/src/Model/Venta/Propietario.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
namespace Incoviba\Model\Venta;
|
||||
|
||||
use Incoviba\Common\Ideal\Model;
|
||||
use Incoviba\Model\Direccion;
|
||||
|
||||
class Propietario extends Model
|
||||
{
|
||||
public int $rut;
|
||||
public string $dv;
|
||||
public string $nombres;
|
||||
public array $apellidos;
|
||||
public Datos $datos;
|
||||
public ?Propietario $representante;
|
||||
public ?bool $otro;
|
||||
|
||||
public function rut(): string
|
||||
{
|
||||
return implode('-', [
|
||||
number_format($this->rut, 0, ',', '.'),
|
||||
$this->dv
|
||||
]);
|
||||
}
|
||||
public function nombreCompleto(): string
|
||||
{
|
||||
return implode(' ', [
|
||||
$this->nombres,
|
||||
implode(' ', $this->apellidos)
|
||||
]);
|
||||
}
|
||||
|
||||
public function jsonSerialize(): mixed
|
||||
{
|
||||
return array_merge([
|
||||
'rut' => $this->rut,
|
||||
'dv' => $this->dv,
|
||||
'rut_formateado' => $this->rut(),
|
||||
'nombres' => $this->nombres,
|
||||
'apellidos' => $this->apellidos,
|
||||
'nombre_completo' => $this->nombreCompleto(),
|
||||
], $this->datos->jsonSerialize(), [
|
||||
'representante' => $this->representante ?? '',
|
||||
'otro' => $this->otro ?? ''
|
||||
]);
|
||||
}
|
||||
}
|
8
app/src/Model/Venta/TipoEstadoPago.php
Normal file
8
app/src/Model/Venta/TipoEstadoPago.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
namespace Incoviba\Model\Venta;
|
||||
|
||||
use Incoviba\Model;
|
||||
|
||||
class TipoEstadoPago extends Model\Tipo
|
||||
{
|
||||
}
|
7
app/src/Model/Venta/TipoEstadoPrecio.php
Normal file
7
app/src/Model/Venta/TipoEstadoPrecio.php
Normal file
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
namespace Incoviba\Model\Venta;
|
||||
|
||||
use Incoviba\Model\Tipo;
|
||||
|
||||
class TipoEstadoPrecio extends Tipo
|
||||
{}
|
8
app/src/Model/Venta/TipoPago.php
Normal file
8
app/src/Model/Venta/TipoPago.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
namespace Incoviba\Model\Venta;
|
||||
|
||||
use Incoviba\Model;
|
||||
|
||||
class TipoPago extends Model\Tipo
|
||||
{
|
||||
}
|
16
app/src/Model/Venta/TipoUnidad.php
Normal file
16
app/src/Model/Venta/TipoUnidad.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
namespace Incoviba\Model\Venta;
|
||||
|
||||
use Incoviba\Model;
|
||||
|
||||
class TipoUnidad extends Model\Tipo
|
||||
{
|
||||
public int $orden;
|
||||
|
||||
public function jsonSerialize(): mixed
|
||||
{
|
||||
return array_merge(parent::jsonSerialize(), [
|
||||
'orden' => $this->orden
|
||||
]);
|
||||
}
|
||||
}
|
25
app/src/Model/Venta/Unidad.php
Normal file
25
app/src/Model/Venta/Unidad.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
namespace Incoviba\Model\Venta;
|
||||
|
||||
use Incoviba\Common\Ideal;
|
||||
use Incoviba\Model;
|
||||
|
||||
class Unidad extends Ideal\Model
|
||||
{
|
||||
public ?string $subtipo = '';
|
||||
public int $piso;
|
||||
public string $descripcion;
|
||||
public ?string $orientacion = '';
|
||||
public Model\Proyecto\ProyectoTipoUnidad $proyectoTipoUnidad;
|
||||
|
||||
public function jsonSerialize(): mixed
|
||||
{
|
||||
return array_merge(parent::jsonSerialize(), [
|
||||
'subtipo' => $this->subtipo,
|
||||
'piso' => $this->piso,
|
||||
'descripcion' => $this->descripcion,
|
||||
'orientacion' => $this->orientacion,
|
||||
'proyecto_tipo_unidad' => $this->proyectoTipoUnidad
|
||||
]);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user