From 5afce5ad1b3f6c712ba96ef02fbcff95693b9337 Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Fri, 30 Sep 2016 17:52:32 +0530 Subject: [PATCH] CRM-19427 - set deductible amount at price field option level --- CRM/Contribute/Form/Contribution.php | 12 ++++++++++++ CRM/Contribute/Form/Contribution/Confirm.php | 17 +++++++++++++++-- CRM/Price/BAO/LineItem.php | 1 + CRM/Price/BAO/PriceField.php | 1 + CRM/Price/DAO/LineItem.php | 14 +++++++------- CRM/Price/DAO/PriceFieldValue.php | 14 +++++++------- CRM/Price/Form/Field.php | 4 ++++ CRM/Price/Form/Option.php | 4 ++++ CRM/Report/Form/Contribute/Detail.php | 6 ++++++ CRM/Report/Form/Contribute/Summary.php | 6 ++++++ CRM/Upgrade/Incremental/sql/4.7.13.mysql.tpl | 5 +++++ sql/civicrm_generated.mysql | 4 ++-- templates/CRM/Price/Form/Field.tpl | 4 ++++ templates/CRM/Price/Form/Option.tpl | 4 ++++ templates/CRM/Price/Page/Option.tpl | 2 ++ tests/phpunit/CiviTest/CiviUnitTestCase.php | 2 +- xml/schema/Price/LineItem.xml | 10 +++++----- xml/schema/Price/PriceFieldValue.xml | 10 +++++----- 18 files changed, 91 insertions(+), 29 deletions(-) diff --git a/CRM/Contribute/Form/Contribution.php b/CRM/Contribute/Form/Contribution.php index a22163f37a..752f83d787 100644 --- a/CRM/Contribute/Form/Contribution.php +++ b/CRM/Contribute/Form/Contribution.php @@ -1874,6 +1874,18 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP if (!empty($params['non_deductible_amount'])) { return $params['non_deductible_amount']; } + $priceSetId = CRM_Utils_Array::value('price_set_id', $params); + + // return non-deductible amount if it is set at the price field option level + if (!empty($priceSetId) && $params['line_item'][$priceSetId]) { + $nonDeductibleAmount = 0; + foreach ($params['line_item'][$priceSetId] as $fieldId => $options) { + $nonDeductibleAmount += $options['non_deductible_amount'] * $options['qty']; + } + if ($nonDeductibleAmount) { + return $nonDeductibleAmount; + } + } $financialType = new CRM_Financial_DAO_FinancialType(); $financialType->id = $params['financial_type_id']; diff --git a/CRM/Contribute/Form/Contribution/Confirm.php b/CRM/Contribute/Form/Contribution/Confirm.php index 67daa503cb..2990ec6d3b 100644 --- a/CRM/Contribute/Form/Contribution/Confirm.php +++ b/CRM/Contribute/Form/Contribution/Confirm.php @@ -133,13 +133,26 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr * @param array $params * @param CRM_Financial_BAO_FinancialType $financialType * @param bool $online + * @param CRM_Contribute_Form_Contribution_Confirm $form * * @return array */ - protected static function getNonDeductibleAmount($params, $financialType, $online) { + protected static function getNonDeductibleAmount($params, $financialType, $online, $form) { if (isset($params['non_deductible_amount']) && (!empty($params['non_deductible_amount']))) { return $params['non_deductible_amount']; } + $priceSetId = CRM_Utils_Array::value('priceSetId', $params); + + // return non-deductible amount if it is set at the price field option level + if (!empty($priceSetId) && !empty($form->_lineItem) && !empty($form->_lineItem[$priceSetId])) { + $nonDeductibleAmount = 0; + foreach ($form->_lineItem[$priceSetId] as $fieldId => $options) { + $nonDeductibleAmount += $options['non_deductible_amount'] * $options['qty']; + } + if ($nonDeductibleAmount) { + return $nonDeductibleAmount; + } + } else { if ($financialType->is_deductible) { if ($online && isset($params['selectProduct'])) { @@ -832,7 +845,7 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr } $params['is_recur'] = $isRecur; $recurringContributionID = self::processRecurringContribution($form, $params, $contactID, $financialType); - $nonDeductibleAmount = self::getNonDeductibleAmount($params, $financialType, $online); + $nonDeductibleAmount = self::getNonDeductibleAmount($params, $financialType, $online, $form); $now = date('YmdHis'); $receiptDate = CRM_Utils_Array::value('receipt_date', $params); diff --git a/CRM/Price/BAO/LineItem.php b/CRM/Price/BAO/LineItem.php index 9b0ef7cc06..fcb2991426 100644 --- a/CRM/Price/BAO/LineItem.php +++ b/CRM/Price/BAO/LineItem.php @@ -375,6 +375,7 @@ AND li.entity_id = {$entityId} 'html_type' => $fields['html_type'], 'financial_type_id' => CRM_Utils_Array::value('financial_type_id', $options[$oid]), 'tax_amount' => CRM_Utils_Array::value('tax_amount', $options[$oid]), + 'non_deductible_amount' => CRM_Utils_Array::value('non_deductible_amount', $options[$oid]), ); if ($values[$oid]['membership_type_id'] && empty($values[$oid]['auto_renew'])) { diff --git a/CRM/Price/BAO/PriceField.php b/CRM/Price/BAO/PriceField.php index 5ae349b305..d640433b61 100644 --- a/CRM/Price/BAO/PriceField.php +++ b/CRM/Price/BAO/PriceField.php @@ -138,6 +138,7 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField { 'is_active' => 1, 'is_default' => CRM_Utils_Array::value($params['option_weight'][$index], $defaultArray) ? $defaultArray[$params['option_weight'][$index]] : 0, 'membership_num_terms' => NULL, + 'non_deductible_amount' => CRM_Utils_Array::value('non_deductible_amount', $params, 0), ); if ($options['membership_type_id']) { diff --git a/CRM/Price/DAO/LineItem.php b/CRM/Price/DAO/LineItem.php index 728fb06068..a0a5abdc03 100644 --- a/CRM/Price/DAO/LineItem.php +++ b/CRM/Price/DAO/LineItem.php @@ -30,7 +30,7 @@ * * Generated from xml/schema/CRM/Price/LineItem.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:5a4cae4554717aae5dd6af5572acd572) + * (GenCodeChecksum:b80ad6c535fb23d2a40fc36104895a79) */ require_once 'CRM/Core/DAO.php'; require_once 'CRM/Utils/Type.php'; @@ -121,11 +121,11 @@ class CRM_Price_DAO_LineItem extends CRM_Core_DAO { */ public $financial_type_id; /** - * Tax-deductible portion of the amount + * Portion of total amount which is NOT tax deductible. * * @var float */ - public $deductible_amount; + public $non_deductible_amount; /** * tax of each item * @@ -289,11 +289,11 @@ class CRM_Price_DAO_LineItem extends CRM_Core_DAO { 'labelColumn' => 'name', ) ) , - 'deductible_amount' => array( - 'name' => 'deductible_amount', + 'non_deductible_amount' => array( + 'name' => 'non_deductible_amount', 'type' => CRM_Utils_Type::T_MONEY, - 'title' => ts('Deductible Amount') , - 'description' => 'Tax-deductible portion of the amount', + 'title' => ts('Non-deductible Amount') , + 'description' => 'Portion of total amount which is NOT tax deductible.', 'required' => true, 'precision' => array( 20, diff --git a/CRM/Price/DAO/PriceFieldValue.php b/CRM/Price/DAO/PriceFieldValue.php index cda882a76f..769dbaa7f3 100644 --- a/CRM/Price/DAO/PriceFieldValue.php +++ b/CRM/Price/DAO/PriceFieldValue.php @@ -30,7 +30,7 @@ * * Generated from xml/schema/CRM/Price/PriceFieldValue.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:14d1591a915f160a115553bc53439d1a) + * (GenCodeChecksum:ed52bc054bb8aed4bb154756a79fafa1) */ require_once 'CRM/Core/DAO.php'; require_once 'CRM/Utils/Type.php'; @@ -145,11 +145,11 @@ class CRM_Price_DAO_PriceFieldValue extends CRM_Core_DAO { */ public $financial_type_id; /** - * Tax-deductible portion of the amount + * Portion of total amount which is NOT tax deductible. * * @var float */ - public $deductible_amount; + public $non_deductible_amount; /** * class constructor * @@ -351,11 +351,11 @@ class CRM_Price_DAO_PriceFieldValue extends CRM_Core_DAO { 'labelColumn' => 'name', ) ) , - 'deductible_amount' => array( - 'name' => 'deductible_amount', + 'non_deductible_amount' => array( + 'name' => 'non_deductible_amount', 'type' => CRM_Utils_Type::T_MONEY, - 'title' => ts('Deductible Amount') , - 'description' => 'Tax-deductible portion of the amount', + 'title' => ts('Non-deductible Amount') , + 'description' => 'Portion of total amount which is NOT tax deductible.', 'required' => true, 'precision' => array( 20, diff --git a/CRM/Price/Form/Field.php b/CRM/Price/Form/Field.php index 2e0fb425a6..9a2fae81f6 100644 --- a/CRM/Price/Form/Field.php +++ b/CRM/Price/Form/Field.php @@ -235,6 +235,10 @@ class CRM_Price_Form_Field extends CRM_Core_Form { $this->registerRule('price', 'callback', 'money', 'CRM_Utils_Rule'); $this->addRule('price', ts('must be a monetary value'), 'money'); + $this->add('text', 'non_deductible_amount', ts('Non-deductible Amount'), NULL); + $this->registerRule('non_deductible_amount', 'callback', 'money', 'CRM_Utils_Rule'); + $this->addRule('non_deductible_amount', ts('Please enter a monetary value for this field.'), 'money'); + if ($this->_action == CRM_Core_Action::UPDATE) { $this->freeze('html_type'); } diff --git a/CRM/Price/Form/Option.php b/CRM/Price/Form/Option.php index 81b994f4ce..29a24e1ad2 100644 --- a/CRM/Price/Form/Option.php +++ b/CRM/Price/Form/Option.php @@ -215,6 +215,10 @@ class CRM_Price_Form_Option extends CRM_Core_Form { $this->registerRule('amount', 'callback', 'money', 'CRM_Utils_Rule'); $this->addRule('amount', ts('Please enter a monetary value for this field.'), 'money'); + $this->add('text', 'non_deductible_amount', ts('Non-deductible Amount'), NULL); + $this->registerRule('non_deductible_amount', 'callback', 'money', 'CRM_Utils_Rule'); + $this->addRule('non_deductible_amount', ts('Please enter a monetary value for this field.'), 'money'); + $this->add('textarea', 'description', ts('Description')); $this->add('textarea', 'help_pre', ts('Pre Option Help')); $this->add('textarea', 'help_post', ts('Post Option Help')); diff --git a/CRM/Report/Form/Contribute/Detail.php b/CRM/Report/Form/Contribute/Detail.php index f5f4509087..8b8bf7f826 100644 --- a/CRM/Report/Form/Contribute/Detail.php +++ b/CRM/Report/Form/Contribute/Detail.php @@ -193,6 +193,9 @@ class CRM_Report_Form_Contribute_Detail extends CRM_Report_Form { 'required' => TRUE, 'statistics' => array('sum' => ts('Amount')), ), + 'non_deductible_amount' => array( + 'title' => ts('Non-deductible Amount'), + ), 'fee_amount' => NULL, 'net_amount' => NULL, 'contribution_or_soft' => array( @@ -233,6 +236,9 @@ class CRM_Report_Form_Contribute_Detail extends CRM_Report_Form { 'default' => NULL, 'type' => CRM_Utils_Type::T_STRING, ), + 'non_deductible_amount' => array( + 'title' => ts('Non-deductible Amount'), + ), 'financial_type_id' => array( 'title' => ts('Financial Type'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, diff --git a/CRM/Report/Form/Contribute/Summary.php b/CRM/Report/Form/Contribute/Summary.php index b70a3f4f53..7174bd9fa0 100644 --- a/CRM/Report/Form/Contribute/Summary.php +++ b/CRM/Report/Form/Contribute/Summary.php @@ -152,6 +152,9 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form { 'avg' => ts('Contribution Avg'), ), ), + 'non_deductible_amount' => array( + 'title' => ts('Non-deductible Amount'), + ), ), 'grouping' => 'contri-fields', 'filters' => array( @@ -185,6 +188,9 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form { 'total_amount' => array( 'title' => ts('Contribution Amount'), ), + 'non_deductible_amount' => array( + 'title' => ts('Non-deductible Amount'), + ), 'total_sum' => array( 'title' => ts('Contribution Aggregate'), 'type' => CRM_Report_Form::OP_INT, diff --git a/CRM/Upgrade/Incremental/sql/4.7.13.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.7.13.mysql.tpl index 83157e9195..7e2bb5b6ab 100644 --- a/CRM/Upgrade/Incremental/sql/4.7.13.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/4.7.13.mysql.tpl @@ -1 +1,6 @@ {* file to handle db changes in 4.7.13 during upgrade *} + +-- CRM-19427 +ALTER TABLE `civicrm_price_field_value` CHANGE `deductible_amount` `non_deductible_amount` DECIMAL( 20, 2 ) NOT NULL DEFAULT '0.00' COMMENT 'Portion of total amount which is NOT tax deductible.'; + +ALTER TABLE `civicrm_line_item` CHANGE `deductible_amount` `non_deductible_amount` DECIMAL( 20, 2 ) NOT NULL DEFAULT '0.00' COMMENT 'Portion of total amount which is NOT tax deductible.'; diff --git a/sql/civicrm_generated.mysql b/sql/civicrm_generated.mysql index cc3b877519..495d198348 100644 --- a/sql/civicrm_generated.mysql +++ b/sql/civicrm_generated.mysql @@ -637,7 +637,7 @@ UNLOCK TABLES; LOCK TABLES `civicrm_line_item` WRITE; /*!40000 ALTER TABLE `civicrm_line_item` DISABLE KEYS */; -INSERT INTO `civicrm_line_item` (`id`, `entity_table`, `entity_id`, `contribution_id`, `price_field_id`, `label`, `qty`, `unit_price`, `line_total`, `participant_count`, `price_field_value_id`, `financial_type_id`, `deductible_amount`, `tax_amount`) VALUES (1,'civicrm_contribution',1,1,1,'Contribution Amount',1.00,125.00,125.00,0,1,1,0.00,NULL),(2,'civicrm_contribution',2,2,1,'Contribution Amount',1.00,50.00,50.00,0,1,1,0.00,NULL),(3,'civicrm_contribution',3,3,1,'Contribution Amount',1.00,25.00,25.00,0,1,1,0.00,NULL),(4,'civicrm_contribution',4,4,1,'Contribution Amount',1.00,50.00,50.00,0,1,1,0.00,NULL),(5,'civicrm_contribution',5,5,1,'Contribution Amount',1.00,500.00,500.00,0,1,1,0.00,NULL),(6,'civicrm_contribution',6,6,1,'Contribution Amount',1.00,175.00,175.00,0,1,1,0.00,NULL),(7,'civicrm_contribution',7,7,1,'Contribution Amount',1.00,50.00,50.00,0,1,1,0.00,NULL),(8,'civicrm_contribution',8,8,1,'Contribution Amount',1.00,10.00,10.00,0,1,1,0.00,NULL),(9,'civicrm_contribution',9,9,1,'Contribution Amount',1.00,250.00,250.00,0,1,1,0.00,NULL),(10,'civicrm_contribution',10,10,1,'Contribution Amount',1.00,500.00,500.00,0,1,1,0.00,NULL),(11,'civicrm_contribution',11,11,1,'Contribution Amount',1.00,200.00,200.00,0,1,1,0.00,NULL),(12,'civicrm_contribution',12,12,1,'Contribution Amount',1.00,200.00,200.00,0,1,1,0.00,NULL),(13,'civicrm_contribution',13,13,1,'Contribution Amount',1.00,200.00,200.00,0,1,1,0.00,NULL),(16,'civicrm_membership',1,14,4,'General',1.00,100.00,100.00,NULL,7,2,0.00,NULL),(17,'civicrm_membership',3,15,4,'General',1.00,100.00,100.00,NULL,7,2,0.00,NULL),(18,'civicrm_membership',7,16,4,'General',1.00,100.00,100.00,NULL,7,2,0.00,NULL),(19,'civicrm_membership',9,17,4,'General',1.00,100.00,100.00,NULL,7,2,0.00,NULL),(20,'civicrm_membership',10,18,4,'General',1.00,100.00,100.00,NULL,7,2,0.00,NULL),(21,'civicrm_membership',13,19,4,'General',1.00,100.00,100.00,NULL,7,2,0.00,NULL),(22,'civicrm_membership',17,20,4,'General',1.00,100.00,100.00,NULL,7,2,0.00,NULL),(23,'civicrm_membership',19,21,4,'General',1.00,100.00,100.00,NULL,7,2,0.00,NULL),(24,'civicrm_membership',20,22,4,'General',1.00,100.00,100.00,NULL,7,2,0.00,NULL),(25,'civicrm_membership',21,23,4,'General',1.00,100.00,100.00,NULL,7,2,0.00,NULL),(26,'civicrm_membership',23,24,4,'General',1.00,100.00,100.00,NULL,7,2,0.00,NULL),(27,'civicrm_membership',27,25,4,'General',1.00,100.00,100.00,NULL,7,2,0.00,NULL),(28,'civicrm_membership',29,26,4,'General',1.00,100.00,100.00,NULL,7,2,0.00,NULL),(29,'civicrm_membership',30,27,4,'General',1.00,100.00,100.00,NULL,7,2,0.00,NULL),(30,'civicrm_membership',2,28,4,'Student',1.00,50.00,50.00,NULL,8,2,0.00,NULL),(31,'civicrm_membership',4,29,4,'Student',1.00,50.00,50.00,NULL,8,2,0.00,NULL),(32,'civicrm_membership',5,30,4,'Student',1.00,50.00,50.00,NULL,8,2,0.00,NULL),(33,'civicrm_membership',6,31,4,'Student',1.00,50.00,50.00,NULL,8,2,0.00,NULL),(34,'civicrm_membership',8,32,4,'Student',1.00,50.00,50.00,NULL,8,2,0.00,NULL),(35,'civicrm_membership',12,33,4,'Student',1.00,50.00,50.00,NULL,8,2,0.00,NULL),(36,'civicrm_membership',14,34,4,'Student',1.00,50.00,50.00,NULL,8,2,0.00,NULL),(37,'civicrm_membership',15,35,4,'Student',1.00,50.00,50.00,NULL,8,2,0.00,NULL),(38,'civicrm_membership',16,36,4,'Student',1.00,50.00,50.00,NULL,8,2,0.00,NULL),(39,'civicrm_membership',18,37,4,'Student',1.00,50.00,50.00,NULL,8,2,0.00,NULL),(40,'civicrm_membership',24,38,4,'Student',1.00,50.00,50.00,NULL,8,2,0.00,NULL),(41,'civicrm_membership',25,39,4,'Student',1.00,50.00,50.00,NULL,8,2,0.00,NULL),(42,'civicrm_membership',26,40,4,'Student',1.00,50.00,50.00,NULL,8,2,0.00,NULL),(43,'civicrm_membership',28,41,4,'Student',1.00,50.00,50.00,NULL,8,2,0.00,NULL),(44,'civicrm_membership',11,42,4,'Lifetime',1.00,1200.00,1200.00,NULL,9,2,0.00,NULL),(45,'civicrm_membership',22,43,4,'Lifetime',1.00,1200.00,1200.00,NULL,9,2,0.00,NULL),(47,'civicrm_participant',3,93,7,'Tiny-tots (ages 5-8)',1.00,800.00,800.00,0,13,4,0.00,NULL),(48,'civicrm_participant',6,76,7,'Tiny-tots (ages 5-8)',1.00,800.00,800.00,0,13,4,0.00,NULL),(49,'civicrm_participant',9,80,7,'Tiny-tots (ages 5-8)',1.00,800.00,800.00,0,13,4,0.00,NULL),(50,'civicrm_participant',12,66,7,'Tiny-tots (ages 5-8)',1.00,800.00,800.00,0,13,4,0.00,NULL),(51,'civicrm_participant',15,67,7,'Tiny-tots (ages 5-8)',1.00,800.00,800.00,0,13,4,0.00,NULL),(52,'civicrm_participant',18,74,7,'Tiny-tots (ages 5-8)',1.00,800.00,800.00,0,13,4,0.00,NULL),(53,'civicrm_participant',21,84,7,'Tiny-tots (ages 5-8)',1.00,800.00,800.00,0,13,4,0.00,NULL),(54,'civicrm_participant',24,48,7,'Tiny-tots (ages 5-8)',1.00,800.00,800.00,0,13,4,0.00,NULL),(55,'civicrm_participant',25,82,7,'Tiny-tots (ages 5-8)',1.00,800.00,800.00,0,13,4,0.00,NULL),(56,'civicrm_participant',28,81,7,'Tiny-tots (ages 5-8)',1.00,800.00,800.00,0,13,4,0.00,NULL),(57,'civicrm_participant',31,60,7,'Tiny-tots (ages 5-8)',1.00,800.00,800.00,0,13,4,0.00,NULL),(58,'civicrm_participant',34,75,7,'Tiny-tots (ages 5-8)',1.00,800.00,800.00,0,13,4,0.00,NULL),(59,'civicrm_participant',37,72,7,'Tiny-tots (ages 5-8)',1.00,800.00,800.00,0,13,4,0.00,NULL),(60,'civicrm_participant',40,61,7,'Tiny-tots (ages 5-8)',1.00,800.00,800.00,0,13,4,0.00,NULL),(61,'civicrm_participant',43,85,7,'Tiny-tots (ages 5-8)',1.00,800.00,800.00,0,13,4,0.00,NULL),(62,'civicrm_participant',46,53,7,'Tiny-tots (ages 5-8)',1.00,800.00,800.00,0,13,4,0.00,NULL),(63,'civicrm_participant',49,65,7,'Tiny-tots (ages 5-8)',1.00,800.00,800.00,0,13,4,0.00,NULL),(64,'civicrm_participant',50,46,7,'Tiny-tots (ages 5-8)',1.00,800.00,800.00,0,13,4,0.00,NULL),(65,'civicrm_participant',1,62,8,'Single',1.00,50.00,50.00,0,16,4,0.00,NULL),(66,'civicrm_participant',4,59,8,'Single',1.00,50.00,50.00,0,16,4,0.00,NULL),(67,'civicrm_participant',7,56,8,'Single',1.00,50.00,50.00,0,16,4,0.00,NULL),(68,'civicrm_participant',10,54,8,'Single',1.00,50.00,50.00,0,16,4,0.00,NULL),(69,'civicrm_participant',13,78,8,'Single',1.00,50.00,50.00,0,16,4,0.00,NULL),(70,'civicrm_participant',16,89,8,'Single',1.00,50.00,50.00,0,16,4,0.00,NULL),(71,'civicrm_participant',19,64,8,'Single',1.00,50.00,50.00,0,16,4,0.00,NULL),(72,'civicrm_participant',22,91,8,'Single',1.00,50.00,50.00,0,16,4,0.00,NULL),(73,'civicrm_participant',26,49,8,'Single',1.00,50.00,50.00,0,16,4,0.00,NULL),(74,'civicrm_participant',29,83,8,'Single',1.00,50.00,50.00,0,16,4,0.00,NULL),(75,'civicrm_participant',32,86,8,'Single',1.00,50.00,50.00,0,16,4,0.00,NULL),(76,'civicrm_participant',35,92,8,'Single',1.00,50.00,50.00,0,16,4,0.00,NULL),(77,'civicrm_participant',38,50,8,'Single',1.00,50.00,50.00,0,16,4,0.00,NULL),(78,'civicrm_participant',41,71,8,'Single',1.00,50.00,50.00,0,16,4,0.00,NULL),(79,'civicrm_participant',44,45,8,'Single',1.00,50.00,50.00,0,16,4,0.00,NULL),(80,'civicrm_participant',47,58,8,'Single',1.00,50.00,50.00,0,16,4,0.00,NULL),(81,'civicrm_participant',2,87,9,'Soprano',1.00,50.00,50.00,0,21,2,0.00,NULL),(82,'civicrm_participant',5,88,9,'Soprano',1.00,50.00,50.00,0,21,2,0.00,NULL),(83,'civicrm_participant',8,57,9,'Soprano',1.00,50.00,50.00,0,21,2,0.00,NULL),(84,'civicrm_participant',11,51,9,'Soprano',1.00,50.00,50.00,0,21,2,0.00,NULL),(85,'civicrm_participant',14,77,9,'Soprano',1.00,50.00,50.00,0,21,2,0.00,NULL),(86,'civicrm_participant',17,47,9,'Soprano',1.00,50.00,50.00,0,21,2,0.00,NULL),(87,'civicrm_participant',20,52,9,'Soprano',1.00,50.00,50.00,0,21,2,0.00,NULL),(88,'civicrm_participant',23,94,9,'Soprano',1.00,50.00,50.00,0,21,2,0.00,NULL),(89,'civicrm_participant',27,70,9,'Soprano',1.00,50.00,50.00,0,21,2,0.00,NULL),(90,'civicrm_participant',30,90,9,'Soprano',1.00,50.00,50.00,0,21,2,0.00,NULL),(91,'civicrm_participant',33,73,9,'Soprano',1.00,50.00,50.00,0,21,2,0.00,NULL),(92,'civicrm_participant',36,68,9,'Soprano',1.00,50.00,50.00,0,21,2,0.00,NULL),(93,'civicrm_participant',39,55,9,'Soprano',1.00,50.00,50.00,0,21,2,0.00,NULL),(94,'civicrm_participant',42,69,9,'Soprano',1.00,50.00,50.00,0,21,2,0.00,NULL),(95,'civicrm_participant',45,63,9,'Soprano',1.00,50.00,50.00,0,21,2,0.00,NULL),(96,'civicrm_participant',48,79,9,'Soprano',1.00,50.00,50.00,0,21,2,0.00,NULL); +INSERT INTO `civicrm_line_item` (`id`, `entity_table`, `entity_id`, `contribution_id`, `price_field_id`, `label`, `qty`, `unit_price`, `line_total`, `participant_count`, `price_field_value_id`, `financial_type_id`, `non_deductible_amount`, `tax_amount`) VALUES (1,'civicrm_contribution',1,1,1,'Contribution Amount',1.00,125.00,125.00,0,1,1,0.00,NULL),(2,'civicrm_contribution',2,2,1,'Contribution Amount',1.00,50.00,50.00,0,1,1,0.00,NULL),(3,'civicrm_contribution',3,3,1,'Contribution Amount',1.00,25.00,25.00,0,1,1,0.00,NULL),(4,'civicrm_contribution',4,4,1,'Contribution Amount',1.00,50.00,50.00,0,1,1,0.00,NULL),(5,'civicrm_contribution',5,5,1,'Contribution Amount',1.00,500.00,500.00,0,1,1,0.00,NULL),(6,'civicrm_contribution',6,6,1,'Contribution Amount',1.00,175.00,175.00,0,1,1,0.00,NULL),(7,'civicrm_contribution',7,7,1,'Contribution Amount',1.00,50.00,50.00,0,1,1,0.00,NULL),(8,'civicrm_contribution',8,8,1,'Contribution Amount',1.00,10.00,10.00,0,1,1,0.00,NULL),(9,'civicrm_contribution',9,9,1,'Contribution Amount',1.00,250.00,250.00,0,1,1,0.00,NULL),(10,'civicrm_contribution',10,10,1,'Contribution Amount',1.00,500.00,500.00,0,1,1,0.00,NULL),(11,'civicrm_contribution',11,11,1,'Contribution Amount',1.00,200.00,200.00,0,1,1,0.00,NULL),(12,'civicrm_contribution',12,12,1,'Contribution Amount',1.00,200.00,200.00,0,1,1,0.00,NULL),(13,'civicrm_contribution',13,13,1,'Contribution Amount',1.00,200.00,200.00,0,1,1,0.00,NULL),(16,'civicrm_membership',1,14,4,'General',1.00,100.00,100.00,NULL,7,2,0.00,NULL),(17,'civicrm_membership',3,15,4,'General',1.00,100.00,100.00,NULL,7,2,0.00,NULL),(18,'civicrm_membership',7,16,4,'General',1.00,100.00,100.00,NULL,7,2,0.00,NULL),(19,'civicrm_membership',9,17,4,'General',1.00,100.00,100.00,NULL,7,2,0.00,NULL),(20,'civicrm_membership',10,18,4,'General',1.00,100.00,100.00,NULL,7,2,0.00,NULL),(21,'civicrm_membership',13,19,4,'General',1.00,100.00,100.00,NULL,7,2,0.00,NULL),(22,'civicrm_membership',17,20,4,'General',1.00,100.00,100.00,NULL,7,2,0.00,NULL),(23,'civicrm_membership',19,21,4,'General',1.00,100.00,100.00,NULL,7,2,0.00,NULL),(24,'civicrm_membership',20,22,4,'General',1.00,100.00,100.00,NULL,7,2,0.00,NULL),(25,'civicrm_membership',21,23,4,'General',1.00,100.00,100.00,NULL,7,2,0.00,NULL),(26,'civicrm_membership',23,24,4,'General',1.00,100.00,100.00,NULL,7,2,0.00,NULL),(27,'civicrm_membership',27,25,4,'General',1.00,100.00,100.00,NULL,7,2,0.00,NULL),(28,'civicrm_membership',29,26,4,'General',1.00,100.00,100.00,NULL,7,2,0.00,NULL),(29,'civicrm_membership',30,27,4,'General',1.00,100.00,100.00,NULL,7,2,0.00,NULL),(30,'civicrm_membership',2,28,4,'Student',1.00,50.00,50.00,NULL,8,2,0.00,NULL),(31,'civicrm_membership',4,29,4,'Student',1.00,50.00,50.00,NULL,8,2,0.00,NULL),(32,'civicrm_membership',5,30,4,'Student',1.00,50.00,50.00,NULL,8,2,0.00,NULL),(33,'civicrm_membership',6,31,4,'Student',1.00,50.00,50.00,NULL,8,2,0.00,NULL),(34,'civicrm_membership',8,32,4,'Student',1.00,50.00,50.00,NULL,8,2,0.00,NULL),(35,'civicrm_membership',12,33,4,'Student',1.00,50.00,50.00,NULL,8,2,0.00,NULL),(36,'civicrm_membership',14,34,4,'Student',1.00,50.00,50.00,NULL,8,2,0.00,NULL),(37,'civicrm_membership',15,35,4,'Student',1.00,50.00,50.00,NULL,8,2,0.00,NULL),(38,'civicrm_membership',16,36,4,'Student',1.00,50.00,50.00,NULL,8,2,0.00,NULL),(39,'civicrm_membership',18,37,4,'Student',1.00,50.00,50.00,NULL,8,2,0.00,NULL),(40,'civicrm_membership',24,38,4,'Student',1.00,50.00,50.00,NULL,8,2,0.00,NULL),(41,'civicrm_membership',25,39,4,'Student',1.00,50.00,50.00,NULL,8,2,0.00,NULL),(42,'civicrm_membership',26,40,4,'Student',1.00,50.00,50.00,NULL,8,2,0.00,NULL),(43,'civicrm_membership',28,41,4,'Student',1.00,50.00,50.00,NULL,8,2,0.00,NULL),(44,'civicrm_membership',11,42,4,'Lifetime',1.00,1200.00,1200.00,NULL,9,2,0.00,NULL),(45,'civicrm_membership',22,43,4,'Lifetime',1.00,1200.00,1200.00,NULL,9,2,0.00,NULL),(47,'civicrm_participant',3,93,7,'Tiny-tots (ages 5-8)',1.00,800.00,800.00,0,13,4,0.00,NULL),(48,'civicrm_participant',6,76,7,'Tiny-tots (ages 5-8)',1.00,800.00,800.00,0,13,4,0.00,NULL),(49,'civicrm_participant',9,80,7,'Tiny-tots (ages 5-8)',1.00,800.00,800.00,0,13,4,0.00,NULL),(50,'civicrm_participant',12,66,7,'Tiny-tots (ages 5-8)',1.00,800.00,800.00,0,13,4,0.00,NULL),(51,'civicrm_participant',15,67,7,'Tiny-tots (ages 5-8)',1.00,800.00,800.00,0,13,4,0.00,NULL),(52,'civicrm_participant',18,74,7,'Tiny-tots (ages 5-8)',1.00,800.00,800.00,0,13,4,0.00,NULL),(53,'civicrm_participant',21,84,7,'Tiny-tots (ages 5-8)',1.00,800.00,800.00,0,13,4,0.00,NULL),(54,'civicrm_participant',24,48,7,'Tiny-tots (ages 5-8)',1.00,800.00,800.00,0,13,4,0.00,NULL),(55,'civicrm_participant',25,82,7,'Tiny-tots (ages 5-8)',1.00,800.00,800.00,0,13,4,0.00,NULL),(56,'civicrm_participant',28,81,7,'Tiny-tots (ages 5-8)',1.00,800.00,800.00,0,13,4,0.00,NULL),(57,'civicrm_participant',31,60,7,'Tiny-tots (ages 5-8)',1.00,800.00,800.00,0,13,4,0.00,NULL),(58,'civicrm_participant',34,75,7,'Tiny-tots (ages 5-8)',1.00,800.00,800.00,0,13,4,0.00,NULL),(59,'civicrm_participant',37,72,7,'Tiny-tots (ages 5-8)',1.00,800.00,800.00,0,13,4,0.00,NULL),(60,'civicrm_participant',40,61,7,'Tiny-tots (ages 5-8)',1.00,800.00,800.00,0,13,4,0.00,NULL),(61,'civicrm_participant',43,85,7,'Tiny-tots (ages 5-8)',1.00,800.00,800.00,0,13,4,0.00,NULL),(62,'civicrm_participant',46,53,7,'Tiny-tots (ages 5-8)',1.00,800.00,800.00,0,13,4,0.00,NULL),(63,'civicrm_participant',49,65,7,'Tiny-tots (ages 5-8)',1.00,800.00,800.00,0,13,4,0.00,NULL),(64,'civicrm_participant',50,46,7,'Tiny-tots (ages 5-8)',1.00,800.00,800.00,0,13,4,0.00,NULL),(65,'civicrm_participant',1,62,8,'Single',1.00,50.00,50.00,0,16,4,0.00,NULL),(66,'civicrm_participant',4,59,8,'Single',1.00,50.00,50.00,0,16,4,0.00,NULL),(67,'civicrm_participant',7,56,8,'Single',1.00,50.00,50.00,0,16,4,0.00,NULL),(68,'civicrm_participant',10,54,8,'Single',1.00,50.00,50.00,0,16,4,0.00,NULL),(69,'civicrm_participant',13,78,8,'Single',1.00,50.00,50.00,0,16,4,0.00,NULL),(70,'civicrm_participant',16,89,8,'Single',1.00,50.00,50.00,0,16,4,0.00,NULL),(71,'civicrm_participant',19,64,8,'Single',1.00,50.00,50.00,0,16,4,0.00,NULL),(72,'civicrm_participant',22,91,8,'Single',1.00,50.00,50.00,0,16,4,0.00,NULL),(73,'civicrm_participant',26,49,8,'Single',1.00,50.00,50.00,0,16,4,0.00,NULL),(74,'civicrm_participant',29,83,8,'Single',1.00,50.00,50.00,0,16,4,0.00,NULL),(75,'civicrm_participant',32,86,8,'Single',1.00,50.00,50.00,0,16,4,0.00,NULL),(76,'civicrm_participant',35,92,8,'Single',1.00,50.00,50.00,0,16,4,0.00,NULL),(77,'civicrm_participant',38,50,8,'Single',1.00,50.00,50.00,0,16,4,0.00,NULL),(78,'civicrm_participant',41,71,8,'Single',1.00,50.00,50.00,0,16,4,0.00,NULL),(79,'civicrm_participant',44,45,8,'Single',1.00,50.00,50.00,0,16,4,0.00,NULL),(80,'civicrm_participant',47,58,8,'Single',1.00,50.00,50.00,0,16,4,0.00,NULL),(81,'civicrm_participant',2,87,9,'Soprano',1.00,50.00,50.00,0,21,2,0.00,NULL),(82,'civicrm_participant',5,88,9,'Soprano',1.00,50.00,50.00,0,21,2,0.00,NULL),(83,'civicrm_participant',8,57,9,'Soprano',1.00,50.00,50.00,0,21,2,0.00,NULL),(84,'civicrm_participant',11,51,9,'Soprano',1.00,50.00,50.00,0,21,2,0.00,NULL),(85,'civicrm_participant',14,77,9,'Soprano',1.00,50.00,50.00,0,21,2,0.00,NULL),(86,'civicrm_participant',17,47,9,'Soprano',1.00,50.00,50.00,0,21,2,0.00,NULL),(87,'civicrm_participant',20,52,9,'Soprano',1.00,50.00,50.00,0,21,2,0.00,NULL),(88,'civicrm_participant',23,94,9,'Soprano',1.00,50.00,50.00,0,21,2,0.00,NULL),(89,'civicrm_participant',27,70,9,'Soprano',1.00,50.00,50.00,0,21,2,0.00,NULL),(90,'civicrm_participant',30,90,9,'Soprano',1.00,50.00,50.00,0,21,2,0.00,NULL),(91,'civicrm_participant',33,73,9,'Soprano',1.00,50.00,50.00,0,21,2,0.00,NULL),(92,'civicrm_participant',36,68,9,'Soprano',1.00,50.00,50.00,0,21,2,0.00,NULL),(93,'civicrm_participant',39,55,9,'Soprano',1.00,50.00,50.00,0,21,2,0.00,NULL),(94,'civicrm_participant',42,69,9,'Soprano',1.00,50.00,50.00,0,21,2,0.00,NULL),(95,'civicrm_participant',45,63,9,'Soprano',1.00,50.00,50.00,0,21,2,0.00,NULL),(96,'civicrm_participant',48,79,9,'Soprano',1.00,50.00,50.00,0,21,2,0.00,NULL); /*!40000 ALTER TABLE `civicrm_line_item` ENABLE KEYS */; UNLOCK TABLES; @@ -1201,7 +1201,7 @@ UNLOCK TABLES; LOCK TABLES `civicrm_price_field_value` WRITE; /*!40000 ALTER TABLE `civicrm_price_field_value` DISABLE KEYS */; -INSERT INTO `civicrm_price_field_value` (`id`, `price_field_id`, `name`, `label`, `description`, `help_pre`, `help_post`, `amount`, `count`, `max_value`, `weight`, `membership_type_id`, `membership_num_terms`, `is_default`, `is_active`, `financial_type_id`, `deductible_amount`) VALUES (1,1,'contribution_amount','Contribution Amount',NULL,NULL,NULL,'1',NULL,NULL,1,NULL,NULL,0,1,1,0.00),(2,2,'friend','Friend',NULL,NULL,NULL,'1.00',NULL,NULL,1,NULL,NULL,0,1,1,0.00),(3,2,'supporter','Supporter',NULL,NULL,NULL,'5.00',NULL,NULL,2,NULL,NULL,0,1,1,0.00),(4,2,'booster','Booster',NULL,NULL,NULL,'10.00',NULL,NULL,3,NULL,NULL,1,1,1,0.00),(5,2,'sustainer','Sustainer',NULL,NULL,NULL,'50.00',NULL,NULL,4,NULL,NULL,0,1,1,0.00),(6,3,'other_amount','Other Amount',NULL,NULL,NULL,'1',NULL,NULL,3,NULL,NULL,0,1,1,0.00),(7,4,'general','General','Regular annual membership.',NULL,NULL,'100.00',NULL,NULL,1,1,NULL,0,1,2,0.00),(8,4,'student','Student','Discount membership for full-time students.',NULL,NULL,'50.00',NULL,NULL,2,2,NULL,0,1,2,0.00),(9,4,'lifetime','Lifetime','Lifetime membership.',NULL,NULL,'1200.00',NULL,NULL,3,3,NULL,0,1,2,0.00),(10,5,'General','General',NULL,NULL,NULL,'100.00',NULL,NULL,1,1,NULL,1,1,2,0.00),(11,5,'Student','Student',NULL,NULL,NULL,'50.00',NULL,NULL,1,2,NULL,0,1,2,0.00),(12,6,'other_amount','Contribution Amount',NULL,NULL,NULL,'1',NULL,NULL,1,NULL,NULL,0,1,1,0.00),(13,7,'tiny_tots__ages_5_8_','Tiny-tots (ages 5-8)',NULL,NULL,NULL,'800',NULL,NULL,1,NULL,NULL,1,1,4,0.00),(14,7,'junior_Stars__ages_9_12_','Junior Stars (ages 9-12)',NULL,NULL,NULL,'1000',NULL,NULL,2,NULL,NULL,0,1,4,0.00),(15,7,'super_Stars__ages_13_18_','Super Stars (ages 13-18)',NULL,NULL,NULL,'1500',NULL,NULL,3,NULL,NULL,0,1,4,0.00),(16,8,'single','Single',NULL,NULL,NULL,'50',NULL,NULL,1,NULL,NULL,1,1,4,0.00),(17,8,'couple','Couple',NULL,NULL,NULL,'100',NULL,NULL,2,NULL,NULL,0,1,4,0.00),(18,8,'family','Family',NULL,NULL,NULL,'200',NULL,NULL,3,NULL,NULL,0,1,4,0.00),(19,9,'bass','Bass',NULL,NULL,NULL,'25',NULL,NULL,1,NULL,NULL,1,1,2,0.00),(20,9,'tenor','Tenor',NULL,NULL,NULL,'40',NULL,NULL,2,NULL,NULL,0,1,2,0.00),(21,9,'soprano','Soprano',NULL,NULL,NULL,'50',NULL,NULL,3,NULL,NULL,0,1,2,0.00); +INSERT INTO `civicrm_price_field_value` (`id`, `price_field_id`, `name`, `label`, `description`, `help_pre`, `help_post`, `amount`, `count`, `max_value`, `weight`, `membership_type_id`, `membership_num_terms`, `is_default`, `is_active`, `financial_type_id`, `non_deductible_amount`) VALUES (1,1,'contribution_amount','Contribution Amount',NULL,NULL,NULL,'1',NULL,NULL,1,NULL,NULL,0,1,1,0.00),(2,2,'friend','Friend',NULL,NULL,NULL,'1.00',NULL,NULL,1,NULL,NULL,0,1,1,0.00),(3,2,'supporter','Supporter',NULL,NULL,NULL,'5.00',NULL,NULL,2,NULL,NULL,0,1,1,0.00),(4,2,'booster','Booster',NULL,NULL,NULL,'10.00',NULL,NULL,3,NULL,NULL,1,1,1,0.00),(5,2,'sustainer','Sustainer',NULL,NULL,NULL,'50.00',NULL,NULL,4,NULL,NULL,0,1,1,0.00),(6,3,'other_amount','Other Amount',NULL,NULL,NULL,'1',NULL,NULL,3,NULL,NULL,0,1,1,0.00),(7,4,'general','General','Regular annual membership.',NULL,NULL,'100.00',NULL,NULL,1,1,NULL,0,1,2,0.00),(8,4,'student','Student','Discount membership for full-time students.',NULL,NULL,'50.00',NULL,NULL,2,2,NULL,0,1,2,0.00),(9,4,'lifetime','Lifetime','Lifetime membership.',NULL,NULL,'1200.00',NULL,NULL,3,3,NULL,0,1,2,0.00),(10,5,'General','General',NULL,NULL,NULL,'100.00',NULL,NULL,1,1,NULL,1,1,2,0.00),(11,5,'Student','Student',NULL,NULL,NULL,'50.00',NULL,NULL,1,2,NULL,0,1,2,0.00),(12,6,'other_amount','Contribution Amount',NULL,NULL,NULL,'1',NULL,NULL,1,NULL,NULL,0,1,1,0.00),(13,7,'tiny_tots__ages_5_8_','Tiny-tots (ages 5-8)',NULL,NULL,NULL,'800',NULL,NULL,1,NULL,NULL,1,1,4,0.00),(14,7,'junior_Stars__ages_9_12_','Junior Stars (ages 9-12)',NULL,NULL,NULL,'1000',NULL,NULL,2,NULL,NULL,0,1,4,0.00),(15,7,'super_Stars__ages_13_18_','Super Stars (ages 13-18)',NULL,NULL,NULL,'1500',NULL,NULL,3,NULL,NULL,0,1,4,0.00),(16,8,'single','Single',NULL,NULL,NULL,'50',NULL,NULL,1,NULL,NULL,1,1,4,0.00),(17,8,'couple','Couple',NULL,NULL,NULL,'100',NULL,NULL,2,NULL,NULL,0,1,4,0.00),(18,8,'family','Family',NULL,NULL,NULL,'200',NULL,NULL,3,NULL,NULL,0,1,4,0.00),(19,9,'bass','Bass',NULL,NULL,NULL,'25',NULL,NULL,1,NULL,NULL,1,1,2,0.00),(20,9,'tenor','Tenor',NULL,NULL,NULL,'40',NULL,NULL,2,NULL,NULL,0,1,2,0.00),(21,9,'soprano','Soprano',NULL,NULL,NULL,'50',NULL,NULL,3,NULL,NULL,0,1,2,0.00); /*!40000 ALTER TABLE `civicrm_price_field_value` ENABLE KEYS */; UNLOCK TABLES; diff --git a/templates/CRM/Price/Form/Field.tpl b/templates/CRM/Price/Form/Field.tpl index e0dd233613..b4c53f4d06 100644 --- a/templates/CRM/Price/Form/Field.tpl +++ b/templates/CRM/Price/Form/Field.tpl @@ -100,6 +100,10 @@ {/if} + + {$form.non_deductible_amount.label} + {$form.non_deductible_amount.html} + {if $useForEvent} {$form.count.label} diff --git a/templates/CRM/Price/Form/Option.tpl b/templates/CRM/Price/Form/Option.tpl index 5600203623..9c3de968d7 100644 --- a/templates/CRM/Price/Form/Option.tpl +++ b/templates/CRM/Price/Form/Option.tpl @@ -51,6 +51,10 @@ {$form.amount.label} {$form.amount.html} + + {$form.non_deductible_amount.label} + {$form.non_deductible_amount.html} + {$form.description.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_price_field_value' field='description' id=$optionId}{/if}{$form.description.html} diff --git a/templates/CRM/Price/Page/Option.tpl b/templates/CRM/Price/Page/Option.tpl index d97a3dd8e8..17bcb98e5a 100644 --- a/templates/CRM/Price/Page/Option.tpl +++ b/templates/CRM/Price/Page/Option.tpl @@ -54,6 +54,7 @@ {ts}Option Label{/ts} {ts}Option Amount{/ts} + {ts}Non-deductible Amount{/ts} {ts}Pre Help{/ts} {ts}Post Help{/ts} {if $isEvent} @@ -76,6 +77,7 @@ {$row.label} {$row.amount|crmMoney} + {$row.non_deductible_amount|crmMoney} {$row.help_pre} {$row.help_post} {if $isEvent} diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index 0aab1a3d55..21065f13ee 100644 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -2547,7 +2547,7 @@ AND ( TABLE_NAME LIKE 'civicrm_value_%' ) public function restoreDefaultPriceSetConfig() { CRM_Core_DAO::executeQuery('DELETE FROM civicrm_price_set WHERE id > 2'); CRM_Core_DAO::executeQuery("INSERT INTO `civicrm_price_field` (`id`, `price_set_id`, `name`, `label`, `html_type`, `is_enter_qty`, `help_pre`, `help_post`, `weight`, `is_display_amounts`, `options_per_line`, `is_active`, `is_required`, `active_on`, `expire_on`, `javascript`, `visibility_id`) VALUES (1, 1, 'contribution_amount', 'Contribution Amount', 'Text', 0, NULL, NULL, 1, 1, 1, 1, 1, NULL, NULL, NULL, 1)"); - CRM_Core_DAO::executeQuery("INSERT INTO `civicrm_price_field_value` (`id`, `price_field_id`, `name`, `label`, `description`, `amount`, `count`, `max_value`, `weight`, `membership_type_id`, `membership_num_terms`, `is_default`, `is_active`, `financial_type_id`, `deductible_amount`) VALUES (1, 1, 'contribution_amount', 'Contribution Amount', NULL, '1', NULL, NULL, 1, NULL, NULL, 0, 1, 1, 0.00)"); + CRM_Core_DAO::executeQuery("INSERT INTO `civicrm_price_field_value` (`id`, `price_field_id`, `name`, `label`, `description`, `amount`, `count`, `max_value`, `weight`, `membership_type_id`, `membership_num_terms`, `is_default`, `is_active`, `financial_type_id`, `non_deductible_amount`) VALUES (1, 1, 'contribution_amount', 'Contribution Amount', NULL, '1', NULL, NULL, 1, NULL, NULL, 0, 1, 1, 0.00)"); } /* * Function does a 'Get' on the entity & compares the fields in the Params with those returned diff --git a/xml/schema/Price/LineItem.xml b/xml/schema/Price/LineItem.xml index 000f891a93..a1f006c9b5 100644 --- a/xml/schema/Price/LineItem.xml +++ b/xml/schema/Price/LineItem.xml @@ -186,15 +186,15 @@ 4.3 - deductible_amount - Deductible Amount + non_deductible_amount + Non-deductible Amount decimal 0.0 - /unit?.?amoun/i + /non?.?deduct/i /^\d+(\.\d{2})?$/ true - Tax-deductible portion of the amount - 4.3 + Portion of total amount which is NOT tax deductible. + 4.7 Text diff --git a/xml/schema/Price/PriceFieldValue.xml b/xml/schema/Price/PriceFieldValue.xml index 5fc037bdc2..cd6ba61a1b 100644 --- a/xml/schema/Price/PriceFieldValue.xml +++ b/xml/schema/Price/PriceFieldValue.xml @@ -208,15 +208,15 @@ 4.3 - deductible_amount - Deductible Amount + non_deductible_amount + Non-deductible Amount decimal 0.0 - /unit?.?amoun/i + /non?.?deduct/i /^\d+(\.\d{2})?$/ true - Tax-deductible portion of the amount - 4.1 + Portion of total amount which is NOT tax deductible. + 4.7 Text -- 2.25.1