From 17d83f507063c3262bfb68ee37f23af0de1cc233 Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Fri, 2 Sep 2016 12:31:32 +0530 Subject: [PATCH] additional fixes --- CRM/Contribute/Form/Contribution.php | 6 +++- CRM/Financial/BAO/FinancialAccount.php | 3 +- .../CRM/Contribute/Form/Contribution.tpl | 32 ++++++++++--------- 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/CRM/Contribute/Form/Contribution.php b/CRM/Contribute/Form/Contribution.php index 78af5f2fbf..8d17c73030 100644 --- a/CRM/Contribute/Form/Contribution.php +++ b/CRM/Contribute/Form/Contribution.php @@ -291,6 +291,8 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP // Set title if ($this->_mode && $this->_id) { $this->setPageTitle(ts('Contribution (Pay Now)')); + $this->_payNow = TRUE; + $this->assign('payNow', $this->_payNow); } elseif ($this->_mode) { $this->setPageTitle($this->_ppID ? ts('Credit Card Pledge Payment') : ts('Credit Card Contribution')); @@ -1507,7 +1509,9 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP $pId = $contributionDetails['participant']; } } - $this->_params['contribution_id'] = $this->_id; + if (!empty($this->_payNow)) { + $this->_params['contribution_id'] = $this->_id; + } } if (!$priceSetId && !empty($submittedValues['total_amount']) && $this->_id) { diff --git a/CRM/Financial/BAO/FinancialAccount.php b/CRM/Financial/BAO/FinancialAccount.php index bc7994cd83..0efbc9a542 100644 --- a/CRM/Financial/BAO/FinancialAccount.php +++ b/CRM/Financial/BAO/FinancialAccount.php @@ -378,7 +378,8 @@ LIMIT 1"; } $recognitionDate = CRM_Utils_Array::value('revenue_recognition_date', $params); if (!(!CRM_Utils_System::isNull($recognitionDate) - || ($contributionID && !CRM_Utils_System::isNull($params['prevContribution']->revenue_recognition_date))) + || ($contributionID && isset($params['prevContribution']) + && !CRM_Utils_System::isNull($params['prevContribution']->revenue_recognition_date))) ) { return FALSE; } diff --git a/templates/CRM/Contribute/Form/Contribution.tpl b/templates/CRM/Contribute/Form/Contribution.tpl index 12ba439831..e72413b9fc 100644 --- a/templates/CRM/Contribute/Form/Contribution.tpl +++ b/templates/CRM/Contribute/Form/Contribution.tpl @@ -41,7 +41,7 @@ {if $contributionMode}
{if $contactId} - {ts 1=$displayName 2=$contributionMode|upper}Use this form to {if $contribID} edit {else} submit a new {/if} contribution on behalf of %1. A + {ts 1=$displayName 2=$contributionMode|upper}Use this form to {if $payNow} edit {else} submit a new {/if} contribution on behalf of %1. A %2 transaction will be submitted using the selected payment processor.{/ts} {else} {ts 1=$displayName 2=$contributionMode|upper}Use this form to submit a new contribution. A %2 transaction will be submitted using the selected payment processor.{/ts} @@ -103,21 +103,23 @@ {$form.total_amount.label} {$form.currency.html|crmAddClass:eight} {$form.total_amount.html|crmAddClass:eight} - {if $hasPriceSets} - {ts}OR{/ts} - {$form.price_set_id.html} -
- {/if} + {if !$payNow} + {if $hasPriceSets} + {ts}OR{/ts} + {$form.price_set_id.html} +
+ {/if} - {if $ppID}{ts}adjust payment amount{/ts}{help id="adjust-payment-amount"}{/if} -
- {if $hasPriceSets}{ts}Alternatively, you can use a price set.{/ts}{/if} -
-
+ {if $ppID}{ts}adjust payment amount{/ts}{help id="adjust-payment-amount"}{/if} +
+ {if $hasPriceSets}{ts}Alternatively, you can use a price set.{/ts}{/if} +
+
+ {/if} - {if $buildRecurBlock && !$contribID} + {if $buildRecurBlock && !$payNow} @@ -158,7 +160,7 @@ {* CRM-7362 --add campaign to contributions *} {include file="CRM/Campaign/Form/addCampaignToComponent.tpl" campaignTrClass="crm-contribution-form-block-campaign_id"} - {if $contributionMode && !$contribID} + {if $contributionMode} {if $email and $outBound_option != 2} {$form.is_email_receipt.label} @@ -179,7 +181,7 @@ {/if} - {if !$contributionMode || $contribID} + {if !$contributionMode || $payNow} {$form.contribution_status_id.label} {$form.contribution_status_id.html} @@ -221,7 +223,7 @@ {/if} - {if $form.revenue_recognition_date && !$contribID} + {if $form.revenue_recognition_date && !$payNow} {$form.revenue_recognition_date.label} {$form.revenue_recognition_date.html} -- 2.25.1