$this->add('select', 'from_email_address', ts('Receipt From'), $this->_fromEmails);
$component = 'contribution';
+ $componentDetails = [];
if ($this->_id) {
$componentDetails = CRM_Contribute_BAO_Contribution::getComponentDetails($this->_id);
if (CRM_Utils_Array::value('membership', $componentDetails)) {
// don't allow price set for contribution if it is related to participant, or if it is a pledge payment
// and if we already have line items for that participant. CRM-5095
if ($buildPriceSet && $this->_id) {
- $componentDetails = CRM_Contribute_BAO_Contribution::getComponentDetails($this->_id);
$pledgePaymentId = CRM_Core_DAO::getFieldValue('CRM_Pledge_DAO_PledgePayment',
$this->_id,
'id',
)
);
- // if status is Cancelled freeze Amount, Payment Instrument, Check #, Financial Type,
- // Net and Fee Amounts are frozen in AdditionalInfo::buildAdditionalDetail
- if ($this->_id && ($this->_values['contribution_status_id'] == CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Cancelled'))) {
- if ($totalAmount) {
- $totalAmount->freeze();
- }
- $paymentInstrument->freeze();
- $trxnId->freeze();
- $financialType->freeze();
- }
-
// if contribution is related to membership or participant freeze Financial Type, Amount
- if ($this->_id && isset($this->_values['tax_amount'])) {
+ if ($this->_id) {
$componentDetails = CRM_Contribute_BAO_Contribution::getComponentDetails($this->_id);
- if (CRM_Utils_Array::value('membership', $componentDetails) || CRM_Utils_Array::value('participant', $componentDetails)) {
+ $isCancelledStatus = ($this->_values['contribution_status_id'] == CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Cancelled'));
+
+ if (CRM_Utils_Array::value('membership', $componentDetails) ||
+ CRM_Utils_Array::value('participant', $componentDetails) ||
+ // if status is Cancelled freeze Amount, Payment Instrument, Check #, Financial Type,
+ // Net and Fee Amounts are frozen in AdditionalInfo::buildAdditionalDetail
+ $isCancelledStatus
+ ) {
if ($totalAmount) {
$totalAmount->freeze();
+ $this->getElement('currency')->freeze();
+ }
+ if ($isCancelledStatus) {
+ $paymentInstrument->freeze();
+ $trxnId->freeze();
}
$financialType->freeze();
$this->assign('freezeFinancialType', TRUE);
{ts}Optional identifier for the contribution source (campaign name, event, mailer, etc.).{/ts}
{/htxt}
+{htxt id="id-total_amount-title"}
+ {ts}Total Amount{/ts}
+{/htxt}
+{htxt id="id-total_amount"}
+{ts 1='target="_blank" href="https://civicrm.org/extensions/line-item-editor"'}You are not allowed to change the total amount as it will lead to incorrect line item entries. You can either delete or recreate or install <a %1>Line Item Editor</a>.{/ts}
+{/htxt}
+
{htxt id="id-financial_type-title"}
{ts}Financial Type{/ts}
{/htxt}
<p>
{ts}When contributions are made via a Personal Campaign Page a soft credit (of type 'Personal Campaign Page') is automatically created and assigned to the 'owner' of the the Personal Campaign Page.{/ts}
</p>
-{/htxt}
+{/htxt}
{htxt id="adjust-payment-amount-title"}
{ts}Payment Amount{/ts}