Search in sources :

Example 1 with ChargeGroup

use of org.estatio.module.charge.dom.ChargeGroup in project estatio by estatio.

the class LeaseItemForEntryFeeBuilder method execute.

@Override
protected void execute(final ExecutionContext ec) {
    defaultParam("charge", ec, Charge_enum.ItEntryFee.findUsing(serviceRegistry));
    final ChargeGroup group = getCharge().getGroup();
    final ChargeGroup_enum expectedGroup = ChargeGroup_enum.EntryFee;
    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 LeaseTermForFixedBuilder.TermSpec termSpec : termSpecs) {
        final LeaseTermForFixed term = new LeaseTermForFixedBuilder().setLeaseItem(leaseItem).setStartDate(termSpec.startDate).setEndDate(termSpec.endDate).setLeaseTermFrequency(termSpec.leaseTermFrequency).setValue(termSpec.value).build(this, ec).getObject();
        terms.add(term);
    }
    object = leaseItem;
}
Also used : ChargeGroup(org.estatio.module.charge.dom.ChargeGroup) ChargeGroup_enum(org.estatio.module.charge.fixtures.chargegroups.enums.ChargeGroup_enum) LeaseTermForFixed(org.estatio.module.lease.dom.LeaseTermForFixed) LeaseItem(org.estatio.module.lease.dom.LeaseItem)

Example 2 with ChargeGroup

use of org.estatio.module.charge.dom.ChargeGroup 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;
}
Also used : ChargeGroup(org.estatio.module.charge.dom.ChargeGroup) ChargeGroup_enum(org.estatio.module.charge.fixtures.chargegroups.enums.ChargeGroup_enum) LeaseTermForIndexable(org.estatio.module.lease.dom.LeaseTermForIndexable) LeaseItem(org.estatio.module.lease.dom.LeaseItem)

Example 3 with ChargeGroup

use of org.estatio.module.charge.dom.ChargeGroup 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;
}
Also used : ChargeGroup(org.estatio.module.charge.dom.ChargeGroup) ChargeGroup_enum(org.estatio.module.charge.fixtures.chargegroups.enums.ChargeGroup_enum) LeaseTermForIndexable(org.estatio.module.lease.dom.LeaseTermForIndexable) LeaseItem(org.estatio.module.lease.dom.LeaseItem)

Example 4 with ChargeGroup

use of org.estatio.module.charge.dom.ChargeGroup in project estatio by estatio.

the class LeaseItemForServiceChargeBudgetedBuilder method execute.

@Override
protected void execute(final ExecutionContext ec) {
    defaultParam("charge", ec, Charge_enum.GbServiceCharge.findUsing(serviceRegistry));
    final ChargeGroup group = getCharge().getGroup();
    final ChargeGroup_enum expectedGroup = ChargeGroup_enum.ServiceCharge;
    if (group != expectedGroup.findUsing(serviceRegistry)) {
        throw new IllegalArgumentException("Charge's group must be " + expectedGroup.getRef());
    }
    final 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();
    object = leaseItem;
}
Also used : ChargeGroup(org.estatio.module.charge.dom.ChargeGroup) ChargeGroup_enum(org.estatio.module.charge.fixtures.chargegroups.enums.ChargeGroup_enum) LeaseItem(org.estatio.module.lease.dom.LeaseItem)

Example 5 with ChargeGroup

use of org.estatio.module.charge.dom.ChargeGroup in project estatio by estatio.

the class LeaseItemForServiceChargeBuilder method execute.

@Override
protected void execute(final ExecutionContext ec) {
    defaultParam("charge", ec, Charge_enum.GbServiceCharge.findUsing(serviceRegistry));
    final ChargeGroup group = getCharge().getGroup();
    final ChargeGroup_enum expectedGroup = ChargeGroup_enum.ServiceCharge;
    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 (LeaseTermForServiceChargeBuilder.TermSpec termSpec : termSpecs) {
        final LeaseTermForServiceCharge term = new LeaseTermForServiceChargeBuilder().setLeaseItem(leaseItem).setStartDate(termSpec.startDate).setEndDate(termSpec.endDate).setLeaseTermFrequency(termSpec.leaseTermFrequency).setBudgetedValue(termSpec.budgetedValue).build(this, ec).getObject();
        terms.add(term);
    }
    object = leaseItem;
}
Also used : ChargeGroup(org.estatio.module.charge.dom.ChargeGroup) ChargeGroup_enum(org.estatio.module.charge.fixtures.chargegroups.enums.ChargeGroup_enum) LeaseTermForServiceCharge(org.estatio.module.lease.dom.LeaseTermForServiceCharge) LeaseItem(org.estatio.module.lease.dom.LeaseItem)

Aggregations

ChargeGroup (org.estatio.module.charge.dom.ChargeGroup)15 ChargeGroup_enum (org.estatio.module.charge.fixtures.chargegroups.enums.ChargeGroup_enum)10 LeaseItem (org.estatio.module.lease.dom.LeaseItem)10 Charge (org.estatio.module.charge.dom.Charge)4 Tax (org.estatio.module.tax.dom.Tax)4 Programmatic (org.apache.isis.applib.annotation.Programmatic)2 Lease (org.estatio.module.lease.dom.Lease)2 LeaseTermForFixed (org.estatio.module.lease.dom.LeaseTermForFixed)2 LeaseTermForIndexable (org.estatio.module.lease.dom.LeaseTermForIndexable)2 LeaseTermForServiceCharge (org.estatio.module.lease.dom.LeaseTermForServiceCharge)2 InvoiceForLease (org.estatio.module.lease.dom.invoicing.InvoiceForLease)2 InvoiceItemForLease (org.estatio.module.lease.dom.invoicing.InvoiceItemForLease)2 Occupancy (org.estatio.module.lease.dom.occupancy.Occupancy)2 Brand (org.estatio.module.lease.dom.occupancy.tags.Brand)2 BigDecimal (java.math.BigDecimal)1 InvoiceItemDto (org.estatio.canonical.invoice.v1.InvoiceItemDto)1 FixedAsset (org.estatio.module.asset.dom.FixedAsset)1 Unit (org.estatio.module.asset.dom.Unit)1 Applicability (org.estatio.module.charge.dom.Applicability)1 InvoiceItemForTesting (org.estatio.module.invoice.dom.InvoiceItemForTesting)1