Added code to display check number on edit payment form
This commit is contained in:
parent
88c0b0e9a8
commit
f71e682614
@ -209,4 +209,15 @@ function checknumberpaymentmethod_civicrm_buildForm($formName, &$form) {
|
||||
$form->assign('paymentTypeLabel', ts('Check Information'));
|
||||
}
|
||||
}
|
||||
if ('CRM_Financial_Form_PaymentEdit' == $formName) {
|
||||
$paymentInstrumentsFromSettings = civicrm_api3('Setting', 'getvalue', [
|
||||
'name' => 'check_payment_instrument_ids',
|
||||
]);
|
||||
$paymentInstrumentsFromSettings[] = (string) CRM_Core_PseudoConstant::getKey(
|
||||
'CRM_Contribute_BAO_Contribution',
|
||||
'payment_instrument_id',
|
||||
'Check'
|
||||
);
|
||||
$form->assign('paymentInstrumentsFromSettings', json_encode($paymentInstrumentsFromSettings));
|
||||
}
|
||||
}
|
||||
|
18
templates/CRM/Financial/Form/PaymentEditExtra.tpl
Normal file
18
templates/CRM/Financial/Form/PaymentEditExtra.tpl
Normal file
@ -0,0 +1,18 @@
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
CRM.$(function ($) {
|
||||
var $paymentInstrumentsFromSettings = {/literal}{$paymentInstrumentsFromSettings}{literal};
|
||||
$('#payment_instrument_id').change(showHidePI);
|
||||
showHidePI();
|
||||
function showHidePI() {
|
||||
var $paymentInstrumentID = $('#payment_instrument_id').val();
|
||||
if ($.inArray($paymentInstrumentID, $paymentInstrumentsFromSettings) > -1) {
|
||||
$('div.check_number-section').show();
|
||||
}
|
||||
else {
|
||||
$('div.check_number-section').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{/literal}
|
Loading…
Reference in New Issue
Block a user