use of org.estatio.module.charge.fixtures.chargegroups.enums.ChargeGroup_enum in project estatio by estatio.
the class LeaseItemForDepositBuilder method execute.
@Override
protected void execute(final ExecutionContext ec) {
defaultParam("charge", ec, Charge_enum.ItDeposit.findUsing(serviceRegistry));
final ChargeGroup group = getCharge().getGroup();
final ChargeGroup_enum expectedGroup = ChargeGroup_enum.Deposit;
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).setSequence(sequence).setInvoicedBy(invoicedBy).setPaymentMethod(paymentMethod).setStatus(status).build(this, ec).getObject();
if (sourceItem != null) {
if (leaseItem.getSourceItems().isEmpty()) {
leaseItem.newSourceItem(sourceItem);
}
}
for (LeaseTermForDepositBuilder.TermSpec termSpec : termSpecs) {
final LeaseTermForDeposit term = new LeaseTermForDepositBuilder().setLeaseItem(leaseItem).setStartDate(termSpec.startDate).setEndDate(termSpec.endDate).setFraction(termSpec.fraction).build(this, ec).getObject();
terms.add(term);
}
object = leaseItem;
}
use of org.estatio.module.charge.fixtures.chargegroups.enums.ChargeGroup_enum in project estatio by estatio.
the class LeaseItemForDiscountBuilder method execute.
@Override
protected void execute(final ExecutionContext ec) {
defaultParam("charge", ec, Charge_enum.ItDiscount.findUsing(serviceRegistry));
final ChargeGroup group = getCharge().getGroup();
final ChargeGroup_enum expectedGroup = ChargeGroup_enum.Discount;
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).setSequence(sequence).setStatus(status).build(this, ec).getObject();
for (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;
}
use of org.estatio.module.charge.fixtures.chargegroups.enums.ChargeGroup_enum in project estatio by estatio.
the class LeaseItemForMarketingBuilder method execute.
@Override
protected void execute(final ExecutionContext ec) {
defaultParam("charge", ec, Charge_enum.GbMarketing.findUsing(serviceRegistry));
final ChargeGroup group = getCharge().getGroup();
final ChargeGroup_enum expectedGroup = ChargeGroup_enum.Marketing;
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;
}
use of org.estatio.module.charge.fixtures.chargegroups.enums.ChargeGroup_enum in project estatio by estatio.
the class LeaseItemForTaxBuilder method execute.
@Override
protected void execute(final ExecutionContext ec) {
defaultParam("charge", ec, Charge_enum.ItTax.findUsing(serviceRegistry));
final ChargeGroup group = getCharge().getGroup();
final ChargeGroup_enum expectedGroup = ChargeGroup_enum.Tax;
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();
if (sourceItem != null) {
if (leaseItem.getSourceItems().isEmpty()) {
leaseItem.newSourceItem(sourceItem);
}
}
for (LeaseTermForTaxBuilder.TermSpec termSpec : termSpecs) {
final LeaseTermForTax term = new LeaseTermForTaxBuilder().setLeaseItem(leaseItem).setStartDate(termSpec.startDate).setEndDate(termSpec.endDate).setLeaseTermFrequency(termSpec.leaseTermFrequency).setTaxPercentage(termSpec.taxPercentage).setRecoverablePercentage(termSpec.recoverablePercentage).setTaxable(termSpec.taxable).build(this, ec).getObject();
terms.add(term);
}
object = leaseItem;
}
use of org.estatio.module.charge.fixtures.chargegroups.enums.ChargeGroup_enum in project estatio by estatio.
the class LeaseItemForTurnoverRentBuilder method execute.
@Override
protected void execute(final ExecutionContext ec) {
defaultParam("charge", ec, Charge_enum.ItTurnoverRent.findUsing(serviceRegistry));
final ChargeGroup group = getCharge().getGroup();
final ChargeGroup_enum expectedGroup = ChargeGroup_enum.TurnoverRent;
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();
if (sourceItem != null) {
if (leaseItem.getSourceItems().isEmpty()) {
leaseItem.newSourceItem(sourceItem);
}
}
for (LeaseTermForTurnoverRentBuilder.TermSpec termSpec : termSpecs) {
final LeaseTermForTurnoverRent term = new LeaseTermForTurnoverRentBuilder().setLeaseItem(leaseItem).setStartDate(termSpec.startDate).setEndDate(termSpec.endDate).setLeaseTermFrequency(termSpec.leaseTermFrequency).setTurnoverRentRule(termSpec.turnoverRentRule).build(this, ec).getObject();
terms.add(term);
}
object = leaseItem;
}
Aggregations