use of org.estatio.module.lease.dom.LeaseTermForIndexable in project estatio by estatio.
the class InvoiceCalculationForDeposit_IntegTest method setUpRentItem.
private LeaseItem setUpRentItem(final Lease lease, final LocalDate effectiveIndexationDate) {
LeaseItem leaseItem = wrap(lease).newItem(LeaseItemType.RENT, LeaseAgreementRoleTypeEnum.LANDLORD, chargeForRent, InvoicingFrequency.QUARTERLY_IN_ADVANCE, PaymentMethod.DIRECT_DEBIT, effectiveIndexationDate);
LeaseTermForIndexable rentTerm1 = (LeaseTermForIndexable) wrap(leaseItem).newTerm(startDateForItems, endOf2011);
wrap(rentTerm1).changeValues(VT.bd("10000.00"), null);
wrap(rentTerm1).changeParameters(IndexationMethod.LAST_KNOWN_INDEX, Index_enum.IStatFoi.findUsing(serviceRegistry), startOf2011, startOf2012, BigDecimal.ONE, effectiveIndexationDate);
return leaseItem;
}
use of org.estatio.module.lease.dom.LeaseTermForIndexable in project estatio by estatio.
the class LeaseItemForIndexableBuilder method execute.
@Override
protected void execute(final ExecutionContext ec) {
defaultParam("charge", ec, Charge_enum.ItServiceChargeIndexable.findUsing(serviceRegistry));
final ChargeGroup group = getCharge().getGroup();
final ChargeGroup_enum expectedGroup = ChargeGroup_enum.ServiceChargeIndexable;
if (group != expectedGroup.findUsing(serviceRegistry)) {
throw new IllegalArgumentException("Charge's group must be " + expectedGroup.getRef());
}
LeaseItem leaseItem = new LeaseItemBuilder().setLease(lease).setCharge(charge).setLeaseItemType(LEASE_ITEM_TYPE).setInvoicingFrequency(INVOICING_FREQUENCY).setInvoicedBy(invoicedBy).setPaymentMethod(paymentMethod).setStatus(status).setSequence(sequence).build(this, ec).getObject();
for (final LeaseTermForIndexableBuilder.TermSpec termSpec : termSpecs) {
final LeaseTermForIndexable term = new LeaseTermForIndexableBuilder().setLeaseItem(leaseItem).setStartDate(termSpec.startDate).setEndDate(termSpec.endDate).setLeaseTermFrequency(termSpec.leaseTermFrequency).setBaseValue(termSpec.baseValue).setBaseIndexStartDate(termSpec.baseIndexStartDate).setNextIndexStartDate(termSpec.nextIndexStartDate).setEffectiveDate(termSpec.effectiveDate).setIndex(termSpec.index).build(this, ec).getObject();
terms.add(term);
}
object = leaseItem;
}
use of org.estatio.module.lease.dom.LeaseTermForIndexable in project estatio by estatio.
the class LeaseItemForRentBuilder method execute.
@Override
protected void execute(final ExecutionContext ec) {
defaultParam("charge", ec, Charge_enum.ItRent.findUsing(serviceRegistry));
final ChargeGroup group = getCharge().getGroup();
final ChargeGroup_enum expectedGroup = ChargeGroup_enum.Rent;
if (group != expectedGroup.findUsing(serviceRegistry)) {
throw new IllegalArgumentException("Charge's group must be " + expectedGroup.getRef());
}
LeaseItem leaseItem = new LeaseItemBuilder().setLease(lease).setCharge(charge).setLeaseItemType(LEASE_ITEM_TYPE).setInvoicingFrequency(INVOICING_FREQUENCY).setInvoicedBy(invoicedBy).setPaymentMethod(paymentMethod).setStatus(status).setSequence(sequence).build(this, ec).getObject();
for (LeaseTermForIndexableBuilder.TermSpec termSpec : termSpecs) {
final LeaseTermForIndexable term = new LeaseTermForIndexableBuilder().setLeaseItem(leaseItem).setStartDate(termSpec.startDate).setEffectiveDate(termSpec.endDate).setBaseValue(termSpec.baseValue).setBaseIndexStartDate(termSpec.baseIndexStartDate).setNextIndexStartDate(termSpec.nextIndexStartDate).setEffectiveDate(termSpec.effectiveDate).setIndex(termSpec.index).build(this, ec).getObject();
terms.add(term);
}
object = leaseItem;
}
use of org.estatio.module.lease.dom.LeaseTermForIndexable in project estatio by estatio.
the class IndexationCalculationMethod_Test method getIndexableWith.
private static Indexable getIndexableWith(double baseValue, double baseIndexValue, double nextIndexValue, double rebaseFactor, double levellingPercentage) {
LeaseTermForIndexable indexable;
indexable = new LeaseTermForIndexable();
// indexable.setIndex(mockIndex);
indexable.setBaseValue(BigDecimal.valueOf(baseValue));
indexable.setBaseIndexValue(BigDecimal.valueOf(baseIndexValue));
indexable.setNextIndexValue(BigDecimal.valueOf(nextIndexValue));
indexable.setRebaseFactor(BigDecimal.valueOf(rebaseFactor));
indexable.setLevellingPercentage(BigDecimal.valueOf(levellingPercentage));
return indexable;
}
use of org.estatio.module.lease.dom.LeaseTermForIndexable in project estatio by estatio.
the class LeaseTermForIndexableBuilder method execute.
@Override
protected void execute(final ExecutionContext ec) {
checkParam("leaseItem", ec, LeaseItem.class);
defaultParam("startDate", ec, leaseItem.getStartDate());
defaultParam("leaseTermFrequency", ec, LeaseTermFrequency.YEARLY);
final Class<?> expectedClass = LeaseTermForIndexable.class;
if (!leaseItem.getType().isCreate(expectedClass)) {
throw new IllegalArgumentException(String.format("LeaseItem type must instantiate %s (is %s)", expectedClass, leaseItem.getType()));
}
final LeaseTermForIndexable leaseTerm = (LeaseTermForIndexable) leaseItem.newTerm(startDate, endDate);
leaseTerm.setBaseValue(baseValue);
leaseTerm.setBaseIndexStartDate(baseIndexStartDate);
leaseTerm.setNextIndexStartDate(nextIndexStartDate);
leaseTerm.setEffectiveDate(effectiveDate);
leaseTerm.setIndex(index);
leaseTerm.setFrequency(leaseTermFrequency);
ec.addResult(this, leaseTerm);
object = leaseTerm;
}
Aggregations