tuki testeaduki y andanduki
This commit is contained in:
@@ -23,6 +23,7 @@
|
|||||||
if (leiContrato) {
|
if (leiContrato) {
|
||||||
let idcontrato = Number(men.mensaje.split(" ").reverse()[0]);
|
let idcontrato = Number(men.mensaje.split(" ").reverse()[0]);
|
||||||
onConfirm(idcontrato);
|
onConfirm(idcontrato);
|
||||||
|
onClose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -30,6 +31,7 @@
|
|||||||
if (leiContrato) {
|
if (leiContrato) {
|
||||||
let idcontrato = Number(men.mensaje.split(" ").reverse()[0]);
|
let idcontrato = Number(men.mensaje.split(" ").reverse()[0]);
|
||||||
onCancel(idcontrato);
|
onCancel(idcontrato);
|
||||||
|
onClose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -57,7 +59,7 @@
|
|||||||
disabled={!contratoDescargado}
|
disabled={!contratoDescargado}
|
||||||
/>
|
/>
|
||||||
<label class="form-check-label" for="leiContratoCheckbox">
|
<label class="form-check-label" for="leiContratoCheckbox">
|
||||||
Leí el contrato
|
Firme el contrato con el agente de la inmobiliaria
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
import { Navbar, NavbarBrand, NavbarToggler, NavItem, Nav, NavLink, Collapse } from "@sveltestrap/sveltestrap";
|
import { Navbar, NavbarBrand, NavbarToggler, NavItem, Nav, NavLink, Collapse } from "@sveltestrap/sveltestrap";
|
||||||
|
|
||||||
let isOpen:boolean = false;
|
let isOpen:boolean = false;
|
||||||
|
let theme = $state(localStorage.getItem("theme") ?? "light");
|
||||||
|
const toggleTheme = () => {
|
||||||
|
theme = theme === "light" ? "dark" : "light";
|
||||||
|
document.body.setAttribute("data-bs-theme", theme);
|
||||||
|
localStorage.setItem("theme", theme);
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
@@ -10,6 +15,15 @@
|
|||||||
<NavbarBrand href="/">
|
<NavbarBrand href="/">
|
||||||
AlquilaFacil
|
AlquilaFacil
|
||||||
</NavbarBrand>
|
</NavbarBrand>
|
||||||
|
<div>
|
||||||
|
<button class="badge btn" onclick={toggleTheme} style="background-color: cadetblue;">
|
||||||
|
{#if theme === "light" }
|
||||||
|
<img src="/toggle-left.svg" alt=""/>
|
||||||
|
{:else}
|
||||||
|
<img src="/toggle-right.svg" alt=""/>
|
||||||
|
{/if}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
<NavbarToggler on:click={() => (isOpen = !isOpen)} />
|
<NavbarToggler on:click={() => (isOpen = !isOpen)} />
|
||||||
<Collapse isOpen={isOpen} navbar expand="md">
|
<Collapse isOpen={isOpen} navbar expand="md">
|
||||||
<Nav class="ms-auto" navbar>
|
<Nav class="ms-auto" navbar>
|
||||||
|
|||||||
@@ -330,7 +330,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handlerechazarcontrato(idcontrato:number) {
|
async function handleAceptarContrato(idcontrato:number) {
|
||||||
if (idcontrato<=0){
|
if (idcontrato<=0){
|
||||||
modaldata="La idcontrato da 0 o menos comunicate con el administrador";
|
modaldata="La idcontrato da 0 o menos comunicate con el administrador";
|
||||||
return;
|
return;
|
||||||
@@ -344,6 +344,7 @@
|
|||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
"Auth": String(token),
|
"Auth": String(token),
|
||||||
|
"Content-Type": "application/json",
|
||||||
},
|
},
|
||||||
body: JSON.stringify(rq),
|
body: JSON.stringify(rq),
|
||||||
});
|
});
|
||||||
@@ -367,17 +368,23 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleAceptarContrato(idcontrato:number) {
|
async function handlerechazarcontrato(idcontrato:number) {
|
||||||
if (idcontrato<=0){
|
if (idcontrato<=0){
|
||||||
modaldata="La idcontrato da 0 o menos comunicate con el administrador";
|
modaldata="La idcontrato da 0 o menos comunicate con el administrador";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
let rq = {
|
||||||
|
idcontrato:idcontrato,
|
||||||
|
fecha:Selmens.fecha
|
||||||
|
}
|
||||||
const responce = await fetch($urlG+"/api/contratos/rechazarPreContrato?idcontrato="+idcontrato, {
|
const responce = await fetch($urlG+"/api/contratos/rechazarPreContrato?idcontrato="+idcontrato, {
|
||||||
method: "PUT",
|
method: "PUT",
|
||||||
headers: {
|
headers: {
|
||||||
"Auth": String(token),
|
"Auth": String(token),
|
||||||
}
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
body: JSON.stringify(rq),
|
||||||
});
|
});
|
||||||
if (responce.ok){
|
if (responce.ok){
|
||||||
let data = await responce.json();
|
let data = await responce.json();
|
||||||
@@ -413,7 +420,7 @@
|
|||||||
{:else if Selmens.accion == "Check y Contrato"}
|
{:else if Selmens.accion == "Check y Contrato"}
|
||||||
<ModalCheckYContrato {garantes} men={Selmens} onCancel={handleCancelPrecontrato} onClose={() => (Selmens.accion = "")} onConfirm={handleEnviarmensaje4}/>
|
<ModalCheckYContrato {garantes} men={Selmens} onCancel={handleCancelPrecontrato} onClose={() => (Selmens.accion = "")} onConfirm={handleEnviarmensaje4}/>
|
||||||
{:else if Selmens.accion == "Aceptar Contrato"}
|
{:else if Selmens.accion == "Aceptar Contrato"}
|
||||||
<ModalVeryAceptarContrato onClose={() => (Selmens.accion = "")} onConfirm={handleAceptarContrato} onCancel={handleCancelPrecontrato} getContrato={ObtenerContrato} men={Selmens}/>
|
<ModalVeryAceptarContrato onClose={() => (Selmens.accion = "")} onConfirm={handleAceptarContrato} onCancel={handlerechazarcontrato} getContrato={ObtenerContrato} men={Selmens}/>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
@@ -466,28 +473,26 @@
|
|||||||
<td>{men.fecha}</td>
|
<td>{men.fecha}</td>
|
||||||
<td>{men.propiedad}</td>
|
<td>{men.propiedad}</td>
|
||||||
|
|
||||||
{#if mostrarleidos == false}
|
|
||||||
<td>
|
<td>
|
||||||
|
{#if mostrarleidos == false && men.accion != "Rechazo Contrato" && men.accion != "Aceptado Contrato"}
|
||||||
<button
|
<button
|
||||||
class="btn btn-outline-primary"
|
class="btn btn-outline-primary"
|
||||||
onclick={() => abrirModal(men)}
|
onclick={() => abrirModal(men)}>
|
||||||
>
|
|
||||||
Expandir
|
Expandir
|
||||||
</button>
|
</button>
|
||||||
</td>
|
{/if}
|
||||||
{:else if men.accion == "ContratoCancelado"}
|
{#if men.accion === "ContratoCancelado" || men.accion === "Rechazo Contrato" ||
|
||||||
<td>
|
men.accion === "Aceptado Contrato"}
|
||||||
<button
|
<button
|
||||||
class="btn btn-outline-danger"
|
class="btn btn-outline-danger"
|
||||||
onclick={() => marcarleido(men.fecha, localStorage.getItem("email")|| "", men)}
|
onclick={() => marcarleido(men.fecha, localStorage.getItem("email")|| "", men)}>
|
||||||
>
|
|
||||||
Marcar Leido
|
Marcar Leido
|
||||||
</button>
|
</button>
|
||||||
</td>
|
|
||||||
{/if}
|
{/if}
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/each}
|
{/each}
|
||||||
{/if}
|
{/if}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ public class RepositorioContratos: RepositorioBase<RepositorioContratos> {
|
|||||||
var con = Context;
|
var con = Context;
|
||||||
Contrato? cont = con.Contratos
|
Contrato? cont = con.Contratos
|
||||||
.Include(x=>x.Idcanons)
|
.Include(x=>x.Idcanons)
|
||||||
.Include(x=>x.Idpropiedad)
|
.Include(x=>x.IdpropiedadNavigation)
|
||||||
.FirstOrDefault(x=>x.Id ==idcontrato &&
|
.FirstOrDefault(x=>x.Id ==idcontrato &&
|
||||||
x.Habilitado ==0 &&
|
x.Habilitado ==0 &&
|
||||||
x.Cancelado == 0);
|
x.Cancelado == 0);
|
||||||
@@ -125,10 +125,12 @@ public class RepositorioContratos: RepositorioBase<RepositorioContratos> {
|
|||||||
Canon can = new Canon{
|
Canon can = new Canon{
|
||||||
Fecha = fecha.AddMonths(i),
|
Fecha = fecha.AddMonths(i),
|
||||||
Monto = cont.IdpropiedadNavigation.Monto,
|
Monto = cont.IdpropiedadNavigation.Monto,
|
||||||
Pagado = 0
|
Pagado = 0,
|
||||||
};
|
};
|
||||||
can.Id = (con.Canons.Any()? con.Canons.Max(x=>x.Id) :0)+1;
|
can.Id = (con.Canons.Any()? con.Canons.Max(x=>x.Id) :0)+1;
|
||||||
|
can.Idcontratos.Add(cont);
|
||||||
|
|
||||||
|
con.Canons.Add(can);
|
||||||
cont.Idcanons.Add(can);
|
cont.Idcanons.Add(can);
|
||||||
}
|
}
|
||||||
return Guardar(con);
|
return Guardar(con);
|
||||||
@@ -136,7 +138,7 @@ public class RepositorioContratos: RepositorioBase<RepositorioContratos> {
|
|||||||
|
|
||||||
public bool CancelarPrecontrato(long idcontrato) {
|
public bool CancelarPrecontrato(long idcontrato) {
|
||||||
var con = Context;
|
var con = Context;
|
||||||
Contrato? cont = con.Contratos.Include(x=>x.Idpropiedad).FirstOrDefault(x=>x.Id ==idcontrato && x.Habilitado ==0);
|
Contrato? cont = con.Contratos.Include(x=>x.IdpropiedadNavigation).FirstOrDefault(x=>x.Id ==idcontrato && x.Habilitado ==0);
|
||||||
if (cont == null|| cont.IdpropiedadNavigation==null) return false;
|
if (cont == null|| cont.IdpropiedadNavigation==null) return false;
|
||||||
cont.Cancelado = 1;
|
cont.Cancelado = 1;
|
||||||
cont.IdpropiedadNavigation.Idestado = 1;
|
cont.IdpropiedadNavigation.Idestado = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user