From a7a8f17d47e70381444d03d1c9eec8d06ccdaa22 Mon Sep 17 00:00:00 2001 From: "deb.monish" Date: Wed, 2 Aug 2017 19:41:03 +0530 Subject: [PATCH] add metadata to trxn_id --- CRM/Financial/DAO/FinancialTrxn.php | 7 +++++-- CRM/Financial/Form/PaymentEdit.php | 28 ++++++-------------------- xml/schema/Financial/FinancialTrxn.xml | 4 ++++ 3 files changed, 15 insertions(+), 24 deletions(-) diff --git a/CRM/Financial/DAO/FinancialTrxn.php b/CRM/Financial/DAO/FinancialTrxn.php index 7555097792..4aac190592 100644 --- a/CRM/Financial/DAO/FinancialTrxn.php +++ b/CRM/Financial/DAO/FinancialTrxn.php @@ -30,7 +30,7 @@ * * Generated from xml/schema/CRM/Financial/FinancialTrxn.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:d897b17ff4b5dee8e47c0c377658eddc) + * (GenCodeChecksum:21185c4929ef1a8d126c72733cc7ad1d) */ require_once 'CRM/Core/DAO.php'; require_once 'CRM/Utils/Type.php'; @@ -336,11 +336,14 @@ class CRM_Financial_DAO_FinancialTrxn extends CRM_Core_DAO { 'title' => ts('Transaction ID') , 'description' => 'Transaction id supplied by external processor. This may not be unique.', 'maxlength' => 255, - 'size' => CRM_Utils_Type::HUGE, + 'size' => 10, 'table_name' => 'civicrm_financial_trxn', 'entity' => 'FinancialTrxn', 'bao' => 'CRM_Financial_DAO_FinancialTrxn', 'localizable' => 0, + 'html' => array( + 'type' => 'Text', + ) , ) , 'trxn_result_code' => array( 'name' => 'trxn_result_code', diff --git a/CRM/Financial/Form/PaymentEdit.php b/CRM/Financial/Form/PaymentEdit.php index 524afb6cf3..650dc0bff3 100644 --- a/CRM/Financial/Form/PaymentEdit.php +++ b/CRM/Financial/Form/PaymentEdit.php @@ -86,7 +86,11 @@ class CRM_Financial_Form_PaymentEdit extends CRM_Core_Form { $this->assign('paymentFields', $paymentFields); foreach ($paymentFields as $name => $paymentField) { if (!empty($paymentField['add_field'])) { - $this->addField($name, $paymentField['attributes'], $paymentField['is_required']); + $attributes = array( + 'entity' => 'FinancialTrxn', + 'name' => $name, + ); + $this->addField($name, $attributes, $paymentField['is_required']); } else { $this->add($paymentField['htmlType'], @@ -173,43 +177,23 @@ class CRM_Financial_Form_PaymentEdit extends CRM_Core_Form { 'payment_instrument_id' => array( 'is_required' => TRUE, 'add_field' => TRUE, - 'attributes' => array( - 'entity' => 'FinancialTrxn', - 'name' => 'payment_instrument_id', - ), ), 'check_number' => array( 'is_required' => FALSE, 'add_field' => TRUE, - 'attributes' => array( - 'entity' => 'FinancialTrxn', - 'name' => 'check_number', - ), ), // @TODO we need to show card type icon in place of select field 'card_type_id' => array( 'is_required' => FALSE, 'add_field' => TRUE, - 'attributes' => array( - 'entity' => 'FinancialTrxn', - 'name' => 'card_type_id', - ), ), 'pan_truncation' => array( 'is_required' => FALSE, 'add_field' => TRUE, - 'attributes' => array( - 'entity' => 'FinancialTrxn', - 'name' => 'pan_truncation', - ), ), 'trxn_id' => array( - 'htmlType' => 'text', - 'title' => ts('Transaction ID'), + 'add_field' => TRUE, 'is_required' => FALSE, - 'attributes' => array( - 'size' => 6, - ), ), 'trxn_date' => array( 'htmlType' => 'datepicker', diff --git a/xml/schema/Financial/FinancialTrxn.xml b/xml/schema/Financial/FinancialTrxn.xml index d2b4b29c50..d0d9ce8572 100644 --- a/xml/schema/Financial/FinancialTrxn.xml +++ b/xml/schema/Financial/FinancialTrxn.xml @@ -175,6 +175,10 @@ varchar 255 Transaction id supplied by external processor. This may not be unique. + + Text + 10 + 1.3 -- 2.25.1