Electronic Invoicing for Italian companies

Since 1st January 2019, the Italian government requires a specific standard for all the companies that sell goods online. All of them are required to issue an electronic invoice for each order and to provide the Italian Agenzia delle Entrate with all invoices in a specific format.

This plugin includes a section that has been specifically developed to give Italian companies an easy tool to generate this required file, together with the PDF file.

If your company is based in Italy and if you sell online, you will be required an .xml file for every order placed in your online shop.

This plugin will help you do that the right way and without much trouble.

Go to the plugin settings at YITH > PDF Invoice > Settings > Generating Documents and enable the option called Abilita la fatturazione elettronica (clienti italiani)

generazione documenti

Then, save the changes. After that, you’ll see a new tab next to the others in the plugin settings called Fatturazione elettronica. Here you can enter your company details, so as they will appear in the .xml file.

Impostazioni-fatturazione

Now, if you have configured all the other settings for the generation of automatic invoices, you will be able to see in every order a dedicated box called Stato XML

box xml

To generate the .xml file in the format required by the Italian Agenzia delle Entrate, just click on the button Crea and then on the button Visualizza in this box. This will let you donwload the .xml file that you can save and send to the Agenzia delle Entrate.

Download xml

Please, note: if you can’t see the box for the .xml file generation in the order details, make sure you haven’t activated the option for the preview (YITH > PDF Invoice > Preview Mode), as this lets you see a preview of the invoice, and so, the .xml generation cannot be enabled.

How to manage invoice generation

The invoice related to the order can be generated automatically or manually by administrator, depending on the configuration in the plugin settings dashboard in YIT Plugins -> Pdf Invoice.

Invoice generation modality

Manual generation

To generate an invoice manually, click on the specific button you’ll find in “WooCommerce -> Orders” or in the order detail page.

Orders page

Order detail page

Automatic generation

If you choose to generate invoices automatically, the document will be created at the moment of your choice, when:

  • order is created
  • order acquires the “processing” status
  • order acquires the “completed” status

Save invoice

Invoices are saved by default in the “Invoices” folder, which is to be found in the folder “wp-content -> uploads->ywpi-pdf-invoice” of your WordPress installation.
In case you wanted to set a customised path for saving, you can use [year], [month] e [day] as placeholders on “Invoice folder format” option, so that your saved invoices are sorted by year, month and day, according to the date it has been generated.

Invoice folder format

An example: if you write Invoices/[year]/[month], an invoice generated on “17/02/2016” will be save in the path “invoices/2016/02”.

Invoice folder

Dropbox

The plugin gives the administrator the possibility to automatically backup all generated PDF documents on Dropbox. Backup is immediate.

Following we analyse each individual step for saving process to work correctly.

Send documents to Dropbox

At first you have to access your account, or create one in case you do not have any.
Then, click on “Login to Dropbox” and the page where entering your data will be displayed.

Login to Dropbox

Now, you have to allow data save on your Dropbox. All documents generated will be saved in the folder “Apps” in your Dropbox archive. Save settings will follow the same rules as computer save, as explained here.

Dropbox Code

Now, you will be shown a code that has to be entered into the input box of the option “Enable Dropbox Backup” to complete synchronisation.

The code has to be entered within a minute since its generation. Contrary, it will not have any effect and the code will have to be generated anew.

Dropbox Code in plugin

In case the code is correctly validated, the Dropbox account synchronised with the plugin for invoice save will be shown.

Login executed

An example of Dropbox save.

Dropbox example

How to manage invoice numeration

Invoice numeration is sequential and begins from the value specified in “Next invoice number” field of “Documents” section of plugin settings dashboard.

Next invoice number

The value specified in the image automatically increases and shows next invoice number that will be generated.
If you change the value and save new settings, the first new invoice will no longer follow previous numeration, but it will begin from the new specified value.

You can add a prefix and/or a suffix to invoice number by changing invoice name format in“Invoice number format” field.

Prefix and suffix

Enable “Reset on 1st January” field if you want to rest numeration and to restart its cycle at the beginning of the new calendar year.

How to generate a packing slip document

To enable the generation of the packing slip document, check “Enable packing slip” option.

Enable packing slip

The document can only be generated manually by the site administrator, through the specific button in “WooCommerce -> Orders” or in the order detail page.

Orders page

Order detail page

Packing slip document

How to generate a pro-forma document

User can download the “Pro-Forma” document from “My Account -> Orders” page, only if “Enable pro-forma” field of settings dashboard is active.

Enable Pro-Forma

Download Pro-Forma

The pro forma invoice will be automatically generated by the system and it is not an official document. So, the button for creating a pro forma invoice will be visible only in front end for your customers in order to avoid any possible confusion with docuemtn managing for the administrator.

Following you find an example of pro forma invoice. It differs from a normal invoice for not having an invoice number and for the text “Pro forma Invoice” on top of the document.

Pro-Forma example

Actions on order documents

Each generated document can be viewed, removed and regenerated at any time. To apply an action on the invoice/packing slip/proforma, go to the order detail page and click on the specific button(s) on the right side.

order actions

How to generate a credit note

The credit notes can be generated when an order refund is granted.

In order to generate the credit notes enable the “Enable credit notes” entry in “PDF Invoice -> General”.

Enable credit note

Now you can generate a credit note for each applied refund directly from the order.

Order detail page

How to customize document filename format

All generated documents as; invoices, pro-forma, packing slip or credit notes, are saved with a default name provided by the plugin. However, it can be easily changed by going to the “Documents” section of settings dashboard.

Documents settings

Use the following data as placeholders to set the file format:

  • [number]: document invoice number
  • [prefix]: invoice number prefix, if any
  • [suffix]: invoice number prefix, if any
  • [year]: year of document generation, 4-figure format
  • [month]: month of document generation, 2-figure format
  • [order_number]: order number

Attention, the [number] placeholder is necessary for Invoice filename format and [order_number] is necessary for Pro-Forms invoice and Shipping List Document. If not specified, they will be queued to the corresponding text.

How to enable SSN/VAT fields

“SSN number” and “VAT Number” fields of settings dashboard allow to add the same fields right inside the form of shop checkout.

VAT/SSN Number

Checkout form

Values of VAT/SSN fields can be inserted in pdf documents generated by the plugin, as explained in this page of documentation.

How to customize template settings

If you want to change the pdf document content generated by the plugin, go to “Template” section of settings dashboard.

Template settings

If you need to optimize the PDF size generated by the plugin, you can disable “Unicode Chartset”. In this case, you must verify that your language “charset” doesn’t need “UNICODE” support. Otherwise, you must keep the option active to avoid a possible wrong coding of some pdf characters.

Unicode charset

In “Visible Section” field you can choose the sections to be shown in invoice documents and pro-forma and, separately, also in shipping documents.

Visible section

To show the total amount of the invoice, discount included, you can enable “Show order subtotal inclusive of order discount”.
Whereas the amount of discount can be shown by enabling “Show the order discount in the invoice summary amounts”.

Order total

The same applies to information related to products inserted in the order and shown in the table of the document. In “Visible columns” field you can choose to show or remove the following information for each product:

  • image
  • SKU
  • description
  • variation
  • quantity
  • price list
  • sale price
  • taxes

Visible columns

How to insert new user details in documents

Right inside documents, you can insert any of the information related to user.
Use the postmeta metakeys as placeholders within double curly brackets, for example {{_shipping_first_name}} to show the order shipping first name.

Customer details

Following the complete list of placeholders that you can use:

  • {{_customer_user}}
  • {{_order_key}}
  • {{_order_currency}}
  • {{_billing_first_name}}
  • {{_billing_last_name}}
  • {{_billing_company}}
  • {{_billing_address_1}}
  • {{_billing_address_2}}
  • {{_billing_city}}
  • {{_billing_state}}
  • {{_billing_postcode}}
  • {{_billing_country}}
  • {{_billing_email}}
  • {{_billing_phone}}
  • {{_shipping_first_name}}
  • {{_shipping_last_name}}
  • {{_shipping_company}}
  • {{_shipping_address_1}}
  • {{_shipping_address_2}}
  • {{_shipping_city}}
  • {{_shipping_state}}
  • {{_shipping_postcode}}
  • {{_shipping_country}}
  • {{_completed_date}}
  • {{_paid_date}}
  • {{_edit_lock}}
  • {{_edit_last}}
  • {{_cart_discount}}
  • {{_cart_discount_tax}}
  • {{_order_shipping}}
  • {{_order_shipping_tax}}
  • {{_order_tax}}
  • {{_order_total}}
  • {{_payment_method}}
  • {{_payment_method_title}}
  • {{_transaction_id}}
  • {{_customer_ip_address}}
  • {{_customer_user_agent}}
  • {{_created_via}}
  • {{_order_version}}
  • {{_prices_include_tax}}
  • {{_date_completed}}
  • {{_date_paid}}
  • {{_payment_tokens}}
  • {{_billing_address_index}}
  • {{_shipping_address_index}}
  • {{_recorded_sales}}
  • {{_recorded_coupon_usage_count}}{{_customer_user}}
  • {{_order_key}}
  • {{_order_currency}}
  • {{_billing_first_name}}
  • {{_billing_last_name}}
  • {{_billing_company}}
  • {{_billing_address_1}}
  • {{_billing_address_2}}
  • {{_billing_city}}
  • {{_billing_state}}
  • {{_billing_postcode}}
  • {{_billing_country}}
  • {{_billing_email}}
  • {{_billing_phone}}
  • {{_shipping_first_name}}
  • {{_shipping_last_name}}
  • {{_shipping_company}}
  • {{_shipping_address_1}}
  • {{_shipping_address_2}}
  • {{_shipping_city}}
  • {{_shipping_state}}
  • {{_shipping_postcode}}
  • {{_shipping_country}}
  • {{_completed_date}}
  • {{_paid_date}}
  • {{_edit_lock}}
  • {{_edit_last}}
  • {{_cart_discount}}
  • {{_cart_discount_tax}}
  • {{_order_shipping}}
  • {{_order_shipping_tax}}
  • {{_order_tax}}
  • {{_order_total}}
  • {{_payment_method}}
  • {{_payment_method_title}}
  • {{_transaction_id}}
  • {{_customer_ip_address}}
  • {{_customer_user_agent}}
  • {{_created_via}}
  • {{_order_version}}
  • {{_prices_include_tax}}
  • {{_date_completed}}
  • {{_date_paid}}
  • {{_payment_tokens}}
  • {{_billing_address_index}}
  • {{_shipping_address_index}}
  • {{_recorded_sales}}
  • {{_recorded_coupon_usage_count}}

How to overwrite documents templates

All the templates used by the plugin are available in the templates path templates -> yith-pdf-invoice.

To overwrite each document template is essential to repeat the specific files in your theme “woocommerce” folder (in case it is not included, you must create it).

Copy and paste files in your theme “woocommerce” folder, by including them in the “yith-pdf-invoice” folder.

Copy files

Please note. Plugin updates will be ignored in your site for the files you have overwritten.

If you made changes and you need to check them, enable “Preview mode” option.

Preview mode

When option is active, you can generate your invoices and check the final result of your changes without any increase of invoice counter.
If provided, the automatic generation system of invoices will be disabled and any generated invoice will be hidden to user.

How to use the plugin in combination with YITH WooCommerce Multi Vendor

YITH WooCommerce PDF Invoice and Shipping List can be integrated with the premium version of YITH WooCommerce Multi Vendor.
Integration provides for site administrator to enable the separeted management of invoices for vendors.

The option must be enabled in “Add-ons” section of Multi Vendor settings dashboard.

Enable PDF Invoice for vendors

When the plugin is used in combination with YITH WooCommerce Multi Vendor, the automatic generation of invoices will be disabled.

The only way to create a new document, invoice or shipping document, is manually through the specific buttons you find in “WooCommerce -> Orders” or in order detail page.

User side, documents can be downloaded in “My Account -> Orders”. Administrator and/or vendor related to the order must generate the document to allow user to have access to it.

A different document is provided for each vendor in relation to products they own.

Documents generated by vendors