Merge pull request #15321 from yashodha/dev_1065
[civicrm-core.git] / CRM / Invoicing / Utils.php
index 05c2506bcec66416705cfc0265facb99080a3cfc..bad42ae8bce40f1ad78d2fa5846c5a656f056a68 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 5                                                  |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2018                                |
+ | Copyright CiviCRM LLC (c) 2004-2019                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -28,7 +28,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2018
+ * @copyright CiviCRM LLC (c) 2004-2019
  */
 class CRM_Invoicing_Utils {
 
@@ -94,4 +94,15 @@ class CRM_Invoicing_Utils {
     return CRM_Utils_Array::value('default_invoice_page', $invoiceSettings);
   }
 
+  /**
+   * Function to get the tax term.
+   *
+   * The value is nested in the contribution_invoice_settings setting - which
+   * is unsupported. Here we have a wrapper function to make later cleanup easier.
+   */
+  public static function getTaxTerm() {
+    $invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
+    return CRM_Utils_Array::value('tax_term', $invoiceSettings);
+  }
+
 }