$this->type("sort_name", "$lastName, $firstName");
$this->click("_qf_Search_refresh");
- $this->waitForElementPresent("xpath=//div[@class='crm-content-block']//div[@id='contributionSearch']");
+ $this->waitForElementPresent("xpath=//*[@id='Search']//div[@id='contributionSearch']");
$contriIDOff = explode('&', $this->getAttribute("xpath=//div[@id='contributionSearch']//table[@class='selector row-highlight']/tbody/tr[1]/td[11]/span/a[1]@href"));
if (!empty($contriIDOff)) {
$contriIDOff = substr($contriIDOff[1], (strrpos($contriIDOff[1], '=') + 1));
$this->clickLink("xpath=//tr[@id='rowid{$contriIDOff}']/td[11]/span/a[2]", "total_amount", FALSE);
$this->type("total_amount", "90");
- $this->clickLink('_qf_Contribution_upload');
+ $this->clickLink('_qf_Contribution_upload','',FALSE);
// Is status message correct?
$this->waitForText('crm-notification-container', "The contribution record has been saved.");
$this->select("account_relationship", "label=Premiums Inventory Account is");
$this->select("financial_account_id", "label=$to");
$this->clickLink("_qf_FinancialTypeAccount_next-botttom", "xpath=//a[@id='newfinancialTypeAccount']", FALSE);
-
+
$premiumName = 'Premium'.substr(sha1(rand()), 0, 7);
$amount = 500;
$sku = 'SKU';
$this->click("xpath=//div[@id='ltype']/div/table/tbody//tr/td[text()='".$financialType['name']."']/../td[7]/span/a[text()='Accounts']");
$this->waitForElementPresent("xpath=//a[@id='newfinancialTypeAccount']");
$this->clickLink("xpath=//a[@id='newfinancialTypeAccount']", "_qf_FinancialTypeAccount_cancel-botttom", FALSE);
-
+
$this->select("account_relationship", "label=Premiums Inventory Account is");
$this->select("financial_account_id", "label=$to");
$this->clickLink("_qf_FinancialTypeAccount_next-botttom", "xpath=//a[@id='newfinancialTypeAccount']", FALSE);
$this->assertEquals($fValue2, "100.00", "Verify Amount");
}
- function _getPremiumActualCost($entityId, $from = NULL, $to = NULL, $cost = NULL, $entityTable = NULL, $select = "ft.total_amount AS amount") {
+ /**
+ * @param $entityId
+ * @param null $from
+ * @param null $to
+ * @param null $cost
+ * @param null $entityTable
+ * @param string $select
+ *
+ * @return null|string
+ */function _getPremiumActualCost($entityId, $from = NULL, $to = NULL, $cost = NULL, $entityTable = NULL, $select = "ft.total_amount AS amount") {
$financialAccount = CRM_Contribute_PseudoConstant::financialAccount();
$query = "SELECT
{$select}
return $result;
}
- function _getFinancialTrxnAmount($contId) {
+ /**
+ * @param $contId
+ *
+ * @return null|string
+ */function _getFinancialTrxnAmount($contId) {
$query = "SELECT
SUM( ft.total_amount ) AS total
FROM civicrm_financial_trxn AS ft
return $result;
}
- function _getFinancialItemAmount($contId) {
+ /**
+ * @param $contId
+ *
+ * @return null|string
+ */function _getFinancialItemAmount($contId) {
$lineItem = key(CRM_Price_BAO_LineItem::getLineItems($contId, 'contribution'));
$query = "SELECT
SUM(amount)
return $result;
}
- function _getTotalContributedAmount($contId) {
+ /**
+ * @param $contId
+ *
+ * @return null|string
+ */function _getTotalContributedAmount($contId) {
$query = "SELECT
SUM(amount)
FROM civicrm_entity_financial_trxn
return $result;
}
- function _testOfflineContribution($firstName, $lastName, $email, $amount, $status="Completed") {
+ /**
+ * @param $firstName
+ * @param $lastName
+ * @param $email
+ * @param $amount
+ * @param string $status
+ */
+ function _testOfflineContribution($firstName, $lastName, $email, $amount, $status="Completed") {
$this->openCiviPage("contribute/add", "reset=1&context=standalone", "_qf_Contribution_upload");