feat: better PDF

This commit is contained in:
2025-08-24 00:24:40 +02:00
parent 0267e6e578
commit 5b664234e9
18 changed files with 540 additions and 228 deletions

View File

@@ -1,43 +1,31 @@
package report
import (
"html/template"
"time"
"git.schreifuchs.ch/lou-taylor/accounting/issue"
"github.com/google/uuid"
"git.schreifuchs.ch/lou-taylor/accounting/model"
"git.schreifuchs.ch/lou-taylor/accounting/report/invoice"
)
func New(issues []issue.Issue, company, client Entity, rate float64) *Report {
return &Report{
type Report struct {
Date time.Time
Issues []issue.Issue
Invoice invoice.Invoice
Rate float64
Company model.Entity
Client model.Entity
}
func New(issues []issue.Issue, company, client model.Entity, rate float64) *Report {
r := &Report{
Date: time.Now(),
Issues: issues,
Rate: rate,
Company: company,
Client: client,
ID: uuid.NewString(),
}
}
r.Invoice = invoice.New(r.applyRate(r.Total()), r.Company, &r.Client)
type Report struct {
Date time.Time
Issues []issue.Issue
Style template.CSS
Rate float64
ID string
Company Entity
Client Entity
}
type Entity struct {
Name string
Address Address
Contact string
IBAN string
}
type Address struct {
Street string
Number string
ZIPCode string
Place string
Country string
return r
}