add metadata to trxn_id
authordeb.monish <monish.deb@jmaconsulting.biz>
Wed, 2 Aug 2017 14:11:03 +0000 (19:41 +0530)
committerdeb.monish <monish.deb@jmaconsulting.biz>
Wed, 2 Aug 2017 14:11:03 +0000 (19:41 +0530)
CRM/Financial/DAO/FinancialTrxn.php
CRM/Financial/Form/PaymentEdit.php
xml/schema/Financial/FinancialTrxn.xml

index 7555097792cec79d94bf4ec95f4fd9c9f5a231a9..4aac190592b5e2210c35b02a27dc61dbc34dffeb 100644 (file)
@@ -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',
index 524afb6cf3d07247552ff91a5f15c68deb732634..650dc0bff3363b575897dcd886d4529db9c5b875 100644 (file)
@@ -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',
index d2b4b29c50ac9d03c032b0bc9878842c217808b8..d0d9ce8572b53a672bf19604af1a2d9535233b32 100644 (file)
     <type>varchar</type>
     <length>255</length>
     <comment>Transaction id supplied by external processor. This may not be unique.</comment>
+    <html>
+      <type>Text</type>
+      <size>10</size>
+    </html>
     <add>1.3</add>
   </field>
   <index>