// assign values to the template
$this->assign($values);
- $invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
$invoicing = CRM_Invoicing_Utils::isInvoicingEnabled();
$this->assign('invoicing', $invoicing);
- $this->assign('isDeferred', CRM_Utils_Array::value('deferred_revenue_enabled', $invoiceSettings));
+ $this->assign('isDeferred', Civi::settings()->get('deferred_revenue_enabled'));
if ($invoicing && isset($values['tax_amount'])) {
$this->assign('totalTaxAmount', $values['tax_amount']);
}
* @throws \CRM_Core_Exception
*/
public function testCreateDeferredTrxn() {
- Civi::settings()->set('contribution_invoice_settings', ['deferred_revenue_enabled' => '1']);
+ Civi::settings()->set('deferred_revenue_enabled', TRUE);
$cid = $this->individualCreate();
$params = [
'contact_id' => $cid,
/**
* Test for validating financial type has deferred revenue account relationship.
+ *
+ * @throws \CRM_Core_Exception
*/
public function testcheckFinancialTypeHasDeferred() {
- Civi::settings()->set('deferred_revenue_enabled', 1);
+ Civi::settings()->set('deferred_revenue_enabled', TRUE);
$params = [];
$valid = CRM_Financial_BAO_FinancialAccount::checkFinancialTypeHasDeferred($params);
$this->assertFalse($valid, "This should have been false");
* CRM-20037: Test balance due amount, if contribution is done using deferred Financial Type
*/
public function testBalanceDueIfDeferredRevenueEnabled() {
- Civi::settings()->set('contribution_invoice_settings', ['deferred_revenue_enabled' => '1']);
+ Civi::settings()->set('deferred_revenue_enabled', TRUE);
$deferredFinancialTypeID = $this->_createDeferredFinancialAccount();
$totalAmount = 100.00;
/**
* Test Deferred Revenue Report.
+ *
+ * @throws \CRM_Core_Exception
*/
public function testDeferredRevenueReport() {
$indv1 = $this->individualCreate();
$indv2 = $this->individualCreate();
- $params = [
- 'contribution_invoice_settings' => [
- 'deferred_revenue_enabled' => '1',
- ],
- ];
- $this->callAPISuccess('Setting', 'create', $params);
+ Civi::settings()->set('deferred_revenue_enabled', TRUE);
$this->contributionCreate(
[
'contact_id' => $indv1,