diff --git a/cmd/invoiceintake/main.go b/cmd/invoiceintake/main.go index c17c598..5695976 100644 --- a/cmd/invoiceintake/main.go +++ b/cmd/invoiceintake/main.go @@ -1,5 +1,5 @@ // invoiceintake — turns the mails of ERPNext's Email Account -// "Eingangsrechnungen" (invoice@) into drafts: E Invoice Imports for +// "Eingangsrechnung" (invoice@) into drafts: E Invoice Imports for // e-invoices, draft Purchase Invoices with the original attached for other // PDFs, ToDos for everything it cannot place (internal/invoiceintake). It // never submits anything. erpsetup must have run first (custom field @@ -62,7 +62,7 @@ func main() { BaseURL: os.Getenv("ERP_BASE_URL"), APIKey: os.Getenv("ERP_API_KEY"), APISecret: os.Getenv("ERP_API_SECRET"), - EmailAccount: envOr("INTAKE_EMAIL_ACCOUNT", "Eingangsrechnungen"), + EmailAccount: envOr("INTAKE_EMAIL_ACCOUNT", "Eingangsrechnung"), Company: envOr("INTAKE_COMPANY", "Breakpilot GmbH"), Since: since, AssignTo: os.Getenv("INTAKE_ASSIGN_TO"), diff --git a/internal/erpsetup/intake.go b/internal/erpsetup/intake.go index ce20de7..be5fb05 100644 --- a/internal/erpsetup/intake.go +++ b/internal/erpsetup/intake.go @@ -1,7 +1,7 @@ package erpsetup // Incoming invoices (orca-infra #121, Collectives ERP/08): the mailbox -// invoice@ is read by ERPNext's Email Account "Eingangsrechnungen"; Strato +// invoice@ is read by ERPNext's Email Account "Eingangsrechnung"; Strato // forwards the originals to DATEV Unternehmen Online. cmd/invoiceintake turns // each received mail into a draft: an E Invoice Import for e-invoices, else a // draft Purchase Invoice with the original attached. What it needs here: diff --git a/internal/invoiceintake/intake.go b/internal/invoiceintake/intake.go index 76d5346..d4ce40b 100644 --- a/internal/invoiceintake/intake.go +++ b/internal/invoiceintake/intake.go @@ -1,5 +1,5 @@ // Package invoiceintake turns the mails of ERPNext's Email Account -// "Eingangsrechnungen" (invoice@) into drafts a person checks and books +// "Eingangsrechnung" (invoice@) into drafts a person checks and books // (orca-infra #121, Collectives ERP/08): // // - an e-invoice (XRechnung XML, ZUGFeRD/Factur-X PDF) becomes an E Invoice @@ -38,7 +38,7 @@ type Config struct { BaseURL string // https://erp.breakpilot.com APIKey string APISecret string - EmailAccount string // "Eingangsrechnungen" + EmailAccount string // "Eingangsrechnung" Company string // "Breakpilot GmbH" Since time.Time // mails received before are left alone AssignTo string // ERPNext user who gets the ToDos; empty: unassigned diff --git a/internal/invoiceintake/intake_test.go b/internal/invoiceintake/intake_test.go index 4ca85d7..d7b8893 100644 --- a/internal/invoiceintake/intake_test.go +++ b/internal/invoiceintake/intake_test.go @@ -38,7 +38,7 @@ func newFakeERP() *fakeERP { func (f *fakeERP) mail(name, sender string, attachments ...string) { f.docs["Communication"] = append(f.docs["Communication"], map[string]any{ "name": name, "sender": sender, "communication_date": "2026-10-20 09:13:00", "creation": "2026-10-20 09:13:01", - "email_account": "Eingangsrechnungen", "sent_or_received": "Received", "communication_medium": "Email", + "email_account": "Eingangsrechnung", "sent_or_received": "Received", "communication_medium": "Email", }) for i, a := range attachments { f.docs["File"] = append(f.docs["File"], map[string]any{ @@ -154,7 +154,7 @@ func setup(t *testing.T) (*fakeERP, *Intake) { f := newFakeERP() srv := httptest.NewServer(f) t.Cleanup(srv.Close) - in, err := New(Config{BaseURL: srv.URL + "/", APIKey: "k", APISecret: "s", EmailAccount: "Eingangsrechnungen", + in, err := New(Config{BaseURL: srv.URL + "/", APIKey: "k", APISecret: "s", EmailAccount: "Eingangsrechnung", Company: "Breakpilot GmbH", AssignTo: "finance@company.example", OwnDomains: []string{"breakpilot.com"}}) if err != nil { t.Fatal(err)