当前位置: 首页>>代码示例>>C#>>正文


C# Loan.Repay方法代码示例

本文整理汇总了C#中OpenCBS.CoreDomain.Contracts.Loans.Loan.Repay方法的典型用法代码示例。如果您正苦于以下问题:C# Loan.Repay方法的具体用法?C# Loan.Repay怎么用?C# Loan.Repay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OpenCBS.CoreDomain.Contracts.Loans.Loan的用法示例。


在下文中一共展示了Loan.Repay方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CalculateExpectedOLB2

        public void CalculateExpectedOLB2()
        {
            LoanProduct package = new LoanProduct
            {
                InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
                LoanType = OLoanTypes.Flat,
                ChargeInterestWithinGracePeriod = true,
                Currency = new Currency { Id = 1 }
            };
            package.KeepExpectedInstallment = false;
            package.AnticipatedTotalRepaymentPenaltiesBase = OAnticipatedRepaymentPenaltiesBases.RemainingOLB;
            Loan myContract = new Loan(package, 20000, 0.02m, 10, 0, new DateTime(2009, 1, 17), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
            myContract.BadLoan = false;

            myContract.Repay(1, new DateTime(2009, 1, 17), 1000, true, false);

            Assert.AreEqual(19000, myContract.CalculateExpectedOlb(1, false).Value);
            Assert.AreEqual(17100, myContract.CalculateExpectedOlb(2, false).Value);
            Assert.AreEqual(15200, myContract.CalculateExpectedOlb(3, false).Value);
            Assert.AreEqual(13300, myContract.CalculateExpectedOlb(4, false).Value);
            Assert.AreEqual(11400, myContract.CalculateExpectedOlb(5, false).Value);
            Assert.AreEqual(9500, myContract.CalculateExpectedOlb(6, false).Value);
            Assert.AreEqual(7600, myContract.CalculateExpectedOlb(7, false).Value);
            Assert.AreEqual(5700, myContract.CalculateExpectedOlb(8, false).Value);
            Assert.AreEqual(3800, myContract.CalculateExpectedOlb(9, false).Value);
            Assert.AreEqual(1900, myContract.CalculateExpectedOlb(10, false).Value);
        }
开发者ID:TalasZh,项目名称:opencbs,代码行数:27,代码来源:TestOLBCalculation.cs

示例2: CalculateRemainingInterest_AccrualAccounting

        public void CalculateRemainingInterest_AccrualAccounting()
        {
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.ACCOUNTINGPROCESS, OAccountingProcesses.Accrual);
            LoanProduct package = new LoanProduct
            {
                InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
                LoanType = OLoanTypes.Flat,
                ChargeInterestWithinGracePeriod = true,
                Currency = new Currency { Id = 1, UseCents = true}
            };
            Loan myContract = new Loan(package, 1000, 0.03m, 6, 0, new DateTime(2009, 12, 25), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));

            myContract.Repay(1, new DateTime(2010, 1, 25), 196.67m, false, true);

            Assert.AreEqual(17.42m, Math.Round(myContract.CalculateRemainingInterests(new DateTime(2010, 2, 12)).Value, 2));

            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.ACCOUNTINGPROCESS, OAccountingProcesses.Cash);
        }
开发者ID:BillTheBest,项目名称:opencbs,代码行数:18,代码来源:TestCreditContract.cs

示例3: Repay_DecliningLoan_KeepNotExpectedInstallment_SecondInstallmentNotEntirlyPaid

        public void Repay_DecliningLoan_KeepNotExpectedInstallment_SecondInstallmentNotEntirlyPaid()
        {
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.CALCULATIONLATEFEESDURINGPUBLICHOLIDAYS, true);

            LoanProduct package = new LoanProduct
            {
                InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
                LoanType = OLoanTypes.DecliningFixedInstallments,
                ChargeInterestWithinGracePeriod = true,
                KeepExpectedInstallment = false,
                Currency = new Currency { Id = 1, UseCents = true},
                RoundingType = ORoundingType.Approximate
            };
            Loan myContract = new Loan(package, 1000, 0.03m, 7, 1, new DateTime(2006, 1, 1), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));

            Assert.AreEqual(1000, _CheckInstalmentsTotalPrincipal(myContract).Value);

            myContract.Repay(1, new DateTime(2006, 2, 1), 30, true, false);
            myContract.Repay(2, new DateTime(2006, 3, 1), 100, true, false);

            _AssertSpecifiedInstallment(myContract.GetInstallment(0), 1, new DateTime(2006, 2, 1), 30, 0, 1000, 0, 30);
            _AssertSpecifiedInstallment(myContract.GetInstallment(1), 2, new DateTime(2006, 3, 1), 30, 154.60m, 1000, 70, 30);
            _AssertSpecifiedInstallment(myContract.GetInstallment(2), 3, new DateTime(2006, 4, 3), 25.36m, 159.24m, 845.40m, 0, 0);
            _AssertSpecifiedInstallment(myContract.GetInstallment(3), 4, new DateTime(2006, 5, 1), 20.58m, 164.02m, 686.16m, 0, 0);
            _AssertSpecifiedInstallment(myContract.GetInstallment(4), 5, new DateTime(2006, 6, 1), 15.66m, 168.93m, 522.14m, 0, 0);
            _AssertSpecifiedInstallment(myContract.GetInstallment(5), 6, new DateTime(2006, 7, 3), 10.60m, 173.99m, 353.21m, 0, 0);
            _AssertSpecifiedInstallment(myContract.GetInstallment(6), 7, new DateTime(2006, 8, 1), 5.38m, 179.22m, 179.22m, 0, 0);
        }
开发者ID:BillTheBest,项目名称:opencbs,代码行数:28,代码来源:TestCreditContract.cs

示例4: TestIfPastDueIsEqualToZeroWhenAllInstallmentsAreRepaid

        public void TestIfPastDueIsEqualToZeroWhenAllInstallmentsAreRepaid()
        {
            LoanProduct package = new LoanProduct
                                      {
                                          InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
                                          LoanType = OLoanTypes.Flat,
                                          ChargeInterestWithinGracePeriod = true,
                                          Currency = new Currency { Id = 1 }
                                      };
            package.KeepExpectedInstallment = false;
            Loan myContract = new Loan(package, 1000, 0.03m, 6, 2, new DateTime(2006, 1, 1), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));

            myContract.Repay(1, new DateTime(2006, 2, 1), 30, true, false);
            myContract.Repay(2, new DateTime(2006, 3, 1), 30, true, false);
            myContract.Repay(3, new DateTime(2006, 4, 1), 280, true, false);
            myContract.Repay(4, new DateTime(2006, 5, 1), 280, true, false);
            myContract.Repay(5, new DateTime(2006, 6, 1), 280, true, false);
            myContract.Repay(6, new DateTime(2006, 7, 1), 280, true, false);

            Assert.AreEqual(0, myContract.CalculatePastDueSinceLastRepayment(new DateTime(2005, 8, 7)));
        }
开发者ID:BillTheBest,项目名称:opencbs,代码行数:21,代码来源:TestCreditContract.cs

示例5: Repay_DecliningLoan_KeepNotExpectedInstallment_EntirlyPaid_NoCancelFees

        public void Repay_DecliningLoan_KeepNotExpectedInstallment_EntirlyPaid_NoCancelFees()
        {
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.CALCULATIONLATEFEESDURINGPUBLICHOLIDAYS, true);
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.ACCOUNTINGPROCESS, OAccountingProcesses.Accrual);

            LoanProduct package = new LoanProduct
            {
                InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
                LoanType = OLoanTypes.DecliningFixedInstallments,
                ChargeInterestWithinGracePeriod = true,
                KeepExpectedInstallment = false,
                Currency = new Currency { Id = 1, UseCents = true},
                RoundingType = ORoundingType.Approximate
            };
            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()))
                                  {
                                      NonRepaymentPenalties = { InitialAmount = 0.003 },
                                      AnticipatedTotalRepaymentPenalties = 0.003
                                  };
            //VPM => 218,3546
            myContract.Repay(1, new DateTime(2006, 2, 1), 30, true, false);
            RepaymentEvent repayEvent = myContract.Repay(2, new DateTime(2006, 3, 1), 1032.44m, false, false);

            _AssertSpecifiedEvent(repayEvent, 2.44m, 30.00m, 1000.00m);

            _AssertSpecifiedInstallment(myContract.GetInstallment(0), 1, new DateTime(2006, 2, 1), 30.00m, 0, 1000, 0, 30);
            _AssertSpecifiedInstallment(myContract.GetInstallment(1), 2, new DateTime(2006, 3, 1), 30.00m, 188.35m, 1000, 188.35m, 30);
            _AssertSpecifiedInstallment(myContract.GetInstallment(2), 3, new DateTime(2006, 4, 3), 0, 811.65m, 811.65m, 811.65m, 0);
            _AssertSpecifiedInstallment(myContract.GetInstallment(3), 4, new DateTime(2006, 5, 1), 0, 0, 0, 0, 0);
            _AssertSpecifiedInstallment(myContract.GetInstallment(4), 5, new DateTime(2006, 6, 1), 0, 0, 0, 0, 0);
            _AssertSpecifiedInstallment(myContract.GetInstallment(5), 6, new DateTime(2006, 7, 3), 0, 0, 0, 0, 0);
        }
开发者ID:BillTheBest,项目名称:opencbs,代码行数:32,代码来源:TestCreditContract.cs

示例6: TestRepayButRepaymentEventIsNull

        public void TestRepayButRepaymentEventIsNull()
        {
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.CALCULATIONLATEFEESDURINGPUBLICHOLIDAYS, true);

            LoanProduct package = new LoanProduct
                                      {
                                          InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
                                          LoanType = OLoanTypes.DecliningFixedInstallments,
                                          ChargeInterestWithinGracePeriod = true,
                                          Currency = new Currency { Id = 1 }
                                      };
            Loan myContract = new Loan(package, 1000, 0.03m, 7, 1, new DateTime(2006, 1, 1), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));

            RepaymentEvent rE = myContract.Repay(1, new DateTime(2006, 2, 1), 1032, true, false);
            Assert.IsNull(rE);

            RepaymentEvent rE2 = myContract.Repay(1, new DateTime(2006, 2, 1), 30, true, false);
            Assert.IsNotNull(rE2);
        }
开发者ID:BillTheBest,项目名称:opencbs,代码行数:19,代码来源:TestCreditContract.cs

示例7: TestContract9InstallmentsDecliningRateWhenLittleOverPaid

        public void TestContract9InstallmentsDecliningRateWhenLittleOverPaid()
        {
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.CALCULATIONLATEFEESDURINGPUBLICHOLIDAYS, true);

            LoanProduct package = new LoanProduct
                                      {
                                          InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
                                          LoanType = OLoanTypes.DecliningFixedInstallments,
                                          ChargeInterestWithinGracePeriod = true,
                                          Currency = new Currency { Id = 1 }
                                      };
            package.KeepExpectedInstallment = false;
            Loan myContract = new Loan(package,1500,0.03m,9,1,new DateTime(2006,1,1), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
            myContract.AnticipatedTotalRepaymentPenalties = 0.02;

            Assert.AreEqual(45m,myContract.GetInstallment(0).InterestsRepayment.Value);
            Assert.AreEqual(0,myContract.GetInstallment(0).CapitalRepayment.Value);
            Assert.AreEqual(new DateTime(2006,2,1),myContract.GetInstallment(0).ExpectedDate);

            RepaymentEvent rPE = myContract.Repay(1,new DateTime(2006,2,1),45m,false,false);
            Assert.AreEqual(45,myContract.GetInstallment(0).PaidInterests.Value);
            Assert.AreEqual(0,myContract.GetInstallment(0).PaidCapital.Value);
            Assert.AreEqual(0m,rPE.Fees.Value);
            Assert.AreEqual(45m,rPE.Interests.Value);
            Assert.AreEqual(0m,rPE.Principal.Value);
        }
开发者ID:BillTheBest,项目名称:opencbs,代码行数:26,代码来源:TestCreditContract.cs

示例8: TestCalculateMaximumAmountForExoticProductTypeForInstallment3

        public void TestCalculateMaximumAmountForExoticProductTypeForInstallment3()
        {
            LoanProduct package = new LoanProduct
                                      {
                                          InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
                                          LoanType = OLoanTypes.Flat,
                                          ChargeInterestWithinGracePeriod = true,
                                          Currency = new Currency { Id = 1 }
                                      };
            package.KeepExpectedInstallment = true;
            package.NonRepaymentPenalties.OLB = 0.01;
            Loan myContract = new Loan(package, 1000, 0.01m, 3, 0, new DateTime(2008, 12, 17), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
            myContract.Repay(1, new DateTime(2008, 12, 19), 103, true, true);
            myContract.Repay(2, new DateTime(2008, 12, 19), 618, true, true);

            OCurrency amountToRetreived = Math.Round(myContract.CalculateMaximumAmountAuthorizedToRepay(3, new DateTime(2007, 3, 28), false, 0, 0, false, 0, true, true).Value);

            Assert.AreEqual(310m, amountToRetreived.Value);
        }
开发者ID:BillTheBest,项目名称:opencbs,代码行数:19,代码来源:TestCreditContract.cs

示例9: TestCalculatePastDueSinceLastRepayment

        public void TestCalculatePastDueSinceLastRepayment()
        {
            LoanProduct package = new LoanProduct
                                      {
                                          InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
                                          LoanType = OLoanTypes.Flat,
                                          ChargeInterestWithinGracePeriod = true,
                                          KeepExpectedInstallment = false,
                                          Currency = new Currency { Id = 1 }
                                      };
            Loan myContract = new Loan(package, 1000, 0.03m, 6, 2, new DateTime(2006, 1, 1), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));

            //before repayment
            Assert.AreEqual(0, myContract.CalculatePastDueSinceLastRepayment(new DateTime(2006, 2, 1)));
            Assert.AreEqual(14, myContract.CalculatePastDueSinceLastRepayment(new DateTime(2006, 2, 15)));
            Assert.AreEqual(59, myContract.CalculatePastDueSinceLastRepayment(new DateTime(2006, 4, 1)));
            Assert.AreEqual(152, myContract.CalculatePastDueSinceLastRepayment(new DateTime(2006, 7, 3)));

            //partially repayment
            PaymentMethod paymentMethod = new PaymentMethod(1, "Cash", "", false);
            myContract.Repay(1, new DateTime(2006, 2, 1), 30, true, 0, 0, false, 0, false, false, false, paymentMethod);
            myContract.Repay(2, new DateTime(2006, 3, 6), 10, true, 0, 0, false, 0, false, false, false, paymentMethod);

            Assert.AreEqual(0, myContract.CalculatePastDueSinceLastRepayment(new DateTime(2006, 2, 1)));
            Assert.AreEqual(0, myContract.CalculatePastDueSinceLastRepayment(new DateTime(2006, 2, 15)));
            Assert.AreEqual(28, myContract.CalculatePastDueSinceLastRepayment(new DateTime(2006, 4, 3)));
            Assert.AreEqual(119, myContract.CalculatePastDueSinceLastRepayment(new DateTime(2006, 7, 3)));

            //totally repayment
            myContract.Repay(2, new DateTime(2006, 3, 6), 20, true, 0, 0, false, 0, false, false, false, paymentMethod);
            Assert.AreEqual(0, myContract.CalculatePastDueSinceLastRepayment(new DateTime(2006, 2, 1)));
            Assert.AreEqual(0, myContract.CalculatePastDueSinceLastRepayment(new DateTime(2006, 2, 15)));
            Assert.AreEqual(0, myContract.CalculatePastDueSinceLastRepayment(new DateTime(2006, 4, 3)));
            Assert.AreEqual(91, myContract.CalculatePastDueSinceLastRepayment(new DateTime(2006, 7, 3)));
        }
开发者ID:BillTheBest,项目名称:opencbs,代码行数:35,代码来源:TestCreditContract.cs

示例10: TestRepayFlateLoanWhenKeepNotExpectedInstallmentButEntirlyPaidButNoCancelFees

        public void TestRepayFlateLoanWhenKeepNotExpectedInstallmentButEntirlyPaidButNoCancelFees()
        {
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.CALCULATIONLATEFEESDURINGPUBLICHOLIDAYS, true);
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.ACCOUNTINGPROCESS, OAccountingProcesses.Accrual);
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.INTEREST_RATE_DECIMAL_PLACES, 2);

            LoanProduct package = new LoanProduct
                                      {
                                          InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
                                          LoanType = OLoanTypes.Flat,
                                          ChargeInterestWithinGracePeriod = true,
                                          Currency = new Currency {Id = 1, UseCents = true},
                                          KeepExpectedInstallment = false
                                      };
            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()))
                                  {
                                      NonRepaymentPenalties = {InitialAmount = 0.003},
                                      AnticipatedTotalRepaymentPenalties = 0.003
                                  };

            myContract.Repay(1, new DateTime(2006, 2, 1), 30, true, false);
            RepaymentEvent repayEvent = myContract.Repay(2, new DateTime(2006, 3, 1), 1032.4m, false, false);

            Assert.AreEqual(2.4m, repayEvent.Fees.Value);
            Assert.AreEqual(30, repayEvent.Interests.Value);
            Assert.AreEqual(1000, repayEvent.Principal.Value);

            Assert.AreEqual(30, myContract.GetInstallment(0).InterestsRepayment.Value);
            Assert.AreEqual(0, myContract.GetInstallment(0).CapitalRepayment.Value);
            Assert.AreEqual(1000, myContract.GetInstallment(0).OLB.Value);
            Assert.AreEqual(0, myContract.GetInstallment(0).PaidCapital.Value);
            Assert.AreEqual(30, myContract.GetInstallment(0).PaidInterests.Value);

            Assert.AreEqual(30, myContract.GetInstallment(1).InterestsRepayment.Value);
            Assert.AreEqual(200, myContract.GetInstallment(1).CapitalRepayment.Value);
            Assert.AreEqual(1000, myContract.GetInstallment(1).OLB.Value);
            Assert.AreEqual(200, myContract.GetInstallment(1).PaidCapital.Value);
            Assert.AreEqual(30, myContract.GetInstallment(1).PaidInterests.Value);

            Assert.AreEqual(0, myContract.GetInstallment(2).InterestsRepayment.Value);
            Assert.AreEqual(800, myContract.GetInstallment(2).CapitalRepayment.Value);
            Assert.AreEqual(800, myContract.GetInstallment(2).OLB.Value);
            Assert.AreEqual(800, myContract.GetInstallment(2).PaidCapital.Value);
            Assert.AreEqual(0, myContract.GetInstallment(2).PaidInterests.Value);

            Assert.AreEqual(0, myContract.GetInstallment(3).InterestsRepayment.Value);
            Assert.AreEqual(0, myContract.GetInstallment(3).CapitalRepayment.Value);
            Assert.AreEqual(0, myContract.GetInstallment(3).OLB.Value);
            Assert.AreEqual(0, myContract.GetInstallment(3).PaidCapital.Value);
            Assert.AreEqual(0, myContract.GetInstallment(3).PaidInterests.Value);

            Assert.AreEqual(0, myContract.GetInstallment(4).InterestsRepayment.Value);
            Assert.AreEqual(0, myContract.GetInstallment(4).CapitalRepayment.Value);
            Assert.AreEqual(0, myContract.GetInstallment(4).OLB.Value);
            Assert.AreEqual(0, myContract.GetInstallment(4).PaidCapital.Value);
            Assert.AreEqual(0, myContract.GetInstallment(4).PaidInterests.Value);

            Assert.AreEqual(0, myContract.GetInstallment(5).InterestsRepayment.Value);
            Assert.AreEqual(0, myContract.GetInstallment(5).CapitalRepayment.Value);
            Assert.AreEqual(0, myContract.GetInstallment(5).OLB.Value);
            Assert.AreEqual(0, myContract.GetInstallment(5).PaidCapital.Value);
            Assert.AreEqual(0, myContract.GetInstallment(5).PaidInterests.Value);
        }
开发者ID:BillTheBest,项目名称:opencbs,代码行数:65,代码来源:TestCreditContract.cs

示例11: InstallmentType

        public void TestRepayFlateLoanWhenKeepNotExpectedInstallmentButSecondInstallmentNotEntirlyPaidTheSecondInstallment()
        {
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.CALCULATIONLATEFEESDURINGPUBLICHOLIDAYS, true);

            LoanProduct package = new LoanProduct
                                      {
                                          InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
                                          LoanType = OLoanTypes.Flat,
                                          ChargeInterestWithinGracePeriod = true,
                                          Currency = new Currency { Id = 1 }
                                      };
            package.KeepExpectedInstallment = false;
            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.Repay(1, new DateTime(2006, 2, 1), 30, true, false);
            myContract.Repay(2, new DateTime(2006, 3, 1), 200, true, false);

            Assert.AreEqual(30m, myContract.GetInstallment(0).InterestsRepayment.Value);
            Assert.AreEqual(0m, myContract.GetInstallment(0).CapitalRepayment.Value);
            Assert.AreEqual(1000m, myContract.GetInstallment(0).OLB.Value);
            Assert.AreEqual(0m, myContract.GetInstallment(0).PaidCapital.Value);
            Assert.AreEqual(30m, myContract.GetInstallment(0).PaidInterests.Value);

            Assert.AreEqual(30m, myContract.GetInstallment(1).InterestsRepayment.Value);
            Assert.AreEqual(200m, myContract.GetInstallment(1).CapitalRepayment.Value);
            Assert.AreEqual(1000m, myContract.GetInstallment(1).OLB.Value);
            Assert.AreEqual(170m, myContract.GetInstallment(1).PaidCapital.Value);
            Assert.AreEqual(30m, myContract.GetInstallment(1).PaidInterests.Value);

            Assert.AreEqual(30m, myContract.GetInstallment(2).InterestsRepayment.Value);
            Assert.AreEqual(200m, myContract.GetInstallment(2).CapitalRepayment.Value);
            Assert.AreEqual(800m, myContract.GetInstallment(2).OLB.Value);
            Assert.AreEqual(0m, myContract.GetInstallment(2).PaidCapital.Value);
            Assert.AreEqual(0m, myContract.GetInstallment(2).PaidInterests.Value);
        }
开发者ID:BillTheBest,项目名称:opencbs,代码行数:35,代码来源:TestCreditContract.cs

示例12: TestRepayFlateLoanWhenKeepExpectedInstallmentButSecondInstallmentNotEntirlyPaidTheSecondInstallment

        public void TestRepayFlateLoanWhenKeepExpectedInstallmentButSecondInstallmentNotEntirlyPaidTheSecondInstallment()
        {
            LoanProduct package = new LoanProduct
                                      {
                                          InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
                                          LoanType = OLoanTypes.Flat,
                                          ChargeInterestWithinGracePeriod = true,
                                          Currency = new Currency { Id = 1 }
                                      };
            package.KeepExpectedInstallment = true;
            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.Repay(1, new DateTime(2006, 2, 1), 30, true, false);
            myContract.Repay(2, new DateTime(2006, 3, 1), 200, true, false);

            _AssertSpecifiedInstallment(myContract.GetInstallment(0), 1, new DateTime(2006, 2, 1), 30, 0, 1000, 0, 30);
            _AssertSpecifiedInstallment(myContract.GetInstallment(1), 2, new DateTime(2006, 3, 1), 30, 200, 1000, 170, 30);
            _AssertSpecifiedInstallment(myContract.GetInstallment(2), 3, new DateTime(2006, 4, 3), 30, 200, 800, 0, 0);
            _AssertSpecifiedInstallment(myContract.GetInstallment(3), 4, new DateTime(2006, 5, 1), 30, 200, 600, 0, 0);
            _AssertSpecifiedInstallment(myContract.GetInstallment(4), 5, new DateTime(2006, 6, 1), 30, 200, 400, 0, 0);
            _AssertSpecifiedInstallment(myContract.GetInstallment(5), 6, new DateTime(2006, 7, 3), 30, 200, 200, 0, 0);
        }
开发者ID:BillTheBest,项目名称:opencbs,代码行数:22,代码来源:TestCreditContract.cs

示例13: TestRepayFlateLoanWhenKeepNotExpectedInstallmentAndOverPaid

        public void TestRepayFlateLoanWhenKeepNotExpectedInstallmentAndOverPaid()
        {
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.CALCULATIONLATEFEESDURINGPUBLICHOLIDAYS, true);
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.ACCOUNTINGPROCESS, OAccountingProcesses.Accrual);

            LoanProduct package = new LoanProduct
                                      {
                                          InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
                                          LoanType = OLoanTypes.Flat,
                                          ChargeInterestWithinGracePeriod = true,
                                          Currency = new Currency { Id = 1 }
                                      };
            package.KeepExpectedInstallment = false;
            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.Repay(1, new DateTime(2006, 2, 1), 30, true, false);
            RepaymentEvent rE = myContract.Repay(2, new DateTime(2006, 3, 1), 430, true, false);

            Assert.AreEqual(0, rE.Fees.Value);
            Assert.AreEqual(30, rE.Interests.Value);
            Assert.AreEqual(400, rE.Principal.Value);

            _AssertSpecifiedInstallment(myContract.GetInstallment(0), 30, 0, 1000, 0, 30);
            _AssertSpecifiedInstallment(myContract.GetInstallment(1), 30, 200, 1000, 200, 30);
            _AssertSpecifiedInstallment(myContract.GetInstallment(2), 18, 150, 600, 0, 0);
            _AssertSpecifiedInstallment(myContract.GetInstallment(3), 18, 150, 450, 0, 0);
            _AssertSpecifiedInstallment(myContract.GetInstallment(4), 18, 150, 300, 0, 0);
            _AssertSpecifiedInstallment(myContract.GetInstallment(5), 18, 150, 150, 0, 0);
        }
开发者ID:BillTheBest,项目名称:opencbs,代码行数:29,代码来源:TestCreditContract.cs

示例14: TestRepayEventCorrectlyGenerateWhenTenDaysLateAndPayFees

        public void TestRepayEventCorrectlyGenerateWhenTenDaysLateAndPayFees()
        {
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.CALCULATIONLATEFEESDURINGPUBLICHOLIDAYS, true);
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.STOP_WRITEOFF_PENALTY, true);

            LoanProduct package = new LoanProduct
                                      {
                                          InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
                                          LoanType = OLoanTypes.Flat,
                                          ChargeInterestWithinGracePeriod = true,
                                          Currency = new Currency { Id = 1 }
                                      };
            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.NonRepaymentPenalties.OLB = 0.003;

            Assert.AreEqual(new DateTime(2006, 2, 1), myContract.GetInstallment(0).ExpectedDate);
            Assert.AreEqual(new DateTime(2006, 3, 1), myContract.GetInstallment(1).ExpectedDate);

            myContract.Repay(1, new DateTime(2006, 2, 1), 30, true, false);

            RepaymentEvent rPE = myContract.Repay(2, new DateTime(2006, 3, 11), 230.41m, false, false);

            Assert.AreEqual(30m, rPE.Fees.Value);
            Assert.AreEqual(30m, rPE.Interests.Value);
            Assert.AreEqual(170.41m, rPE.Principal.Value);
        }
开发者ID:BillTheBest,项目名称:opencbs,代码行数:26,代码来源:TestCreditContract.cs

示例15: TestRepayEventCorrectlyGeneratedWithThirdInstallmentFlatRateWithOverPaid

        public void TestRepayEventCorrectlyGeneratedWithThirdInstallmentFlatRateWithOverPaid()
        {
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.CALCULATIONLATEFEESDURINGPUBLICHOLIDAYS, true);
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.ACCOUNTINGPROCESS, OAccountingProcesses.Accrual);

            LoanProduct package = new LoanProduct
                                      {
                                          InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
                                          LoanType = OLoanTypes.Flat,
                                          ChargeInterestWithinGracePeriod = true,
                                          Currency = new Currency { Id = 1 }
                                      };
            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.AnticipatedTotalRepaymentPenalties = 0.01;
            myContract.AnticipatedPartialRepaymentPenalties = 0.01;

            myContract.Repay(1, new DateTime(2006, 2, 1), 30m, false, false);
            myContract.Repay(2, new DateTime(2006, 3, 1), 230m, false, false);
            RepaymentEvent rPE = myContract.Repay(3, new DateTime(2006, 4, 3), 530m, false, false);

            Assert.AreEqual(6, rPE.Fees.Value);
            Assert.AreEqual(30, rPE.Interests.Value);
            Assert.AreEqual(494, rPE.Principal.Value);
        }
开发者ID:BillTheBest,项目名称:opencbs,代码行数:25,代码来源:TestCreditContract.cs


注:本文中的OpenCBS.CoreDomain.Contracts.Loans.Loan.Repay方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。