Jooglies Goodies für Joomla und VirtueMart

VirtueMart Invoice Pro

Professional Invoice Layout
Erweiterung VirtueMart Rechnung ProErweiterung VirtueMart Rechnung Pro
Joomla:
ab 3.9.x
VirtueMart:
ab 3.8.0
VM getestet:
bis 4.2.2
Price incl. VAT83,30 €
Price w/o VAT70,00 €
Tax amount 13,30 €

invoice.3.8.9.1.plugin.ERST_ENTPACKEN.zip

invoice.3.8.9.1.plugin.ERST_ENTPACKEN.zip
Installation
Description

VirtueMart Invoice Pro - Documentation

Overrides for VirtueMart invoice and delivery note.


Requirements for installation and configuration

What you need

  • FTP access and FTP client for transfer of the override files.
  • Access to Joomla as a Super User.

Installation

The ZIP archive contains four files in the invoice folder. They have to be copied to the folder invoice in your template. Common template override path:
/templates/My_Template/html/com_virtuemart/invoice/.
(My_Template refers to the name of your template in the Joomla template folder.)

The Plugin "Jooglies VirtueMart Overrides Controller" (plg_system_jglvmoverrides.3.8.x.y.zip) is installed via the Joomla extension manager.
Joomla Menu -> Extensions -> Manage -> Install

Before you proceed, please backup all the files in your invoice folder, if it already exists, otherwise create the directory.

Available files:
  • invoice.php
  • invoice_order.php
  • invoice_items.php
  • invoice_orderitems.php

Create language override in Joomla

For some language constants language overrides can be created to adjust VM Invoice Pro to your needs. Please create Joomla language overrides for "Site" and "Administrator" by using "Administrator - my language" and check the box "For Both Locations".

  • COM_VIRTUEMART_SHOP_ADDRESS_LINE="MyCompany, MyName, MyRoad, 12345 MyCity, MyState"
  • COM_VIRTUEMART_UID="Tax Number"
  • COM_VIRTUEMART_INVOICE_UID_MESSAGE="Some text that refers to my tax number"
  • COM_VIRTUEMART_INVOICE_NUMBER_CONNECTOR=" Nr. "
  • COM_VM_CUSTOMER_NR="Customer Id"
  • COM_VIRTUEMART_INVOICE_SPECIAL_TEXT="This is a standard message that every customer will see in the invoice."

If you want to change the name of the generated PDF for your invoice, add the following language constant: COM_VIRTUEMART_FILEPREFIX_INVOICE.
Zum Beispiel: COM_VIRTUEMART_FILEPREFIX_INVOICE="myinvoice_"

Settings

There are two ways to configure your layout settings. You can use the variables in the PHP source code of the overrides or you can use the plugin "Jooglies VirtueMart Override Controller.

Since invoice layouts are generally only configured once, you can change the settings in the layouts only. Please be aware the you have to set up language overrides for all needed language variables since the language files come with the plugin. In a normal installation you can use the plugin, it is light weight, saves you work and it is much easier to test and change settings.

Open Plugin "Jooglies VirtueMart Overrides Controller"

  • Open the Joomla plugin manager in Joomla Menu -> Extensions -> Plugins.
  • Search for "Jooglies".
  • Click "System - Jooglies VirtueMart Overrides Plugin" to open the settings.

Invoice setttings in second tab

The first settings refer to the shown columns in your invoice product list.
Choose No if you want to hide SKU, Status, Net Sum or Discount.

The setting for showing the tax column is still in the original Virtuemart configuration, tab "Checkout".

Some of the following settings are self explanatory and are not explained in detail.

  • Show delivery address in invoice. Yes/No. - Delivery address will be shown below the product list.
  • Show shop address in letter window - A language constant to show the vendor address above the customer address in a letter address window is shown: COM_VIRTUEMART_SHOP_ADDRESS_LINE.
  • The payment method can be shown in the calculation of the bill total price (originally shown in VM).
  • The payment method can be shown below the calculation of the bill total price. (If you want to keep the calculation table short if you do not charge a fee for any payment.)
  • If multiple VAT rates are used you can show the VAT separated by percentage. It is possible to switch this off if only one VAT is used.
  • If your customers have to provide a VAT ID or other tax number, the position can be changed to different places.
  • If your customers provide a VAT ID you can show a message that can be adjusted via Joomla language override for COM_VIRTUEMART_INVOICE_UID_MESSAGE. (e. g. Reverse Charge)

VAT ID

The template can show the VAT ID of a customer, if a VirtueMart Shopper Field uid is given.

If you use Reverse Charge you can show a message regarding this. With Joomla language constant COM_VIRTUEMART_INVOICE_UID_MESSAGE you can adjust this message according to the laws of your country.

We cannot answer any legal questions regarding your invoice. The content of the overrides or examples here are just hints about what the intended use is or examples from customers. For legal advise please ask a lawyer or whoever is allowed to give you legal advise on the subject of invoices in your country.

Configure the header of your invoice

The header of the VirtueMart email and the header of the invoice are identical. The header is configured in VirtueMart settings for the current vendor.

Open the vendor settings via VirtueMart Menu -> Shop -> Shop or via Joomla Menu -> VirtueMart -> Shop.

If you have not uploaded an image for the vendor, you can do that in the first tab now. JPG is a good choice, PNG might throw an error.

In section "Upload File" check the radio box "upload" and choose an image from your hard disk. Save the file to VirtueMart by clicking the "Save" button on top of the page.

If you have not filled in the address information in the third tab "shopper/vendor information" you need to do that before you can save the settings.

Second tab Invoices/Emails.
In section Invoice Head use the following settings to show a logo left and your address on the right.

  • Display Head: Yes
  • Line below header: Yes (recommended)
  • Include Vendor Image: Yes
  • Header cell height ratio: 1 (default)
  • Line color: #000000 (black, default)
  • Size of Vendor Image: 60mm (for about half of the invoice width, (20 cm letter width minus borders) devided by 2)

Example code for header

Example with automatically generated data from vendor address:

<table>
  <tr>
    <td style="width:30%;"> </td>
    <td style="width:70%;">
      <h1>{vm:vendorname}</h1>
      <p> </p>
      <p>{vm:vendoraddress}</p>
    </td>
  </tr>
</table>

Example with custom text (mostly preferred):

<table>
  <tr>
    <td style="width:30%;"> </td>
    <td style="width:70%;text-align: right;">
      <h1 style="text-align: right;">Flower Shop Happybloom</h1>
      <p>Rose Garden Av 12<br />
        12345 Roseville<br />
        Phone: 01234 567890</p>
    </td>
  </tr>
</table>

The first table cell TD with the width 30% generates some distance between the address and the image. The second table cell of width 70% contains the text. These percentages need to be adjusted depending on the logo and the width of the address. The sum should be 100%.

Example code for footer with 4 columns

<table style="width: 100%;">
<tbody>
  <tr><td colspan="4"> </td></tr>
  <tr>
    <td style="width: 25%;vertical-align: top">
      <p>CEO<br />
        FirstName, SurName</p>
    </td>
    <td style="width: 25%;;vertical-align: top">
      <p>Name of the bank<br />
        My bank code: 0000 0000 0000 0000 00<br />
        More bank details: XXXXXXXXXXX</p>
    </td>
    <td style="width: 25%;;vertical-align: top">
      <p>Some very important information.</p>
    </td>
    <td style="width: 25%;;vertical-align: top">
      <p>Legal info<br />
        Business ID<br />
        Tax ID Tax/0000/0000</p>
    </td>
  </tr>
  <tr><td colspan="4"> </td></tr>
  <tr>
    <td colspan="4">Page {vm:pagenum} of {vm:pagecount}</td>
  </tr>
</tbody>
</table>

Example code for footer with a full width column

<table style="width: 100%;">
<tbody>
  <tr><td> </td></tr>
  <tr>
    <td style="width: 100%;vertical-align: top">
      Company Name - Ewan McGregor - The Long Way Up - 12345 Californication
    </td>
  </tr>
  <tr><td> </td></tr>
  <tr>
    <td>Page {vm:pagenum} of {vm:pagecount}</td>
  </tr>
</tbody>
</table>

TCPDF is the PDF-Generator that generates the PDF files. TCPDF does not work with all CSS rules and does not accept external CSS files. The behaviour of TCPDF ist the reason why the HTML is not always make the heart of a perfectionist bloom.

Tuning for Coders

If you are not happy with the width of the columns in the generated invoice you have to lay hands on the PHP file invoice-items.php.

  • Open the file in a code editor like Notepad++ or Sublime Text.
  • In the upper area there are percentages for the table columns. Values are different depending on the number of shown columns (4 to 9). Recommendation: Use as less columns as possible.
  • Change the percentages of in the place of your chosen amount of columns (e. g. 6 colums, if status, net sum and discount are not shown).
  • Use 0% for the hidden columns, the sum of the other columns shoud add up to 100% if you want the table to fill the full width of the page.
  • Save the file after the changes and make sure it is saved as UTF-8 without BOM.

With this manual you should be able to generate a clean invoice PDF. This invoice layout is the result of many individually formatted invoices for customers. These customers had to pay a lot more for their invoices that fully integrated their corporate design. With these layout files it won't be possible to achieve every corporate design easily, but it is a reliable and professionally looking invoice for a very reasonable price if you compare it with a custom invoice that can easily go four figures.

We customize this layout for you

If you have the need to change anything that you won't be able to achieve, and let me say, it is not easy, there were about 300 working hours in the first layouts, then you won't be left alone. Please send a message via the Contact form to optain a quote.

Settings

invoice.php

  • $inv_jgl_header = VmConfig::get('inv_jgl_header', 0); // add own PHP header: 0 or 1 - if 1 jgl-header.php will be displayed
  • $inv_delivery_address_in_invoice = VmConfig::get('inv_delivery_address_in_invoice', 1); // Show delivery address in invoice: 0 or 1
  • $inv_customer_note_pos = VmConfig::get('inv_customer_note_pos', 'below_list'); // Position of customer message: below_address or below_list
  • $inv_show_payment_belowlist = VmConfig::get('inv_show_payment_belowlist', 1); // Show payment method below product list: 0 or 1
  • $inv_uid_pos = VmConfig::get('inv_uid_pos', 'below_address'); // Position of tax id: below_address or below_list
  • $inv_uid_message_pos = VmConfig::get('inv_uid_message_pos', 'below_address'); // Position of message for tax id: below_address or below_list
  • $inv_legal_info = VmConfig::get('inv_legal_info', 0); // Show legal information: 0 or 1, not implemented
  • $inv_special_text = VmConfig::get('inv_special_text', 1); // Show special text: 0 or 1

invoice-items.php

  • $col_sku = VmConfig::get('show_col_sku', 1); // Show column SKU: 0 or 1
  • $col_stt = VmConfig::get('show_col_status', 1); // Show column status: 0 or 1
  • $col_tax = VmConfig::get('show_tax', 1); // Show column VAT: 0 or 1
  • $col_dsc = VmConfig::get('show_col_discount', 1); // Show column discount: 0 or 1
  • $col_ttn = VmConfig::get('show_ttn', 1); // Show column net total: 0 or 1
  • $inv_show_payment_inlist = VmConfig::get('inv_show_payment_inlist', 1); // Show payment method in price calculation: 0 or 1
  • $inv_show_separate_tax = VmConfig::get('inv_show_separate_tax', 1); // Show separate tax: 0 or 1
  • $uid_pos = VmConfig::get('inv_uid_pos', 'below_address'); // Position of tax id: below_address or below_list
  • $uid_message_pos = VmConfig::get('inv_uid_message_pos', 'below_address'); // Position of message for tax id: below_address or below_list

Language constants

  • COM_VM_CUSTOMER_NR
  • COM_VIRTUEMART_INVOICE
  • COM_VIRTUEMART_DELIVERYNOTE
  • COM_VIRTUEMART_CONFIRMATION
  • COM_VM_CUSTOMER_NR
  • COM_VM_INVOICE_NR
  • COM_VIRTUEMART_DELIVERY_DATE
  • COM_VIRTUEMART_DELDATE_INV
  • COM_VIRTUEMART_ORDER_PRINT_PO_NUMBER
  • COM_VIRTUEMART_ORDER_PRINT_PO_DATE
  • COM_VIRTUEMART_ORDER_PRINT_SKU
  • COM_VIRTUEMART_PRODUCT_NAME_TITLE
  • COM_VIRTUEMART_ORDER_PRINT_PRODUCT_STATUS
  • COM_VIRTUEMART_ORDER_PRINT_PRICE
  • COM_VIRTUEMART_ORDER_PRINT_QTY
  • COM_VIRTUEMART_ORDER_PRINT_PRODUCT_TAX
  • COM_VIRTUEMART_ORDER_PRINT_SUBTOTAL_DISCOUNT_AMOUNT
  • COM_VIRTUEMART_ORDER_PRINT_PRODUCT_PRICE_TOTAL="Products Total"
  • COM_VIRTUEMART_ORDER_PRINT_TOTAL="Bill Total"
  • COM_VIRTUEMART_TOTAL_INCL_TAX="Separated VAT"
  • COM_VIRTUEMART_ORDER_PRINT_SUBTOTAL_DISCOUNT_AMOUNT
  • COM_VIRTUEMART_COUPON_DISCOUNT