private static Loan _SetContract(OLoanTypes pLoansType, int pNumberOfInstallments, int pGracePeriod, NonRepaymentPenalties pNonRepaymentPenalties, bool pKeepExpectedInstallment,
                                         OAnticipatedRepaymentPenaltiesBases pAnticipatedBase, double pAnticipatedPenalties, bool pBadLoan)
        {
            LoanProduct package = new LoanProduct
                                      {
                                          InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
                                          LoanType = pLoansType,
                                          ChargeInterestWithinGracePeriod = true,
                                          Currency = new Currency {Id = 1, UseCents = true},
                                          KeepExpectedInstallment = pKeepExpectedInstallment,
                                          AnticipatedTotalRepaymentPenaltiesBase = pAnticipatedBase,
                                          RoundingType = ORoundingType.Approximate
                                      };

            Loan myContract = new Loan(package, 1000, 0.03m, pNumberOfInstallments, pGracePeriod, new DateTime(2006, 1, 1), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()))
                                  {
                                      BadLoan = pBadLoan,
                                      AnticipatedTotalRepaymentPenalties = pAnticipatedPenalties,
                                      NonRepaymentPenalties = pNonRepaymentPenalties
                                  };

            return myContract;
        }
 private static Loan _SetContract(OLoanTypes pLoansType, NonRepaymentPenalties pNonRepaymentFees,bool pKeepExpectedInstallment)
 {
     LoanProduct package = new LoanProduct
     {
         InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
         LoanType = pLoansType,
         ChargeInterestWithinGracePeriod = true,
         Currency = new Currency { Id = 1, UseCents = true }
     };
     package.KeepExpectedInstallment = pKeepExpectedInstallment;
     package.AnticipatedTotalRepaymentPenaltiesBase = OAnticipatedRepaymentPenaltiesBases.RemainingOLB;
     Loan myContract = new Loan(package, 1000, 0.03m, 6, 1, new DateTime(2006, 1, 1), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
     myContract.BadLoan = false;
     myContract.AnticipatedTotalRepaymentPenalties = 0.01;
     myContract.NonRepaymentPenalties = pNonRepaymentFees;
     return myContract;
 }
 private static Loan _SetContract(OLoanTypes pLoansType, int pNumberOfInstallments, int pGracePeriod, NonRepaymentPenalties pNonRepaymentPenalties, bool pKeepExpectedInstallment,
                                  OAnticipatedRepaymentPenaltiesBases pAnticipatedBase, bool pBadLoan)
 {
     return _SetContract(pLoansType,pNumberOfInstallments, pGracePeriod, pNonRepaymentPenalties, pKeepExpectedInstallment, pAnticipatedBase, 0.01,pBadLoan);
 }
        private static Loan _SetContract(OCurrency amount, decimal rate, OLoanTypes loansType, NonRepaymentPenalties nonRepaymentFees, bool keepExpectedInstallment, int numberOfGracePeriod, DateTime stratDate, int nbInstallment)
        {
            LoanProduct package = new LoanProduct
            {
                InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
                LoanType = loansType,
                ChargeInterestWithinGracePeriod = true,
                Currency = new Currency { Id = 1 }
            };

            package.KeepExpectedInstallment = keepExpectedInstallment;
            package.AnticipatedTotalRepaymentPenaltiesBase = OAnticipatedRepaymentPenaltiesBases.RemainingOLB;
            Loan myContract = new Loan(package, amount, rate, nbInstallment, numberOfGracePeriod, stratDate, new User(),
                                       ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""),
                                       ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
            myContract.BadLoan = false;
            myContract.AnticipatedTotalRepaymentPenalties = 0;
            myContract.NonRepaymentPenalties = nonRepaymentFees;
            return myContract;
        }
Ejemplo n.º 5
0
        public Loan(LoanProduct pAckage, OCurrency pAmount, decimal pInterestRate, int pNbOfInstallments, int pGracePeriod,
                      DateTime pStartDate, DayOfWeek? meetingDay, User pUser, ApplicationSettings pGeneralSettings,
                        NonWorkingDateSingleton pNwds, ProvisionTable pPt, ChartOfAccounts pChartOfAccounts)
        {
            _user = pUser;
            _generalSettings = pGeneralSettings;
            _nwdS = pNwds;
            Product = pAckage;

            NonRepaymentPenalties = new NonRepaymentPenalties();
            _events = new EventStock();
            _guarantors = new List<Guarantor>();
            _collaterals = new List<ContractCollateral>();
            _installmentType = pAckage.InstallmentType;
            _amount = pAmount;
            _interestRate = pInterestRate;
            _nbOfInstallments = pNbOfInstallments;
            GracePeriod = pGracePeriod;
            CreationDate = pStartDate;
            _startDate = pStartDate;

            _firstInstallmentDate = CalculateInstallmentDate(pStartDate, 1);
            if (meetingDay.HasValue)
                _firstInstallmentDate = GetMeetingDate(_firstInstallmentDate, meetingDay);

            _alignAlignDisbursementDate = CalculateAlignDisbursementDate(_firstInstallmentDate);

            //with this constructor, installment are directly calculated when a new CreditContract is instanciated
            _installmentList = CalculateInstallments(true);
            CalculateStartDates();
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Instancy a new CreditContract. Use it if installments need'nt calculate 
        /// </summary>
        /// <param name="pUser"></param>
        /// <param name="pGeneralSettings"></param>
        /// <param name="pNwds"></param>
        /// <param name="pPt"></param>
        /// <param name="pChartOfAccounts"></param>
        public Loan(User pUser, ApplicationSettings pGeneralSettings, NonWorkingDateSingleton pNwds, ProvisionTable pPt, ChartOfAccounts pChartOfAccounts)
        {
            _user = pUser;
            _generalSettings = pGeneralSettings;
            _nwdS = pNwds;

            NonRepaymentPenalties = new NonRepaymentPenalties();
            _installmentList = new List<Installment>();
            _guarantors = new List<Guarantor>();
            _collaterals = new List<ContractCollateral>();
            _events = new EventStock();
        }
Ejemplo n.º 7
0
        private static Loan _SetContract(OLoanTypes pLoansType, int pNumberOfInstallments, int pGracePeriod, NonRepaymentPenalties pNonRepaymentPenalties, bool pKeepExpectedInstallment, 
                                         OAnticipatedRepaymentPenaltiesBases pAnticipatedBase, double pAnticipatedPenalties,bool pBadLoan)
        {
            LoanProduct package = new LoanProduct
                                      {
                                          InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
                                          LoanType = pLoansType,
                                          ChargeInterestWithinGracePeriod = true,
                                          Currency = new Currency { Id = 1 }
                                      };
            package.KeepExpectedInstallment = pKeepExpectedInstallment;
            package.AnticipatedRepaymentPenaltiesBase = pAnticipatedBase;

            Loan myContract = new Loan(package, 1000, 0.03, pNumberOfInstallments, pGracePeriod, new DateTime(2006, 1, 1), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisioningTable.GetInstance(new User()));
            myContract.BadLoan = pBadLoan;

            myContract.AnticipatedRepaymentPenalties = pAnticipatedPenalties;
            myContract.NonRepaymentPenalties = pNonRepaymentPenalties;
            return myContract;
        }