Current File : /var/www/vinorea/modules/ipexportimport/classes/EIAHelper.php
<?php
/**
 *
 * NOTICE OF LICENSE
 *
 *  @author    SmartPresta <tehran.alishov@gmail.com>
 *  @copyright 2024 SmartPresta
 *  @license   Commercial License
 */

if (!defined('_PS_VERSION_')) {
    exit;
}

@ini_set('max_execution_time', 0);
if (!defined('MAX_LINE_SIZE')) {
    define('MAX_LINE_SIZE', 0);
}
if (!defined('MAX_COLUMNS')) {
    define('MAX_COLUMNS', 6);
}
@ini_set('auto_detect_line_endings', '1');

use PhpOffice\PhpSpreadsheet\IOFactory;

class EIAHelper
{
    public $entity;
    public $fields;
    private $fieldsInTree;
    public $available_fields = [];
    public $auto;
    public $inputs;
    public $required_fields = [];
    public $module;
    public $importDir;
    public $errors;
    public $filterOperators = [
        'lt' => ' < ',
        'lte' => ' <= ',
        'gt' => ' > ',
        'gte' => ' >= ',
        'e' => ' = ',
        'ne' => ' != ',
        'in' => ' IN ',
        'not_in' => ' NOT IN ',
        'contains' => ' LIKE ',
        'not_contains' => ' NOT LIKE ',
    ];
    
    public function __construct($module)
    {
        $this->module = $module;
        $this->entity = Tools::getValue('entity');
        $this->importDir = dirname(__FILE__) . '/../import/';
        
        $this->fields = [
            'categories' => [
                'no' => ['label' => '-- ' . $module->l('Ignore this column', 'EIAHelper') . ' --'],
                'id' => ['type' => 'number', 'label' => $module->l('Category ID', 'EIAHelper')],
                'active' => ['type' => 'bool', 'label' => $module->l('Enabled (0 = No, 1 = Yes)', 'EIAHelper')],
                'name' => ['type' => 'string', 'label' => $module->l('Name', 'EIAHelper')],
                'id_parent' => ['type' => 'number', 'label' => $module->l('Parent Category ID', 'EIAHelper')],
                'parent' => ['type' => 'string', 'label' => $module->l('Parent Category Name', 'EIAHelper')],
                'description' => ['type' => 'string', 'label' => $module->l('Description', 'EIAHelper')],
                'link_rewrite' => ['type' => 'string', 'label' => $module->l('Rewritten URL', 'EIAHelper')],
                'meta_title' => ['type' => 'string', 'label' => $module->l('Meta Title', 'EIAHelper')],
                'meta_keywords' => ['type' => 'string', 'label' => $module->l('Meta Keywords', 'EIAHelper')],
                'meta_description' => ['type' => 'string', 'label' => $module->l('Meta Description', 'EIAHelper')],
//                    'is_root_category' => [
//                        'type' => 'bool', 'label' => $module->l('Root category (0/1)', 'EIAHelper'),
//                        'help' => $module->l('A category root is where a category tree can begin. This is used with multistore.', 'EIAHelper'),
//                    ],
                'position' => ['type' => 'number', 'label' => $module->l('Position', 'EIAHelper')],
                'image' => ['label' => $module->l('Image URL', 'EIAHelper')],
                'date_add' => ['type' => 'date', 'label' => $module->l('Creation Date', 'EIAHelper')],
                'id_groups' => ['type' => 'string', 'label' => $module->l('Group IDs (x,y,z...)', 'EIAHelper')],
                'group_names' => ['type' => 'string', 'label' => $module->l('Group Names (x,y,z...)', 'EIAHelper')],
                'reductions' => ['type' => 'string', 'label' => $module->l('Group Reductions (x,y,z...)', 'EIAHelper')],
            ],
            'products' => [
                'no' => ['label' => '-- ' . $module->l('Ignore this column', 'EIAHelper') . ' --'],
                'id' => ['type' => 'number', 'label' => $module->l('Product ID', 'EIAHelper')],
                'reference' => ['type' => 'string', 'label' => $module->l('Reference', 'EIAHelper')],
                'active' => ['type' => 'bool', 'label' => $module->l('Enabled (0 = No, 1 = Yes)', 'EIAHelper')],
                'name' => ['type' => 'string', 'label' => $module->l('Name', 'EIAHelper')],
                'ean13' => ['type' => 'string', 'label' => $module->l('EAN13', 'EIAHelper')],
                'upc' => ['type' => 'string', 'label' => $module->l('UPC', 'EIAHelper')],
                'isbn' => ['type' => 'string', 'label' => $module->l('ISBN', 'EIAHelper')],
                'mpn' => ['type' => 'string', 'label' => $module->l('MPN', 'EIAHelper')],
                'visibility' => ['type' => 'string', 'label' => $module->l('Visibility', 'EIAHelper')],
                'condition' => ['type' => 'string', 'label' => $module->l('Condition', 'EIAHelper')],
                'show_condition' => ['type' => 'bool', 'label' => $module->l('Show Condition (0 = No, 1 = Yes)', 'EIAHelper')],
                'cache_is_pack' => ['type' => 'bool', 'label' => $module->l('Is Pack (0 = No, 1 = Yes)', 'EIAHelper')],
                'description_short' => ['type' => 'string', 'label' => $module->l('Summary', 'EIAHelper')],
                'description' => ['type' => 'string', 'label' => $module->l('Description', 'EIAHelper')],
                'tags' => ['type' => 'string', 'label' => $module->l('Tags (x,y,z...)', 'EIAHelper')],
                'available_for_order' => ['type' => 'bool', 'label' => $module->l('Available for Order (0 = No, 1 = Yes)', 'EIAHelper')],
                'available_date' => ['type' => 'date', 'label' => $module->l('Availability Date', 'EIAHelper')],
                'show_price' => ['type' => 'bool', 'label' => $module->l('Show Price (0 = No, 1 = Yes)', 'EIAHelper')],
                'date_add' => ['type' => 'date', 'label' => $module->l('Creation Date', 'EIAHelper')],
                'online_only' => ['type' => 'bool', 'label' => $module->l('Available Online Only (0 = No, 1 = Yes)', 'EIAHelper')],
                'is_virtual' => ['type' => 'bool', 'label' => $module->l('Is Virtual Product (0 = No, 1 = Yes)', 'EIAHelper')],
                'file_url' => ['type' => 'string', 'label' => $module->l('Virtual File URL', 'EIAHelper')],
                'display_filename' => ['type' => 'string', 'label' => $module->l('Virtual File Displayed Name', 'EIAHelper')],
                'nb_downloadable' => [
                    'type' => 'number', 'label' => $module->l('Number of Allowed Downloads', 'EIAHelper'),
                    'help' => $module->l('Number of days this file can be accessed by customers. Set to zero for unlimited access.', 'EIAHelper'),
                ],
                'date_expiration' => ['type' => 'date', 'label' => $module->l('Expiration Date of Download', 'EIAHelper')],
                'nb_days_accessible' => [
                    'type' => 'number', 'label' => $module->l('Number of Days Accessible', 'EIAHelper'),
                    'help' => $module->l('Number of days this file can be accessed by customers. Set to zero for unlimited access.', 'EIAHelper'),
                ],
                'pack_stock_type' => ['type' => 'number', 'label' => $module->l('Pack Quantity Type', 'EIAHelper')],
                'price_tex' => ['type' => 'number', 'label' => $module->l('Price (Tax Excluded)', 'EIAHelper')],
                'price_tin' => ['type' => 'number', 'label' => $module->l('Price (Tax Included)', 'EIAHelper')],
                'wholesale_price' => ['type' => 'number', 'label' => $module->l('Cost (Wholesale) Price', 'EIAHelper')],
                'on_sale' => ['type' => 'bool', 'label' => $module->l('On Sale Badge (0 = No, 1 = Yes)', 'EIAHelper')],
//                'reduction_amount' => ['type' => 'number', 'label' => $module->l('Discount Amount', 'EIAHelper')],
//                'reduction_type' => ['type' => 'number', 'label' => $module->l('Discount Type', 'EIAHelper')],
//                'reduction_from' => ['type' => 'date', 'label' => $module->l('Discount from (yyyy-mm-dd)', 'EIAHelper')],
//                'reduction_to' => ['type' => 'date', 'label' => $module->l('Discount to (yyyy-mm-dd)', 'EIAHelper')],
//                'reduction_price' => ['type' => 'number', 'label' => $module->l('Discount Base Price', 'EIAHelper')],
//                'reduction_from_quantity' => ['type' => 'number', 'label' => $module->l('Discount From Quantity', 'EIAHelper')],
//                'reduction_customer_email' => ['type' => 'string', 'label' => $module->l('Discount Customer Email', 'EIAHelper')],
//                'reduction_group_name' => ['type' => 'string', 'label' => $module->l('Discount Group', 'EIAHelper')],
//                'reduction_id_country' => ['type' => 'string', 'label' => $module->l('Discount Country', 'EIAHelper')],
//                'reduction_currency' => ['type' => 'string', 'label' => $module->l('Discount Currency (ISO)', 'EIAHelper')],
//                'reduction_priority' => ['type' => 'string', 'label' => $module->l('Discount Priority', 'EIAHelper')],
                'specific_price_priority' => ['type' => 'string', 'label' => $module->l('Priority Management', 'EIAHelper')],
                'id_tax_rules_group' => ['type' => 'number', 'label' => $module->l('Tax Rule ID', 'EIAHelper')],
                'tax_rules_group_name' => ['type' => 'string', 'label' => $module->l('Tax Rule Name', 'EIAHelper')],
                'ecotax' => ['type' => 'number', 'label' => $module->l('Ecotax', 'EIAHelper')],
                'unity' => ['type' => 'string', 'label' => $module->l('Unity', 'EIAHelper')],
                'unit_price' => ['type' => 'number', 'label' => $module->l('Unit Price', 'EIAHelper')],
                'meta_title' => ['type' => 'string', 'label' => $module->l('Meta Title', 'EIAHelper')],
                'meta_keywords' => ['type' => 'string', 'label' => $module->l('Meta Keywords', 'EIAHelper')],
                'meta_description' => ['type' => 'string', 'label' => $module->l('Meta Description', 'EIAHelper')],
                'link_rewrite' => ['type' => 'string', 'label' => $module->l('Rewritten URL', 'EIAHelper')],
                'redirect_type' => ['type' => 'string', 'label' => $module->l('Redirect Type', 'EIAHelper')],
                'id_type_redirected' => ['type' => 'number', 'label' => $module->l('Target Redirect ID', 'EIAHelper')],
                'type_redirected_name' => ['type' => 'string', 'label' => $module->l('Target Redirect Name', 'EIAHelper')],
                'id_category_default' => ['type' => 'number', 'label' => $module->l('Default Category ID', 'EIAHelper')],
                'category_default' => ['type' => 'string', 'label' => $module->l('Default Category Name', 'EIAHelper')],
                'id_category' => ['type' => 'string', 'label' => $module->l('Category IDs (x,y,z...)', 'EIAHelper')],
                'category' => ['type' => 'string', 'label' => $module->l('Category Names (x,y,z...)', 'EIAHelper')],
                'id_manufacturer' => ['type' => 'number', 'label' => $module->l('Brand ID', 'EIAHelper')],
                'manufacturer' => ['type' => 'string', 'label' => $module->l('Brand Name', 'EIAHelper')],
                'id_accessories' => ['type' => 'string', 'label' => $module->l('Related Product IDs (x,y,z...)', 'EIAHelper')],
                'accessories' => ['type' => 'string', 'label' => $module->l('Related Product Names (x,y,z...)', 'EIAHelper')],
                'id_pack_products' => ['type' => 'string', 'label' => $module->l('Product IDs in Pack (x,y,z...)', 'EIAHelper')],
                'pack_products' => ['type' => 'string', 'label' => $module->l('Product Names in Pack (x,y,z...)', 'EIAHelper')],
                'pack_product_quantity' => ['type' => 'string', 'label' => $module->l('Product Quantities in Pack (x,y,z...)', 'EIAHelper')],
                'id_carriers' => ['type' => 'string', 'label' => $module->l('Carrier IDs (x,y,z...)', 'EIAHelper')],
                'carriers' => ['type' => 'string', 'label' => $module->l('Carrier Names (x,y,z...)', 'EIAHelper')],
                'width' => ['type' => 'number', 'label' => $module->l('Width', 'EIAHelper')],
                'height' => ['type' => 'number', 'label' => $module->l('Height', 'EIAHelper')],
                'depth' => ['type' => 'number', 'label' => $module->l('Depth', 'EIAHelper')],
                'weight' => ['type' => 'number', 'label' => $module->l('Weight', 'EIAHelper')],
                'delivery_in_stock' => ['type' => 'string', 'label' => $module->l('Delivery Time of In-stock Products', 'EIAHelper')],
                'delivery_out_stock' => ['type' => 'string', 'label' => $module->l('Delivery Time of Out-of-stock Products', 'EIAHelper')],
                'additional_shipping_cost' => ['type' => 'number', 'label' => $module->l('Additional Shipping Fees', 'EIAHelper')],
                'additional_delivery_times' => ['type' => 'string', 'label' => $module->l('Delivery Time', 'EIAHelper')],
                'sold_quantity' => ['type' => 'number', 'label' => $module->l('Sold Quantity', 'EIAHelper')],
                'sale_nbr' => ['type' => 'number', 'label' => $module->l('Number of Sales', 'EIAHelper')],
                'quantity' => ['type' => 'number', 'label' => $module->l('Quantity', 'EIAHelper')],
                'minimal_quantity' => ['type' => 'number', 'label' => $module->l('Minimal Quantity', 'EIAHelper')],
                'physical_quantity' => ['type' => 'number', 'label' => $module->l('Physical Quantity', 'EIAHelper')],
                'reserved_quantity' => ['type' => 'number', 'label' => $module->l('Reserved Quantity', 'EIAHelper')],
                'stock_location' => ['type' => 'string', 'label' => $module->l('Stock Location', 'EIAHelper')],
                'location' => ['type' => 'string', 'label' => $module->l('Location', 'EIAHelper')],
                'low_stock_threshold' => ['type' => 'number', 'label' => $module->l('Low Stock Level', 'EIAHelper')],
                'low_stock_alert' => ['type' => 'bool', 'label' => $module->l('Low Stock Alert (0 = No, 1 = Yes)', 'EIAHelper')],
                'available_now' => ['type' => 'string', 'label' => $module->l('Label When in Stock', 'EIAHelper')],
                'available_later' => ['type' => 'string', 'label' => $module->l('Label When Backorder Allowed', 'EIAHelper')],
                'out_of_stock' => ['type' => 'number', 'label' => $module->l('Action When out of Stock', 'EIAHelper')],
//                'advanced_stock_management' => [
//                    'type' => 'bool', 'label' => $module->l('Advanced Stock Management (0 = No, 1 = Yes)', 'EIAHelper'),
//                    'help' => $module->l('Enable Advanced Stock Management on product (0 = No, 1 = Yes).', 'EIAHelper'),
//                ],
//                'depends_on_stock' => [
//                    'type' => 'bool', 'label' => $module->l('Depends on Stock', 'EIAHelper'),
//                    'help' => $module->l('0 = Use quantity set in product, 1 = Use quantity from warehouse.', 'EIAHelper'),
//                ],
                'warehouse' => ['type' => 'string', 'label' => $module->l('Warehouses (Reference:Name:Location) (x,y,z...)', 'EIAHelper')],
                'quantity_discount' => ['type' => 'bool', 'label' => $module->l('Quantity Discount (0 = No, 1 = Yes)', 'EIAHelper')],
                'cover_image' => ['label' => $module->l('Cover Image URL', 'EIAHelper')],
                'image' => ['label' => $module->l('Image URLs (x,y,z...)', 'EIAHelper')],
//                'image_position' => ['type' => 'string', 'label' => $module->l('Image positions (x,y,z...)', 'EIAHelper')],
                'image_alt' => ['type' => 'string', 'label' => $module->l('Image Alt Texts (x,y,z...)', 'EIAHelper')],
//                    'delete_existing_images' => ['type' => 'bool', 'label' => $module->l('Delete existing images (0 = No, 1 = Yes)', 'EIAHelper')],
                'features' => ['type' => 'string', 'label' => $module->l('Features (Name~Value~Custom) (x,y,z...)', 'EIAHelper')],
                'customizable' => ['type' => 'bool', 'label' => $module->l('Is Customizable (0 = No, 1 = Yes)', 'EIAHelper')],
                'text_fields' => ['type' => 'number', 'label' => $module->l('Number of Customization Text Fields', 'EIAHelper')],
                'uploadable_files' => ['type' => 'number', 'label' => $module->l('Number of Customization File Fields', 'EIAHelper')],
                'customization_fields' => ['type' => 'string', 'label' => $module->l('Customization Fields (Label:Type:Required) (x,y,z...)', 'EIAHelper')],
                'cache_has_attachments' => ['type' => 'bool', 'label' => $module->l('Has Attachments (0 = No, 1 = Yes)', 'EIAHelper')],
                'attachment_id' => ['type' => 'string', 'label' => $module->l('Attachment IDs (x,y,z...)', 'EIAHelper')],
                'attachment_url' => ['type' => 'string', 'label' => $module->l('Attachment URLs (x,y,z...)', 'EIAHelper')],
                'attachment_name' => ['type' => 'string', 'label' => $module->l('Attachment Names (x,y,z...)', 'EIAHelper')],
                'attachment_desc' => ['type' => 'string', 'label' => $module->l('Attachment Descriptions (x,y,z...)', 'EIAHelper')],
                'id_supplier' => ['type' => 'number', 'label' => $module->l('Default Supplier ID', 'EIAHelper')],
                'supplier' => ['type' => 'string', 'label' => $module->l('Default Supplier Name', 'EIAHelper')],
                'supplier_reference' => ['type' => 'string', 'label' => $module->l('Default Supplier Reference', 'EIAHelper')],
                'supplier_ids' => ['type' => 'string', 'label' => $module->l('Supplier IDs (x,y,z...)', 'EIAHelper')],
                'supplier_names' => ['type' => 'string', 'label' => $module->l('Supplier Names (x,y,z...)', 'EIAHelper')],
                'supplier_references' => ['type' => 'string', 'label' => $module->l('Supplier References (x,y,z...)', 'EIAHelper')],
                'supplier_prices' => ['type' => 'string', 'label' => $module->l('Supplier Prices (x,y,z...)', 'EIAHelper')],
                'supplier_currency_ids' => ['type' => 'string', 'label' => $module->l('Supplier Currency IDs (x,y,z...)', 'EIAHelper')],
                'supplier_currencies' => ['type' => 'string', 'label' => $module->l('Supplier Currency ISO Codes (x,y,z...)', 'EIAHelper')],
//                    'shop' => [
//                        'type' => 'string', 'label' => $module->l('ID / Name of shop', 'EIAHelper'),
//                        'help' => $module->l('Ignore this field if you don\'t use the Multistore tool. If you leave this field empty, the default shop will be used.', 'EIAHelper'),
//                    ],
            ],
            'combinations' => [
                'no' => ['label' => '-- ' . $module->l('Ignore this column', 'EIAHelper') . ' --'],
                'id' => ['type' => 'number', 'label' => $module->l('Combination ID', 'EIAHelper')],
                'reference' => ['type' => 'string', 'label' => $module->l('Combination Reference', 'EIAHelper')],
                'id_product' => ['type' => 'number', 'label' => $module->l('Product ID', 'EIAHelper')],
                'product_reference' => ['type' => 'string', 'label' => $module->l('Product Reference', 'EIAHelper')],
                'product_name' => ['type' => 'string', 'label' => $module->l('Product Name', 'EIAHelper')],
                'group_type' => ['type' => 'string', 'label' => $module->l('Attribute Type (x,y,z...)', 'EIAHelper') . ' *'],
                'group_name' => ['type' => 'string', 'label' => $module->l('Attribute Name (x,y,z...)', 'EIAHelper') . ' *'],
                'group_public_name' => ['type' => 'string', 'label' => $module->l('Attribute Public Name (x,y,z...)', 'EIAHelper') . ' *'],
                'attribute' => ['type' => 'string', 'label' => $module->l('Value:Color / Value (x,y,z...)', 'EIAHelper') . ' *'],
                'supplier_reference' => ['type' => 'string', 'label' => $module->l('Supplier Reference', 'EIAHelper')],
                'location' => ['type' => 'string', 'label' => $module->l('Location', 'EIAHelper')],
                'ean13' => ['type' => 'string', 'label' => $module->l('EAN13', 'EIAHelper')],
                'upc' => ['type' => 'string', 'label' => $module->l('UPC', 'EIAHelper')],
                'isbn' => ['type' => 'string', 'label' => $module->l('ISBN', 'EIAHelper')],
                'mpn' => ['type' => 'string', 'label' => $module->l('MPN', 'EIAHelper')],
                'wholesale_price' => ['type' => 'number', 'label' => $module->l('Cost (Wholesale) Price', 'EIAHelper')],
                'price' => ['type' => 'number', 'label' => $module->l('Impact on Price', 'EIAHelper')],
                'unit_price_impact' => ['type' => 'number', 'label' => $module->l('Impact on Unit Price', 'EIAHelper')],
                'ecotax' => ['type' => 'number', 'label' => $module->l('Ecotax', 'EIAHelper')],
                'quantity' => ['type' => 'number', 'label' => $module->l('Quantity', 'EIAHelper')],
                'minimal_quantity' => ['type' => 'number', 'label' => $module->l('Minimal Quantity', 'EIAHelper')],
                'physical_quantity' => ['type' => 'number', 'label' => $module->l('Physical Quantity', 'EIAHelper')],
                'reserved_quantity' => ['type' => 'number', 'label' => $module->l('Reserved Quantity', 'EIAHelper')],
                'stock_location' => ['type' => 'string', 'label' => $module->l('Stock Location', 'EIAHelper')],
                'low_stock_threshold' => ['type' => 'number', 'label' => $module->l('Low Stock Level', 'EIAHelper')],
                'low_stock_alert' => ['type' => 'bool', 'label' => $module->l('Low Stock Alert (0 = No, 1 = Yes)', 'EIAHelper')],
                'weight' => ['type' => 'number', 'label' => $module->l('Impact on Weight', 'EIAHelper')],
                'default_on' => ['type' => 'bool', 'label' => $module->l('Is Default (0 = No, 1 = Yes)', 'EIAHelper')],
                'available_date' => ['type' => 'date', 'label' => $module->l('Availability Date', 'EIAHelper')],
                'image_url' => ['type' => 'string', 'label' => $module->l('Image URLs (x,y,z...)', 'EIAHelper')],
//                'image_position' => ['type' => 'string', 'label' => $module->l('Image Positions (x,y,z...)', 'EIAHelper')],
                'image_alt' => ['type' => 'string', 'label' => $module->l('Image Alt Texts (x,y,z...)', 'EIAHelper')],
//                    'shop' => [
//                        'type' => 'string', 'label' => $module->l('ID / Name of shop', 'EIAHelper'),
//                        'help' => $module->l('Ignore this field if you don\'t use the Multistore tool. If you leave this field empty, the default shop will be used.', 'EIAHelper'),
//                    ],
                'out_of_stock' => ['type' => 'number', 'label' => $module->l('Action When out of Stock', 'EIAHelper')],
//                'depends_on_stock' => [
//                    'type' => 'string', 'label' => $module->l('Depends on Stock', 'EIAHelper'),
//                    'help' => $module->l('0 = Use quantity set in product, 1 = Use quantity from warehouse.', 'EIAHelper'),
//                ],
//                    'advanced_stock_management' => [
//                        'type' => 'bool', 'label' => $module->l('Advanced Stock Management', 'EIAHelper'),
//                        'help' => $module->l('Enable Advanced Stock Management on product (0 = No, 1 = Yes)', 'EIAHelper'),
//                    ],
                'warehouse' => ['type' => 'string', 'label' => $module->l('Warehouses (Reference:Name:Location) (x,y,z...)', 'EIAHelper')],
            ],
            'features' => [
                'no' => ['label' => '-- ' . $module->l('Ignore this column', 'EIAHelper') . ' --'],
                'id' => ['type' => 'number', 'label' => $module->l('Feature ID', 'EIAHelper')],
                'name' => ['type' => 'string', 'label' => $module->l('Feature Name', 'EIAHelper')],
                'position' => ['type' => 'string', 'label' => $module->l('Feature Position', 'EIAHelper')],
                'feature_value_id' => ['type' => 'number', 'label' => $module->l('Feature Value ID', 'EIAHelper')],
                'feature_value' => ['type' => 'string', 'label' => $module->l('Feature Value', 'EIAHelper')],
                'feature_value_custom' => ['type' => 'string', 'label' => $module->l('Feature Value Is Custom', 'EIAHelper')],
            ],
            'attributes' => [
                'no' => ['label' => '-- ' . $module->l('Ignore this column', 'EIAHelper') . ' --'],
                'id' => ['type' => 'number', 'label' => $module->l('Attribute ID', 'EIAHelper')],
                'name' => ['type' => 'string', 'label' => $module->l('Attribute Name', 'EIAHelper')],
                'public_name' => ['type' => 'string', 'label' => $module->l('Attribute Public Name', 'EIAHelper')],
                'group_type' => ['type' => 'string', 'label' => $module->l('Attribute Group Type', 'EIAHelper')],
                'position' => ['type' => 'string', 'label' => $module->l('Attribute Position', 'EIAHelper')],
                'attribute_id' => ['type' => 'number', 'label' => $module->l('Attribute Value ID', 'EIAHelper')],
                'attribute_name' => ['type' => 'string', 'label' => $module->l('Attribute Value', 'EIAHelper')],
                'attribute_color' => ['type' => 'string', 'label' => $module->l('Attribute Value Color', 'EIAHelper')],
                'attribute_position' => ['type' => 'string', 'label' => $module->l('Attribute Value Position', 'EIAHelper')],
            ],
            'packs' => [
                'no' => ['label' => '-- ' . $module->l('Ignore this column', 'EIAHelper') . ' --'],
                'id' => ['type' => 'number', 'label' => $module->l('Pack ID', 'EIAHelper')],
                'name' => ['type' => 'string', 'label' => $module->l('Pack Name', 'EIAHelper')],
                'reference' => ['type' => 'string', 'label' => $module->l('Pack Reference', 'EIAHelper')],
                'id_product' => ['type' => 'number', 'label' => $module->l('Product ID', 'EIAHelper')],
                'product_name' => ['type' => 'string', 'label' => $module->l('Product Name', 'EIAHelper')],
                'product_reference' => ['type' => 'string', 'label' => $module->l('Product Reference', 'EIAHelper')],
                'id_product_attribute' => ['type' => 'number', 'label' => $module->l('Combination ID', 'EIAHelper')],
                'product_attribute_reference' => ['type' => 'string', 'label' => $module->l('Combination Reference', 'EIAHelper')],
                'attribute' => ['type' => 'string', 'label' => $module->l('Attributes (x,y,z...)', 'EIAHelper')],
                'quantity' => ['type' => 'number', 'label' => $module->l('Quantity', 'EIAHelper')],
            ],
            'discounts' => [
                'no' => ['label' => '-- ' . $module->l('Ignore this column', 'EIAHelper') . ' --'],
                'id_specific_price' => ['type' => 'number', 'label' => $module->l('Specific Price ID', 'EIAHelper')],
                'id_specific_price_rule' => ['type' => 'number', 'label' => $module->l('Catalog Price Rule ID', 'EIAHelper')],
                'name' => ['type' => 'string', 'label' => $module->l('Catalog Price Rule Name', 'EIAHelper')],
                'conds' => ['type' => 'string', 'label' => $module->l('Catalog Price Rule Conditions', 'EIAHelper')],
                'id_product' => ['type' => 'number', 'label' => $module->l('Product ID', 'EIAHelper')],
                'product_reference' => ['type' => 'string', 'label' => $module->l('Product Reference', 'EIAHelper')],
                'product_name' => ['type' => 'string', 'label' => $module->l('Product Name', 'EIAHelper')],
                'id_product_attribute' => ['type' => 'number', 'label' => $module->l('Combination ID', 'EIAHelper')],
                'product_attribute_reference' => ['type' => 'string', 'label' => $module->l('Combination Reference', 'EIAHelper')],
                'attribute' => ['type' => 'string', 'label' => $module->l('Combination Attributes', 'EIAHelper')],
                'reduction' => ['type' => 'number', 'label' => $module->l('Reduction', 'EIAHelper')],
                'reduction_type' => ['type' => 'string', 'label' => $module->l('Reduction Type', 'EIAHelper')],
                'reduction_tax' => ['type' => 'bool', 'label' => $module->l('Reduction Tax (0 = No, 1 = Yes)', 'EIAHelper')],
                'from' => ['type' => 'date', 'label' => $module->l('From Date', 'EIAHelper')],
                'to' => ['type' => 'date', 'label' => $module->l('To Date', 'EIAHelper')],
                'price' => ['type' => 'number', 'label' => $module->l('Price', 'EIAHelper')],
                'from_quantity' => ['type' => 'number', 'label' => $module->l('From Quantity', 'EIAHelper')],
                'id_customer' => ['type' => 'number', 'label' => $module->l('Customer ID', 'EIAHelper')],
                'customer_email' => ['type' => 'string', 'label' => $module->l('Customer Email', 'EIAHelper')],
                'id_group' => ['type' => 'number', 'label' => $module->l('Group ID', 'EIAHelper')],
                'group_name' => ['type' => 'string', 'label' => $module->l('Group Name', 'EIAHelper')],
                'id_country' => ['type' => 'number', 'label' => $module->l('Country ID', 'EIAHelper')],
                'country_name' => ['type' => 'string', 'label' => $module->l('Country Name', 'EIAHelper')],
                'id_currency' => ['type' => 'number', 'label' => $module->l('Currency ID', 'EIAHelper')],
                'currency_iso_code' => ['type' => 'string', 'label' => $module->l('Currency ISO Code', 'EIAHelper')],
                'is_rule' => ['type' => 'bool', 'label' => $module->l('Is Rule', 'EIAHelper')],
            ],
            'carriers' => array(
                'no' => array('label' => '-- ' . $module->l('Ignore this column', 'EIAHelper') . ' --', 'EIAHelper'),
                'id' => array('type' => 'number', 'label' => $module->l('Carrier ID', 'EIAHelper')),
                'id_reference' => array('type' => 'number', 'label' => $module->l('Reference ID', 'EIAHelper')),
                'active' => array('type' => 'bool', 'label' => $module->l('Enabled (0 = No, 1 = Yes)', 'EIAHelper')),
                'name' => array('type' => 'string', 'label' => $module->l('Name', 'EIAHelper') . ' *', 'EIAHelper'),
                'delay' => array('type' => 'string', 'label' => $module->l('Transit Time', 'EIAHelper') . ' *', 'EIAHelper'),
                'id_tax_rules_group' => array('type' => 'number', 'label' => $module->l('Tax Rule ID', 'EIAHelper')),
                'tax_rules_group_name' => array('type' => 'string', 'label' => $module->l('Tax Rule Name', 'EIAHelper')),
                'url' => array('type' => 'string', 'label' => $module->l('Tracking URL', 'EIAHelper')),
                'logo_url' => array('label' => $module->l('Logo URL', 'EIAHelper')),
                'shipping_handling' => array('type' => 'bool', 'label' => $module->l('Shipping Handling (0 = No, 1 = Yes)', 'EIAHelper')),
                'range_behavior' => array('type' => 'number', 'label' => $module->l('Range Behavior (0/1)', 'EIAHelper')),
                'is_module' => array('type' => 'bool', 'label' => $module->l('Is Module (0 = No, 1 = Yes)', 'EIAHelper')),
                'is_free' => array('type' => 'bool', 'label' => $module->l('Is Free (0 = No, 1 = Yes)', 'EIAHelper')),
                'shipping_external' => array('type' => 'bool', 'label' => $module->l('External Shipping (0 = No, 1 = Yes)', 'EIAHelper')),
                'external_module_name' => array('type' => 'string', 'label' => $module->l('External Module Name', 'EIAHelper')),
                'shipping_method' => array('type' => 'number', 'label' => $module->l('Shipping Method (0/1/2)', 'EIAHelper')),
                'position' => array('type' => 'number', 'label' => $module->l('Position', 'EIAHelper')),
                'max_width' => array('type' => 'number', 'label' => $module->l('Max Width', 'EIAHelper')),
                'max_height' => array('type' => 'number', 'label' => $module->l('Max Height', 'EIAHelper')),
                'max_depth' => array('type' => 'number', 'label' => $module->l('Max Depth', 'EIAHelper')),
                'max_weight' => array('type' => 'number', 'label' => $module->l('Max Weight', 'EIAHelper')),
                'grade' => array('type' => 'number', 'label' => $module->l('Speed Grade', 'EIAHelper')),
                'id_groups' => ['type' => 'string', 'label' => $module->l('Group IDS (x,y,z...)', 'EIAHelper')],
                'group_names' => ['type' => 'string', 'label' => $module->l('Group Names (x,y,z...)', 'EIAHelper')],
                'id_zones' => ['type' => 'string', 'label' => $module->l('Zone IDs (x,y,z...)', 'EIAHelper')],
                'zone_names' => ['type' => 'string', 'label' => $module->l('Zone Names (Name:Active) (x,y,z...)', 'EIAHelper')],
                'price_range' => ['type' => 'string', 'label' => $module->l('Price Ranges (Min - Max) (x,y,z...)', 'EIAHelper')],
                'price_range_price' => ['type' => 'string', 'label' => $module->l('Zone Prices by Total Price (x,y,z...)', 'EIAHelper')],
                'weight_range' => ['type' => 'string', 'label' => $module->l('Weight Ranges (Min - Max) (x,y,z...)', 'EIAHelper')],
                'weight_range_price' => ['type' => 'string', 'label' => $module->l('Zone Prices by Total Weight (x,y,z...)', 'EIAHelper')],
            ),
            'brands' => array(
                'no' => array('label' => '-- ' . $module->l('Ignore this column', 'EIAHelper') . ' --', 'EIAHelper'),
                'id' => array('type' => 'number', 'label' => $module->l('Brand ID', 'EIAHelper')),
                'active' => array('type' => 'bool', 'label' => $module->l('Enabled (0 = No, 1 = Yes)', 'EIAHelper')),
                'name' => array('type' => 'string', 'label' => $module->l('Name', 'EIAHelper') . ' *', 'EIAHelper'),
                'description' => array('type' => 'string', 'label' => $module->l('Description', 'EIAHelper')),
                'short_description' => array('type' => 'string', 'label' => $module->l('Short Description', 'EIAHelper')),
                'meta_title' => array('type' => 'string', 'label' => $module->l('Meta Title', 'EIAHelper')),
                'meta_keywords' => array('type' => 'string', 'label' => $module->l('Meta Keywords', 'EIAHelper')),
                'meta_description' => array('type' => 'string', 'label' => $module->l('Meta Description', 'EIAHelper')),
                'image' => array('label' => $module->l('Image URL', 'EIAHelper')),
                'date_add' => array('type' => 'date', 'label' => $module->l('Creation Date', 'EIAHelper')),
            ),
            'suppliers' => array(
                'no' => array('label' => '-- ' . $module->l('Ignore this column', 'EIAHelper') . ' --', 'EIAHelper'),
                'id' => array('type' => 'number', 'label' => $module->l('Supplier ID', 'EIAHelper')),
                'active' => array('type' => 'bool', 'label' => $module->l('Enabled (0 = No, 1 = Yes)', 'EIAHelper')),
                'name' => array('type' => 'string', 'label' => $module->l('Name', 'EIAHelper') . ' *', 'EIAHelper'),
                'description' => array('type' => 'string', 'label' => $module->l('Description', 'EIAHelper')),
                'meta_title' => array('type' => 'string', 'label' => $module->l('Meta Title', 'EIAHelper')),
                'meta_keywords' => array('type' => 'string', 'label' => $module->l('Meta Keywords', 'EIAHelper')),
                'meta_description' => array('type' => 'string', 'label' => $module->l('Meta Description', 'EIAHelper')),
                'image' => array('label' => $module->l('Image URL', 'EIAHelper')),
                'date_add' => array('type' => 'date', 'label' => $module->l('Creation Date', 'EIAHelper')),
            ),
            'customers' => [
                'no' => ['label' => '-- ' . $module->l('Ignore this column', 'EIAHelper') . ' --'],
                'id' => ['type' => 'number', 'label' => $module->l('Customer ID', 'EIAHelper')],
                'active' => ['type' => 'bool', 'label' => $module->l('Enabled (0 = No, 1 = Yes)', 'EIAHelper')],
                'id_gender' => ['type' => 'string', 'label' => $module->l('Title ID (1 = Mr, 2 = Mrs, 0 = else)', 'EIAHelper')],
                'email' => ['type' => 'string', 'label' => $module->l('Email', 'EIAHelper') . ' *'],
                'passwd' => ['type' => 'string', 'label' => $module->l('Current Password (Encrypted)', 'EIAHelper') . ' **'],
                'new_passwd' => ['type' => 'string', 'label' => $module->l('New Password', 'EIAHelper') . ' **'],
                'firstname' => ['type' => 'string', 'label' => $module->l('First Name', 'EIAHelper') . ' *'],
                'lastname' => ['type' => 'string', 'label' => $module->l('Last Name', 'EIAHelper') . ' *'],
                'birthday' => ['type' => 'date', 'label' => $module->l('Birthday', 'EIAHelper')],
                'date_add' => ['type' => 'date', 'label' => $module->l('Registration Date', 'EIAHelper')],
                'is_guest' => ['type' => 'bool', 'label' => $module->l('Is Guest (0 = No, 1 = Yes)', 'EIAHelper')],
                'id_lang' => ['type' => 'number', 'label' => $module->l('Customer Language ID', 'EIAHelper')],
                'lang_iso_code' => ['type' => 'string', 'label' => $module->l('Customer Language ISO', 'EIAHelper')],
                'newsletter' => ['type' => 'bool', 'label' => $module->l('Newsletter (0 = No, 1 = Yes)', 'EIAHelper')],
                'newsletter_date_add' => ['type' => 'date', 'label' => $module->l('Newsletter Subscription Date', 'EIAHelper')],
                'optin' => ['type' => 'bool', 'label' => $module->l('Opt-in (0 = No, 1 = Yes)', 'EIAHelper')],
                'note' => ['type' => 'string', 'label' => $module->l('Private Note', 'EIAHelper')],
                'id_default_group' => ['type' => 'string', 'label' => $module->l('Default Group ID', 'EIAHelper')],
                'default_group_name' => ['type' => 'string', 'label' => $module->l('Default Group Name', 'EIAHelper')],
                'id_groups' => ['type' => 'string', 'label' => $module->l('Group IDs (x,y,z...)', 'EIAHelper')],
                'group_names' => ['type' => 'string', 'label' => $module->l('Group Names (x,y,z...)', 'EIAHelper')],
                'company' => ['type' => 'string', 'label' => $module->l('Company', 'EIAHelper')],
                'siret' => ['type' => 'string', 'label' => $module->l('SIRET', 'EIAHelper')],
                'ape' => ['type' => 'string', 'label' => $module->l('APE', 'EIAHelper')],
                'website' => ['type' => 'string', 'label' => $module->l('Website', 'EIAHelper')],
                'outstanding_allow_amount' => ['type' => 'number', 'label' => $module->l('Allowed Outstanding Amount', 'EIAHelper')],
                'max_payment_days' => ['type' => 'number', 'label' => $module->l('Maximum Number of Payment Days', 'EIAHelper')],
                'id_risk' => ['type' => 'number', 'label' => $module->l('Risk ID', 'EIAHelper')],
            ],
            'groups' => [
                'no' => ['label' => '-- ' . $module->l('Ignore this column', 'EIAHelper') . ' --'],
                'id' => ['type' => 'number', 'label' => $module->l('Group ID', 'EIAHelper')],
                'name' => ['type' => 'string', 'label' => $module->l('Name', 'EIAHelper') . ' *'],
                'reduction' => ['type' => 'number', 'label' => $module->l('Reduction', 'EIAHelper')],
                'price_display_method' => ['type' => 'bool', 'label' => $module->l('Price Display Method (0 = Tax Included, 1 = Tax Excluded)', 'EIAHelper')],
                'show_prices' => ['type' => 'bool', 'label' => $module->l('Show Prices (0 = No, 1 = Yes)', 'EIAHelper')],
                'date_add' => ['type' => 'date', 'label' => $module->l('Creation Date', 'EIAHelper')],
            ],
            'addresses' => [
                'no' => ['label' => '-- ' . $module->l('Ignore this column', 'EIAHelper') . ' --'],
                'id' => ['type' => 'number', 'label' => $module->l('Address ID', 'EIAHelper')],
                'active' => ['type' => 'bool', 'label' => $module->l('Enabled (0 = No, 1 = Yes)', 'EIAHelper')],
                'address1' => ['type' => 'string', 'label' => $module->l('Address', 'EIAHelper') . ' *'],
                'address2' => ['type' => 'string', 'label' => $module->l('Address 2', 'EIAHelper')],
                'alias' => ['type' => 'string', 'label' => $module->l('Alias', 'EIAHelper') . ' *'],
                'company' => ['type' => 'string', 'label' => $module->l('Company', 'EIAHelper')],
                'firstname' => ['type' => 'string', 'label' => $module->l('First Name', 'EIAHelper') . ' *'],
                'lastname' => ['type' => 'string', 'label' => $module->l('Last Name', 'EIAHelper') . ' *'],
                'id_customer' => ['type' => 'number', 'label' => $module->l('Customer ID', 'EIAHelper') . ' **'],
                'customer_email' => ['type' => 'string', 'label' => $module->l('Customer Email', 'EIAHelper') . ' **'],
                'id_manufacturer' => ['type' => 'number', 'label' => $module->l('Brand ID', 'EIAHelper')],
                'manufacturer' => ['type' => 'string', 'label' => $module->l('Brand Name', 'EIAHelper')],
                'id_supplier' => ['type' => 'number', 'label' => $module->l('Supplier ID', 'EIAHelper')],
                'supplier' => ['type' => 'string', 'label' => $module->l('Supplier Name', 'EIAHelper')],
                'postcode' => ['type' => 'string', 'label' => $module->l('Zip/Postal code', 'EIAHelper') . ' *'],
                'city' => ['type' => 'string', 'label' => $module->l('City', 'EIAHelper') . ' *'],
                'id_country' => ['type' => 'number', 'label' => $module->l('Country ID', 'EIAHelper') . ' **'],
                'country' => ['type' => 'string', 'label' => $module->l('Country Name', 'EIAHelper') . ' **'],
                'id_state' => ['type' => 'number', 'label' => $module->l('State ID', 'EIAHelper')],
                'state' => ['type' => 'string', 'label' => $module->l('State Name', 'EIAHelper')],
                'other' => ['type' => 'string', 'label' => $module->l('Other', 'EIAHelper')],
                'phone' => ['type' => 'string', 'label' => $module->l('Phone', 'EIAHelper')],
                'phone_mobile' => ['type' => 'string', 'label' => $module->l('Mobile Phone', 'EIAHelper')],
                'vat_number' => ['type' => 'string', 'label' => $module->l('VAT Number', 'EIAHelper')],
                'dni' => ['type' => 'string', 'label' => $module->l('DNI (Identification Number)', 'EIAHelper')],
                'date_add' => ['type' => 'date', 'label' => $module->l('Creation Date', 'EIAHelper')],
            ],
            'aliases' => [
                'no' => ['label' => '-- ' . $module->l('Ignore this column', 'EIAHelper') . ' --'],
                'id' => ['type' => 'number', 'label' => $module->l('Alias ID', 'EIAHelper')],
                'active' => ['type' => 'bool', 'label' => $module->l('Enabled (0 = No, 1 = Yes)', 'EIAHelper')],
                'alias' => ['type' => 'string', 'label' => $module->l('Alias', 'EIAHelper') . ' *'],
                'search' => ['type' => 'string', 'label' => $module->l('Search', 'EIAHelper') . ' *'],
            ],
            'stores' => [
                'no' => ['label' => '-- ' . $module->l('Ignore this column', 'EIAHelper') . ' --'],
                'id' => ['type' => 'number', 'label' => $module->l('Store ID', 'EIAHelper')],
                'active' => ['type' => 'bool', 'label' => $module->l('Enabled (0 = No, 1 = Yes)', 'EIAHelper')],
                'name' => ['type' => 'string', 'label' => $module->l('Name', 'EIAHelper')],
                'address1' => ['type' => 'string', 'label' => $module->l('Address', 'EIAHelper') . ' *'],
                'address2' => ['type' => 'string', 'label' => $module->l('Address 2', 'EIAHelper')],
                'city' => ['type' => 'string', 'label' => $module->l('City', 'EIAHelper') . ' *'],
                'id_country' => ['type' => 'number', 'label' => $module->l('Country ID', 'EIAHelper') . ' **'],
                'country' => ['type' => 'string', 'label' => $module->l('Country Name', 'EIAHelper') . ' **'],
                'id_state' => ['type' => 'number', 'label' => $module->l('State ID', 'EIAHelper')],
                'state' => ['type' => 'string', 'label' => $module->l('State Name', 'EIAHelper')],
                'latitude' => ['type' => 'number', 'label' => $module->l('Latitude', 'EIAHelper') . ' *'],
                'longitude' => ['type' => 'number', 'label' => $module->l('Longitude', 'EIAHelper') . ' *'],
                'postcode' => ['type' => 'string', 'label' => $module->l('Zip/Postal Code', 'EIAHelper')],
                'phone' => ['type' => 'string', 'label' => $module->l('Phone', 'EIAHelper')],
                'fax' => ['type' => 'string', 'label' => $module->l('Fax', 'EIAHelper')],
                'email' => ['type' => 'string', 'label' => $module->l('Email', 'EIAHelper')],
                'note' => ['type' => 'string', 'label' => $module->l('Note', 'EIAHelper')],
                'hours' => ['type' => 'string', 'label' => $module->l('Hours', 'EIAHelper')],
                'image' => ['label' => $module->l('Image URL', 'EIAHelper')],
                'date_add' => ['type' => 'date', 'label' => $module->l('Creation Date', 'EIAHelper')],
//                    'shop' => [
//                        'type' => 'string', 'label' => $module->l('ID / Name of shop', 'EIAHelper'),
//                        'help' => $module->l('Ignore this field if you don\'t use the Multistore tool. If you leave this field empty, the default shop will be used.', 'EIAHelper'),
//                    ],
            ],
            'warehouses' => [
                'no' => ['label' => '-- ' . $module->l('Ignore this column', 'EIAHelper') . ' --'],
                'id' => ['type' => 'number', 'label' => $module->l('Warehouse ID', 'EIAHelper')],
                'reference' => ['type' => 'string', 'label' => $module->l('Reference', 'EIAHelper') . ' *'],
                'name' => ['type' => 'string', 'label' => $module->l('Name', 'EIAHelper') . ' *'],
                'management_type' => ['type' => 'string', 'label' => $module->l('Management Type', 'EIAHelper')],
                'id_currency' => ['type' => 'string', 'label' => $module->l('Currency ISO', 'EIAHelper') . ' *'],
                'phone' => ['type' => 'string', 'label' => $module->l('Phone', 'EIAHelper')],
                'phone_mobile' => ['type' => 'string', 'label' => $module->l('Mobile Phone', 'EIAHelper')],
                'address1' => ['type' => 'string', 'label' => $module->l('Address', 'EIAHelper') . ' *'],
                'address2' => ['type' => 'string', 'label' => $module->l('Address 2', 'EIAHelper')],
                'postcode' => ['type' => 'string', 'label' => $module->l('ZIP/Postal Code', 'EIAHelper')],
                'city' => ['type' => 'string', 'label' => $module->l('City', 'EIAHelper') . ' *'],
                'country' => ['type' => 'string', 'label' => $module->l('Country Name', 'EIAHelper') . ' *'],
                'state' => ['type' => 'string', 'label' => $module->l('State Name', 'EIAHelper')],
                'id_employee' => ['type' => 'string', 'label' => $module->l('Manager Email', 'EIAHelper') . ' *'],
                'carriers' => ['type' => 'string', 'label' => $module->l('Carrier Names (x,y,z...)', 'EIAHelper')],
            ],
            'orders' => [
                'no' => ['label' => '-- ' . $module->l('Ignore this column', 'EIAHelper') . ' --'],
                'order.id_order' => ['type' => 'number', 'label' => $module->l('Order ID', 'EIAHelper')],
                'order.reference' => ['type' => 'string', 'label' => $module->l('Order Reference', 'EIAHelper')],
                'order.id_cart' => ['type' => 'number', 'label' => $module->l('Cart ID', 'EIAHelper')],
                'order.id_lang' => ['type' => 'number', 'label' => $module->l('Language ID', 'EIAHelper')],
                'order.lang_iso_code' => ['type' => 'string', 'label' => $module->l('Language ISO Code', 'EIAHelper')],
                'order.id_carrier' => ['type' => 'number', 'label' => $module->l('Carrier ID', 'EIAHelper')],
                'order.id_reference' => ['type' => 'number', 'label' => $module->l('Carrier Reference ID', 'EIAHelper')],
                'order.carrier_name' => ['type' => 'string', 'label' => $module->l('Carrier Name', 'EIAHelper')],
                'order.current_state' => ['type' => 'number', 'label' => $module->l('Current Status ID', 'EIAHelper')],
                'order.current_state_name' => ['type' => 'string', 'label' => $module->l('Current Status Name', 'EIAHelper')],
                'order.history' => ['type' => 'string', 'label' => $module->l('Order History (Status ID ! Date) (x,y,z...)', 'EIAHelper')],
                'order.secure_key' => ['type' => 'string', 'label' => $module->l('Secure Key', 'EIAHelper')],
                'order.payment' => ['type' => 'string', 'label' => $module->l('Payment', 'EIAHelper')],
                'order.id_currency' => ['type' => 'number', 'label' => $module->l('Order Currency ID', 'EIAHelper')],
                'order.currency_iso_code' => ['type' => 'string', 'label' => $module->l('Order Currency ISO Code', 'EIAHelper')],
                'order.conversion_rate' => ['type' => 'number', 'label' => $module->l('Conversion Rate', 'EIAHelper')],
                'order.message' => ['type' => 'string', 'label' => $module->l('Order Message (Type ! Message)', 'EIAHelper')],
                'order.module' => ['type' => 'string', 'label' => $module->l('Module', 'EIAHelper')],
                'order.recyclable' => ['type' => 'bool', 'label' => $module->l('Recyclable', 'EIAHelper')],
                'order.gift' => ['type' => 'bool', 'label' => $module->l('Gift', 'EIAHelper')],
                'order.gift_message' => ['type' => 'string', 'label' => $module->l('Gift Message', 'EIAHelper')],
                'order.mobile_theme' => ['type' => 'string', 'label' => $module->l('Mobile Theme', 'EIAHelper')],
                'order.shipping_number' => ['type' => 'string', 'label' => $module->l('Shipping Number', 'EIAHelper')],
                'order.total_discounts' => ['type' => 'number', 'label' => $module->l('Total Discounts', 'EIAHelper')],
                'order.total_discounts_tax_incl' => ['type' => 'number', 'label' => $module->l('Total Discounts (Tax included)', 'EIAHelper')],
                'order.total_discounts_tax_excl' => ['type' => 'number', 'label' => $module->l('Total Discounts (Tax excluded)', 'EIAHelper')],
                'order.total_paid' => ['type' => 'number', 'label' => $module->l('Total Paid', 'EIAHelper')],
                'order.total_paid_tax_incl' => ['type' => 'number', 'label' => $module->l('Total Paid (Tax included)', 'EIAHelper')],
                'order.total_paid_tax_excl' => ['type' => 'number', 'label' => $module->l('Total Paid (Tax excluded)', 'EIAHelper')],
                'order.total_paid_real' => ['type' => 'number', 'label' => $module->l('Total Paid Real', 'EIAHelper')],
                'order.total_products_wt' => ['type' => 'number', 'label' => $module->l('Total Products (Tax included)', 'EIAHelper')],
                'order.total_products' => ['type' => 'number', 'label' => $module->l('Total Products (Tax excluded)', 'EIAHelper')],
                'order.total_shipping' => ['type' => 'number', 'label' => $module->l('Total Shipping', 'EIAHelper')],
                'order.total_shipping_tax_incl' => ['type' => 'number', 'label' => $module->l('Total Shipping (Tax included)', 'EIAHelper')],
                'order.total_shipping_tax_excl' => ['type' => 'number', 'label' => $module->l('Total Shipping (Tax excluded)', 'EIAHelper')],
                'order.carrier_tax_rate' => ['type' => 'number', 'label' => $module->l('Carrier Tax Rate', 'EIAHelper')],
                'order.total_wrapping' => ['type' => 'number', 'label' => $module->l('Total Wrapping', 'EIAHelper')],
                'order.total_wrapping_tax_incl' => ['type' => 'number', 'label' => $module->l('Total Wrapping (Tax included)', 'EIAHelper')],
                'order.total_wrapping_tax_excl' => ['type' => 'number', 'label' => $module->l('Total Wrapping (Tax excluded)', 'EIAHelper')],
                'order.cart_rule_name' => ['type' => 'string', 'label' => $module->l('Cart Rule Name (x,y,z...)', 'EIAHelper')],
                'order.cart_rule_code' => ['type' => 'string', 'label' => $module->l('Cart Rule Code (x,y,z...)', 'EIAHelper')],
                'order.cart_rule_value' => ['type' => 'string', 'label' => $module->l('Cart Rule Value (x,y,z...)', 'EIAHelper')],
                'order.cart_rule_value_tax_excl' => ['type' => 'string', 'label' => $module->l('Cart Rule Value (Tax excluded) (x,y,z...)', 'EIAHelper')],
                'order.cart_rule_free_shipping' => ['type' => 'string', 'label' => $module->l('Cart Rule Free Shipping (x,y,z...)', 'EIAHelper')],
                'order.invoice_number' => ['type' => 'number', 'label' => $module->l('Default Invoice Number', 'EIAHelper')],
                'order.delivery_number' => ['type' => 'number', 'label' => $module->l('Delivery Number', 'EIAHelper')],
                'order.invoice_date' => ['type' => 'date', 'label' => $module->l('Invoice Date', 'EIAHelper')],
                'order.delivery_date' => ['type' => 'date', 'label' => $module->l('Delivery Date', 'EIAHelper')],
                'order.valid' => ['type' => 'bool', 'label' => $module->l('Order is Valid', 'EIAHelper')],
                'order.date_add' => ['type' => 'date', 'label' => $module->l('Order Date', 'EIAHelper')],
                'order.date_upd' => ['type' => 'date', 'label' => $module->l('Order Update Date', 'EIAHelper')],
                'order.id_order_invoice' => ['type' => 'string', 'label' => $module->l('Invoice ID (x,y,z...)', 'EIAHelper')],
                'order.inv_number' => ['type' => 'string', 'label' => $module->l('Invoice Number (x,y,z...)', 'EIAHelper')],
                'order.invoice_delivery_number' => ['type' => 'string', 'label' => $module->l('Invoice Delivery Number (x,y,z...)', 'EIAHelper')],
                'order.invoice_delivery_date' => ['type' => 'string', 'label' => $module->l('Invoice Delivery Date (x,y,z...)', 'EIAHelper')],
                'order.invoice_total_discount_tax_excl' => ['type' => 'string', 'label' => $module->l('Invoice Total Discounts (Tax excluded) (x,y,z...)', 'EIAHelper')],
                'order.invoice_total_discount_tax_incl' => ['type' => 'string', 'label' => $module->l('Invoice Total Discounts (Tax included) (x,y,z...)', 'EIAHelper')],
                'order.invoice_total_paid_tax_excl' => ['type' => 'string', 'label' => $module->l('Invoice Total Paid (Tax excluded) (x,y,z...)', 'EIAHelper')],
                'order.invoice_total_paid_tax_incl' => ['type' => 'string', 'label' => $module->l('Invoice Total Paid (Tax included) (x,y,z...)', 'EIAHelper')],
                'order.invoice_total_products' => ['type' => 'string', 'label' => $module->l('Invoice Total Products (Tax excluded) (x,y,z...)', 'EIAHelper')],
                'order.invoice_total_products_wt' => ['type' => 'string', 'label' => $module->l('Invoice Total Products (Tax included) (x,y,z...)', 'EIAHelper')],
                'order.invoice_total_shipping_tax_excl' => ['type' => 'string', 'label' => $module->l('Invoice Total Shipping (Tax excluded) (x,y,z...)', 'EIAHelper')],
                'order.invoice_total_shipping_tax_incl' => ['type' => 'string', 'label' => $module->l('Invoice Total Shipping (Tax included) (x,y,z...)', 'EIAHelper')],
                'order.invoice_shipping_tax_computation_method' => ['type' => 'string', 'label' => $module->l('Invoice Tax Computation Method (x,y,z...)', 'EIAHelper')],
                'order.invoice_total_wrapping_tax_excl' => ['type' => 'string', 'label' => $module->l('Invoice Total Wrapping (Tax excluded) (x,y,z...)', 'EIAHelper')],
                'order.invoice_total_wrapping_tax_incl' => ['type' => 'string', 'label' => $module->l('Invoice Total Wrapping (Tax included) (x,y,z...)', 'EIAHelper')],
                'order.invoice_shop_address' => ['type' => 'string', 'label' => $module->l('Invoice Shop Address (x,y,z...)', 'EIAHelper')],
//                'order.invoice_address' => ['type' => 'string', 'label' => $module->l('Invoice Address (x,y,z...)', 'EIAHelper')],
//                'order.invoice_delivery_address' => ['type' => 'string', 'label' => $module->l('Invoice Delivery Address (x,y,z...)', 'EIAHelper')],
                'order.invoice_note' => ['type' => 'string', 'label' => $module->l('Invoice Note (x,y,z...)', 'EIAHelper')],
                'order.invoice_date_add' => ['type' => 'string', 'label' => $module->l('Invoice Creation Date (x,y,z...)', 'EIAHelper')],
                'order.invoice_tax' => ['type' => 'string', 'label' => $module->l('Invoice Tax Type 1 : Tax ID 1 : Tax Name 1 : Tax Amount 1 & 2 & 3... (x,y,z...)', 'EIAHelper')],
                'order.id_invoice_payment' => ['type' => 'string', 'label' => $module->l('Invoice Payment ID 1 & 2 & 3... (x,y,z...)', 'EIAHelper')],
                'order.id_order_slip' => ['type' => 'string', 'label' => $module->l('Order Slip ID (x,y,z...)', 'EIAHelper')],
                'order.order_slip_total_products_tax_excl' => ['type' => 'string', 'label' => $module->l('Order Slip Products (Tax excluded) (x,y,z...)', 'EIAHelper')],
                'order.order_slip_total_products_tax_incl' => ['type' => 'string', 'label' => $module->l('Order Slip Products (Tax included) (x,y,z...)', 'EIAHelper')],
                'order.order_slip_total_shipping_tax_excl' => ['type' => 'string', 'label' => $module->l('Order Slip Shipping (Tax excluded) (x,y,z...)', 'EIAHelper')],
                'order.order_slip_total_shipping_tax_incl' => ['type' => 'string', 'label' => $module->l('Order Slip Shipping (Tax included) (x,y,z...)', 'EIAHelper')],
                'order.order_slip_amount' => ['type' => 'string', 'label' => $module->l('Order Slip Amount (x,y,z...)', 'EIAHelper')],
                'order.order_slip_shipping_cost' => ['type' => 'string', 'label' => $module->l('Order Slip Shipping Cost (x,y,z...)', 'EIAHelper')],
                'order.order_slip_shipping_cost_amount' => ['type' => 'string', 'label' => $module->l('Order Slip Shipping Cost Amount (x,y,z...)', 'EIAHelper')],
                'order.order_slip_partial' => ['type' => 'string', 'label' => $module->l('Order Slip is Partial (x,y,z...)', 'EIAHelper')],
                'order.order_slip_type' => ['type' => 'string', 'label' => $module->l('Order Slip Type (x,y,z...)', 'EIAHelper')],
                'order.order_slip_date_add' => ['type' => 'string', 'label' => $module->l('Order Slip Date (x,y,z...)', 'EIAHelper')],
                
                'order_detail.id_order_detail' => ['type' => 'number', 'label' => $module->l('Order Detail ID', 'EIAHelper')],
                'order_detail.id_order_invoice' => ['type' => 'number', 'label' => $module->l('Order Detail Invoice ID', 'EIAHelper')],
                'order_detail.product_id' => ['type' => 'number', 'label' => $module->l('Product ID', 'EIAHelper')],
                'order_detail.product_reference' => ['type' => 'string', 'label' => $module->l('Product Reference', 'EIAHelper')],
                'order_detail.product_ean13' => ['type' => 'string', 'label' => $module->l('Product EAN-13', 'EIAHelper')],
                'order_detail.product_upc' => ['type' => 'string', 'label' => $module->l('Product UPC', 'EIAHelper')],
                'order_detail.product_isbn' => ['type' => 'string', 'label' => $module->l('Product ISBN', 'EIAHelper')],
                'order_detail.product_mpn' => ['type' => 'string', 'label' => $module->l('Product MPN', 'EIAHelper')],
                'order_detail.product_lang_name' => ['type' => 'string', 'label' => $module->l('Product Name', 'EIAHelper')],
                'order_detail.product_name' => ['type' => 'string', 'label' => $module->l('Product Name with Combination', 'EIAHelper')],
                'order_detail.product_lang_description_short' => ['type' => 'string', 'label' => $module->l('Product Short Description', 'EIAHelper')],
                'order_detail.product_lang_description' => ['type' => 'string', 'label' => $module->l('Product Long Description', 'EIAHelper')],
                'order_detail.product_attribute_id' => ['type' => 'number', 'label' => $module->l('Combination ID', 'EIAHelper')],
                'order_detail.product_attribute_reference' => ['type' => 'string', 'label' => $module->l('Combination Reference', 'EIAHelper')],
                'order_detail.product_attribute_ean13' => ['type' => 'string', 'label' => $module->l('Combination EAN-13', 'EIAHelper')],
                'order_detail.product_attribute_upc' => ['type' => 'string', 'label' => $module->l('Combination UPC', 'EIAHelper')],
                'order_detail.product_attribute_isbn' => ['type' => 'string', 'label' => $module->l('Combination ISBN', 'EIAHelper')],
                'order_detail.product_attribute_mpn' => ['type' => 'string', 'label' => $module->l('Combination MPN', 'EIAHelper')],
                'order_detail.product_quantity' => ['type' => 'number', 'label' => $module->l('Product Quantity', 'EIAHelper')],
                'order_detail.product_quantity_in_stock' => ['type' => 'number', 'label' => $module->l('Product Quantity In Stock', 'EIAHelper')],
                'order_detail.product_quantity_refunded' => ['type' => 'number', 'label' => $module->l('Product Quantity Refunded', 'EIAHelper')],
                'order_detail.product_quantity_return' => ['type' => 'number', 'label' => $module->l('Product Quantity Returned', 'EIAHelper')],
                'order_detail.product_quantity_reinjected' => ['type' => 'number', 'label' => $module->l('Product Quantity Reinjected', 'EIAHelper')],
                'order_detail.product_price' => ['type' => 'number', 'label' => $module->l('Product Price', 'EIAHelper')],
                'order_detail.reduction_percent' => ['type' => 'number', 'label' => $module->l('Reduction Percent', 'EIAHelper')],
                'order_detail.reduction_amount' => ['type' => 'number', 'label' => $module->l('Reduction Amount', 'EIAHelper')],
                'order_detail.reduction_amount_tax_incl' => ['type' => 'number', 'label' => $module->l('Reduction Amount (Tax included)', 'EIAHelper')],
                'order_detail.reduction_amount_tax_excl' => ['type' => 'number', 'label' => $module->l('Reduction Amount (Tax excluded)', 'EIAHelper')],
                'order_detail.group_reduction' => ['type' => 'number', 'label' => $module->l('Group Reduction', 'EIAHelper')],
                'order_detail.product_quantity_discount' => ['type' => 'number', 'label' => $module->l('Product Quantity Discount', 'EIAHelper')],
                'order_detail.total_price_tax_incl' => ['type' => 'number', 'label' => $module->l('Product Total Price (Tax included)', 'EIAHelper')],
                'order_detail.total_price_tax_excl' => ['type' => 'number', 'label' => $module->l('Product Total Price (Tax excluded)', 'EIAHelper')],
                'order_detail.unit_price_tax_incl' => ['type' => 'number', 'label' => $module->l('Product Unit Price (Tax included)', 'EIAHelper')],
                'order_detail.unit_price_tax_excl' => ['type' => 'number', 'label' => $module->l('Product Unit Price (Tax excluded)', 'EIAHelper')],
                'order_detail.total_shipping_price_tax_incl' => ['type' => 'number', 'label' => $module->l('Total Shipping Price (Tax included)', 'EIAHelper')],
                'order_detail.total_shipping_price_tax_excl' => ['type' => 'number', 'label' => $module->l('Total Shipping Price (Tax excluded)', 'EIAHelper')],
                'order_detail.purchase_supplier_price' => ['type' => 'number', 'label' => $module->l('Purchase Price from Supplier', 'EIAHelper')],
                'order_detail.original_product_price' => ['type' => 'number', 'label' => $module->l('Original Product Price', 'EIAHelper')],
                'order_detail.original_wholesale_price' => ['type' => 'number', 'label' => $module->l('Original Wholesale Price', 'EIAHelper')],
                'order_detail.product_weight' => ['type' => 'number', 'label' => $module->l('Product Weight', 'EIAHelper')],
                'order_detail.id_manufacturer' => ['type' => 'number', 'label' => $module->l('Manufacturer ID', 'EIAHelper')],
                'order_detail.manufacturer_name' => ['type' => 'v', 'label' => $module->l('Manufacturer Name', 'EIAHelper')],
                'order_detail.id_supplier' => ['type' => 'number', 'label' => $module->l('Default Supplier ID', 'EIAHelper')],
                'order_detail.supplier_name' => ['type' => 'string', 'label' => $module->l('Default Supplier Name', 'EIAHelper')],
                'order_detail.product_supplier_reference' => ['type' => 'string', 'label' => $module->l('Product Supplier Reference', 'EIAHelper')],
                'order_detail.id_tax_rules_group' => ['type' => 'number', 'label' => $module->l('Tax Rules Group ID', 'EIAHelper')],
                'order_detail.tax_rules_group_name' => ['type' => 'string', 'label' => $module->l('Tax Rules Group Name', 'EIAHelper')],
                'order_detail.tax_computation_method' => ['type' => 'number', 'label' => $module->l('Tax Computation Method', 'EIAHelper')],
                'order_detail.tax_name' => ['type' => 'string', 'label' => $module->l('Tax Name (old)', 'EIAHelper')],
                'order_detail.tax_rate' => ['type' => 'number', 'label' => $module->l('Tax Rate (old)', 'EIAHelper')],
                'order_detail.id_tax' => ['type' => 'string', 'label' => $module->l('Tax ID (x,y,z...)', 'EIAHelper')],
                'order_detail.tax_name_new' => ['type' => 'string', 'label' => $module->l('Tax Name (x,y,z...)', 'EIAHelper')],
                'order_detail.unit_amount_tax' => ['type' => 'string', 'label' => $module->l('Unit Amount Tax (x,y,z...)', 'EIAHelper')],
                'order_detail.total_amount_tax' => ['type' => 'string', 'label' => $module->l('Total Amount Tax (x,y,z...)', 'EIAHelper')],
                'order_detail.ecotax' => ['type' => 'number', 'label' => $module->l('Ecotax', 'EIAHelper')],
                'order_detail.ecotax_tax_rate' => ['type' => 'number', 'label' => $module->l('Ecotax Tax Rate', 'EIAHelper')],
                'order_detail.discount_quantity_applied' => ['type' => 'bool', 'label' => $module->l('Discount Quantity Applied', 'EIAHelper')],
                'order_detail.download_hash' => ['type' => 'string', 'label' => $module->l('Download Hash', 'EIAHelper')],
                'order_detail.download_nb' => ['type' => 'number', 'label' => $module->l('Download Number', 'EIAHelper')],
                'order_detail.download_deadline' => ['type' => 'date', 'label' => $module->l('Download Deadline', 'EIAHelper')],
                'order_detail.id_warehouse' => ['type' => 'number', 'label' => $module->l('Warehouse ID', 'EIAHelper')],
                'order_detail.order_slip_product_quantity' => ['type' => 'string', 'label' => $module->l('Order Slip Product Quantity (x,y,z...)', 'EIAHelper')],
                'order_detail.order_slip_unit_price_tax_excl' => ['type' => 'string', 'label' => $module->l('Order Slip Unit Price (Tax excluded) (x,y,z...)', 'EIAHelper')],
                'order_detail.order_slip_unit_price_tax_incl' => ['type' => 'string', 'label' => $module->l('Order Slip Unit Price (Tax included) (x,y,z...)', 'EIAHelper')],
                'order_detail.order_slip_total_price_tax_excl' => ['type' => 'string', 'label' => $module->l('Order Slip Total Price (Tax excluded) (x,y,z...)', 'EIAHelper')],
                'order_detail.order_slip_total_price_tax_incl' => ['type' => 'string', 'label' => $module->l('Order Slip Total Price (Tax included) (x,y,z...)', 'EIAHelper')],
                'order_detail.order_slip_amount_tax_excl' => ['type' => 'string', 'label' => $module->l('Order Slip Amount (Tax excluded) (x,y,z...)', 'EIAHelper')],
                'order_detail.order_slip_amount_tax_incl' => ['type' => 'string', 'label' => $module->l('Order Slip Amount (Tax included) (x,y,z...)', 'EIAHelper')],
                
                'customer.id_customer' => ['type' => 'number', 'label' => $module->l('Customer ID', 'EIAHelper')],
                'customer.email' => ['type' => 'string', 'label' => $module->l('Customer Email', 'EIAHelper') . ' *'],
                'customer.passwd' => ['type' => 'string', 'label' => $module->l('Customer Password', 'EIAHelper') . ' *'],
                'customer.firstname' => ['type' => 'string', 'label' => $module->l('Customer First Name', 'EIAHelper') . ' *'],
                'customer.lastname' => ['type' => 'string', 'label' => $module->l('Customer Last Name', 'EIAHelper') . ' *'],
                'customer.birthday' => ['type' => 'date', 'label' => $module->l('Customer Birthday', 'EIAHelper')],
                'customer.date_add' => ['type' => 'date', 'label' => $module->l('Customer Registration Date', 'EIAHelper')],
                'customer.is_guest' => ['type' => 'bool', 'label' => $module->l('Customer Is Guest (0 = No, 1 = Yes)', 'EIAHelper')],
                'customer.company' => ['type' => 'string', 'label' => $module->l('Customer Company', 'EIAHelper')],
                'customer.newsletter' => ['type' => 'bool', 'label' => $module->l('Newsletter (0 = No, 1 = Yes)', 'EIAHelper')],
                'customer.newsletter_date_add' => ['type' => 'date', 'label' => $module->l('Newsletter Subscription Date', 'EIAHelper')],
                'customer.note' => ['type' => 'string', 'label' => $module->l('Customer Private Note', 'EIAHelper')],
                'customer.default_group' => ['type' => 'string', 'label' => $module->l('Customer Default Group Name', 'EIAHelper')],
                'customer.groups' => ['type' => 'string', 'label' => $module->l('Customer Group Names (x,y,z...)', 'EIAHelper')],
                
                'payment.id_order_payment' => ['type' => 'string', 'label' => $module->l('Payment ID (x,y,z...)', 'EIAHelper')],
                'payment.id_currency' => ['type' => 'string', 'label' => $module->l('Payment Currency ID (x,y,z...)', 'EIAHelper') . ' *'],
                'payment.currency_iso_code' => ['type' => 'string', 'label' => $module->l('Payment Currency ISO Code (x,y,z...)', 'EIAHelper') . ' *'],
                'payment.amount' => ['type' => 'string', 'label' => $module->l('Payment Amount (x,y,z...)', 'EIAHelper')],
                'payment.date_add' => ['type' => 'string', 'label' => $module->l('Payment Date (x,y,z...)', 'EIAHelper')],
                'payment.payment_method' => ['type' => 'string', 'label' => $module->l('Payment Method (x,y,z...)', 'EIAHelper')],
                'payment.conversion_rate' => ['type' => 'string', 'label' => $module->l('Payment Conversion Rate (x,y,z...)', 'EIAHelper')],
                'payment.transaction_id' => ['type' => 'string', 'label' => $module->l('Transaction ID (x,y,z...)', 'EIAHelper')],
                'payment.card_number' => ['type' => 'string', 'label' => $module->l('Card Number (x,y,z...)', 'EIAHelper')],
                'payment.card_brand' => ['type' => 'string', 'label' => $module->l('Card Brand (x,y,z...)', 'EIAHelper')],
                'payment.card_expiration' => ['type' => 'string', 'label' => $module->l('Card Expiration Date (x,y,z...)', 'EIAHelper')],
                'payment.card_holder' => ['type' => 'string', 'label' => $module->l('Card Holder (x,y,z...)', 'EIAHelper')],
                
                'order.ids_order_carrier' => ['type' => 'string', 'label' => $module->l('Order Carrier ID (x,y,z...)', 'EIAHelper')],
                'order.ids_carrier' => ['type' => 'string', 'label' => $module->l('Carrier ID (x,y,z...)', 'EIAHelper')],
                'order.ids_reference' => ['type' => 'string', 'label' => $module->l('Carrier Reference ID (x,y,z...)', 'EIAHelper')],
                'order.carrier_names' => ['type' => 'string', 'label' => $module->l('Carrier Name (x,y,z...)', 'EIAHelper') . ' *'],
                'order.carrier_weight' => ['type' => 'string', 'label' => $module->l('Carrier Weight (x,y,z...)', 'EIAHelper') . ' *'],
                'order.carrier_tracking_number' => ['type' => 'string', 'label' => $module->l('Tracking Number (x,y,z...)', 'EIAHelper') . ' *'],
                'order.carrier_shipping_cost_tax_excl' => ['type' => 'string', 'label' => $module->l('Carrier Cost (Tax excluded) (x,y,z...)', 'EIAHelper')],
                'order.carrier_shipping_cost_tax_incl' => ['type' => 'string', 'label' => $module->l('Carrier Cost (Tax included) (x,y,z...)', 'EIAHelper')],
                'order.carrier_date_add' => ['type' => 'string', 'label' => $module->l('Carrier Creation Date (x,y,z...)', 'EIAHelper')],
                
                'address_invoice.id_address' => ['type' => 'number', 'label' => $module->l('Invoice Address ID', 'EIAHelper')],
                'address_invoice.firstname' => ['type' => 'string', 'label' => $module->l('Invoice Address Firstname', 'EIAHelper') . ' *'],
                'address_invoice.lastname' => ['type' => 'string', 'label' => $module->l('Invoice Address Lastname', 'EIAHelper') . ' *'],
                'address_invoice.alias' => ['type' => 'string', 'label' => $module->l('Invoice Address Alias', 'EIAHelper') . ' *'],
                'address_invoice.id_country' => ['type' => 'number', 'label' => $module->l('Invoice Address Country ID', 'EIAHelper')],
                'address_invoice.country_lang_name' => ['type' => 'string', 'label' => $module->l('Invoice Address Country Name', 'EIAHelper')],
                'address_invoice.country_iso_code' => ['type' => 'string', 'label' => $module->l('Invoice Address Country ISO Code', 'EIAHelper')],
                'address_invoice.id_state' => ['type' => 'number', 'label' => $module->l('Invoice Address State ID', 'EIAHelper')],
                'address_invoice.state_name' => ['type' => 'string', 'label' => $module->l('Invoice Address State Name', 'EIAHelper')],
                'address_invoice.state_iso_code' => ['type' => 'string', 'label' => $module->l('Invoice Address State ISO Code', 'EIAHelper')],
                'address_invoice.city' => ['type' => 'string', 'label' => $module->l('Invoice Address City', 'EIAHelper')],
                'address_invoice.other' => ['type' => 'string', 'label' => $module->l('Invoice Address Other', 'EIAHelper')],
                'address_invoice.address1' => ['type' => 'string', 'label' => $module->l('Invoice Address 1', 'EIAHelper')],
                'address_invoice.address2' => ['type' => 'string', 'label' => $module->l('Invoice Address 2', 'EIAHelper')],
                'address_invoice.postcode' => ['type' => 'string', 'label' => $module->l('Invoice Address Postcode', 'EIAHelper')],
                'address_invoice.company' => ['type' => 'string', 'label' => $module->l('Invoice Address Company', 'EIAHelper')],
                'address_invoice.vat_number' => ['type' => 'string', 'label' => $module->l('Invoice Address VAT Number', 'EIAHelper')],
                'address_invoice.dni' => ['type' => 'string', 'label' => $module->l('Invoice Address DNI', 'EIAHelper')],
                'address_invoice.phone' => ['type' => 'string', 'label' => $module->l('Invoice Address Phone', 'EIAHelper')],
                'address_invoice.phone_mobile' => ['type' => 'string', 'label' => $module->l('Invoice Address Mobile Phone', 'EIAHelper')],
                'address_delivery.id_address' => ['type' => 'number', 'label' => $module->l('Delivery Address ID', 'EIAHelper')],
                'address_delivery.firstname' => ['type' => 'string', 'label' => $module->l('Delivery Address Firstname', 'EIAHelper') . ' *'],
                'address_delivery.lastname' => ['type' => 'string', 'label' => $module->l('Delivery Address Lastname', 'EIAHelper') . ' *'],
                'address_delivery.alias' => ['type' => 'string', 'label' => $module->l('Delivery Address Alias', 'EIAHelper') . ' *'],
                'address_delivery.id_country' => ['type' => 'number', 'label' => $module->l('Delivery Address Country ID', 'EIAHelper')],
                'address_delivery.country_lang_name' => ['type' => 'string', 'label' => $module->l('Delivery Address Country Name', 'EIAHelper')],
                'address_delivery.country_iso_code' => ['type' => 'string', 'label' => $module->l('Delivery Address Country ISO Code', 'EIAHelper')],
                'address_delivery.id_state' => ['type' => 'number', 'label' => $module->l('Delivery Address State ID', 'EIAHelper')],
                'address_delivery.state_name' => ['type' => 'string', 'label' => $module->l('Delivery Address State Name', 'EIAHelper')],
                'address_delivery.state_iso_code' => ['type' => 'string', 'label' => $module->l('Delivery Address State ISO Code', 'EIAHelper')],
                'address_delivery.city' => ['type' => 'string', 'label' => $module->l('Delivery Address City', 'EIAHelper')],
                'address_delivery.other' => ['type' => 'string', 'label' => $module->l('Delivery Address Other', 'EIAHelper')],
                'address_delivery.address1' => ['type' => 'string', 'label' => $module->l('Delivery Address 1', 'EIAHelper')],
                'address_delivery.address2' => ['type' => 'string', 'label' => $module->l('Delivery Address 2', 'EIAHelper')],
                'address_delivery.postcode' => ['type' => 'string', 'label' => $module->l('Delivery Address Postcode', 'EIAHelper')],
                'address_delivery.company' => ['type' => 'string', 'label' => $module->l('Delivery Address Company', 'EIAHelper')],
                'address_delivery.vat_number' => ['type' => 'string', 'label' => $module->l('Delivery Address VAT Number', 'EIAHelper')],
                'address_delivery.dni' => ['type' => 'string', 'label' => $module->l('Delivery Address DNI', 'EIAHelper')],
                'address_delivery.phone' => ['type' => 'string', 'label' => $module->l('Delivery Address Phone', 'EIAHelper')],
                'address_delivery.phone_mobile' => ['type' => 'string', 'label' => $module->l('Delivery Address Mobile Phone', 'EIAHelper')],
                
                'order.id_shop' => ['type' => 'number', 'label' => $module->l('Shop ID', 'EIAHelper')],
                'order.shop_name' => ['type' => 'string', 'label' => $module->l('Shop Name', 'EIAHelper')],
                'order.id_shop_group' => ['type' => 'number', 'label' => $module->l('Shop Group ID', 'EIAHelper')],
                'order.shop_group_name' => ['type' => 'string', 'label' => $module->l('Shop Group Name', 'EIAHelper')],
            ],
        ];
        
        $this->fieldsInTree = [
            'addresses' => [
                'address.id_address' => 'Address_ID',
                'address.active' => 'Enabled',
                'address.address1' => 'Address_1',
                'address.address2' => 'Address_2',
                'address.alias' => 'Alias',
                'address.company' => 'Company',
                'address.firstname' => 'Firstname',
                'address.lastname' => 'Lastname',
                'customer.id_customer' => 'Customer_ID',
                'customer.email' => 'Customer_Email',
                'customer.firstname' => 'Customer_First_Name',
                'customer.lastname' => 'Customer_Last_Name',
                'address.id_manufacturer' => 'Brand_ID',
                'manufacturer.name' => 'Brand_Name',
                'address.id_supplier' => 'Supplier_ID',
                'supplier.name' => 'Supplier_Name',
                'address.postcode' => 'Postcode',
                'address.city' => 'City',
                'address.id_country' => 'Country_ID',
                'country_lang.name' => 'Country_Name',
                'state.id_state' => 'State_ID',
                'state.name' => 'State_Name',
                'address.other' => 'Other',
                'address.phone' => 'Phone',
                'address.phone_mobile' => 'Phone_Mobile',
                'address.vat_number' => 'VAT_Number',
                'address.dni' => 'DNI',
                'address.date_add' => 'Date_Created',
                'address.date_upd' => 'Date_Updated',
            ],
            'attributes' => [
                'attribute_group.id_attribute_group' => 'Attribute_ID',
                'attribute_group_lang.name' => 'Attribute_Name',
                'attribute_group_lang.public_name' => 'Attribute_Public_Name',
                'attribute_group.group_type' => 'Attribute_Group_Type',
                'attribute_group.position' => 'Attribute_Position',
                'attribute.id_attribute' => 'Attribute_Value_ID',
                'attribute_lang.name' => 'Attribute_Value',
                'attribute.color' => 'Attribute_Value_Color',
                'attribute.position' => 'Attribute_Value_Position',
            ],
            'features' => [
                'feature.id_feature' => 'Feature_ID',
                'feature_lang.name' => 'Feature_Name',
                'feature.position' => 'Feature_Position',
                'feature_value.id_feature_value' => 'Feature_Value_ID',
                'feature_value_lang.value' => 'Feature_Value',
                'feature_value.custom' => 'Feature_Value_Is_Custom',
            ],
            'brands' => [
                'manufacturer.id_manufacturer' => 'Brand_ID',
                'manufacturer.active' => 'Enabled',
                'manufacturer.name' => 'Name',
                'brand_link' => 'Link',
                'manufacturer_lang.description' => 'Description',
                'manufacturer_lang.short_description' => 'Short_Description',
                'manufacturer_lang.meta_title' => 'Meta_Title',
                'manufacturer_lang.meta_keywords' => 'Meta_Keywords',
                'manufacturer_lang.meta_description' => 'Meta_Description',
                'image_url' => 'Image_URL',
                'manufacturer.date_add' => 'Date_Created',
                'manufacturer.date_upd' => 'Date_Updated',
            ],
            'suppliers' => [
                'supplier.id_supplier' => 'Supplier_ID',
                'supplier.active' => 'Enabled',
                'supplier.name' => 'Name',
                'supplier_link' => 'Link',
                'supplier_lang.description' => 'Description',
                'supplier_lang.meta_title' => 'Meta_Title',
                'supplier_lang.meta_keywords' => 'Meta_Keywords',
                'supplier_lang.meta_description' => 'Meta_Description',
                'image_url' => 'Image_URL',
                'supplier.date_add' => 'Date_Created',
                'supplier.date_upd' => 'Date_Updated',
            ],
            'carriers' => [
                'carrier.id_carrier' => 'Carrier_ID',
                'carrier.id_reference' => 'Reference_ID',
                'carrier.active' => 'Enabled',
                'carrier.name' => 'Name',
                'carrier_lang.delay' => 'Transit_Time',
                'carrier.id_tax_rules_group' => 'Tax_Rule_ID',
                'carrier.tax_rules_group_name' => 'Tax_Rule_Name',
                'trg.name' => 'Tax_Rule_Name',
                'carrier.url' => 'Tracking_URL',
                'logo_url' => 'Logo_URL',
                'carrier.shipping_handling' => 'Shipping_Handling',
                'carrier.range_behavior' => 'Range_Behavior',
                'carrier.is_module' => 'Is_Module',
                'carrier.is_free' => 'Is_Free',
                'carrier.shipping_external' => 'External_Shipping',
                'carrier.external_module_name' => 'External_Module_Name',
                'carrier.shipping_method' => 'Shipping_Method',
                'carrier.position' => 'Position',
                'carrier.max_width' => 'Max_Width',
                'carrier.max_height' => 'Max_Height',
                'carrier.max_depth' => 'Max_Depth',
                'carrier.max_weight' => 'Max_Weight',
                'carrier.grade' => 'Speed_Grade',
                'carrier_group.ids' => 'Group_IDs',
                'carrier_group.names' => 'Group_Names',
                'carrier_zone.ids' => 'Zone_IDs',
                'carrier_zone.names' => 'Zone_Names',
                'range_price.ranges' => 'Price_Ranges',
                'range_price.price' => 'Zone_Prices_by_Total_Price',
                'range_weight.ranges' => 'Weight_Ranges',
                'range_weight.price' => 'Zone_Prices_by_Total_Weight',
            ],
            'packs' => [
                'pack.id_product_pack' => 'Pack_ID',
                'pack_name.name' => 'Pack_Name',
                'pack_name.reference' => 'Pack_Reference',
                'pack.id_product_item' => 'Product_ID',
                'product_lang.name' => 'Product_Name',
                'product.reference' => 'Product_Reference',
                'pack.id_product_attribute_item' => 'Combination_ID',
                'combination.reference' => 'Combination_Reference',
                'attributes.values' => 'Attributes',
                'pack.quantity' => 'Quantity',
            ],
            'discounts' => [
                'discount.id_specific_price' => 'Specific_Price_ID',
                'discount.id_specific_price_rule' => 'Catalog_Price_Rule_ID',
                'discount.spr_name' => 'Catalog_Price_Rule_Name',
                'discount.conds' => 'Catalog_Price_Rule_Conditions',
                'discount.id_product' => 'Product_ID',
                'discount.prod_reference' => 'Product_Reference',
                'discount.prod_name' => 'Product_Name',
                'discount.id_product_attribute' => 'Combination_ID',
                'discount.comb_reference' => 'Combination_Reference',
                'discount.comb_values' => 'Combination_Attributes',
                'discount.reduction' => 'Reduction',
                'discount.reduction_type' => 'Reduction_Type',
                'discount.reduction_tax' => 'Reduction_Tax',
                'discount.from' => 'From_Date',
                'discount.to' => 'To_Date',
                'discount.price' => 'Price',
                'discount.from_quantity' => 'From_Quantity',
                'discount.id_customer' => 'Customer_ID',
                'discount.email' => 'Customer_Email',
                'discount.id_group' => 'Group_ID',
                'discount.group_name' => 'Group_Name',
                'discount.id_country' => 'Country_ID',
                'discount.country_name' => 'Country_Name',
                'discount.id_currency' => 'Currency_ID',
                'discount.currency_iso_code' => 'Currency_ISO_Code',
                'discount.is_rule' => 'Is_Rule',
            ],
            'categories' => [
                'category.id_category' => 'Category_ID',
                'category.active' => 'Enabled',
                'category_lang.name' => 'Name',
                'category_link' => 'Link',
                'category.id_parent' => 'Parent_Category_ID',
                'parent.name' => 'Parent_Category_Name',
                'category_lang.description' => 'Description',
                'category_lang.link_rewrite' => 'Rewritten_URL',
                'category_lang.meta_title' => 'Meta_Title',
                'category_lang.meta_keywords' => 'Meta_Keywords',
                'category_lang.meta_description' => 'Meta_Description',
                'category.position' => 'Position',
                'image_url' => 'Image_URL',
                'category.date_add' => 'Creation_Date',
                'category.date_upd' => 'Update_Date',
                'category.is_root_category' => 'Is_Root',
                'category_group.ids' => 'Group_IDs',
                'category_group.names' => 'Group_Names',
                'group_reduction.reductions' => 'Group_Reductions',
            ],
            'aliases' => [
                'alias.id_alias' => 'Alias_ID',
                'alias.active' => 'Enabled',
                'alias.alias' => 'Alias',
                'alias.search' => 'Search',
            ],
            'groups' => [
                'groupp.id_group' => 'Group_ID',
                'group_lang.name' => 'Name',
                'groupp.reduction' => 'Reduction',
                'groupp.price_display_method' => 'Price_Display_Method',
                'groupp.show_prices' => 'Show_Prices',
                'groupp.date_add' => 'Creation_Date',
                'groupp.date_upd' => 'Update_Date',
            ],
            'stores' => [
                'store.id_store' => 'Store_ID',
                'store.active' => 'Enabled',
                'store.name' => 'Name',
                'store_lang.name' => 'Name',
                'store.address1' => 'Address',
                'store_lang.address1' => 'Address',
                'store.address2' => 'Address_2',
                'store_lang.address2' => 'Address_2',
                'store.city' => 'City',
                'store.id_country' => 'Country_ID',
                'country_lang.name' => 'Country_Name',
                'store.id_state' => 'State_ID',
                'state.name' => 'State_Name',
                'store.latitude' => 'Latitude',
                'store.longitude' => 'Longitude',
                'store.postcode' => 'Zip_Postal_Code',
                'store.phone' => 'Phone',
                'store.fax' => 'Fax',
                'store.email' => 'Email',
                'store.note' => 'Note',
                'store_lang.note' => 'Note',
                'store.hours' => 'Hours',
                'store_lang.hours' => 'Hours',
                'image_url' => 'Image_URL',
                'store.date_add' => 'Creation_Date',
                'store.date_upd' => 'Update_Date',
            ],
            'customers' => [
                'customer.id_customer' => 'Customer_ID',
                'customer.active' => 'Enabled',
                'customer.id_gender' => 'Title_ID',
                'customer.email' => 'Email',
                'customer.passwd' => 'Current_Password_Encrypted',
                'new_passwd' => 'New_Password',
                'customer.firstname' => 'First_Name',
                'customer.lastname' => 'Last_Name',
                'customer.birthday' => 'Birthday',
                'customer.date_add' => 'Registration_Date',
                'customer.date_upd' => 'Update_Date',
                'customer.is_guest' => 'Is_Guest',
                'customer.id_lang' => 'Language_ID',
                'lang.iso_code' => 'Customer_Language_ISO',
                'lang.name' => 'Language_Name',
                'customer.newsletter' => 'Newsletter',
                'customer.newsletter_date_add' => 'Newsletter_Subscription_Date',
                'customer.optin' => 'Opt_In',
                'customer.secure_key' => 'Secure_Key',
                'customer.note' => 'Private_Note',
                'customer.id_default_group' => 'Default_Group_ID',
                'default_group_lang.name' => 'Default_Group_Name',
                'groupp.ids' => 'Group_IDs',
                'groupp.names' => 'Group_Names',
                'customer.company' => 'Company',
                'customer.siret' => 'SIRET',
                'customer.ape' => 'APE',
                'customer.website' => 'website',
                'customer.outstanding_allow_amount' => 'Allowed_Outstanding_Amount',
                'customer.max_payment_days' => 'Maximum_Number_of_Payment_Days',
                'customer.id_risk' => 'Risk_ID',
                'risk_lang.name' => 'Risk Name',
            ],
            'combinations' => [
                'combination.id_product_attribute' => 'Combination_ID',
                'combination.reference' => 'Combination_Reference',
                'combination.id_product' => 'Product_ID',
                'product.reference' => 'Product_Reference',
                'product_lang.name' => 'Product_Name',
                'attributes.types' => 'Attribute_Type',
                'attributes.groups' => 'Attribute_Name',
                'attributes.public_name' => 'Attribute_Public_Name',
                'attributes.values' => 'Value',
                'combination.supplier_reference' => 'Supplier_Reference',
                'combination.location' => 'Location',
                'product.location' => 'Location',
                'combination.ean13' => 'EAN13',
                'combination.upc' => 'UPC',
                'combination.isbn' => 'ISBN',
                'combination.mpn' => 'MPN',
                'combination_shop.wholesale_price' => 'Cost_Price',
                'combination_shop.price' => 'Impact_on_Price',
                'combination_shop.unit_price_impact' => 'Impact_on_Unit_Price',
                'combination_shop.ecotax' => 'Ecotax',
                'stock_available.quantity' => 'Quantity',
                'combination_shop.minimal_quantity' => 'Minimal_Quantity',
                'stock_available.physical_quantity' => 'Physical_Quantity',
                'stock_available.reserved_quantity' => 'Reserved_Quantity',
                'stock_available.location' => 'Stock_Location',
                'combination_shop.low_stock_threshold' => 'Low_Stock_Level',
                'combination_shop.low_stock_alert' => 'Low_Stock_Alert',
                'combination_shop.weight' => 'Impact_on_Weight',
                'combination_shop.default_on' => 'Is_Default',
                'combination_shop.available_date' => 'Availability_Date',
                'image_urls' => 'Image_URLs',
                'image.texts' => 'Image_Alt_Texts',
                'stock_available.out_of_stock' => 'Action_When_out_of_Stock',
                'warehouse.name_ref_loc' => 'Warehouses',
            ],
            'products' => [
                'product.id_product' => 'Product_ID',
                'product.reference' => 'Reference',
                'product_shop.active' => 'Enabled',
                'product_lang.name' => 'Name',
                'product_link' => 'Link',
                'product.ean13' => 'EAN13',
                'product.upc' => 'UPC',
                'product.isbn' => 'ISBN',
                'product.mpn' => 'MPN',
                'product_shop.visibility' => 'Visibility',
                'product_shop.condition' => 'Condition',
                'product_shop.show_condition' => 'Show_Condition',
                'product.cache_is_pack' => 'Is_Pack',
                'product_lang.description_short' => 'Summary',
                'product_lang.description' => 'Description',
                'product_tag.tags' => 'Tags',
                'product_shop.available_for_order' => 'Available_for_Order',
                'product_shop.available_date' => 'Availability_Date',
                'product_shop.show_price' => 'Show_Price',
                'product_shop.date_add' => 'Creation_Date',
                'product_shop.date_upd' => 'Update_Date',
                'product_shop.online_only' => 'Online_Only',
                'product.is_virtual' => 'Is_Virtual',
                'file_url' => 'Virtual_File_URL',
                'product_download.display_filename' => 'Virtual_File_Displayed_Name',
                'product_download.filename' => 'Virtual_File_Name',
                'product_download.nb_downloadable' => 'Number_of_Allowed_Downloads',
                'product_download.date_expiration' => 'Expiration_Date_of_Download',
                'product_download.nb_days_accessible' => 'Number_of_Days_Accessible',
                'product_shop.pack_stock_type' => 'Pack_Quantity_Type',
                'shop.id_shop' => 'Shop_ID',
                'shop.name' => 'Shop_Name',
                'shop_group.id_shop_group' => 'Shop_Group_ID',
                'shop_group.name' => 'Shop_Group_Name',
                'product_shop.price' => 'Price_Tax_Excluded',
                'product_price_tax_incl' => 'Price_Tax_Included',
                'product_shop.wholesale_price' => 'Cost_Price',
                'product_shop.on_sale' => 'On_Sale_Badge',
                'specific_price_priority.priority' => 'Priority_Management',
                'product_shop.id_tax_rules_group' => 'Tax_Rule_ID',
                'tax_rules_group.name' => 'Tax_Rule_Name',
                'product_shop.ecotax' => 'Ecotax',
                'product_shop.unity' => 'Unity',
                'product_shop.unit_price' => 'Unit_Price',
                'product_lang.meta_title' => 'Meta_Title',
                'product_lang.meta_keywords' => 'Meta_Keywords',
                'product_lang.meta_description' => 'Meta_Description',
                'product_lang.link_rewrite' => 'Rewritten_URL',
                'product_shop.redirect_type' => 'Redirect_Type',
                'product_shop.id_type_redirected' => 'Target_Redirect_ID',
                'target_type.name' => 'Target_Redirect_Name',
                'product_shop.id_product_redirected' => 'Target_Redirect_ID',
                'target_product.name' => 'Target_Redirect_Name',
                'default_category.id_category' => 'Default_Category_ID',
                'default_category.name' => 'Default_Category_Name',
                'category.ids' => 'Category_IDs',
                'category.names' => 'Category_Names',
                'product.id_manufacturer' => 'Brand_ID',
                'manufacturer.name' => 'Brand_Name',
                'related_products.ids' => 'Related_Product_IDs',
                'related_products.names' => 'Related_Product_Names',
                'pack.product_ids' => 'Products_IDs_in_Pack',
                'pack.product_names' => 'Products_Names_in_Pack',
                'pack.quantity' => 'Products_Quantities_in_Pack',
                'carrier.ids' => 'Carrier_IDs',
                'carrier.names' => 'Carrier_Names',
                'product.width' => 'Width',
                'product.height' => 'Height',
                'product.depth' => 'Depth',
                'product.weight' => 'Weight',
                'product_lang.delivery_in_stock' => 'Delivery_Time_of_InStock_Products',
                'product_lang.delivery_out_stock' => 'Delivery_Time_OutOfStock_Products',
                'product_shop.additional_shipping_cost' => 'Additional_Shipping_Fees',
                'product.additional_delivery_times' => 'Delivery_Time',
                'product_sale.quantity' => 'Sold_Quantity',
                'product_sale.sale_nbr' => 'Number_of_Sales',
                'stock_available.quantity' => 'Quantity',
                'product_shop.minimal_quantity' => 'Minimal_Quantity',
                'stock_available.physical_quantity' => 'Physical_Quantity',
                'stock_available.reserved_quantity' => 'Reserved_Quantity',
                'stock_available.location' => 'Stock_Location',
                'product.location' => 'Location',
                'product_shop.low_stock_threshold' => 'Low_Stock_Level',
                'product_shop.low_stock_alert' => 'Low_Stock_Alert',
                'product_lang.available_now' => 'Label_When_in_Stock',
                'product_lang.available_later' => 'Label_When_Backorder_Allowed',
                'stock_available.out_of_stock' => 'Action_When_OutOf_Stock',
                'warehouse.name_ref_loc' => 'Warehouses',
                'product.quantity_discount' => 'Quantity_Discount',
                'image.cover_id' => 'Cover_Image_ID',
                'image.ids' => 'Image_IDs',
                'cover_image_url' => 'Cover_Image_URL',
                'image_urls' => 'Image_URLs',
                'image.texts' => 'Image_Alt_Texts',
                'feature.name_value_custom' => 'Features',
                'product_shop.customizable' => 'Is_Customizable',
                'product_shop.text_fields' => 'Number_of_Customization_Text_Fields',
                'product_shop.uploadable_files' => 'Number_of_Customization_File_Fields',
                'customization_field.name_type_req' => 'Customization_Fields',
                'product.cache_has_attachments' => 'Has_Attachments',
                'attachment.id_attachment' => 'Attachment_IDs',
                'attachment_url' => 'Attachment_URLs',
                'attachment.name' => 'Attachment_Names',
                'attachment.description' => 'Attachment_Descriptions',
                'product.id_supplier' => 'Default_Supplier_ID',
                'default_supplier.name' => 'Default_Supplier_Name',
                'product.supplier_reference' => 'Default_Supplier_Reference',
                'supplier.id_supplier' => 'Supplier_IDs',
                'supplier.name' => 'Supplier_Names',
                'supplier.product_supplier_reference' => 'Supplier_References',
                'supplier.product_supplier_price_te' => 'Supplier_Prices',
                'supplier.id_currency' => 'Supplier_Currency_IDs',
                'supplier.currency_iso_code' => 'Supplier_Currency_ISO_Codes',
            ],
            'orders' => [
                'order.id_order' => 'Order_ID',
                'order.reference' => 'Order_Reference',
                'order.id_cart' => 'Cart_ID',
                'order.id_lang' => 'Language_ID',
                'lang.iso_code' => 'Language_ISO_Code',
                'order.id_carrier' => 'Carrier_ID',
                'default_carrier.id_reference' => 'Carrier_Reference_ID',
                'default_carrier.name' => 'Carrier_Name',
                'order.current_state' => 'Current_Status_ID',
                'order_state.name' => 'Current_Status_Name',
                'order_history.history' => 'Order_History',
                'order.secure_key' => 'Secure_Key',
                'order.payment' => 'Payment',
                'order.id_currency' => 'Order_Currency_ID',
                'currency.iso_code' => 'Order_Currency_ISO_Code',
                'order.conversion_rate' => 'Conversion_Rate',
                'order_messages.message' => 'Order_Message',
                'order.module' => 'Module',
                'order.recyclable' => 'Recyclable',
                'order.gift' => 'Gift',
                'order.gift_message' => 'Gift_Message',
                'order.mobile_theme' => 'Mobile_Theme',
                'order.shipping_number' => 'Shipping_Number',
                'order.total_discounts' => 'Total_Discounts',
                'order.total_discounts_tax_incl' => 'Total_Discounts_Tax_included',
                'order.total_discounts_tax_excl' => 'Total_Discounts_Tax_excluded',
                'order.total_discounts_tax_incl - order.total_discounts_tax_excl' => 'Total_Discounts_Tax',
                'order.total_paid' => 'Total_Paid',
                'order.total_paid_tax_incl' => 'Total_Paid_Tax_included',
                'order.total_paid_tax_excl' => 'Total_Paid_Tax_excluded',
                'order.total_paid_real' => 'Total_Paid_Real',
                'order.total_paid_tax_incl - order.total_paid_tax_excl' => 'Total_Paid_Tax',
                'order.total_products_wt' => 'Total_Products_Tax_included',
                'order.total_products' => 'Total_Products_Tax_excluded',
                'order.total_products_wt - order.total_products' => 'Total_Products_Tax',
                'order.total_shipping' => 'Total_Shipping',
                'order.total_shipping_tax_incl' => 'Total_Shipping_Tax_included',
                'order.total_shipping_tax_excl' => 'Total_Shipping_Tax_excluded',
                'order.total_shipping_tax_incl - order.total_shipping_tax_excl' => 'Total_Shipping_Tax_Amount',
                'order.carrier_tax_rate' => 'Carrier_Tax_Rate',
                'order.total_wrapping' => 'Total_Wrapping',
                'order.total_wrapping_tax_incl' => 'Total_Wrapping_Tax_included',
                'order.total_wrapping_tax_excl' => 'Total_Wrapping_Tax_excluded',
                'cart_rule.id_cart_rule' => 'Cart_Rule_ID',
                'cart_rule.name' => 'Cart_Rule_Name',
                'cart_rule.code' => 'Cart_Rule_Code',
                'cart_rule.value' => 'Cart_Rule_Value',
                'cart_rule.value_tax_excl' => 'Cart_Rule_Value_Tax_excluded',
                'cart_rule.free_shipping' => 'Cart_Rule_Free_Shipping',
                'order.invoice_number' => 'Default_Invoice_Number',
                'order.delivery_number' => 'Delivery_Number',
                'order.invoice_date' => 'Invoice_Date',
                'order.delivery_date' => 'Delivery_Date',
                'order.valid' => 'Order_is_Valid',
                'order.date_add' => 'Order_Date',
                'order.date_upd' => 'Order_Update_Date',
                'order_invoice.id_order_invoice' => 'Invoice_ID',
                'order_invoice.number' => 'Invoice_Number',
                'order_invoice.delivery_number' => 'Invoice_Delivery_Number',
                'order_invoice.delivery_date' => 'Invoice_Delivery_Date',
                'order_invoice.total_discount_tax_excl' => 'Invoice_Total_Discounts_Tax_excluded',
                'order_invoice.total_discount_tax_incl' => 'Invoice_Total_Discounts_Tax_included',
                'order_invoice.total_paid_tax_excl' => 'Invoice_Total_Paid_Tax_excluded',
                'order_invoice.total_paid_tax_incl' => 'Invoice_Total_Paid_Tax_included',
                'order_invoice.total_products' => 'Invoice_Total_Products_Tax_excluded',
                'order_invoice.total_products_wt' => 'Invoice_Total_Products_Tax_included',
                'order_invoice.total_shipping_tax_excl' => 'Invoice_Total_Shipping_Tax_excluded',
                'order_invoice.total_shipping_tax_incl' => 'Invoice_Total_Shipping_Tax_included',
                'order_invoice.shipping_tax_computation_method' => 'Invoice_Tax_Computation_Method',
                'order_invoice.total_wrapping_tax_excl' => 'Invoice_Total_Wrapping_Tax_excluded',
                'order_invoice.total_wrapping_tax_incl' => 'Invoice_Total_Wrapping_Tax_included',
                'order_invoice.shop_address' => 'Invoice_Shop_Address',
                'order_invoice.note' => 'Invoice_Note',
                'order_invoice.date_add' => 'Invoice_Creation_Date',
                'order_invoice.invoice_tax' => 'Invoice_Tax',
                'order_invoice.id_invoice_payment' => 'Invoice_Payment_ID',
                'order_slip.id_order_slip' => 'Order_Slip_ID',
                'order_slip.total_products_tax_excl' => 'Order_Slip_Products_Tax_excluded',
                'order_slip.total_products_tax_incl' => 'Order_Slip_Products_Tax_included',
                'order_slip.total_products_tax_incl - order_slip.total_products_tax_excl' => 'Order_Slip_Products_Tax',
                'order_slip.total_shipping_tax_excl' => 'Order_Slip_Shipping_Tax_excluded',
                'order_slip.total_shipping_tax_incl' => 'Order_Slip_Shipping_Tax_included',
                'order_slip.total_shipping_tax_incl - order_slip.total_shipping_tax_excl' => 'Order_Slip_Shipping_Tax',
                'order_slip.amount' => 'Order_Slip_Amount',
                'order_slip.shipping_cost' => 'Order_Slip_Shipping_Cost',
                'order_slip.shipping_cost_amount' => 'Order_Slip_Shipping_Cost_Amount',
                'order_slip.partial' => 'Order_Slip_is_Partial',
                'order_slip.order_slip_type' => 'Order_Slip_Type',
                'order_slip.date_add' => 'Order_Slip_Date',
                'product.id_order_detail' => 'Order_Detail_ID',
                'product.id_order_invoice' => 'Order_Detail_Invoice_ID',
                'product.product_id' => 'Product_ID',
                'product.product_reference' => 'Product_Reference',
                'product.product_ean13' => 'Product_EAN-13',
                'product.product_upc' => 'Product_UPC',
                'product.product_isbn' => 'Product_ISBN',
                'product.product_mpn' => 'Product_MPN',
                'order_detail_lang.name' => 'Product_Name',
                'product.product_name' => 'Product_Name_with_Combination',
                'order_detail_lang.description_short' => 'Product_Short_Description',
                'order_detail_lang.description' => 'Product_Long_Description',
                'product_image' => 'Product_Image',
                'product.product_attribute_id' => 'Combination_ID',
                'product_attribute.reference' => 'Combination_Reference',
                'product_attribute.ean13' => 'Combination_EAN-13',
                'product_attribute.upc' => 'Combination_UPC',
                'product_attribute.isbn' => 'Combination_ISBN',
                'product_attribute.mpn' => 'Combination_MPN',
                'attribute_image' => 'Combination_Image',
                'product.product_quantity' => 'Product_Quantity',
                'product.product_quantity_in_stock' => 'Product_Quantity_In_Stock',
                'product.product_quantity_refunded' => 'Product_Quantity_Refunded',
                'product.product_quantity_return' => 'Product_Quantity_Returned',
                'product.product_quantity_reinjected' => 'Product_Quantity_Reinjected',
                'product.product_price' => 'Product_Price',
                'product.reduction_percent' => 'Reduction_Percent',
                'product.reduction_amount' => 'Reduction_Amount',
                'product.reduction_amount_tax_incl' => 'Reduction_Amount_Tax_included',
                'product.reduction_amount_tax_excl' => 'Reduction_Amount_Tax_excluded',
                'product.group_reduction' => 'Group_Reduction',
                'product.product_quantity_discount' => 'Product_Quantity_Discount',
                'product.total_price_tax_incl' => 'Product_Total_Price_Tax_included',
                'product.total_price_tax_excl' => 'Product_Total_Price_Tax_excluded',
                'product.unit_price_tax_incl' => 'Product_Unit_Price_Tax_included',
                'product.unit_price_tax_excl' => 'Product_Unit_Price_Tax_excluded',
                'product.total_shipping_price_tax_incl' => 'Total_Shipping_Price_Tax_included',
                'product.total_shipping_price_tax_excl' => 'Total_Shipping_Price_Tax_excluded',
                'product.purchase_supplier_price' => 'Purchase_Price_from_Supplier',
                'product.original_product_price' => 'Original_Product_Price',
                'product.original_wholesale_price' => 'Original_Wholesale_Price',
                'product.product_weight' => 'Product_Weight',
                'prod.id_manufacturer' => 'Manufacturer_ID',
                'manufacturer.name' => 'Manufacturer_Name',
                'prod.id_supplier' => 'Default_Supplier_ID',
                'default_supplier.name' => 'Default_Supplier_Name',
                'product.product_supplier_reference' => 'Product_Supplier_Reference',
                'product.id_tax_rules_group' => 'Tax_Rules_Group_ID',
                'tax_rules_group.name' => 'Tax_Rules_Group_Name',
                'product.tax_computation_method' => 'Tax_Computation_Method',
                'product.tax_name' => 'Tax_Name_old',
                'product.tax_rate' => 'Tax_Rate_old',
                'order_details_tax.id_tax' => 'Tax_ID',
                'order_details_tax.name' => 'Tax_Name',
                'order_details_tax.unit_amount_tax' => 'Unit_Amount_Tax',
                'order_details_tax.total_amount_tax' => 'Total_Amount_Tax',
                'product.ecotax' => 'Ecotax',
                'product.ecotax_tax_rate' => 'Ecotax_Tax_Rate',
                'product.discount_quantity_applied' => 'Discount_Quantity_Applied',
                'product.download_hash' => 'Download_Hash',
                'product.download_nb' => 'Download_Number',
                'product.download_deadline' => 'Download_Deadline',
                'product.id_warehouse' => 'Warehouse_ID',
                'order_slip_detail.product_quantity' => 'Order_Slip_Product_Quantity',
                'order_slip_detail.unit_price_tax_excl' => 'Order_Slip_Unit_Price_Tax_excluded',
                'order_slip_detail.unit_price_tax_incl' => 'Order_Slip_Unit_Price_Tax_included',
                'order_slip_detail.total_price_tax_excl' => 'Order_Slip_Total_Price_Tax_excluded',
                'order_slip_detail.total_price_tax_incl' => 'Order_Slip_Total_Price_Tax_included',
                'order_slip_detail.amount_tax_excl' => 'Order_Slip_Amount_Tax_excluded',
                'order_slip_detail.amount_tax_incl' => 'Order_Slip_Amount_Tax_included',
                'customer.id_customer' => 'Customer_ID',
                'customer.email' => 'Customer_Email',
                'customer.passwd' => 'Customer_Password',
                'customer.firstname' => 'Customer_First_Name',
                'customer.lastname' => 'Customer_Last_Name',
                'customer.birthday' => 'Customer_Birthday',
                'customer.date_add' => 'Customer_Registration_Date',
                'customer.is_guest' => 'Customer_Is_Guest',
                'customer.company' => 'Customer_Company',
                'customer.newsletter' => 'Newsletter',
                'customer.newsletter_date_add' => 'Newsletter_Subscription_Date',
                'customer.note' => 'Customer_Private_Note',
                'def_group.name' => 'Customer_Default_Group_Name',
                'groupp.group_names' => 'Customer_Group_Names',
                'payment.id_order_payment' => 'Payment_ID',
                'payment.id_currency' => 'Payment_Currency_ID',
                'payment.currency_iso_code' => 'Payment_Currency_ISO_Code',
                'payment.amount' => 'Payment_Amount',
                'payment.payment_dt_add' => 'Payment_Date',
                'payment.payment_method' => 'Payment_Method',
                'payment.conversion_rate' => 'Payment_Conversion_Rate',
                'payment.transaction_id' => 'Transaction_ID',
                'payment.card_number' => 'Card_Number',
                'payment.card_brand' => 'Card_Brand',
                'payment.card_expiration' => 'Card_Expiration_Date',
                'payment.card_holder' => 'Card_Holder',
                'carrier.id_order_carrier' => 'Order_Carrier_ID',
                'carrier.id_carrier' => 'Carrier_ID',
                'carrier.id_reference' => 'Carrier_Reference_ID',
                'carrier.name' => 'Carrier_Name',
                'carrier.weight' => 'Carrier_Weight',
                'carrier.tracking_number' => 'Tracking_Number',
                'carrier.shipping_cost_tax_excl' => 'Carrier_Cost_Tax_excluded',
                'carrier.shipping_cost_tax_incl' => 'Carrier_Cost_Tax_included',
                'carrier.shipping_cost_tax_amount' => 'Carrier_Tax_Amount',
                'carrier.date_add' => 'Carrier_Creation_Date',
                'order.id_address_invoice' => 'Invoice_Address_ID',
                'address_invoice.firstname' => 'Invoice_Address_Firstname',
                'address_invoice.lastname' => 'Invoice_Address_Lastname',
                'address_invoice.alias' => 'Invoice_Address_Alias',
                'address_invoice.id_country' => 'Invoice_Address_Country_ID',
                'invoice_country_lang.name' => 'Invoice_Address_Country_Name',
                'invoice_country.iso_code' => 'Invoice_Address_Country_ISO_Code',
                'address_invoice.id_state' => 'Invoice_Address_State_ID',
                'invoice_state.name' => 'Invoice_Address_State_Name',
                'invoice_state.iso_code' => 'Invoice_Address_State_ISO_Code',
                'address_invoice.city' => 'Invoice_Address_City',
                'address_invoice.other' => 'Invoice_Address_Other',
                'address_invoice.address1' => 'Invoice_Address_1',
                'address_invoice.address2' => 'Invoice_Address_2',
                'address_invoice.postcode' => 'Invoice_Address_Postcode',
                'address_invoice.company' => 'Invoice_Address_Company',
                'address_invoice.vat_number' => 'Invoice_Address_VAT_Number',
                'address_invoice.dni' => 'Invoice_Address_DNI',
                'address_invoice.phone' => 'Invoice_Address_Phone',
                'address_invoice.phone_mobile' => 'Invoice_Address_Mobile_Phone',
                'order.id_address_delivery' => 'Delivery_Address_ID',
                'address_delivery.firstname' => 'Delivery_Address_Firstname',
                'address_delivery.lastname' => 'Delivery_Address_Lastname',
                'address_delivery.alias' => 'Delivery_Address_Alias',
                'address_delivery.id_country' => 'Delivery_Address_Country_ID',
                'delivery_country_lang.name' => 'Delivery_Address_Country_Name',
                'delivery_country.iso_code' => 'Delivery_Address_Country_ISO_Code',
                'address_delivery.id_state' => 'Delivery_Address_State_ID',
                'delivery_state.name' => 'Delivery_Address_State_Name',
                'delivery_state.iso_code' => 'Delivery_Address_State_ISO_Code',
                'address_delivery.city' => 'Delivery_Address_City',
                'address_delivery.other' => 'Delivery_Address_Other',
                'address_delivery.address1' => 'Delivery_Address_1',
                'address_delivery.address2' => 'Delivery_Address_2',
                'address_delivery.postcode' => 'Delivery_Address_Postcode',
                'address_delivery.company' => 'Delivery_Address_Company',
                'address_delivery.vat_number' => 'Delivery_Address_VAT_Number',
                'address_delivery.dni' => 'Delivery_Address_DNI',
                'address_delivery.phone' => 'Delivery_Address_Phone',
                'address_delivery.phone_mobile' => 'Delivery_Address_Mobile_Phone',
                'shop.id_shop' => 'Shop_ID',
                'shop.name' => 'Shop_Name',
                'shop.id_shop_group' => 'Shop_Group_ID',
                'shop_group.name' => 'Shop_Group_Name',
            ],
        ];

        if (version_compare(_PS_VERSION_, '1.7', '>=')) {
//            unset($this->fields['products']['advanced_stock_management']);
//            unset($this->fields['products']['depends_on_stock']);
//            unset($this->fields['combinations']['depends_on_stock']);
        }
        
        if (version_compare(_PS_VERSION_, 8, '>=')) {
            unset($this->fields['carriers']['id_tax_rules_group']);
            unset($this->fields['carriers']['tax_rules_group_name']);
        }

        switch ($this->entity) {
            case 'categories':
                $this->available_fields = $this->fields['categories'];

                break;
            case 'products':
                $this->available_fields = $this->fields['products'];

                break;
            case 'combinations':
                $this->required_fields = [
                    'group_name',
                    'attribute',
                ];

                $this->available_fields = $this->fields['combinations'];

                break;
            case 'packs':
                $this->required_fields = [
                    'product_name',
                    'quantity'
                ];

                $this->available_fields = $this->fields['packs'];

                break;
            case 'features':
                $this->available_fields = $this->fields['features'];
                $this->required_fields = [
                    'name',
                    'feature_value'
                ];
                break;
            case 'attributes':
                $this->available_fields = $this->fields['attributes'];
                $this->required_fields = [
                    'name',
                    'attribute_name'
                ];
                break;
            case 'discounts':
                $this->available_fields = $this->fields['discounts'];

                break;
            case 'carriers':
                $this->required_fields = ['name', 'delay'];

                $this->available_fields = $this->fields['carriers'];

                break;
            case 'brands':
                $this->required_fields = array('name');

                $this->available_fields = $this->fields['brands'];

                break;
            case 'suppliers':
                $this->required_fields = array('name');

                $this->available_fields = $this->fields['suppliers'];

                break;
            case 'customers':
                //Overwrite required_fields AS only email is required whereas other entities
                $this->required_fields = ['email', 'passwd', 'lastname', 'firstname'];

                $this->available_fields = $this->fields['customers'];

                break;
            case 'warehouses':
                //Overwrite required_fields AS only email is required whereas other entities
                $this->required_fields = [
                    'reference',
                    'name',
                    'address1',
                    'city',
                    'country',
                    'id_employee',
                    'management_type',
                    'id_currency',
                ];

                $this->available_fields = $this->fields['warehouses'];

                break;
            case 'groups':
                //Overwrite required_fields AS only email is required whereas other entities
                $this->required_fields = ['name'];

                $this->available_fields = $this->fields['groups'];

                break;
            case 'addresses':
                //Overwrite required_fields
                $this->required_fields = [
                    'alias',
                    'lastname',
                    'firstname',
                    'address1',
                    'postcode',
                    'country',
                    'customer_email',
                    'city',
                ];

                $this->available_fields = $this->fields['addresses'];

                break;
            case 'aliases':
                //Overwrite required_fields
                $this->required_fields = [
                    'alias',
                    'search',
                ];

                $this->available_fields = $this->fields['aliases'];

                break;
            case 'stores':
                $this->required_fields = [
                    'address1',
                    'city',
                    'country',
                    'latitude',
                    'longitude',
                ];

                $this->available_fields = $this->fields['stores'];

                break;
            case 'orders':
                $this->required_fields = [
                ];

                $this->available_fields = $this->fields['orders'];

                break;
        }
    }

    public static $formatArray = array(
        'Y-m-d' => '%Y-%m-%d',
        'd/m/Y' => '%d/%m/%Y',
        'Y/m/d' => '%Y/%m/%d',
        'm/d/e' => '%m/%d/%e',
        'd.m.Y' => '%d.%m.%Y',
        'e/c/Y' => '%e/%c/%Y',
        'c/e/Y' => '%c/%e/%Y',
        'e.c.Y' => '%e.%c.%Y',
        'd b Y' => '%d %b %Y',
        'e b Y' => '%e %b %Y',
        'e b y' => '%e %b %y',
        'd M Y' => '%d %M %Y',
        'e M Y' => '%e %M %Y',
        'e M y' => '%e %M %y',
        'Ymd' => '%Y%m%d',
        'H:i:s' => ' %H:%i:%s',
        'k:i:s' => ' %k:%i:%s',
        'h:i:s p' => ' %h:%i:%s %p',
        'l:i:s p' => ' %l:%i:%s %p',
        'His' => ' %H%i%s',
        'no_time' => '',
    );
    private static $operators = array(
        'gt' => '>',
        'lt' => '<',
        'eq' => '=',
    );
    public static $mimeTypes = array(
        'ez' => 'application/andrew-inset',
        'hqx' => 'application/mac-binhex40',
        'cpt' => 'application/mac-compactpro',
        'doc' => 'application/msword',
        'oda' => 'application/oda',
        'pdf' => 'application/pdf',
        'ai' => 'application/postscript',
        'eps' => 'application/postscript',
        'ps' => 'application/postscript',
        'smi' => 'application/smil',
        'smil' => 'application/smil',
        'wbxml' => 'application/vnd.wap.wbxml',
        'wmlc' => 'application/vnd.wap.wmlc',
        'wmlsc' => 'application/vnd.wap.wmlscriptc',
        'bcpio' => 'application/x-bcpio',
        'vcd' => 'application/x-cdlink',
        'pgn' => 'application/x-chess-pgn',
        'cpio' => 'application/x-cpio',
        'csh' => 'application/x-csh',
        'dcr' => 'application/x-director',
        'dir' => 'application/x-director',
        'dxr' => 'application/x-director',
        'dvi' => 'application/x-dvi',
        'spl' => 'application/x-futuresplash',
        'gtar' => 'application/x-gtar',
        'hdf' => 'application/x-hdf',
        'js' => 'application/x-javascript',
        'skp' => 'application/x-koan',
        'skd' => 'application/x-koan',
        'skt' => 'application/x-koan',
        'skm' => 'application/x-koan',
        'latex' => 'application/x-latex',
        'nc' => 'application/x-netcdf',
        'cdf' => 'application/x-netcdf',
        'sh' => 'application/x-sh',
        'shar' => 'application/x-shar',
        'swf' => 'application/x-shockwave-flash',
        'sit' => 'application/x-stuffit',
        'sv4cpio' => 'application/x-sv4cpio',
        'sv4crc' => 'application/x-sv4crc',
        'tar' => 'application/x-tar',
        'tcl' => 'application/x-tcl',
        'tex' => 'application/x-tex',
        'texinfo' => 'application/x-texinfo',
        'texi' => 'application/x-texinfo',
        't' => 'application/x-troff',
        'tr' => 'application/x-troff',
        'roff' => 'application/x-troff',
        'man' => 'application/x-troff-man',
        'me' => 'application/x-troff-me',
        'ms' => 'application/x-troff-ms',
        'ustar' => 'application/x-ustar',
        'src' => 'application/x-wais-source',
        'xhtml' => 'application/xhtml+xml',
        'xht' => 'application/xhtml+xml',
        'zip' => 'application/zip',
        'au' => 'audio/basic',
        'snd' => 'audio/basic',
        'mid' => 'audio/midi',
        'midi' => 'audio/midi',
        'kar' => 'audio/midi',
        'mpga' => 'audio/mpeg',
        'mp2' => 'audio/mpeg',
        'mp3' => 'audio/mpeg',
        'aif' => 'audio/x-aiff',
        'aiff' => 'audio/x-aiff',
        'aifc' => 'audio/x-aiff',
        'm3u' => 'audio/x-mpegurl',
        'ram' => 'audio/x-pn-realaudio',
        'rm' => 'audio/x-pn-realaudio',
        'rpm' => 'audio/x-pn-realaudio-plugin',
        'ra' => 'audio/x-realaudio',
        'wav' => 'audio/x-wav',
        'pdb' => 'chemical/x-pdb',
        'xyz' => 'chemical/x-xyz',
        'bmp' => 'image/bmp',
        'gif' => 'image/gif',
        'ief' => 'image/ief',
        'jpeg' => 'image/jpeg',
        'jpg' => 'image/jpeg',
        'jpe' => 'image/jpeg',
        'png' => 'image/png',
        'tiff' => 'image/tiff',
        'tif' => 'image/tif',
        'djvu' => 'image/vnd.djvu',
        'djv' => 'image/vnd.djvu',
        'wbmp' => 'image/vnd.wap.wbmp',
        'ras' => 'image/x-cmu-raster',
        'pnm' => 'image/x-portable-anymap',
        'pbm' => 'image/x-portable-bitmap',
        'pgm' => 'image/x-portable-graymap',
        'ppm' => 'image/x-portable-pixmap',
        'rgb' => 'image/x-rgb',
        'xbm' => 'image/x-xbitmap',
        'xpm' => 'image/x-xpixmap',
        'xwd' => 'image/x-windowdump',
        'igs' => 'model/iges',
        'iges' => 'model/iges',
        'msh' => 'model/mesh',
        'mesh' => 'model/mesh',
        'silo' => 'model/mesh',
        'wrl' => 'model/vrml',
        'vrml' => 'model/vrml',
        'css' => 'text/css',
        'html' => 'text/html',
        'htm' => 'text/html',
        'asc' => 'text/plain',
        'txt' => 'text/plain',
        'rtx' => 'text/richtext',
        'rtf' => 'text/rtf',
        'sgml' => 'text/sgml',
        'sgm' => 'text/sgml',
        'tsv' => 'text/tab-seperated-values',
        'wml' => 'text/vnd.wap.wml',
        'wmls' => 'text/vnd.wap.wmlscript',
        'etx' => 'text/x-setext',
        'xml' => 'text/xml',
        'xsl' => 'text/xml',
        'mpeg' => 'video/mpeg',
        'mpg' => 'video/mpeg',
        'mpe' => 'video/mpeg',
        'qt' => 'video/quicktime',
        'mov' => 'video/quicktime',
        'mxu' => 'video/vnd.mpegurl',
        'avi' => 'video/x-msvideo',
        'movie' => 'video/x-sgi-movie',
        'ice' => 'x-conference-xcooltalk');

    public static function allEntities($module)
    {
        return array(
            'product' => array(
                'pEntity' => 'products',
                'plural' => $module->l('Products', 'EIAHelper'),
                'class' => 'EIAProductsExport',
                'position' => 9,
            ),
            'feature' => array(
                'pEntity' => 'features',
                'plural' => $module->l('Features', 'EIAHelper'),
                'class' => 'EIAFeaturesExport',
                'position' => 7,
            ),
            'attribute' => array(
                'pEntity' => 'attributes',
                'plural' => $module->l('Attributes', 'EIAHelper'),
                'class' => 'EIAAttributesExport',
                'position' => 8,
            ),
            'combination' => array(
                'pEntity' => 'combinations',
                'plural' => $module->l('Combinations', 'EIAHelper'),
                'class' => 'EIACombinationsExport',
                'position' => 10,
            ),
            'pack' => array(
                'pEntity' => 'packs',
                'plural' => $module->l('Packs', 'EIAHelper'),
                'class' => 'EIAPacksExport',
                'position' => 11,
            ),
            'discount' => array(
                'pEntity' => 'discounts',
                'plural' => $module->l('Discounts', 'EIAHelper'),
                'class' => 'EIADiscountsExport',
                'position' => 12,
            ),
            'category' => array(
                'pEntity' => 'categories',
                'plural' => $module->l('Categories', 'EIAHelper'),
                'class' => 'EIACategoriesExport',
                'position' => 6,
            ),
            'brand' => array(
                'pEntity' => 'brands',
                'plural' => $module->l('Brands', 'EIAHelper'),
                'class' => 'EIABrandsExport',
                'position' => 0,
            ),
            'supplier' => array(
                'pEntity' => 'suppliers',
                'plural' => $module->l('Suppliers', 'EIAHelper'),
                'class' => 'EIASuppliersExport',
                'position' => 1,
            ),
            'carrier' => array(
                'pEntity' => 'carriers',
                'plural' => $module->l('Carriers', 'EIAHelper'),
                'class' => 'EIACarriersExport',
                'position' => 5,
            ),
            'group' => array(
                'pEntity' => 'groups',
                'plural' => $module->l('Groups', 'EIAHelper'),
                'class' => 'EIAGroupsExport',
                'position' => 2,
            ),
            'customer' => array(
                'pEntity' => 'customers',
                'plural' => $module->l('Customers', 'EIAHelper'),
                'class' => 'EIACustomersExport',
                'position' => 3,
            ),
            'address' => array(
                'pEntity' => 'addresses',
                'plural' => $module->l('Addresses', 'EIAHelper'),
                'class' => 'EIAAddressesExport',
                'position' => 4,
            ),
            'order' => array(
                'pEntity' => 'orders',
                'plural' => $module->l('Orders', 'EIAHelper'),
                'class' => 'EIAOrdersExport',
                'position' => 13,
            ),
            'store' => array(
                'pEntity' => 'stores',
                'plural' => $module->l('Stores', 'EIAHelper'),
                'class' => 'EIAStoresExport',
                'position' => 14,
            ),
            'alias' => array(
                'pEntity' => 'aliases',
                'plural' => $module->l('Aliases', 'EIAHelper'),
                'class' => 'EIAAliasesExport',
                'position' => 15,
            ),
//            'warehouse' => array(
//                'pEntity' => 'warehouses',
//                'plural' => $module->l('Warehouses', 'EIAHelper'),
//                'class' => 'EIAWarehousesExport',
//                'position' => 6, // if you enable this, you MUST change all the position numbera!
//            ),
        );
    }
    
    public static function allEntitiesUnordered($module)
    {
        return array(
            'products' => array(
                'plural' => $module->l('Products', 'EIAHelper'),
                'class' => 'EIAProductsExport'
            ),
            'orders' => array(
                'plural' => $module->l('Orders', 'EIAHelper'),
                'class' => 'EIAOrdersExport'
            ),
            'features' => array(
                'plural' => $module->l('Features', 'EIAHelper'),
                'class' => 'EIAFeaturesExport'
            ),
            'attributes' => array(
                'plural' => $module->l('Attributes', 'EIAHelper'),
                'class' => 'EIAAttributesExport'
            ),
            'combinations' => array(
                'plural' => $module->l('Combinations', 'EIAHelper'),
                'class' => 'EIACombinationsExport'
            ),
            'packs' => array(
                'plural' => $module->l('Packs', 'EIAHelper'),
                'class' => 'EIAPacksExport'
            ),
            'discounts' => array(
                'plural' => $module->l('Discounts', 'EIAHelper'),
                'class' => 'EIADiscountsExport'
            ),
            'categories' => array(
                'plural' => $module->l('Categories', 'EIAHelper'),
                'class' => 'EIACategoriesExport'
            ),
            'brands' => array(
                'plural' => $module->l('Brands', 'EIAHelper'),
                'class' => 'EIABrandsExport'
            ),
            'suppliers' => array(
                'plural' => $module->l('Suppliers', 'EIAHelper'),
                'class' => 'EIASuppliersExport'
            ),
            'carriers' => array(
                'plural' => $module->l('Carriers', 'EIAHelper'),
                'class' => 'EIACarriersExport'
            ),
            'groups' => array(
                'plural' => $module->l('Groups', 'EIAHelper'),
                'class' => 'EIAGroupsExport'
            ),
            'customers' => array(
                'plural' => $module->l('Customers', 'EIAHelper'),
                'class' => 'EIACustomersExport'
            ),
            'addresses' => array(
                'plural' => $module->l('Addresses', 'EIAHelper'),
                'class' => 'EIAAddressesExport'
            ),
            'stores' => array(
                'plural' => $module->l('Stores', 'EIAHelper'),
                'class' => 'EIAStoresExport'
            ),
            'aliases' => array(
                'plural' => $module->l('Aliases', 'EIAHelper'),
                'class' => 'EIAAliasesExport'
            ),
//            'warehouses' => array(
//                'plural' => $module->l('Warehouses', 'EIAHelper'),
//                'class' => 'EIAWarehousesExport'
//            ),
        );
    }

    public static function getOperator($op)
    {
        if (isset(static::$operators[$op])) {
            return static::$operators[$op];
        } else {
            throw new PrestaShopException('No such an operator!');
        }
    }

    public static function createColumnsArray($x)
    {
        $letters = range('A', 'Z');
        $arr = array();
        $i = 1;
        foreach ($letters as $val) {
            $arr[] = $val;
            if ($i === $x) {
                return $arr;
            }
            if ($i === 26) {
                break;
            }
            $i++;
        }

        foreach ($letters as $outerVal) {
            foreach ($letters as $innerVal) {
                $i++;
                $arr[] = $outerVal . $innerVal;
                if ($i === $x) {
                    return $arr;
                }
            }
        }
    }

    public static function getTypeFromMime($mime)
    {
        $types = array_flip(static::$mimeTypes);
        if (isset($types[$mime])) {
            return $types[$mime];
        } else {
            return false;
        }
    }

    public static function getMimeFromType($type)
    {
        if (isset(static::$mimeTypes[$type])) {
            return static::$mimeTypes[$type];
        } else {
            return false;
        }
    }
    
    public function getFieldsFilterString($auto, $inputs)
    {
        $this->auto = $auto;
        $this->inputs = $inputs;
        
        $filter_options = $this->getValue('filter_options');
        $filter_values = $this->getValue('filter_values');
        $filter_types = $this->getValue('filter_types');
        $filterSql = '';
        foreach ($filter_options as $key => $option) {
            foreach ($option as $k => $opt) {
                if ($opt === 'none') {
                    continue;
                }
                if (pSQL($filter_types[$key][$k]) === 'number' && !empty($filter_values[$key][$k])) {
                    $filterSql .= ' AND ' . $key . ($opt === 'in' || $opt === 'not_in' ? $this->filterOperators[$opt] . ' (' . $filter_values[$key][$k] . ')' : $this->filterOperators[$opt] . $filter_values[$key][$k]);
                } elseif (pSQL($filter_types[$key][$k]) === 'string' && !empty($filter_values[$key][$k])) {
                    if ($opt === 'in' || $opt === 'not_in') {
                        $v = explode(',', $filter_values[$key][$k]);
                        $v = array_map(function ($e) {
                            return trim($e, '"');
                        }, $v);
                        $filter_values[$key][$k] = '"' . implode('","', $v) . '"';
                    } elseif ($opt === 'contains' || $opt === 'not_contains') {
                        $filter_values[$key][$k] = '"%' . trim($filter_values[$key][$k], '"'). '%"';
                    } else {
                        $filter_values[$key][$k] = '"' . trim($filter_values[$key][$k], '"'). '"';
                    }
                    $filterSql .= ' AND ' . $key . ($opt === 'in' || $opt === 'not_in' ? $this->filterOperators[$opt] . ' (' . $filter_values[$key][$k] . ')' : $this->filterOperators[$opt] . $filter_values[$key][$k]);
                } elseif (pSQL($filter_types[$key][$k]) === 'date') {
                    if ($opt === 'this_month') {
                        $filterSql .= " AND $key >= '" . date("Y-m-d", strtotime("first day of this month")) . "'";
                        $filterSql .= " AND $key < '" . date("Y-m-d", strtotime("first day of next month")) . "'";
                    } elseif ($opt === 'last_month') {
                        $filterSql .= " AND $key >= '" . date("Y-m-d", strtotime("first day of previous month")) . "'";
                        $filterSql .= " AND $key < '" . date("Y-m-d", strtotime("first day of this month")) . "'";
                    } elseif ($opt === 'this_week') {
                        $start = date('N') == 1 ? date('Y-m-d') : date('Y-m-d', strtotime('last monday'));
                        $end = date('Y-m-d', strtotime('this sunday'));
                        $filterSql .= " AND $key >= '" . $start . "'";
                        $filterSql .= " AND $key <= '" . $end . "'";
                    } elseif ($opt === 'last_week') {
                        $start = date('N') == 1 ? date('Y-m-d', strtotime('last monday')) : date('Y-m-d', strtotime('last week monday'));
                        $end = date('Y-m-d', strtotime('last sunday'));
                        $filterSql .= " AND $key >= '" . $start . "'";
                        $filterSql .= " AND $key <= '" . $end . "'";
                    } elseif ($opt === 'today') {
                        $filterSql .= " AND $key >= '" . date("Y-m-d", strtotime("today")) . "'";
                        $filterSql .= " AND $key < '" . date("Y-m-d", strtotime("tomorrow")) . "'";
                    } elseif ($opt === 'last_24_hours') {
                        $filterSql .= " AND $key >= '" . date('Y-m-d H:i:s', strtotime("-1 day")) . "'";
                        $filterSql .= " AND $key < '" . date('Y-m-d H:i:s') . "'";
                    } elseif ($opt === 'last_7_days') {
                        $filterSql .= " AND $key >= '" . date('Y-m-d H:i:s', strtotime("today -7 days")) . "'";
                        $filterSql .= " AND $key < '" . date('Y-m-d H:i:s') . "'";
                    } elseif ($opt === 'last_n_hours') {
                        $n_hours = (int) $filter_values[$key][$k]['n_hours'];
                        if ($n_hours) {
                            $filterSql .= " AND $key >= '" . date('Y-m-d H:i:s', strtotime("today -$n_hours hours")) . "'";
                            $filterSql .= " AND $key < '" . date('Y-m-d H:i:s') . "'";
                        }
                    } elseif ($opt === 'last_n_days') {
                        $n_days = (int) $filter_values[$key][$k]['n_days'];
                        if ($n_days) {
                            $filterSql .= " AND $key >= '" . date('Y-m-d H:i:s', strtotime("today -$n_days days")) . "'";
                            $filterSql .= " AND $key < '" . date('Y-m-d H:i:s') . "'";
                        }
                    } elseif ($opt === 'yesterday') {
                        $filterSql .= " AND $key >= '" . date("Y-m-d", strtotime("yesterday")) . "'";
                        $filterSql .= " AND $key < '" . date("Y-m-d", strtotime("today")) . "'";
                    } elseif ($opt === 'before_date') {
                        $toDate = pSQL($filter_values[$key][$k]['to']);
                        if ($toDate) {
                            $filterSql .= " AND $key <= '" . $toDate . "'";
                        }
                    } elseif ($opt === 'after_date') {
                        $fromDate = pSQL($filter_values[$key][$k]['from']);
                        if ($fromDate) {
                            $filterSql .= " AND $key >= '" . $fromDate . "'";
                        }
                    } elseif ($opt === 'select_date') {
                        $fromDate = pSQL($filter_values[$key][$k]['from']);
                        $toDate = pSQL($filter_values[$key][$k]['to']);
                        if ($fromDate) {
                            $filterSql .= " AND $key >= '" . $fromDate . "'";
                        }
                        if ($toDate) {
                            $filterSql .= " AND $key <= '" . $toDate . "'";
                        }
                    }
                } elseif (pSQL($filter_types[$key][$k]) === 'bool') {
                    $filterSql .= ' AND ' . $key . ($opt === 'is' ? ' = 1' : ' != 1');
                }
            }
        }
        
        return $filterSql;
    }
    
    public function getFieldsInTree($entity)
    {
        if (isset($this->fieldsInTree[$entity])) {
            return $this->fieldsInTree[$entity];
        } else {
            throw new Exception('Invalid entity');
        }
    }
    
    public function passedFilterForImport($row)
    {
        $filter_options = $this->getValue('filter_options');
        $filter_values = $this->getValue('filter_values');
        $filter_types = $this->getValue('filter_types');
        if ($filter_options) {
            foreach ($filter_options as $key => $option) {
                foreach ($option as $k => $opt) {
                    if ($opt === 'none') {
                        continue;
                    }
                    if (pSQL($filter_types[$key][$k]) === 'number' && !empty($filter_values[$key][$k])) {
                        if ($opt === 'lt' && (float)$filter_values[$key][$k] >= (float)$row[$key]) {
                            return false;
                        } elseif ($opt === 'lte' && (float) $filter_values[$key][$k] > (float) $row[$key]) {
                            return false;
                        } elseif ($opt === 'gt' && (float) $filter_values[$key][$k] <= (float) $row[$key]) {
                            return false;
                        } elseif ($opt === 'gte' && (float) $filter_values[$key][$k] < (float) $row[$key]) {
                            return false;
                        } elseif ($opt === 'e' && (float) $filter_values[$key][$k] != (float) $row[$key]) {
                            return false;
                        } elseif ($opt === 'ne' && (float) $filter_values[$key][$k] == (float) $row[$key]) {
                            return false;
                        } elseif ($opt === 'in' && !in_array($row[$key], explode(',', $filter_values[$key][$k]))) {
                            return false;
                        } elseif ($opt === 'not_in' && in_array($row[$key], explode(',', $filter_values[$key][$k]))) {
                            return false;
                        }
                    } elseif (pSQL($filter_types[$key][$k]) === 'string' && !empty($filter_values[$key][$k])) {
                        if ($opt === 'e' && $filter_values[$key][$k] != $row[$key]) {
                            return false;
                        } elseif ($opt === 'ne' && $filter_values[$key][$k] == $row[$key]) {
                            return false;
                        } elseif ($opt === 'in' && !in_array($row[$key], explode(',', $filter_values[$key][$k]))) {
                            return false;
                        } elseif ($opt === 'not_in' && in_array($row[$key], explode(',', $filter_values[$key][$k]))) {
                            return false;
                        } elseif ($opt === 'contains' && strpos($row[$key], $filter_values[$key][$k]) === false) {
                            return false;
                        } elseif ($opt === 'not_contains' && strpos($row[$key], $filter_values[$key][$k]) !== false) {
                            return false;
                        }
                    } elseif (pSQL($filter_types[$key][$k]) === 'date') {
                        if ($opt === 'this_month') {
                            if (!($row[$key] >= date("Y-m-d", strtotime("first day of this month")) && $row[$key] < date("Y-m-d", strtotime("first day of next month")))) {
                                return false;
                            }
                        } elseif ($opt === 'last_month') {
                            if (!($row[$key] >= date("Y-m-d", strtotime("first day of previous month")) && $row[$key] < date("Y-m-d", strtotime("first day of this month")))) {
                                return false;
                            }
                        } elseif ($opt === 'this_week') {
                            $start = date('N') == 1 ? date('Y-m-d') : date('Y-m-d', strtotime('last monday'));
                            $end = date('Y-m-d', strtotime('this sunday'));
                            if (!($row[$key] >= $start && $row[$key] <= $end)) {
                                return false;
                            }
                        } elseif ($opt === 'last_week') {
                            $start = date('N') == 1 ? date('Y-m-d', strtotime('last monday')) : date('Y-m-d', strtotime('last week monday'));
                            $end = date('Y-m-d', strtotime('last sunday'));
                            if (!($row[$key] >= $start && $row[$key] <= $end)) {
                                return false;
                            }
                        } elseif ($opt === 'today') {
                            if (!($row[$key] >= date("Y-m-d", strtotime("today")) && $row[$key] < date("Y-m-d", strtotime("tomorrow")))) {
                                return false;
                            }
                        } elseif ($opt === 'last_24_hours') {
                            if (!($row[$key] >= date('Y-m-d H:i:s', strtotime("-1 day")) && $row[$key] < date('Y-m-d H:i:s'))) {
                                return false;
                            }
                        } elseif ($opt === 'last_7_days') {
                            if (!($row[$key] >= date('Y-m-d H:i:s', strtotime("today -7 days")) && $row[$key] < date('Y-m-d H:i:s'))) {
                                return false;
                            }
                        } elseif ($opt === 'last_n_hours') {
                            $n_hours = (int) $filter_values[$key][$k]['n_hours'];
                            if ($n_hours) {
                                if (!($row[$key] >= date('Y-m-d H:i:s', strtotime("today -$n_hours hours")) && $row[$key] < date('Y-m-d H:i:s'))) {
                                    return false;
                                }
                            }
                        } elseif ($opt === 'last_n_days') {
                            $n_days = (int) $filter_values[$key][$k]['n_days'];
                            if ($n_days) {
                                if (!($row[$key] >= date('Y-m-d H:i:s', strtotime("today -$n_days days")) && $row[$key] < date('Y-m-d H:i:s'))) {
                                    return false;
                                }
                            }
                        } elseif ($opt === 'yesterday') {
                            if (!($row[$key] >= date("Y-m-d", strtotime("yesterday")) && $row[$key] < date("Y-m-d", strtotime("today")))) {
                                return false;
                            }
                        } elseif ($opt === 'before_date') {
                            $toDate = pSQL($filter_values[$key][$k]['to']);
                            if ($toDate) {
                                if ($row[$key] > $toDate) {
                                    return false;
                                }
                            }
                        } elseif ($opt === 'after_date') {
                            $fromDate = pSQL($filter_values[$key][$k]['from']);
                            if ($fromDate) {
                                if ($row[$key] < $fromDate) {
                                    return false;
                                }
                            }
                        } elseif ($opt === 'select_date') {
                            $fromDate = pSQL($filter_values[$key][$k]['from']);
                            $toDate = pSQL($filter_values[$key][$k]['to']);
                            if ($fromDate) {
                                if ($row[$key] < $fromDate) {
                                    return false;
                                }
                            }
                            if ($toDate) {
                                if ($row[$key] > $toDate) {
                                    return false;
                                }
                            }
                        }
                    } elseif (pSQL($filter_types[$key][$k]) === 'bool') {
                        if ($opt === 'is' && $row[$key] != 1) {
                            return false;
                        } elseif ($row[$key] == 1) {
                            return false;
                        }
                    }
                }
            }
        }
        
        return true;
    }
    
    protected function getValue($param)
    {
        if ($this->auto) {
            return $this->inputs[$param];
        } else {
            return Tools::getValue($param);
        }
    }
    
    public function convertExcelToCsv($filePath, $separator, $enclosure)
    {
        require_once dirname(__FILE__) . '/../vendor/autoload.php';
        $spreadsheet = IOFactory::load($filePath);
        $writer = IOFactory::createWriter($spreadsheet, 'Csv');
        $writer->setDelimiter($separator);
        $writer->setEnclosure($enclosure);
        $targetFilePath = $this->importDir . 'tmp/' . pathinfo($filePath, PATHINFO_FILENAME) . '.csv';
        $writer->save($targetFilePath);
        unset($spreadsheet);
        unset($writer);
        
        return $targetFilePath;
    }

    public function convertXmlToCsv($filePath, $separator, $enclosure)
    {
        self::setLocale();
        $targetFilePath = $this->importDir . 'tmp/' . pathinfo($filePath, PATHINFO_FILENAME) . '.csv';
        $handle = fopen($targetFilePath, 'w');
        if (!$handle) {
            $this->errors[] = Tools::displayError('Cannot convert');
            return;
        }
        fwrite($handle, "\xEF\xBB\xBF"); // NEW LINE
        
        // Make the header line
        $reader = new XMLReader(); // initialize
        $reader->open($filePath); // open file
        $i = 0;
        $header_row = [];
        while ($reader->read()) {
            if ($reader->nodeType == XMLReader::ELEMENT) {
                if ($reader->depth === 1) {
                    if ($i === 1) { // has read 1 "row" in terms of grid line
                        break;
                    }
                    $i++;
                }
                if ($reader->depth === 2) {
                    $header_row[] = trim($reader->localName);
                    $reader->read();
                }
            }
        }
        fputcsv($handle, $header_row, $separator, $enclosure);

        // make the data line
        $data_row = [];
        $reader = new XMLReader(); // initialize
        $reader->open($filePath); // open file
        while ($reader->read()) {
            if ($reader->nodeType == XMLReader::ELEMENT) {
                if ($reader->depth === 1) {
                    if ($data_row) {
                        fputcsv($handle, $data_row, $separator, $enclosure);
                        $data_row = [];
                    }
                }
                if ($reader->depth === 2) {
                    $reader->read();
                    if ($reader->nodeType == XMLReader::TEXT || $reader->nodeType == XMLReader::CDATA) {
                        $data_row[] = trim($reader->value);
                    } elseif ($reader->nodeType == XMLReader::END_ELEMENT) { // empty tag
                        $data_row[] = '';
                    } elseif ($reader->nodeType == XMLReader::SIGNIFICANT_WHITESPACE) { // space before <![CDATA[
                        $reader->read();
                        if ($reader->nodeType == XMLReader::CDATA) {
                            $data_row[] = trim($reader->value);
                        }
                    }
                }
            }
        }

        fclose($handle);
        $reader->close();
        
        return $targetFilePath;
    }
    
    public function convertJsonToCsv($filePath, $separator, $enclosure)
    {
        self::setLocale();
        
        $targetFilePath = $this->importDir . 'tmp/' . pathinfo($filePath, PATHINFO_FILENAME) . '.csv';
        $handle = fopen($targetFilePath, 'w');
        if (!$handle) {
            $this->errors[] = Tools::displayError('Cannot convert');
            return;
        }
        
        fwrite($handle, "\xEF\xBB\xBF"); // NEW LINE
        
        $data = json_decode(Tools::file_get_contents($filePath), true);
        foreach ($data as $key => $line) {
            if ($key === 0) {
                fputcsv($handle, array_keys($line), $separator, $enclosure);
            }
            fputcsv($handle, array_values($line), $separator, $enclosure);
        }
        
        fclose($handle);
        
        return $targetFilePath;
    }
    
    public static function setLocale()
    {
        $iso_lang = Language::getIsoById(Tools::getValue('language'));
        setlocale(LC_COLLATE, Tools::strtolower($iso_lang) . '_' . Tools::strtoupper($iso_lang) . '.UTF-8');
        setlocale(LC_CTYPE, Tools::strtolower($iso_lang) . '_' . Tools::strtoupper($iso_lang) . '.UTF-8');
//        setlocale(LC_ALL, Tools::strtolower($iso_lang) . '_' . Tools::strtoupper($iso_lang) . '.UTF-8');
    }
}