{* Check to see if this user can lock/unlock items *}
{if call_user_func(array('CRM_Core_Permission','check'), 'Administer CiviCRM')}
{assign var='canLock' value='crm-editable'}
{/if}
{ts}Fiscal Year: {/ts}
{$fiscal_year_options}
{ts}Endowment{/ts}
{ts}Annual Budget{/ts}
{ts}Amount Awarded{/ts}
{ts}Amount Remaining{/ts}
{ts}Locked?{/ts}
{ts}Note{/ts}
{crmAPI var='result' entity='GrantBudget' action='getbudget' fiscal_year=$fiscalYear}
{crmAPI var='totals' entity='GrantBudget' action='getbudget' fiscal_year=$fiscalYear return_totals=1}
Totals:
{foreach from=$totals.values item=total}
{$total}
{/foreach}
{foreach from=$result.values item=row}
{if $row.id}
{assign var='rowId' value=$row.id}
{if !$row.is_reserved}
{assign var='canEdit' value='crm-editable'}
{/if}
{else}
{capture assign=rowId}{$row.financial_type_id}_{$fiscalYear}{/capture}
{/if}
{$row.name}
{$row.budget}
{$row.total_amount_granted}
{$row.balance_amount}
{if $row.is_reserved eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}
{$row.note}
{/foreach}
Totals:
{foreach from=$totals.values item=total}
{$total}
{/foreach}
{crmButton p="civicrm" q="reset=1" class="cancel" icon="times"}{ts}Done{/ts}{/crmButton}
{literal}
{/literal}