use of org.estatio.module.lease.dom.Lease in project estatio by estatio.
the class Occupancy method remove.
@Action(semantics = SemanticsOf.NON_IDEMPOTENT_ARE_YOU_SURE, domainEvent = Occupancy.RemoveEvent.class)
public Object remove() {
Lease lease = getLease();
remove(this);
return lease;
}
use of org.estatio.module.lease.dom.Lease in project estatio by estatio.
the class InvoiceAttributesVM method getLeasePropertyName.
@Programmatic
public String getLeasePropertyName() {
Lease lease = invoice.getLease();
if (lease == null) {
return null;
}
Property property = lease.getProperty();
if (property == null) {
return null;
}
return property.getName();
}
use of org.estatio.module.lease.dom.Lease in project estatio by estatio.
the class LeaseTermForServiceChargeImport method fetchLease.
private Lease fetchLease(final String leaseReference) {
final Lease lease;
lease = leaseRepository.findLeaseByReference(leaseReference.trim().replaceAll("~", "+"));
if (lease == null) {
throw new ApplicationException(String.format("Lease with reference %s not found.", leaseReference));
}
return lease;
}
use of org.estatio.module.lease.dom.Lease in project estatio by estatio.
the class LeaseTermImportAbstract method initLeaseItem.
protected LeaseItem initLeaseItem() {
// find or create leaseItem
final Lease lease = fetchLease(getLeaseReference());
final ApplicationTenancy leaseItemApplicationTenancy = ObjectUtils.firstNonNull(securityApplicationTenancyRepository.findByPath(getLeaseItemAtPath()), lease.getApplicationTenancy());
final Charge charge = fetchCharge(getItemChargeReference());
final LeaseItemType itemType = fetchLeaseItemType(getItemTypeName());
LeaseItem item = lease.findItem(itemType, getItemStartDate(), getItemSequence());
if (item == null) {
item = lease.newItem(itemType, LeaseAgreementRoleTypeEnum.LANDLORD, charge, InvoicingFrequency.valueOf(getItemInvoicingFrequency()), PaymentMethod.valueOf(getItemPaymentMethod()), getItemStartDate());
item.setSequence(getItemSequence());
}
item.setEpochDate(getItemEpochDate());
item.setNextDueDate(getItemNextDueDate());
final LeaseItemStatus leaseItemStatus = LeaseItemStatus.valueOfElse(getItemStatus(), LeaseItemStatus.ACTIVE);
item.setStatus(leaseItemStatus);
// Find source item and create source link
if (getSourceItemTypeName() != null) {
final LeaseItemType sourceItemType = LeaseItemType.valueOf(sourceItemTypeName);
LeaseItem sourceItem = item.getLease().findItem(sourceItemType, sourceItemStartDate, sourceItemSequence);
if (sourceItem != null) {
item.findOrCreateSourceItem(sourceItem);
}
}
return item;
}
use of org.estatio.module.lease.dom.Lease in project estatio by estatio.
the class LeaseTermImportAbstract method fetchLease.
private Lease fetchLease(final String leaseReference) {
final Lease lease;
lease = leaseRepository.findLeaseByReference(leaseReference.trim().replaceAll("~", "+"));
if (lease == null) {
throw new ApplicationException(String.format("Lease with reference %s not found.", leaseReference));
}
return lease;
}
Aggregations