Search in sources :

Example 16 with DisburseLoanParameters

use of org.mifos.test.acceptance.framework.loan.DisburseLoanParameters in project head by mifos.

the class CreateClientLoanAccountTest method getLoanStatusActive.

private void getLoanStatusActive(String loanId) {
    EditLoanAccountStatusParameters editLoanAccountStatusParameters = new EditLoanAccountStatusParameters();
    editLoanAccountStatusParameters.setStatus(EditLoanAccountStatusParameters.APPROVED);
    editLoanAccountStatusParameters.setNote("test");
    loanTestHelper.changeLoanAccountStatus(loanId, editLoanAccountStatusParameters);
    DisburseLoanParameters disburseParameters = new DisburseLoanParameters();
    disburseParameters.setPaymentType(DisburseLoanParameters.CASH);
    disburseParameters.setDisbursalDateDD("01");
    disburseParameters.setDisbursalDateMM("02");
    disburseParameters.setDisbursalDateYYYY("2011");
    //Then
    loanTestHelper.disburseLoan(loanId, disburseParameters);
}
Also used : EditLoanAccountStatusParameters(org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters) DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters)

Example 17 with DisburseLoanParameters

use of org.mifos.test.acceptance.framework.loan.DisburseLoanParameters in project head by mifos.

the class CreateGLIMLoanAccountTest method checkGLIMIndividualSchedule.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(enabled = true)
public void checkGLIMIndividualSchedule() throws Exception {
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2011, 03, 1, 13, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    searchParameters.setSearchString("Default Group");
    searchParameters.setLoanProduct("WeeklyGroupFlatLoanWithOnetimeFee");
    CreateLoanAccountEntryPage loanAccountEntryPage = loanTestHelper.navigateToCreateLoanAccountEntryPage(searchParameters);
    loanAccountEntryPage.selectGLIMClients(0, "Stu1233266299995 Client1233266299995 Client Id: 0002-000000012", "9999", "0012-Sheep Purchase");
    loanAccountEntryPage.selectGLIMClients(1, "Stu1233266309851 Client1233266309851 Client Id: 0002-000000013", "99999");
    loanAccountEntryPage.selectGLIMClients(2, "Stu1233266319760 Client1233266319760 Client Id: 0002-000000014", "99999");
    LoanAccountPage loanAccountPage = loanAccountEntryPage.navigateToReviewInstallmentsPage().clickPreviewAndGoToReviewLoanAccountPage().submitForApprovalAndNavigateToConfirmationPage().navigateToLoanAccountDetailsPage();
    loanAccountPage.verifyGLIMIndividualScheduleLinks(3, true);
    EditLoanAccountStatusParameters statusParams = new EditLoanAccountStatusParameters();
    statusParams.setNote("GLIM test");
    statusParams.setStatus(EditLoanAccountStatusParameters.APPROVED);
    loanAccountPage.changeAccountStatus(statusParams);
    loanAccountPage.verifyGLIMIndividualScheduleLinks(3, true);
    String loanId = loanAccountPage.getAccountId();
    dateTimeUpdaterRemoteTestingService.setDateTime(new LocalDate(2011, 3, 8).toDateTimeAtStartOfDay());
    loanAccountPage = navigationHelper.navigateToLoanAccountPage(loanId);
    DisburseLoanParameters disburseParams = new DisburseLoanParameters();
    disburseParams.setAmount("209997.0");
    disburseParams.setDisbursalDateDD("8");
    disburseParams.setDisbursalDateMM("3");
    disburseParams.setDisbursalDateYYYY("2011");
    disburseParams.setPaymentType(DisburseLoanParameters.CASH);
    loanAccountPage.disburseLoan(disburseParams);
    loanAccountPage.verifyGLIMIndividualScheduleLinks(3, false);
    totalGroupLoanEqualSumOfindividual(loanAccountPage, 3, 1.0);
    PaymentParameters paymentParams = new PaymentParameters();
    paymentParams.setAmount("1500.0");
    paymentParams.setTransactionDateDD("8");
    paymentParams.setTransactionDateMM("3");
    paymentParams.setTransactionDateYYYY("2011");
    paymentParams.setPaymentType(PaymentParameters.CASH);
    loanTestHelper.applyPayment(loanId, paymentParams);
    loanAccountPage.verifyGLIMIndividualScheduleLinks(3, false);
    totalGroupLoanEqualSumOfindividual(loanAccountPage, 3, 1.0);
    loanAccountPage.navigateToApplyAdjustment().fillAdjustmentFieldsWithoutRevertingAndSubmit("1500.0");
    loanAccountPage.verifyGLIMIndividualScheduleLinks(3, false);
    totalGroupLoanEqualSumOfindividual(loanAccountPage, 3, 1.0);
    String[] expectedPrincipalAmounts = new String[] { "24.9", "249.2", "249.3" };
    String[] expectedInterestAmounts = new String[] { "46", "460.3", "460.3" };
    String[] expectedFeeAmounts = new String[] { "0.5", "4.8", "4.7" };
    verifyProRatedGLIMPayments(loanAccountPage, 3, expectedPrincipalAmounts, expectedInterestAmounts, expectedFeeAmounts);
    loanTestHelper.repayLoan(loanId);
    loanAccountPage.verifyGLIMIndividualScheduleLinks(3, false);
    totalGroupLoanEqualSumOfindividual(loanAccountPage, 3, 1.0);
    loanAccountPage.navigateToApplyAdjustment().submitAdjustment();
    loanAccountPage.verifyGLIMIndividualScheduleLinks(3, false);
    totalGroupLoanEqualSumOfindividual(loanAccountPage, 3, 1.0);
    statusParams.setNote("GLIM test");
    statusParams.setStatus(EditLoanAccountStatusParameters.CLOSED_WRITTEN_OFF);
    loanAccountPage.changeAccountStatus(statusParams);
    loanAccountPage.verifyGLIMIndividualScheduleLinks(3, false);
    totalGroupLoanEqualSumOfindividual(loanAccountPage, 3, 1.0);
}
Also used : EditLoanAccountStatusParameters(org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters) DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters) CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) EditPreviewLoanAccountPage(org.mifos.test.acceptance.framework.loan.EditPreviewLoanAccountPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) LocalDate(org.joda.time.LocalDate) DateTime(org.joda.time.DateTime) CreateLoanAccountEntryPage(org.mifos.test.acceptance.framework.loan.CreateLoanAccountEntryPage) PaymentParameters(org.mifos.test.acceptance.framework.loan.PaymentParameters) Test(org.testng.annotations.Test)

Example 18 with DisburseLoanParameters

use of org.mifos.test.acceptance.framework.loan.DisburseLoanParameters in project head by mifos.

the class GuarantyCoreTest method createAndDisburseGroupLoan.

public void createAndDisburseGroupLoan() throws Exception {
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2013, 04, 9, 13, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    CreateLoanAccountSearchParameters searchParameters = new CreateLoanAccountSearchParameters();
    searchParameters.setSearchString("Default Group");
    searchParameters.setLoanProduct("WeeklyGroupFlatLoanWithOnetimeFee");
    List<GLIMClient> glimClients = new ArrayList<GLIMClient>();
    glimClients.add(new GLIMClient(0, "Stu1233266299995 Client1233266299995 Client Id: 0002-000000012", "1000", null));
    glimClients.add(new GLIMClient(1, "Stu1233266309851 Client1233266309851 Client Id: 0002-000000013", "100", null));
    LoanAccountPage loanAccountPage = loanTestHelper.createGroupLoanAccount(searchParameters, glimClients);
    String loanId = loanAccountPage.getAccountId();
    EditLoanAccountStatusParameters statusParameters = new EditLoanAccountStatusParameters();
    statusParameters.setStatus(EditLoanAccountStatusParameters.APPROVED);
    statusParameters.setNote("Test apply Guaranty");
    loanTestHelper.changeLoanAccountStatus(loanId, statusParameters);
    DisburseLoanParameters disburseParams = new DisburseLoanParameters();
    disburseParams.setDisbursalDateDD("09");
    disburseParams.setDisbursalDateMM("04");
    disburseParams.setDisbursalDateYYYY("2013");
    disburseParams.setPaymentType(DisburseLoanParameters.CASH);
    loanAccountPage = loanAccountPage.disburseLoan(disburseParams);
    verifyGuarantyGroupIndividualLoan(loanAccountPage);
}
Also used : EditLoanAccountStatusParameters(org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters) DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters) CreateLoanAccountSearchParameters(org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters) ArrayList(java.util.ArrayList) GLIMClient(org.mifos.test.acceptance.framework.loan.GLIMClient) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) DateTimeUpdaterRemoteTestingService(org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService) DateTime(org.joda.time.DateTime)

Example 19 with DisburseLoanParameters

use of org.mifos.test.acceptance.framework.loan.DisburseLoanParameters in project head by mifos.

the class RemovePenaltiesTest method shouldRemovePenaltyBeforeDisbursal.

@Test(enabled = true)
public void shouldRemovePenaltyBeforeDisbursal() throws Exception {
    final String accountId = setUpPenaltyAndLoanAccount(false, PenaltyFormParameters.FREQUENCY_NONE);
    LoanAccountPage loanAccountPage = navigationHelper.navigateToLoanAccountPage(accountId);
    loanAccountPage.removeOneTimePenalty(1);
    loanAccountPage.verifyNoOneTimePenaltyRemovalLinkExists(1);
    final DisburseLoanParameters disburseParams = new DisburseLoanParameters();
    disburseParams.setAmount(loanAccountPage.getOriginalTotalAmount());
    disburseParams.setDisbursalDateDD("15");
    disburseParams.setDisbursalDateMM("2");
    disburseParams.setDisbursalDateYYYY("2012");
    disburseParams.setPaymentType(DisburseLoanParameters.CASH);
    loanAccountPage.changeAccountStatusToAccepted().disburseLoan(disburseParams);
    changeDateTime(04, 1);
    verifyCalculatePenaltyWithoutPenalty(accountId);
}
Also used : DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters) LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) Test(org.testng.annotations.Test)

Example 20 with DisburseLoanParameters

use of org.mifos.test.acceptance.framework.loan.DisburseLoanParameters in project head by mifos.

the class AdditionalHolidayTest method testHolidayLoanDisbursement.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void testHolidayLoanDisbursement() throws Exception {
    DateTime targetTime = new DateTime(2020, 8, 9, 0, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    String officeName = "MyOfficeDHMFT";
    String loanId = "000100000000035";
    CreateHolidaySubmitParameters holidayParams = new CreateHolidayEntryPage.CreateHolidaySubmitParameters();
    holidayParams.setName("Holiday" + StringUtil.getRandomString(8));
    holidayParams.setFromDateDD("16");
    holidayParams.setFromDateMM("08");
    holidayParams.setFromDateYYYY("2020");
    holidayParams.setRepaymentRule(CreateHolidaySubmitParameters.MORATORIUM);
    holidayParams.addOffice(officeName);
    holidayTestHelper.createHoliday(holidayParams);
    DateTime targetTime1 = new DateTime(2020, 8, 16, 0, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime1);
    DisburseLoanParameters disburseParams = new DisburseLoanParameters();
    disburseParams.setDisbursalDateDD("16");
    disburseParams.setDisbursalDateMM("08");
    disburseParams.setDisbursalDateYYYY("2020");
    disburseParams.setPaymentType(DisburseLoanParameters.CASH);
    loanTestHelper.prepareToDisburseLoan(loanId).submitAndNavigateToDisburseLoanConfirmationPage(disburseParams).submitButDisbursalFailed("Disbursement date must be on a working day.");
}
Also used : DisburseLoanParameters(org.mifos.test.acceptance.framework.loan.DisburseLoanParameters) CreateHolidaySubmitParameters(org.mifos.test.acceptance.framework.holiday.CreateHolidayEntryPage.CreateHolidaySubmitParameters) DateTime(org.joda.time.DateTime)

Aggregations

DisburseLoanParameters (org.mifos.test.acceptance.framework.loan.DisburseLoanParameters)40 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)29 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)26 DateTime (org.joda.time.DateTime)15 DefineNewLoanProductPage (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage)14 Test (org.testng.annotations.Test)14 SubmitFormParameters (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage.SubmitFormParameters)13 EditLoanAccountStatusParameters (org.mifos.test.acceptance.framework.loan.EditLoanAccountStatusParameters)11 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)10 LoanProductDetailsPage (org.mifos.test.acceptance.framework.loanproduct.LoanProductDetailsPage)8 PaymentParameters (org.mifos.test.acceptance.framework.loan.PaymentParameters)7 ViewRepaymentSchedulePage (org.mifos.test.acceptance.framework.loan.ViewRepaymentSchedulePage)6 CreateLoanAccountEntryPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountEntryPage)5 EditPreviewLoanAccountPage (org.mifos.test.acceptance.framework.loan.EditPreviewLoanAccountPage)5 CreateLoanAccountSubmitParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSubmitParameters)4 HashMap (java.util.HashMap)3 CreateLoanAccountConfirmationPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountConfirmationPage)3 CreateLoanAccountPreviewPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountPreviewPage)3 CreateLoanAccountReviewInstallmentPage (org.mifos.test.acceptance.framework.loan.CreateLoanAccountReviewInstallmentPage)3 ArrayList (java.util.ArrayList)2