From 1932ac1c388d4e77cf91df2d38468d7c590e6070 Mon Sep 17 00:00:00 2001
From: Immanuel Onyeka
Date: Tue, 5 Sep 2023 21:54:15 -0400
Subject: [PATCH] correct file misnaming
---
skouter.go | 27 ++++++--------
views/report/comparison.tpl | 70 +++++++++++++++++++++++++++++++++---
views/report/master.tpl | 5 ++-
views/report/summary.tpl | 71 ++++---------------------------------
4 files changed, 84 insertions(+), 89 deletions(-)
diff --git a/skouter.go b/skouter.go
index 1896873..121c0a9 100644
--- a/skouter.go
+++ b/skouter.go
@@ -162,6 +162,15 @@ type Estimate struct {
Loans []Loan `json:"loans"`
}
+type Report struct {
+ Title string
+ Name string
+ Avatar string
+ Letterhead string
+ User User
+ Estimate Estimate
+}
+
type Password struct {
Old string `json:"old"`
New string `json:"new"`
@@ -1849,14 +1858,7 @@ func showPDF(w http.ResponseWriter, r *http.Request) {
if err != nil { w.WriteHeader(500); return }
users, err := queryUsers(db, 1)
- info := struct {
- Title string
- Name string
- Avatar string
- Letterhead string
- User User
- Estimate Estimate
- }{
+ info := Report{
Title: "test PDF",
Name: "idk-random-name",
User: users[0],
@@ -1905,14 +1907,7 @@ func getPdf(w http.ResponseWriter, db *sql.DB, r *http.Request) {
}
users, err := queryUsers(db, claims.Id)
- info := struct {
- Title string
- Name string
- Avatar string
- Letterhead string
- User User
- Estimate Estimate
- }{
+ info := Report{
Title: "test PDF",
Name: "idk-random-name",
User: users[0],
diff --git a/views/report/comparison.tpl b/views/report/comparison.tpl
index 9531cba..91ffd99 100644
--- a/views/report/comparison.tpl
+++ b/views/report/comparison.tpl
@@ -1,9 +1,69 @@
{{define "comparison"}}
-
-
-hello
-
+
+
+
+ | {{range $l := .Estimate.Loans}}{{$l.Name}} | {{end}}
+
+
+
+Type |
+{{range .Estimate.Loans}}{{.Type.Name}} | {{end}}
+Term |
+{{range .Estimate.Loans}}{{.Term}} Years | {{end}}
+Amortization |
+{{range .Estimate.Loans}}{{.Amortization}} | {{end}}
+Interest rate |
+{{range .Estimate.Loans}}{{.Interest}}% | {{end}}
+Monthly MI |
+ {{range .Estimate.Loans}}${{dollars .Mi.Premium}}/month | {{end}}
+Real estate taxes |
+ {{range .Estimate.Loans}}${{dollars .Tax}}/month | {{end}}
+Total monthly |
+{{range .Estimate.Loans}}${{dollars .Result.TotalMonthly}} | {{end}}
+
+Purchase price |
+{{range .Estimate.Loans}}${{dollars $.Estimate.Price}} | {{end}}
+Loan amount |
+{{range .Estimate.Loans}}${{dollars .Amount}} | {{end}}
+Down payment |
+{{range .Estimate.Loans}}${{diff .Amount $.Estimate.Price}} | {{end}}
+Closing costs |
+{{range .Estimate.Loans}}${{dollars .Result.TotalFees}} | {{end}}
+MI Premium |
+ {{range .Estimate.Loans}}${{.Mi.Upfront}} | {{end}}
+Credits |
+ {{range .Estimate.Loans}}${{dollars .Result.TotalCredits}} | {{end}}
+Cash to close |
+ {{range .Estimate.Loans}}${{dollars .Result.CashToClose}} | {{end}}
+
+
-{{end}}
+
+{{end}}
diff --git a/views/report/master.tpl b/views/report/master.tpl
index 15dcc8a..e846d59 100644
--- a/views/report/master.tpl
+++ b/views/report/master.tpl
@@ -12,7 +12,7 @@
Get an official quote before choosing a loan.
{{template "header" .}}
-{{template "summary" .}}
+{{template "comparison" .}}
@@ -21,9 +21,8 @@ Get an official quote before choosing a loan.
Get an official quote before choosing a loan.
{{template "header" .}}
-{{template "comparison" .}}
+{{template "summary" .}}
-