<!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.lblAffiliate} : {$language.lblPaymentReport} : {$language.lblReceivedPayments}</title>
{include file='CommonStyles.tpl'}
<link rel="stylesheet" type="text/css" href="{$view_styles}/ui.daterangepicker.css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/affiliates.css" />
{include file='CommonJavaScript.tpl'}
</head>
<body>
<!-- Outer container starts-->
<div class="outer_container"> 
  <!-- Header Container starts--> 
  {include file='CommonTop.tpl'} 
  <!-- Header Container ends--> 
  <!-- Content Container starts-->
  <div class="content_container2"> 
    <!-- left wrapper starts-->
    <div class="left_wrapper">
      <div class="content_wrapper">
      <div align="right">
     	{html->anchor class="action-link" href="{$previousURl}" content="<span class='back'>{$language.lblBack}</span>"} 
     </div>
        <h2>{$language.lblTransactionID} # {$transactionID} </h2>
        <!-- Inner Content Container starts-->
        <div class="inner_content_wrapper"> 
          <!-- Search container starts -->
          <div class="search_container">
            <div class="inner"> 
             {form->start name="searchTransaction"  method="post"}
            {form->hidden id="searchAlert" name="searchAlert" value=$language.lblSearchEnter}
            {form->hidden name="transactionID" value=$transactionID}
              <table width="100%" border="0" cellspacing="0" cellpadding="0"   >
                <tr>
                  <td  width="10%" align="left" valign="middle" class="left">{$language.lblType}</td>
                  <td  width="20%" align="left" valign="middle"><div class="textfield">
                      <div class="textfield"> 
                     {form->select name="type" id="type" class="select-box" caption="{$language.lblSelect}" options="Order->"|cat:$language.lblOrder|cat:"~*Registration->"|cat:$language.lblRegistration|cat:"~*Subscription->"|cat:$language.lblSubscription|cat:"~*Imported User->"|cat:$language.lblImportedUsers|cat:"~*Imported Subscriber->"|cat:$language.lblImportedSubscribers|cat:"" caption="->"|cat:$language.lblSelect}
                      </div>
                    </div></td>
                  <td align="left" valign="middle" class="padding-r-10"> 
                  	{form->submit name="formSubmitSearch" value={$language.lblSearch} class="button01"}
                    {html->anchor href="/payment/transactiondetails/transactionID/{$transactionID}/" class="action-link" caption=$language.lblResetFields}</td>
                </tr>
              </table>
              {form->close}
              <div class="clear"></div>
            </div>
          </div>
          <!--End:Search container-->  
          {if $resTransactionAmount} 
          <div class="clear"></div>
          <div class="grid01"> 
            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="grid_table00">
              <thead>
                <tr>
                 <th width="15%" align="left" valign="middle">
                  {$language.lblType}
                  </th>
                   <th width="12%" align="left" valign="middle" >
                  {$language.lblActionDate}
                  </th>
                  <th width="12%" align="left" valign="middle">{$language.lblTransactionDate}</th>
                  <th width="15%" align="left" valign="middle" >{$language.lblChargeBackCommission}</th>
                   <th width="10%" align="left" valign="middle">
                  {$language.lblCommission}
                  </th>
                </tr>
              </thead>
              <tbody>
              {foreach from=$resTransactionAmount item="orderList" key="key1"}
               {assign var="totalAdjustedAmount" value=$totalAdjustedAmount|default:0+$orderList.adjustedAmount}
              {assign var="totalTransactionTotalAmount" value=$totalTransactionTotalAmount|default:0+$orderList.commissionAmountChargback}
              <tr>
                <td align="left" valign="middle">
                {$orderList.orderNumber} 
                {if !( ($orderList.orderStatus =='Completed' &&  $orderList.paymentStatus=='Received') ||
				($orderList.orderStatus=='Pending' &&  $orderList.paymentStatus=='Received')	||
				($orderList.orderStatus=='Process' &&  $orderList.paymentStatus=='Received')) && $orderList.type =='Order'}{$language.lblCancelled}{/if}
                </td>
                <td align="left" valign="middle">{$orderList.createdDate|date_format:$settingsDateFormat} 				                                                 {$orderList.createdDate|date_format:$settingsTimeFormat}
                 </td>
                <td align="left" valign="middle">{$orderList.affiliateTransDate|date_format:$settingsDateFormat} 				                                                 {$orderList.affiliateTransDate|date_format:$settingsTimeFormat}
                </td>
                <td align="left" valign="middle">{$orderList.adjustedAmount|price}</td>
                <td align="left" valign="middle">{$orderList.commissionAmountChargback|price}</td>
              </tr>
              {/foreach}
                </tbody>
                <tfoot>
                 <tr class="bottom">
                <td align="left" valign="middle" colspan="2">{$language.lblTotal}</td>
                <td align="left" valign="middle">&nbsp;</td>
                <td align="left" valign="middle">{$totalAdjustedAmount|price}</td>
                <td align="left" valign="middle">{$totalTransactionTotalAmount|price}</td>
                </tr>
               </tfoot>
            </table>
           
            <div class="clear"></div>
          </div>
          {else}
          <div class="clear"></div>
          <div class="grid01 message_info"> {$language.msgNoRecords} </div>
          {/if} </div>
        <!-- Inner Content Container ends-->
        <div class="clear"></div>
      </div>
    </div>
    <!-- left wrapper ends--> 
    <!-- right side bar starts-->
    <div class="right-sidebar">
      <div class="side_wrapper"> 
        <!-- right side menu starts--> 
        {include file='AffReportSideMenu.tpl'} 
        <!-- right side menu ends--> 
      </div>
    </div>
    <!-- right side bar ends-->
    <div class="clear"></div>
  </div>
  <!-- Content Container ends--> 
  <!-- Footer starts--> 
  {include file='CommonBottom.tpl'} 
  <!-- Footer ends--> 
</div>
<!-- Outer container ends--> 
{form->rootpath_script}
{form->basepath_script}
<script type="text/javascript" src="{$view_javascript}/message.plugin.js"></script>
<script>
$(document).ready(function(e) {
$('.side_menu').find("a[rel='payment']").addClass('selected').removeBorder();
$('.main_menu').find("a[rel='affReports']").addClass('active');
		  var transID   = $("#transactionID").val();
		  $.ajax(
   {
     type: "POST",
     url: GLOBAL_BASE_PATH+"/payment/ajaxUpdateTransaction/", 
     data: "transactionID="+transID,
     success: function(msg){
        if(msg=="yes"){
          $(".count-rt").text($(".count-rt").text()-1);
			if($(".count-rt").text()=="0")
			{
				$(".transactionAlertCount").hide();
			}
        }
     }
  });
		
});
</script>
</body>
</html>