<div id="account-history-info">
    <h1>
        {txt key=TEXT_TITLE_ORDER_RESCISSION}
        <small>- {txt key=TEXT_ORDER_NUMBER}: {$order_data.orders_id}</small>
    </h1>

    <div class="row">
        <div class="col col-sm-4 col-md-3">
            <div class="well">
                <p class="headline-underline">{txt key=TEXT_SHIPPING_ADDRESS}</p>
                {if $order_data.delivery_company}{$order_data.delivery_company}<br />{/if}
                {if $order_data.delivery_company_2}{$order_data.delivery_company_2}<br />{/if}
                {if $order_data.delivery_company_3}{$order_data.delivery_company_3}<br />{/if}
                {$order_data.delivery_title} {$order_data.delivery_firstname} {$order_data.delivery_lastname}<br />
                {$order_data.delivery_street_address}<br />
                {if $order_data.delivery_suburb}{$order_data.delivery_suburb}<br />{/if}
                {$order_data.delivery_postcode} {$order_data.delivery_city}<br />
                {if $order_data.delivery_state}{$order_data.delivery_state}<br />{/if}
                {$order_data.delivery_country}
            </div><!-- .box -->
            <div class="well">
                <p class="headline-underline">{txt key=TEXT_PAYMENT_ADDRESS}</p>
                {if $order_data.billing_company}{$order_data.billing_company}<br />{/if}
                {if $order_data.billing_company_2}{$order_data.billing_company_2}<br />{/if}
                {if $order_data.billing_company_3}{$order_data.billing_company_3}<br />{/if}
                {$order_data.billing_title} {$order_data.billing_firstname}{$order_data.billing_lastname}<br />
                {$order_data.billing_street_address}<br />
                {if $order_data.billing_suburb}{$order_data.billing_suburb}<br />{/if}
                {$order_data.billing_postcode} {$order_data.billing_city}<br />
                {if $order_data.billing_state}{$order_data.billing_state}<br />{/if}
                {$order_data.billing_country}
            </div><!-- .box -->
            {if $order_data.shipping_method!=''}
            <div class="well">
                <p class="headline-underline">{txt key=TEXT_SHIPPING_METHOD}</p>
                {$order_data.shipping_method}
            </div><!-- .box -->
            {/if}
            {if $order_data.payment_name}
            <div class="well">
                <p class="headline-underline">{txt key=TEXT_PAYMENT_METHOD}</p>
                {$order_data.payment_name}
            </div><!-- .box -->
            {/if}
            {if $order_data.payment_info!=''}
            <div class="well">
                <p class="headline-underline">{txt key=TEXT_PAYMENT_INFO}</p>
                {$order_data.payment_info}
            </div><!-- .box -->
            {/if}

            {if $order_data.bank_details}
            <div class="well">
                <p class="headline-underline">{txt key='TEXT_BANK_DETAILS'}</p>
                {foreach from=$order_data.bank_details item=bd}
                    {txt key='TEXT_BAD_ACCOUNT_NAME'}: {$bd.bad_account_name}<br />
                    {txt key='TEXT_BAD_BANK_IDENTIFIER_CODE'}: {$bd.bad_bank_identifier_code}<br />
                    {if $bd.bad_due_date}{txt key='TEXT_BAD_DUE_DATE'}: {$bd.bad_due_date}<br />{/if}
                    {txt key='TEXT_BAD_INTERNATIONAL_BANK_ACCOUNT_NUMBER'}: {$bd.bad_international_bank_account_number}<br />
                    {txt key='TEXT_BAD_REFERENCE_NUMBER'}: {$bd.bad_reference_number}
                {/foreach}
            </div>
            {/if}

            {if $order_data.comments!=''}
            <div class="well">
                <p class="headline-underline">{txt key=TEXT_ORDER_COMMENTS}</p>
                {$order_data.comments|nl2br}
            </div><!-- .box -->
            {/if}
            {hook key=account_history_info_left}
        </div>

        <div class="col col-sm-8 col-md-9">

            {if $smarty.const._STORE_ALLOW_PARTLY_RESCISSION == 1}
                <p>{txt key=TEXT_RESCISSION_SELECT_ITEMS_FORM_INFO}</p>
            {/if}
            <p>{txt key="TEXT_RESCISSION_SELECT_ITEMS_FORM_INFO_2"}</p>

            {$message}
            <p class="pull-right clear"><a href="javascript:history.back();">{css_button text=$smarty.const.BUTTON_BACK}</a></p>

            <p class="headline">{txt key=TEXT_ORDER_DATE}</p>
            <p>{$order_data.date_purchased}</p>
            <hr />
            <br />

            {form type=form id=rescission_form name=rescission_form action='dynamic' link_params=getParams method=post conn=SSL}
            {form type=hidden name=page_action value=rescission_confirmation_registered}
            {form type=hidden name=email value=$email}
            {form type=hidden name=order value=$order_id}

            <button type="submit" class="btn btn-success pull-right" style="margin-bottom: 7px;">
                <i class="glyphicon glyphicon-ok"></i>
                &nbsp;{txt key=TEXT_CANCEL_ORDER_NOW}
            </button>
            <span class="clearfix"></span>

            <div id="cart-table" class="div-table table-hover table-bordered">
                <div class="row th">
                    <div class="col col-sm-8">
                        {txt key=TEXT_ARTICLE}
                    </div>
                    <div class="col col-sm-2 hidden-xs text-right">
                        {txt key=TEXT_SINGLE_PRICE}
                    </div>
                    <div class="col col-sm-2 hidden-xs text-right">
                        {txt key=TEXT_TOTAL_PRICE}
                    </div>
                </div>

                {foreach name=aussen key=key item=data from=$order_products}
                {hook key=account_history_info_foreach_order_products_top}

                <div class="row tr">
                    <div class="col col-xs-5 col-sm-2">
                        <p class="image">
                            {if !$data.products_image || $data.products_image == 'product:noimage.gif'}
                            {if $data.is_product}
                            <a href="{$data.products_link}" class="vertical-helper image-link no-image img-thumbnail">
                                <i class="no-image-icon"></i>
                            </a>
                            {else}
                            <span class="vertical-helper image-link no-image img-thumbnail">
                                    <i class="no-image-icon"></i>
                                </span>
                            {/if}
                            {elseif $data.is_product}
                            <a href="{$data.products_link}" class="vertical-helper image-link img-thumbnail">{img img=$data.products_image type=m_thumb class="productImageBorder img-responsive" alt=$data.products_name|escape:"html"}</a>
                            {else}
                            {img img=$data.products_image type=m_thumb class="productImageBorder img-responsive" alt=$data.products_name|escape:"html"}
                            {/if}
                        </p>
                    </div>
                    <div class="col col-xs-7 col-sm-6 col-lg-6">
                        {if $data.is_product}
                        <p class="product-name break-word bold"><a href="{$data.products_link}">{$data.products_name}</a></p>
                        {else}
                        <p class="product-name break-word bold">{$data.products_name}</p>
                        {/if}
                        {hook key=account_history_info_bundle}
                        {hook key=account_history_info_xt_options pid=$data.products_id}
                        <ul class="label-list fixed-padding">
                            {if $data.products_information.content}<li><span class="badge">{$data.products_information.content|replace:'<tr class="contentrow1">':''|replace:'<tr class="contentrow2">':''|replace:'<td>':''|replace:'<td class="left" colspan="4">':''|replace:'</td>':''|replace:'</tr>':''}</span></li>{/if}
                            {if $data.products_model!=''}<li><span class="badge">{txt key=TEXT_PRODUCTS_MODEL} {$data.products_model}</span></li>{/if}
                            {if $data.products_weight > 0}<li><span class="badge">{txt key=TEXT_PRODUCTS_WEIGHT} {$data.products_weight|number_format:2:",":"."} kg</span></li>{/if}
                            {if $data.shipping_status_data.name}<li><span class="badge">{txt key=TEXT_SHIPPING_STATUS} {$data.shipping_status_data.name}</span></li>{/if}
                            {if $data.base_price}<li><span class="badge">{$data.products_vpe_value|number_format_prec} {$data.base_price.vpe.name} / {$data.base_price.price} {txt key=TEXT_SHIPPING_BASE_PER} {$data.base_price.vpe.name}</span></li>{/if}
                            {if $data.stock_image}
                            <!--li class="product-stock-image">
                                <img src="{img img=$data.stock_image.image type=t_img_stockrules path_only=true}"
                                     class="img-responsive cursor-help"
                                     alt="{$data.stock_image.name}"
                                     title="{$data.stock_image.name}"
                                     data-toggle="tooltip" />
                                <span class="sr-only">{$stock_image.name}</span>
                            </li-->
                            {/if}
                        </ul>

                        {*<!-- price info visible-xs part --- start -->*}
                        <div class="hidden-sm hidden-md hidden-lg text-left-xs">
                            <span>{txt key=TEXT_SINGLE_PRICE}:</span><br />
                            <p class="product-price">
                                {$data.products_price.formated}
                            </p>
                            <span>{txt key=TEXT_TOTAL_PRICE}:</span><br />
                            <p class="product-price final-price">{$data.products_final_price.formated}</p>
                        </div>
                        {*<!-- / price info visible-xs part --- end -->*}

                        <div class="form-inline">
                            {if $data.is_product}
                            <div class="form-group form-group-sm">
                                <div class="input-group">

                                    <input type="number"
                                           class="form-control"
                                           min="0"
                                           max="{$data.products_quantity}"
                                           step="1"
                                    required="required"
                                    name="qty[]"
                                    autocomplete="off"
                                    id="form-qty-{$data.products_id}"
                                    value="{if $smarty.const._STORE_ALLOW_DECIMAL_QUANTITIY=='true'}{$data.products_quantity}{else}{$data.products_quantity|intval}{/if}"
                                    placeholder="{txt key=TEXT_QTY}"
                                    style="width: 6em"
                                    {if $smarty.const._STORE_ALLOW_PARTLY_RESCISSION != 1}disabled="disabled"{/if} />
                                    <label for="form-qty-{$data.products_id}" class="input-group-addon text-regular">{$data.products_unit_name}</label>
                                </div>
                            </div>
                            {/if}
                            {if $smarty.const._STORE_ALLOW_PARTLY_RESCISSION != 1}
                            <input type="hidden" name="qty[]" value="{if $smarty.const._STORE_ALLOW_DECIMAL_QUANTITIY=='true'}{$data.products_quantity}{else}{$data.products_quantity|intval}{/if}" />
                            {/if}

                            {if $smarty.const._STORE_ALLOW_PARTLY_RESCISSION == 1}
                            <input type="checkbox" name="cancel_product_{$data.orders_products_id}" id="cancel_product_{$data.orders_products_id}" checked="checked" value="1"> <label for="cancel_product_{$data.orders_products_id}"> {txt key=TEXT_CANCEL_ITEM}</label>
                            {else}
                            <input type="hidden" name="cancel_product_{$data.orders_products_id}" id="cancel_product_{$data.orders_products_id}" value="1">
                            {/if}

                            {form type=hidden name='orders_products_id[]' value=$data.orders_products_id}
                            {form type=hidden name='products_id[]' value=$data.products_id}
                            {form type=hidden name='products_model[]' value=$data.products_model}
                            {form type=hidden name='products_name[]' value=$data.products_name}

                            {hook key=account_history_info_product}
                        </div>
                    </div>
                    <div class="col col-sm-2 hidden-xs text-right">
                        <p class="product-price">
                            {$data.products_price.formated}
                            {if $data._cart_discount_data.plain}<br />
                            <span class="price-old">{$data._original_products_price.formated}</span><br />
                            <span class="small">(-{$data._cart_discount} %)</span>
                            {/if}
                        </p>
                    </div>
                    <div class="col col-sm-2 hidden-xs text-right">
                        <p class="product-price final-price">{$data.products_final_price.formated}</p>
                    </div>
                </div>
                {/foreach}
                {hook key=account_history_info_total_top}
                <div class="row tfoot bold text-right">

                    <div class="col col-sm-offset-4 col-xs-7 col-sm-6">
                        {txt key=TEXT_SUB_TOTAL}
                    </div>
                    <div class="col  col-xs-5 col-sm-2">
                        {$total.product_total.formated}
                    </div>

                    {foreach name=aussen item=order_total_values from=$order_total_data}
                    <div class="col col-sm-offset-4 col-xs-7 col-sm-6">
                        {$order_total_values.orders_total_name}
                    </div>
                    <div class="col  col-xs-5 col-sm-2">
                        {$order_total_values.orders_total_price.formated}
                    </div>
                    {/foreach}

                    <div class="col col-sm-offset-4 col-xs-7 col-sm-6">
                        {txt key=TEXT_TOTAL}
                    </div>
                    <div class="col  col-xs-5 col-sm-2">
                        {$total.total.formated}
                    </div>

                    {foreach name=aussen item=tax_data from=$total.total_tax}
                    <div class="col col-sm-offset-4 col-xs-7 col-sm-6">
                        {txt key=TEXT_TAX} {$tax_data.tax_key}%
                    </div>
                    <div class="col  col-xs-5 col-sm-2">
                        {$tax_data.tax_value.formated}
                    </div>
                    {/foreach}

                </div>
                {hook key=account_history_info_total_tpl}
                {foreach name=aussen item=tax_data from=$cart_tax}
                <div class="row tfoot text-right">
                    <div class="col col-sm-offset-4  col-xs-7 col-sm-6">
                        {txt key=TEXT_TAX} {$tax_data.tax_key}%
                        {if $shipping_link}<br /><span class="shipping-link"><a href="{$shipping_link}" target="_blank" rel="nofollow">{txt key=TEXT_EXCL_SHIPPING}</a></span>{/if}
                    </div>
                    <div class="col  col-xs-5 col-sm-2 text-right">
                        {$tax_data.tax_value.formated|replace:"*":""}
                    </div>
                </div>
                {/foreach}

                {hook key=account_history_info_total_bottom}
            </div><!-- .div-table -->
            <br />

            <label for="customer_comments">{txt key=TEXT_YOUR_COMMENTS} <span class="small">({txt key=TEXT_OPTIONAL})</span></label>
            <textarea name="customer_comments" id="customer_comments" class="form-control autosizejs" cols="50" rows="3" placeholder="" maxlength="2048"></textarea>
            <br />

            <p>
                {$legal_text}
            </p>

            <p class="pull-left"><a href="javascript:history.back();">{css_button text=$smarty.const.BUTTON_BACK}</a></p>

            <button type="submit" class="btn btn-success pull-right" style="margin-bottom: 7px;">
                <i class="glyphicon glyphicon-ok"></i>
                &nbsp;{txt key=TEXT_CANCEL_ORDER_NOW}
            </button>

            {form type=formend}

            {hook key=account_history_info_main_table_bottom}


        </div>
    </div><!-- .row -->

</div><!-- #account-history-info -->
