create report pdf

This commit is contained in:
Ruidy 2024-03-03 14:03:23 +01:00
parent 3d6d1474a2
commit 575dc5ad7b
No known key found for this signature in database
GPG key ID: E00F51288CB857CC
8 changed files with 295 additions and 173 deletions

View file

@ -1,115 +1,115 @@
<tr>
<td>
<strong>Au : </strong></td>
ss="text-break product_name">
{{ row.name }}
</td>
<td>{{ row.quantity }}</td>
e d'intérêts de retard. Le montant des pénalités résulte de l'application aux sommes restant dues d'un taux d'intérêt légal en vigueur au moment de l'incident. <br/>
</div>
</div>
<div class="order-total space-between">
<div></div>
<div class="total">
<div class="amount-due">
Total
</div>
<div class="amount-due-total">
{{ total }} €
</div>
</div>
</div>
</body>
</html> <td>{{row.price }} €</td>
<td class="align-right">{{ row.total }} €</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="order-summary space-between">
<div class="card">
<b>Notes</b> <br/>
TVA non applicable, art. 293 B du CGI <br/>
Dispensé dimmatriculation au registre du commerce et des sociétés (RCS) et au répertoire des métiers. <br/>
Conditions de paiement : paiement à réception de facture. Aucun escompte consenti pour règlement anticipé ou désistement. Tout incident de paiement est passibl <td>{{ to }}</td>
</tr>
<tr>
<td>
<strong>Montant : </strong></td>
<td>{{ total }} €</td>
</tr>
</tbody>
</table>
</div>
<hr/>
<div class="order-details">
<table class="items-table">
<thead>
<tr>
<th>Objet</th>
<th>Quantité</th>
<th>Prix</th>
<th class="align-right">Total</th>
</tr>
</thead>
<tbody class="bg-gray rounded">
{% for row in lines %}
<tr class="item-row">
<td cla<!DOCTYPE html>
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="main.css">
</head>
<head>
<link rel="stylesheet" href="main.css">
</head>
<body>
<body>
<div class="header space-between">
<img class="logo" src="logo.png">
<div class="payee">
<b>{{ host.name }}</b><br/>
{{ host.address }}<br/>
{{ host.zip_code}} {{ host.city }}<br/>
<b>Tel : </b>{{ host.phone }}<br/>
<b>Mail : </b>{{ host.email }}<br/>
</div>
<img class="logo" src="logo.png">
<div class="payee">
<b>{{ host.name }}</b><br/>
{{ host.address }}<br/>
{{ host.zip_code}} {{ host.city }}<br/>
<b>Tel : </b>{{ host.phone }}<br/>
<b>Mail : </b>{{host.email }}<br/>
</div>
</div>
<hr/>
<div class="billing-details space-between">
<table class="info-table">
<tbody>
<tr>
<td>
<strong>{{name}}</strong></td>
</tr>
<tr>
<td>
<strong>Tel : </strong></td>
<td>{{phone_number}}</td>
</tr>
<tr>
<td>
<strong>Voyageurs : </strong></td>
<td>{{ customers_number }}</td>
</tr>
<tr>
<td>
<strong>Plateforme : </strong></td>
<td>{{platform}}</td>
</tr>
</tbody>
</table>
<table class="info-table">
<tbody>
<tr>
<td>
<strong>Nº de facture : </strong></td>
<td>{{id}}</td>
</tr>
<tr>
<td>
<strong>Du : </strong></td>
<td>{{ from }}</td>
</tr>
<table class="info-table">
<tbody>
<tr>
<td>
<strong>{{name}}</strong></td>
</tr>
<tr>
<td>
<strong>Tel : </strong></td>
<td>{{phone_number}}</td>
</tr>
<tr>
<td>
<strong>Voyageurs : </strong></td>
<td>{{ customers_number }}</td>
</tr>
<tr>
<td>
<strong>Plateforme : </strong></td>
<td>{{platform}}</td>
</tr>
</tbody>
</table>
<table class="info-table">
<tbody>
<tr>
<td>
<strong>Nº de facture : </strong></td>
<td>{{id}}</td>
</tr>
<tr>
<td>
<strong>Du : </strong></td>
<td>{{ from }}</td>
</tr>
<tr>
<td>
<strong>Au : </strong></td>
<td>{{ to }}</td>
</tr>
<tr>
<td>
<strong>Montant : </strong></td>
<td>{{ total }}</td>
</tr>
</tbody>
</table>
</div>
<hr/>
<div class="order-details">
<table class="items-table">
<thead>
<tr>
<th>Objet</th>
<th>Quantité</th>
<th>Prix</th>
<th class="align-right">Total</th>
</tr>
</thead>
<tbody class="bg-gray rounded">
{% for row in lines %}
<tr class="item-row">
<td class="text-break product_name">
{{ row.name }}
</td>
<td>{{ row.quantity }}</td>
<td>{{row.price }}</td>
<td class="align-right">{{ row.total }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="order-summary space-between">
<div class="card">
<b>Notes</b> <br/>
TVA non applicable, art. 293 B du CGI <br/>
Dispensé dimmatriculation au registre du commerce et des sociétés (RCS) et au répertoire des métiers. <br/>
Conditions de paiement : paiement à réception de facture. Aucun escompte consenti pour règlement anticipé ou désistement. Tout incident de paiement est passible d'intérêts de retard. Le montant des pénalités résulte de l'application aux sommes restant dues d'un taux d'intérêt légal en vigueur au moment de l'incident. <br/>
</div>
</div>
<div class="order-total space-between">
<div></div>
<div class="total">
<div class="amount-due">
Total
</div>
<div class="amount-due-total">
{{ total }}
</div>
</div>
</div>
</body>
</html>

68
assets/html/report.html Normal file
View file

@ -0,0 +1,68 @@
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="main.css">
</head>
<body>
<h1>Bilan réservations</h1>
<h2>{{month}} {{ year }}</h2>
<div class="overflow-auto">
<table class="items-table">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Nom</th>
<th scope="col">Du</th>
<th scope="col">Au</th>
<th scope="col">Revenue (€)</th>
<th scope="col">Platforme</th>
<th scope="col">Commission (€)</th>
<th scope="col">NemoImmo (€)</th>
<th scope="col">Profit (€)</th>
</tr>
</thead>
<tbody>
{% for row in lines %}
<tr>
<th scope="row"> {{ row.Id }} </th>
<td>{{ row.CustomerName }}</td>
<td>{{ row.From }}</td>
<td>{{ row.To }}</td>
<td>{{ row.Total }}</td>
<td>{{ row.Platform }}</td>
<td>{{ row.PlatformFees }}</td>
<td>{{ row.Fee }}</td>
<td>{{ row.Profit }}</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<td scope="row">Totaux</td>
<td></td>
<td></td>
<td></td>
<td>{{ total }}</td>
<td></td>
<td>{{ platformFees }}</td>
<td>{{ fee }}</td>
<td>{{ profit }}</td>
</tr>
<tr>
<td scope="row"></td>
<td></td>
<td></td>
<td>dont CB :</td>
<td>{{ cardTotal }}</td>
<td>Frais Booking :</td>
<td>{{ bookingFees }}</td>
<td></td>
<td></td>
</tr>
</tfoot>
</table>
</div>
</body>
</html>

View file

@ -1,12 +1,15 @@
package server
import (
"fmt"
"net/http"
"strconv"
"github.com/labstack/echo/v4"
"github.com/rjNemo/rentease/config"
"github.com/rjNemo/rentease/internal/booking"
"github.com/rjNemo/rentease/internal/pdf"
u "github.com/rjNemo/underscore"
)
func handleCreateInvoicePdf(bs *booking.Service, ps *pdf.PdfService, hc *config.Host) echo.HandlerFunc {
@ -26,3 +29,41 @@ func handleCreateInvoicePdf(bs *booking.Service, ps *pdf.PdfService, hc *config.
return c.Attachment("tmp.pdf", "tmp.pdf")
}
}
func handleCreateReportPdf(bs *booking.Service, ps *pdf.PdfService) echo.HandlerFunc {
return func(c echo.Context) error {
period := c.QueryParam("period")
if !u.Contains([]string{"month", "year"}, period) {
return &echo.HTTPError{
Code: http.StatusBadRequest,
Message: fmt.Sprintf("%q is not a valid period", period),
}
}
monthStr := c.QueryParam("month")
month, err := strconv.Atoi(monthStr)
if err != nil || month < 1 || month > 12 {
return &echo.HTTPError{
Code: http.StatusBadRequest,
Message: fmt.Sprintf("%q is not a valid month", month),
}
}
yearStr := c.QueryParam("year")
year, err := strconv.Atoi(yearStr)
if err != nil {
return &echo.HTTPError{
Code: http.StatusBadRequest,
Message: fmt.Sprintf("%q is not a valid year", year),
}
}
report := bs.BuildReport(period, month, year)
err = ps.BuildReport(report, month, year)
if err != nil {
return err
}
return c.Attachment("tmp.pdf", "tmp.pdf")
}
}

View file

@ -74,6 +74,7 @@ func handleComputeReport(bs *booking.Service, hc *config.Host) echo.HandlerFunc
Profit: strconv.FormatFloat(r.Profit, 'f', 2, 64),
CardTotal: strconv.FormatFloat(r.CardTotal, 'f', 2, 64),
BookingFees: strconv.FormatFloat(r.BookingFees, 'f', 2, 64),
PdfUrl: templ.URL(fmt.Sprintf("%s/pdf?period=%s&month=%d&year=%d", constants.RouteReports, period, month, year)),
Lines: u.Map(r.Lines, func(l *booking.Line) *views.ReportLine {
return &views.ReportLine{
Id: l.InvoiceNumber(hc),

View file

@ -10,4 +10,5 @@ func (s Server) MountHandlers() {
s.Router.GET("/bookings/pdf/:id", handleCreateInvoicePdf(s.bs, s.ps, s.hc))
s.Router.GET("/reports", handleReportsPage())
s.Router.GET("/reports/do", handleComputeReport(s.bs, s.hc))
s.Router.GET("/reports/pdf", handleCreateReportPdf(s.bs, s.ps))
}

View file

@ -23,7 +23,7 @@ func BaseLayout() templ.Component {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 1)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!doctype html><html lang=\"en\"><head><title>RentEase | Your Property Management System</title><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><meta name=\"description\" content=\"AI assistant to help you improve your management\"><link rel=\"icon\" href=\"/static/img/favicon.svg\"><link rel=\"stylesheet\" href=\"/static/css/pico.min.css\"><script src=\"/static/js/htmx.js\" defer></script></head><body hx-boost=\"true\"><nav class=\"container-fluid\"><ul><li><a href=\"/\"><b>🏨 RentEase </b></a></li></ul><ul><li><a href=\"/bookings\">Bookings</a></li><li><a href=\"/reports\">Reports</a></li><li><a href=\"/bookings/new\" role=\"button\">New Booking</a></li></ul></nav><main class=\"container\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@ -31,7 +31,7 @@ func BaseLayout() templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templ.WriteWatchModeString(templ_7745c5c3_Buffer, 2)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</main><footer class=\"container-fluid\">🏨 RentEase &copy 2024</footer></body></html>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}

View file

@ -7,6 +7,7 @@ type ReportViewModel struct {
PlatformFees string
Fee string
Profit string
PdfUrl templ.SafeURL
Lines []*ReportLine
}
@ -27,7 +28,7 @@ templ ReportSection(report *ReportViewModel) {
<div class="grid">
<h2>Your report </h2>
<div>
<button class="outline">Create PDF</button>
<a class="outline" role="button" href={ report.PdfUrl } target="_blank">Create PDF</a>
<a href="https://web.whatsapp.com/" target="_blank" rel="noreferrer noopener"><img src="/static/icons/whatsapp.png" width="20px" style="width: 2rem; margin: 0 1rem"/></a>
</div>
</div>

View file

@ -17,6 +17,7 @@ type ReportViewModel struct {
PlatformFees string
Fee string
Profit string
PdfUrl templ.SafeURL
Lines []*ReportLine
}
@ -46,7 +47,16 @@ func ReportSection(report *ReportViewModel) templ.Component {
templ_7745c5c3_Var1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"grid\"><h2>Your report </h2><div><button class=\"outline\">Create PDF</button> <a href=\"https://web.whatsapp.com/\" target=\"_blank\" rel=\"noreferrer noopener\"><img src=\"/static/icons/whatsapp.png\" width=\"20px\" style=\"width: 2rem; margin: 0 1rem\"></a></div></div><div class=\"overflow-auto\"><table class=\"striped\"><thead><tr><th scope=\"col\">ID</th><th scope=\"col\">Name</th><th scope=\"col\">From</th><th scope=\"col\">To</th><th scope=\"col\">Revenue (€)</th><th scope=\"col\">Platform</th><th scope=\"col\">Platform Fees (€)</th><th scope=\"col\">Fees (€)</th><th scope=\"col\">Profit (€)</th></tr></thead> <tbody>")
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"grid\"><h2>Your report </h2><div><a class=\"outline\" role=\"button\" href=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 templ.SafeURL = report.PdfUrl
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var2)))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" target=\"_blank\">Create PDF</a> <a href=\"https://web.whatsapp.com/\" target=\"_blank\" rel=\"noreferrer noopener\"><img src=\"/static/icons/whatsapp.png\" width=\"20px\" style=\"width: 2rem; margin: 0 1rem\"></a></div></div><div class=\"overflow-auto\"><table class=\"striped\"><thead><tr><th scope=\"col\">ID</th><th scope=\"col\">Name</th><th scope=\"col\">From</th><th scope=\"col\">To</th><th scope=\"col\">Revenue (€)</th><th scope=\"col\">Platform</th><th scope=\"col\">Platform Fees (€)</th><th scope=\"col\">Fees (€)</th><th scope=\"col\">Profit (€)</th></tr></thead> <tbody>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@ -55,8 +65,8 @@ func ReportSection(report *ReportViewModel) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 templ.SafeURL = row.Url
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var2)))
var templ_7745c5c3_Var3 templ.SafeURL = row.Url
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var3)))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@ -64,12 +74,12 @@ func ReportSection(report *ReportViewModel) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(row.Id)
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(row.Id)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 53, Col: 16}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 54, Col: 16}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@ -77,23 +87,10 @@ func ReportSection(report *ReportViewModel) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(row.CustomerName)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 56, Col: 28}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(row.From)
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(row.CustomerName)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 57, Col: 20}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 57, Col: 28}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
@ -104,9 +101,9 @@ func ReportSection(report *ReportViewModel) templ.Component {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(row.To)
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(row.From)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 58, Col: 18}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 58, Col: 20}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil {
@ -117,9 +114,9 @@ func ReportSection(report *ReportViewModel) templ.Component {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(row.Total)
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(row.To)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 59, Col: 21}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 59, Col: 18}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
if templ_7745c5c3_Err != nil {
@ -130,9 +127,9 @@ func ReportSection(report *ReportViewModel) templ.Component {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(row.Platform)
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(row.Total)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 60, Col: 24}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 60, Col: 21}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
if templ_7745c5c3_Err != nil {
@ -143,9 +140,9 @@ func ReportSection(report *ReportViewModel) templ.Component {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(row.PlatformFees)
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(row.Platform)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 61, Col: 28}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 61, Col: 24}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
if templ_7745c5c3_Err != nil {
@ -156,9 +153,9 @@ func ReportSection(report *ReportViewModel) templ.Component {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(row.Fee)
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(row.PlatformFees)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 62, Col: 19}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 62, Col: 28}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
if templ_7745c5c3_Err != nil {
@ -169,14 +166,27 @@ func ReportSection(report *ReportViewModel) templ.Component {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(row.Profit)
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(row.Fee)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 63, Col: 22}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 63, Col: 19}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var12 string
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(row.Profit)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 64, Col: 22}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td></tr>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
@ -186,12 +196,12 @@ func ReportSection(report *ReportViewModel) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var12 string
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(report.Total)
var templ_7745c5c3_Var13 string
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(report.Total)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 73, Col: 23}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 74, Col: 23}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@ -199,23 +209,10 @@ func ReportSection(report *ReportViewModel) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var13 string
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(report.PlatformFees)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 75, Col: 30}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var14 string
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(report.Fee)
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(report.PlatformFees)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 76, Col: 21}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 76, Col: 30}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
if templ_7745c5c3_Err != nil {
@ -226,24 +223,37 @@ func ReportSection(report *ReportViewModel) templ.Component {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var15 string
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(report.Profit)
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(report.Fee)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 77, Col: 24}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 77, Col: 21}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var16 string
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(report.Profit)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 78, Col: 24}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td></tr><tr><td scope=\"row\"></td><td></td><td></td><td>Card-only: </td><td>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var16 string
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(report.CardTotal)
var templ_7745c5c3_Var17 string
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(report.CardTotal)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 84, Col: 27}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 85, Col: 27}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@ -251,12 +261,12 @@ func ReportSection(report *ReportViewModel) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var17 string
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(report.BookingFees)
var templ_7745c5c3_Var18 string
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(report.BookingFees)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 86, Col: 29}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/views/report_section.templ`, Line: 87, Col: 29}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}