New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QR code in invoice #845
base: stable
Are you sure you want to change the base?
QR code in invoice #845
Conversation
That would be because you didn't tell the linker where to find the symbol. You do that by adding You also need to check for qrencode being available in the root CMakeLists.txt, update Readme.dependencies in the root directory and add module installation in gnucash-on-windows, gnucash-on-osx, and gnucash-on-flatpak. |
It seems to be in most important distributions: https://repology.org/project/qrencode/versions. |
bc67158
to
f1bbc5e
Compare
This requires |
Will it be: if (FOUND_QRENCODE)
set (CMAKE_C_FLAGS "-lqrencode ${CMAKE_C_FLAGS}")
endif () |
No, you add it to the list in the target's |
f1bbc5e
to
130b21d
Compare
This branch has the C glue code to call Missing:
|
44a2029
to
2313abe
Compare
@gjanssens this is now functional. |
This will become a nice addition to our invoice printing functionality.
There are two bits of required information that are currently not stored: IBAN and BIC. I agree they can be part of the book company info. The currency should be invoice currency. We don't need to store that as a company parameter. From the specification it seems to me the only free form fields in the QR template are the reference and information fields. All other fields have strictly defined content. Unless you are considering other formats which follow different specifications ? In that case we will probably want a templating system similar to the check printing one. GnuCash can provide a number of standard formats and allow the user to create custom ones. But I'd wait with that until the need arises. As for the technical side of this PR: A few hints:
As you can see, quite a few bits to change in order to make this an optional feature. If that's too much, the alternative is to only introduce this in master. I am totally fine with adding a new mandatory dependency there. Note also that regardless of your target branch you can only make this mandatory when our build systems for MacOS, Windows and Flatpak are updated to also install or build qrencode. |
And in addition our ci scripts need updates to install qrencode before building gnucash. If we go the optional route, I'd only install qrencode in a few of our build environments to check if test succeed both with or without qrencode. |
47c4442
to
1743d83
Compare
Ok yes two string options must be created. Note IBAN maximum 34 chars, BIC max 11 chars.
From my understanding it's reference or information. For reference invoice ID seems natural.
I'd suggest if (HAVE_QRENCODE)
target_link_libraries (qrencode)
add_library (qr-encode.c)
else ()
add_library (qr-encode-stub.c)
endif ()
For simplicity I'd vote to allow QR option in invoice.scm (otherwise saved-reports etc will complain), and if |
No, there are actually two supported reference types, structured or unstructured. And in addition you can have a free form information field. The structured reference follows the ISO 11649 format.
That's ok in principle. I assume you were using pseudocode here ?
Is it technically difficult to hide the option when qrcode is not available ? I don't mean make it non-existent, just hidden. The other option is to keep it around but disable it when qrencode is not found. That way it still exists but the user can't set it. A tooltip would then be helpful to explain why the option is disabled. The main difference between your and my approach is that in your case the error message only appears after the user has configured the report, which leads to frustration. If you can't set the option in the first place that saves the user a roundtrip to the options if it was set incorrectly. |
53dec16
to
ccba1ea
Compare
Have moved into
I can't figure out CMakeLists changes to load either |
d2a6610
to
bd85ca7
Compare
d6f9522
to
29bf4b0
Compare
29bf4b0
to
610831f
Compare
610831f
to
651e505
Compare
@gjanssens how about converting your tips from this PR into a wiki page Adding_Dependencies? |
How about a one-line wiki page: Adding DependenciesDon't. We already have too many dependencies and every added one makes GnuCash harder to build and more dependent on the whims of distribution packagers and in the case of single-contributor libraries like libqrencode the whims and survival of that one contributor. Note that it's been almost 10 months since the last commit to that repo. |
I hoped it would scare off in most cases. ;-) |
https://lists.gnucash.org/pipermail/gnucash-de/2022-February/012321.html: |
Here's one of the QR contents from the PDF. They also mandate precise layout containing the QR code.
|
I assume you are talking about They put the payment part below the invoice or on the next page. That is also common here in DE. The german form descriptions are in As feared the formats are very different. |
Not a problem in this branch. The format it's extensible by modifying code, or even maybe in the future via options. |
Perhaps the printing of the payment part is easier integrated in the cheque printing facility. Most german and also other european bank forms are based on an A6 landscape form. |
651e505
to
3690f15
Compare
What's the status on this PR. This is a fantastic feature |
bump |
The options parts need to be rewritten in C++. |
3690f15
to
06421a7
Compare
QRcode_encodeString 4.11 has changed something and this isn't producing valid QR data anymore. Anyway rebased onto master, and using c++options. If libqrencode is added into borrowed then I'll try debug again. |
14916e9
to
07225b3
Compare
this function converts string to QRcode, returns a SCM object containing version, width, qrdata
07225b3
to
80baf53
Compare
after
$sudo apt install qrencode
:#include <qrencode.h>
does not seem to work: