コード例 #1
0
        public decimal CalculateGiftAidAmount(decimal donationAmount, EventSupplement selectedEventSupplement)
        {
            if (donationAmount <= 0m)
            {
                throw new ArgumentOutOfRangeException("donationAmount");
            }

            var currentTaxRate = _taxRepository.RetrieveTaxRate();

            var supplementAmount = this.CalculateSupplementedAmount(donationAmount, selectedEventSupplement);
            var gaRatio          = currentTaxRate / (100 - currentTaxRate);
            var giftAidAmount    = supplementAmount * gaRatio;

            return(CalculationHelper.RoundDecimal(giftAidAmount, 2));
        }