Re: [GNC-dev] EPC QR code
Rainer Dorsch via gnucash-devel <[email protected]>
| Newsgroups | gmane.comp.gnome.apps.gnucash.devel |
|---|---|
| Organization | @home |
| Message-ID | <7057112.LoR1y8T2h8@h370> |
Am Sonntag, 16. Januar 2022, 19:07:21 CET schrieb Rainer Dorsch via gnucash- devel: > Am Sonntag, 16. Januar 2022, 18:07:31 CET schrieb john: > > > On Jan 16, 2022, at 8:37 AM, Rainer Dorsch via gnucash-devel > > > <[email protected]> wrote: > > > > > > Hello, > > > > > > many thanks for all the effort you put in gnucash. It is a really useful > > > and very stable tool and that for many years (even decades!) > > > > > > I recent times I often see QR codes on invoices. I quick search revealed > > > that they are standardized by the European Payments Council > > > > > > https://en.wikipedia.org/wiki/EPC_QR_code > > > > > > Is there any plan to support reading these QR codes with e.g. the laptop > > > camera and extract the data required for the SEPA credit transfer? > > > > There isn't, and adding the ability to access the camera would involve > > adding GStreamer as a dependency, not an easy task. > > Thanks for you quick reply. > > I dug somewhat more: > > There is a tool QtQR which e.g. produces > > BCD > 001 > 1 > SCT > SOLADES1TUB > Landkreis T羹bingen - Kreiskasse > DE43641500200000000048 > EUR693.00 > > > 5.1099.220039.0 > Geb羹hrenbescheid-Nr. 20220039 vom 12.01.2022 > > (the "Asian" letters should be the German umlaut ü, not sure what is going > wrong there) > > So calling an external tool would probably be sufficient and using the > response. > > > QtQR is using python3-qrtools under the hood, which are less then 300 lines > of code. > > python-qrtools has a > > def decode_webcam(self, callback=lambda s:None, device='/dev/video0'): > > function. > > Since I scan the invoices with the qrcode anyways using a pdf file as data > source would also be a good approach, though it seems with python3-qrtools > the webcam approach is more straight forward. > > I can do more experimenting with python3-qrtools if you think the approach > is viable and somebody is willing to do the gnucash integration: > - Add a button in the SEPA transfer dialog > - Call an external tool > - Process the data as defined by the EPC QR code > - Fill them in the fields of the SEPA transfer form I thought I do a quick test: rd@h370:~/tmp.nobackup$ cat test-ecr-qrcode.py import qrtools ecr=qrtools.QR() ecr.decode("Screenshot_20220116_183429.png") print(ecr.data_to_string().decode("utf-8")) rd@h370:~/tmp.nobackup$ python3 test-ecr-qrcode.py BCD 001 1 SCT SOLADES1TUB Landkreis T羹bingen - Kreiskasse DE43641500200000000048 EUR693.00 5.1099.220039.0 Geb羹hrenbescheid-Nr. 20220039 vom 12.01.2022 rd@h370:~/tmp.nobackup$ All data is there, the umlaut probably needs more investigation. I suspect some mapping or filter needs to be added to the Python code, since the QRCode accepts UTF-8 but a SEPA transfer supported character set is limited. Rainer -- Rainer Dorsch http://bokomoko.de/ _______________________________________________ gnucash-devel mailing list [email protected] https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Screenshot_20220116_183429.png
(image/png, 56.3 KB) - not displayed