getNonDeductibleAmountFromPriceSet should take into account the financial type of the price field option
Overview
getNonDeductibleAmountFromPriceSet()
gets called in a couple places to calculate the non-deductible amount of contributions. While the calling method will take into account the financial type of the contribution when assigning the non-deductible amount, getNonDeductibleAmountFromPriceSet()
does not take into account the financial type of the price set option. I believe it should be.
Reproduction steps
- Create price set and add two fields: one with financial type Donation (deductible) =
$10
and other Event Fee (non-deductible) =$20
. Make the Event Fee have a random non-deductible amount of say$2.50
. - Add a contribution in the backend to a contact and choose this new price set.
- Look at the resulting contribution.
Current behaviour
The contribution has non-deductible = $2.50
for a $30
contribution.
Expected behaviour
I expect the non-deducible to be $20
, the full price of the Event Fee. The contribution should be setting the non-deductible to be equal that of the merchandise price field, regardless of the actual non-deductible amount for that field. If a price field is non-deductible then it is 100% non-deductible based on the financial type.