//public LoanAgreement(string name, string template, Database.Loans.Loan loan, int templateId) public LoanAgreement(string name, Database.Loans.Loan loan, int templateID) { Name = name; Loan = loan; FilePath = LongFilenameWithDir(); TemplateID = templateID; }
} // UpdateBalance public virtual Loan Clone() { var newItem = new Database.Loans.Loan() { APR = this.APR, Balance = this.Balance, Date = this.Date, Interest = this.Interest, InterestPaid = this.InterestPaid, Principal = this.Principal, Status = this.Status, DateClosed = this.DateClosed, InterestRate = this.InterestRate, LoanAmount = this.LoanAmount, SetupFee = this.SetupFee, RefNumber = this.RefNumber, Repayments = this.Repayments, RepaymentsNum = this.RepaymentsNum, NextRepayment = this.NextRepayment, Fees = this.Fees, FeesPaid = this.FeesPaid, LoanType = this.LoanType }; foreach (var loanScheduleItem in this.Schedule.Select(s => s.Clone())) { newItem.Schedule.Add(loanScheduleItem); loanScheduleItem.Loan = this; } // foreach return(newItem); } // Clone
public override decimal NextInterestPayment(Database.Loans.Loan loan) { var installment = loan.Schedule.FirstOrDefault(i => i.Status == LoanScheduleStatus.StillToPay && i.LoanRepayment == 0); if (installment == null) { return(0); } return(installment.Interest); }
public virtual decimal NextInterestPayment(Database.Loans.Loan loan) { return(0); }