fix(invoiceintake): ERPNext's email account is named Eingangsrechnung
ci / shared (pull_request) Successful in 15s
ci / test (pull_request) Successful in 25m36s
ci / image (pull_request) Skipped

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Sharang ParnerkarandClaude Opus 5.5 committed 2026-10-20 09:49:36 +02:00
1 parent 433baf3740
commit f20957c858
4 files changed
+7 -7

No files matched your search

+2 -2
View File
@@ -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"),
+1 -1
View File
@@ -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:
+2 -2
View File
@@ -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
+2 -2
View File
@@ -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)