SwissQr Additional Information

Hi @invoiceninja

In the company settings, the QR IBAN and the BESR ID can be set. I am looking for a solution to my specific problem and wondered if this could only be solved by an additional attitude.

Problem:
I would like to use the Public Notes field for the detailed report. According to the standard behavior of InvoiceNinja, the file app/Helpers/SwissQr/SwissQrGenerator.php checks whether public notes are present. If they exist, they are shortened to 140 characters and displayed in the Additional Information field of the QrBill. If there are no public notes, the string “Invoice + $number” is returned in the field. The text I enter in the public notes is not suitable for the QrBill.

I tried this:
Created a custom text field (Multi Line) so that I can enter the content of public notes there. Unfortunately, the custom field does not support HTML/markdown nor are new lines respected. The Text becomes one long string.

Possible solution 1:
Insert an additional option in the company settings, where you can define whether the public notes should be used for the Additional Information field (Checkbox Toggle = On) or whether the field should be filled with “Invoice + $number” (Checkbox Toggle = Off).

Possible Solution 2:
A second option would be to insert another field (like Public Notes) called "Additional Information for QrBill " in the invoice and to hand it over to SwissQrGenerator instead of the public notes. Then only one line would have to be changed in the SwissQrGenerator.

// Optionally, add some human-readable information about what the bill is for.
$qrBill->setAdditionalInformation(
    QrBill\DataGroup\Element\AdditionalInformation::create(
        $this->invoice->additional_qr_info ? substr($this->invoice->additional_qr_info, 0, 139) : ctrans('texts.invoice_number_placeholder', ['invoice' => $this->invoice->number])
    )
);

What do you think? Is there any solution I have overlooked? Would that make sense to expand this?

Thank you and best regards

Hi,

@david any thoughts?

@checkitsedo

Are you advising that you are currently using the public notes for some other functionality and it is not appropriate for this section?

One option here would be to move that particular content into the Terms or Footer section which would free up the public notes for the QR Content?

@david

To make it clear what I mean, I’ll briefly show what I’m aiming at.

So far I have not used the Public Notes field at all. On the QrBill, the string “Invoice + $number” was then displayed in the Additional Information field (e.g. Invoice R-ABC-F224501).

For one customer, I now needed to include a detailed work report on the invoice. As written in InvoiceNinja’s instructions, I wanted to use the Public Notes field for this.

Free Source Available Invoicing, Expenses & Time-Tracking | Invoice Ninja

However, this results in the content of Public Notes being used on the QrBill in the Additional Information field instead of the above string:
Work Performed
-Adjustments to the network layout
-Updating of driver packages
-Firewall web filter rules revised
-Creation of a document template in PDF format
-…

This text is now shortened to 140 characters and inserted in the QrBill (incl. all formatting → bold, new line, …).

image

Further thoughts:
I see your point about the Public Notes field being freed up for QR content. To illustrate, here’s another case… Suppose I want to display the following text on the QrBill:
“Your order dated 01/11/2022 / Invoice $number.”

Thus, in each invoice I would have to enter this text manually in the Public Notes field, which on the one hand means extra work each time. In addition, there is a potential for mistakes here…

To be able to map as many situations as possible in InvoiceNinja, I would define the desired workflow as follows:

  1. Default = String Invoice + $number is used on the QrBill Additional information field.
  2. Custom = If I don’t want the default string, this can be entered manually on the invoice in a separate field
  3. Bonus effect = this allows to use the Public Notes field for additional text (it could be that there is a short text for the customer in the Public Notes field, but it is irrelevant for the QrBill or should not be displayed on the QrBill)

Of course, I can still try to insert my work report in the Terms or Footer field; but again, the question arises… In my understanding, the Terms are something different from a work report in terms of content. And I sometimes use the Footer field to refer to a special offer, which is also thematically different from my work report.

I hope this makes clear what I asked in the first post…

HI @checkitsedo

I’m hesitant to add additional fields. Are you able to use the Terms field for these additional notes for the client? They are located in the same section as the public notes:

@hillel do you have any thoughts on how to solve this use case?

Hi @david

Thx for the answer. I’ve tried this with no success…

In the Design I have the following code:

Tab Content

...
<div id="table-totals" cellspacing="0"></div>

<!-- Show public notes below table-totals -->
<div id="public-notes">
    $public_notes
</div>
...

Tab Includes

...
#public-notes {
    margin-top: 2cm;
}

/** Useful snippets, uncomment to enable. **/

/* Hide public notes --> hide in table-totals */
[data-ref="total_table-public_notes"] { display: none } */
...

The result

  1. Within the table-totals this is the field $terms (it contains some conditions)
  2. Below table-totals this is the field $public_notes

After moving the content from $public_notes to $terms
image

  • In the table-totals I can hide the $terms (CSS) and include it below
  • But now I don’t have the former $terms with the conditions

Yes, inserting a new field needs to be well thought out. I’m right there with you. Would my solution 1 from above be easier to implement?

This would solve my requirement as well:

  • One can use the $terms as before for the conditions.
  • One can use the $public_notes for the work report or any other text
  • With the switch in the settings one can define if on the qr invoice the public notes should be considered or not.
  • This solution would allows the previous behavior to continue

At this point I would like to say thanks for all your efforts: Invoiceninja is a fantastic project and the support is also great.

ping @hillel for your opinion please.

One option may be to check if any of the custom invoice fields are labeled ‘qr info’ in which case the content is used.

1 Like

Hi David,
I want to automate Invoice on Zapier from new record in Airtable.
I use AIRTABLE + create client in Invoice Ninja + Create Invoice.
I m blocked on Client ID.
Help me to automate invoices.

@USIG

we are happy to assist, are you able to create a new post? i’ll update your account to give you the correct permissions.

Thanks.
I’m waiting for the assistance.