Skip to content

Fresh-Advance/Invoice

Repository files navigation

PDF Invoice module for OXID eShop

Development Latest Version PHP Version

Quality Gate Status Coverage Technical Debt

Features

  • Adjustable invoice pages margins
  • Adjustable invoice pages header and footer (images are possible in inlined CSS)
  • Invoice numbering automation (uses the order's oxbillnr field)
  • Several fields are adjustable before invoice generation:
    • Invoice number template (or number itself, if number automation is not used)
    • Invoice date (with configurable format for automatic calculation)
    • Invoice signer person
  • PDF Invoice file generated in shop Default language
    • Currently we have DE, EN and LT translations available. Feel free to add yours.
  • PDF Invoice can be automatically generated and attached to order confirmation email
    • Invoice filename configurable through settings
  • Total sum shown in words in the invoice.
  • Only Twig shop installations supported
  • Tested with:
    • Shop 7.0 - PHP 8.0, 8.1, MySQL 5.7 and 8.0
    • Shop 7.1 - PHP 8.1, 8.2, MySQL 5.7 and 8.0
    • Shop 7.2 - PHP 8.2, 8.3, MySQL 5.7 and 8.0

Compatibility

  • Branch b-7.0.x is compatible with OXID Shop compilation 7.0.0-rc.2 and up

What to expect in next versions

  • Possibility to automatically generate and send the invoice with order confirmation email
  • Show Vat for every product in list
  • The Credit note issuing functionality
  • Possibility to send generated invoice or credit note by email with button click.
  • Other improvements? (feel free to ask in Issues section for possible additional functions)

Installation

Module is available on packagist and installable via composer

composer require fresh-advance/invoice

Overwriting the template

For customizing the template, start from creating the template extension in your module views/twig/extensions/modules/fa_invoice/invoice/body.html.twig with example content:

{% extends '@fa_invoice/invoice/body.html.twig' %}

{% block fa_invoice_invoice_body_order_number %}
    <div id="number">example overwrite</div>
{% endblock %}

Next, check the original template, and overwrite the blocks you need.

Troubles during overwrite?

If overwrite doesnt work: first, clear the cache; second, might be the issue with module loading order. If so, create the file var/configuration/shops/1/template_extension_chain.yaml with content:

'@fa_invoice/invoice/body.html.twig':
  - oe_moduletemplate(please put your module id instead of the module template example)

More information you might need for the template

The order variable in the template is the Order model object, so you can access all its fields and methods.

Some examples you might need for achieving the desired result:

  • Customer number: {{ order.getOrderUser().getFieldData('oxcustnr') }}
  • Payment method: {{ order.getPaymentType().oxpayments__oxdesc.value }}
  • Order net sum: {{ order.getOrderNetSum() }}

License

Please make sure you checked the License before using the module. License subscription can be bought on MB Arbatos Klubas website