Versions in this module Expand all Collapse all v0 v0.1.5 Oct 21, 2026 Changes in this version + const FitContain + const MoneyScale + const OrientationAuto + const OrientationLandscape + const OrientationPortrait + const PagesAll + const PagesFace + const PagesFirst + const SortCode + const SortDate + const SortInput + const SortName + var ErrNotInvoice = errors.New(...) + func SortItems(items []Item, key string) error + func WriteCSV(w io.Writer, batch *Batch) error + func WriteXLSX(w io.Writer, batch *Batch) error + type Batch struct + Items []Item + Skipped []Skipped + Summary Summary + func ExtractBatch(sources []Source, options BatchOptions) (*Batch, error) + func MergePDF(ctx context.Context, sources []Source, w io.Writer, options MergeOptions) (*Batch, error) + func (b *Batch) ActiveItems() []Item + type BatchOptions struct + Dedup bool + SkipBroken bool type Decimal + func NewDecimal(text string) (*Decimal, bool) + func Sum(values []*Decimal) *Decimal + func (d *Decimal) Abs() *Decimal + func (d *Decimal) Add(other *Decimal) *Decimal + func (d *Decimal) Cmp(other *Decimal) int + func (d *Decimal) Fixed(places int) string + func (d *Decimal) IsNegative() bool + func (d *Decimal) IsZero() bool + func (d *Decimal) Money() *Decimal + func (d *Decimal) Mul(other *Decimal) *Decimal + func (d *Decimal) Neg() *Decimal + func (d *Decimal) Round(places int) *Decimal + func (d *Decimal) Sign() int + func (d *Decimal) Sub(other *Decimal) *Decimal + type Group struct + Amount *Decimal + Count int + Key string + Name string + Red int + TaxAmount *Decimal + TotalAmount *Decimal type Invoice + func (i *Invoice) Check() []string + func (i *Invoice) ID() string + func (i *Invoice) InvoiceDate() (time.Time, error) + func (i *Invoice) IsRed() bool + type Item struct + DuplicateOf string + Error string + Invoice *Invoice + Issues []string + Name string + Red bool + func (i Item) OK() bool + type MergeLimits struct + MaxInputBytes int64 + MaxInvoices int + MaxTotalBytes int64 + type MergeOptions struct + CellBorder bool + Cover bool + CoverTitle string + Fit string + Limits MergeLimits + NUp int + NUpGap float64 + Orientation string + Pages string + Paper string + Sort string + type Skipped struct + Name string + Reason string + type Source struct + Input any + Name string + type Summary struct + Amount *Decimal + ByMonth []Group + BySeller []Group + ByType []Group + Count int + Red int + TaxAmount *Decimal + TotalAmount *Decimal + func Summarize(invoices []*Invoice) Summary + func (s Summary) String() string v0.1.4 Oct 4, 2026 v0.1.3 Sep 24, 2026 Changes in this version + var ErrNoAttachment = errors.New("未找到 OFD 发票结构化附件(Attachs 目录下的 XML)") + type Decimal struct + func (d *Decimal) MarshalJSON() ([]byte, error) + func (d *Decimal) String() string + type Detail struct + Amount *Decimal + Count *Decimal + Model string + Name string + Price *Decimal + TaxAmount *Decimal + TaxRate *Decimal + Unit string + type Invoice struct + Amount *Decimal + Attachment string + Buyer Party + Checksum string + Code string + Date string + Details []Detail + Drawer string + MachineNumber string + Number string + Payee string + Reviewer string + Seller Party + TaxAmount *Decimal + TaxControlCode string + Title string + TotalAmount *Decimal + TotalAmountString string + Type string + Warnings []string + func Extract(input any) (*Invoice, error) + type Party struct + Account string + Address string + Code string + Name string