<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<?php /* @var $this Mage_Sales_Block_Order_Print_Shipment */?>
<?php $order = $this->getOrder(); ?>
<h1><?php echo $this->__('Order #%s', $this->getObjectData($order, 'real_order_id')); ?></h1>
<p class="order-date"><?php echo $this->__('Order Date: %s', $this->formatDate($this->getObjectData($order, 'created_at_store_date'), 'long')) ?></p>
<?php if (!$this->getObjectData($order, 'is_virtual')): ?>
<?php foreach ($this->getShipmentsCollection() as $shipment): ?>
    <h2 class="h2"><?php echo $this->__('Shipment #%s', $this->getObjectData($shipment, 'increment_id')); ?></h2>
    <div class="col2-set">
        <div class="col-1">
            <h3><?php echo $this->__('Shipping Address') ?></h3>
            <address><?php echo $this->getShipmentAddressFormattedHtml($shipment); ?></address>
        </div>
        <div class="col-2">
            <h3><?php echo $this->__('Billing Address') ?></h3>
            <address><?php echo $this->getBillingAddressFormattedHtml($order); ?></address>
        </div>
    </div>
    <div class="col2-set">
        <div class="col-1">
            <h3><?php echo $this->__('Shipping Method') ?></h3>
             <?php echo $this->escapeHtml($this->getObjectData($order, 'shipping_description')); ?>
             <?php $tracks = $this->getShipmentTracks($shipment); 
                if ($tracks): ?>
                <table class="data-table" id="my-shipment-tracking">
                    <col />
                    <col />
                    <thead>
                        <tr>
                            <th><?php echo Mage::helper('sales')->__('Title')?></th>
                            <th><?php echo Mage::helper('sales')->__('Number')?></th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php foreach ($tracks as $track): ?>
                            <tr>
                                <td><?php echo $this->escapeHtml($this->getObjectData($track, 'title')); ?></td>
                                <td><?php echo $this->escapeHtml($this->getObjectData($track, 'number')); ?></td>
                            </tr>
                        <?php endforeach; ?>
                    </tbody>
                </table>
                <script type="text/javascript">decorateTable('my-shipment-tracking');</script>
            <?php endif; ?>
        </div>
        <div class="col-2">
            <h3><?php echo $this->__('Payment Method') ?></h3>
            <?php echo $this->getPaymentInfoHtml() ?>
        </div>
    </div>
    <h3><?php echo $this->__('Items Shipped') ?></h3>
    <table class="data-table" id="my-shipment-table-<?php echo $this->getObjectData($shipment, 'id') ?>">
        <col />
        <col width="1" />
        <col width="1" />
        <thead>
            <tr>
                <th><?php echo $this->__('Product Name') ?></th>
                <th><?php echo $this->__('SKU') ?></th>
                <th class="a-center"><span class="nobr"><?php echo $this->__('Qty Shipped') ?></span></th>
            </tr>
        </thead>
        <?php foreach ($this->getShipmentItems($shipment) as $item): ?>
        <tbody>
            <?php echo $this->getItemHtml($item) ?>
        </tbody>
        <?php endforeach; ?>
    </table>
    <script type="text/javascript">decorateTable('my-shipment-table-<?php echo $this->getObjectData($shipment, 'id')?>', {'tbody' : ['odd', 'even'], 'tbody tr' : ['first', 'last']})</script>
<?php endforeach; ?>
<?php endif; ?>
<script type="text/javascript">window.print();</script>
