feat: better PDF
This commit is contained in:
17
main.go
17
main.go
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user