blob: 7d64f21aab8050bc51a33c8af90de905a8ff1682 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
#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;
int is_text;
};
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
|