{* Affiliate program settings and info *}
{if $smarty.const.CONF_AFFILIATE_PROGRAM_ENABLED}
{if !$show_tables}{$smarty.const.MSG_PERIOD_ISNT_SPECIFIED}
{/if}
{if $show_tables}
{* commissions table *}
{if $CommissionsNumber}
{if $delete_commission}{$smarty.const.AFFP_MSG_COMMISSION_DELETED}
{/if}
{$smarty.const.AFFP_STRING_CUSTOMER_COMMISSIONS} ({$smarty.const.STRING_FROM} {$from} {$smarty.const.STRING_TILL} {$till})
ID
{$smarty.const.ADMIN_CURRENT_DATE}
{$smarty.const.TABLE_CUSTOMER}
{$smarty.const.STRING_DESCRIPTION}
{$smarty.const.STRING_SUM}
{assign var="admhl" value=0}
{foreach from=$Commissions item=_Commission}
{if $admhl eq 1}
{else}{assign var="admhl" value=1}{/if}
{assign_array var="TotalCommissionsAmount" index=$_Commission.CurrencyISO3 value=$TotalCommissionsAmount[$_Commission.CurrencyISO3]+$_Commission.Amount}
C-{$_Commission.cID}
{$_Commission.xDateTime}
{$_Commission.CustomerLogin}
{$_Commission.Description}
{$_Commission.Amount} {$_Commission.CurrencyISO3}
{$smarty.const.EDIT_BUTTON} | X
{/foreach}
{$smarty.const.STRING_SUM}:
{foreach from=$TotalCommissionsAmount key=_key item=_total}
{$_total|string_format:"%.2f"} {$_key}
{/foreach}
{else}
{$smarty.const.AFFP_MSG_NOCOMMISISONS_FOUND}
{/if}{* if $CommissionsNumber *}
{* payments table *}
{if $PaymentsNumber}
{if $delete_payment}{$smarty.const.AFFP_MSG_PAYMENT_DELETED}
{/if}
{$smarty.const.AFFP_STRING_PAYMENTS_TO_CUSTOMERS} ({$smarty.const.STRING_FROM} {$from} {$smarty.const.STRING_TILL} {$till})
ID
{$smarty.const.ADMIN_CURRENT_DATE}
{$smarty.const.TABLE_CUSTOMER}
{$smarty.const.STRING_DESCRIPTION}
{$smarty.const.STRING_SUM}
{assign var="admhl" value=0}
{foreach from=$Payments item=_Payment}
{if $admhl eq 1}
{else}{assign var="admhl" value=1}{/if}
{assign_array var="TotalPaymentsAmount" index=$_Payment.CurrencyISO3 value=$TotalPaymentsAmount[$_Payment.CurrencyISO3]+$_Payment.Amount}
P-{$_Payment.pID}
{$_Payment.xDate}
{$_Payment.CustomerLogin}
{$_Payment.Description}
{$_Payment.Amount} {$_Payment.CurrencyISO3}
{$smarty.const.EDIT_BUTTON} | X
{/foreach}
{$smarty.const.STRING_SUM}:
{foreach from=$TotalPaymentsAmount key=_key item=_total}
{$_total|string_format:"%.2f"} {$_key}
{/foreach}
{$smarty.const.AFFP_USER_BALANCE}:
{foreach from=$CurrencyISO3 item=_currency}
{if $TotalCommissionsAmount[$_currency.currency_iso_3] or $TotalPaymentsAmount[$_currency.currency_iso_3]}
{"`$TotalCommissionsAmount[$_currency.currency_iso_3]-$TotalPaymentsAmount[$_currency.currency_iso_3]`"|string_format:"%.2f"}
{$_currency.currency_iso_3}
{/if}
{/foreach}
{else}
{$smarty.const.AFFP_MSG_NOPAYMENTS_FOUND}
{/if}
{/if}
{if $error_new_commission}{$error_new_commission}
{/if}
{if $newCommissionStatus}{$smarty.const.AFFP_MSG_NEW_COMMISSION_OK}
{/if}
{$smarty.const.ADD_BUTTON}
{if $error_new_payment}{$error_new_payment}
{/if}
{if $newPayStatus}{$smarty.const.AFFP_MSG_NEW_PAY_OK}
{/if}
{$smarty.const.ADD_BUTTON}
{$smarty.const.USEFUL_FOR_YOU} {$smarty.const.ALERT_ADMIN2}
{else}
{$smarty.const.AFFP_MSG_PROGRAM_DISABLED}. {$smarty.const.AFF_GO_SETTINGS}
{$smarty.const.USEFUL_FOR_YOU} {$smarty.const.ALERT_ADMIN2}
{/if}