hn.today

Falsehoods programmers believe about invoices

dev.cordhq.app9 points1 comments
Screenshot of Falsehoods programmers believe about invoices

Building invoicing for 12 countries forced Cord to discard nineteen common assumptions about how invoices work. Practical surprises include: invoices can be signed XMLs (Mexico’s CFDI) rather than legally binding PDFs; an invoice often only legally exists after a tax authority accepts it (Mexico, Argentina, Chile, Peru, Colombia, Brazil); countries can run multiple invoicing systems or classes (Brazil’s NF-e vs NFS-e, Argentina’s A/B/C); and required dates, customer identity rules, numbering ranges and uniqueness are set by authorities (Chile issues signed number ranges, numbers are unique per tax ID and series, and concurrent numbering needs leases). Money handling also varies: VAT may be calculated on totals not per-line (Chile), currencies have different minor units, jurisdictions layer taxes (Quebec, Spain, US local rates), and official exchange rates aren’t always available, so guessing is unacceptable.

Operationally Cord adapted with concrete engineering and legal rules: immutability via chained hashes and Postgres triggers for systems like Spain’s Verifactu, lease-backed sequences and unique indices to avoid duplicate numbers, never blind-retrying authority requests (query the authority instead), splitting batches to isolate rejected records, and tracking special cancellation and payment-reporting requirements (Argentina credit notes, Mexico cancellation windows, France’s payment-based VAT reporting). Cord now runs Mexico’s CFDI live, Spain’s Verifactu in beta, and other Latin integrations built but not yet live.

Read on dev.cordhq.app1 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Other

Abolish AI Manifesto

Abolish AI Manifesto

The Abolish AI manifesto advocates for the complete abolition of artificial intelligence, viewing it as a tool of societal control and oppression. It promotes a revolutionary, liberatory alternative aligned with other social justice movements, asserting that abolishing AI requires dismantling capitalism. (abolish-ai.net)

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.