inicio soporte informe
This commit is contained in:
@@ -38,12 +38,12 @@ public class ContratoDtoBuilder: Builder<ContratoDto> {
|
|||||||
|
|
||||||
if (Habilitado == true && Cancelado == false){
|
if (Habilitado == true && Cancelado == false){
|
||||||
data.Estado = "Alquiler Iniciado";
|
data.Estado = "Alquiler Iniciado";
|
||||||
} else if (Cancelado == true && Habilitado == true) {
|
} else if (Cancelado == true && Habilitado == false) {
|
||||||
data.Estado = "Nunca Empezo Esta Cancelado";
|
data.Estado = "Nunca Empezo Esta Cancelado";
|
||||||
}
|
} else if (Habilitado == false && Cancelado ==false){
|
||||||
|
|
||||||
if (Habilitado == false && Cancelado ==false){
|
|
||||||
data.Estado = "Esta en Proceso";
|
data.Estado = "Esta en Proceso";
|
||||||
|
} else if (Habilitado == true && Cancelado == true){
|
||||||
|
data.Estado = "Terminado";
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,12 +38,12 @@ public class ContratoPropiedadDtoBuilder : Builder<ContratoPropiedadDto>{
|
|||||||
|
|
||||||
if (Habilitado == true && Cancelado == false){
|
if (Habilitado == true && Cancelado == false){
|
||||||
data.Estado = "Alquiler Iniciado";
|
data.Estado = "Alquiler Iniciado";
|
||||||
} else if (Cancelado == true && Habilitado == true) {
|
} else if (Cancelado == true && Habilitado == false) {
|
||||||
data.Estado = "Nunca Empezo Esta Cancelado";
|
data.Estado = "Nunca Empezo Esta Cancelado";
|
||||||
}
|
} else if (Habilitado == false && Cancelado ==false){
|
||||||
|
|
||||||
if (Habilitado == false && Cancelado ==false){
|
|
||||||
data.Estado = "Esta en Proceso";
|
data.Estado = "Esta en Proceso";
|
||||||
|
} else if (Habilitado == true && Cancelado == true){
|
||||||
|
data.Estado = "Terminado";
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
public class ChartData
|
||||||
|
{
|
||||||
|
[JsonPropertyName("labels")]
|
||||||
|
public List<string> Labels { get; set; }=new();
|
||||||
|
|
||||||
|
[JsonPropertyName("datasets")]
|
||||||
|
public List<Dataset> Datasets { get; set; }=new();
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Dataset
|
||||||
|
{
|
||||||
|
[JsonPropertyName("label")]
|
||||||
|
public string Label { get; set; } ="";
|
||||||
|
|
||||||
|
[JsonPropertyName("data")]
|
||||||
|
public List<double> Data { get; set; }= new();
|
||||||
|
/*
|
||||||
|
[JsonPropertyName("backgroundColor")]
|
||||||
|
public List<string> BackgroundColor { get; set; }
|
||||||
|
|
||||||
|
[JsonPropertyName("borderColor")]
|
||||||
|
public List<string> BorderColor { get; set; }
|
||||||
|
*/
|
||||||
|
[JsonPropertyName("borderWidth")]
|
||||||
|
public int BorderWidth { get; set; }=1;
|
||||||
|
}
|
||||||
@@ -21,6 +21,7 @@
|
|||||||
import ControlAlquileresPropietario from "./paginas/ControlAlquileresPropietario.svelte";
|
import ControlAlquileresPropietario from "./paginas/ControlAlquileresPropietario.svelte";
|
||||||
import ContratosPropietario from "./paginas/ContratosPropietario.svelte";
|
import ContratosPropietario from "./paginas/ContratosPropietario.svelte";
|
||||||
import ContratoInquilino from "./paginas/ContratoInquilino.svelte";
|
import ContratoInquilino from "./paginas/ContratoInquilino.svelte";
|
||||||
|
import Informes from "./paginas/Informes.svelte";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Router>
|
<Router>
|
||||||
@@ -64,6 +65,11 @@
|
|||||||
<ProteRoute componente={PropPage}/>
|
<ProteRoute componente={PropPage}/>
|
||||||
</Route>
|
</Route>
|
||||||
|
|
||||||
|
<!--Crear Cuenta Propietario-->
|
||||||
|
<Route path="/accion/6">
|
||||||
|
<ProteRoute componente={Informes}/>
|
||||||
|
</Route>
|
||||||
|
|
||||||
<!--Administrar Propiedades Dadas de Baja-->
|
<!--Administrar Propiedades Dadas de Baja-->
|
||||||
<Route path="/accion/8">
|
<Route path="/accion/8">
|
||||||
<ProteRoute componente={MisPropiedadesDeBaja}/>
|
<ProteRoute componente={MisPropiedadesDeBaja}/>
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
<script>
|
||||||
|
import { onMount } from "svelte";
|
||||||
|
import {
|
||||||
|
Chart,
|
||||||
|
registerables
|
||||||
|
} from "chart.js";
|
||||||
|
|
||||||
|
Chart.register(...registerables);
|
||||||
|
|
||||||
|
export let data;
|
||||||
|
|
||||||
|
let chartCanvas;
|
||||||
|
let chartInstance;
|
||||||
|
|
||||||
|
onMount(() => {
|
||||||
|
if (chartCanvas) {
|
||||||
|
chartInstance = new Chart(chartCanvas, {
|
||||||
|
type: "bar",
|
||||||
|
data: data,
|
||||||
|
options: {
|
||||||
|
responsive: true,
|
||||||
|
plugins: {
|
||||||
|
legend: {
|
||||||
|
position: "top"
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
enabled: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
scales: {
|
||||||
|
y: {
|
||||||
|
beginAtZero: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
if (chartInstance) {
|
||||||
|
chartInstance.destroy();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="card card-body">
|
||||||
|
<canvas bind:this={chartCanvas}></canvas>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import { onMount } from "svelte";
|
||||||
|
import BarraHorizontalConTexto from "../Componentes/BarraHorizontalConTexto.svelte";
|
||||||
|
import NavBarAutocompletable from "../Componentes/NavBarAutocompletable.svelte";
|
||||||
|
import { Chart } from "chart.js";
|
||||||
|
import FChart from "../Componentes/Estadisticas/fChart.svelte";
|
||||||
|
|
||||||
|
let cdata = $state();
|
||||||
|
|
||||||
|
let myChart;
|
||||||
|
onMount(() => {
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<NavBarAutocompletable/>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<br>
|
||||||
|
<div class="row">
|
||||||
|
<BarraHorizontalConTexto text="Alquileres del ultimo año"/>
|
||||||
|
<div class="col">
|
||||||
|
<table class="table table-hover">
|
||||||
|
<thead>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<th>#</th>
|
||||||
|
<th>Ubicacion</th>
|
||||||
|
<th>Divisa</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<FChart data={null}/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
@@ -29,14 +29,28 @@ public class RepositorioCanons: RepositorioBase<RepositorioCanons> {
|
|||||||
|
|
||||||
public bool SetRecibo(Canon c, Recibo re) {
|
public bool SetRecibo(Canon c, Recibo re) {
|
||||||
var con = Context;
|
var con = Context;
|
||||||
var cc = con.Canons.FirstOrDefault(x=>x.Id == c.Id);
|
var cc = con.Canons
|
||||||
|
.Include(x=>x.Idcontratos)
|
||||||
|
.ThenInclude(x=>x.Idcanons)
|
||||||
|
.FirstOrDefault(x=>x.Id == c.Id);
|
||||||
if (cc == null) return false;
|
if (cc == null) return false;
|
||||||
|
|
||||||
|
if (cc.Idcontratos.Count()!=1) return false;
|
||||||
|
Contrato ccc = cc.Idcontratos.First();
|
||||||
|
if (ccc.Cancelado == 1 || ccc.Habilitado == 0) return false;
|
||||||
|
con.Entry(ccc).Reference(x=>x.IdpropiedadNavigation).Load();
|
||||||
|
|
||||||
re.Id = (con.Recibos.Any()?con.Recibos.Max(x=>x.Id):0)+1;
|
re.Id = (con.Recibos.Any()?con.Recibos.Max(x=>x.Id):0)+1;
|
||||||
con.Recibos.Add(re);
|
con.Recibos.Add(re);
|
||||||
cc.Idrecibo = re.Id;
|
cc.Idrecibo = re.Id;
|
||||||
cc.Pagado = 1;
|
cc.Pagado = 1;
|
||||||
|
|
||||||
|
|
||||||
|
if (ccc.Idcanons.Where(x=>x.Pagado==1).Count() == ccc.MesesDurationContrato){
|
||||||
|
ccc.Cancelado = 1;
|
||||||
|
ccc.IdpropiedadNavigation.Idestado = 3;
|
||||||
|
}
|
||||||
|
|
||||||
return Guardar(con);
|
return Guardar(con);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user