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-20954 Fixing localized financial status problems #10747

Merged
merged 2 commits into from
Jul 25, 2017

Conversation

samuelsov
Copy link
Contributor

Quite trivial patch that uses CRM_Core_PseudoConstant::getKey (localization independent) instead of CRM_Core_PseudoConstant::get (which return a localized version by default)

To reproduce the problem :

  • localize financial status label (/civicrm/admin/options?reset=1 -> financial_item_status -> change "Paid" label to something else like "Payé")
  • create any contribution on any contact and set the status to "Pending"
  • submit a new (partial payment) -> contribution status should change to "Partially paid"
  • submit a new payment for the balance -> should crash without this PR

@@ -3961,7 +3960,7 @@ public static function recordAdditionalPayment($contributionId, $trxnsData, $pay
$contributionDetails = CRM_Core_DAO::setFieldValue('CRM_Contribute_BAO_Contribution', $contributionId, 'contribution_status_id', $statusId);
}
// add financial item entry
$financialItemStatus = CRM_Core_PseudoConstant::get('CRM_Financial_DAO_FinancialItem', 'status_id');
$paidStatus = CRM_Core_PseudoConstant::getKey('CRM_Financial_DAO_FinancialItem', 'status_id', 'Paid');
Copy link
Member

Choose a reason for hiding this comment

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

@samuelsov can you initialise this $paidStatus outside the IF-ELSEIF loop, that could avoid the repeated assignment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@monishdeb sure, it's done

@monishdeb
Copy link
Member

Working as expected.

@monishdeb monishdeb merged commit b64fc3e into civicrm:master Jul 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants