Eileen has uploaded a new change for review.
https://gerrit.wikimedia.org/r/281585
Change subject: Fix source field on partial refunds
......................................................................
Fix source field on partial refunds
We are showing partial refunds by updating the original refund status to
Refunded but creating an extra contribution for any part not refunded. I
decided we were using a negative incorrectly in the source.
Bug: T127929
Change-Id: I3b8ddcd8bf60f4d5a9b433d249f846fa5f89a7e9
---
M sites/all/modules/wmf_civicrm/tests/phpunit/RefundTest.php
M sites/all/modules/wmf_civicrm/wmf_civicrm.module
2 files changed, 3 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm
refs/changes/85/281585/1
diff --git a/sites/all/modules/wmf_civicrm/tests/phpunit/RefundTest.php
b/sites/all/modules/wmf_civicrm/tests/phpunit/RefundTest.php
index d03486e..16ad05d 100644
--- a/sites/all/modules/wmf_civicrm/tests/phpunit/RefundTest.php
+++ b/sites/all/modules/wmf_civicrm/tests/phpunit/RefundTest.php
@@ -183,7 +183,7 @@
));
$this->assertEquals(
- "{$this->original_currency} -0.25",
+ "{$this->original_currency} 0.25",
$refund_contribution['contribution_source'],
'Refund contribution has correct lesser amount'
);
@@ -253,6 +253,7 @@
$this->assertEquals('USD', $contributions['values'][2]['currency']);
// Exchange rates might move a bit but hopefully it stays less than the
original amount.
$this->assertEquals($contributions['values'][2]['total_amount'], 150);
+ $this->assertEquals('COP 15000',
$contributions['values'][2]['contribution_source']);
}
}
diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.module
b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
index 6d684dc..1528b4e 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.module
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
@@ -1888,7 +1888,7 @@
// New type?
'financial_type_id' => 'Refund',
'contact_id' => $contribution['contact_id'],
- 'contribution_source' => $refund_currency . " " .
$amount_scammed,
+ 'contribution_source' => $refund_currency . " " .
-$amount_scammed,
'trxn_id' => $refund_unique_id,
'receive_date' => date('Y-m-d h:i:s', $refund_date),
'currency' => 'USD',
--
To view, visit https://gerrit.wikimedia.org/r/281585
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3b8ddcd8bf60f4d5a9b433d249f846fa5f89a7e9
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Eileen <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits