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

17
main.go
View File

@@ -7,6 +7,7 @@ import (
"code.gitea.io/sdk/gitea"
"git.schreifuchs.ch/lou-taylor/accounting/issue"
"git.schreifuchs.ch/lou-taylor/accounting/model"
"git.schreifuchs.ch/lou-taylor/accounting/pdf"
"git.schreifuchs.ch/lou-taylor/accounting/report"
)
@@ -57,10 +58,10 @@ func main() {
issues := issue.FromGiteas(is, time.Minute*15)
r := report.New(
issues,
report.Entity{
model.Entity{
Name: "schreifuchs.ch",
IBAN: "CH06 0079 0042 5877 0443 7",
Address: report.Address{
Address: model.Address{
Street: "Kilchbergerweg",
Number: "1",
ZIPCode: "3052",
@@ -69,9 +70,9 @@ func main() {
},
Contact: "Niklas Breitenstein",
},
report.Entity{
model.Entity{
Name: "Lou Taylor",
Address: report.Address{
Address: model.Address{
Street: "Alpenstrasse",
Number: "22",
ZIPCode: "4950",
@@ -84,6 +85,14 @@ func main() {
)
html := r.ToHTML()
file, err := os.Create("index.html")
if err != nil {
panic(err)
}
defer file.Close()
file.Write([]byte(html))
// fmt.Print(html)
pdfs, err := pdf.New("http://localhost:3030")
if err != nil {