Auth, Login, Home, Venta->Listados->Precios

This commit is contained in:
Juan Pablo Vial
2023-07-24 20:55:26 -04:00
parent d9d5a15376
commit 1a7b10ce3c
130 changed files with 4302 additions and 0 deletions

View 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
]);
}
}

View 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 ?? ''
]);
}
}

View 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 ?? ''
];
}
}

View 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
]);
}
}

View 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')
]);
}
}

View 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 ?? ''
]);
}
}

View 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 ?? ''
]);
}
}

View 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
]);
}
}

View 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 ?? ''
]);
}
}

View File

@ -0,0 +1,8 @@
<?php
namespace Incoviba\Model\Venta;
use Incoviba\Model;
class TipoEstadoPago extends Model\Tipo
{
}

View File

@ -0,0 +1,7 @@
<?php
namespace Incoviba\Model\Venta;
use Incoviba\Model\Tipo;
class TipoEstadoPrecio extends Tipo
{}

View File

@ -0,0 +1,8 @@
<?php
namespace Incoviba\Model\Venta;
use Incoviba\Model;
class TipoPago extends Model\Tipo
{
}

View 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
]);
}
}

View 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
]);
}
}