feat: cli app
This commit is contained in:
@@ -10,7 +10,7 @@ import (
|
||||
"git.schreifuchs.ch/lou-taylor/accounting/pkg/invoice/report"
|
||||
)
|
||||
|
||||
func (s *Service) Generate(creditor, deptor model.Entity, mindur time.Duration, rate float64, repos []Repo) (document io.ReadCloser, r *report.Report, err error) {
|
||||
func (s *Service) Generate(creditor model.Entity, deptor *model.Entity, mindur time.Duration, rate float64, repos []Repo) (document io.ReadCloser, r *report.Report, err error) {
|
||||
var is []*gitea.Issue
|
||||
for _, repo := range repos {
|
||||
iss, _, err := s.gitea.ListRepoIssues(
|
||||
|
||||
@@ -14,10 +14,10 @@ type Report struct {
|
||||
Invoice qrbill.Invoice
|
||||
Rate float64
|
||||
Company model.Entity
|
||||
Client model.Entity
|
||||
Client *model.Entity
|
||||
}
|
||||
|
||||
func New(issues []issue.Issue, company, client model.Entity, rate float64) *Report {
|
||||
func New(issues []issue.Issue, company model.Entity, client *model.Entity, rate float64) *Report {
|
||||
r := &Report{
|
||||
Date: time.Now(),
|
||||
Issues: issues,
|
||||
@@ -25,7 +25,7 @@ func New(issues []issue.Issue, company, client model.Entity, rate float64) *Repo
|
||||
Company: company,
|
||||
Client: client,
|
||||
}
|
||||
r.Invoice = qrbill.New(r.applyRate(r.Total()), r.Company, &r.Client)
|
||||
r.Invoice = qrbill.New(r.applyRate(r.Total()), r.Company, r.Client)
|
||||
|
||||
return r
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user