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.