Esempio n. 1
0
        public override List<SavingEvent> ChargeOverdraftFee(OCurrency pAmount, DateTime pDate, string pDescription, User pUser, bool pIsDesactivateFees)
        {
            List<SavingEvent> events = new List<SavingEvent>();

            SavingOverdraftFeeEvent overdraftFeeEvent = new SavingOverdraftFeeEvent
            {
                Amount = pAmount,
                Date = pDate,
                Description = pDescription,
                User = pUser,
                Cancelable = true,
                ProductType = typeof(SavingBookProduct)
            };
            _events.Add(overdraftFeeEvent);
            events.Add(overdraftFeeEvent);

            if (Status != OSavingsStatus.Closed && !pIsDesactivateFees)
                overdraftFeeEvent.Fee = OverdraftFees;

            return events;
        }
Esempio n. 2
0
        private List<SavingEvent> GenerateManagementFeeEvent(DateTime prevDate, DateTime nextDate)
        {
            List<SavingEvent> retval = new List<SavingEvent>();

            const string desc = "Management fee of {0:.00} for {1:dd.MM.yyyy} - {2:dd.MM.yyyy}";
            object[] items = new object[] { ManagementFees.GetFormatedValue(true), prevDate, nextDate };

            SavingManagementFeeEvent smfe = new SavingManagementFeeEvent
            {
                Amount = 0m,
                Cancelable = true,
                Date = nextDate,
                Description = string.Format(desc, items),
                Fee = ManagementFees.HasValue ? ManagementFees : 0m,
                User = _user,
                ProductType = Product.GetType()
            };
            retval.Add(smfe);
            _AddSavingEvent(smfe);

            OCurrency balance = GetBalance(nextDate);
            if (balance < 0)
            {
                if (!InOverdraft)
                {
                    SavingOverdraftFeeEvent overdraftFeeEvent = new SavingOverdraftFeeEvent
                    {
                        Amount = 0m,
                        Date = nextDate,
                        Description = "Overdraft fee event",
                        User = _user,
                        Cancelable = false,
                        Fee = OverdraftFees,
                        ProductType = typeof(SavingBookProduct)
                    };

                    _AddSavingEvent(overdraftFeeEvent);
                    retval.Add(overdraftFeeEvent);
                    InOverdraft = true;
                }
            }

            return retval;
        }
Esempio n. 3
0
        public virtual List<SavingEvent> ChargeOverdraftFee(OCurrency pAmount, DateTime pDate, string pDescription, User pUser, bool pIsDesactivateFees)
        {
            List<SavingEvent> events = new List<SavingEvent>();
            SavingOverdraftFeeEvent overdraftFeeEvent = new SavingOverdraftFeeEvent
            {
                Amount = pAmount,
                Date = pDate,
                Description = pDescription,
                User = pUser,
                Cancelable = true,
                ProductType = Product.GetType()
            };
            events.Add(overdraftFeeEvent);
            _events.Add(overdraftFeeEvent);

            return events;
        }