diff options
Diffstat (limited to 'src/invoice.h')
| -rw-r--r-- | src/invoice.h | 66 |
1 files changed, 66 insertions, 0 deletions
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 <stddef.h> +#include <stdint.h> + +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 |
