Search in sources :

Example 6 with FixedAsset

use of org.estatio.module.asset.dom.FixedAsset in project estatio by estatio.

the class PartyRoleMemberInferenceServiceForFixedAssetRoleAndOrder method doInferMembersOf.

@Override
protected List<Person> doInferMembersOf(final FixedAssetRoleTypeEnum partyRoleType, final Order order) {
    final FixedAsset fixedAsset = order.getProperty();
    if (fixedAsset == null) {
        // can't go any further
        return null;
    }
    final List<FixedAssetRole> fixedAssetRoles = fixedAssetRoleRepository.findByAssetAndType(fixedAsset, partyRoleType);
    return currentPersonsFrom(fixedAssetRoles);
}
Also used : FixedAssetRole(org.estatio.module.asset.dom.role.FixedAssetRole) FixedAsset(org.estatio.module.asset.dom.FixedAsset)

Example 7 with FixedAsset

use of org.estatio.module.asset.dom.FixedAsset in project estatio by estatio.

the class InvoiceAttributesVM method getUnitName.

@Programmatic
public String getUnitName() {
    final Optional<InvoiceItem> invoiceItemOptional = invoice.getItems().stream().findFirst();
    if (invoiceItemOptional.isPresent()) {
        final InvoiceItemForLease invoiceItem = (InvoiceItemForLease) invoiceItemOptional.get();
        final FixedAsset fixedAsset = invoiceItem.getFixedAsset();
        if (fixedAsset != null && fixedAsset instanceof Unit) {
            return fixedAsset.getName();
        }
    }
    return null;
}
Also used : InvoiceItem(org.estatio.module.invoice.dom.InvoiceItem) InvoiceItemForLease(org.estatio.module.lease.dom.invoicing.InvoiceItemForLease) FixedAsset(org.estatio.module.asset.dom.FixedAsset) Unit(org.estatio.module.asset.dom.Unit) Programmatic(org.apache.isis.applib.annotation.Programmatic)

Example 8 with FixedAsset

use of org.estatio.module.asset.dom.FixedAsset in project estatio by estatio.

the class IncomingInvoice method copyWithLinks.

private IncomingInvoiceItem copyWithLinks(final IncomingInvoiceItem itemToReverse, final Sort sort) {
    final IncomingInvoiceType type = itemToReverse.getIncomingInvoiceType();
    final String description = itemToReverse.getDescription();
    final Charge charge = itemToReverse.getCharge();
    final BigDecimal netAmount = itemToReverse.getNetAmount();
    final BigDecimal vatAmount = itemToReverse.getVatAmount();
    final BigDecimal grossAmount = itemToReverse.getGrossAmount();
    final Tax tax = itemToReverse.getTax();
    final LocalDate dueDate = itemToReverse.getDueDate();
    final String period = itemToReverse.getPeriod();
    final FixedAsset fixedAsset = itemToReverse.getFixedAsset();
    final Project project = itemToReverse.getProject();
    final BudgetItem budgetItem = itemToReverse.getBudgetItem();
    final IncomingInvoiceItem copyItem = addItemToThis(type, charge, sort.prefixTo(description), sort.adjust(netAmount), sort.adjust(vatAmount), sort.adjust(grossAmount), tax, dueDate, period, fixedAsset, project, budgetItem);
    if (sort == Sort.REVERSAL) {
        copyItem.setReversalOf(itemToReverse);
    }
    final Optional<OrderItemInvoiceItemLink> linkIfAny = orderItemInvoiceItemLinkRepository.findByInvoiceItem(itemToReverse);
    linkIfAny.ifPresent(link -> {
        orderItemInvoiceItemLinkRepository.createLink(link.getOrderItem(), copyItem, sort.adjust(link.getNetAmount()));
    });
    return copyItem;
}
Also used : Project(org.estatio.module.capex.dom.project.Project) BudgetItem(org.estatio.module.budget.dom.budgetitem.BudgetItem) OrderItemInvoiceItemLink(org.estatio.module.capex.dom.orderinvoice.OrderItemInvoiceItemLink) Charge(org.estatio.module.charge.dom.Charge) Tax(org.estatio.module.tax.dom.Tax) FixedAsset(org.estatio.module.asset.dom.FixedAsset) LocalDate(org.joda.time.LocalDate) BigDecimal(java.math.BigDecimal)

Aggregations

FixedAsset (org.estatio.module.asset.dom.FixedAsset)8 Programmatic (org.apache.isis.applib.annotation.Programmatic)3 Action (org.apache.isis.applib.annotation.Action)2 FixedAssetRole (org.estatio.module.asset.dom.role.FixedAssetRole)2 Charge (org.estatio.module.charge.dom.Charge)2 Lease (org.estatio.module.lease.dom.Lease)2 InvoiceForLease (org.estatio.module.lease.dom.invoicing.InvoiceForLease)2 InvoiceItemForLease (org.estatio.module.lease.dom.invoicing.InvoiceItemForLease)2 Tax (org.estatio.module.tax.dom.Tax)2 BigDecimal (java.math.BigDecimal)1 InvoiceDto (org.estatio.canonical.invoice.v1.InvoiceDto)1 InvoiceItemDto (org.estatio.canonical.invoice.v1.InvoiceItemDto)1 Unit (org.estatio.module.asset.dom.Unit)1 BankMandate (org.estatio.module.bankmandate.dom.BankMandate)1 BudgetItem (org.estatio.module.budget.dom.budgetitem.BudgetItem)1 OrderItemInvoiceItemLink (org.estatio.module.capex.dom.orderinvoice.OrderItemInvoiceItemLink)1 Project (org.estatio.module.capex.dom.project.Project)1 ChargeGroup (org.estatio.module.charge.dom.ChargeGroup)1 InvoiceItem (org.estatio.module.invoice.dom.InvoiceItem)1 Occupancy (org.estatio.module.lease.dom.occupancy.Occupancy)1