=== OVP-Sponsorizare ===
Contributors: ovpdigital
Tags: nonprofit, form-230, form-177, tax-redirection, romania
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 2.1.5
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Complete plugin for Romanian nonprofits: Form 230, Form D177 (XML for SPV) and Sponsorship Contract. Fully ANAF compliant.

== Description ==

**OVP-Sponsorizare** is a WordPress plugin dedicated to Romanian nonprofit organizations for online collection of tax redirection forms and sponsorship contracts, fully compliant with Romanian tax legislation (ANAF).

= Form 230 — Individual Taxpayers =

* Complete online form compliant with OPANAF 103/2025
* Digital handwritten signature (canvas)
* Automatic generation of official ANAF PDF
* Automatic email with PDF attachment
* Organization submits the form to ANAF on behalf of the taxpayer

= Form D177 — Legal Entities =

* Form compliant with schema D177_A1.0.8 (SPV ANAF)
* Generates valid **XML file** for submission via SPV (ANAF Private Virtual Space)
* Multiple beneficiaries — add/remove dynamically
* Clear instructions for qualified electronic signature and SPV submission
* Taxpayer submits signed XML directly via SPV

= Sponsorship Contract =

* Form for individuals and legal entities
* 3 types of sponsorship: monetary, goods, services
* Generates complete PDF with 10 chapters (including GDPR clauses)
* Dedicated space for manual signature and stamp
* Automatic email to sponsor with signing instructions

= Admin Features =

* Dashboard with statistics: number of forms 230, 177, contracts and declared amounts
* Fully configurable colors from admin with live preview
* Organization data auto-filled in forms from settings
* Responsive — works on any device
* Server-side validation on all forms
* WordPress nonce protection on all requests
* Data stored securely in WordPress database

= Shortcodes =

* `[ovpspo_formular230]` — Form 230 for individual taxpayers
* `[ovpspo_formular177]` — Form D177 for legal entities
* `[ovpspo_contract_sponsorizare]` — Sponsorship contract

== Installation ==

1. Upload the plugin files to `/wp-content/plugins/ovp-sponsorizare/`, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the **Plugins** screen in WordPress.
3. Go to **OVP-Sponsorizare → Settings** and fill in your organization details.
4. Create pages and add the shortcodes: `[ovpspo_formular230]`, `[ovpspo_formular177]`, `[ovpspo_contract_sponsorizare]`.
5. Configure the email address where forms should be received.

== Frequently Asked Questions ==

= Is the plugin compliant with current legislation? =
Yes. Forms comply with OPANAF 103/2025. The XML schema for D177 is D177_A1.0.8 issued by ANAF.

= Does the organization need to submit Form 177 on behalf of the taxpayer? =
No. Form D177 is submitted by the taxpayer themselves (the legal entity) in SPV with a qualified electronic signature. The plugin generates the valid XML that the taxpayer downloads, signs, and uploads to SPV.

= Does it work on multiple sites? =
Yes. The plugin is multi-site ready. Organization data is configured in Settings and automatically populated in all generated documents.

= Can I customize the form colors? =
Yes. From **OVP-Sponsorizare → Settings → Organization** you can configure 5 colors (header, accent, sections, button, text) with live preview.

= Is user data saved? =
Yes. All data is saved in the WordPress database. You can view and download PDFs/XMLs from the admin panel.

= What PHP extensions are required? =
PHP 7.4 or newer. For the official ANAF 230 PDF, the `imagick` or `gd` PHP extension is required (both are standard on most hosting providers).

== Screenshots ==

1. Dashboard with form statistics and declared amounts
2. Form D177 — multiple beneficiaries and proxy details
3. Form D177 — taxpayer identification and tax redirection details
4. Form D177 — signing instructions and SPV submission steps
5. Form 230 — individual taxpayers with handwritten signature
6. Settings — Organization data (general info)
7. Settings — Organization address and contact details
8. Settings — Configurable form colors with live preview
9. Settings — Email configuration

== Changelog ==
= 2.1.5 =
Shortcodes are now prefixed: update [formular230], [formular177], [contract_sponsorizare] to [ovpspo_formular230], [ovpspo_formular177], [ovpspo_contract_sponsorizare] on your pages.

= 2.1.4 =
* Fix: Removed all K_PATH_* and K_BLANK_IMAGE defines from TCPDF wrapper classes (handled automatically by TCPDF's own autoconfig)
* Fix: Removed unprefixed shortcode backward-compatibility aliases (`formular230`, `formular177`, `contract_sponsorizare`) — only prefixed shortcodes (`ovpspo_*`) remain registered
* Improvement: Plugin Check compliance — full pass with zero errors

= 2.1.3 =
* Fix: Colors now applied correctly on all three forms (230, 177, Contract)
* Fix: Button hover color no longer reverts to default blue
* Improvement: Emoji replaced with Dashicons throughout the interface
* Improvement: TCPDF bundled directly in plugin (no separate installation needed)
* Improvement: Plugin Check compliance improvements

= 2.1.2 =
* Added: Sponsorship Contract (individuals and legal entities, 3 types)
* Added: Dedicated admin panel for contracts with PDF download
* Added: Detailed address fields for organization in Settings
* Added: Fields for legal representative, position, bank, association register number
* Improved: D177 taxpayer email with detailed signing instructions
* Fix: "Headers already sent" warning on admin deletion
* Fix: Double arrow on contract form dropdowns

= 2.0.0 =
* Added: Form D177 with valid XML generation for SPV (D177_A1.0.8)
* Added: Dynamic multiple beneficiaries in Form 177
* Added: Dashboard with statistics and informational cards
* Added: Separate admin sections for 230 and 177
* Added: Fully configurable colors with live preview
* Added: Organization data pre-filled in forms
* Renamed: Plugin renamed from "Formular 230" to "OVP-Sponsorizare"
* Improved: Completely redesigned responsive layout
* Improved: Settings reorganized with modern tabs

= 1.2.0 =
* Added: Official ANAF PDF generated via overlay
* Added: Handwritten signature on canvas
* Improved: Email with ANAF PDF attached

= 1.0.0 =
* Initial release: Form 230 with branded PDF generation

== Upgrade Notice ==

= 2.1.5 =
Shortcodes are now prefixed: update [formular230], [formular177], [contract_sponsorizare] to [ovpspo_formular230], [ovpspo_formular177], [ovpspo_contract_sponsorizare] on your pages.

= 2.1.4 =
* Fix: Removed all K_PATH_* and K_BLANK_IMAGE defines from TCPDF wrapper classes (handled automatically by TCPDF's own autoconfig)
* Fix: Removed unprefixed shortcode backward-compatibility aliases (`formular230`, `formular177`, `contract_sponsorizare`) — only prefixed shortcodes (`ovpspo_*`) remain registered
* Improvement: Plugin Check compliance — full pass with zero errors

= 2.1.3 =
* Fix: Colors now applied correctly on all three forms (230, 177, Contract)
* Fix: Button hover color no longer reverts to default blue
* Improvement: Emoji replaced with Dashicons throughout the interface
* Improvement: TCPDF bundled directly in plugin (no separate installation needed)
* Improvement: Plugin Check compliance improvements

= 2.1.2 =
* Added: Sponsorship Contract (individuals and legal entities, 3 types)
* Added: Dedicated admin panel for contracts with PDF download
* Added: Detailed address fields for organization in Settings
* Added: Fields for legal representative, position, bank, association register number
* Improved: D177 taxpayer email with detailed signing instructions
* Fix: "Headers already sent" warning on admin deletion
* Fix: Double arrow on contract form dropdowns

= 2.0.0 =
* Added: Form D177 with valid XML generation for SPV (D177_A1.0.8)
* Added: Dynamic multiple beneficiaries in Form 177
* Added: Dashboard with statistics and informational cards
* Added: Separate admin sections for 230 and 177
* Added: Fully configurable colors with live preview
* Added: Organization data pre-filled in forms
* Renamed: Plugin renamed from "Formular 230" to "OVP-Sponsorizare"
* Improved: Completely redesigned responsive layout
* Improved: Settings reorganized with modern tabs

= 1.2.0 =
* Added: Official ANAF PDF generated via overlay
* Added: Handwritten signature on canvas
* Improved: Email with ANAF PDF attached

= 1.0.0 =
* Initial release: Form 230 with branded PDF generation



== External Services ==

This plugin does NOT connect to any external services. All PDF generation and XML processing is done locally on your server. No user data is sent to external servers.

== Third Party Libraries ==

This plugin includes the following third party library, bundled locally — no external connections required:

**TCPDF 6.7.5** (https://tcpdf.org)
Used for PDF generation (Form 230, Form D177 auxiliary PDF, Sponsorship Contract).
Bundled directly in the plugin folder — no download or internet connection required.
License: LGPL 3.0 (https://www.gnu.org/copyleft/lesser.html)
Copyright: Nicola Asuni — Tecnick.com

== Privacy Policy ==

This plugin collects and stores data entered by users in tax redirection forms and sponsorship contracts. Data is stored in the WordPress database of the site and is not transmitted to third parties, except via email as configured by the site administrator.

Data collected includes: name, CNP/CIF (Romanian tax ID), address, email, phone, amounts to redirect. This data is required for the legal completion of ANAF tax forms.

The data controller is the organization that administers the WordPress site on which the plugin is installed.
