diff --git a/cmd/pdfamount/main.go b/cmd/pdfamount/main.go index ca22636..6690caa 100644 --- a/cmd/pdfamount/main.go +++ b/cmd/pdfamount/main.go @@ -18,36 +18,52 @@ import ( onlyoffice "github.com/eslider/go-onlyoffice" ) -// amountLabels are the payable-amount labels in priority order: the first -// label present in a document wins. Within one label the last amount is taken, -// because totals usually come last. -// -// "gesamtsumme" is not in the original list but is the real label on Diashop -// invoices: "Gesamtsumme (inkl. Steuern)". -var amountLabels = []string{ - "zu zahlender betrag", - "rechnungsbetrag", - "rechnungsendbetrag", - "endbetrag", - "zahlbetrag", - "bruttobetrag", - "gesamtbetrag", - "gesamtsumme", - "betrag", - "total", - "summe", +// amountPat is the amount capture shared by every amount regex. +const amountPat = `([0-9]+(?:[.,][0-9]+)*)` + +// amountRE builds "