{* placeholder file for upgrade*}
+
+-- CRM-12470
+UPDATE civicrm_financial_account
+SET is_default = 1
+WHERE name IN ('{ts escape="sql"}Premiums{/ts}', '{ts escape="sql"}Banking Fees{/ts}', '{ts escape="sql"}Accounts Payable{/ts}', '{ts escape="sql"}Donation{/ts}');
$params = array(
'qfkey' => '9a3ef3c08879ad4c8c109b21c583400e',
'title' => 'Test Contribution Page',
- 'financial_type_id' => $this->_contributionTypeID,
+ 'financial_type_id' => $this->_contributionTypeID,
'intro_text' => '',
'footer_text' => 'Thanks',
'is_for_organization' => 0,
$params = array(
'title' => 'Test Contribution Page',
- 'financial_type_id' => $this->_contributionTypeID,
+ 'financial_type_id' => $this->_contributionTypeID,
'is_active' => 1,
);
$id = $contributionpage->id;
$is_active = 1;
$pageActive = CRM_Contribute_BAO_ContributionPage::setIsActive($id, $is_active);
- $this->assertEquals( $pageActive, true, 'Verify financial types record deletion.');
+ $this->assertEquals($pageActive, true, 'Verify financial types record deletion.');
ContributionPage::delete($contributionpage->id);
}
$params = array(
'title' => 'Test Contribution Page',
- 'financial_type_id' => $this->_contributionTypeID,
+ 'financial_type_id' => $this->_contributionTypeID,
'is_active' => 1,
);
$setValues = CRM_Contribute_BAO_ContributionPage::setValues($id, $values);
$this->assertEquals($params['title'], $values['title'], 'Verify contribution title.');
- $this->assertEquals( $this->_contributionTypeID, $values['financial_type_id'], 'Verify financial types id.');
+ $this->assertEquals($this->_contributionTypeID, $values['financial_type_id'], 'Verify financial types id.');
$this->assertEquals(1, $values['is_active'], 'Verify contribution is_active value.');
ContributionPage::delete($contributionpage->id);
}
$params = array(
'qfkey' => '9a3ef3c08879ad4c8c109b21c583400e',
'title' => 'Test Contribution Page',
- 'financial_type_id' => $this->_contributionTypeID,
+ 'financial_type_id' => $this->_contributionTypeID,
'intro_text' => '',
'footer_text' => 'Thanks',
'is_for_organization' => 0,
$contributionpage = CRM_Contribute_BAO_ContributionPage::create($params);
$copycontributionpage = CRM_Contribute_BAO_ContributionPage::copy($contributionpage->id);
- $this->assertEquals( $copycontributionpage->financial_type_id, $this->_contributionTypeID, 'Check for Financial type id.' );
+ $this->assertEquals($copycontributionpage->financial_type_id, $this->_contributionTypeID, 'Check for Financial type id.');
$this->assertEquals($copycontributionpage->goal_amount, 400, 'Check for goal amount.');
ContributionPage::delete($contributionpage->id);
ContributionPage::delete($copycontributionpage->id);
class CRM_Contribute_BAO_ContributionTypeTest extends CiviUnitTestCase {
function get_info() {
return array(
- 'name' => 'FinancialAccount BAOs',
+ 'name' => 'FinancialAccount BAOs',
'description' => 'Test all Contribute_BAO_Contribution methods.',
'group' => 'CiviCRM BAO Tests',
);
function setUp() {
parent::setUp();
+ $this->organizationCreate();
+ }
+
+ function teardown() {
+ $this->financialAccountDelete('Donations');
}
/**
*/
function testSetIsActive() {
$params = array(
- 'name' => 'testDonations',
+ 'name' => 'Donations',
'is_deductible' => 0,
'is_active' => 1,
);
*/
function testdel() {
$params = array(
- 'name' => 'checkDonations',
+ 'name' => 'Donations',
'is_deductible' => 0,
'is_active' => 1,
);
+--------------------------------------------------------------------+
*/
require_once 'CiviTest/CiviUnitTestCase.php';
-require_once 'CRM/Financial/DAO/FinancialAccount.php';
-require_once 'CRM/Financial/BAO/FinancialAccount.php';
class CRM_Financial_BAO_FinancialAccountTest extends CiviUnitTestCase {
function setUp() {
parent::setUp();
+ $this->organizationCreate();
+ }
+
+ function teardown() {
+ $this->financialAccountDelete('Donations');
}
/**
*/
function testRetrieve() {
$params = array(
- 'name' => 'Donations_1',
+ 'name' => 'Donations',
'is_deductible' => 0,
'is_active' => 1,
);
$result = CRM_Financial_BAO_FinancialAccount::retrieve($params, $defaults);
- $this->assertEquals($result->name, 'Donations_1', 'Verify financial type name.');
+ $this->assertEquals($result->name, 'Donations', 'Verify financial type name.');
}
/**
*/
function testSetIsActive() {
$params = array(
- 'name' => 'testDonations',
+ 'name' => 'Donations',
'is_deductible' => 0,
'is_active' => 1,
);
*/
function testdel() {
$params = array(
- 'name' => 'checkDonations',
+ 'name' => 'Donations',
'is_deductible' => 0,
'is_active' => 1,
);
*/
function testGetAccountingCode() {
$params = array(
- 'name' => 'TestFinancialAccount',
- 'accounting_code' => 4800,
- 'is_deductible' => 0,
+ 'name' => 'Donations',
'is_active' => 1,
'is_reserved' => 0,
);
$ids = array();
- $financialAccount = CRM_Financial_BAO_FinancialAccount::add($params, $ids);
$financialType = CRM_Financial_BAO_FinancialType::add($params, $ids);
- $relationTypeId = key(CRM_Core_PseudoConstant::accountOptionValues('account_relationship', NULL, " AND v.name LIKE 'Income Account is' "));
- $financialParams = array(
- 'entity_table' => 'civicrm_financial_type',
- 'entity_id' => $financialType->id,
- 'account_relationship' => $relationTypeId,
- 'financial_account_id' => $financialAccount->id,
- );
-
- CRM_Financial_BAO_FinancialTypeAccount::add($financialParams, $ids);
+ $financialAccountid = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialAccount', 'Donations', 'id', 'name');
+ CRM_Core_DAO::setFieldValue('CRM_Financial_DAO_FinancialAccount', $financialAccountid, 'accounting_code', '4800');
$accountingCode = CRM_Financial_BAO_FinancialAccount::getAccountingCode($financialType->id);
$this->assertEquals( $accountingCode, 4800, 'Verify accounting code.');
}
+--------------------------------------------------------------------+
*/
require_once 'CiviTest/CiviUnitTestCase.php';
-require_once 'CRM/Financial/DAO/FinancialAccount.php';
-require_once 'CRM/Financial/BAO/FinancialAccount.php';
-require_once 'CRM/Financial/BAO/FinancialTypeAccount.php';
class CRM_Financial_BAO_FinancialTypeAccountTest extends CiviUnitTestCase {
function get_info() {
return array(
- 'name' => 'FinancialTypeAccount BAOs',
+ 'name' => 'FinancialTypeAccount BAOs',
'description' => 'Test all Contribute_BAO_Contribution methods.',
- 'group' => 'CiviCRM BAO Tests',
+ 'group' => 'CiviCRM BAO Tests',
);
}
function setUp() {
parent::setUp();
+ $this->organizationCreate();
}
/**
$ids = array();
$financialAccount = CRM_Financial_BAO_FinancialAccount::add($params, $ids);
+ $params['name'] = 'test_financialType1';
$financialType = CRM_Financial_BAO_FinancialType::add($params, $ids);
$relationTypeId = key(CRM_Core_PseudoConstant::accountOptionValues('account_relationship', NULL, " AND v.name LIKE 'Income Account is' "));
$financialParams = array(
$ids = array();
$defaults = array();
$financialAccount = CRM_Financial_BAO_FinancialAccount::add($params, $ids);
+ $params['name'] = 'test_financialType2';
$financialType = CRM_Financial_BAO_FinancialType::add($params, $ids);
$relationTypeId = key(CRM_Core_PseudoConstant::accountOptionValues('account_relationship', NULL, " AND v.name LIKE 'Expense Account is' "));
$financialParams = array(
);
$ids = array();
$financialAccount = CRM_Financial_BAO_FinancialAccount::add($params, $ids);
+ $params['name'] = 'test_financialType3';
$financialType = CRM_Financial_BAO_FinancialType::add($params, $ids);
$relationTypeId = key(CRM_Core_PseudoConstant::accountOptionValues('account_relationship', NULL, " AND v.name LIKE 'Asset Account is' "));
$financialParams = array(
);
$ids = array();
$financialAccount = CRM_Financial_BAO_FinancialAccount::add($params, $ids);
- $financialType = CRM_Financial_BAO_FinancialType::add($params, $ids);
- $relationTypeId = key(CRM_Core_PseudoConstant::accountOptionValues('account_relationship', NULL, " AND v.name LIKE 'Income Account is' "));
- $financialParams = array(
- 'entity_table' => 'civicrm_financial_type',
- 'entity_id' => $financialType->id,
- 'account_relationship' => $relationTypeId,
+ $params = array(
'financial_account_id' => $financialAccount->id,
+ 'payment_processor_type_id' => 1,
+ 'domain_id' => 1,
+ 'billing_mode' => 1,
+ 'name' => 'paymentProcessor',
);
- $financialAccountType = CRM_Financial_BAO_FinancialTypeAccount::add($financialParams, $ids);
+ $processor = CRM_Financial_BAO_PaymentProcessor::create($params);
+
$account = CRM_Financial_BAO_FinancialTypeAccount::getFinancialAccount(
- $financialAccountType->entity_id,
- $financialAccountType->entity_table
+ $processor->id,
+ 'civicrm_payment_processor'
);
- $this->assertEquals( $account, 'TestFinancialAccount', 'Verify Financial Account Name');
+ $this->assertEquals($account, 'TestFinancialAccount', 'Verify Financial Account Name');
}
/**
+--------------------------------------------------------------------+
*/
require_once 'CiviTest/CiviUnitTestCase.php';
-require_once 'CRM/Financial/DAO/FinancialAccount.php';
-require_once 'CRM/Financial/BAO/FinancialAccount.php';
class CRM_Financial_BAO_FinancialTypeTest extends CiviUnitTestCase {
function get_info() {
return array(
- 'name' => 'FinancialType BAOs',
+ 'name' => 'FinancialType BAOs',
'description' => 'Test all Contribute_BAO_Contribution methods.',
- 'group' => 'CiviCRM BAO Tests',
+ 'group' => 'CiviCRM BAO Tests',
);
}
parent::setUp();
}
+ function teardown() {
+ $this->financialAccountDelete('Donations');
+ }
+
/**
* check method add()
*/
$defaults = array();
$result = CRM_Financial_BAO_FinancialType::retrieve($params, $defaults);
- $this->assertEquals( $result->name, 'Donations', 'Verify Name for Financial Type');
+ $this->assertEquals($result->name, 'Donations', 'Verify Name for Financial Type');
}
/**
*/
function testSetIsActive() {
$params = array(
- 'name' => 'testDonations',
+ 'name' => 'Donations',
'is_deductible' => 0,
'is_active' => 1,
);
$ids = array();
$financialType = CRM_Financial_BAO_FinancialType::add($params, $ids);
$result = CRM_Financial_BAO_FinancialType::setIsActive($financialType->id, 0);
- $this->assertEquals( $result, true , 'Verify financial type record updation for is_active.');
+ $this->assertEquals($result, true , 'Verify financial type record updation for is_active.');
$isActive = $this->assertDBNotNull(
'CRM_Financial_DAO_FinancialType',
$financialType->id ,
'id',
'Database check on updated for financial type is_active.'
);
- $this->assertEquals( $isActive, 0, 'Verify financial types is_active.');
+ $this->assertEquals($isActive, 0, 'Verify financial types is_active.');
}
/**
*/
function testDel() {
$params = array(
- 'name' => 'checkDonations',
+ 'name' => 'Donations',
'is_deductible' => 0,
'is_active' => 1,
);
$financialType = CRM_Financial_BAO_FinancialType::add($params, $ids);
CRM_Financial_BAO_FinancialType::del($financialType->id);
- $params = array('id' => $financialType->id );
+ $params = array('id' => $financialType->id);
$result = CRM_Financial_BAO_FinancialType::retrieve($params, $defaults);
- $this->assertEquals( empty($result), true, 'Verify financial types record deletion.');
+ $this->assertEquals(empty($result), true, 'Verify financial types record deletion.');
}
}
\ No newline at end of file
$this->click('_qf_FinancialType_next');
$this->waitForPageToLoad($this->getTimeoutMsec());
if ($option == 'new') {
- $text = "The financial type '{$financialType['name']}' has been added. You can add Financial Accounts to this Financial Type now.";
+ $text = "Your Financial '{$financialType['name']}' Type has been created, along with a corresponding income account '{$financialType['name']}'. That income account, along with standard financial accounts 'Accounts Receivable', 'Banking Fees' and 'Premiums' have been linked to the financial type. You may edit or replace those relationships here.";
}
else {
$text = "The financial type '{$financialType['name']}' has been saved.";
}
}
- function _testAddFinancialType() {
- // Add new Financial Account
- $orgName = 'Alberta ' . substr(sha1(rand()), 0, 7);
- $financialAccountTitle = 'Financial Account ' . substr(sha1(rand()), 0, 4);
- $financialAccountDescription = "{$financialAccountTitle} Description";
- $accountingCode = 1033;
- $financialAccountType = 'Revenue'; //Asset Revenue
- $taxDeductible = FALSE;
- $isActive = FALSE;
- $isTax = TRUE;
- $taxRate = 9.99999999;
- $isDefault = FALSE;
-
- //Add new organisation
- if ($orgName) {
- $this->webtestAddOrganization($orgName);
- }
-
- $this->_testAddFinancialAccount(
- $financialAccountTitle,
- $financialAccountDescription,
- $accountingCode,
- $orgName,
- $financialAccountType,
- $taxDeductible,
- $isActive,
- $isTax,
- $taxRate,
- $isDefault
- );
- $this->waitForElementPresent("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[8]/span/a[text()='Edit']");
-
- //Add new Financial Type
- $financialType['name'] = 'FinancialType ' . substr(sha1(rand()), 0, 4);
- $financialType['is_deductible'] = TRUE;
- $financialType['is_reserved'] = FALSE;
- $this->addeditFinancialType($financialType);
-
- $accountRelationship = "Income Account is"; //Asset Account - of Income Account is
- $expected[] = array(
- 'financial_account' => $financialAccountTitle,
- 'account_relationship' => $accountRelationship
- );
-
- $this->select('account_relationship', "label={$accountRelationship}");
- // Because it tends to cause problems, all uses of sleep() must be justified in comments
- // Sleep should never be used for wait for anything to load from the server
- // Justification for this instance: FIXME
- sleep(2);
- $this->select('financial_account_id', "label={$financialAccountTitle}");
- $this->click('_qf_FinancialTypeAccount_next');
- $this->waitForPageToLoad($this->getTimeoutMsec());
- $text = 'The financial type Account has been saved.';
- $this->assertTrue($this->isTextPresent($text), 'Missing text: ' . $text);
- return $financialType['name'];
- }
-
function addPremium($name, $sku, $amount, $price, $cost, $financialType) {
$this->waitForElementPresent("_qf_ManagePremiums_upload-bottom");
$this->type("name", $name);
$this->origExtensionSystem = NULL;
}
}
+
+ function financialAccountDelete($name) {
+ $financialAccount = new CRM_Financial_DAO_FinancialAccount();
+ $financialAccount->name = $name;
+ if($financialAccount->find(TRUE)) {
+ $entityFinancialType = new CRM_Financial_DAO_EntityFinancialAccount();
+ $entityFinancialType->financial_account_id = $financialAccount->id;
+ $entityFinancialType->delete();
+ $financialAccount->delete();
+ }
+ }
}
function CiviUnitTestCase_fatalErrorHandler($message) {
'is_deductible' => FALSE,
);
$this->addeditFinancialType($financialType);
- $this->select('account_relationship', 'label=Income Account is');
- $this->select('financial_account_id', 'label=Discounts');
- $this->click('_qf_FinancialTypeAccount_next-botttom');
- $this->waitForPageToLoad($this->getTimeoutMsec());
$financialType['name'] = $financialTypeName2;
$this->addeditFinancialType($financialType);
- $this->select('account_relationship', 'label=Income Account is');
- $this->select('financial_account_id', 'label=Discounts');
- $this->click('_qf_FinancialTypeAccount_next-botttom');
- $this->waitForPageToLoad($this->getTimeoutMsec());
//create 6 contribution
$this->openCiviPage("contribute/add", "reset=1&action=add&context=standalone", "_qf_Contribution_upload");
for ($i = 1; $i <= 6; $i++) {
}
function _testAddFinancialType() {
- // Add new Financial Account
- $orgName = 'Alberta '.substr(sha1(rand()), 0, 7);
- $financialAccountTitle = 'Financial Account '.substr(sha1(rand()), 0, 4);
- $financialAccountDescription = "{$financialAccountTitle} Description";
- $accountingCode = 1033;
- $financialAccountType = 'Revenue';
- $taxDeductible = FALSE;
- $isActive = FALSE;
- $isTax = TRUE;
- $taxRate = 9;
- $isDefault = FALSE;
-
- //Add new organisation
- if($orgName) {
- $this->webtestAddOrganization($orgName);
- }
-
- $this->_testAddFinancialAccount($financialAccountTitle,
- $financialAccountDescription,
- $accountingCode,
- $orgName,
- $financialAccountType,
- $taxDeductible,
- $isActive,
- $isTax,
- $taxRate,
- $isDefault
- );
- $this->waitForElementPresent("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Edit']");
-
//Add new Financial Type
$financialType['name'] = 'FinancialType '.substr(sha1(rand()), 0, 4);
$financialType['is_deductible'] = TRUE;
$financialType['is_reserved'] = FALSE;
$this->addeditFinancialType($financialType);
-
- $accountRelationship = "Income Account is";
- $expected[] = array('financial_account' => $financialAccountTitle,
-
- 'account_relationship' => $accountRelationship
- );
-
- $this->select('account_relationship', "label={$accountRelationship}");
- // Because it tends to cause problems, all uses of sleep() must be justified in comments
- // Sleep should never be used for wait for anything to load from the server
- // Justification for this instance: FIXME
- sleep(2);
- $this->select('financial_account_id', "label={$financialAccountTitle}");
- $this->click('_qf_FinancialTypeAccount_next');
- $this->waitForPageToLoad($this->getTimeoutMsec());
- $text = 'The financial type Account has been saved.';
- $this->assertTrue($this->isTextPresent($text), 'Missing text: ' . $text);
return $financialType['name'];
}
'is_deductible' => 1,
);
$this->addeditFinancialType($financialType);
- $this->select("account_relationship", "label=Cost of Sales Account is");
- $this->select("financial_account_id", "label=$from");
- $this->clickLink("_qf_FinancialTypeAccount_next_new-botttom");
+ $this->clickLink("xpath=//a[@id='newfinancialTypeAccount']");
$this->select("account_relationship", "label=Premiums Inventory Account is");
$this->select("financial_account_id", "label=$to");
$this->clickLink("_qf_FinancialTypeAccount_next-botttom");
+
$premiumName = 'Premium'.substr(sha1(rand()), 0, 7);
$amount = 500;
$sku = 'SKU';
$from = 'Premiums';
$to = 'Premiums inventory';
$financialType = array(
- 'name' => 'Test Financial'.substr(sha1(rand()), 0, 7),
+ 'name' => 'Test Financial' . substr(sha1(rand()), 0, 7),
'is_reserved' => 1,
'is_deductible' => 1,
);
$this->addeditFinancialType($financialType);
- $this->select("account_relationship", "label=Cost of Sales Account is");
- $this->select("financial_account_id", "label=$from");
- $this->clickLink("_qf_FinancialTypeAccount_next_new-botttom");
+ $this->clickLink("xpath=//a[@id='newfinancialTypeAccount']");
+
$this->select("account_relationship", "label=Premiums Inventory Account is");
$this->select("financial_account_id", "label=$to");
$this->clickLink("_qf_FinancialTypeAccount_next-botttom");
- $premiumName = 'Premium'.substr(sha1(rand()), 0, 7);
+ $premiumName = 'Premium' . substr(sha1(rand()), 0, 7);
$amount = 500;
$sku = 'SKU';
$price = 300;
// Log in using webtestLogin() method
$this->webtestLogin();
- // Add new Financial Account
- $orgName = 'Alberta '.substr(sha1(rand()), 0, 7);
- $financialAccountTitle = 'Financial Account '.substr(sha1(rand()), 0, 4);
- $financialAccountDescription = "{$financialAccountTitle} Description";
- $accountingCode = 1033;
- $financialAccountType = 'Revenue';
- $taxDeductible = FALSE;
- $isActive = FALSE;
- $isTax = TRUE;
- $taxRate = 5.20;
- $isDefault = FALSE;
-
- //Add new organisation
- if ($orgName) {
- $this->webtestAddOrganization($orgName);
- }
-
- $this->_testAddFinancialAccount(
-
- $financialAccountTitle,
- $financialAccountDescription,
- $accountingCode,
- $orgName,
- $financialAccountType,
- $taxDeductible,
- $isActive,
- $isTax,
- $taxRate,
- $isDefault
- );
-
- $this->waitForElementPresent("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Edit']");
-
- $this->clickLink("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Edit']", '_qf_FinancialAccount_cancel-botttom');
-
- //Varify Data after Adding new Financial Account
- $verifyData = array(
-
- 'name' => $financialAccountTitle,
- 'description' => $financialAccountDescription,
- 'accounting_code' => $accountingCode,
- 'contact_name' => $orgName,
- 'tax_rate' => $taxRate,
- 'is_tax' => 'on',
- 'is_deductible' => 'off',
- 'is_default' => 'off',
- );
-
- $this->_assertFinancialAccount($verifyData);
- $verifySelectFieldData = array(
- 'financial_account_type_id' => $financialAccountType,
- );
- $this->_assertSelectVerify($verifySelectFieldData);
- $this->click('_qf_FinancialAccount_cancel-botttom');
- $this->waitForPageToLoad($this->getTimeoutMsec());
-
//Add new Financial Type
$financialType['name'] = 'FinancialType '.substr(sha1(rand()), 0, 4);
$financialType['is_deductible'] = true;
$financialType['is_reserved'] = false;
$this->addeditFinancialType($financialType);
- $accountRelationship = "Income Account is";
- $expected[] = array(
-
- 'financial_account' => $financialAccountTitle,
-
- 'account_relationship' => $accountRelationship
-
- );
-
- $this->select('account_relationship', "label={$accountRelationship}");
- $this->select('financial_account_id', "label={$financialAccountTitle}");
- $this->click('_qf_FinancialTypeAccount_next_new');
- $this->waitForPageToLoad($this->getTimeoutMsec());
- $text = 'The financial type Account has been saved.';
- $this->waitForText('crm-notification-container', $text);
- $text = 'You can add another Financial Account Type.';
- $this->waitForText('crm-notification-container', $text);
- $accountRelationship = 'Expense Account is';
- $expected[] = array(
- 'financial_account' => 'Banking Fees',
- 'account_relationship' => $accountRelationship
+ $expected = array(
+ array(
+ 'financial_account' => $financialType['name'],
+ 'account_relationship' => "Income Account is",
+ ),
+ array(
+ 'financial_account' => 'Banking Fees',
+ 'account_relationship' => 'Expense Account is',
+ ),
+ array(
+ 'financial_account' => 'Accounts Receivable',
+ 'account_relationship' => 'Accounts Receivable Account is',
+ ),
+ array(
+ 'financial_account' => 'Premiums',
+ 'account_relationship' => 'Cost of Sales Account is',
+ ),
);
-
- $this->select('account_relationship', "label={$accountRelationship}");
- $this->select('financial_account_id', "label=Banking Fees");
- $this->click('_qf_FinancialTypeAccount_next');
- $this->waitForElementPresent('newfinancialTypeAccount');
- $text = 'The financial type Account has been saved.';
- $this->waitForText('crm-notification-container', $text);
-
+
foreach ($expected as $value => $label) {
$this->verifyText("xpath=id('ltype')/div/table/tbody/tr/td[2][text()='$label[financial_account]']/../td[1]", preg_quote($label['account_relationship']));
}
$this->openCiviPage('admin/financial/financialType', 'reset=1', 'newFinancialType');
- $this->verifyText("xpath=id('ltype')/div/table/tbody/tr/td[1][text()='$financialType[name]']/../td[3]", $financialAccountTitle. ',Banking Fees');
+ $this->verifyText("xpath=id('ltype')/div/table/tbody/tr/td[1][text()='$financialType[name]']/../td[3]", 'Accounts Receivable,Banking Fees,Premiums,' . $financialType['name']);
$this->click("xpath=id('ltype')/div/table/tbody/tr/td[1][text()='$financialType[name]']/../td[7]/span/a[text()='Accounts']");
$this->waitForElementPresent('newfinancialTypeAccount');
$this->click("xpath=id('ltype')/div/table/tbody/tr/td[2][text()='Banking Fees']/../td[7]/span/a[text()='Edit']");
// Sleep should never be used for wait for anything to load from the server
// Justification for this instance: FIXME
sleep(1);
- $this->select('account_relationship', "label=Accounts Receivable Account is");
- $this->select('financial_account_id', "label=Accounts Receivable");
+ $this->select('account_relationship', "label=Premiums Inventory Account is");
+ $this->select('financial_account_id', "label=Premiums inventory");
$this->click('_qf_FinancialTypeAccount_next');
- $this->waitForElementPresent("xpath=id('ltype')/div/table/tbody/tr/td[2][text()='Accounts Receivable']/../td[7]/span/a[text()='Edit']");
- $this->verifyText("xpath=id('ltype')/div/table/tbody/tr/td[2][text()='Accounts Receivable']/../td[1]", preg_quote('Accounts Receivable Account is'));
- $this->clickLink("xpath=id('ltype')/div/table/tbody/tr/td[2][text()='Accounts Receivable']/../td[7]/span/a[text()='Delete']", '_qf_FinancialTypeAccount_next-botttom');
+ $this->waitForElementPresent("xpath=id('ltype')/div/table/tbody/tr/td[2][text()='Premiums inventory']/../td[7]/span/a[text()='Edit']");
+ $this->verifyText("xpath=id('ltype')/div/table/tbody/tr/td[2][text()='Premiums inventory']/../td[1]", preg_quote('Premiums Inventory Account is'));
+ $this->clickLink("xpath=id('ltype')/div/table/tbody/tr/td[2][text()='Premiums inventory']/../td[7]/span/a[text()='Delete']", '_qf_FinancialTypeAccount_next-botttom');
$this->click('_qf_FinancialTypeAccount_next-botttom');
$this->waitForPageToLoad($this->getTimeoutMsec());
$this->waitForText('crm-notification-container', 'Selected financial type account has been deleted.');