<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
	
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>{$language.lblBusiness} :  {$language.lblReturnDetails}</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}/chosen.css" media="screen"/>
        <link rel="stylesheet" type="text/css" href="{$view_styles}/colorbox.css" />
	<link rel="stylesheet" type="text/css" href="{$view_styles}/details.css" media="screen" />
	{include file='CommonCustomStyles.tpl'}
	{form->basepath_script}
	{form->rootpath_script}
	</head>
	<body id="returnpage" class="{$languageDirection}">
		<div class="outer"> {include file='CommonHeader.tpl'} 
		<!--End:Header Container-->
			<div class="content-wrapper">
				<div class="container-fluid">
					<div class="clearfix">
				        <div class="pull-left left">
					        {include file='ContentLanguageOptions.tpl'}
				        </div>
						{html->anchor href=$history caption="{$language.lblBack}" class="back-link pull-right"}
				    </div>
					<div id="common_message"></div>
					<!-- Inner Content Container starts-->
				
						<h2>{$language.lblReturnRequestsDetails}
                                                
                                                <input type="hidden" name="returnIDHid" id="returnIDHid" value="{$returnID|default:''}">
                                                    {if $resApprovedReturn|@count !='0'}
                                              <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>
						<!-- sort by starts -->
                    <div class="row">
                    <div class="col-xs-12 col-sm-6">
                        <div class=" container-section order_details">
                            <ul class="listing-03">
								<li class="row">
                                    <span class="col-xs-6 col-first">{$language.lblReturnID} :</span> 
                                    <span class="col-xs-6 col-last"><strong>#{$resReturnDetails.returnID|default:0}</strong></span> </li>
								<li class="row"> 
                                    <span class="col-xs-6 col-first">{$language.lblReturnStatus} :</span> 
                                    <span class="col-xs-6 col-last"><strong>{$resReturnDetails.statusDescription|default:''}</strong></span> </li>
								<li class="row"> 
                                    <span class="col-xs-6 col-first">{$language.lblQuantity} :</span>
                                    <span class="col-xs-6 col-last"><strong>{$resReturnDetails.quantity|default:0}</strong></span> </li>
								<li class="row"> 
                                    <span class="col-xs-6 col-first">{$language.lblOrderNumber} :</span> 
                                    <span class="col-xs-6 col-last"><strong>#{$resReturnDetails.orderNumber|default:0}</strong></span> </li>
								<li class="row"> 
                                    <span class="col-xs-6 col-first">{$language.lblReturnAction} :</span> 
                                    <span class="col-xs-6 col-last"><strong>{$resReturnDetails.actionReason|default:''}</strong></span> </li>
								<li class="row"> 
                                    <span class="col-xs-6 col-first">{$language.lblRequestDate} :</span> 
                                    <span class="col-xs-6 col-last"><strong>{$resReturnDetails.returnDate|default:''|date_format:$date_format}{$resReturnDetails.returnDate|default:''|date_format:$time_format}</strong></span> </li>
								<li class="row"> 
                                    <span class="col-xs-6 col-first">{$language.lblCustomerName} :</span> 
                                    <span class="col-xs-6 col-last"><strong>{$resReturnDetails.fullName|default:''}</strong></span> </li>
							{if $resReturnDetails.merchantRequestStatusID|default:0 neq 0}	
								<li class="row"> 
                                    <span class="col-xs-6 col-first">{$language.lblRequestedStatus} :</span> 
                                    <span class="col-xs-6 col-last"><strong>{$resRequestStatus.statusDescription|default:''}</strong></span> </li>
							{/if}
                                </ul>
                        </div>
                    </div>
				
                   <div class="col-xs-12 col-sm-6">
                    <div class="container-section">
					{if $resReturnDetails.comments|default:''}
						<h3 class="reduce-btm-spc border-bottom"><span>{$language.lblUserComments} </span></h3>
						<div class="content-block">{$resReturnDetails.comments|default:''} <br />
								&nbsp;<br />
                            </div>
					{/if}
					{if $statusHistory|default:array()|count >0}
						<h3 class="reduce-btm-spc border-bottom"><span>{$language.lblBusinessComments}</span></h3>
						<div class="content-block">{foreach from=$statusHistory|default:array() item="history" key="key1"}
								<p > 
									<strong>
										{$history.date|date_format:$date_format|default:''}
										{$history.date|date_format:$time_format|default:''}
									</strong>	
										<br>
										{if $history.status|default:''}
										<strong>{$language.lblRequestedStatus} :</strong> {$history.status|default:''} <strong>|</strong>{/if}<strong> {$language.lblComment} : </strong> {$history.comments|default:''} 	<strong>| {$language.lblBy} :</strong> {if $history.from|default:'' eq  'merchant'}
										{$language.lblBusiness}
										{else}
										{$language.lblAdmin}
										{/if}
								</p>
						{/foreach}		 <br />
								&nbsp;<br />
                        </div>
					{/if}
					</div>
                    </div>
                        </div>
                     
					<div class="clearfix"> 
					<div class="tab02 fixing_right order_tab">
                        <ul>
						{if $resApprovedReturn|@count>0}
							<li><a href="javascript:void(0);"  class="tab-anchor active tab"><strong>{$language.lblAcceptProducts}</strong></a></li>
						{/if}
						{if $resDeclinedReturn|@count>0} 
                            <li><a href="javascript:void(0);" class="{if $resApprovedReturn|@count eq 0} active {/if} tab-anchor tab"><strong>{$language.lblDeclinedProducts}</strong></a> </li>
						{/if}
						{if $resReturnDetails.returnStatusID|default:'' neq 5}
                            <li><a href="javascript:void(0);" class="tab-anchor tab"><strong>{$language.lblActionRequest}</strong></a> </li>
						{/if}
                            </ul>
						</div>
					</div>
					{if $resApprovedReturn|@count>0}
						<div class="tab-content container-section margin-top" >
							<h3 class="border-bottom">{$language.lblReturnProductInformation} </h3>
							<!--Start: Product List--> 
							{form->start name="formApprovedReturn" action="" method="post" enctype="multipart/form-data"} 		
								{form->hidden name="returnID" value=$retrunID|default:''}
								<div class="grid_table00 pd-list">
									<table width="100%" border="0" cellspacing="0" cellpadding="0"   >
									<thead>
										<tr>
											<th align="left" valign="middle" width="40%">{$language.lblProduct}</th>
											<th align="left" valign="middle" width="15%">{$language.lblPrice}</th>
											<th align="left" valign="middle" width="10%">{$language.lblQuantity}</th>
											<th align="left" valign="middle" width="15%" colspan="2">{$language.lblReason}</th>
										</tr>
									</thead>
									<tbody>
										{foreach from=$resApprovedReturn item="approvedProduct" key="key"}
											{assign var="productID" value=$approvedProduct.productID}
											<tr>
												<td align="left" valign="top"><span ><img src="{$view_public_path}/uploads/catalog/product/small/{$approvedProduct.productImage}?random={$rand|default:''}" class="fixing_left pd-img" /> 
													{html->anchor history="yes" href="/product/show/id/{$approvedProduct.productID}/" class="normal_link" content="<strong>{$approvedProduct.productTitle|truncate:80}</strong>"} 
													<br />
													{if $approvedProduct.productTitle neq $approvedProduct.productOptionName}
														({$language.lblOption} : {$approvedProduct.productOptionName})
													{/if}
													{assign var="unserialize" value=$approvedProduct.11|default:''|unserialize}
                  
													{if $unserialize.combinationValues.customOption|default:array()|count >0}
														<div class="cart-detil"> <span class="heading">{$language.lblCombination} : {$language.lblSKU} - {$unserialize.combinationValues.cimbinationSKU|default:''}</span>
														<div class="show-hide-cart" style="display:block;"> <span class="combination " >
														{foreach from=$unserialize.combinationValues.customOption|default:'' item="combination" key="key"}
															{if $key neq 0}<span class="x-style">X </span>{/if}
															{$combination.customOptionName|default:''}-{$combination.variantValue|default:''}
														{/foreach} </span> 
														</div>
														</div>
													{/if}						
													{if $unserialize.customOptionValues|count >0}
														<div class="cart-detil"><span class="heading">{$language.lblOptions}</span>
														<div class="show-hide-cart" style="display:block;"> 
															{foreach from=$unserialize.customOptionValues item="customOptionValues"} <span class="combination clearfix" > <span class="left">{$customOptionValues.0.customOptionName}</span> <span class="right"> {foreach from=$customOptionValues item="customOption" key="key"}
															{if $customOption.inputType != 'file'}
																{$customOption.variantValue}{if $key >0},{/if}
															{else if $customOption.inputType == 'file' && $customOption.variantValue!=''}
																{if $orderShowPrivilege}
																	{html->anchor href="/order/getFile/id/{$customOption.variantValue}/" 
																		caption=$customOption.variantValue 
																		title=$customOption.customOptionName}
																{else}
																	{$customOption.variantValue}
																{/if}
															{/if}
															{/foreach} </span> </span> {/foreach} </div>
														</div>
													{/if}						
												</span></td>
                  <td align="left" valign="top"><span > {$approvedProduct.orderItemPrice|price:'':$approvedProduct.productDefaultCurrency|default:'':$approvedProduct.productDefaultCurrency|default:''}</span></td>
                  <td align="left" valign="top"> {$approvedProduct.quantity|default:0}</td>
                  <td align="left" valign="top" colspan="2"> {$approvedProduct.reason} </td>
                </tr>
            {/foreach}
              </tbody>
            
          </table>
            </div>
        <!--end: Product List-->
		
        {form->close} </div>
          {/if} 
          
          {if $resDeclinedReturn|@count>0}
          <div class="tab-content container-section margin-top" style="display:none">
        <h3>{$language.lblDeclinedProductInformation} </h3>
        <!--Start: Product List--> 
        {form->start name="formDeclinedReturn" action="" method="post" enctype="multipart/form-data"} 
        {form->hidden name="returnID" value=$retrunID|default:''}
        <div class="grid_table00 pd-list">
              <table width="100%" border="0" cellspacing="0" cellpadding="0"   >
            <thead>
                  <tr>
                    <th align="left" valign="middle" width="40%">{$language.lblProduct}</th>
                <th align="left" valign="middle" width="15%">{$language.lblPrice}</th>
                <th align="left" valign="middle" width="10%">{$language.lblQuantity}</th>
                <th align="left" valign="middle" width="15%" colspan="2">{$language.lblReason}</th>
              </tr>
                </thead>
            <tbody>
                
            {foreach from=$resDeclinedReturn item="declinedProduct" key="key"}
            {assign var="productID" value=$declinedProduct.productID}
            <tr>
                    <td align="left" valign="top"><span ><img src="{$view_public_path}/uploads/catalog/product/small/{$declinedProduct.productImage}?random={$rand|default:''}" class="fixing_left pd-img" />
					{if $productShowPrivilege|default:''}
						{html->anchor history="yes" href="/product/show/id/{$declinedProduct.productID}/" class="pd-title" content="<strong>{$declinedProduct.productTitle|truncate:80}</strong>"}
					{else}
						<strong>{$declinedProduct.productTitle|truncate:80}</strong>
					{/if}
					<br />
						({$language.lblOption} : {$declinedProduct.productOptionName})
						{assign var="unserialize" value=$declinedProduct.11|default:''|unserialize}
						{if $unserialize.combinationValues.customOption|default:array()|count >0}
							<div class="cart-detil"> <span class="heading">{$language.lblCombination} : {$language.lblSKU} - {$unserialize.combinationValues.cimbinationSKU}</span>
							<div class="show-hide-cart" style="display:block;"> <span class="combination " > {foreach from=$unserialize.combinationValues.customOption|default:'' item="combination" key="key"}
							{if $key neq 0}<span class="x-style">X </span>{/if}
								{$combination.customOptionName} - {$combination.variantValue}
							{/foreach} </span> </div>
							</div>
						{/if}						
						{if $unserialize.customOptionValues|count >0}
							<div class="cart-detil"><span class="heading">{$language.lblOptions}</span>
							<div class="show-hide-cart" style="display:block;"> {foreach from=$unserialize.customOptionValues item="customOptionValues"} <span class="combination clearfix" > <span class="left">{$customOptionValues.0.customOptionName}</span> <span class="right"> {foreach from=$customOptionValues item="customOption" key="key"}
							{if $customOption.inputType != 'file'}
								{$customOption.variantValue}{if $key >0},{/if}
							{else if $customOption.inputType == 'file' && $customOption.variantValue!=''}
					  {if $orderShowPrivilege}
                      {html->anchor href="/order/getFile/id/{$customOption.variantValue}/" 
                      caption=$customOption.variantValue 
                      title=$customOption.customOptionName}
					  {else}
					  {$customOption.variantValue}
                      {/if}
                      {/if}
                      {/foreach} </span> </span> {/foreach} </div>
                  </div>
                  {/if}						
				  </span></td>
                  <td align="left" valign="top"><span > {$declinedProduct.orderItemPrice|price:'':$declinedProduct.productDefaultCurrency|default:'':$declinedProduct.productDefaultCurrency|default:''}</span></td>
                  <td align="left" valign="top"> {$declinedProduct.quantity|default:0} </td>
                  <td align="left" valign="top" colspan="2"> {$declinedProduct.reason} </td>
                </tr>
            {/foreach}
              </tbody>
            
          </table>

            </div>
        <!--end: Product List-->
	
        {form->close} </div>
          {/if}
		  {if $resReturnDetails.returnStatusID|default:'' neq 5}
          {form->start name="formReturnAction" action="" method="post" enctype="multipart/form-data"}
          {form->hidden name="returnID" value=$retrunID|default:''}
          {form->hidden name="actionID" value=$resReturnDetails.actionID|default:''}
          <div class="tab-content container-section margin-top" style="display:none">
        <h3 class="border-bottom">{$language.lblActionRequest}</h3>
        <div class="order_details row">
				<ul class=" listing-03 col-sm-6">
				{assign var="statusFlag" value=0}
				{assign var="requestStatus" value="->{$language.lblSelect}"}
				{foreach from=$rmaStatuses item="reqStatus"}
					{if ($resReturnDetails.returnStatusID|default:'' eq 1 || $resReturnDetails.returnStatusID|default:'' eq 4) && $reqStatus[0] eq 3}
						{$statusFlag= 1}
						{assign var="requestStatus" value="{$requestStatus}~*{$reqStatus[0]}->{$reqStatus[1]}"}
					{/if}
					{if ($resReturnDetails.returnStatusID|default:'' eq 1) && ($reqStatus[0] eq 4)}
						{$statusFlag= 1}
						{assign var="requestStatus" value="{$requestStatus}~*{$reqStatus[0]}->{$reqStatus[1]}"}
					{/if}
					{if ($resReturnDetails.returnStatusID|default:'' eq 4) && ($reqStatus[0] eq 1)}
						{$statusFlag= 1}
						{assign var="requestStatus" value="{$requestStatus}~*{$reqStatus[0]}->{$reqStatus[1]}"}
					{/if}
					{if ($resReturnDetails.returnStatusID|default:'' eq 3) && ($reqStatus[0] eq 5)}
						{$statusFlag= 1}
						{assign var="requestStatus" value="{$requestStatus}~*{$reqStatus[0]}->{$reqStatus[1]}"}
					{/if}
				{/foreach}
				{if $statusFlag == 1}
					<li class="row"> 
                        <span class="col-xs-12 col-sm-6 col-first">{$language.lblStatus} : </span> 
                        <span class="col-xs-12 col-sm-6 col-last">{form->select options=$requestStatus name="rmaStatus"  class="form-control" validate="required" error="{$language.errStatusSelect}"}</span> </li>
					<li class="row bg-transparent" >  
                        <span class="col-xs-12 col-sm-6 col-first"> {$language.lblComments} :</span> 
                        <span class="col-xs-12 col-sm-6 col-last">{form->textarea style="height:70px;" cols=30 rows=5 class="form-control " name="notifyComment" validate="required" error="{$language.errComment}"}
                              {form->submit name="submitAction" class="update_btn_table btn btn-primary btn-sm margin-top" value="{$language.lblSave}"}
						
						</span>
					</li> 
                    <li>
                        
                    </li>
				{else}
					{$language.lblSelectedStatus}
				{/if}
				</ul>
				
        </div>
        {form->close} {/if}</div>
        </div>

    
    <!--End: left Block-->
  </div>
      <!--End:Content Container--> 
      {include file='CommonFooter.tpl'} </div>
<!--End:Outer Container--> 
{include file='CommonJavaScriptBottom.tpl'} 
<script type="text/javascript" src="{$view_javascript}/jquery.multiselect.widget.js"></script> 
<script type="text/javascript" src="{$view_javascript}/returndetails.page.js"></script> 
<script type="text/javascript" src="{$view_javascript}/jquery.colorbox.js"></script> 
<script type="text/javascript" src="{$common_js}/validate.plugin.js"></script> 
<script type="text/javascript" src="{$view_javascript}/chosen.jquery.min.js"></script>
<script type="text/javascript">
if($(".tab-anchor").hasClass('active')){
		var index = $(this).index(this);
		$(".tab-content:eq("+index+")").fadeIn();
	}
$(".tab-anchor").click(function () {
	$(".tab-anchor").removeClass("active");
	$(this).addClass("active");
  var index = $(".tab-anchor").index(this);
  $(".tab-content").hide();
  $(".tab-content:eq("+index+")").fadeIn();
});
</script> 
{form->validate_script form = "formReturnAction"}
{html->messages_script id="common_message"}
</body>
</html>
