CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Making Additional Info Fields Editable in Contributions
Pages: [1]

Author Topic: Making Additional Info Fields Editable in Contributions  (Read 952 times)

VRAZER

  • I post occasionally
  • **
  • Posts: 49
  • Karma: 1
Making Additional Info Fields Editable in Contributions
March 13, 2009, 05:01:01 am
I'm looking into changing the Edit screen in my CiviCRM installations to make the Non-Deductible amount for a completed contribution editable.  Looking at the code in CRM/Contribution/Form/AdditionalInfo.php, it should be editable unless I'm misunderstanding these two lines of code.

        $element =& $form->add( 'text', 'non_deductible_amount', ts('Non-deductible Amount'),
                                $attributes['non_deductible_amount'] );
        $form->addRule('non_deductible_amount', ts('Please enter a valid amount.'), 'money');

Is there some other location I should be looking if I need to figure out why this field is NOT editable in a completed Contribution?

- Lance

Sunil

  • I post frequently
  • ***
  • Posts: 131
  • Karma: 23
  • The community around a product more important than the product itself?
    • CiviCRM
Re: Making Additional Info Fields Editable in Contributions
March 13, 2009, 05:16:25 am
Hi

In Contribution Edit screen, we freeze all financial related fields when contribution made through Credit card.

If u want 'non_deductible_amount' field editable at any case then apply following patch.

Quote
--- CRM/Contribute/Form/AdditionalInfo.php      (revision 20288)
+++ CRM/Contribute/Form/AdditionalInfo.php      (working copy)
@@ -104,13 +104,10 @@
         $form->addElement('date', 'thankyou_date', ts('Thank-you Sent'), CRM_Core_SelectValues::date('activityDate'));
         $form->addRule('thankyou_date', ts('Select a valid date.'), 'qfDate');
         // add various amounts
-        $element =& $form->add( 'text', 'non_deductible_amount', ts('Non-deductible Amount'),
+        $form->add( 'text', 'non_deductible_amount', ts('Non-deductible Amount'),
                                 $attributes['non_deductible_amount'] );
         $form->addRule('non_deductible_amount', ts('Please enter a valid amount.'), 'money');
         
-        if ( $form->_online ) {
-            $element->freeze( );
-        }
         $element =& $form->add( 'text', 'fee_amount', ts('Fee Amount'),
                                 $attributes['fee_amount'] );
         $form->addRule('fee_amount', ts('Please enter a valid amount.'), 'money');

Sunil
The community around a product more important than the product itself?

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Making Additional Info Fields Editable in Contributions

This forum was archived on 2017-11-26.