Skip to content

Commit

Permalink
Merge pull request #9556 from jitendrapurohit/CRM-19777
Browse files Browse the repository at this point in the history
CRM-19777: Edit contribution : wrong decimal separator on total_amount
  • Loading branch information
monishdeb authored Dec 21, 2016
2 parents 40c4673 + 85ade0a commit 0cf3700
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CRM/Member/Form/MembershipRenewal.php
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,10 @@ protected function submit() {
'membership_id' => $renewMembership->id,
'contribution_recur_id' => $contributionRecurID,
));
//Remove `tax_amount` if it is not calculated.
if (CRM_Utils_Array::value('tax_amount', $temporaryParams) === 0) {
unset($temporaryParams['tax_amount']);
}
CRM_Member_BAO_Membership::recordMembershipContribution($temporaryParams);
}

Expand Down
2 changes: 2 additions & 0 deletions tests/phpunit/CRM/Member/Form/MembershipRenewalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,10 @@ public function testSubmitPayLater() {
$contribution = $this->callAPISuccessGetSingle('Contribution', array(
'contact_id' => $this->_individualId,
'contribution_status_id' => 2,
'return' => array("tax_amount", "trxn_id"),
));
$this->assertEquals($contribution['trxn_id'], 777);
$this->assertEquals($contribution['tax_amount'], NULL);

$this->callAPISuccessGetCount('LineItem', array(
'entity_id' => $membership['id'],
Expand Down

0 comments on commit 0cf3700

Please sign in to comment.