<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{$language.lblBusiness} : {$language.lblOrderDetails}</title>
{include file='CommonStyles.tpl'}
{include file='CommonJavaScript.tpl'}
<link href="{$view_styles}/jquery-ui-1.8.19.custom.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/details.css" media="screen" />
<script type="text/javascript" src="{$view_javascript}/orderEdit.page.js"></script>
<link rel="stylesheet" type="text/css" href="{$view_styles}/colorbox.css" />
</head>
<body class="{$languageDirection}">
<div class="outer" id="main">
  {include file='CommonHeader.tpl'}
  <!--End:Header Container--> <!--***********************************************************************END HEADER CONTAINER******************************************************-->
  <div class="content-wrapper">
    <div class="container-fluid">
      <div class="clearfix">
        <div class="pull-left left">
          {include file='ContentLanguageOptions.tpl'}
        </div>
   {if $user|default:''}
          {html->anchor href="user/show/id/$user/" caption="{$language.lblBack}" class="back-link pull-right"}
          {else}
          {html->anchor href=$history caption="{$language.lblBack}" class="back-link pull-right"}
          {/if}
      </div>

        <div class="clearfix">
          <div class="tab-block order_tab pull-right order-view">
            {*<ul class="listing-01 ">
              {if $resShippingHistory|count >0} <li> {html->anchor href="" class="tab cur_menu" id="detail" content="{$language.lblOrderDetails}"}</li>{/if}
              
                {if $shippingItems|count >0 && $showCreateShipment != 'none'}
              <li> {html->anchor href="" class="tab order_tab_a" id="coupon-shipping" content="{$language.lblCreateShipment}"} </li>{/if}
              {if $resShippingHistory|count >0}<li> {html->anchor href="" class="tab" id="shipments" content="{$language.lblShipments}"} </li>{/if}
      		  </ul>*}
               <ul class="listing-01 pull-right">
             <li> {html->anchor href="" class="tab cur_menu" id="detail" content="{$language.lblOrderDetails}"}</li>
            {if $resShippingHistory|count >0}<li> {html->anchor href="" class="tab" id="shipments" content="{$language.lblShipments}"} </li>{/if}
 </ul>
          </div>
        </div>
         
        
        <div id="common_message"></div>
        <div class="content-tab-block">
          <div class="content-block row"> 
            <!--order_details :: Starts-->
               <h2>{$language.lblOrderDetails}
               {if $masterOrderID > 0}
                   <input type="hidden" name="orderIDHid" id="orderIDHid" value="{$masterOrderID|default:''}">
          <img src="{$view_root_path}/public/default/manage/standard/images/print-icon.png"
    id="print_slip" 
    width="24" height="24" alt="print" class="print">
              {/if}
               </h2>
            <div class="order_details">
              <div class=" row">
                <div class="col-sm-6 col-xs-12 ">
                    <div class="container-section order-detail">
                        <h3 class="border-bottom">{$language.lblListProducts}</h3>
                  <ul class="listing-03">
                    <li class="row"> 
                        <span class="col-xs-6 col-first">{$language.lblOrderID} : </span> 
                        <span class="col-xs-6 col-last">{$resOrderDetails.orderNumber}</span> </li>
                    <li class="row"> 
                        <span class="col-xs-6 col-first">{$language.lblOrderedAt} : </span>
                        <span class="col-xs-6">{$resOrderDetails.orderCreatedDate|date_format:$date_format}</span> 
                      </li>
                     {*  <li class="row"> 
                           <span class="col-xs-6 col-first">{$language.lblPrescriptionRequired} :</span> 
                           <span class="col-xs-6">{$resOrderDetails.prescriptionstatus|upper}</span> 
                       </li>*}
                    <li class="row"> 
                        <span class="col-xs-6 col-first">{$language.lblOrderStatus} : </span>   
                        <span class="col-xs-6 col-last status">{$getDynOrderStatusByKey[$resOrderDetails.dynamicOrderStatus]}
                        
                        </span> 
                      </li>
                    <li class="row"> 
                        <span class="col-xs-6 col-first">{$language.lblPaymentStatus} : </span>  
                        <span class="col-xs-6 col-last recieved">{* {$resOrderDetails.paymentStatus} *}
                        {if $resOrderDetails.paymentStatus == 'Received'}
                        {$language.lblReceived}
                        {else if $resOrderDetails.paymentStatus == 'Refunded '}
                        {$language.lblRefunded}
                        {else if $resOrderDetails.paymentStatus == 'Denied'}
                        {$language.lblDenied}
                         {else if $resOrderDetails.paymentStatus == 'Pending'}
                        {$language.lblPending}
                        {else}
                             {$resOrderDetails.paymentStatus}
                        {/if}
                        </span>  
                      </li>
                    {if $resOrderDetails.orderPaymentMethodName}
                    <li class="row"> 
                        <span class="col-xs-6 col-first">{$language.lblPaymentMethod} : </span> 
                        <span class="col-xs-6 col-last">{$language.{$paymentSettingsGroupKey}}
                        {* {if $resOrderDetails.orderPaymentMethodName == 'Free_Checkout'}
                        {$language.lblFree_Checkout}
                        {else if $resOrderDetails.orderPaymentMethodName == 'Refunded '}
                        {$language.lblRefunded}
                        {else if $resOrderDetails.orderPaymentMethodName == 'Denied'}
                        {$language.lblDenied}
                        {/if} *}
                        </span> </li>
                    {/if}
					
                  </ul>
                  </div>
                </div>
                <!--End:Order Details-->
                <div class="col-sm-6 col-xs-12">
                    <div class="container-section billing-details clearfix">
                  <div class="left-pane col-sm-6 order-detail">
                    <h3 class="border-bottom">{$language.lblBillinginfo}</h3>
                    <address>
                    {$billingAddress|address_format:$languageIDs:'':'':$currentLangID}
                    </address>
                  </div>
                  <!--End:BILLING information--> 
                  <!-- shipping Information-->
                  <div class="right-pane col-sm-6 order-detail">
                    <h3 class="border-bottom">{$language.lblShippinginfo}</h3>
                    <address>
                    {$resOrderDetails.shippingAddress|address_format:$languageIDs:'':'':$currentLangID}
                     {if $shippingPhone|default:'' neq ''}<br><span> {$language.lblPhone}:</span>{$shippingPhone} {/if}
                    </address>
                  </div>
                  <!-- End shipping Information--> 
                        </div>
                </div>
              </div>
                    <div class="clear"></div>
              
              {if $resOrderDetails.pr_order_id >0}
              <!-- Prescription Details Start-->
              <div class="prescription_details clearfix padding-b-15">
                <div class="pane02">
                  <ul class="listing-03">
                      {if $prescriptionres.specify_medicine neq ''}
                    <li class="clearfix"> <span class="left_block  col-frst">Medicine Specification</span> <span class="col-septr">:</span> <span class="col-lst">{$prescriptionres.specify_medicine}</span> </li>
                    {/if}
                    {if $prescriptionres.medicine_details neq ''}
                        <li class="clearfix"> <span class=" left_block col-frst">Medicine Details </span> <span class="col-septr">:</span> <span class="col-lst">{$prescriptionres.medicine_details}</span> </li>
                    {/if}    
                    {if $prescriptionres.cource_duration neq '' and $prescriptionres.cource_duration > 0}
                    <li class="clearfix"> <span class="left_block  col-frst">Course Duration</span> <span class="col-septr">:</span> <span class="col-lst">{$prescriptionres.cource_duration}</span> </li>
                    {/if}
                    <li class="clearfix">
                        <span class="left_block  col-frst">Prescriptions</span><span class="col-septr">:</span>
                        <span class="col-lst">

                        {foreach from=$presImages item="order" key="key1"}
                        <div class="right01">
                            <img  src="{$view_public_path}/uploads/prescription/thumb/{$order}">
                        </div>
                        {/foreach}

                        </span>
                  </li>
                 </ul>
                </div>
              </div>
              <!-- Prescription Details Stop-->
              {/if}
              <div class="clear"></div>
              {form->start name="formOrder" action="" method="post" enctype="multipart/form-data"} 
			   {form->hidden name="orderStatus" value=$resOrderDetails.orderStatus}
			   {form->hidden name="paymentStatus" value=$resOrderDetails.paymentStatus}
              {form->hidden name="pendingProductFlag"}  {form->hidden name="insuffCertificateFlag"}
              <div class="products_ordered clearfix container-section">
                <h3 class="border-bottom"><span>{$language.lblProductsOrdered}</span> </h3>
                <div class="grid_table00">
                  <table width="100%" border="0" cellspacing="0" cellpadding="0"   >
                    <tr>
                      <th  width="10%"  align="left" valign="middle"><div style="width:205px"> {$language.lblBusiness} - {$language.lblSKU}</div></th>
                        <th align="left" valign="middle" width="30%" ><div style="width:205px">{$language.lblProductTitle}</div></th>
                      <th align="left" valign="middle" width="5%" >
                          <div style="width:85px">{$language.lblPrice}</div>
                        </th>
                      <th width="5%" align="left" valign="middle" >
                          <div style="width:85px">{$language.lblQuantity}</div>
                        </th>
                        <th align="left" valign="middle" width="5%"><div style="width:95px">{$language.lblTotal}</div></th>
                      <th align="left" valign="middle" width="10%">
                          <div style="width:160px">{$language.lblCurrentShipmentStatus}</div></th>
                      {*  <th align="left" valign="middle" width="10%">{$language.lblSubscription}</th>*}
                    </tr>
                    {assign var="taxDescription" value=""}
                    {assign var="itemPriceTotal" value="0"}
                    {foreach from=$resProductOrderDetails item="product" key="key1"}
                    {assign var="unserialize" value=$product.extra|unserialize}
                    {if $settingsTaxApplicable eq 'Yes' && $unserialize.orderItemTaxDescription neq ''} 		
                            {assign var="taxDescription" value="{$unserialize.orderItemTaxDescription}"}
                    {/if}
                    <tr >
                      <td align="left" valign="top">{$product.businessName} - {$product.optionSKU}{if $product.orderGiveAsGift eq 'Yes'} &nbsp;(Gift){/if}</td>
                      <td align="left" valign="top">
                        {$unserialize.itemDetails.user.productTitle}
                        {if $product.sellAsBatch eq 'Yes'}
                            <small><br/>{$language.lblSetOf} {$product.qtyPerBatch} {$product.batchType}<br/></small>
                        {/if}
                        {if $product.orderGiveAsGift eq 'Yes'} &nbsp;(Gift){/if} <br />

                        {if $unserialize.itemDetails.user.productTitle neq $unserialize.itemDetails.user.productOptionName}
                          ({$language.lblOption} : {$unserialize.itemDetails.user.productOptionName})<br/>
                        {/if}
                       
						{if $unserialize.combinationValues.customOption|count|default:0 >0}
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td colspan="2"><b>{$language.lblCombination}</b></td>
                          </tr>
                          <tr>
                            <td width="30%">{$language.lblSKU} </td>
                            <td>{$unserialize.combinationValues.cimbinationSKU|default:''}</td>
                          </tr>
                          {foreach from=$unserialize.combinationValues.customOption|default:'' item="combination" key="key"}
                          <tr>
                            <td>{$combination.customOptionName|default:''} </td>
                            <td>{$combination.variantValue|default:''}</td>
                          </tr>
                          {/foreach}
                        </table>
                        {/if}
                        
                        {if $unserialize.customOptionValues|count >0}
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td colspan="2"><strong>{$language.lblOption}</strong></td>
                          </tr>
                          {foreach from=$unserialize.customOptionValues item="customOptionValues"}
                          <tr>
                            <td width="30%">{$customOptionValues.0.customOptionName} </td>
                            {foreach from=$customOptionValues item="customOption" key="key"}
                            <td>
							{if $customOption.inputType=='file'}
                              {html->anchor href="/payment/getFile/id/{$customOption.variantValue}/" 
                              caption=$customOption.variantValue|default:'' 
                              title=$customOption.customOptionName|default:''}
                              {if $key >0},{/if}
                              {else}
                              {$customOption.variantValue}{if $key >0},{/if}
                            {/if}
							</td>
                            {/foreach} </tr>
                          {/foreach}
                        </table>
                        {/if} </td>
                      <td align="left" valign="top">
                          {if $product.freeProduct=='Yes' && $product.freeBaseProductID>0}
                              {assign var="itemPrice" value=$product.originalSubtotal/$product.orderItemQuantity}
                              {assign var="itemPriceTotal" value=$itemPriceTotal + $product.originalSubtotal}
                              {$itemPrice|price:'':$product.purchasedCurrency:$product.purchasedCurrency}
                           {else}
                            {$product.orderItemPrice|price:'':$product.purchasedCurrency:$product.purchasedCurrency}
                           {/if}
						  {if $product.freeProduct=='Yes'}
							<span class="heading"> ({$language.lblFree}) </span>
						{/if}
                        </td>
                      <td align="left" valign="top">
                          {$product.orderItemQuantity}
                        </td>
                      <td align="left" valign="top"> 
                                                {if $product.freeProduct=='Yes' && $product.freeBaseProductID>0} 
                                                    {$product.originalSubtotal|price:'':$product.purchasedCurrency:$product.purchasedCurrency|default:0} 
                                                {else}    
                                                    {$product.orderItemSubtotal|price:'':$product.purchasedCurrency:$product.purchasedCurrency|default:0} 
                                                {/if}
						{if $product.orderItemSubtotal != $product.originalSubtotal && $product.freeBaseProductID<=0}
							<br>{$language.lblOriginalPrice} - {$product.originalSubtotal|price:'':$product.purchasedCurrency|default:0:$product.purchasedCurrency|default:0} 
						{/if}
					  </td>
                      <td  align="left" valign="top"> 
						{if $product.shipmentStatus== 'Delivered'}
							{$language.lblDelivered}
						{else if $product.shipmentStatus== 'Shipment'}
							{$language.lblShipmentcreated}
						{else if $product.shipmentStatus== 'Dispatched'}
							{$language.lblDispatched}
						{else if $product.shipmentStatus== 'Pickup'}
							{$language.lblPickupCreated}
						{else if $product.shipmentStatus== 'Pending'}
							{$language.lblPending}
                                                {else if $product.shipmentStatus== 'Cancelled'}
                                                {$language.lblCancelled}
						{/if}
                        {if $product.shipmentStatus !='Pending'} <br>
                        ({$product.shipmentDate|date_format:$date_format} 
                        {$product.shipmentDate|date_format:$time_format})
                        {/if} </td>
                       {* <td align="left" valign="top">{if $unserialize.purchaseType=='subscribe'}{html->anchor href="/payment/ShowSubscription/id/{$product.orderItemID}/" caption="{$language.lblView}"  class="showsubscription" title="{$language.lblView}"}<span style="display:none;">{$language.lblOrderSubscription}</span>{else}&nbsp;{/if}</td>*}
                    </tr>
                    {/foreach}
                  </table>
                </div>
                <div class="clearfix">
                  <table width="100%" align="right">
                    <tr>
                      <td align="right">
					  <div class="order_amount col-lg-4 col-md-5 col-sm-6 col-xs-12 pull-right">
                          <ul class="amount-listing">
                            <li class="row"> 
                                <span class="col-frst col-xs-6 text-right">{$language.lblSubtotal} </span> 
                                {assign var="orderTotalSub" value=$itemPriceTotal + $resOrderDetails.orderSubtotal}
                                <span class="col-frst col-xs-6 text-right">{$orderTotalSub|price:'':$resOrderDetails.purchasedCurrency:$resOrderDetails.purchasedCurrency}</span> 
                              </li>
                            {if $resOrderDetails.shippingAmount>0}
                            <li class="row"> 
                                <span class="col-frst col-xs-6 text-right">{$language.lblShippingAmount}</span>
                                <span class="col-frst col-xs-6 text-right">{$resOrderDetails.shippingAmount|price:'':$resOrderDetails.purchasedCurrency:$resOrderDetails.purchasedCurrency}</span> 
                              </li>
                            {/if}
                            {if $resOrderDetails.orderOtherServiceCharge>0}
                            <li class="row"> 
                                <span class="col-frst col-xs-6 text-right">{$language.lblServiceCharge} </span> 
                                <span class="col-frst col-xs-6 text-right">{$resOrderDetails.orderOtherServiceCharge|price:'':$resOrderDetails.purchasedCurrency:$resOrderDetails.purchasedCurrency}</span> 
                              </li>
                            {/if}
                            {if $resOrderDetails.orderPromoDiscountAmount>0}
                            <li class="row"> 
                                <span class="col-frst col-xs-6 text-right">{$language.lblDiscount} </span>
                                <span class="col-frst col-xs-6 text-right">-{$resOrderDetails.orderPromoDiscountAmount|price:'':$resOrderDetails.purchasedCurrency:$resOrderDetails.purchasedCurrency} {if $resOrderDetails.orderPromoCode}({$resOrderDetails.orderPromoCode}){/if}</span> 
                              </li>
                            {/if}
                            {if $resOrderDetails.orderUserCreditAmount>0}
                            <li class="row"> 
                                <span class="col-frst col-xs-6 text-right">{$language.lblCreditAmount}</span>
                                <span class="col-lst col-xs-6 text-right">-{$resOrderDetails.orderUserCreditAmount|price:'':$resOrderDetails.purchasedCurrency:$resOrderDetails.purchasedCurrency}</span> 
                              </li>
                            {/if}
							{if $resOrderDetails.redeemDiscountAmount>0}
                            <li class="row"> 
                                <span class="col-frst col-xs-6 text-right">{$language.lblRedeemAmount}</span>
                                <span class="col-frst col-xs-6 text-right">-{$resOrderDetails.redeemDiscountAmount|price:'':$resOrderDetails.purchasedCurrency:$resOrderDetails.purchasedCurrency}</span> 
                              </li>
                            {/if}
                            {if $resOrderDetails.orderTaxAmount>0}
                            <li class="row"> 
                                <span class="col-frst col-xs-6 text-right">{$language.lblTaxAmount}{if $taxDescription|default:'' neq ''} - {$taxDescription}{/if}</span>
                                <span class="col-frst col-xs-6 text-right">{$resOrderDetails.orderTaxAmount|price:'':$resOrderDetails.purchasedCurrency:$resOrderDetails.purchasedCurrency}</span> 
                              </li>
                            {/if}
                            <li class="row"> 
                                <span class="col-frst col-xs-6 text-right">{$language.lblTotal}</span>
                                {assign var="orderTotal" value=$itemPriceTotal + $resOrderDetails.orderTotalAmount}
                                <span class="col-frst col-xs-6 text-right">{$orderTotal|price:'':$resOrderDetails.purchasedCurrency:$resOrderDetails.purchasedCurrency}</span> 
                              </li>
                          </ul>
                        </div>
						</td>
                    </tr>
                  </table>
                </div>
              </div>
            </div>
            <!--End:Table Listing--> 
            {form->hidden name="paymentSettingsGroupID" value=$resOrderDetails.paymentSettingsGroupID}
            {form->close} </div>
          <!--End: left Block-->
        
		<!-- Shipments listing section  -->
	<div class="content-block row" style="display:none;"> 
		<h2>{$language.lblMenuShippedOrders}</h2>  

          <div class="products_ordered clearfix container-section">
			{if $resShippingHistory|count >0}
           
            <div class="grid_table00">
              
             
	  
              <div class="full_width pane01">
            
         	<table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
				<th width="100"  align="left" valign="top">{$language.lblShipmentId}</th>
                <th  align="left" valign="top">{$language.lbldate}</th>
                <th  align="left" valign="top">{$language.lblStatus}</th>
				<th  align="left" valign="top">{$language.lblQuantity}</th>
                <th width="100"  align="left" valign="top">{$language.lblNotifiedCustomer} </th>
                <th  align="left" valign="top">{$language.lblComments}</th>
                <th  align="left" valign="top">{$language.lblTrackingnumber}</th>
                <th  align="left" valign="top">{$language.lblLogisticPartner}</th>
				<th  align="left" valign="top"></th>
              </tr>
              {foreach from=$resShippingHistory item="history2"}
              <tr>
				 <td  align="left" valign="top">
					{html->anchor href="/shipment/show/id/{$history2.shippingID}/" caption="#{$history2.shippingID|default:''}"  class="normal_link" title="Show"}
				 </td>
                <td  align="left" valign="top">{$history2.activityDate|date_format:$date_format} 
                  {$history2.activityDate|date_format:$time_format} </td>
                 <td  align="left" valign="top">
					{if $history2.shippingStatus== 'Delivered'}
						{$language.lblDelivered}
					{else if $history2.shippingStatus== 'Pending'}
						{$language.lblPending}
					{else if $history2.shippingStatus== 'Shipment'}
						{$language.lblShipmentcreated}
					{else if $history2.shippingStatus== 'Dispatched'}
						{$language.lblDispatched}
					{else if $history2.shippingStatus== 'Pickup'}
						{$language.lblPickupCreated}
                                        {else if $history2.shippingStatus== 'Cancelled'}
							{$language.lblCancelled}    
					{/if}
				 </td>
				 <td  align="left" valign="top">{$history2.quantity}</td>
                 <td  align="left" valign="top">
				 {$language.lblDispatched} -
					{if $history2.dispatch_notify_customer=='Yes'}  <span class="status-active no_cursor icon-set bg-trnsp"></span> {else}<span class="status-inactive no_cursor icon-set bg-trnsp"></span>{/if}
					<br>{$language.lblDelivered} - {if $history2.delivered_notify_customer=='Yes'}  <span class="status-active no_cursor icon-set bg-trnsp"></span> {else}<span class="status-inactive no_cursor icon-set bg-trnsp"></span>{/if}
				 </td>
                 <td  align="left" valign="top">{$history2.comment}</td>
                 <td  align="left" valign="top">{$history2.trackingNumber}</td>
                <td  align="left" valign="top">
					{if $history2.carrier eq 'other'}
						{$history2.other_logistic_partner}
					{else}
						{$history2.logisticPartner}
					{/if}
				</td>
				 <td  align="left" valign="top">
					{if $history2.createdBy == 'business'}
						{assign var="href" value= "/shipment/edit/id/"|cat:{$history2.shippingID}|cat:"/"}
						{html->anchor href="{$href}" title="{$language.lblEdit}" class="product-preview icon-set edit03"}
						{html->anchor history="yes" rel="/payment/destroy/id/{$history2.shippingID}/newstatus/Deleted/" class="delete02 icon-set" title="Delete" task='delete'}
					{/if}
				 </td>
              </tr>
			  {/foreach}
            </table>
            
                   	
                    
               </div>
                    
                    </div>
					{/if}
          </div>
</div>
	
	<!-- Shipments listing section End-->
    </div>
    </div>
  </div>
  <!--End:Content Container--> 
   {include file='CommonFooter.tpl'}
</div>
<!--End:Outer Container--> 
{include file='CommonJavaScriptBottom.tpl'}
{html->messages_script id="common_message"}
{form->rootpath_script}
{form->basepath_script}
<script>
var msgConfirmDelete="{$language.msgConfirmDelete}";
var lblSelectItems	=	"{$language.lblSelectItems}";
var lblNoDataDefault = "{$language.lblNoDataDefault}";
var msgShipMismatch = "{$language.msgShipMismatch}";
var msgDeliveredStatus = "{$language.msgDeliveredStatus}";
var msgPendingStatus = "{$language.msgPendingStatus}";
</script>

{* <script type="text/javascript">
  $(document).ready(function(){
    $('.tab-block li a.tab').click(function()
    {
      var indexVar =  $(".tab").index(this);
      $('.content-block').slideUp(300);
      $('.content-block:eq('+indexVar+')').slideDown(500);
      $(".tab-block li a.tab").removeClass('cur_menu');
      $(this).addClass('cur_menu');
    });
    
  });
</script> *}

<script type="text/javascript" src="{$common_js}/validate.plugin.js"></script> 
<script type="text/javascript" src="{$view_javascript}/tab.plugin.js"></script> 
<script type="text/javascript" src="{$view_javascript}/table.plugin.js"></script> 
<script type="text/javascript"  src="{$view_javascript}/jquery.colorbox.js"></script>
<script type="text/javascript" src="{$view_javascript}/jquery-ui-timepicker-addon.js"></script>
{form->validate_script form="formChangeShippingStatus"} 

</body></html> 