From fb21e8efa65662dcb6c2cc7ed693dea91888c3a7 Mon Sep 17 00:00:00 2001 From: Anders Betts Date: Sun, 20 Sep 2026 15:08:58 +0200 Subject: invoice: render the document as PDF --- src/invoice.h | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 src/invoice.h (limited to 'src/invoice.h') diff --git a/src/invoice.h b/src/invoice.h new file mode 100644 index 0000000..c92677d --- /dev/null +++ b/src/invoice.h @@ -0,0 +1,66 @@ +#ifndef BOKF_INVOICE_H +#define BOKF_INVOICE_H + +#include +#include + +struct invoice_seller { + const char *name; + const char *address; + const char *postal_code; + const char *city; + const char *phone; + const char *email; + const char *org_nr; + const char *vat_nr; + const char *bankgiro; +}; + +struct invoice_customer { + const char *name; + const char *address; + const char *postal_code; + const char *city; + const char *vat_nr; +}; + +struct invoice_line { + const char *article_no; + const char *description; + int64_t quantity_milli; + const char *unit; + int64_t unit_price_ore; + int64_t amount_ore; + const char *note; + const char *vat_code; +}; + +struct invoice_doc { + struct invoice_seller seller; + struct invoice_customer customer; + int64_t number; + const char *ocr; + const char *invoice_date; + const char *due_date; + const char *delivery_date; + const char *our_ref; + const char *your_ref; + const char *notes; + int payment_days; + const struct invoice_line *lines; + size_t nlines; +}; + +struct invoice_totals { + int64_t net_ore; + int64_t vat_ore; + int64_t total_ore; + int64_t net_25, net_12, net_6, net_free; +}; + +void invoice_totals(const struct invoice_doc *d, struct invoice_totals *t); +int invoice_ocr_check(const char *number_digits); +int invoice_render_pdf(const struct invoice_doc *d, unsigned char **out, + size_t *len); + +#endif -- cgit v1.3