<script type="text/javascript">
var lblMaxCharaLength	=	"{$language.lblMaxCharaLength500}";
var msgAdjustableamountRollback	=	"{$language.msgAdjustableamountRollback}";
var msgEnterTransactionNoteForAdmin	=	"{$language.msgEnterTransactionNoteForAdmin}";
var msgEnterTransactionNoteForAffiliate	=	"{$language.msgEnterTransactionNoteForAffiliate}";
</script>
{include file='CommonJavaScript.tpl'}
<link href="{$view_styles}/popup.css" rel="stylesheet" type="text/css" media="screen" />
<div class="popup-block">
<h2>{$language.lblTotalAmount}       : {$totalCommissionAmount|price} </h2>
{form->start name="formAffiliateTransaction" action="" method="post"}
			 {if $resRollbackOrders|default:array()}
<h4>{$language.lblCancelledOrder}</h4>
<div class="grid_table00" >
            {form->hidden name="currencySymbolLeft"}
			{form->hidden name="currencySymbolRight"}
  <table width="100%" border="0" cellspacing="0" cellpadding="0"  >
    <tr>
      <th width="42" align="left" valign="middle" >&nbsp;</th>
      <th width="42" align="left" valign="middle" > {$language.lblOrderID}</th>
      <th width="42" align="left" valign="middle" > {$language.lblOrderDate}</th>
      <th width="42" align="left" valign="middle" >{$language.lblPaymentStatus}</th>
      <th width="42" align="left" valign="middle" >{$language.lblOrderStatus}</th>
      <th width="42" align="left" valign="middle" >{$language.lblAmountPaid}</th>
    </tr>
    {foreach from=$resRollbackOrders item="rollbackOrders" key="key1"}
    {assign var="affiliateCommissionID" value=$rollbackOrders.affiliateCommissionID}
    <tr>
      <td width="42" align="left" valign="middle" > {form->checkbox name="check_$affiliateCommissionID" name="checkCommissionIDs[]" value=$affiliateCommissionID class="checkbox01 ListAll"}</td>
      <td width="42" align="left" valign="middle" >{$rollbackOrders.orderNumber}</td>
      <td width="42" align="left" valign="middle" > {$rollbackOrders.createdDate|date_format:$settingsDateFormat} {$order.createdDate|default:''|date_format:$settingsTimeFormat}</td>
      <td width="42" align="left" valign="middle" >{$rollbackOrders.paymentStatus}</td>
      <td width="42" align="left" valign="middle" >{$rollbackOrders.orderStatus}</td>
      <td width="42" align="left" valign="middle" >{$rollbackOrders.commissionAmount|price}<span style="display:none" id="or_{$affiliateCommissionID}">{$rollbackOrders.commissionAmount}</span></td>
    </tr>
    {/foreach}
    <tfoot>
    
    {if !$action|default:''}
    <tr>
      <td colspan="5" align="right">{$language.lblTotalAdjustableAmount}</td>
      <td><span id="AdjustableAmount">0</span> <span style="display:none" id="HidAdjustableAmount">0}</span></td>
    </tr>
    {/if}
    <tr>
      <td colspan="5" align="right">{if !$action|default:''}{$language.lblAmountneedtopay}{else} {$language.lblAmountneedtocancel} {/if} </td>
      <td><span id="needToPayShow">{$totalCommissionAmount|price}</span><span id="needToPay"  style="display:none;">{$totalCommissionAmount}</span></td>
    </tr>
      </tfoot>
    
  </table>
</div>
{/if}
<table width="100%" cellpadding="0" cellspacing="0" class="form_grid">
  <tr>
    <td> {$language.lblTransactionNoteForAdmin} </td>
    <td> {$language.lblTransactionNoteForAffiliate} </td>
  </tr>
  <tr>
    <td> {form->textarea onkeyup="return ismaxlength(this)" tabindex="1" onchange="return ismaxlength(this)" maxlength="500" name="affiliateTransDescription" rows="6" cols="50"} </td>
    <td> {form->textarea onkeyup="return ismaxlength(this)" tabindex="1" onchange="return ismaxlength(this)" maxlength="500" name="transactionDescrForAffiliate" rows="6" cols="50"} </td>
  </tr>
  <tr>
    <td colspan="2"><div class="submit-block textto_center"> <span>&nbsp; </span> {form->submit  name="submitTransaction" tabindex="1" id="submitTransaction" class="curve-3" value=$language.lblSubmit} {$language.lblOr}
        {html->anchor id="cancel" tabindex="1" onclick="parent.location.reload();" name="cancelAffiliateAdd"  caption="{$language.lblCancel}"} </div></td>
  </tr>
</table>
{form->close} 
{form->rootpath_script}
{form->basepath_script} 
<script type="text/javascript" src="{$view_javascript}/affiliateTransaction.page.js"></script>