Skip to content

Commit

Permalink
Merge pull request #13918 from seamuslee001/trxn_date_conversion
Browse files Browse the repository at this point in the history
Convert trxn_date field in the Update Pending Status task option from…
  • Loading branch information
eileenmcnaughton authored Apr 1, 2019
2 parents ed53f55 + 73409b5 commit cb7f35b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions CRM/Contribute/Form/Task/Status.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public function buildQuickForm() {
$this->_rows = array();
$attributes = CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Contribution');
$defaults = array();
$now = date("m/d/Y");
$now = date("Y-m-d");
$paidByOptions = array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::paymentInstrument();

while ($dao->fetch()) {
Expand All @@ -140,9 +140,7 @@ public function buildQuickForm() {
$this->addRule("fee_amount_{$row['contribution_id']}", ts('Please enter a valid amount.'), 'money');
$defaults["fee_amount_{$row['contribution_id']}"] = 0.0;

$row['trxn_date'] = $this->addDate("trxn_date_{$row['contribution_id']}", FALSE,
ts('Receipt Date'), array('formatType' => 'activityDate')
);
$row['trxn_date'] = $this->add('datepicker', "trxn_date_{$row['contribution_id']}", ts('Transaction Date'), [], FALSE, ['time' => FALSE]);
$defaults["trxn_date_{$row['contribution_id']}"] = $now;

$this->add("text", "check_number_{$row['contribution_id']}", ts('Check Number'));
Expand Down Expand Up @@ -294,7 +292,7 @@ public static function processForm($form, $params) {
else {
$input['trxn_id'] = $contribution->invoice_id;
}
$input['trxn_date'] = CRM_Utils_Date::processDate($params["trxn_date_{$row['contribution_id']}"], date('H:i:s'));
$input['trxn_date'] = $params["trxn_date_{$row['contribution_id']}"] . ' ' . date('H:i:s');

// @todo calling baseIPN like this is a pattern in it's last gasps. Call contribute.completetransaction api.
$baseIPN->completeTransaction($input, $ids, $objects, $transaction, FALSE);
Expand Down
2 changes: 1 addition & 1 deletion templates/CRM/Contribute/Form/Task/Status.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
{assign var="element_name" value="trxn_id_"|cat:$row.contribution_id}
<td>{$form.$element_name.html|crmAddClass:eight}</td>
{assign var="element_name" value="trxn_date_"|cat:$row.contribution_id}
<td>{include file="CRM/common/jcalendar.tpl" elementName=$element_name}</td>
<td>{$form.$element_name.html}</td>
</tr>
{/foreach}
</table>
Expand Down

0 comments on commit cb7f35b

Please sign in to comment.