]> pere.pagekite.me Git - homepage.git/blob - blog/data/2013-02-12-qr-invoice.txt
Generated.
[homepage.git] / blog / data / 2013-02-12-qr-invoice.txt
1 Title: "Electronic" paper invoices - using vCard in a QR code
2 Tags: english, standard
3 Date: 2013-02-12 10:30
4
5 <p>Here in Norway, electronic invoices are spreading, and the
6 <a href="http://www.anskaffelser.no/e-handel/faktura">solution promoted
7 by the Norwegian government</a> require that invoices are sent through
8 one of the approved facilitators, and it is not possible to send
9 electronic invoices without an agreement with one of these
10 facilitators. This seem like a needless limitation to be able to
11 transfer invoice information between buyers and sellers. My preferred
12 solution would be to just transfer the invoice information directly
13 between seller and buyer, for example using SMTP, or some HTTP based
14 protocol like REST or SOAP. But this might also be overkill, as the
15 "electronic" information can be transferred using paper invoices too,
16 using a simple bar code. My bar code encoding of choice would be QR
17 codes, as this encoding can be read by any smart phone out there. The
18 content of the code could be anything, but I would go with
19 <a href="http://en.wikipedia.org/wiki/VCard">the vCard format</a>, as
20 it too is supported by a lot of computer equipment these days.</p>
21
22 <p>The vCard format support extentions, and the invoice specific
23 information can be included using such extentions. For example an
24 invoice from SLX Debian Labs (picked because we
25 <a href="http://www.linuxiskolen.no/slxdebianlabs/donations.html">ask
26 for donations to the Debian Edu project</a> and thus have bank account
27 information publicly available) for NOK 1000.00 could have these extra
28 fields:</p>
29
30 <p><pre>
31 X-INVOICE-NUMBER:1
32 X-INVOICE-AMOUNT:NOK1000.00
33 X-INVOICE-KID:123412341234
34 X-INVOICE-MSG:Donation to Debian Edu
35 X-BANK-ACCOUNT-NUMBER:16040884339
36 X-BANK-IBAN-NUMBER:NO8516040884339
37 X-BANK-SWIFT-NUMBER:DNBANOKKXXX
38 </pre></p>
39
40 <p>The X-BANK-ACCOUNT-NUMBER field was proposed in a stackoverflow
41 answer regarding
42 <a href="http://stackoverflow.com/questions/10045664/storing-bank-account-in-vcard-file">how
43 to put bank account information into a vCard</a>. For payments in
44 Norway, either X-INVOICE-KID (payment ID) or X-INVOICE-MSG could be
45 used to pass on information to the seller when paying the invoice.</p>
46
47 <p>The complete vCard could look like this:</p>
48
49 <p><pre>
50 BEGIN:VCARD
51 VERSION:2.1
52 ORG:SLX Debian Labs Foundation
53 ADR;WORK:;;Gunnar Schjelderups vei 29D;OSLO;;0485;Norway
54 URL;WORK:http://www.linuxiskolen.no/slxdebianlabs/
55 EMAIL;PREF;INTERNET:sdl-styret@rt.nuug.no
56 REV:20130212T095000Z
57 X-INVOICE-NUMBER:1
58 X-INVOICE-AMOUNT:NOK1000.00
59 X-INVOICE-MSG:Donation to Debian Edu
60 X-BANK-ACCOUNT-NUMBER:16040884339
61 X-BANK-IBAN-NUMBER:NO8516040884339
62 X-BANK-SWIFT-NUMBER:DNBANOKKXXX
63 END:VCARD
64 </pre></p>
65
66 <p>The resulting QR code created using
67 <a href="http://fukuchi.org/works/qrencode/">qrencode</a> would look
68 like this, and should be readable (and thus checkable) by any smart
69 phone, or for example the <a href="http://zbar.sourceforge.net/">zbar
70 bar code reader</a> and feed right into the approval and accounting
71 system.</p>
72
73 <p><img src="http://people.skolelinux.org/pere/blog/images/2013-02-12-qr-invoice.png"></p>
74
75 <p>The extension fields will most likely not show up in any normal
76 vCard reader, so those parts would have to go directly into a system
77 handling invoices. I am a bit unsure how vCards without name parts
78 are handled, but a simple test indicate that this work just fine.</p>
79
80 <p><strong>Update 2013-02-12 11:30</strong>: Added KID to the proposal
81 based on feedback from Sturle Sunde.</p>