Search in sources :

Example 11 with ChargeParameters

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

the class AdditionalHolidayTest method testHolidayAffectsFeeSchedule.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public // http://mifosforge.jira.com/browse/MIFOSTEST-281
void testHolidayAffectsFeeSchedule() throws Exception {
    DateTime targetTime = new DateTime(2009, 3, 11, 0, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    // Given
    ChargeParameters chargeParameters = new ChargeParameters();
    String officeName = "MyOfficeDHMFT";
    String centerName = "Default Center";
    String groupName = "Default Group";
    String clientName = "Holiday TestClient";
    String loanId = "000100000000035";
    CreateHolidaySubmitParameters params = new CreateHolidayEntryPage.CreateHolidaySubmitParameters();
    params.setName("Holiday" + StringUtil.getRandomString(8));
    params.setFromDateDD("16");
    params.setFromDateMM("03");
    params.setFromDateYYYY("2009");
    params.setRepaymentRule(CreateHolidaySubmitParameters.MORATORIUM);
    params.addOffice(officeName);
    // When
    chargeParameters.setType("Misc Fees");
    chargeParameters.setAmount("100");
    centerTestHelper.applyCharge(centerName, chargeParameters);
    String centerAmount = navigationHelper.navigateToCenterViewDetailsPage(centerName).getAmountDue();
    chargeParameters.setType("Misc Fees");
    chargeParameters.setAmount("100");
    groupTestHelper.applyCharge(groupName, chargeParameters);
    String groupAmount = navigationHelper.navigateToGroupViewDetailsPage(groupName).getAmountDue();
    chargeParameters.setType("Misc Fees");
    chargeParameters.setAmount("100");
    clientTestHelper.applyCharge(clientName, chargeParameters);
    String clientAmount = navigationHelper.navigateToClientViewDetailsPage(clientName).getAmountDue();
    chargeParameters.setType("loanWeeklyFee");
    chargeParameters.setAmount("100");
    loanTestHelper.applyChargeUsingFeeLabel(loanId, chargeParameters);
    holidayTestHelper.createHoliday(params);
    navigationHelper.navigateToAdminPage();
    applicationDatabaseOperation.cleanBatchJobTables();
    List<String> jobsToRun = new ArrayList<String>();
    jobsToRun.add("ApplyHolidayChangesTaskJob");
    new BatchJobHelper(selenium).runSomeBatchJobs(jobsToRun);
    targetTime = new DateTime(2009, 3, 17, 0, 0, 0, 0);
    dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
    navigationHelper.navigateToCenterViewDetailsPage(centerName).verifyAmountDue(centerAmount);
    navigationHelper.navigateToGroupViewDetailsPage(groupName).verifyAmountDue(groupAmount);
    navigationHelper.navigateToClientViewDetailsPage(clientName).verifyAmountDue(clientAmount);
    navigationHelper.navigateToLoanAccountPage(loanId).navigateToRepaymentSchedulePage().verifyScheduleNotContainDate("16-Mar-2009");
}
Also used : BatchJobHelper(org.mifos.test.acceptance.framework.testhelpers.BatchJobHelper) ArrayList(java.util.ArrayList) CreateHolidaySubmitParameters(org.mifos.test.acceptance.framework.holiday.CreateHolidayEntryPage.CreateHolidaySubmitParameters) DateTime(org.joda.time.DateTime) ChargeParameters(org.mifos.test.acceptance.framework.loan.ChargeParameters)

Example 12 with ChargeParameters

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

the class LoanTestHelper method applyCharge.

public LoanAccountPage applyCharge(String feeName, String amount) {
    ChargeParameters chargeParameters = new ChargeParameters();
    chargeParameters.setType(feeName);
    chargeParameters.setAmount(amount);
    return new LoanAccountPage(selenium).navigateToApplyCharge().submitAndNavigateToApplyChargeConfirmationPage(chargeParameters);
}
Also used : LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) EditPreviewLoanAccountPage(org.mifos.test.acceptance.framework.loan.EditPreviewLoanAccountPage) ChargeParameters(org.mifos.test.acceptance.framework.loan.ChargeParameters)

Example 13 with ChargeParameters

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

the class ApplyChargeGroupLoanTest method applyMiscPenalty.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void applyMiscPenalty() throws Exception {
    DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
    DateTime targetTime = new DateTime(2013, 02, 8, 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", "1500", null));
    glimClients.add(new GLIMClient(2, "Stu1233266319760 Client1233266319760 Client Id: 0002-000000014", "1500", null));
    LoanAccountPage loanAccountPage = loanTestHelper.createGroupLoanAccount(searchParameters, glimClients);
    String loanId = loanAccountPage.getAccountId();
    String penaltyAmount = "100";
    List<String> individualPenaltyAmounts = new ArrayList<String>();
    individualPenaltyAmounts.add("20");
    individualPenaltyAmounts.add("80");
    ChargeParameters params = new ChargeParameters();
    params.setType(ChargeParameters.MISC_PENALTY);
    params.setAmount(penaltyAmount);
    params.setGroupLoanIndividualAmounts(individualPenaltyAmounts);
    loanAccountPage = loanTestHelper.applyChargeToGroupLoan(loanId, params);
    verifyPenaltySummaryAndActivity(loanAccountPage, penaltyAmount, "Misc penalty applied", 2);
    verifyRepaymentSchedulePage(loanAccountPage, penaltyAmount);
    for (int i = 0; i < glimClients.size(); i++) {
        LoanAccountPage individualLoanAccountPage = loanAccountPage.navigateToIndividualLoanAccountPageFromPendingApprovalGroupLoan(i);
        verifyPenaltySummaryAndActivity(individualLoanAccountPage, individualPenaltyAmounts.get(i), "Misc penalty applied", 2);
        verifyRepaymentSchedulePage(individualLoanAccountPage, individualPenaltyAmounts.get(i));
        individualLoanAccountPage.navigateToGroupLoanPageFromIndividualLoanPage();
    }
}
Also used : 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) ChargeParameters(org.mifos.test.acceptance.framework.loan.ChargeParameters)

Example 14 with ChargeParameters

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

the class ViewOriginalLoanScheduleTest method createLoanAccount.

private void createLoanAccount(DateTime creationDisbursalDate, DateTime actualDisbursalDate, boolean needApplyFee) throws UnsupportedEncodingException {
    navigationHelper.navigateToHomePage();
    loanTestHelper.navigateToCreateLoanAccountEntryPageWithoutLogout(setLoanSearchParameters()).setDisbursalDate(creationDisbursalDate).clickContinue().clickPreviewAndGoToReviewLoanAccountPage().submit().navigateToLoanAccountDetailsPage();
    if (needApplyFee) {
        ChargeParameters chargeParameters = new ChargeParameters();
        chargeParameters.setType(feeName);
        new LoanAccountPage(selenium).navigateToApplyCharge().applyFeeAndConfirm(chargeParameters);
    }
    loanTestHelper.applyCharge(ChargeParameters.MISC_FEES, "10");
    loanTestHelper.applyCharge(ChargeParameters.MISC_PENALTY, "10");
    loanTestHelper.approveLoan();
    loanTestHelper.disburseLoan(actualDisbursalDate);
}
Also used : LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) ChargeParameters(org.mifos.test.acceptance.framework.loan.ChargeParameters)

Example 15 with ChargeParameters

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

the class ViewOriginalLoanScheduleTest method verifyForDecBalIntReCalcLoanEarlyDisbursalLSIMOn.

@Test(enabled = true)
// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void verifyForDecBalIntReCalcLoanEarlyDisbursalLSIMOn() throws Exception {
    int interestType = DefineNewLoanProductPage.SubmitFormParameters.DECLINING_BALANCE_INTEREST_RECALCULATION;
    applicationDatabaseOperation.updateLSIM(1);
    createLoanProduct(interestType, false);
    navigationHelper.navigateToHomePage();
    loanTestHelper.navigateToCreateLoanAccountEntryPageWithoutLogout(setLoanSearchParameters()).setDisbursalDate(systemDateTime.plusDays(1)).clickContinue().clickPreviewAndGoToReviewLoanAccountPage().submit().navigateToLoanAccountDetailsPage();
    ChargeParameters chargeParameters = new ChargeParameters();
    chargeParameters.setType(feeName);
    new LoanAccountPage(selenium).navigateToApplyCharge().applyFeeAndConfirm(chargeParameters);
    loanTestHelper.applyCharge(ChargeParameters.MISC_FEES, "10");
    loanTestHelper.applyCharge(ChargeParameters.MISC_PENALTY, "10");
    loanTestHelper.approveLoan();
    loanTestHelper.disburseLoan(systemDateTime);
    String[][] tableOnOriginalInstallment = OriginalScheduleData.DEC_BAL_INT_RECALC_LOAN_EARLY_DISBURSAL_SCHEDULE_ON;
    verifyOriginalSchedule(tableOnOriginalInstallment);
    loanTestHelper.applyCharge(ChargeParameters.MISC_FEES, "10");
    loanTestHelper.applyCharge(ChargeParameters.MISC_PENALTY, "10");
    verifyOriginalSchedule(tableOnOriginalInstallment);
    loanTestHelper.makePayment(systemDateTime.plusDays(15), "100");
    verifyOriginalSchedule(tableOnOriginalInstallment);
    //        loanTestHelper.applyCharge(ChargeParameters.MISC_FEES, "10");
    //        loanTestHelper.applyCharge(ChargeParameters.MISC_PENALTY, "10");
    //        verifyOriginalSchedule(tableOnOriginalInstallment);
    applicationDatabaseOperation.updateLSIM(0);
}
Also used : LoanAccountPage(org.mifos.test.acceptance.framework.loan.LoanAccountPage) ChargeParameters(org.mifos.test.acceptance.framework.loan.ChargeParameters) Test(org.testng.annotations.Test)

Aggregations

ChargeParameters (org.mifos.test.acceptance.framework.loan.ChargeParameters)15 LoanAccountPage (org.mifos.test.acceptance.framework.loan.LoanAccountPage)8 DateTime (org.joda.time.DateTime)6 CreateLoanAccountSearchParameters (org.mifos.test.acceptance.framework.loan.CreateLoanAccountSearchParameters)5 PaymentParameters (org.mifos.test.acceptance.framework.loan.PaymentParameters)3 NavigationHelper (org.mifos.test.acceptance.framework.testhelpers.NavigationHelper)3 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)3 Test (org.testng.annotations.Test)3 ArrayList (java.util.ArrayList)2 ApplyPaymentConfirmationPage (org.mifos.test.acceptance.framework.loan.ApplyPaymentConfirmationPage)2 DisburseLoanParameters (org.mifos.test.acceptance.framework.loan.DisburseLoanParameters)2 CreateCenterEnterDataPage (org.mifos.test.acceptance.framework.center.CreateCenterEnterDataPage)1 MeetingParameters (org.mifos.test.acceptance.framework.center.MeetingParameters)1 ViewCenterChargesDetailPage (org.mifos.test.acceptance.framework.center.ViewCenterChargesDetailPage)1 ApplyChargesPage (org.mifos.test.acceptance.framework.client.ApplyChargesPage)1 CreateHolidaySubmitParameters (org.mifos.test.acceptance.framework.holiday.CreateHolidayEntryPage.CreateHolidaySubmitParameters)1 ApplyPaymentPage (org.mifos.test.acceptance.framework.loan.ApplyPaymentPage)1 EditPreviewLoanAccountPage (org.mifos.test.acceptance.framework.loan.EditPreviewLoanAccountPage)1 GLIMClient (org.mifos.test.acceptance.framework.loan.GLIMClient)1 DefineNewLoanProductPage (org.mifos.test.acceptance.framework.loanproduct.DefineNewLoanProductPage)1