当前位置: 首页>>代码示例>>PHP>>正文


PHP CRM_Financial_BAO_FinancialAccount::getFinancialAccountForFinancialTypeByRelationship方法代码示例

本文整理汇总了PHP中CRM_Financial_BAO_FinancialAccount::getFinancialAccountForFinancialTypeByRelationship方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Financial_BAO_FinancialAccount::getFinancialAccountForFinancialTypeByRelationship方法的具体用法?PHP CRM_Financial_BAO_FinancialAccount::getFinancialAccountForFinancialTypeByRelationship怎么用?PHP CRM_Financial_BAO_FinancialAccount::getFinancialAccountForFinancialTypeByRelationship使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CRM_Financial_BAO_FinancialAccount的用法示例。


在下文中一共展示了CRM_Financial_BAO_FinancialAccount::getFinancialAccountForFinancialTypeByRelationship方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getFinancialAccountForStatusChangeTrxn

 /**
  * Get the financial account for the item associated with the new transaction.
  *
  * @param array $params
  * @param CRM_Financial_BAO_FinancialItem $prevFinancialItem
  *
  * @return int
  */
 public static function getFinancialAccountForStatusChangeTrxn($params, $prevFinancialItem)
 {
     if (!empty($params['financial_account_id'])) {
         return $params['financial_account_id'];
     }
     $contributionStatus = CRM_Contribute_PseudoConstant::contributionStatus($params['contribution_status_id'], 'name');
     $preferredAccountsRelationships = array('Refunded' => 'Credit/Contra Revenue Account is', 'Chargeback' => 'Chargeback Account is');
     if (in_array($contributionStatus, array_keys($preferredAccountsRelationships))) {
         $financialTypeID = !empty($params['financial_type_id']) ? $params['financial_type_id'] : $params['prevContribution']->financial_type_id;
         return CRM_Financial_BAO_FinancialAccount::getFinancialAccountForFinancialTypeByRelationship($financialTypeID, $preferredAccountsRelationships[$contributionStatus]);
     }
     return $prevFinancialItem->financial_account_id;
 }
开发者ID:scardinius,项目名称:civicrm-core,代码行数:21,代码来源:Contribution.php

示例2: testGetFinancialAccountByFinancialTypeAndRelationshipCustomAddedRefunded

 /**
  * Test getting financial account for a given financial Type with a particular relationship.
  */
 public function testGetFinancialAccountByFinancialTypeAndRelationshipCustomAddedRefunded()
 {
     $financialAccount = $this->callAPISuccess('FinancialAccount', 'create', array('name' => 'Refund Account', 'is_active' => TRUE));
     $this->callAPISuccess('EntityFinancialAccount', 'create', array('entity_id' => 2, 'entity_table' => 'civicrm_financial_type', 'account_relationship' => 'Credit/Contra Revenue Account is', 'financial_account_id' => 'Refund Account'));
     $this->assertEquals($financialAccount['id'], CRM_Financial_BAO_FinancialAccount::getFinancialAccountForFinancialTypeByRelationship(2, 'Credit/Contra Revenue Account is'));
 }
开发者ID:sdekok,项目名称:civicrm-core,代码行数:9,代码来源:FinancialAccountTest.php


注:本文中的CRM_Financial_BAO_FinancialAccount::getFinancialAccountForFinancialTypeByRelationship方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。