%@ Language=VBScript %>
<%OPTION EXPLICIT%>
<%
ConnectRS
'constantes de grandeur
CONST PAGE_W = 700
CONST PAGE_H = 900
CONST VPC = 10.7639
'variables globales
Dim RS2 : Set RS2 = Server.CreateObject("ADODB.Recordset")
Dim RS3 : Set RS3 = Server.CreateObject("ADODB.Recordset")
Dim Disclaimer
Disclaimer = "
" & _
"
Dossier à traiter avec confidentialité et la plus grande discrétion.
" & _
"
Les renseignements apparaissant sur cette inscription sont exacts " & _
" au meilleur de la connaissance du courtier inscripteur.
" & _
"
"
dim vVal,vValF,vValD, vVal2 'generic variable for multiple uses
'Options d'affichage
dim vID,TList, P, C, DD, MD, SD, NomDevise, DateDevise, SourceDevise 'ID_res, Partial, Comptant, Device, Mod Devise, Symbole Devise
dim MDF 'mise de fond
DD = 0
MD = 1
SD = "$"
vID=0
vID = Request.Form("hidID")
if vID=0 then
vID = Request.QueryString("id")
P = Request.QueryString("pid")
else
'Partielle/full
if Request.Form("part.x") <> "" then
P = True
else
P = False
end if
end if
'comptant normal ou 50%
C = Request.Form("cmbComptant")
Response.Cookies("Comptant") = C
'Devise
DD = Request.Form("cmbDevise")
Response.Cookies("Devise") = DD
if DD > 0 then
strSQL = "SELECT Nom_devise, Mod_Devise, Symbol_Devise, Date_Devise, Source_Devise FROM tblDevise WHERE ID_Devise = " & DD
RS.Open strSQL, CNRS
if not RS.EOF then
MD = RS.Fields("Mod_Devise")
SD = RS.Fields("Symbol_Devise")
NomDevise = RS.Fields("Nom_devise")
DateDevise = RS.Fields("Date_Devise")
SourceDevise = RS.Fields("Source_Devise")
end if
RS.close
end if
Public Function Div0(ByVal v1, ByVal v2)
If Not IsNull(v1) And Not IsNull(v2) Then
If v2 <> 0 Then
Div0 = v1 / v2
Else
Div0 = 0
End If
End If
End Function
Public Function CalculerMensualite(ECapital, EDuree, ETaux)
'set the variables
Dim vTaux 'As Double
Dim vPaiement 'As Currency
Dim vDiviseur 'As Double
Dim vNumPaiement 'As Integer
Dim vQuotien 'As Double
Dim vQuotien1 'As Double
If ECapital > 0 And EDuree > 0 Then
vTaux = (ETaux) / 2
vQuotien1 = ((1 + vTaux) ^ 2) - 1
vQuotien = ((1 + vQuotien1) ^ (1 / 12)) - 1
vNumPaiement = EDuree * 12
vDiviseur = (1 - ((1 + vQuotien) ^ (-1 * vNumPaiement))) / vQuotien
if vDiviseur <>0 then vPaiement = ECapital / vDiviseur end if
CalculerMensualite = FormatNumber(vPaiement, 2)
Else
CalculerMensualite = 0
End If
if ETaux =0 then CalculerMensualite = ECapital/(12 * EDuree) end if
End Function
Public Function CalculerRemb(ECapital, EDuree, ETaux, EAnnees)
'set the variables
Dim vTaux 'As Double
Dim vPaiement 'As Currency
Dim vDiviseur 'As Double
Dim vNumPaiement 'As Integer
Dim vQuotien 'As Double
Dim vQuotien1 'As Double
Dim vSolde 'As Currency
Dim I 'As Byte
Dim J 'As Byte
Dim vCapM 'As Currency
Dim vCapTot 'As Currency
If ECapital > 0 And EDuree > 0 Then
'calcul du paiement mensuel
vTaux = (ETaux) / 2
vQuotien1 = ((1 + vTaux) ^ 2) - 1
vQuotien = ((1 + vQuotien1) ^ (1 / 12)) - 1
vNumPaiement = EDuree * 12
vDiviseur = (1 - ((1 + vQuotien) ^ (-1 * vNumPaiement))) / vQuotien
if vDiviseur <>0 then vPaiement = ECapital / vDiviseur end if
'Calcul du capital payé par fréquence par année sur 5 ans
vSolde = ECapital
vCapTot = 0
For I = 1 To EAnnees
For J = 1 To 12
vCapM = (vPaiement - (vSolde * vQuotien))
vCapTot = vCapTot + vCapM
vSolde = vSolde - vCapM
Next
Next
CalculerRemb = (vCapTot / EAnnees)
Else
CalculerRemb = 0
End If
End Function
Public Function CalculerRembNow(ECapital, EDuree, ETaux, EAnnees,ENow)
'set the variables
Dim vTaux 'As Double
Dim vPaiement 'As Currency
Dim vDiviseur 'As Double
Dim vNumPaiement 'As Integer
Dim vQuotien 'As Double
Dim vQuotien1 'As Double
Dim vSolde 'As Currency
Dim I 'As Byte
Dim J 'As Byte
Dim vCapM 'As Currency
Dim vCapTot 'As Currency
Dim vCapTotNow 'As Currency
If ECapital > 0 And EDuree > 0 Then
'calcul du paiement mensuel
vTaux = (ETaux) / 2
vQuotien1 = ((1 + vTaux) ^ 2) - 1
vQuotien = ((1 + vQuotien1) ^ (1 / 12)) - 1
vNumPaiement = EDuree * 12
vDiviseur = (1 - ((1 + vQuotien) ^ (-1 * vNumPaiement))) / vQuotien
if vDiviseur <>0 then vPaiement = ECapital / vDiviseur end if
'Calcul du capital payé par fréquence par année sur 5 ans
vSolde = ECapital
vCapTot = 0
For I = 1 To EAnnees + ENow
For J = 1 To 12
vCapM = (vPaiement - (vSolde * vQuotien))
vCapTot = vCapTot + vCapM
vSolde = vSolde - vCapM
if I > EAnnees then vCapTotNow = vCapTotNow + vCapM
Next
Next
CalculerRembNow = (vCapTotNow / ENow)
Else
CalculerRembNow = 0
End If
End Function
Public Function CalculerRembJ(ECapital, EDuree, ETaux, EJours)
'set the variables
Dim vTaux 'As Double
Dim vPaiement 'As Currency
Dim vDiviseur 'As Double
Dim vNumPaiement 'As Integer
Dim vQuotien 'As Double
Dim vQuotien1 'As Double
Dim vSolde 'As Currency
Dim I 'As Byte
Dim J 'As Byte
Dim vCapM 'As Currency
Dim vCapTot 'As Currency
If ECapital > 0 And EDuree > 0 Then
vTaux = (ETaux) / 2
vQuotien1 = ((1 + vTaux) ^ 2) - 1
vQuotien = ((1 + vQuotien1) ^ (1 / 365)) - 1
vNumPaiement = EDuree * 365
vDiviseur = (1 - ((1 + vQuotien) ^ (-1 * vNumPaiement))) / vQuotien
if vDiviseur <>0 then vPaiement = ECapital / vDiviseur end if
vSolde = ECapital
vCapTot = 0
For I = 1 To EJours
vCapM = (vPaiement - (vSolde * vQuotien))
vCapTot = vCapTot + vCapM
vSolde = vSolde - vCapM
Next
CalculerRembJ = vSolde
Else
CalculerRembJ = 0
End If
End Function
Public Function CalculerRembM(ECapital, EDuree, ETaux,NoMois)
Dim vTaux, IYear, IMonth, vSolde, vPaiement, vDiviseur, vNumPaiement, vQuotien, vQuotien1, vInteretM, vCapitalM, vInteretTot, vCapitalTot, vInteretAn, vCapitalAn, vSoldeDebutAn, compteur
vSolde = ECapital
vTaux = ETaux / 100
vTaux = vTaux / 2
vQuotien1 = ((1 + vTaux) ^ 2) - 1
vQuotien = ((1 + vQuotien1) ^ (1 / 12)) - 1
vNumPaiement = EDuree * 12
vDiviseur = (1 - ((1 + vQuotien) ^ (-1 * vNumPaiement))) / vQuotien
if vDiviseur <>0 then vPaiement = vSolde / vDiviseur end if
vInteretTot = 0
vCapitalTot = 0
compteur =0
for IYear = 1 to EDuree
for IMonth = 1 to 12
'Année-mois
vInteretM = vSolde * vQuotien
vCapitalM = vPaiement - vInteretM
vInteretAn = vInteretAn + vInteretM
vCapitalAn = vCapitalAn + vCapitalM
vInteretTot = vInteretTot + vInteretM
vCapitalTot = vCapitalTot + vCapitalM
vSolde = vSolde-vCapitalM
compteur = compteur +1
if compteur = NoMois then CalculerRembM = vSolde end if
next
vInteretAn = 0
vCapitalAn = 0
next
if ETaux =0 then CalculerRembM = ECapital/(12 * EDuree) end if
End Function
Public function ShowProjection()
if RS.Fields("final") <> true then
Response.Write "Fiche préliminaire "
else
Response.Write "Fiche complète "
end if
End function
Public function ShowDateP
if RS.Fields("dateVers") <> "" then
Response.Write"" & RS.Fields ("dateVers")
end if
End function
Public function PN(vVal)
if IsNull(vVal) or vVal =0 or vVal ="" then
PN ="??"
elseif vVal =111111 then
PN ="N/A"
else
if P then
dim I
dim vRet
vRet = "----"
for I = 1 to len(vVal)
vRet = vRet & ""
next
PN = vRet
else
PN = vVal
end if
end if
end function
Public function PN2(vVal)
if P then
dim I
dim vRet
vRet = ""
for I = 1 to len(vVal)
vRet = vRet & "-"
next
PN2 = vRet
else
if vVal =0 then
PN2 = ""
else
PN2 = vVal
end if
end if
end function
Public function PN3(vVal)
if P then
dim I
dim vRet
vRet = ""
for I = 1 to len(vVal)
vRet = vRet & "-"
next
PN3 = vRet
else
if vVal =0 then
PN3 = "N/A"
else
PN3 = vVal
end if
end if
end function
Public function PS(vVal)
if P then
PS = ""
else
PS = vVal
end if
end function
Public function PN4(vVal)
if P then
dim I
dim vRet
vRet = ""
for I = 1 to len(vVal)
vRet = vRet & "-"
next
PN4 = vRet
else
if isNull(vVal) then
PN4 = 111111
else
PN4 = vVal
end if
end if
end function
Public function Onze(vVal)
if P then
dim I
dim vRet
vRet = ""
for I = 1 to len(vVal)
vRet = vRet & "-"
next
vVal = vRet
else
if vVal= 111111 then
vVal =0
end if
end if
end function
Public function Annexe(vVal)
if vVal= 0 then Annexe = "(non)" end if
if vVal= 1 then Annexe = "(oui)" end if
if vVal= 2 then Annexe = "(à venir)" end if
if vVal= 3 then Annexe = "(N/A)" end if
if vVal= 4 then Annexe = " " end if
end function
Public function lettreOpen(rid)
if rid <> RS.Fields("ID_res") and RS.Fields("Open_Listing") then
if rid < 300 then
lettreOpen = "Z"
elseif rid >1499 then
lettreOpen = "H"
else lettreOpen = "B"
end if
end if
end function
Public function lettreVF(rid)
if rid <> RS.Fields("ID_res") then
if RS.Fields("Temp") then
lettreVF = "VF"
end if
end if
end function
Public function SautPage(nrLignes,nrPermis,nrPage)
if nrLignes+ nrPermis > 40 then
%>
<%if RS.Fields("Titre")=1 then %>RÉSIDENCE POUR PERSONNES AGÉES<%END IF %>
<%if RS.Fields("Titre")=2 then %>RESSOURCE INTERMEDIAIRE EN SANTÉ MENTALE<%END IF %>
<%if RS.Fields("Titre")=3 then %>RESSOURCE DE TYPE FAMILIALE<%END IF %>
<%if RS.Fields("Titre")=4 then %>APPARTEMENTS LOCATIFS – STANDARD<%END IF %>
<%if RS.Fields("Categ")=1 then %>Complexe d'appartement sans service<%END IF %>
<%if RS.Fields("Categ")=2 then %>Complexe d'appartement avec service<%END IF %>
<%if RS.Fields("Categ")=3 then %>Ressource intermediaire gerontologie<%END IF %>
<%if RS.Fields("Categ")=4 then %>Ressource intermediaire gerontologie<%END IF %>
<%if RS.Fields("Categ")=11 then %>Chsld public<%END IF %>
<%if RS.Fields("Categ")=5 then %>Chsld privé autofinancé<%END IF %>
<%if RS.Fields("Categ")=6 then %>Chsld conventionné<%END IF %>
<%if RS.Fields("Categ")=7 then %>Clientele privé santé mentale<%END IF %>
<%if RS.Fields("Categ")=8 then %>Clientele privé en lourde perte d'autonomie<%END IF %>
<%if RS.Fields("Categ")=9 then %>Repas et services inclus<%END IF %>
<%if RS.Fields("Categ")=10 then %>Osbl<%END IF %>
<%if RS.Fields("SCateg1") then %>Chambres privées <%END IF %>
<%if RS.Fields("SCateg2") then %>Studios privés <%END IF %>
<%if RS.Fields("SCateg3") then %>Achat service<%END IF %>
<%if RS.Fields("SCateg5") then %>Appartements avec service<%END IF %>
<% if RS.Fields("Open_Listing") = 0 then %>
*Richard Perreault Immobilier Inc. agit uniquement comme courtier pour le vendeur et non pas comme agent de l’acheteur
<%else %>
*Richard Perreault Immobilier Inc. agit uniquement comme courtier pour l’acheteur et non pas comme agent du vendeur
<%end if %>
<% if RS.Fields("Open_Listing") <> 0 then%>
<%if RS.Fields("chUnite")<25 then %>1 à 24 unités
<%elseif RS.Fields("chUnite")<51 then %>25 à 50 unités
<%else %>51 unités et +
<%end if %>
<%else %>
<%=PN(RS.Fields("chUnite"))%><%end if %>
Mise de fonds
<%
dim Cr1,sc
sc=0
strSQL = " SELECT Count(*) AS typeUn" & _
" FROM tblCreancier" & _
" WHERE ID_Listing = " & vID & " AND ID_TypePret = 1"
RS2.Open strSQL, CNRS
Cr1 = RS2.Fields(0)
RS2.Close
%>
<% if Cr1 >0 then
strSQL = " SELECT c.ID_Cre ,c.ID_TypeCreancier ,c.ID_TypePret,c.Schl" & _
" FROM tblCreancier AS c,tblTypeCreancier AS t " & _
" WHERE c.ID_TypeCreancier = t.ID_TypeCreancier AND c.ID_Listing = " & vID &" AND c.ID_TypePret=1"
RS2.Open strSQL, CNRS
if RS2.Fields("Schl") then sc=1 end if
RS2.Close
end if %>
<% if RS.Fields("Nom_TypeSyndicat")<> "' '" then %>
<%=RS.Fields("Nom_TypeSyndicat") %><%else %>??<% end if%>
Mise en services
:
<%=PN(RS.Fields("DateDebut_res"))%>
Propriétaire depuis
:
<%if isNull(RS.Fields("DateAchat_res")) or RS.Fields("DateAchat_res")="" then %> ??
<%else %><%=Str2ProperCase(RS.Fields("DateAchat_res"))%><%end if %>
Certification
:
<% if isNull(RS.Fields("Certific")) then %>??<%else %>
<%=Str2ProperCase(RS.Fields("Certific"))%><%end if %>
BÂTIMENT
1)Spécifications
<% Dim batiments
RS2.Open " SELECT COUNT (Nr_Bat) AS nrB" & _
" FROM tblBatiment" & _
" WHERE ID_Listing = " & vID,CNRS
batiments = RS2.Fields(0)
RS2.Close
if batiments > 1 then %>
Nombre/nom(batiments)
:
<%=batiments %> :
<% Dim nrBat
nrBat =1
strSQL = " SELECT Titre " & _
" FROM tblBatiment" & _
" WHERE ID_Listing = " & vID
RS2.Open strSQL, CNRS
Do While Not RS2.EOF %>
<%=RS2.Fields("Titre")%>
<%if nrBat <> batiments then %>/<%end if %>
<% RS2.MoveNext
nrBat = nrBat +1
loop
RS2.Close%>
<%end if %>
Rénovations
:
<%if isNull(RS.Fields("DateReno_res")) then %> ??
<%else %><%=Str2ProperCase(RS.Fields("DateReno_res"))%> <% end if%>
<% if RS.Fields("DateAgr_res") = "111111" then %>
Agrandissement
:
N/A
<% elseif RS.Fields("DateAgr_res") = "" then %>
Agrandissements
:
NON
<% else %>
Agrandissement
:
<%=RS.Fields("DateAgr_res")%>
<% end if%>
Étage <% if batiments > 1 then %>par bâtiment<%end if %>
:
<%if batiments > 1 then %>
<% nrBat =1
strSQL = " SELECT Titre,Etages " & _
" FROM tblBatiment" & _
" WHERE ID_Listing = " & vID
RS2.Open strSQL, CNRS
Do While Not RS2.EOF %>
<%=RS2.Fields("Titre")%>= <%=RS2.Fields("Etages")%>
<%if nrBat <> batiments then %> / <%end if %>
<% RS2.MoveNext
nrBat = nrBat +1
loop
RS2.Close%>
<%else %>
<%=Str2ProperCase(RS.Fields("dgNbrEtages"))%>
<%end if %>
<% if batiments > 1 and RS.Fields("Open_Listing") = 0 then %>
Unités par bâtiment
:
<% nrBat =1
strSQL = " SELECT Titre,NrUnit " & _
" FROM tblBatiment" & _
" WHERE ID_Listing = " & vID
RS2.Open strSQL, CNRS
Do While Not RS2.EOF %>
<%=RS2.Fields("Titre")%>= <%=RS2.Fields("NrUnit")%> unités
<%if nrBat <> batiments then %> <%end if %>
<% RS2.MoveNext
nrBat = nrBat +1
loop
RS2.Close%>
<%end if %>
Recouvrement extérieur
:
<%if isNull(RS.Fields("Nom_TypeRecouvrement")) then %> ??
<%else %><%=Str2ProperCase(RS.Fields("Nom_TypeRecouvrement"))%><%end if %>
Eau chaude
:
<%if isNull(RS.Fields("Nom_TypeEauChaude")) then %> ??
<%else %><%=Str2ProperCase(RS.Fields("Nom_TypeEauChaude"))%><%end if %>
Équipement cuisine
:
<%if isNull(RS.Fields("Nom_EquipCuisine")) then %> ??
<%else %><%=Str2ProperCase(RS.Fields("Nom_EquipCuisine"))%><%end if %>
Année construction
:
<%if batiments > 1 then %>
<% nrBat =1
strSQL = " SELECT Titre,Constr " & _
" FROM tblBatiment" & _
" WHERE ID_Listing = " & vID
RS2.Open strSQL, CNRS
Do While Not RS2.EOF %>
<%=RS2.Fields("Titre")%>= <%if RS2.Fields("Constr") =0 then %>?
<%else %><%=Str2ProperCase(RS2.Fields("Constr"))%><%end if %>
<%if nrBat <> batiments then %> <%end if %>
<% RS2.MoveNext
nrBat = nrBat +1
loop
RS2.Close%>
<%else %>
<% if RS.Fields("DateCons_res")<> "" then %>
<% =PN(RS.Fields("DateCons_res"))%>
<%else %>Inconnu<%end if %><%end if %>
Structure <%if batiments > 1 then %>par bâtiment<%end if %>
:
<%if batiments > 1 then %>
<% nrBat = 1
strSQL = " SELECT Titre,Struct " & _
" FROM tblBatiment" & _
" WHERE ID_Listing = " & vID
RS2.Open strSQL, CNRS
Do While Not RS2.EOF %>
<%=RS2.Fields("Titre")%>=
<%if RS2.Fields("Struct")=0 then %>?<%end if %>
<%if RS2.Fields("Struct")=1 then %>BOIS<%end if %>
<%if RS2.Fields("Struct")=2 then %>BÉTON<%end if %>
<%if RS2.Fields("Struct")=3 then %>BOIS / BÉTON<%end if %>
<%if RS2.Fields("Struct")=4 then %>ACIER / BÉTON<%end if %>
<%if RS2.Fields("Struct")=5 then %>BOIS ACIER BÉTON<%end if %>
<%if nrBat <> batiments then %> <%end if %>
<% RS2.MoveNext
nrBat = nrBat +1
loop
RS2.Close%>
<%else %>
<%if isNull(RS.Fields("Nom_TypeConstruction")) then %> ??
<%else %><%=Str2ProperCase(RS.Fields("Nom_TypeConstruction"))%><%end if %>
<%end if %>
Ascenseur <%if batiments > 1 then %>par bâtiment<%end if %>
:
<%if batiments > 1 then %>
<% nrBat =1
strSQL = " SELECT Titre,Ascenseurs " & _
" FROM tblBatiment" & _
" WHERE ID_Listing = " & vID
RS2.Open strSQL, CNRS
Do While Not RS2.EOF %>
<%=RS2.Fields("Titre")%>= <%if RS2.Fields("Ascenseurs") =0 then %>Non
<%else %><%=Str2ProperCase(RS2.Fields("Ascenseurs"))%><%end if %>
<%if nrBat <> batiments then %> / <%end if %>
<% RS2.MoveNext
nrBat = nrBat +1
loop
RS2.Close%>
<%else %>
<%if RS.Fields("dgAscenseur") =0 then %> NON
<%else %><%=Str2ProperCase(RS.Fields("dgAscenseur"))%><%end if %>
<%end if %>
<% if not isNull(RS.Fields("Chaise")) or RS.Fields("Chaise") <> "Non" then %>
Chaise élévatrice
:
<%=Str2ProperCase(RS.Fields("Chaise"))%>
<%end if %>
Classe <%if batiments > 1 then %>par bâtiment<%end if %>
:
<%if batiments > 1 then %>
<% nrBat = 1
strSQL = " SELECT Titre,Classe " & _
" FROM tblBatiment" & _
" WHERE ID_Listing = " & vID
RS2.Open strSQL, CNRS
Do While Not RS2.EOF %>
<%=RS2.Fields("Titre")%>=
<%if RS2.Fields("Classe")=0 then %>?<%end if %>
<%if RS2.Fields("Classe")=1 then %>C<%end if %>
<%if RS2.Fields("Classe")=2 then %>Autres<%end if %>
<%if RS2.Fields("Classe")=3 then %>B2<%end if %>
<%if RS2.Fields("Classe")=4 then %>B2 + C<%end if %>
<%if RS2.Fields("Classe")=5 then %>R<%end if %>
<%if nrBat <> batiments then %> / <%end if %>
<% RS2.MoveNext
nrBat = nrBat +1
loop
RS2.Close%>
<%else %>
<%=Str2ProperCase(RS.Fields("Nom_Classe"))%>
<%end if %>
Chauffage
:
<%if isNull(RS.Fields("Nom_TypeChauffage")) then %> ??
<% else %><%=Str2ProperCase(RS.Fields("Nom_TypeChauffage"))%><%end if %>
Cable payé par
:
<% if RS.Fields("Nom_TypeCable")<> "' '" then %> <%=Str2ProperCase(RS.Fields("Nom_TypeCable"))%><%else %>??<% end if%>
Fournisseur cable
:
<% if RS.Fields("Nom_TypeFCable")<> "' '" then %> <%=Str2ProperCase(RS.Fields("Nom_TypeFCable"))%><%else %>??<% end if%>
Gicleurs
:
<%if RS.Fields("Gicleurs")=0 then %>??<%end if %>
<%if RS.Fields("Gicleurs")=1 then %>Oui 100%<%end if %>
<%if RS.Fields("Gicleurs")=2 then %>Oui partiellement<%end if %>
<%if RS.Fields("Gicleurs")=3 then %>Non<%end if %>
Espaces climatisés
:
<%if RS.Fields("Climat")=1 then %>Espaces communs seulement<%end if %>
<%if RS.Fields("Climat")=2 then %>Complètement<%end if %>
<%if RS.Fields("Climat")=3 then %>Bureaux seulement<%end if %>
<%if RS.Fields("Climat")=0 then %>???<%end if %>
<%if RS.Fields("Climat")=4 then %>Rien<%end if %>
Échangeur d'air
:
<%if RS.Fields("EchAir")=1 then %>Oui<%else%>Non<%end if %>
Cameras de surveillance
:
<%if RS.Fields("CamSurv")=0 then %>Non
<%elseif RS.Fields("CamSurv")=1 then %>Oui
<%else%>Oui (<%=RS.Fields("CamSurv")%>)
<%end if %>
Logement proprietaire
:
<% if RS.Fields("Nom_TypeLogProp")<> "' '" then %> <%=Str2ProperCase(RS.Fields("Nom_TypeLogProp"))%><%else %>??<% end if%>
DIMENSIONS - SUPERFICIE
Terrain (dimension)
:
<%if RS.Fields("dgDimTerrain")= "0" then %> ??
<%else %>
<%=LCase(RS.Fields("dgDimTerrain"))%><%end if %>
<%
strSQL = " SELECT t.Nom_Langue" & _
" FROM tblLangueParlee AS l INNER JOIN tblLangue AS t ON l.ID_Langue = t.ID_Langue" & _
" WHERE l.ID_Listing = " & vID & _
" ORDER BY t.Nom_Langue ASC;"
RS2.Open strSQL, CNRS
Do While Not RS2.EOF
Response.Write Str2ProperCase(RS2.fields("Nom_Langue"))
RS2.MoveNext
If Not RS2.EOF Then Response.Write ", "
Loop
RS2.Close
%>
CLIÈNTELE
<%
strSQL = " SELECT t.Nom_TypeClientele" & _
" FROM tblClientele AS c INNER JOIN tblTypeClientele AS t ON c.ID_TypeClientele = t.ID_TypeClientele" & _
" WHERE c.ID_Listing = " & vID & _
" ORDER BY t.Nom_TypeClientele ASC;"
RS2.Open strSQL, CNRS
Do While Not RS2.EOF
Response.Write Str2ProperCase(RS2.fields("Nom_TypeClientele"))
RS2.MoveNext
If Not RS2.EOF Then Response.Write ", "
Loop
RS2.Close
%>
SERVICES À PROXIMITÉ
<%
strSQL = " SELECT t.Nom_TypeService" & _
" FROM tblService AS s INNER JOIN tblTypeService AS t ON s.ID_TypeService = t.ID_TypeService" & _
" WHERE s.ID_Listing = " & vID & _
" ORDER BY t.Nom_TypeService;"
RS2.Open strSQL, CNRS
Do While Not RS2.EOF
Response.Write Str2ProperCase(RS2.fields("Nom_TypeService"))
RS2.MoveNext
If Not RS2.EOF Then Response.Write ", "%>
<%Loop
RS2.Close
%>
<% dim color,depenseC
color = 0
strSQL = " SELECT t.Nom_TypeDepense, d.Valeur_Depense, t.Pourcentage_Depense" & _
" FROM tblDepense AS d INNER JOIN tblTypeDepense AS t ON d.ID_TypeDepense = t.ID_TypeDepense" & _
" WHERE (t.Rang_Depense BETWEEN 1 AND 2) AND d.ID_Listing = " & vID & _
" ORDER BY t.Rang_Depense ASC"
RS2.Open strSQL, CNRS
do while not RS2.EOF
depenseC = RS2.Fields("Valeur_Depense")
if depenseC= 111111 then depenseC=0 end if
%>
bgcolor="#E4E4E4" <% end if%>class="v1"><%=RS2.Fields("Nom_TypeDepense")%>
<% color = color +1
RS2.MoveNext
loop
RS2.Close
%>
SALAIRES
<% color = 0
strSQL = " SELECT t.Nom_TypeDepense, d.Valeur_Depense, t.Pourcentage_Depense" & _
" FROM tblDepense AS d INNER JOIN tblTypeDepense AS t ON d.ID_TypeDepense = t.ID_TypeDepense" & _
" WHERE (t.Rang_Depense BETWEEN 3 AND 10) AND d.ID_Listing = " & vID & _
" ORDER BY t.Rang_Depense ASC"
RS2.Open strSQL, CNRS
do while not RS2.EOF
depenseC = RS2.Fields("Valeur_Depense")
if (depenseC= 111111 or depenseC = 111) then depenseC=0 end if
%>
bgcolor="#E4E4E4" <% end if%> class="v1"><%=RS2.Fields("Nom_TypeDepense")%>
<%
color = color +1
RS2.MoveNext
loop
RS2.Close
%>
ÉNERGIE & TÉLÉCOMUNICATIONS
<%
color = 0
strSQL = " SELECT t.Nom_TypeDepense, d.Valeur_Depense, t.Pourcentage_Depense" & _
" FROM tblDepense AS d INNER JOIN tblTypeDepense AS t ON d.ID_TypeDepense = t.ID_TypeDepense" & _
" WHERE (t.Rang_Depense BETWEEN 11 AND 16 ) AND d.ID_Listing = " & vID & _
" ORDER BY t.Rang_Depense ASC"
RS2.Open strSQL, CNRS
do while not RS2.EOF
depenseC = RS2.Fields("Valeur_Depense")
if depenseC= 111111 then depenseC=0 end if
%>
bgcolor="#E4E4E4" <% end if%> class="v1"><%=RS2.Fields("Nom_TypeDepense")%>
<%
color = color +1
RS2.MoveNext
loop
RS2.Close
%>
ENTRETIEN ET ACHAT PRODUITS
<%
color = 0
strSQL = " SELECT t.Nom_TypeDepense, d.Valeur_Depense, t.Pourcentage_Depense" & _
" FROM tblDepense AS d INNER JOIN tblTypeDepense AS t ON d.ID_TypeDepense = t.ID_TypeDepense" & _
" WHERE (t.Rang_Depense BETWEEN 17 AND 22) AND d.ID_Listing = " & vID & _
" ORDER BY t.Rang_Depense ASC"
RS2.Open strSQL, CNRS
do while not RS2.EOF
depenseC = RS2.Fields("Valeur_Depense")
if depenseC= 111111 then depenseC=0 end if
%>
bgcolor="#E4E4E4" <% end if%> class="v1"><%=RS2.Fields("Nom_TypeDepense")%>
<%
color = color +1
RS2.MoveNext
loop
RS2.Close
%>
PERMIS & FRAIS FINANCIERS
<%
color = 0
strSQL = " SELECT t.Nom_TypeDepense, d.Valeur_Depense, t.Pourcentage_Depense" & _
" FROM tblDepense AS d INNER JOIN tblTypeDepense AS t ON d.ID_TypeDepense = t.ID_TypeDepense" & _
" WHERE (t.Rang_Depense BETWEEN 23 AND 32) AND d.ID_Listing = " & vID & _
" ORDER BY t.Rang_Depense ASC"
RS2.Open strSQL, CNRS
do while not RS2.EOF
depenseC = RS2.Fields("Valeur_Depense")
if depenseC= 111111 then depenseC=0 end if
%>
bgcolor="#E4E4E4" <% end if%> class="v1"><%=RS2.Fields("Nom_TypeDepense")%>
<%
color = color +1
RS2.MoveNext
loop
RS2.Close
%>
LOCATION D'ÉQUIPEMENTS
<%
color = 0
strSQL = " SELECT t.Nom_TypeDepense, d.Valeur_Depense, t.Pourcentage_Depense" & _
" FROM tblDepense AS d INNER JOIN tblTypeDepense AS t ON d.ID_TypeDepense = t.ID_TypeDepense" & _
" WHERE (t.Rang_Depense BETWEEN 33 AND 36) AND d.ID_Listing = " & vID & _
" ORDER BY t.Rang_Depense ASC"
RS2.Open strSQL, CNRS
do while not RS2.EOF
depenseC = RS2.Fields("Valeur_Depense")
if depenseC= 111111 then depenseC=0 end if
%>
bgcolor="#E4E4E4" <% end if%> class="v1"><%=RS2.Fields("Nom_TypeDepense")%>
<%
color = color +1
RS2.MoveNext
loop
RS2.Close
%>
<%
color = 0
strSQL = " SELECT t.Nom_TypeDepense, d.Valeur_Depense, t.Pourcentage_Depense" & _
" FROM tblDepense AS d INNER JOIN tblTypeDepense AS t ON d.ID_TypeDepense = t.ID_TypeDepense" & _
" WHERE t.Rang_Depense =37 AND d.ID_Listing = " & vID & _
" ORDER BY t.Rang_Depense ASC"
RS2.Open strSQL, CNRS
do while not RS2.EOF
depenseC = RS2.Fields("Valeur_Depense")
if depenseC= 111111 then depenseC=0 end if
%>
bgcolor="#E4E4E4" <% end if%> class="v12">ALIMENTATION
<%
color = color +1
RS2.MoveNext
loop
RS2.Close
%>
LOCATAIRE MARKETING
<%
color = 0
strSQL = " SELECT t.Nom_TypeDepense, d.Valeur_Depense, t.Pourcentage_Depense" & _
" FROM tblDepense AS d INNER JOIN tblTypeDepense AS t ON d.ID_TypeDepense = t.ID_TypeDepense" & _
" WHERE (t.Rang_Depense BETWEEN 38 AND 41) AND d.ID_Listing = " & vID & _
" ORDER BY t.Rang_Depense ASC"
RS2.Open strSQL, CNRS
do while not RS2.EOF
depenseC = RS2.Fields("Valeur_Depense")
if depenseC= 111111 then depenseC=0 end if
%>
bgcolor="#E4E4E4" <% end if%> class="v1"><%=RS2.Fields("Nom_TypeDepense")%>
<%
color = color +1
RS2.MoveNext
loop
RS2.Close
%>
<%
color = 0
strSQL = " SELECT t.Nom_TypeDepense, d.Valeur_Depense, t.Pourcentage_Depense" & _
" FROM tblDepense AS d INNER JOIN tblTypeDepense AS t ON d.ID_TypeDepense = t.ID_TypeDepense" & _
" WHERE t.Rang_Depense =42 AND d.ID_Listing = " & vID & _
" ORDER BY t.Rang_Depense ASC"
RS2.Open strSQL, CNRS
do while not RS2.EOF
depenseC = RS2.Fields("Valeur_Depense")
if depenseC= 111111 then depenseC=0 end if
%>
<% dim Occloyers
RS2.Open " SELECT SUM (Tarif)" & _
" FROM tblLoyers" & _
" WHERE Tarif<>111111 and ID_Listing = " & vID,CNRS
%>
<% Occloyers = 12 * RS2.Fields(0)
RS2.Close%>
<% dim OccloyersSoins
RS2.Open " SELECT SUM (Soin)" & _
" FROM tblLoyers" & _
" WHERE Soin<>111111 and ID_Listing = " & vID,CNRS
%>
<% OccloyersSoins = 12 * RS2.Fields(0)
RS2.Close%>
<% if isnull(Occloyers) then Occloyers = 0 end if
if isnull(OccloyersSoins) then OccloyersSoins = 0 end if
%>
<% if Occloyers <> 0 then
RDB = Occloyers + OccloyersSoins
else
RDB = 0
end if
if RDB = 0 or (isnull(RDB)) then RDB = 1 end if
%>
A- Revenu brut résidentiel:
<%=PN(FormatNumber(RDB * MD, 0, , , true))%> $
<% RDA = RS.Fields("moRevenuActuel") %>
Revenu à la signature du mandat
Mensuel: <%=FormatNumber(RDA * MD, 0, , , true)%> $ /
Annuel: <%=FormatNumber((RDA * 12) * MD, 0, , , true)%> $
<% dim Vacantloyers,PercVL
Vacantloyers = 0
PercVL = 0
RS2.Open " SELECT SUM (Tarif)" & _
" FROM tblLoyers" & _
" WHERE Vacante = 1 and Tarif<>111111 AND ID_Listing = " & vID,CNRS
%>
<% if not isnull(RS2.Fields(0)) then
Vacantloyers = 12 * RS2.Fields(0)
end if
PercVL = RS.Fields("moTauxPerteVacance")
RDB1 = RDB * RS.Fields("moTauxPerteVacance")
RS2.Close%>
<%if RDG_a < 0 then %>(<%=PN(FormatNumber(RDG_a * MD, 0, , , true))%> $)
<% else %> <%=PN(FormatNumber(RDG_a * MD, 0, , , true))%> $<% end if %>
H- Capitalisation
<%=PN(FormatNumber(RDH * MD, 0, , , true))%> $
<%=PN(FormatNumber(RDH_a * MD, 0, , , true))%> $
<% if RS.Fields("dgLogementProprio") then %>
Avantage-Prop
<%=PN(FormatNumber(RDH1 * MD, 0, , , true))%> $
<%=PN(FormatNumber(RDH1 * MD, 0, , , true))%> $
<% end if %>
I- PROFIT TOTAL
<%=PN(FormatNumber(RDI * MD, 0, , , true))%> $
<%=PN(FormatNumber(RDI_a * MD, 0, , , true))%> $
RATIO REVENUS / DÉPENSES
<% RVD =0
RS2.Open " SELECT SUM (d.Valeur_Depense) " & _
" FROM tblDepense AS d INNER JOIN tblTypeDepense AS t ON d.ID_TypeDepense = t.ID_TypeDepense" & _
" WHERE (t.Rang_Depense BETWEEN 1 AND 2) AND d.Valeur_Depense<>111111 AND d.ID_Listing = " & vID,CNRS
%>
<% if not isnull(RS2.Fields(0)) then RVD = RS2.Fields(0) end if
dim dep1,dep2,dep3,dep4 ,dep5,dep6,dep7,dep8,dep9,depG
dep1 = FormatNumber(Div0(RVD, RDBT) * 100, 1, , , true) %>
Taxes:
<%=PN3(dep1)%>%
<%=PN3(FormatNumber(RVD * MD, 0, , , true))%> $
<% RS2.Close %>
<% RVD =0
RS2.Open " SELECT SUM (d.Valeur_Depense) " & _
" FROM tblDepense AS d INNER JOIN tblTypeDepense AS t ON d.ID_TypeDepense = t.ID_TypeDepense" & _
" WHERE (t.Rang_Depense BETWEEN 3 AND 10) AND d.Valeur_Depense<>111111 AND d.ID_Listing = " & vID,CNRS
%>
<% if not isnull(RS2.Fields(0)) then RVD = RS2.Fields(0) end if
dep2 = FormatNumber(Div0(RVD, RDBT) * 100, 1, , , true) %>
Salaires:
<%=PN3(dep2)%>%
<%=PN3(FormatNumber(RVD * MD, 0, , , true))%> $
<% RS2.Close %>
<% RVD =0
RS2.Open " SELECT SUM (d.Valeur_Depense) " & _
" FROM tblDepense AS d INNER JOIN tblTypeDepense AS t ON d.ID_TypeDepense = t.ID_TypeDepense" & _
" WHERE t.Rang_Depense = 8 AND d.ID_Listing = " & vID,CNRS
%>
<%
if not isnull(RS2.Fields(0)) then RVD = RS2.Fields(0) end if
depG = FormatNumber(Div0(RVD, RDBT) * 100, 1, , , true)
if RVD = 111111 then depG = 111111 end if%>
Gestion:
<%=PN(depG)%>%
<%=PN(FormatNumber(RVD * MD, 0, , , true))%> $
<% RS2.Close %>
<% RVD =0
RS2.Open " SELECT SUM (d.Valeur_Depense) " & _
" FROM tblDepense AS d INNER JOIN tblTypeDepense AS t ON d.ID_TypeDepense = t.ID_TypeDepense" & _
" WHERE (t.Rang_Depense BETWEEN 11 AND 16) AND d.Valeur_Depense<>111111 AND d.ID_Listing = " & vID,CNRS
%>
<% if not isnull(RS2.Fields(0)) then RVD = RS2.Fields(0) end if
dep3 = FormatNumber(Div0(RVD, RDBT) * 100, 1, , , true)%>
Énergie & télécommunications:
<%=PN3(dep3)%>%
<%=PN3(FormatNumber(RVD * MD, 0, , , true))%> $
<% RS2.Close %>
<% RVD =0
RS2.Open " SELECT SUM (d.Valeur_Depense) " & _
" FROM tblDepense AS d INNER JOIN tblTypeDepense AS t ON d.ID_TypeDepense = t.ID_TypeDepense" & _
" WHERE (t.Rang_Depense BETWEEN 17 AND 22) AND d.ID_Listing = " & vID,CNRS
%>
<% if not isnull(RS2.Fields(0)) then RVD = RS2.Fields(0) end if
dep4 = FormatNumber(Div0(RVD, RDBT) * 100, 1, , , true) %>
Entretien & achat fournitures:
<%=PN3(dep4)%>%
<%=PN3(FormatNumber(RVD * MD, 0, , , true))%> $
<% RS2.Close %>
<% RVD =0
RS2.Open " SELECT SUM (d.Valeur_Depense) " & _
" FROM tblDepense AS d INNER JOIN tblTypeDepense AS t ON d.ID_TypeDepense = t.ID_TypeDepense" & _
" WHERE (t.Rang_Depense BETWEEN 23 AND 33) AND d.Valeur_Depense<>111111 AND d.ID_Listing = " & vID,CNRS
%>
<% if not isnull(RS2.Fields(0)) then RVD = RS2.Fields(0) end if
dep5 = FormatNumber(Div0(RVD, RDBT) * 100, 1, , , true)%>
Permis & frais financiers:
<%=PN3(dep5)%>%
<%=PN3(FormatNumber(RVD * MD, 0, , , true))%> $
<% RS2.Close %>
<% RVD =0
RS2.Open " SELECT SUM (d.Valeur_Depense) " & _
" FROM tblDepense AS d INNER JOIN tblTypeDepense AS t ON d.ID_TypeDepense = t.ID_TypeDepense" & _
" WHERE (t.Rang_Depense BETWEEN 34 AND 36)AND d.Valeur_Depense<>111111 AND d.ID_Listing = " & vID,CNRS
%>
<% if not isnull(RS2.Fields(0)) then RVD = RS2.Fields(0) end if
dep6 = FormatNumber(Div0(RVD, RDBT) * 100, 1, , , true)%>
Location équipement:
<%=PN3(dep6)%>%
<%=PN3(FormatNumber(RVD * MD, 0, , , true))%> $
<% RS2.Close %>
<% RVD =0
RS2.Open " SELECT SUM (d.Valeur_Depense) " & _
" FROM tblDepense AS d INNER JOIN tblTypeDepense AS t ON d.ID_TypeDepense = t.ID_TypeDepense" & _
" WHERE t.Rang_Depense = 37 AND d.Valeur_Depense<>111111 AND d.ID_Listing = " & vID,CNRS
%>
<% if not isnull(RS2.Fields(0)) then RVD = RS2.Fields(0) end if
dep7 = FormatNumber(Div0(RVD, RDBT) * 100, 1, , , true) %>
Alimentation:
<%=PN3(dep7)%>%
<%=PN3(FormatNumber(RVD * MD, 0, , , true))%> $
<% RS2.Close %>
<% RVD =0
RS2.Open " SELECT SUM (d.Valeur_Depense) " & _
" FROM tblDepense AS d INNER JOIN tblTypeDepense AS t ON d.ID_TypeDepense = t.ID_TypeDepense" & _
" WHERE (t.Rang_Depense BETWEEN 38 AND 41) AND d.Valeur_Depense<>111111 AND d.ID_Listing = " & vID,CNRS
%>
<% if not isnull(RS2.Fields(0)) then RVD = RS2.Fields(0) end if
dep8 = FormatNumber(Div0(RVD, RDBT) * 100, 1, , , true)%>
Locataire marketing:
<%=PN3(dep8)%>%
<%=PN3(FormatNumber(RVD * MD, 0, , , true))%> $
<% RS2.Close %>
<% RVD =0
RS2.Open " SELECT SUM (d.Valeur_Depense) " & _
" FROM tblDepense AS d INNER JOIN tblTypeDepense AS t ON d.ID_TypeDepense = t.ID_TypeDepense" & _
" WHERE t.Rang_Depense = 42 AND d.Valeur_Depense<>111111 AND d.ID_Listing = " & vID,CNRS
%>
<% if not isnull(RS2.Fields(0)) then RVD = RS2.Fields(0) end if
dep9 = FormatNumber(Div0(RVD, RDBT) * 100, 1, , , true)%>
<%
else
Response.Write "Affichage impossible, une erreur se produite."
end if
end if
on error resume next
RS2.ActiveConnection = nothing
set RS2 = nothing
EndConnect
%>