<?php

$_['main_sheet'] = array(
    'name' => 'Orders',
    'table' => array(
        'name' => 'o',
        'full_name' => 'order',
        'key' => 'order_id'
        ),

    'tables' => array(),

    'columns' => array(
        array(
            'column' => 'order_id',
            'table' => 'o',
            'name' => 'Order ID',
            'filter' => 1
            ),
        array(
            'column' => 'invoice_no',
            'table' => 'o',
            'name' => 'Invoice Number',
            'filter' => 1
            ),
        array(
            'column' => 'invoice_prefix',
            'table' => 'o',
            'name' => 'Invoice Prefix',
            'filter' => 1
            ),
        array(
            'column' => 'store_id',
            'table' => 'o',
            'name' => 'Store ID',
            'filter' => 1
            ),
        array(
            'column' => 'store_name',
            'table' => 'o',
            'name' => 'Store Name',
            'filter' => 1
            ),
        array(
            'column' => 'store_url',
            'table' => 'o',
            'name' => 'Store Url',
            'filter' => 1
            ),
        array(
            'column' => 'customer_id',
            'table' => 'o',
            'name' => 'Customer ID'

            ),
        array(
            'column' => 'customer_group_id',
            'table' => 'o',
            'name' => 'Customer Group ID'
            ),
        array(
            'column' => 'firstname',
            'table' => 'o',
            'name' => 'Customer First Name',
            'filter' => 1
            ),
        array(
            'column' => 'lastname',
            'table' => 'o',
            'name' => 'Customer Last Name',
            'filter' => 1
            ),
        array(
            'column' => 'email',
            'table' => 'o',
            'name' => 'Customer E-Mail'
            ),
        array(
            'column' => 'telephone',
            'table' => 'o',
            'name' => 'Customer Telephone',
            'filter' => 1
            ),
        array(
            'column' => 'fax',
            'table' => 'o',
            'name' => 'Customer Fax',
            'filter' => 1
            ),
        array(
            'column' => 'payment_firstname',
            'table' => 'o',
            'name' => 'Payment First Name'
            ),
        array(
            'column' => 'payment_lastname',
            'table' => 'o',
            'name' => 'Payment Last Name'
            ),
        array(
            'column' => 'payment_company',
            'table' => 'o',
            'name' => 'Payment Company'
            ),
        array(
            'column' => 'payment_address_1',
            'table' => 'o',
            'name' => 'Payment Address 1'
            ),
        array(
            'column' => 'payment_address_2',
            'table' => 'o',
            'name' => 'Payment Address 2'
            ),
        array(
            'column' => 'payment_city',
            'table' => 'o',
            'name' => 'Payment City'
            ),
        array(
            'column' => 'payment_postcode',
            'table' => 'o',
            'name' => 'Payment Post Code'
            ),
        array(
            'column' => 'payment_country',
            'table' => 'o',
            'name' => 'Payment Country'
            ),
        array(
            'column' => 'payment_country_id',
            'table' => 'o',
            'name' => 'Payment Country ID'
            ),
        array(
            'column' => 'payment_zone',
            'table' => 'o',
            'name' => 'Payment Zone'
            ),
        array(
            'column' => 'payment_zone_id',
            'table' => 'o',
            'name' => 'Payment Zone ID'
            ),
        array(
            'column' => 'payment_address_format',
            'table' => 'o',
            'name' => 'Payment Address Format'
            ),
        array(
            'column' => 'payment_method',
            'table' => 'o',
            'name' => 'Payment Method'
            ),
        array(
            'column' => 'payment_code',
            'table' => 'o',
            'name' => 'Payment Code'
            ),
        array(
            'column' => 'shipping_firstname',
            'table' => 'o',
            'name' => 'Shipping First Name'
            ),
        array(
            'column' => 'shipping_lastname',
            'table' => 'o',
            'name' => 'Shipping Last Name'
            ),
        array(
            'column' => 'shipping_company',
            'table' => 'o',
            'name' => 'Shipping Company'
            ),
        array(
            'column' => 'shipping_address_1',
            'table' => 'o',
            'name' => 'Shipping Address 1'
            ),
        array(
            'column' => 'shipping_address_2',
            'table' => 'o',
            'name' => 'Shipping Address2'
            ),
        array(
            'column' => 'shipping_city',
            'table' => 'o',
            'name' => 'Shipping City'
            ),
        array(
            'column' => 'shipping_postcode',
            'table' => 'o',
            'name' => 'Shipping Post Code'
            ),
        array(
            'column' => 'shipping_country',
            'table' => 'o',
            'name' => 'Shipping Country'
            ),
        array(
            'column' => 'shipping_country_id',
            'table' => 'o',
            'name' => 'Shipping Country ID'
            ),
        array(
            'column' => 'shipping_zone',
            'table' => 'o',
            'name' => 'Shipping Zone'
            ),
        array(
            'column' => 'shipping_zone_id',
            'table' => 'o',
            'name' => 'Shipping Zone ID'
            ),
        array(
            'column' => 'shipping_address_format',
            'table' => 'o',
            'name' => 'Shipping Address Format'
            ),
        array(
            'column' => 'shipping_method',
            'table' => 'o',
            'name' => 'Shipping Method'
            ),
        array(
            'column' => 'shipping_code',
            'table' => 'o',
            'name' => 'Shipping Code'
            ),
        array(
            'column' => 'comment',
            'table' => 'o',
            'name' => 'Comment'
            ),
        array(
            'column' => 'total',
            'table' => 'o',
            'name' => 'Total'
            ),
        array(
            'column' => 'order_status_id',
            'table' => 'o',
            'name' => 'Order Status ID',
            'filter' => 1
            ),
        array(
            'column' => 'affiliate_id',
            'table' => 'o',
            'name' => 'Affiliate ID'
            ),
        array(
            'column' => 'commission',
            'table' => 'o',
            'name' => 'Commision'
            ),
        array(
            'column' => 'language_id',
            'table' => 'o',
            'name' => 'Language ID'
            ),
        array(
            'column' => 'currency_id',
            'table' => 'o',
            'name' => 'Currency ID'
            ),
        array(
            'column' => 'currency_code',
            'table' => 'o',
            'name' => 'Currency Code'
            ),
        array(
            'column' => 'currency_value',
            'table' => 'o',
            'name' => 'Currency Value'
            ),
        array(
            'column' => 'ip',
            'table' => 'o',
            'name' => 'IP'
            ),
        array(
            'column' => 'forwarded_ip',
            'table' => 'o',
            'name' => 'Forwarded IP'
            ),
        array(
            'column' => 'user_agent',
            'table' => 'o',
            'name' => 'User Agent'
            ),
        array(
            'column' => 'accept_language',
            'table' => 'o',
            'name' => 'Accept Language'
            ),
        array(
            'column' => 'date_added',
            'table' => 'o',
            'name' => 'Date Added'
            ),
        array(
            'column' => 'date_modified',
            'table' => 'o',
            'name' => 'Date Modified'
            ),
        array(
            'column' => 'custom_field',
            'table' => 'o',
            'name' => 'Customer Custom Field',
            'filter' => 1
            ),
        array(
            'column' => 'payment_custom_field',
            'table' => 'o',
            'name' => 'Payment Custom Field'
            ),
        array(
            'column' => 'shipping_custom_field',
            'table' => 'o',
            'name' => 'Shipping Custom Field'
            ),
        array(
            'column' => 'marketing_id',
            'table' => 'o',
            'name' => 'Marketing ID'
            ),
        array(
            'column' => 'tracking',
            'table' => 'o',
            'name' => 'Tracking'
            ),
        )
    );

$_['sheets'] = array(
    array(
    'name' => 'Products',
    'table' => array(
        'name' => 'op',
        'full_name' => 'order_product',
        'related_key' => 'order_id',
        'key' => 'order_product_id'
        ),
    'tables' => array(),
    'columns' => array(
        array(
            'column' => 'order_id',
            'table' => 'op',
            'name' => 'Order ID'
            ),
        array(
            'column' => 'order_product_id',
            'table' => 'op',
            'name' => 'Order Product ID'
            ),
        array(
            'column' => 'product_id',
            'table' => 'op',
            'name' => 'Product ID'
            ),
        array(
            'column' => 'name',
            'table' => 'op',
            'name' => 'Product Name'
            ),
        array(
            'column' => 'model',
            'table' => 'op',
            'name' => 'Product Model'
            ),
        array(
            'column' => 'quantity',
            'table' => 'op',
            'name' => 'Product Quantity'
            ),
        array(
            'column' => 'price',
            'table' => 'op',
            'name' => 'Product Price'
            ),
        array(
            'column' => 'total',
            'table' => 'op',
            'name' => 'Product Total'
            ),
        array(
            'column' => 'tax',
            'table' => 'op',
            'name' => 'Product tax'
            ),
        array(
            'column' => 'reward',
            'table' => 'op',
            'name' => 'Product Reward'
            ),
        ),
    ),
    array(
    'name' => 'Options',
    'table' => array(
        'name' => 'oo',
        'full_name' => 'order_option',
        'related_key' => 'order_id',
        'key' => 'order_option_id'
        ),
    'tables' => array(),
    'columns' => array(
        array(
            'column' => 'order_id',
            'table' => 'oo',
            'name' => 'Order ID'
            ),
        array(
            'column' => 'order_option_id',
            'table' => 'oo',
            'name' => 'Order Option ID'
            ),
        array(
            'column' => 'order_product_id',
            'table' => 'oo',
            'name' => 'Order Product ID'
            ),
        array(
            'column' => 'product_option_id',
            'table' => 'oo',
            'name' => 'Product Option ID'
            ),
        array(
            'column' => 'product_option_value_id',
            'table' => 'oo',
            'name' => 'Product Option Value ID'
            ),
        array(
            'column' => 'name',
            'table' => 'oo',
            'name' => 'Option Name'
            ),
        array(
            'column' => 'value',
            'table' => 'oo',
            'name' => 'Option Value'
            ),
        array(
            'column' => 'type',
            'table' => 'oo',
            'name' => 'Option Type'
            )
        ),
    ),
    array(
    'name' => 'Totals',
    'table' => array(
        'name' => 'ot',
        'full_name' => 'order_total',
        'related_key' => 'order_id',
        'key' => 'order_total_id'
        ),
    'tables' => array(),
    'columns' => array(
        array(
            'column' => 'order_id',
            'table' => 'ot',
            'name' => 'Order ID'
            ),
        array(
           'column' => 'order_total_id',
            'table' => 'ot',
            'name' => 'Order Total ID'
            ),
        array(
            'column' => 'code',
            'table' => 'ot',
            'name' => 'Code'
            ),
        array(
            'column' => 'title',
            'table' => 'ot',
            'name' => 'Title'
            ),
        array(
            'column' => 'value',
            'table' => 'ot',
            'name' => 'Value'
            ),
        array(
            'column' => 'sort_order',
            'table' => 'ot',
            'name' => 'Sort Order'
            )
        ),
    ),
    array(
    'name' => 'Histories',
    'table' => array(
        'name' => 'oh',
        'full_name' => 'order_history',
        'related_key' => 'order_id',
        'key' => 'order_history_id'
        ),
    'tables' => array(),
    'columns' => array(
        array(
            'column' => 'order_id',
            'table' => 'oh',
            'name' => 'Order ID'
            ),
        array(
           'column' => 'order_history_id',
            'table' => 'oh',
            'name' => 'Order History ID'
            ),
        array(
            'column' => 'order_status_id',
            'table' => 'oh',
            'name' => 'Order Status ID'
            ),
        array(
            'column' => 'notify',
            'table' => 'oh',
            'name' => 'Notify'
            ),
        array(
            'column' => 'comment',
            'table' => 'oh',
            'name' => 'Comment'
            ),
        array(
            'column' => 'date_added',
            'table' => 'oh',
            'name' => 'Date Added'
            )
        ),
    ),
    array(
    'name' => 'Vouchers',
    'table' => array(
        'name' => 'ov',
        'full_name' => 'order_voucher',
        'related_key' => 'order_id',
        'key' => 'order_voucher_id'
        ),
    'tables' => array(),
    'columns' => array(
        array(
            'column' => 'order_id',
            'table' => 'ov',
            'name' => 'Order ID'
            ),
        array(
           'column' => 'order_voucher_id',
            'table' => 'ov',
            'name' => 'Order Voucher ID'
            ),
        array(
            'column' => 'voucher_id',
            'table' => 'ov',
            'name' => 'Voucher ID'
            ),
        array(
            'column' => 'description',
            'table' => 'ov',
            'name' => 'Description'
            ),
        array(
            'column' => 'code',
            'table' => 'ov',
            'name' => 'Code'
            ),
        array(
            'column' => 'from_name',
            'table' => 'ov',
            'name' => 'From Name'
            ),
        array(
           'column' => 'from_email',
            'table' => 'ov',
            'name' => 'From E-Mail'
            ),
        array(
            'column' => 'to_name',
            'table' => 'ov',
            'name' => 'To Name'
            ),
        array(
            'column' => 'to_email',
            'table' => 'ov',
            'name' => 'To E-Mail'
            ),
        array(
            'column' => 'voucher_theme_id',
            'table' => 'ov',
            'name' => 'Voucher Theme ID'
            ),
        array(
            'column' => 'message',
            'table' => 'ov',
            'name' => 'Message'
            ),
        array(
            'column' => 'amount',
            'table' => 'ov',
            'name' => 'Ammount'
            )
        ),
    )
);
