| 1 | {* |
| 2 | +--------------------------------------------------------------------+ |
| 3 | | CiviCRM version 4.7 | |
| 4 | +--------------------------------------------------------------------+ |
| 5 | | Copyright CiviCRM LLC (c) 2004-2015 | |
| 6 | +--------------------------------------------------------------------+ |
| 7 | | This file is a part of CiviCRM. | |
| 8 | | | |
| 9 | | CiviCRM is free software; you can copy, modify, and distribute it | |
| 10 | | under the terms of the GNU Affero General Public License | |
| 11 | | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | |
| 12 | | | |
| 13 | | CiviCRM is distributed in the hope that it will be useful, but | |
| 14 | | WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
| 16 | | See the GNU Affero General Public License for more details. | |
| 17 | | | |
| 18 | | You should have received a copy of the GNU Affero General Public | |
| 19 | | License and the CiviCRM Licensing Exception along | |
| 20 | | with this program; if not, contact CiviCRM LLC | |
| 21 | | at info[AT]civicrm[DOT]org. If you have questions about the | |
| 22 | | GNU Affero General Public License or the licensing of CiviCRM, | |
| 23 | | see the CiviCRM license FAQ at http://civicrm.org/licensing | |
| 24 | +--------------------------------------------------------------------+ |
| 25 | *} |
| 26 | {if $action eq 1 or $action eq 2 or $action eq 8} |
| 27 | {include file="CRM/Financial/Form/FinancialAccount.tpl"} |
| 28 | {else} |
| 29 | <div id="help"> |
| 30 | {capture assign="typeLink"}{crmURL p="civicrm/admin/financial/financialType" q="reset=1"}{/capture} |
| 31 | {capture assign="paymentLink"}{crmURL p="civicrm/admin/options/payment_instrument" q="reset=1"}{/capture} |
| 32 | {capture assign="premiumLink"}{crmURL p="civicrm/admin/contribute/managePremiums" q="reset=1"}{/capture} |
| 33 | <p>{ts 1=$typeLink 2=$paymentLink 3=$premiumLink}Financial accounts correspond to those in your accounting system. <a href="%1">Financial types</a>, <a href="%2">payment methods</a>, and <a href="%3">premiums</a> are associated with financial accounts so that they can result in the proper double-entry transactions to export to your accounting system.{/ts}</p> |
| 34 | </div> |
| 35 | {if $action ne 1 and $action ne 2} |
| 36 | <div class="action-link"> |
| 37 | <a href="{crmURL q="action=add&reset=1"}" id="newFinancialAccount-top" class="button"><span><div class="icon ui-icon-circle-plus"></div>{ts}Add Financial Account{/ts}</span></a> |
| 38 | </div> |
| 39 | {/if} |
| 40 | |
| 41 | {if $rows} |
| 42 | {include file="CRM/common/jsortable.tpl"} |
| 43 | <div id="ltype"> |
| 44 | <p></p> |
| 45 | <div class="form-item"> |
| 46 | {strip} |
| 47 | {* handle enable/disable actions*} |
| 48 | {include file="CRM/common/enableDisableApi.tpl"} |
| 49 | <table id="crm-financial_accounts" class="display"> |
| 50 | <thead class="sticky"> |
| 51 | <th>{ts}Name{/ts}</th> |
| 52 | <th>{ts}Description{/ts}</th> |
| 53 | <th>{ts}Acctg Code{/ts}</th> |
| 54 | <th id="sortable">{ts}Account Type{/ts}</th> |
| 55 | <th>{ts}Deductible?{/ts}</th> |
| 56 | <th>{ts}Reserved?{/ts}</th> |
| 57 | <th>{ts}Default?{/ts}</th> |
| 58 | <th>{ts}Enabled?{/ts}</th> |
| 59 | <th></th> |
| 60 | </thead> |
| 61 | {foreach from=$rows item=row} |
| 62 | <tr id="financial_account-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if}"> |
| 63 | <td class="crm-editable" data-field="name">{$row.name}</td> |
| 64 | <td class="crm-editable" data-field="description" data-type="textarea">{$row.description}</td> |
| 65 | <td class="crm-editable" data-field="accounting_code">{$row.accounting_code}</td> |
| 66 | <td>{$row.financial_account_type_id}{if $row.account_type_code} ({$row.account_type_code}){/if}</td> |
| 67 | <td>{if $row.is_deductible eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td> |
| 68 | <td>{if $row.is_reserved eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td> |
| 69 | <td>{if $row.is_default eq 1}<img src="{$config->resourceBase}i/check.gif" alt="{ts}Default{/ts}" /> {/if}</td> |
| 70 | <td id="row_{$row.id}_status">{if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td> |
| 71 | <td>{$row.action|replace:'xx':$row.id}</td> |
| 72 | </tr> |
| 73 | {/foreach} |
| 74 | </table> |
| 75 | {/strip} |
| 76 | |
| 77 | {if $action ne 1 and $action ne 2} |
| 78 | <div class="action-link"> |
| 79 | <a href="{crmURL q="action=add&reset=1"}" id="newFinancialAccount-bottom" class="button"><span><div class="icon ui-icon-circle-plus"></div>{ts}Add Financial Account{/ts}</span></a> |
| 80 | </div> |
| 81 | {/if} |
| 82 | </div> |
| 83 | </div> |
| 84 | {else} |
| 85 | <div class="messages status"> |
| 86 | <div class="icon inform-icon"></div> |
| 87 | {capture assign=crmURL}{crmURL q="action=add&reset=1"}{/capture} |
| 88 | {ts 1=$crmURL}There are no Financial Account entered. You can <a href='%1'>add one</a>.{/ts} |
| 89 | </div> |
| 90 | {/if} |
| 91 | {/if} |