=== ParteFácil – Online Guest Check-in for SES, Mossos, Alloggiati Web & SIBA ===
Contributors: rgcglobalnet
Tags: check-in, ses hospedajes, alloggiati web, siba, vacation rental
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Guests check in online before they arrive. You download the official file for SES.Hospedajes, Mossos d'Esquadra, Alloggiati Web (Italy) or SIBA (Portugal) in one click. No monthly fees.

== Description ==

Holiday rentals, hotels, hostels and campsites in Spain, Italy and Portugal must record each guest and send the data to the police within a short deadline (24 hours in Spain and Italy; 3 working days in Portugal). Copying passports by hand at reception is slow, and the usual check-in platforms charge every month for each property.

**ParteFácil** puts the check-in form on your own WordPress site. Each booking gets a private link. Guests fill in their details on their phones before they arrive, sign on screen, and the plugin checks the data. You then download the file for the authorities, already in the official format.

= What you get =

* **Online check-in link per booking.** It is private and random, and it expires the day after check-out. Share it by email, WhatsApp or in your WooCommerce confirmation.
* **Every field the law asks for** (annexes I and II of RD 933/2021): document, support number, nationality, address, contact details, and, for minors, their relationship with the adult travelling with them.
* **Checks that catch typos.** DNI and NIE control letters, support numbers, the second surname on Spanish documents, and age-based rules for minors.
* **Spanish municipality search.** All 8,132 INE municipalities are built in, so you get the exact code SES.Hospedajes requires and no rejected uploads.
* **On-screen signature** and a **printable parte** for your paper or PDF register.
* **SES.Hospedajes XML** for traveller partes and for reservations. It is generated from the official schemas (v3.1.2) and validated against them in our tests.
* **Mossos d'Esquadra file** for Catalonia, in format V24 for bulk uploads (beta).
* **Alloggiati Web file** for Italy: the official 168-character schedina (D.M. 7 January 2013 / Polizia di Stato guide, chapter 12), ready to upload in the portal.
* **SIBA file** for Portugal: the official BA03 .DAT for manual upload and the BAL XML (validated against the official BAL.XSD) for the web service.
* **Several establishments**, each reporting to its own system.
* **WooCommerce:** tick "Guest registration" on a stay product. Paid orders then create the booking automatically and add the check-in link to the customer email. Compatible with HPOS.
* **Reception mode.** Staff can register walk-in guests from the admin without a signature.
* **Private by design.** Guest records are encrypted in your database (libsodium) and deleted automatically 3 years after check-out, the legal retention period. Nothing is sent to us or to any third party.
* English, Spanish and Catalan included. The form follows the site language.

= How it works =

1. Activate the plugin. It creates an "Online check-in" page with the `[partefacil_checkin]` shortcode.
2. Under ParteFácil › Settings, add your establishment and choose the destination: **SES.Hospedajes**, **Mossos**, **Alloggiati Web** or **SIBA**. Enter the official codes of that system (SES or Mossos code; SIBA NIPC and establishment number issued by UCFE). Alloggiati Web identifies you by the holder’s portal account.
3. Create a booking, or let WooCommerce create it, and send the guest the link.
4. Guests register themselves. The booking turns **Ready to send** when everyone is in.
5. Tick the bookings and download the official file. Upload it in the authority’s portal (SES.Hospedajes, Mossos, Alloggiati Web or SIBA), then mark the bookings as sent. Always check that the portal accepted the file.

= ParteFácil Pro =

Pro sends the partes for you.

| | Free | Pro |
|---|:---:|:---:|
| Online check-in links, validation, signature | ✓ | ✓ |
| SES.Hospedajes XML (partes and reservations) | ✓ | ✓ |
| Mossos d'Esquadra file (Catalonia) | ✓ | ✓ |
| Alloggiati Web schedina (Italy) | ✓ | ✓ |
| SIBA .DAT and BAL XML (Portugal) | ✓ | ✓ |
| WooCommerce bookings and email link | ✓ | ✓ |
| Encryption and automatic 3-year deletion | ✓ | ✓ |
| **Automatic sending** to the SES.Hospedajes, Alloggiati Web or SIBA web service, with queue and retries | – | ✓ |
| Reminder emails to guests who have not checked in (2 days before and on arrival day) | – | ✓ |
| 20:00 alert to the owner when a stay that started today has no parte yet | – | ✓ |
| Register export (CSV) for inspections | – | ✓ |
| Priority email support | – | ✓ |

Pro costs 39 € + VAT per year for up to 3 establishments, or 99 € + VAT per year for up to 15 (agencies and property managers). See [rgcglobalnet.com/partefacil](https://rgcglobalnet.com/partefacil/).

= Legal note =

ParteFácil is a tool. It does not guarantee legal compliance. The establishment owner stays responsible for the communication and for the data, and is the data controller. Check that each upload was accepted in the authority's portal. The Mossos file follows the published V24 layout. The Alloggiati Web file follows the official 168-character record (D.M. 7 January 2013 and the Polizia di Stato guide). The SIBA files follow the official BA03 layout and BAL.XSD. Official Alloggiati code tables (comuni, stati, documenti) are downloaded by the holder from the portal; the plugin ships only a verified subset of state codes plus official municipality examples used in tests. Validate your first file with the portal's validator. Ertzaintza (Basque Country) export is still planned. ISTAT flows for Italy are not included in this version.

Spanish municipality list: Instituto Nacional de Estadística (INE), "Relación de municipios y códigos por provincias" at 1 January 2026, reused under the INE's terms of reuse.

== Installation ==

1. Install from Plugins › Add New, or upload the zip, then activate.
2. Go to ParteFácil › Settings and add your establishment(s).
3. Optional: add `define( 'PARTEFACIL_KEY', '…' );` to `wp-config.php` with the value shown on the settings screen, before you register any guest. This gives you a dedicated encryption key.

== Frequently Asked Questions ==

= Is this enough to comply with RD 933/2021? =

It collects every required field, checks it, and produces the file in the official format. You still have to upload it, or use Pro to send it automatically, within 24 hours of arrival, and keep the register for 3 years. ParteFácil does the keeping and deleting for you.

= Where is my guests' data stored? =

Only in your WordPress database, encrypted. The free plugin makes no external connections at all.

= Does it work for Catalonia, the Basque Country, Italy and Portugal? =

Catalonia: yes (Mossos V24 file, beta). Basque Country: Ertzaintza export is on the roadmap; until then, you can print the partes. Italy: yes, the official Alloggiati Web schedina for manual upload (Pro can send it through the official web service with the holder’s utente, password and WsKey). Portugal: yes, the official SIBA .DAT and BAL XML (Pro can send it to the official web service with the holder’s UCFE access key). You still have to check the portal’s acceptance message.

= Do I need WooCommerce? =

No. You can create bookings by hand in a few seconds. WooCommerce only automates that step.

= What about children? =

Guests under 14 can register without a document. Every minor must state their relationship with the adult they travel with, as SES.Hospedajes requires.

= Does the guest need an account? =

No. The private link is enough. It opens only that booking and expires after check-out.

= Can I edit or delete a guest? =

Yes. Open the booking, delete the record and register it again. Deleting the plugin keeps the guest records, because you must keep them for 3 years. To erase them on uninstall, define `PARTEFACIL_DELETE_DATA` as true.

= What does "Ready to send" mean? =

Every guest of the booking has registered, so the parte can be generated.

== Screenshots ==

1. Bookings dashboard: who has checked in, what is ready to send, and one-click SES and Mossos files.
2. The guest's online check-in form on a phone, with document checks and municipality search.
3. Minors: relationship with the accompanying adult, plus the on-screen signature.
4. A booking with its private link, the registered guests and the reception form.
5. Settings: establishments with their SES.Hospedajes or Mossos codes.
6. Printable parte with the guest's signature, ready for your register.

== Changelog ==

= 1.2.0 =
* Italy: Alloggiati Web schedina (official 168-character record) for manual upload. Pro can send it through the official web service (GenerateToken / Test / Send). Local simulation is used in tests and can be kept on until you are ready to send live.
* Portugal: SIBA BA03 .DAT for manual upload and BAL XML validated against the official schema. Pro can send it through the official EntregaBoletinsAlojamento method, also with a local simulation.
* Check-in form and settings adapted to each destination. No real Alloggiati or SIBA credentials are shipped with the plugin.
* Legal wording made clearer: ParteFácil is a tool; the owner remains responsible for the communication. No claim of guaranteed compliance.

= 1.0.0 =
* First release: online check-in, SES.Hospedajes XML (PV/RH, v3.1.2), Mossos V24 file (beta), WooCommerce bookings, encryption and 3-year purge.

== Upgrade Notice ==

= 1.2.0 =
Adds official file generation for Alloggiati Web (Italy) and SIBA (Portugal). Spanish SES and Mossos behaviour is unchanged.

= 1.0.0 =
First release.
