qa
This commit is contained in:
@@ -39,6 +39,7 @@
|
||||
let selgru: GrupoDto = $state({
|
||||
gruposIncluidos: [],
|
||||
idgrupo: 0,
|
||||
habilitado: false,
|
||||
nombre: "",
|
||||
permisos: [],
|
||||
});
|
||||
@@ -153,7 +154,6 @@
|
||||
</div>
|
||||
</div>
|
||||
{:else}
|
||||
<BotonEsquina handleclick={() => (showmodaladd = true)} />
|
||||
{#if showmodaladd}
|
||||
<ModalAadirGrupo
|
||||
onClose={() => (showmodaladd = false)}
|
||||
@@ -242,5 +242,6 @@
|
||||
</div>
|
||||
</div>
|
||||
{/each}
|
||||
<BotonEsquina handleclick={() => (showmodaladd = true)} />
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -2,41 +2,55 @@
|
||||
import NavBarAutocompletable from "../Componentes/NavBarAutocompletable.svelte";
|
||||
import { onMount } from "svelte";
|
||||
import ModalEstatico from "../Componentes/ModalEstatico.svelte";
|
||||
import {urlG} from "../stores/urlStore";
|
||||
import type { AltaDefectoDto, CanonDto, ContratoDto, ContratoPropiedadDto, DefectoDto, GaranteDto2, OpcionVentaDto } from "../types";
|
||||
import { urlG } from "../stores/urlStore";
|
||||
import type {
|
||||
AltaDefectoDto,
|
||||
CanonDto,
|
||||
ContratoDto,
|
||||
ContratoPropiedadDto,
|
||||
DefectoDto,
|
||||
GaranteDto2,
|
||||
OpcionVentaDto,
|
||||
} from "../types";
|
||||
import ModalPedirDoc from "../Componentes/ModalPedirDoc.svelte";
|
||||
import FormAltaDefecto from "../Componentes/FormAltaDefecto.svelte";
|
||||
import { navigate } from "svelte-routing";
|
||||
|
||||
let token:string = sessionStorage.getItem("token")||"";
|
||||
|
||||
let selMod:any =$state();
|
||||
let showmodal:boolean = $state(false);
|
||||
let canons:CanonDto[] = $state([]);
|
||||
let token: string = sessionStorage.getItem("token") || "";
|
||||
|
||||
let selMod: any = $state();
|
||||
let showmodal: boolean = $state(false);
|
||||
let canons: CanonDto[] = $state([]);
|
||||
let garantes: GaranteDto2[] = $state([]);
|
||||
let prop:ContratoPropiedadDto = $state({
|
||||
estado:"",
|
||||
fechainicio:"",
|
||||
id:0,
|
||||
inquilino:"",
|
||||
propietario:"",
|
||||
tipoPropiedad:"",
|
||||
ubicacion:"",
|
||||
habitaciones:0,
|
||||
piso:0,
|
||||
letra:"",
|
||||
mesesAumento:0,
|
||||
mesesDuracion:0,
|
||||
let prop: ContratoPropiedadDto = $state({
|
||||
estado: "",
|
||||
fechainicio: "",
|
||||
id: 0,
|
||||
inquilino: "",
|
||||
propietario: "",
|
||||
tipoPropiedad: "",
|
||||
ubicacion: "",
|
||||
habitaciones: 0,
|
||||
piso: 0,
|
||||
letra: "",
|
||||
mesesAumento: 0,
|
||||
mesesDuracion: 0,
|
||||
});
|
||||
let defectos:DefectoDto[] = $state([]);
|
||||
let defectos: DefectoDto[] = $state([]);
|
||||
|
||||
let TieneOpcionVenta:boolean =$state(false);
|
||||
let dtoVenta:OpcionVentaDto =$state({divisa:"", id:0, monto:0, enOrden:false, fueEjercido:false});
|
||||
let TieneOpcionVenta: boolean = $state(false);
|
||||
let dtoVenta: OpcionVentaDto = $state({
|
||||
divisa: "",
|
||||
id: 0,
|
||||
monto: 0,
|
||||
enOrden: false,
|
||||
fueEjercido: false,
|
||||
});
|
||||
|
||||
let modaldata:string = $state("");
|
||||
let contratoid:string = $state("");
|
||||
let modaldata: string = $state("");
|
||||
let contratoid: string = $state("");
|
||||
|
||||
onMount(()=>{
|
||||
onMount(() => {
|
||||
getparams();
|
||||
obtenerDatosACargar();
|
||||
opcionVenta();
|
||||
@@ -44,16 +58,21 @@
|
||||
|
||||
async function opcionVenta() {
|
||||
try {
|
||||
const r = await fetch($urlG+"/api/contrato/tieneopcionventa?idcontrato="+contratoid, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Auth": String(token),
|
||||
}
|
||||
});
|
||||
if (r.ok){
|
||||
const r = await fetch(
|
||||
$urlG +
|
||||
"/api/contrato/tieneopcionventa?idcontrato=" +
|
||||
contratoid,
|
||||
{
|
||||
method: "GET",
|
||||
headers: {
|
||||
Auth: String(token),
|
||||
},
|
||||
},
|
||||
);
|
||||
if (r.ok) {
|
||||
let data = await r.json();
|
||||
TieneOpcionVenta = data.message;
|
||||
if (TieneOpcionVenta){
|
||||
if (TieneOpcionVenta) {
|
||||
ObtenerOpcionVentaDto();
|
||||
}
|
||||
return;
|
||||
@@ -61,58 +80,79 @@
|
||||
let data = await r.json();
|
||||
modaldata = data.message;
|
||||
return;
|
||||
}catch {
|
||||
} catch {
|
||||
modaldata = "Fallo hacer la request";
|
||||
}
|
||||
}
|
||||
|
||||
async function ObtenerOpcionVentaDto() {
|
||||
try{
|
||||
const r = await fetch($urlG+"/api/opcionventa?idcontrato="+contratoid, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Auth": String(token),
|
||||
}
|
||||
});
|
||||
try {
|
||||
const r = await fetch(
|
||||
$urlG + "/api/opcionventa?idcontrato=" + contratoid,
|
||||
{
|
||||
method: "GET",
|
||||
headers: {
|
||||
Auth: String(token),
|
||||
},
|
||||
},
|
||||
);
|
||||
if (r.ok) {
|
||||
let data = await r.json();
|
||||
dtoVenta = data;
|
||||
return
|
||||
return;
|
||||
}
|
||||
let data = await r.json();
|
||||
modaldata = data.message;
|
||||
}catch{
|
||||
} catch {
|
||||
modaldata = "Fallo hacer la request";
|
||||
}
|
||||
}
|
||||
|
||||
async function obtenerDatosACargar() {
|
||||
try {
|
||||
const respPropiedad = fetch($urlG+"/api/contrato/inquilino?id="+contratoid, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Auth": String(token),
|
||||
}
|
||||
});
|
||||
const respgarantes = fetch($urlG+"/api/contratos/garantes?idcontrato="+contratoid, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Auth": String(token),
|
||||
}
|
||||
});
|
||||
const respCanons = fetch($urlG+"/api/contratos/canon?id="+contratoid, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Auth": String(token),
|
||||
}
|
||||
});
|
||||
const respoDefect = fetch($urlG+"/api/defectos?Idcontrato="+contratoid, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Auth": token,
|
||||
}
|
||||
});
|
||||
const [p, g, c, d] = await Promise.all([respPropiedad, respgarantes, respCanons, respoDefect]);
|
||||
const respPropiedad = fetch(
|
||||
$urlG + "/api/contrato/inquilino?id=" + contratoid,
|
||||
{
|
||||
method: "GET",
|
||||
headers: {
|
||||
Auth: String(token),
|
||||
},
|
||||
},
|
||||
);
|
||||
const respgarantes = fetch(
|
||||
$urlG + "/api/contratos/garantes?idcontrato=" + contratoid,
|
||||
{
|
||||
method: "GET",
|
||||
headers: {
|
||||
Auth: String(token),
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
},
|
||||
);
|
||||
const respCanons = fetch(
|
||||
$urlG + "/api/contratos/canon?id=" + contratoid,
|
||||
{
|
||||
method: "GET",
|
||||
headers: {
|
||||
Auth: String(token),
|
||||
},
|
||||
},
|
||||
);
|
||||
const respoDefect = fetch(
|
||||
$urlG + "/api/defectos?Idcontrato=" + contratoid,
|
||||
{
|
||||
method: "GET",
|
||||
headers: {
|
||||
Auth: token,
|
||||
},
|
||||
},
|
||||
);
|
||||
const [p, g, c, d] = await Promise.all([
|
||||
respPropiedad,
|
||||
respgarantes,
|
||||
respCanons,
|
||||
respoDefect,
|
||||
]);
|
||||
|
||||
const datosPropiedad = await p.json();
|
||||
const datosGarantes = await g.json();
|
||||
@@ -123,27 +163,29 @@
|
||||
garantes = datosGarantes;
|
||||
canons = datosCanons;
|
||||
defectos = datosDefect;
|
||||
|
||||
} catch {
|
||||
modaldata = "Fallo hacer las request";
|
||||
}
|
||||
}
|
||||
|
||||
function getparams(){
|
||||
function getparams() {
|
||||
const qs = window.location.search;
|
||||
const par = new URLSearchParams(qs);
|
||||
contratoid = par.get("id")||"";
|
||||
}
|
||||
|
||||
contratoid = par.get("id") || "";
|
||||
}
|
||||
|
||||
async function refreshCanon() {
|
||||
try {
|
||||
const ret = await fetch($urlG+"/api/contratos/canon?id="+contratoid, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Auth": String(token),
|
||||
}
|
||||
});
|
||||
if (!ret.ok){
|
||||
const ret = await fetch(
|
||||
$urlG + "/api/contratos/canon?id=" + contratoid,
|
||||
{
|
||||
method: "GET",
|
||||
headers: {
|
||||
Auth: String(token),
|
||||
},
|
||||
},
|
||||
);
|
||||
if (!ret.ok) {
|
||||
let data = await ret.json();
|
||||
modaldata = data.message;
|
||||
return;
|
||||
@@ -155,94 +197,102 @@
|
||||
modaldata = "No se pudo obtener la lista de canones actualizada";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async function verContrato() {
|
||||
if (prop.id <= 0) {
|
||||
modaldata = "no hay contratos con id 0 o menor";
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const resp = await fetch ($urlG+"/api/contrato/DocumentoFinal?idcontrato="+prop.id, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Auth": String(token),
|
||||
}
|
||||
});
|
||||
const resp = await fetch(
|
||||
$urlG + "/api/contrato/DocumentoFinal?idcontrato=" + prop.id,
|
||||
{
|
||||
method: "GET",
|
||||
headers: {
|
||||
Auth: String(token),
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
if (!resp.ok) {
|
||||
let blob = await resp.json();
|
||||
modaldata=blob.message;
|
||||
modaldata = blob.message;
|
||||
return;
|
||||
}
|
||||
|
||||
let blob = await resp.blob();
|
||||
const blobUrl = URL.createObjectURL(blob);
|
||||
window.open(blobUrl, '_blank');
|
||||
setTimeout(() => URL.revokeObjectURL(blobUrl), 100000);
|
||||
const blobUrl = URL.createObjectURL(blob);
|
||||
window.open(blobUrl, "_blank");
|
||||
setTimeout(() => URL.revokeObjectURL(blobUrl), 100000);
|
||||
} catch {
|
||||
modaldata= "fallo intentar hacer la request";
|
||||
modaldata = "fallo intentar hacer la request";
|
||||
}
|
||||
}
|
||||
|
||||
async function realizarpago(mes: Date) {
|
||||
try {
|
||||
const ret = await fetch($urlG+"/api/contratos/realizarPago", {
|
||||
const ret = await fetch($urlG + "/api/contratos/realizarPago", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Auth": String(token),
|
||||
Auth: String(token),
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({idcontrato:contratoid, fecha:mes}),
|
||||
body: JSON.stringify({ idcontrato: contratoid, fecha: mes }),
|
||||
});
|
||||
let data = await ret.json();
|
||||
modaldata = data.message;
|
||||
if (ret.ok){
|
||||
refreshCanon()
|
||||
if (ret.ok) {
|
||||
refreshCanon();
|
||||
return;
|
||||
}
|
||||
} catch {
|
||||
modaldata = "Fallo al intentar hacer la request";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function generarTiket(mod:any) {
|
||||
selMod = mod;
|
||||
showmodal =true;
|
||||
}
|
||||
|
||||
async function pedirdocumento(op:boolean) {
|
||||
try {
|
||||
const ret = await fetch($urlG+"/api/contrato/GenerarRecibo?html="+op, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Auth": String(token),
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
|
||||
body: JSON.stringify({fecha: selMod.mes, idcontrato: contratoid})
|
||||
});
|
||||
if (!ret.ok) {
|
||||
let blob = await ret.json();
|
||||
modaldata=blob.message;
|
||||
return;
|
||||
}
|
||||
let blob = await ret.blob();
|
||||
const blobUrl = URL.createObjectURL(blob);
|
||||
window.open(blobUrl, '_blank');
|
||||
setTimeout(() => URL.revokeObjectURL(blobUrl), 100000);
|
||||
} catch {
|
||||
modaldata = "Fallo al intentar hacer la request";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function generarTiket(mod: any) {
|
||||
selMod = mod;
|
||||
showmodal = true;
|
||||
}
|
||||
|
||||
async function pedirdocumento(op: boolean) {
|
||||
try {
|
||||
const ret = await fetch(
|
||||
$urlG + "/api/contrato/GenerarRecibo?html=" + op,
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
Auth: String(token),
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
|
||||
body: JSON.stringify({
|
||||
fecha: selMod.mes,
|
||||
idcontrato: contratoid,
|
||||
}),
|
||||
},
|
||||
);
|
||||
if (!ret.ok) {
|
||||
let blob = await ret.json();
|
||||
modaldata = blob.message;
|
||||
return;
|
||||
}
|
||||
let blob = await ret.blob();
|
||||
const blobUrl = URL.createObjectURL(blob);
|
||||
window.open(blobUrl, "_blank");
|
||||
setTimeout(() => URL.revokeObjectURL(blobUrl), 100000);
|
||||
} catch {
|
||||
modaldata = "Fallo al intentar hacer la request";
|
||||
}
|
||||
}
|
||||
|
||||
async function cargarDefecto(data: AltaDefectoDto) {
|
||||
if(data.idcontrato ==0) data.idcontrato = prop.id;
|
||||
if (data.idcontrato == 0) data.idcontrato = prop.id;
|
||||
try {
|
||||
const r = await fetch($urlG+"/api/defecto", {
|
||||
const r = await fetch($urlG + "/api/defecto", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Auth": String(token),
|
||||
Auth: String(token),
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(data),
|
||||
@@ -252,38 +302,45 @@
|
||||
if (r.ok) {
|
||||
refreshDefectos();
|
||||
}
|
||||
}catch{
|
||||
} catch {
|
||||
modaldata = "Fallo al intentar hacer la request";
|
||||
}
|
||||
}
|
||||
|
||||
async function refreshDefectos() {
|
||||
try {
|
||||
const r = await fetch($urlG+"/api/defectos?Idcontrato="+contratoid, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Auth": token,
|
||||
}
|
||||
});
|
||||
let rr =await r.json();
|
||||
const r = await fetch(
|
||||
$urlG + "/api/defectos?Idcontrato=" + contratoid,
|
||||
{
|
||||
method: "GET",
|
||||
headers: {
|
||||
Auth: token,
|
||||
},
|
||||
},
|
||||
);
|
||||
let rr = await r.json();
|
||||
defectos = rr;
|
||||
} catch {
|
||||
modaldata ="No se pudo pedir la lista de Defectos";
|
||||
modaldata = "No se pudo pedir la lista de Defectos";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async function ejercerOpcionVenta() {
|
||||
try {
|
||||
const r = await fetch($urlG+"/api/ventas/ejercerOpcionVenta?idcontrato="+contratoid, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Auth": token,
|
||||
}
|
||||
});
|
||||
const r = await fetch(
|
||||
$urlG +
|
||||
"/api/ventas/ejercerOpcionVenta?idcontrato=" +
|
||||
contratoid,
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
Auth: token,
|
||||
},
|
||||
},
|
||||
);
|
||||
let data = await r.json();
|
||||
modaldata =data.message;
|
||||
if(r.ok){
|
||||
modaldata = data.message;
|
||||
if (r.ok) {
|
||||
opcionVenta();
|
||||
return;
|
||||
}
|
||||
@@ -293,14 +350,17 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<NavBarAutocompletable/>
|
||||
<NavBarAutocompletable />
|
||||
|
||||
{#if modaldata}
|
||||
<ModalEstatico payload={modaldata} close={()=>!!(modaldata = "")}/>
|
||||
<ModalEstatico payload={modaldata} close={() => !!(modaldata = "")} />
|
||||
{/if}
|
||||
|
||||
{#if showmodal}
|
||||
<ModalPedirDoc onClose={()=>showmodal=false} onSubmit={pedirdocumento} />
|
||||
<ModalPedirDoc
|
||||
onClose={() => (showmodal = false)}
|
||||
onSubmit={pedirdocumento}
|
||||
/>
|
||||
{/if}
|
||||
|
||||
<div class="container-fluid mt-4 d-flex">
|
||||
@@ -315,7 +375,10 @@
|
||||
<p><b>Habitaciones:</b> {prop.habitaciones}</p>
|
||||
<p><b>Piso:</b> {prop.piso}</p>
|
||||
<p><b>Letra:</b> {prop.letra}</p>
|
||||
<p><b>Fecha Inicio:</b> {String(prop.fechainicio).split("T")[0]}</p>
|
||||
<p>
|
||||
<b>Fecha Inicio:</b>
|
||||
{String(prop.fechainicio).split("T")[0]}
|
||||
</p>
|
||||
<p><b>Estado:</b> {prop.estado}</p>
|
||||
<button class="btn btn-secondary" onclick={verContrato}>
|
||||
Ver Contrato
|
||||
@@ -362,14 +425,14 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
{#each garantes as g}
|
||||
<tr>
|
||||
<td>{g.dni}</td>
|
||||
<td>{g.nombre}</td>
|
||||
<td>{g.apellido}</td>
|
||||
<td>{g.domicilio}</td>
|
||||
<td>{g.domiciliolaboral}</td>
|
||||
<td>{g.celular}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{g.dni}</td>
|
||||
<td>{g.nombre}</td>
|
||||
<td>{g.apellido}</td>
|
||||
<td>{g.domicilio}</td>
|
||||
<td>{g.domiciliolaboral}</td>
|
||||
<td>{g.celular}</td>
|
||||
</tr>
|
||||
{/each}
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -398,27 +461,53 @@
|
||||
<div class="accordion-body">
|
||||
<div class="row">
|
||||
{#each canons as canon}
|
||||
<div class="col-6 mb-3">
|
||||
<div class="card">
|
||||
<div class="card-header text-center">
|
||||
{canon.mesNum}/{prop.mesesDuracion}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p><strong>Mes:</strong> {String(canon.mes).split("T")[0]}</p>
|
||||
<p><strong>Monto:</strong> {canon.monto}</p>
|
||||
<p><strong>Divisa:</strong> {canon.divisa}</p>
|
||||
<p><strong>Pago:</strong> {canon.pago ? "Sí" : "No"}</p>
|
||||
</div>
|
||||
<div class="card-footer d-flex justify-content-between">
|
||||
<button class="btn btn-primary btn-xs" disabled={canon.pago} onclick={()=>realizarpago(canon.mes)}>
|
||||
Pagar
|
||||
</button>
|
||||
<button class="btn btn-info btn-xs" disabled={!canon.pago} onclick={()=> generarTiket(canon)}>
|
||||
Generar Tiket
|
||||
</button>
|
||||
<div class="col-6 mb-3">
|
||||
<div class="card">
|
||||
<div class="card-header text-center">
|
||||
{canon.mesNum}/{prop.mesesDuracion}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p>
|
||||
<strong>Mes:</strong>
|
||||
{String(canon.mes).split(
|
||||
"T",
|
||||
)[0]}
|
||||
</p>
|
||||
<p>
|
||||
<strong>Monto:</strong>
|
||||
{canon.monto}
|
||||
</p>
|
||||
<p>
|
||||
<strong>Divisa:</strong>
|
||||
{canon.divisa}
|
||||
</p>
|
||||
<p>
|
||||
<strong>Pago:</strong>
|
||||
{canon.pago ? "Sí" : "No"}
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
class="card-footer d-flex justify-content-between"
|
||||
>
|
||||
<button
|
||||
class="btn btn-primary btn-xs"
|
||||
disabled={canon.pago}
|
||||
onclick={() =>
|
||||
realizarpago(canon.mes)}
|
||||
>
|
||||
Pagar
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-info btn-xs"
|
||||
disabled={!canon.pago}
|
||||
onclick={() =>
|
||||
generarTiket(canon)}
|
||||
>
|
||||
Generar Tiket
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
@@ -442,102 +531,122 @@
|
||||
class="accordion-collapse collapse"
|
||||
aria-labelledby="ht"
|
||||
data-bs-parent="#accordionExample"
|
||||
>
|
||||
|
||||
>
|
||||
<div class="accordion-body">
|
||||
{#if prop.estado != "Terminado"}
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Notificar Defecto en Propiedad
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Notificar Defecto en Propiedad
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<FormAltaDefecto
|
||||
onConfirm={cargarDefecto}
|
||||
idcontrato={prop.id}
|
||||
/>
|
||||
</div>
|
||||
<div class="card-footer"></div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<FormAltaDefecto onConfirm={cargarDefecto} idcontrato={prop.id} />
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<br />
|
||||
{/if}
|
||||
<table class="table table-hover table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Descripción</th>
|
||||
<th>Costo</th>
|
||||
<th>Estado</th>
|
||||
<th>Paga Inquilino</th>
|
||||
<th>Divisa</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Descripción</th>
|
||||
<th>Costo</th>
|
||||
<th>Estado</th>
|
||||
<th>Paga Inquilino</th>
|
||||
<th>Divisa</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{#if defectos.length == 0}
|
||||
<tr>
|
||||
<td colspan="6">No hay defectos que mostrar</td>
|
||||
</tr>
|
||||
{:else}
|
||||
{#each defectos as defecto}
|
||||
<tr>
|
||||
<td>{defecto.descripcion}</td>
|
||||
<td>{defecto.costo}</td>
|
||||
<td>{defecto.estado}</td>
|
||||
<td>{defecto.pagainquilino}</td>
|
||||
<td>{defecto.divisa}</td>
|
||||
</tr>
|
||||
{/each}
|
||||
{/if}
|
||||
{#if defectos.length == 0}
|
||||
<tr>
|
||||
<td colspan="6"
|
||||
>No hay defectos que mostrar</td
|
||||
>
|
||||
</tr>
|
||||
{:else}
|
||||
{#each defectos as defecto}
|
||||
<tr>
|
||||
<td>{defecto.descripcion}</td>
|
||||
<td>{defecto.costo}</td>
|
||||
<td>{defecto.estado}</td>
|
||||
<td>{defecto.pagainquilino}</td>
|
||||
<td>{defecto.divisa}</td>
|
||||
</tr>
|
||||
{/each}
|
||||
{/if}
|
||||
</tbody>
|
||||
</table>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{#if TieneOpcionVenta}
|
||||
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="hq">
|
||||
<button
|
||||
class="accordion-button collapsed"
|
||||
type="button"
|
||||
data-bs-toggle="collapse"
|
||||
data-bs-target="#cq"
|
||||
aria-expanded="false"
|
||||
aria-controls="cq"
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="hq">
|
||||
<button
|
||||
class="accordion-button collapsed"
|
||||
type="button"
|
||||
data-bs-toggle="collapse"
|
||||
data-bs-target="#cq"
|
||||
aria-expanded="false"
|
||||
aria-controls="cq"
|
||||
>
|
||||
Opcion Venta
|
||||
</button>
|
||||
</h2>
|
||||
<div
|
||||
id="cq"
|
||||
class="accordion-collapse collapse"
|
||||
aria-labelledby="hq"
|
||||
data-bs-parent="#accordionExample"
|
||||
>
|
||||
Opcion Venta
|
||||
</button>
|
||||
</h2>
|
||||
<div
|
||||
id="cq"
|
||||
class="accordion-collapse collapse"
|
||||
aria-labelledby="hq"
|
||||
data-bs-parent="#accordionExample"
|
||||
>
|
||||
<div class="accordion-body">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Datos Opcion Venta
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<b>Monto</b>: {dtoVenta.divisa} {dtoVenta.monto}.
|
||||
<div class="accordion-body">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Datos Opcion Venta
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<b>Monto</b>: {dtoVenta.divisa}
|
||||
{dtoVenta.monto}.
|
||||
|
||||
<p class="mt-2 text-muted">
|
||||
Para poder ejercer la opcion de venta necesitas estar en el mismo mes que el ultimo pago y haber pagado todos los canones
|
||||
</p>
|
||||
<div class="d-flex justify-content-between">
|
||||
<button class="btn btn-primary" disabled={dtoVenta.enOrden==false || dtoVenta.fueEjercido == true} onclick={()=>ejercerOpcionVenta()}>
|
||||
Ejercer
|
||||
</button>
|
||||
{#if dtoVenta.fueEjercido}
|
||||
<button class="btn btn-secondary" onclick={()=>navigate("/Ventas?idventa="+dtoVenta.id)}>
|
||||
Ir a la pagina de la Venta
|
||||
<p class="mt-2 text-muted">
|
||||
Para poder ejercer la opcion de venta
|
||||
necesitas estar en el mismo mes que el
|
||||
ultimo pago y haber pagado todos los
|
||||
canones
|
||||
</p>
|
||||
<div class="d-flex justify-content-between">
|
||||
<button
|
||||
class="btn btn-primary"
|
||||
disabled={dtoVenta.enOrden ==
|
||||
false ||
|
||||
dtoVenta.fueEjercido == true}
|
||||
onclick={() => ejercerOpcionVenta()}
|
||||
>
|
||||
Ejercer
|
||||
</button>
|
||||
{/if}
|
||||
{#if dtoVenta.fueEjercido}
|
||||
<button
|
||||
class="btn btn-secondary"
|
||||
onclick={() =>
|
||||
navigate(
|
||||
"/Ventas?idventa=" +
|
||||
dtoVenta.id,
|
||||
)}
|
||||
>
|
||||
Ir a la pagina de la Venta
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer text-center">
|
||||
IdOpcionVenta: {dtoVenta.id}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer text-center">IdOpcionVenta: {dtoVenta.id}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user