Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-21005, "Record Payment" dialogue lacks required field and is clunky #10817

Merged
merged 3 commits into from
Aug 8, 2017

Conversation

pradpnayak
Copy link
Contributor

@pradpnayak pradpnayak commented Aug 4, 2017

Overview

This PR holds fix

  1. Add required marker for Payment method on Record payment form
  2. Set amount default to amount owed on Record payment form

Before

before

After

after
)


----------------------------------------
* CRM-21005: "Record Payment" dialogue lacks required field and is clunky
  https://issues.civicrm.org/jira/browse/CRM-21005
----------------------------------------
* CRM-21005: "Record Payment" dialogue lacks required field and is clunky
  https://issues.civicrm.org/jira/browse/CRM-21005
monishdeb
monishdeb approved these changes Aug 4, 2017
@@ -100,7 +100,7 @@
</td>
</tr>
<tr class="crm-payment-form-block-payment_instrument_id">
<td class="label">{$form.payment_instrument_id.label}</td>
<td class="label">{$form.payment_instrument_id.label} <span class="crm-marker" title="{ts}This field is required.{/ts}">*</span></td>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pradpnayak why can't we change at backend by setting required parameter TRUE for payment_instrument_id here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the same form is used to pay as a credit card using payment processor, in those case this field should not be required.

@lcdservices
Copy link
Contributor

tested and confirmed.

@@ -252,7 +255,7 @@ public function buildQuickForm() {
$this->add('select', 'payment_instrument_id',
ts('Payment Method'),
array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::paymentInstrument(),
FALSE,
TRUE,
Copy link
Member

@monishdeb monishdeb Aug 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pradpnayak I have set required = TRUE because this field is present only in backoffice form not on live mode, see the check is made on line 252 above. Also tested in my local and it's working fine w/o live mode.

@pradpnayak
Copy link
Contributor Author

pradpnayak commented Aug 7, 2017

My bad :(, Tested works fine.

@monishdeb
Copy link
Member

@colemanw can you please test and merge this PR?

@colemanw colemanw merged commit 2dab519 into civicrm:master Aug 8, 2017
@pradpnayak pradpnayak deleted the CRM-21005 branch August 8, 2017 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants