=== Oxygen MyData for WooCommerce ===
Author: oxygensuite
Author URI: https://www.pelatologio.gr/
Plugin URI: https://wordpress.org/plugins/oxygen-mydata/
Contributors: oxygensuite
Tags: oxygen, mydata, invoices, woocommerce invoices , invoices Greece
Requires at least: 5.5
Tested up to: 6.8.2
Requires PHP: >= 7.4
WC requires at least: 4.7
WC tested up to: 10.0.4
Version: 2.0.40
Stable tag: 2.0.40
License: GPLv2
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automate your WooCommerce store and accounting by syncing orders and more between WooCommerce and Oxygen Suite.

== Description ==

Automatically issue invoices & receipts from your eshop.

Connecting the eshop (woocommerce) with your Oxygen ERP is now an extremely useful tool for your business. This interface permits the optimization of all operations and saves valuable time.

Oxygen offers a complete solution with the Oxygen WooCommerce plugin, which allows eshops to be connected with Oxygen Pelatologio ERP using an API Key.

With the woocommerce plugin from Oxygen you can:

-Transfer orders from eshop to ERP
-Automatically create customer contacts from eshop to Oxygen
-Automatically issue of receipts and invoices in Oxygen without additional ECR (using the myData provider)
-View and automatically send PDF documents to customers
-Manage order status
-NEW:Set document payment status (e.g. "Paid") based on WooCommerce payment method
-NEW:Issue intra-community invoices (EU customers)
-NEW:Select to issue only retail receipts (not invoices)
-NEW: Ability to select Oxygen Checkout for card billing

**An account with https://www.pelatologio.gr/ is required.**

== Installation ==

1. Choose to add a new plugin, then click upload
2. Upload the oxygen-mydata zip
3. Activate the plugin through the 'Plugins' menu in WordPress
4. Setup the plugin via WooCommerce -> Settings -> Oxygen

== Frequently Asked Questions ==

=  Is it possible to have a test account? =

Yes. Contact us to help you in order to log in with a test account in the environment.

= How does Oxygen Checkout works =

During Checkout along with all other payment methods (cash on delivery, bank deposit, etc.), the option “Oxygen Payments (Debit/Credit Card)” appears, a secure payment environment opens and the customer can complete the transaction.

= Can I issue receipts through Oxygen Woocommerce Plugin? =

Yes. You can issue receipts as Oxygen Pelatologio is a certified e-invoicing Provider from ΑΑDΕ.

= Where can I find the API key? =

You can have the API Key from https://www.pelatologio.gr/ if you have an active account on the ERP or Cloud Cash Register.

= Will it work with the data that my clients already have? =

You can select the fields your customers already have with the data required by myData. The plugin can create these fields to be filled by your customer when completing the order.

= Will it automatically generate an invoice? =

Yes! There is an option on the plugin's settings page.

= Can my customers view and download the invoice or the receipt? =

Yes. A download button will appear in the customer's order list once the invoice or receipt is issued.

= Can a tech support specialist connect remotely for help in case of a problem? =

Yes. An Oxygen tech support specialist can be connected through a remote desktop for 2 hours with your developer with an extra fee.

== Screenshots ==

1. Oxygen Payments on Payments Methods WooCommerce
2. Oxygen Payments option on Checkout page
3. Oxygen Payment Modal
4. Oxygen Payment Modal Android Devices
5. Oxygen Payment Modal Apple Devices
6. Oxygen settings 1
7. Oxygen settings 2
8. Oxygen settings 3
9. Oxygen settings 4
10. Oxygen settings 5
11. Oxygen settings 6
12. Oxygen settings 7
13. Oxygen settings 8
14. Oxygen settings products categories myDATA
15. Oxygen settings products myDATA
16. Orders page WooCommerce download/view Oxygen documents
17. Oxygen meta box on order edit screen
18. My account page invoice view action
19. Edit order page oxygen actions
20. Client's account page - view actions

== Notes ==
- Ensure WooCommerce is active before using this plugin.
- You must have an account in pelatologio app

== Changelog ==

= 2.0.40 =
* Fixed bug with discount value per unit net value, remove total discount value per line

= 2.0.39 =
* Minor fix on decimal places of unit net value

= 2.0.38 =
* Minor fix for field unit_net_value , pass unit net value pre-discount on api call

= 2.0.37 =
* Added at notices unit pre-discount value to be able to convert it to another document with correct prices on app.pelatologio.gr

= 2.0.36 =
* Fixed order's language on documents,depending on checkout's customer country

= 2.0.35 =
* Added apply_filters (oxygen/add_notice),in order to allow change notice arguments before creation

= 2.0.34 =
* Fixed a bug with negative values when parent sku is used for variation products and order has discount
* Refactored code for discount code, to be able to compute bundle discounts
* Fixed a number fault on decimal places of unit net value

= 2.0.33 =
* Fixed the discount logic to be compatible with woo discount rules plugin
* Fixed a number fault on decimal places of unit net value

= 2.0.32 =
* Added functionality to manage discounts per line for products
* Fixed log messages to be labeled correctly as debug,info or error

= 2.0.31 =
* If billing_invoice is yes/true on order's meta, if there are different fields between checkout and api, contact's details are updated with new checkout's data
* Fixed multiple auto-create documents on bulk actions buttons, for receipts

= 2.0.30 =
* Added an exception for oxygen payments - if any billing_invoice metadata value provided assumes that the document type is receipt

= 2.0.29 =
* Fixed invoicing fields to be compatible with other tools/plugins
* Fixed products categories classifications bug

= 2.0.28 =
* Added the ability to save metadata on thankyou page action,in order to collect metadata from other plugins that are slow to save on order their metadata

= 2.0.27 =
* Fixed bug with duplicate documents check, prevent creation of the document only if it's not locked and the document for the order has been created

= 2.0.26 =
* Added a new option setting for mydata classification type of shipping and fee data, admin can select one of E3 given classification types

= 2.0.25 =
* Prevent duplicate documents creation on bulk actions buttons - added logs for duplicate order's documents

= 2.0.24 =
* Fixed do not to throw error message for shipping data with value 0, for example, branch_code = 0 or address_number = 0
* Fixed get the correct customer's shipping data from order's edit page via get_shipping_*() method

= 2.0.23 =
* Minor fixes

= 2.0.22 =
* Fixed billing invoice field update after order's creation, in case only if oxygen fields are used for invoicing

= 2.0.21 =
* Fixed billing invoice field accepts no/yes and set oxygen's field 0/1 , if there is another plugin that uses this field

= 2.0.20 =
* Removed deprecated code for oxygen payments settings - was for old versions of woocommerce
* Changed check for connection with pelatologio via api key , refactored for reducing resources

= 2.0.19 =
* Fixed a bug with wpml language code , not assigned correctly on documents

= 2.0.18 =
* Corrected plugin's name in the main file

= 2.0.17 =
* Fixed a bug on an error message associated with  shipping details, during document's auto-creation

= 2.0.16 =
* Added a new button for opening a document in iframe, ready to print
* Improved plugin's performance, executes faster some requests and does not make unsued api calls

= 2.0.15 =
* Fixed error with get_current_screen() , in oxygen payment gateway file
* Fixed payment method title for other payments methods
* Added icons for Oxygen Payment Gateway

= 2.0.14 =
* Fixed a critical error with Automattic\WooCommerce\Container->get() - removed
* Fixed company name on the checkout page for some eshops that do not show
* Ignore products with zero total value for invoices/receipts

= 2.0.13 =
* Added check if vies is disabled and billing vat on checkout is not greek vat number, not show notice "This Tax id does not match selected country."
* Added a button to show/hide shipping data on order's edit page

= 2.0.12 =
* Added functionality when used default shipping details, system copies them in order's meta data automatically and displayed
* Fixed bug on shipping details, validation messages
* Fixed on bulk actions not check shipping details if are not enabled

= 2.0.11 =
* Added option for auto create documents, get default shipping data otherwise not create document
* Fixed bug on updating shipping data, not saved
* Fixed get logo by language selection
* Fixed measurements units not appear those with empty api ids
* Fixed errors caused for servers running php under php8

= 2.0.10 =
* Fixed bug for cash on delivery-shipping details
* Added default measurement unit for fees

= 2.0.9 =
* Added "Use Shipping Data" option to the general settings tab of the Oxygen MyData Plugin
* Added instructions for shipping details from the link "See here for mandatory shipping details"
* New tab in the plugin settings titled "Shipping Data"
* Added individual shipping details per order (on the order edit page)
* Added "Load from general settings Oxygen" button to the order edit page (loads shipping data from default settings on specific order)
* Ability to enter a unit of measure on the product edit page at section "Warehouse"  (gets  measurements units from Oxygen ERP)
* Fixed attached notice sequence different from default on documents
* Note : Zero total lines are not allowed

= 2.0.8 =
* Fixed bug with notice sequence
* Fixed shipping item on zero amount , add tax id of item before
* Fixed create documents with empty tax on woocommerce order page for shipping

= 2.0.7 =
* Fixed bug on order language

= 2.0.6 =
* Fixed bug with shipping tax id
* Fixed Order No translation on documents infobox
* Added receipt id on paid documents with oxygen payments method

= 2.0.5 =
* Removed check for empty product code (other checks still exist)
* Fixed paid/unpaid status on documents
* Fixed invoices fields not shown on edit order page
* Removed function is_wc_order_edit_screen() , refactored this code

= 2.0.4 =
* Fixed bug that crushed wordpress on alp/apy creation with cash on delivery

= 2.0.3 =
* Fixed notices error messages, remove extra checks
* Fixed tax for products with zero totals (presents with price 0)

= 2.0.2 =
* Minor fixes js cached files
* Unblock intra-community invoices

= 2.0.1 =
* Fixed crush on first activation checks

= 2.0.0 =
* Adding intra-community documents.
* Adding the ability to match payment methods and document status.
* Νew updated UI.
* Adding the ability to create only receipts, the other menus are hidden when this has been chosen.
* Adding new, more detailed error/warning messages.
* Fully translated in english.

= 1.0.66 =
* Fixed error security checks, nonce message

= 1.0.65 =
* Fixed security issue, removes downloaded  docs with safety from folder oxygen
* Code refactor for showing errors array that return from api pelatologio requests

= 1.0.64 =
* Fix bug on product mydata category and classification type settings for a service (iconic product)

= 1.0.63 =
* Minor fixes

= 1.0.62 =
* Added new option setting,for viewing documents on users account page
* Added extra check if billing_invoice checkbox on checkout page is checked - throws error for required fields for invoice creation

= 1.0.61 =
* Fixed duplicate notices on save order action , changed order status

= 1.0.60 =
* Fixed bug on save_order function when status changes , if equals to default status for auto-creation of document , creates correct document type

= 1.0.59 =
* Fixed bug on oxygen payments save options that not worked as expected

= 1.0.58 =
* Minor fixes

= 1.0.57 =
* Fixed custom billing metadata fields ( billing_vat , billing_job etc ) , that have been set at other plugins custom fields

= 1.0.56 =
* Add extra conditions for address field check on create contact

= 1.0.55 =
* Fixed bug with address field for invoices

= 1.0.54 =
* Fixed bug with multiple identical contacts

= 1.0.53 =
* Fixed check for GR only vat numbers, not allow more than 9 digits
* Fixed on invoice email set language according to order's language

= 1.0.52 =
* Minor fixes

= 1.0.51 =
* Fixed oxygen payments enable/disable , get payments on click toggle oxygen payment gateway (reduce traffic /api calls)

= 1.0.50 =
* Fixed bug with the notices documents emails not able to sent

= 1.0.49 =
* Fixed at notices the duplicate contacts with same email , added identical contact check

= 1.0.48 =
* Fixed bug with documents attachments on email (on document creation an email send via a new email template)
* Fixed language on order infobox el/en
* Fixed bug with duplicate payment in app pelatologio , when order's payment way is oxygen-payment on checkout page
* Add new button on order's (oxygen column / box) , in order to send document as attachment to customer's email

= 1.0.47 =
* Fixed get selected logo for documents

= 1.0.46 =
* Minor fixes

= 1.0.45 =
* Fixed bug for empty item not get sku

= 1.0.44 =
* Fixed contacts for creating alp/apy documents - added check for identical contact on order's metadata compared to pelatologio app contact
* Fixed bug for duplicate documents creation on bulk actions buttons

= 1.0.43 =
* Remove notices from my account page

= 1.0.42 =
* Added ability to create as many notices as wp-admin wants from order's edit page

= 1.0.41 =
* Fixed bug on Oxygen Settings page , new option for default payment methods crushed the page (line 499)

= 1.0.40 =
* Added new option for default payment method, when an order has not any payment method, applied the selected default payment method
* Removed notice message for Oxygen Payments after dismiss it

= 1.0.39 =
* Minor fixes for caching(versioned) js files - using latest version

= 1.0.38 =
* Minor fixes for checking vat on checkout page (VIES)

= 1.0.37 =
* Fixed bug for (VIES) on checkout page,in case the input field billing_country , is set and locked to specific country

= 1.0.36 =
* Add extra messages during new contacts creation , when an invoice/receipt created - missing data fields

= 1.0.35 =
* minor fixes

= 1.0.34 =
* Fixed bug for oxygen payments , on user's pay order page
* Documents pdf no longer save in oxygen folder , because of waste of space
* Added option to use always parent sku code for variations products , on oxygen settings
* Change buttons and texts design on admin' s orders main page in woocommerce
* Change buttons and texts design in order's page meta box data

= 1.0.33 =
* Fixed bug with email attachments with order's details , oxygen plugin attaches document on order's details and send it to customer email (**SOS** option oxygen_order_attachment must be checked)

= 1.0.32 =
* Fixed contacts (company/client contact in pelatologio app) for creating invoice/notices (one company contact allowed per vat number)
* Added different button's and text's labels for receipts/invoices/notifications, on admin' s order panel, user's orders page and order processing page
* Fixed bug not showing created documents on user's orders page if self_fields option was enabled in oxygen settings panel
* Fixed bug if trp was null , get_checkout_language returned empty string ( by default returns EL )
* New add of plugin's settings manual pdf (on oxygen settings page)

= 1.0.31 =
* New option (yes/no) on oxygen settings page - fetch invoice data via vat number ( VIES supported )
* New feature - Search and fill company's mandatory fields for invoice creation via vat number field on checkout page
* VIES search if EU country is used for checkout
* Fixed bug with invoice language , now it gets the language from order metadata

= 1.0.30 =
* Add at oxygen settings page , an option for printing type of receipts (80mm or a4)

= 1.0.29 =
* Fixed oxygen payments modal window position fixed always center of the page

= 1.0.28 =
* Fixed oxygen payments modal window (conflicts for some bootstrap versions css)
* Add translations texts for oxygen payment modal

= 1.0.27 =
* Fixed TPDA/TPY on empty email create new contact, if exist vat number

= 1.0.26 =
* Add create new contact for empty email (on checkout)

= 1.0.25 =
* Add extra checks for billing invoice checkbox and add contact on creating invoice/notice ( oxygen log file )
* Add a language option in oxygen settings panel , in order to select  of invoice/notice according to eshop language

= 1.0.24 =
* Fixed bug bool|string return type for php < 7.4

= 1.0.23 =
* Add new option about oxygen payments order status (after successful payment)
* Fixed SKU codes on variations products (product codes in app have to be the same with Woocommerce SKU)
* Fixed on auto creation checkout fields checkbox is checked then hide the rest fields vat, tax office etc oxygen settings
* Add download button in oxygen settings tab admin for system report latest oxygen log file
* Add download in oxygen settings tab admin for plugin's settings
* Fixed contacts creation during creation of invoice
* Fixed bug in oxygen payments ( print error message on oxygen log file )

= 1.0.22 =
* Fixed debug log oxygen payments
* Fixed if a payment way is disabled not show in oxygen payments methods

= 1.0.21 =
* Fixed broken url for oxygen payment

= 1.0.20 =
* Fixed assets for oxygen payments gateway

= 1.0.19 =
* Add frequently questions and answers
* Minor fixes

= 1.0.18 =
* Added Oxygen Payments gateway
* Fixed bug with variations products sku
* Increase requests timeout to 15 seconds

= 1.0.17 =
* Minor PHP related bug fixes
* Fixed variation SKU data

= 1.0.16 =
* Minor PHP related bug fixes

= 1.0.15 =
* Improved debug logging

= 1.0.14 =
* Added checkout company field check on invoice request

= 1.0.13 =
* Added API user look up by email
* Added invoice request check by various values
* Added checkout checks for required fields on invoice request
* Added actions to trigger document creation on bulk order status change
* Updated Greek translation
* Fixed switching the essential checkout fields to required when invoice is selected
* Fixed E_ERROR on API PDF look up by invoice ID
* Fixed wrongly create invoices when VAT ID is set but invoice is not requested
* Fixed document not created when email to customer is not enabled
* Removed not longer needed shutdown WP tweak

= 1.0.12 =
* Fixed WordPress caching issue
* Fixed user data auto load on manually created orders

= 1.0.11 =
* Fixed duplicate documents on button double click
* Fixed notice auto creation error

= 1.0.10 =
* Fixed minor logical PHP error with custom logos

= 1.0.9 =
* Added shipping code option
* Added the option to choose Default Invoice Document Type on order status
* Added order number on the infobox API field
* Added color labels on admin column for documents
* Added document attachment on WooCommerce emails
* Added logo image option on documents
* Better vat info fields handling on checkout
* Updated translation files

= 1.0.8 =
* Added empty plugin values on WooCommerce terms entry
* Forcing rounded values for vat and net amount of the orders to be sent to the API
* Better vat info handling
* Updated translation files

= 1.0.7 =
* Fixed invoice/notice auto creation
* Fixed language settings not saving
* Added default payment status for invoices and notices
* Added language support for invoices and notices

= 1.0.6 =
* Fixed coding typo

= 1.0.5 =
* Fixed sequence number for notices
* Fixed category for order fees
* Fixed customer being empty when switching between live and sandbox mode
* Added extra headers on API requests

= 1.0.4 =
* Fixed classification assignment
* Added the option to issue multiple notices

= 1.0.3 =
* Fixed 3rd party user fields selection values
* Added receipt default types and categories
* Added support for coupons
* Added support for not activated payment methods setup
* Added support for WooCommerce 7.0.0

= 1.0.2 =
* Minor code fixes
* Created additional messages and alerts

= 1.0.1 =
* Fixed wrong API key error
* Fixed live API URL
* Fixed default myData values
* UI improvements
* Added notice functionality
* Fixed duplicate client creation in the Oxygen platform

= 1.0.0 =
* Initial plugin release.

== Upgrade Notice ==

= 1.0.0 =
* Initial plugin release.
