dev/financial#57 Add order_reference field
authorAidan Saunders <aidan.saunders@squiffle.uk>
Wed, 9 Oct 2019 13:29:40 +0000 (14:29 +0100)
committerAidan Saunders <aidan.saunders@squiffle.uk>
Wed, 9 Oct 2019 13:29:40 +0000 (14:29 +0100)
CRM/Financial/DAO/FinancialTrxn.php
CRM/Upgrade/Incremental/php/FiveTwenty.php
xml/schema/Financial/FinancialTrxn.xml

index c740bff55fbf4ed12f72db083eefd0cd573d7c9d..837ddd678225b6adf4d81360748a3fe7453d6e42 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Financial/FinancialTrxn.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:ea6e4e27680634c1c2e4def15d91e02c)
+ * (GenCodeChecksum:30dff7f6f16ef7cd997187a202a59173)
  */
 
 /**
@@ -145,6 +145,13 @@ class CRM_Financial_DAO_FinancialTrxn extends CRM_Core_DAO {
    */
   public $pan_truncation;
 
+  /**
+   * Payment Processor external order reference
+   *
+   * @var string
+   */
+  public $order_reference;
+
   /**
    * Class constructor.
    */
@@ -460,6 +467,22 @@ class CRM_Financial_DAO_FinancialTrxn extends CRM_Core_DAO {
             'type' => 'Text',
           ],
         ],
+        'financial_trxn_order_reference' => [
+          'name' => 'order_reference',
+          'type' => CRM_Utils_Type::T_STRING,
+          'title' => ts('Order Reference'),
+          'description' => ts('Payment Processor external order reference'),
+          'maxlength' => 255,
+          'size' => 25,
+          'where' => 'civicrm_financial_trxn.order_reference',
+          'table_name' => 'civicrm_financial_trxn',
+          'entity' => 'FinancialTrxn',
+          'bao' => 'CRM_Financial_DAO_FinancialTrxn',
+          'localizable' => 0,
+          'html' => [
+            'type' => 'Text',
+          ],
+        ],
       ];
       CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
     }
index 94b9e029e7369f345654587b621aabed742548ff..9485ff8813f8a635c8be9e9cc10bb5f5da3bf6ee 100644 (file)
@@ -81,6 +81,8 @@ class CRM_Upgrade_Incremental_php_FiveTwenty extends CRM_Upgrade_Incremental_Bas
       'frontend_title', "varchar(255) DEFAULT NULL COMMENT 'Contribution Page Public title'", TRUE, '5.20.alpha1');
     $this->addTask('Add is_template field to civicrm_contribution', 'addColumn', 'civicrm_contribution', 'is_template',
       "tinyint(4) DEFAULT '0' COMMENT 'Shows this is a template for recurring contributions.'", FALSE, '5.20.alpha1');
+    $this->addTask('Add order_reference field to civicrm_financial_trxn', 'addColumn', 'civicrm_financial_trxn', 'order_reference',
+      "varchar(255) COMMENT 'Payment Processor external order reference'", FALSE, '5.20.alpha1');
     $this->addTask(ts('Upgrade DB to %1: SQL', [1 => $rev]), 'runSql', $rev);
   }
 
index 55290a872ed0679caa009df562695193126c03c5..f7f0bb05d7b963b62f658268c1964a05fb9c90f3 100644 (file)
     <comment>Last 4 digits of credit card</comment>
     <add>4.7</add>
   </field>
+  <field>
+    <name>order_reference</name>
+    <uniqueName>financial_trxn_order_reference</uniqueName>
+    <title>Order Reference</title>
+    <type>varchar</type>
+    <length>255</length>
+    <html>
+      <type>Text</type>
+      <size>25</size>
+    </html>
+    <comment>Payment Processor external order reference</comment>
+    <add>5.20</add>
+  </field>
 </table>