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-20987, added batch transaction column #10789

Merged
merged 2 commits into from
Jul 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions CRM/Financial/Page/AJAX.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,10 @@ public static function getFinancialTransactionsList() {
3 => 'amount',
4 => 'trxn_id',
5 => 'transaction_date',
6 => 'payment_method',
7 => 'status',
8 => 'name',
6 => 'receive_date',
7 => 'payment_method',
8 => 'status',
9 => 'name',
);

$sEcho = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer');
Expand Down Expand Up @@ -287,6 +288,7 @@ public static function getFinancialTransactionsList() {
'contact_a.contact_type',
'contact_a.contact_sub_type',
'civicrm_financial_trxn.trxn_date as transaction_date',
'civicrm_contribution.receive_date as receive_date',
'civicrm_financial_type.name',
'civicrm_financial_trxn.currency as currency',
'civicrm_financial_trxn.status_id as status',
Expand All @@ -298,7 +300,8 @@ public static function getFinancialTransactionsList() {
'sort_name' => ts('Contact Name'),
'amount' => ts('Amount'),
'trxn_id' => ts('Trxn ID'),
'transaction_date' => ts('Received'),
'transaction_date' => ts('Transaction Date'),
'receive_date' => ts('Received'),
'payment_method' => ts('Payment Method'),
'status' => ts('Status'),
'name' => ts('Type'),
Expand Down Expand Up @@ -374,6 +377,9 @@ public static function getFinancialTransactionsList() {
elseif ($columnKey == 'transaction_date' && $financialItem->$columnKey) {
$row[$financialItem->id][$columnKey] = CRM_Utils_Date::customFormat($financialItem->$columnKey);
}
elseif ($columnKey == 'receive_date' && $financialItem->$columnKey) {
$row[$financialItem->id][$columnKey] = CRM_Utils_Date::customFormat($financialItem->$columnKey);
}
elseif ($columnKey == 'status' && $financialItem->$columnKey) {
$row[$financialItem->id][$columnKey] = CRM_Core_PseudoConstant::getLabel('CRM_Contribute_BAO_Contribution', 'contribution_status_id', $financialItem->$columnKey);
}
Expand Down Expand Up @@ -450,6 +456,7 @@ public static function getFinancialTransactionsList() {
'amount',
'trxn_id',
'transaction_date',
'receive_date',
'payment_method',
'status',
'name',
Expand Down
3 changes: 3 additions & 0 deletions templates/CRM/Financial/Form/BatchTransaction.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
<th class="crm-contact-name">{ts}Name{/ts}</th>
<th class="crm-amount">{ts}Amount{/ts}</th>
<th class="crm-trxnID">{ts}Trxn ID{/ts}</th>
<th class="crm-trxn_date">{ts}Transaction Date{/ts}</th>
<th class="crm-received">{ts}Received{/ts}</th>
<th class="crm-payment-method">{ts}Pay Method{/ts}</th>
<th class="crm-status">{ts}Status{/ts}</th>
Expand Down Expand Up @@ -196,6 +197,7 @@ function buildTransactionSelectorAssign(filterSearch) {
{sClass:'crm-contact-name'},
{sClass:'crm-amount'},
{sClass:'crm-trxnID'},
{sClass:'crm-trxn_date'},
{sClass:'crm-received'},
{sClass:'crm-payment-method'},
{sClass:'crm-status'},
Expand Down Expand Up @@ -270,6 +272,7 @@ function buildTransactionSelectorRemove( ) {
{sClass:'crm-contact-name'},
{sClass:'crm-amount'},
{sClass:'crm-trxnID'},
{sClass:'crm-trxn_date'},
{sClass:'crm-received'},
{sClass:'crm-payment-method'},
{sClass:'crm-status'},
Expand Down
5 changes: 3 additions & 2 deletions templates/CRM/Financial/Page/BatchTransaction.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@
<th class="crm-contact-type"></th>
<th class="crm-contact-name">{ts}Name{/ts}</th>
<th class="crm-amount">{ts}Amount{/ts}</th>
<th class="crm-trxnID">{ts}Trxn ID{/ts}</th>
<th class="crm-trxnID">{ts}Trxn ID{/ts}</th>
<th class="crm-trxn_date">{ts}Transaction Date{/ts}</th>
<th class="crm-received">{ts}Received{/ts}</th>
<th class="crm-payment-method">{ts}Pay Method{/ts}</th>
<th class="crm-status">{ts}Status{/ts}</th>
<th class="crm-status">{ts}Status{/ts}</th>
<th class="crm-type">{ts}Type{/ts}</th>
<th class="crm-transaction-links"></th>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Financial/Page/AjaxTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function testGetFinancialTransactionsList() {
$json = CRM_Financial_Page_AJAX::getFinancialTransactionsList();
$json = str_replace(rtrim(CIVICRM_UF_BASEURL, '/'), 'http://FIX ME', $json);
$this->assertEquals($json, '{"sEcho": 1, "iTotalRecords": 1, "iTotalDisplayRecords": 1, "aaData": [ ["","<a href=\"/index.php?q=civicrm/profile/view&amp;reset=1&amp;gid=7&amp;id=3&amp;snippet=4\" class=\"crm-summary-link\"><div'
. ' class=\"icon crm-icon Individual-icon\"></div></a>","<a href=/index.php?q=civicrm/contact/view&amp;reset=1&amp;cid=3>Anderson, Anthony</a>","$ 100.00","12345","' . CRM_Utils_Date::customFormat(date('Ymd')) . ' 12:00 AM",'
. ' class=\"icon crm-icon Individual-icon\"></div></a>","<a href=/index.php?q=civicrm/contact/view&amp;reset=1&amp;cid=3>Anderson, Anthony</a>","$ 100.00","12345","' . CRM_Utils_Date::customFormat(date('Ymd')) . ' 12:00 AM","' . CRM_Utils_Date::customFormat(date('Ymd')) . ' 12:00 AM",'
. '"Credit Card","Completed","Donation","<span><a href=\"/index.php?q=civicrm/contact/view/contribution&amp;reset=1&amp;id=1&amp;cid=3&amp;action=view&amp;context=contribution&amp;'
. 'selectedChild=contribute\" class=\"action-item crm-hover-button\" title=\'View Contribution\' >View</a></span>"]] }');
}
Expand Down