Search in sources :

Example 1 with Project_InvoiceItemsNotOnProjectItem

use of org.estatio.module.capex.dom.invoice.contributions.Project_InvoiceItemsNotOnProjectItem in project estatio by estatio.

the class Project_CreateMissingItems method chargesLinkedNotOnItems.

private List<Charge> chargesLinkedNotOnItems() {
    List<Charge> result = new ArrayList<>();
    Project_OrderItemsNotOnProjectItem orderItemsMixin = new Project_OrderItemsNotOnProjectItem(project);
    serviceRegistry2.injectServicesInto(orderItemsMixin);
    for (Charge chargeCandidate : orderItemsMixin.orderItemsNotOnProjectItem().stream().filter(x -> x.getCharge() != null).map(x -> x.getCharge()).collect(Collectors.toList())) {
        if (!result.contains(chargeCandidate)) {
            result.add(chargeCandidate);
        }
    }
    Project_InvoiceItemsNotOnProjectItem invoiceItemsMixin = new Project_InvoiceItemsNotOnProjectItem(project);
    serviceRegistry2.injectServicesInto(invoiceItemsMixin);
    for (Charge chargeCandidate : invoiceItemsMixin.invoiceItemsNotOnProjectItem().stream().filter(x -> x.getCharge() != null).map(x -> x.getCharge()).collect(Collectors.toList())) {
        if (!result.contains(chargeCandidate)) {
            result.add(chargeCandidate);
        }
    }
    return result;
}
Also used : Action(org.apache.isis.applib.annotation.Action) Project(org.estatio.module.capex.dom.project.Project) ServiceRegistry2(org.apache.isis.applib.services.registry.ServiceRegistry2) Project_InvoiceItemsNotOnProjectItem(org.estatio.module.capex.dom.invoice.contributions.Project_InvoiceItemsNotOnProjectItem) Charge(org.estatio.module.charge.dom.Charge) EstatioRole(org.estatio.module.base.dom.EstatioRole) Property(org.estatio.module.asset.dom.Property) Collectors(java.util.stream.Collectors) MemberOrder(org.apache.isis.applib.annotation.MemberOrder) ArrayList(java.util.ArrayList) Inject(javax.inject.Inject) Mixin(org.apache.isis.applib.annotation.Mixin) SemanticsOf(org.apache.isis.applib.annotation.SemanticsOf) List(java.util.List) Project_OrderItemsNotOnProjectItem(org.estatio.module.capex.dom.order.contributions.Project_OrderItemsNotOnProjectItem) UserService(org.apache.isis.applib.services.user.UserService) Project_InvoiceItemsNotOnProjectItem(org.estatio.module.capex.dom.invoice.contributions.Project_InvoiceItemsNotOnProjectItem) Charge(org.estatio.module.charge.dom.Charge) ArrayList(java.util.ArrayList) Project_OrderItemsNotOnProjectItem(org.estatio.module.capex.dom.order.contributions.Project_OrderItemsNotOnProjectItem)

Aggregations

ArrayList (java.util.ArrayList)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 Inject (javax.inject.Inject)1 Action (org.apache.isis.applib.annotation.Action)1 MemberOrder (org.apache.isis.applib.annotation.MemberOrder)1 Mixin (org.apache.isis.applib.annotation.Mixin)1 SemanticsOf (org.apache.isis.applib.annotation.SemanticsOf)1 ServiceRegistry2 (org.apache.isis.applib.services.registry.ServiceRegistry2)1 UserService (org.apache.isis.applib.services.user.UserService)1 Property (org.estatio.module.asset.dom.Property)1 EstatioRole (org.estatio.module.base.dom.EstatioRole)1 Project_InvoiceItemsNotOnProjectItem (org.estatio.module.capex.dom.invoice.contributions.Project_InvoiceItemsNotOnProjectItem)1 Project_OrderItemsNotOnProjectItem (org.estatio.module.capex.dom.order.contributions.Project_OrderItemsNotOnProjectItem)1 Project (org.estatio.module.capex.dom.project.Project)1 Charge (org.estatio.module.charge.dom.Charge)1