Example usage for org.joda.time LocalDate toDate

List of usage examples for org.joda.time LocalDate toDate

Introduction

In this page you can find the example usage for org.joda.time LocalDate toDate.

Prototype

@SuppressWarnings("deprecation")
public Date toDate() 

Source Link

Document

Get the date time as a java.util.Date.

Usage

From source file:com.gst.portfolio.loanaccount.domain.LoanOfficerAssignmentHistory.java

License:Apache License

public static LoanOfficerAssignmentHistory createNew(final Loan loan, final Staff loanOfficer,
        final LocalDate startDate) {
    return new LoanOfficerAssignmentHistory(loan, loanOfficer, startDate.toDate(), null);
}

From source file:com.gst.portfolio.loanaccount.domain.LoanRepaymentScheduleInstallment.java

License:Apache License

public LoanRepaymentScheduleInstallment(final Loan loan, final Integer installmentNumber,
        final LocalDate fromDate, final LocalDate dueDate, final BigDecimal principal,
        final BigDecimal interest, final BigDecimal feeCharges, final BigDecimal penaltyCharges,
        final boolean recalculatedInterestComponent,
        final Set<LoanInterestRecalcualtionAdditionalDetails> compoundingDetails) {
    this.loan = loan;
    this.installmentNumber = installmentNumber;
    this.fromDate = fromDate.toDateTimeAtStartOfDay().toDate();
    this.dueDate = dueDate.toDateTimeAtStartOfDay().toDate();
    this.principal = defaultToNullIfZero(principal);
    this.interestCharged = defaultToNullIfZero(interest);
    this.feeChargesCharged = defaultToNullIfZero(feeCharges);
    this.penaltyCharges = defaultToNullIfZero(penaltyCharges);
    this.obligationsMet = false;
    this.recalculatedInterestComponent = recalculatedInterestComponent;
    this.loanCompoundingDetails = compoundingDetails;
}

From source file:com.gst.portfolio.loanaccount.domain.LoanRepaymentScheduleInstallment.java

License:Apache License

public void updateDerivedFields(final MonetaryCurrency currency, final LocalDate actualDisbursementDate) {
    if (!this.obligationsMet && getTotalOutstanding(currency).isZero()) {
        this.obligationsMet = true;
        this.obligationsMetOnDate = actualDisbursementDate.toDate();
    }/*from  ww  w.j a va  2s  . c om*/
}

From source file:com.gst.portfolio.loanaccount.domain.LoanRepaymentScheduleInstallment.java

License:Apache License

private void checkIfRepaymentPeriodObligationsAreMet(final LocalDate transactionDate,
        final MonetaryCurrency currency) {
    this.obligationsMet = getTotalOutstanding(currency).isZero();
    if (this.obligationsMet) {
        this.obligationsMetOnDate = transactionDate.toDate();
    } else {//www .j a v a2s  . c  om
        this.obligationsMetOnDate = null;
    }
}

From source file:com.gst.portfolio.loanaccount.domain.LoanRepaymentScheduleInstallment.java

License:Apache License

public void updateDueDate(final LocalDate newDueDate) {
    if (newDueDate != null) {
        this.dueDate = newDueDate.toDate();
    }/*from  www  .j a v  a2  s.  c  om*/
}

From source file:com.gst.portfolio.loanaccount.domain.LoanRepaymentScheduleInstallment.java

License:Apache License

public void updateFromDate(final LocalDate newFromDate) {
    if (newFromDate != null) {
        this.fromDate = newFromDate.toDate();
    }//from  w w w.ja v a2  s. co m
}

From source file:com.gst.portfolio.loanaccount.domain.LoanRepaymentScheduleInstallment.java

License:Apache License

public void updateObligationMetOnDate(final LocalDate obligationsMetOnDate) {
    this.obligationsMetOnDate = (obligationsMetOnDate != null) ? obligationsMetOnDate.toDate() : null;
}

From source file:com.gst.portfolio.loanaccount.domain.LoanTransaction.java

License:Apache License

public static LoanTransaction accrueInterest(final Office office, final Loan loan, final Money amount,
        final LocalDate interestAppliedDate, final LocalDateTime createdDate, final AppUser appUser) {
    BigDecimal principalPortion = null;
    BigDecimal feesPortion = null;
    BigDecimal penaltiesPortion = null;
    BigDecimal interestPortion = amount.getAmount();
    BigDecimal overPaymentPortion = null;
    boolean reversed = false;
    PaymentDetail paymentDetail = null;/*from  w ww .  j  av  a2  s .c  om*/
    String externalId = null;
    return new LoanTransaction(loan, office, LoanTransactionType.ACCRUAL.getValue(),
            interestAppliedDate.toDate(), interestPortion, principalPortion, interestPortion, feesPortion,
            penaltiesPortion, overPaymentPortion, reversed, paymentDetail, externalId, createdDate, appUser);
}

From source file:com.gst.portfolio.loanaccount.domain.LoanTransaction.java

License:Apache License

public static LoanTransaction accrueTransaction(final Loan loan, final Office office, final LocalDate dateOf,
        final BigDecimal amount, final BigDecimal interestPortion, final BigDecimal feeChargesPortion,
        final BigDecimal penaltyChargesPortion, final AppUser appUser) {
    BigDecimal principalPortion = null;
    BigDecimal overPaymentPortion = null;
    boolean reversed = false;
    PaymentDetail paymentDetail = null;//w w w.  j a  va 2s .c  o  m
    String externalId = null;
    LocalDateTime createdDate = DateUtils.getLocalDateTimeOfTenant();
    return new LoanTransaction(loan, office, LoanTransactionType.ACCRUAL.getValue(), dateOf.toDate(), amount,
            principalPortion, interestPortion, feeChargesPortion, penaltyChargesPortion, overPaymentPortion,
            reversed, paymentDetail, externalId, createdDate, appUser);
}

From source file:com.gst.portfolio.loanaccount.domain.LoanTransaction.java

License:Apache License

public static LoanTransaction initiateTransfer(final Office office, final Loan loan,
        final LocalDate transferDate, final LocalDateTime createdDate, final AppUser appUser) {
    return new LoanTransaction(loan, office, LoanTransactionType.INITIATE_TRANSFER.getValue(),
            transferDate.toDateTimeAtStartOfDay().toDate(), loan.getSummary().getTotalOutstanding(),
            loan.getSummary().getTotalPrincipalOutstanding(), loan.getSummary().getTotalInterestOutstanding(),
            loan.getSummary().getTotalFeeChargesOutstanding(),
            loan.getSummary().getTotalPenaltyChargesOutstanding(), null, false, null, null, createdDate,
            appUser);// w  w  w .ja v  a 2  s.c  om
}