Smaoui CII Electronic Invoicing

Plugin Banner

Smaoui CII Electronic Invoicing

by novabiz

Download
Description

Built for French e-invoicing (facturation électronique). For each WooCommerce order, the plugin produces two files:

  • an XML file in CII (Cross Industry Invoice, EN 16931) format, the structured format used for business-to-business electronic invoicing;
  • a printable PDF with the same data, meant for human reading.

The XML file follows the French core specification (AFNOR XP Z12-012 rules):

  • invoicing framework code (BT-23);
  • the three mandatory French invoice notes: recovery costs (PMT), late payment penalties (PMD) and early payment discount (AAB);
  • seller SIREN under scheme 0002, and the seller VAT identifier;
  • seller and buyer electronic addresses (scheme 0225 for companies, EM for individuals);
  • an IBAN on the invoice when a bank transfer is used;
  • amounts, VAT rates and dates formatted for French readers (1 234,56 €), while the XML keeps the decimal point required by the standard;
  • your logo, chosen from the media library, at the top right of the PDF;
  • the mandatory French notes (PMT, PMD, AAB) printed on the PDF, not only present in the XML.

Two optional fields can be shown at checkout to collect a business customer’s SIREN or SIRET and VAT number. Both are checked on the spot: the SIREN and SIRET check digits are verified, and a French VAT number has its key recomputed. A wrong digit is caught before the order is placed, not months later.

What the plugin does: it prepares, produces and stores the invoice files next to the order.

What the plugin does not do: it does not connect to any dematerialisation platform and it does not transmit invoices. Issuing and transmitting an electronic invoice is the responsibility of the issuing company, which must use an approved platform. This plugin is a technical tool: it is neither legal advice nor a guarantee of compliance.

  1. Install and activate the plugin.
  2. Open Settings Electronic invoicing and fill in your company name, SIREN, VAT number, address and IBAN.
  3. Check the pre-filled mandatory notes and adjust them if needed.
  4. Choose your invoicing framework code and your first invoice number.
  5. Decide whether to ask business customers for their SIREN and VAT number at checkout (Settings – Electronic invoicing – Business customer).
  6. Place a test order: the files are generated as soon as the order moves to “processing” or “completed”.

Files can be downloaded from the order screen.

  1. The settings screen: your company details, your logo, the invoicing framework code and the mandatory French notes.

    The settings screen: your company details, your logo, the invoicing framework code and the mandatory French notes.

  2. An order: the SIREN and VAT number of a business customer, the invoice number, and the XML and PDF downloads.

    An order: the SIREN and VAT number of a business customer, the invoice number, and the XML and PDF downloads.

  3. The two optional fields at checkout, asking a business customer for their SIREN and VAT number.

    The two optional fields at checkout, asking a business customer for their SIREN and VAT number.

  4. The Electronic invoices screen: every invoice with its number, date, order, customer, amount, and the CII and PDF downloads, with search and pagination.

    The Electronic invoices screen: every invoice with its number, date, order, customer, amount, and the CII and PDF downloads, with search and pagination.

  5. Plugin Check run on this plugin.

    Plugin Check run on this plugin.

Where are the files stored?

In the wp-content/uploads/smaoui-invoices/ folder, protected by an .htaccess file and an index.php file. They are served only to users who can manage orders.

Can I add my logo?

Yes. Settings Electronic invoicing Logo lets you pick an image from the media library. A horizontal logo on a light background gives the best result.

What happens with a very long order?

The PDF is paginated: the item table continues on further pages with a repeated header, and the totals, payment details and legal notes are kept together at the end.

Does the plugin transmit invoices?

No. It produces the files. Transmission to an approved platform must be handled by the company.

What is the difference with Factur-X?

A Factur-X invoice is a PDF file that carries the CII invoice data inside it. This plugin produces the same invoice data as a standalone CII XML file, plus a separate PDF meant for reading. The XML is the file to hand over when a platform, an accountant or a business customer asks for the structured invoice.

What happens when the customer is an individual?

The plugin generates the invoice without a company identifier for the buyer, which matches an invoice to an individual. Business identifiers (buyer SIREN and VAT number) are collected at checkout when those fields are enabled, and can always be filled in or corrected from the order screen.

Does the plugin contact any external service?

Not by default. Every number is checked locally, without any network access: SIREN and SIRET check digits, and the key of a French VAT number.

Online checks can be enabled. When they are, a “Check” button appears on the order screen; clicking it queries two public services, both free and requiring no account or key: the French business directory for a SIREN, and VIES, a European Commission service, for a VAT number. Nothing is queried until you click, and the answer is kept for one day.

Are invoice numbers reused?

No. A number is assigned once, the first time an order is generated, and is never reused.

Are the settings removed on uninstall?

Settings are removed, but invoice files that were already generated are kept, so that accounting documents are not destroyed.

0.6.0

  • The settings screen compares what the free plugin does with what the optional transmission module adds, and names the two approved platforms it supports: SUPER PDP and A-Cube.
  • The invoices screen carries the same offer, as a single notice you can hide for good.

0.5.0

  • An “Invoice” column in the orders list, so you can see at a glance which orders already have an invoice.

0.4.0

  • New “Electronic invoices” screen under WooCommerce: number, date, order, customer, amount, and the CII and PDF downloads, with search and pagination.
  • The list also shows invoices whose order was deleted, so a number that was consumed is never lost from sight.
  • The settings screen now says where the invoices are.
  • New setting: attach the invoice PDF to the customer order emails.
  • An order with no items no longer consumes an invoice number.
  • The invoice number is stored in the numbering table, which makes the list reliable on stores that use the classic order storage.

0.3.0

  • Renamed to “Smaoui CII Electronic Invoicing”, as requested during the WordPress.org review.
  • Plugin headers, text domain and identifiers updated accordingly.

0.2.0

  • Optional SIREN/SIRET and VAT number fields at checkout for business customers, in both the block and the classic checkout.
  • Local validation of those numbers: SIREN and SIRET check digits, and the key of a French VAT number, verified before the order is placed.
  • A SIRET is converted to its SIREN, the identifier the business directory uses.
  • Optional check of a SIREN or a VAT number against public registers, off by default and never triggered without a click.

0.1.0

  • First release: CII EN 16931 XML and PDF generation for WooCommerce orders, seller settings, continuous invoice numbering.
Back to top