Additional Text in invoice. How?

  • Posts: 9
  • Thank you received: 1
  • Hikashop Essential
2 days 9 hours ago #366531

-- url of the page with the problem -- : best4dive.de
-- HikaShop version -- : 5.1.5
-- Joomla version -- : 5.2.5
-- PHP version -- : 8.3
-- Browser(s) name and version -- : Firefox 135.0; Chrome 133.0.6943.99

Ich möchte auf dem Rechnungsformular einen zusätzlichen Text einfügen.
Wenn man ein Gewerbe als Kleinunternehmer betreibt, MUSS auf jeder Rechnung ein Hinweis auf §19 UstG enthalten sein. Im Hika Shop ist das aber nicht der Fall! Deshalb wollte ich einen solchen Text auf der Rechnung einfügen. Ich habe lange recherchiert und mir im Forum auch alle möglichen Posts durchgelesen aber ich werde einfach nicht schlau als den ganzen Aussagen.
Auch in der Dokumentation zu Hika-Shop gibt es keine entsprechende Anleitung dazu. Alle Anleitungen und Beschreibungen enden immer genau da, wo es interessant wird.
Ich habe z.B. ein Zusatzfeld als Textfeld angelegt, welches die entsprechende Klausel enthält (Tabelle "product", Feldtyp "Textbereich"). Im Bereich "Anzeige" lässt sich dann ja anscheinend einstellen, wo das Feld angezeigt werden soll, u.a. auch bei "Rechnung". Diese Einstellung habe ich auf "Ja" gesetzt. Jetzt sollte der Text nach meinem Verständnis auf der Rechnung erscheinen. Tut er aber nicht. Außerdem stellt sich mir auch die Frage, an welcher Stelle auf einer Rechnung das passieren soll.
In anderen Anleitungen wird auch beschrieben, dass man unter [Dashboard] - [Anzeige] - [Ansichten] ja die php-Datei ändern könnte, aber welche von den 145 aufgelisteten und was genau soll man darin ändern/ergänzen?

Leider kann ich bis zur Lösung des Problems nicht mit meinem Shop 'live' gehen. Ich möchte nicht in eine Abmahnfalle geraten, weil eine Software nicht in der Lage ist, gesetzliche Vorgaben zu erfüllen.

Ich bin doch sicherlich nicht der erste, der ein Rechnungsformular anpassen möchte. Gibt es denn nicht eine vernünftige und ausführliche Beschreibung zu diesem Thema?


I would like to add an additional text to the invoice form.
If you run a business as a small business, you MUST include a reference to §19 UstG on every invoice. However, this is not the case in the Hika Shop! That's why I wanted to insert such a text on the invoice. I've done a lot of research and read through all kinds of posts in the forum, but I just can't make sense of all the statements.
There are also no corresponding instructions in the Hika-Shop documentation. All instructions and descriptions always end exactly where it gets interesting.
For example, I have created an additional field as a text field, which contains the corresponding clause (table “product”, field type “text area”). In the “Display” area, you can then apparently set where the field should be displayed, including for “Invoice”. I have set this setting to “Yes”. As I understand it, the text should now appear on the invoice. But it does not. I also have the question of where on an invoice this should happen.
In other instructions it is also described that you could change the php file under [Dashboard] - [Display] - [Views], but which of the 145 listed and what exactly should you change/add in it?

Unfortunately, I cannot go live with my store until the problem is solved. I don't want to fall into a warning trap because a software is not able to fulfill legal requirements.

Surely I'm not the first person to want to customize an invoice form. Is there not a reasonable and detailed description of this topic?

Please Log in or Create an account to join the conversation.

  • Posts: 83568
  • Thank you received: 13522
  • MODERATOR
2 days 6 hours ago #366534

Hi,

At the beginning of our documentation page on custom fields we explain the uses of the different "tables" of custom fields:
www.hikashop.com/support/documentation/4...orm.html#description
There, you can read this for custom fields of the table "product":

With the product custom fields (both essential and business edition only), you will be able to personalize the information for your products. Your potential customers will be able to see those on the product page. Also, with the filtering module, which will be available in a later release, your customers will be able to filter your products using filters based on those custom fields.

So, the goal of these custom fields, is to add extra information on the product details page on the frontend, which can be different for each product. Supposing you do this, and you get to see on the product details page the custom field value entered in the custom field of a product in the backend, then activating the "invoice" display setting will add an extra column to the products listing of the invoice, with the value from the custom field for that product if it is part of the products purchased for the order of the invoice.

If your goal is to add a generic text to the invoices (which is the same for all of them), then I don't think a custom field is appropriate, and a product custom field even less.

In your case, I think the best is to edit the order / invoice view (for your backend template), and the order / show view (for your frontend template), via the menu Display>Views of HikaShop. There, near the end, you can directly add your text.
For example, just after the last
</table>
of these views, you could add the line:
<h3>Gemäß § 19 UStG wird keine Umsatzsteuer berechnet.</h3>
You can read more about view files edition here:
www.hikashop.com/support/documentation/1...-display.html#layout

The following user(s) said Thank You: petloc

Please Log in or Create an account to join the conversation.

  • Posts: 9
  • Thank you received: 1
  • Hikashop Essential
2 days 4 hours ago #366536

Hi Nicolas,
thank you for your quick reply.
It worked fine.
Unfortunately, I cannot write a ‘normal’ reply with an attachment. I always get an error message:
"Kunena Internal Error..."

Please Log in or Create an account to join the conversation.

  • Posts: 9
  • Thank you received: 1
  • Hikashop Essential
2 days 4 hours ago #366537

Hi Nicolas,
(another attempt)
I already suspected that a custom-field could not be the right solution, but that was the only possibility I could associate with a calculation.
The invoice.php worked. However, I don't find it very convenient to have to make changes in a PHP file for such a simple thing. At least not for a ‘normal’ user. But well, it worked, that's the most important thing.

But now I have another question:
The prices are not displayed correctly on my invoice forms. Even with relatively small amounts, the currency symbol is written in the next line. That's a bit unsightly. See the attached PDF.
Is it possible to change e.g. the column widths so that there is no line break in the prices? Or can the font size for the invoice form be changed globally?

Greetings from Augsburg

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 83568
  • Thank you received: 13522
  • MODERATOR
2 days 1 hour ago #366539

Hi,

In the same view file where you added the text, you can see the line:

<th class="title" width="60%" colspan="2">
This basically says that the column with the image and the name of the product can take up to 60% of the width. Change it to 50% and it will leave more space for the other columns, preventing the browser from forcing the prices on two rows.

Another, simpler option is to edit the euro currency in the System>Currencies menu, and turn off the "Symbol and positive value space separation" and "Symbol and negative value space separation" setting. That way, you won't have a space between the price and the currency symbol, preventing the browser from separating them on two rows when not enough space is available. This will be effective everywhere on your website, so it's a great way to prevent this.

Please Log in or Create an account to join the conversation.

  • Posts: 9
  • Thank you received: 1
  • Hikashop Essential
1 day 13 hours ago #366545

nicolas wrote:
In the same view file where you added the text, you can see the line:

<th class="title" width="60%" colspan="2">


I had already tried that. The result is that the product description is narrower and the “Unit price” column is moved to the left. However, the columns for “Quantity” and “Price” remain as before. This did not solve the problem (see invoice_title_width_50.jpg).
You do not have permissions to access this page.


So I changed the columns for "Unit price", "Quantity" and "Price" as follows:
<th class="title" width="55%" colspan="2">
...
<th class="hikashop_order_item_unit_price_title title" width="17%"><?php
<th class="hikashop_order_item_quantity_title title" width="13%"><?php
<th class="hikashop_order_item_total_price_title title" width="15%"><?php

Now the invoice looks like this:
You do not have permissions to access this page.


I will also try your suggestion to remove the blank space in the "Currencies settings"

Please Log in or Create an account to join the conversation.

  • Posts: 9
  • Thank you received: 1
  • Hikashop Essential
1 day 13 hours ago #366546

Here are the attachments

You do not have permissions to access this page ????.

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 83568
  • Thank you received: 13522
  • MODERATOR
1 day 9 hours ago #366549

Hi,

Yes, forcing the width of all the columns is indeed better.

But yes, look into the currency settings. Changing a setting is always better than having view overrides for long term maintainability.

Please Log in or Create an account to join the conversation.

  • Posts: 9
  • Thank you received: 1
  • Hikashop Essential
1 day 9 hours ago #366552

nicolas wrote: Hi,

But yes, look into the currency settings. Changing a setting is always better than having view overrides for long term maintainability.


That's my opinion too.

Thank you for your quick support.:)

Please Log in or Create an account to join the conversation.

  • Posts: 9
  • Thank you received: 1
  • Hikashop Essential
1 day 5 hours ago #366557

Hi Nicolas,
I know I'm getting annoying, but thanks to your help, I was able to customize the invoice form to my liking.
Nbw I just have one last small question. The date on the invoice appears in the format YYYY-MM-DD (e.g. 2025-03-15), but should appear in the format DD.MM.YYYY (e.g. 15.03.2025). In invoice.php, the date is generated in the form

echo JText::_('DATE').': '.hikashop_getDate($this->element->order_invoice_created,'%d %B %Y');
echo JText::_('DATE').': '.hikashop_getDate($this->element->order_created,'%d %B %Y');

And %d %B %Y should be actually how I would like it to appear, but i don't know, what the function .hikashop_getDate() does exactly. Can this be changed on the invoice (in involic.php)?

Please Log in or Create an account to join the conversation.

  • Posts: 83568
  • Thank you received: 13522
  • MODERATOR
1 day 1 hour ago #366560

Hi,

The format of the dates in HikaShop is controlled by two translation keys, which you can override to change the format:
www.hikashop.com/forum/product-category-...ing-date-format.html
I would recommend doing a translation override instead of changing the view file. It will be easier to maintain in the long run.

Please Log in or Create an account to join the conversation.

  • Posts: 9
  • Thank you received: 1
  • Hikashop Essential
15 hours 12 minutes ago #366565

Hi Nicolas,

thanks again for your super quick reply (when do you actually sleep?).

Now everything is working the way I want it to :) . My store ‘goes live’ today.

Thank you very much for your support.

The following user(s) said Thank You: nicolas

Please Log in or Create an account to join the conversation.

Time to create page: 0.092 seconds
Powered by Kunena Forum