<% ' *********************************************************** ' ' 09/22/07 790 users cannot edit tracking notes of others (except Admin) ' 04/28/07 713 add Police Report Link ' 04/25/07 633 add Comaker employer information ' 02/28/07 697 add map link for addresses ' 10/28/06 617 do not allow clients to change info (must submit an update) ' 11/09/05 Exxx do not show account number ' 09/22/05 E501 Allow managers to print repo order ' ' *********************************************************** Session("PriorPage") = Session("CurrentPage") Session("CurrentPage") = "case.asp" ' ***** Initialize Query ***** Dim ConnStr Dim Conn Dim rs Dim SQL Dim CaseID Dim ClientID Dim AgentID Dim StatusID Dim AssignID Dim AcctNbr Dim Lname Dim Fname Dim Addr1 Dim Addr2 Dim City Dim State Dim Zip Dim Hphone Dim Wphone Dim SSN Dim BirthDate Dim Year Dim Make Dim Model Dim Plate Dim PlateState Dim Color Dim VIN Dim KeyIgn Dim EmpName Dim EmpAddr Dim EmpCity Dim EmpState Dim CoEmpName Dim CoEmpAddr Dim CoEmpCity Dim CoEmpState Dim AmtDue Dim DueDate Dim PymtAmt Dim Balance Dim AssignDate Dim ClientName Dim Lienholder Dim Desc1Addr Dim Desc2Addr Dim strAgentName Dim strEnteredBy Dim Status Dim Assignment Dim SpecInstr Dim strErrorMsg Dim UserClass Dim UserType Dim Comment Dim RepoDate Dim CoLName Dim CoFName Dim CoAddr1 Dim CoAddr2 Dim CoCity Dim CoState Dim CoZip Dim CoWphone Dim TrackEmpID ' On Error Resume Next strErrorMsg = "" CaseID = Request.QueryString("CaseID") CaseID = trim(CaseID) ' *************************************** ' Connect to Database ' *************************************** connectdb If Err.number <> 0 Then strErrorMsg = strErrorMsg & "305. Error Unable to connect to database.
" Err.Clear End If ' *************************************** ' Select Case Information ' *************************************** SQL = "SELECT C.CaseID, " SQL = SQL & "C.Status, " SQL = SQL & "C.AssignType, " SQL = SQL & "C.Agent, " SQL = SQL & "R1.Lname, " SQL = SQL & "R1.Fname, " SQL = SQL & "R1.Addr1, " SQL = SQL & "R1.Addr2, " SQL = SQL & "R1.City, " SQL = SQL & "R1.State, " SQL = SQL & "R1.Zip, " SQL = SQL & "R1.Hphone, " SQL = SQL & "R1.Wphone, " SQL = SQL & "C.SSN, " SQL = SQL & "C.Birthdate, " SQL = SQL & "C.Year, " SQL = SQL & "C.Make, " SQL = SQL & "C.Model, " SQL = SQL & "C.Plate, " SQL = SQL & "C.PlateState, " SQL = SQL & "C.Color, " SQL = SQL & "C.ClientAcct, " SQL = SQL & "C.VIN, " SQL = SQL & "C.KeyIgn, " SQL = SQL & "C.EmpName, " SQL = SQL & "C.EmpAddr, " SQL = SQL & "C.EmpCity, " SQL = SQL & "C.EmpState, " SQL = SQL & "C.CoEmpName, " SQL = SQL & "C.CoEmpAddr, " SQL = SQL & "C.CoEmpCity, " SQL = SQL & "C.CoEmpState, " SQL = SQL & "C.AmtDue, " SQL = SQL & "C.DueDate, " SQL = SQL & "C.PymtAmt, " SQL = SQL & "C.Balance, " SQL = SQL & "C.AssignDate, " SQL = SQL & "C.SpecInstr, " SQL = SQL & "C.Lienholder, " SQL = SQL & "C.Desc1Addr, " SQL = SQL & "C.Desc2Addr, " SQL = SQL & "C.RepoDate, " SQL = SQL & "Cd1.CodeDesc as StatusDesc, " SQL = SQL & "Cd2.CodeDesc as AssignDesc, " SQL = SQL & "R3.Lname as ClientLname, " SQL = SQL & "R3.ID as ClientID " SQL = SQL & "FROM tCase C, Rdex R1, Rdex R3, Codes Cd1, Codes Cd2 " SQL = SQL & "Where CaseID = " & CaseID & " " SQL = SQL & "AND C.CaseID = R1.ID " SQL = SQL & "AND C.Status = Cd1.CodeID " SQL = SQL & "AND C.AssignType = Cd2.CodeID " SQL = SQL & "AND R1.MasterID = R3.ID " ' ***** Run Query ***** Set rs = Conn.Execute(SQL) If Err.number <> 0 Then strErrorMsg = strErrorMsg & "306. Error Unable to read assignment information.
" Err.Clear End If if Not rs.EOF then StatusID = rs.fields("Status") AssignID = rs.fields("AssignType") AgentID= rs.fields("Agent") ClientID= rs.fields("ClientID") AcctNbr= rs.fields("ClientAcct") if isnull(rs.fields("Lname")) then Lname = " " else Lname= rs.fields("Lname") end if if isnull(rs.fields("Fname")) then Fname = " " else Fname= rs.fields("Fname") end if if isnull(rs.fields("Addr1")) then addr1 = " " else Addr1= rs.fields("Addr1") end if if isnull(rs.fields("Addr2")) then addr2 = " " else Addr2= rs.fields("Addr2") end if if isnull(rs.fields("City")) then City = " " else City= rs.fields("City") end if if isnull(rs.fields("State")) then State = " " else State= rs.fields("State") end if if isnull(rs.fields("Zip")) then Zip = " " else Zip= rs.fields("Zip") end if if isnull(rs.fields("Hphone")) then Hphone = " " else Hphone= rs.fields("Hphone") end if if isnull(rs.fields("Wphone")) then Wphone = " " else Wphone= rs.fields("Wphone") end if if isnull(rs.fields("SSN")) then SSN = " " else SSN= rs.fields("SSN") end if if isnull(rs.fields("BirthDate")) then BirthDate = " " else BirthDate = rs.fields("BirthDate") end if if isnull(rs.fields("Year")) then Year = " " else Year= rs.fields("Year") end if if isnull(rs.fields("Make")) then Make = " " else Make= rs.fields("Make") end if if isnull(rs.fields("Model")) then Model = " " else Model= rs.fields("Model") end if if isnull(rs.fields("Plate")) then Plate = " " else Plate= rs.fields("Plate") end if if isnull(rs.fields("PlateState")) then PlateState = " " else PlateState = rs.fields("PlateState") end if if isnull(rs.fields("Color")) then Color = " " else Color = rs.fields("Color") end if if isnull(rs.fields("VIN")) then VIN = " " else VIN= rs.fields("VIN") end if if isnull(rs.fields("KeyIgn")) then KeyIgn = " " else KeyIgn = rs.fields("KeyIgn") end if if isnull(rs.fields("EmpName")) then EmpName = " " else EmpName = rs.fields("EmpName") end if if isnull(rs.fields("EmpAddr")) then EmpAddr = " " else EmpAddr = rs.fields("EmpAddr") end if if isnull(rs.fields("EmpCity")) then EmpCity = " " else EmpCity = rs.fields("EmpCity") end if if isnull(rs.fields("EmpState")) then EmpState = " " else EmpState = rs.fields("EmpState") end if if isnull(rs.fields("CoEmpName")) then CoEmpName = " " else CoEmpName = rs.fields("CoEmpName") end if if isnull(rs.fields("CoEmpAddr")) then CoEmpAddr = " " else CoEmpAddr = rs.fields("CoEmpAddr") end if if isnull(rs.fields("CoEmpCity")) then CoEmpCity = " " else CoEmpCity = rs.fields("CoEmpCity") end if if isnull(rs.fields("CoEmpState")) then CoEmpState = " " else CoEmpState = rs.fields("CoEmpState") end if if isnull(rs.fields("AmtDue")) then AmtDue = " " else AmtDue = rs.fields("AmtDue") end if if isnull(rs.fields("DueDate")) then DueDate = " " else DueDate = rs.fields("DueDate") end if if isnull(rs.fields("PymtAmt")) then PymtAmt = " " else PymtAmt = rs.fields("PymtAmt") end if if isnull(rs.fields("Balance")) then Balance = " " else Balance = rs.fields("Balance") end if if isnull(rs.fields("ClientLName")) then ClientName = " " else ClientName= rs.fields("ClientLName") end if if isnull(rs.fields("Lienholder")) then Lienholder = " " else Lienholder = rs.fields("Lienholder") end if if isnull(rs.fields("Desc1Addr")) then Desc1Addr = " " else Desc1Addr = rs.fields("Desc1Addr") end if if isnull(rs.fields("Desc2Addr")) then Desc2Addr = " " else Desc2Addr = rs.fields("Desc2Addr") end if if isnull(rs.fields("RepoDate")) then RepoDate = "1/1/1900" else RepoDate = rs.fields("RepoDate") end if SpecInstr = rs.fields("SpecInstr") if len(SpecInstr) = 0 then SpecInstr = " " end if Status = rs.fields("StatusDesc") Assignment = rs.fields("AssignDesc") AssignDate = rs.fields("AssignDate") end if rs.close set rs = nothing ' *************************************** ' Select Agent Information ' *************************************** strAgentName = "" if AgentID > 0 then SQL = "SELECT " SQL = SQL & "R2.Lname as AgentLname, " SQL = SQL & "R2.Fname as AgentFname " SQL = SQL & "FROM Rdex R2 " SQL = SQL & "Where R2.ID = " & AgentID & " " ' ***** Run Query ***** Set rs = Conn.Execute(SQL) If Err.number <> 0 Then strErrorMsg = strErrorMsg & "306. Error Unable to read assignment information.
" Err.Clear End If if Not rs.EOF then strAgentName = rs.fields("AgentLname") if rs.fields("AgentFname") > "" then strAgentName = strAgentName & ", " & rs.fields("AgentFname") end if end if rs.close set rs = nothing end if ' *************************************** ' Select Comaker Information ' *************************************** CoLname = " " CoFname = " " CoAddr1 = " " CoAddr2 = " " CoCity = " " CoState = " " CoZip = " " SQL = "SELECT " SQL = SQL & "Lname, " SQL = SQL & "Fname, " SQL = SQL & "Addr1, " SQL = SQL & "Addr2, " SQL = SQL & "City, " SQL = SQL & "State, " SQL = SQL & "Zip, " SQL = SQL & "Wphone " SQL = SQL & "FROM Rdex " SQL = SQL & "Where MasterID = " & CaseID & " " SQL = SQL & "AND Type = '5' " ' ***** Run Query ***** Set rs = Conn.Execute(SQL) If Err.number <> 0 Then strErrorMsg = strErrorMsg & "Error Unable to read comaker information.
" Err.Clear End If if Not rs.EOF then if isnull(rs.fields("Lname")) then CoLname = " " else CoLname= rs.fields("Lname") end if if isnull(rs.fields("Fname")) then CoFname = " " else CoFname= rs.fields("Fname") end if if isnull(rs.fields("Addr1")) then CoAddr1 = " " else CoAddr1= rs.fields("Addr1") end if if isnull(rs.fields("Addr2")) then CoAddr2 = " " else CoAddr2 = rs.fields("Addr2") end if if isnull(rs.fields("City")) then CoCity = " " else CoCity = rs.fields("City") end if if isnull(rs.fields("State")) then CoState = " " else CoState = rs.fields("State") end if if isnull(rs.fields("Zip")) then CoZip = " " else CoZip = rs.fields("Zip") end if if isnull(rs.fields("Wphone")) then CoWphone = " " else CoWphone = rs.fields("Wphone") end if end if rs.close set rs = nothing ' *************************************** ' Select Addr1 Information ' *************************************** A1Addr1 = " " A1Addr2 = " " A1City = " " A1State = " " A1Zip = " " SQL = "SELECT " SQL = SQL & "Addr1, " SQL = SQL & "Addr2, " SQL = SQL & "City, " SQL = SQL & "State, " SQL = SQL & "Zip " SQL = SQL & "FROM Rdex " SQL = SQL & "Where MasterID = " & CaseID & " " SQL = SQL & "AND Type = '6' " ' ***** Run Query ***** Set rs = Conn.Execute(SQL) If Err.number <> 0 Then strErrorMsg = strErrorMsg & "Error Unable to read Address 1 information.
" Err.Clear End If if Not rs.EOF then if isnull(rs.fields("Addr1")) then A1Addr1 = " " else A1Addr1= rs.fields("Addr1") end if if isnull(rs.fields("Addr2")) then A1Addr2 = " " else A1Addr2 = rs.fields("Addr2") end if if isnull(rs.fields("City")) then A1City = " " else A1City = rs.fields("City") end if if isnull(rs.fields("State")) then A1State = " " else A1State = rs.fields("State") end if if isnull(rs.fields("Zip")) then A1Zip = " " else A1Zip = rs.fields("Zip") end if end if rs.close set rs = nothing ' *************************************** ' Select Addr2 Information ' *************************************** A2Addr1 = " " A2Addr2 = " " A2City = " " A2State = " " A2Zip = " " SQL = "SELECT " SQL = SQL & "Addr1, " SQL = SQL & "Addr2, " SQL = SQL & "City, " SQL = SQL & "State, " SQL = SQL & "Zip " SQL = SQL & "FROM Rdex " SQL = SQL & "Where MasterID = " & CaseID & " " SQL = SQL & "AND Type = '7' " ' ***** Run Query ***** Set rs = Conn.Execute(SQL) If Err.number <> 0 Then strErrorMsg = strErrorMsg & "Error Unable to read Address 1 information.
" Err.Clear End If if Not rs.EOF then if isnull(rs.fields("Addr1")) then A2Addr1 = " " else A2Addr1= rs.fields("Addr1") end if if isnull(rs.fields("Addr2")) then A2Addr2 = " " else A2Addr2 = rs.fields("Addr2") end if if isnull(rs.fields("City")) then A2City = " " else A2City = rs.fields("City") end if if isnull(rs.fields("State")) then A2State = " " else A2State = rs.fields("State") end if if isnull(rs.fields("Zip")) then A2Zip = " " else A2Zip = rs.fields("Zip") end if end if rs.close set rs = nothing ' ***************************************************************************** ' Begin HTML ' ***************************************************************************** %> Assignment Detail

Assignment Detail

<% ' Do not display account number ' ' ' ' %> <% if Session("UserType") = 1 _ or Session("UserType") = 3 then %> <% end if %>
Case <%=CaseID%>
Account Number< %=AcctNbr% >
  Debtor
First Name <%=Fname%>
LastName <%=Lname%>
Address Line 1 <% if Addr1 > "" then %> <% end if %> <%=Addr1%>
Address Line 2 <%=Addr2%>
City <%=City%>
State <%=State%>
Home Phone <%=Hphone%>
Postal Code <%=Zip%>
Date of Birth <%=BirthDate%>
  Vehicle
Vehicle Year <%=Year%>
Vehicle Model <%=Make%>
Vehicle Make <%=Model%>
License Plate <%=Plate%>
Plate State <%=PlateState%>
Vehicle Color <%=Color%>
VIN <%=VIN%>
Key Code <%=KeyIgn%>
  Employer
Employer Name <%=EmpName%>
Employer Address <% if trim(EmpAddr) > "" then %> <% end if %> <%=EmpAddr%>
Employer City <%=EmpCity%>
Employer State <%=EmpState%>
Work Phone <%=Wphone%>
  Loan
Assigned by <%=ClientName%>
Lienholder (if different) <%=Lienholder%>
Amount Due <%=AmtDue%>
Due Date <%=DueDate%>
Payment Amount <%=PymtAmt%>
Loan Balance <%=Balance%>
  Comaker
Comaker Name
<%=CoFname%> <%=CoLname%>
Address 1 <% if trim(CoAddr1) > "" then %> <% end if %>
<%=CoAddr1%>
Address 2
<%=CoAddr2%>
City
<%=CoCity%>
State
<%=CoState%>
Zip
<%=CoZip%>
  Comaker Employer
Employer Name <%=CoEmpName%>
Employer Address <% if trim(CoEmpAddr) > "" then %> <% end if %> <%=CoEmpAddr%>
Employer City <%=CoEmpCity%>
Employer State <%=CoEmpState%>
Work Phone <%=CoWphone%>
  Address 1
Description
<%=Desc1Addr%>
Address 1 <% if trim(A1Addr1) > "" then %> <% end if %>
<%=A1Addr1%>
Address 2
<%=A1Addr2%>
City
<%=A1City%>
State
<%=A1State%>
Zip
<%=A1Zip%>
  Address 2
Description
<%=Desc2Addr%>
Address 1 <% if trim(A2Addr1) > "" then %> <% end if %>
<%=A2Addr1%>
Address 2
<%=A2Addr2%>
City
<%=A2City%>
State
<%=A2State%>
Zip
<%=A2Zip%>
  Assignment
Date Assigned
<%=AssignDate%>
Assignment <%=Assignment%>
Status <%=Status%>
Field Agent <%=strAgentName%>

 

<% SQL = "SELECT TrackID, " SQL = SQL & "R1.Type, " SQL = SQL & "R1.Lname, " SQL = SQL & "R1.Fname, " SQL = SQL & "R1.ID, " SQL = SQL & "EntryDate, " SQL = SQL & "Private, " SQL = SQL & "Comment " SQL = SQL & "FROM Track, Rdex R1 " SQL = SQL & "Where Track.ID = " & caseid & " " SQL = SQL & "And EmpID = R1.ID " if Session("UserType") = 2 then SQL = SQL & "And (Private <> 'Y' OR Private is Null) " end if SQL = SQL & "Order by EntryDate, TrackID " ' ***** Run Query ***** Set rs = Conn.Execute(SQL) If Err.number <> 0 Then strErrorMsg = strErrorMsg & "Error Unable to read updates.
" Err.Clear End If While Not rs.EOF UserType = rs.fields("ID") if isnull(rs.fields("Lname")) then TrackEmpID = 0 else TrackEmpID= rs.fields("ID") end if if UserType <= 1 then UserClass = "UpdateC" ' elseif UserType = 4 then ' UserClass = "UpdateA" else UserClass = "UpdateA" end if if not isnull(rs.fields("Private")) then if rs.fields("Private") = "Y" then UserClass = "UpdateB" end if end if Comment = rs.fields("Comment") if isNull(comment) then comment = " " else Comment = Replace(Comment,vbcrlf,"
") end if strEnteredBy = rs.fields("Lname") if rs.fields("Fname") > "" and UserClass <> "UpdateC" then strEnteredBy = strEnteredBy & ", " & rs.fields("Fname") end if %> <% rs.movenext wend rs.close set rs = nothing %>
<% if Session("UserType") = 3 then if AGENTCHANGES then %> <% end if %> <% elseif Session("UserType") = 1 then %> <% else %> <% end if %> <% if Session("UserType") = 1 then %> <% end if %> <% if RepoDate > "1/1/1900" then %> <% end if %>
 
 
 
 
 
 
 
 
   
Special Instructions -
<%=SpecInstr%>

<%=rs.fields("EntryDate")%> - <%=strEnteredBy%> - <% if Session("UserType") = 1 _ or Session("UserID") = TrackEmpID then %> ">(edit) <% end if %>
<%=Comment%>