'always_post_to_accounts_receivable' => CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,
'deferred_revenue_enabled' => CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,
'default_invoice_page' => CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,
- 'financial_account_bal_enable' => CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,
- 'fiscalYearStart' => CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME,
- 'prior_financial_period' => CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,
'invoicing' => CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,
);
)
);
}
- $defaults['fiscalYearStart'] = Civi::settings()->get('fiscalYearStart');
- $period = CRM_Contribute_BAO_Contribution::checkContributeSettings('prior_financial_period');
- $this->assign('priorFinancialPeriod', $period);
return $defaults;
}
unset($params['qfKey']);
unset($params['entryURL']);
Civi::settings()->set('contribution_invoice_settings', $params);
- Civi::settings()->set('fiscalYearStart', $params['fiscalYearStart']);
// to set default value for 'Invoices / Credit Notes' checkbox on display preferences
$values = CRM_Core_BAO_Setting::getItem("CiviCRM Preferences");
'description' => '',
'help_text' => '',
),
- 'financial_account_bal_enable' => array(
- 'group_name' => 'Contribute Preferences',
- 'group' => 'contribute',
- 'name' => 'financial_account_bal_enable',
- 'type' => 'Integer',
- 'html_type' => 'checkbox',
- 'quick_form_type' => 'Element',
- 'default' => 0,
- 'add' => '4.7',
- 'title' => 'Enable Financial Account Balances',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
- 'prior_financial_period' => array(
- 'group_name' => 'Contribute Preferences',
- 'group' => 'contribute',
- 'name' => 'prior_financial_period',
- 'type' => 'activityDate',
- 'quick_form_type' => 'Date',
- 'html_type' => 'Date',
- 'default' => '',
- 'add' => '4.7',
- 'title' => 'Prior Financial Period',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => '',
- 'help_text' => '',
- ),
'always_post_to_accounts_receivable' => array(
'group_name' => 'Contribute Preferences',
'group' => 'contribute',
'description' => NULL,
'help_text' => NULL,
),
- 'financial_account_bal_enable' => array(
- 'group_name' => 'Contribute Preferences',
- 'group' => 'contribute',
- 'name' => 'financial_account_bal_enable',
- 'type' => 'Integer',
- 'html_type' => 'checkbox',
- 'quick_form_type' => 'Element',
- 'default' => 0,
- 'add' => '4.7',
- 'title' => 'Enable Financial Account Balances',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => NULL,
- 'help_text' => NULL,
- ),
- 'prior_financial_period' => array(
- 'group_name' => 'Contribute Preferences',
- 'group' => 'contribute',
- 'name' => 'prior_financial_period',
- 'type' => 'activityDate',
- 'quick_form_type' => 'Date',
- 'html_type' => 'Date',
- 'default' => NULL,
- 'add' => '4.7',
- 'title' => 'Prior Financial Period',
- 'is_domain' => 1,
- 'is_contact' => 0,
- 'description' => NULL,
- 'help_text' => NULL,
- ),
'always_post_to_accounts_receivable' => array(
'group_name' => 'Contribute Preferences',
'group' => 'contribute',
$("#deferred_revenue_enabled").click(function() {
showHideElement('deferred_revenue_enabled', 'default_invoice_page');
});
- showHideElement('financial_account_bal_enable', 'fiscalYearStart');
- $("#financial_account_bal_enable").click(function() {
- showHideElement('financial_account_bal_enable', 'fiscalYearStart');
- });
function showHideElement(checkEle, toHide) {
if ($('#' + checkEle).prop('checked')) {
$("tr.crm-preferences-form-block-" + toHide).show();
$("tr.crm-preferences-form-block-" + toHide).hide();
}
}
- $('input[name=_qf_Contribute_next]').on('click', checkPeriod);
- function checkPeriod() {
- var speriod = $('#prior_financial_period').val();
- var hperiod = '{/literal}{$priorFinancialPeriod}{literal}';
- if (((hperiod && speriod == '') || (hperiod && speriod != '')) && (speriod != hperiod)) {
- var msg = '{/literal}{ts}Changing the Prior Financial Period may result in problems calculating closing account balances accurately and / or exporting of financial transactions. Do you want to proceed?{/ts}{literal}';
- return confirm(msg);
- }
- }
});
</script>
{/literal}
{else}
<td class="label">{$form.$htmlField.label} {if $htmlField eq 'acl_financial_type'}{help id="$htmlField"}{/if}</td>
<td>
- {if $htmlField eq 'prior_financial_period'}
- {include file="CRM/common/jcalendar.tpl" elementName=$htmlField}
- {else}
- {$form.$htmlField.html}
- {/if}
+ {$form.$htmlField.html}
{if $desc}
<br /><span class="description">{$desc}</span>
{/if}
</tr>
{/if}
{/foreach}
- {$form.prior_financial_period_M_hidden.html}
- {$form.prior_financial_period_d_hidden.html}
</table>
{/if}
<table class="form-layout" id="invoicing_blocks">