Search in sources :

Example 1 with Property

use of org.apache.isis.applib.annotation.Property in project estatio by estatio.

the class Paperclip method getDocumentDate.

/**
 * Either the {@link Document#getCreatedAt()} or {@link Document#getRenderedAt()}, depending upon the
 * {@link Document#getState()} of the {@link Document}.  Returns <tt>null</tt> for {@link DocumentTemplate}s.
 */
@NotPersistent
@Property(domainEvent = DocumentDateDomainEvent.class, editing = Editing.DISABLED)
public DateTime getDocumentDate() {
    final DocumentAbstract documentAbstract = getDocument();
    if (documentAbstract instanceof Document) {
        final Document document = (Document) documentAbstract;
        DocumentState state = document.getState();
        return state.dateOf(document);
    }
    return null;
}
Also used : DocumentAbstract(org.incode.module.document.dom.impl.docs.DocumentAbstract) DocumentState(org.incode.module.document.dom.impl.docs.DocumentState) Document(org.incode.module.document.dom.impl.docs.Document) NotPersistent(javax.jdo.annotations.NotPersistent) Property(org.apache.isis.applib.annotation.Property)

Example 2 with Property

use of org.apache.isis.applib.annotation.Property in project estatio by estatio.

the class IncomingDocAsInvoiceViewModel method choicesOrderItem.

public List<OrderItem> choicesOrderItem() {
    final Party seller = getSeller();
    final org.estatio.module.asset.dom.Property property = getProperty();
    final List<OrderItem> orderItems;
    if (property == null) {
        orderItems = orderItemRepository.findBySeller(seller);
    } else {
        orderItems = orderItemRepository.findBySellerAndProperty(seller, property);
    }
    if (getOrderItem() != null && !orderItems.contains(getOrderItem())) {
        orderItems.add(getOrderItem());
    }
    return orderItems.stream().filter(x -> x.getOrdr().getApprovalState() == null || x.getOrdr().getApprovalState() != OrderApprovalState.DISCARDED).collect(Collectors.toList());
}
Also used : OrderApprovalState(org.estatio.module.capex.dom.order.approval.OrderApprovalState) Order(org.estatio.module.capex.dom.order.Order) SortedSet(java.util.SortedSet) Currency(org.estatio.module.currency.dom.Currency) InvoiceItem(org.estatio.module.invoice.dom.InvoiceItem) IncomingInvoiceType(org.estatio.module.capex.dom.invoice.IncomingInvoiceType) PaymentMethod(org.estatio.module.invoice.dom.PaymentMethod) PropertyLayout(org.apache.isis.applib.annotation.PropertyLayout) MinLength(org.apache.isis.applib.annotation.MinLength) XmlJavaTypeAdapter(javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter) BankAccount(org.estatio.module.financial.dom.BankAccount) FactoryService(org.apache.isis.applib.services.factory.FactoryService) IncomingInvoice(org.estatio.module.capex.dom.invoice.IncomingInvoice) XmlAccessorType(javax.xml.bind.annotation.XmlAccessorType) IncomingInvoiceRepository(org.estatio.module.capex.dom.invoice.IncomingInvoiceRepository) Party(org.estatio.module.party.dom.Party) Charge(org.estatio.module.charge.dom.Charge) OrderItemRepository(org.estatio.module.capex.dom.order.OrderItemRepository) IncomingInvoiceApprovalState(org.estatio.module.capex.dom.invoice.approval.IncomingInvoiceApprovalState) XmlTransient(javax.xml.bind.annotation.XmlTransient) JodaLocalDateStringAdapter(org.apache.isis.schema.utils.jaxbadapters.JodaLocalDateStringAdapter) OrderItem(org.estatio.module.capex.dom.order.OrderItem) Collectors(java.util.stream.Collectors) MemberOrder(org.apache.isis.applib.annotation.MemberOrder) SellerBankAccountCreator(org.estatio.module.capex.dom.invoice.SellerBankAccountCreator) XmlAccessType(javax.xml.bind.annotation.XmlAccessType) List(java.util.List) DomainObject(org.apache.isis.applib.annotation.DomainObject) Optional(java.util.Optional) StateTransitionService(org.estatio.module.capex.dom.state.StateTransitionService) OrderItemInvoiceItemLink(org.estatio.module.capex.dom.orderinvoice.OrderItemInvoiceItemLink) OrderRepository(org.estatio.module.capex.dom.order.OrderRepository) Project(org.estatio.module.capex.dom.project.Project) Optionality(org.apache.isis.applib.annotation.Optionality) Setter(lombok.Setter) IncomingInvoiceItemRepository(org.estatio.module.capex.dom.invoice.IncomingInvoiceItemRepository) Getter(lombok.Getter) Document(org.incode.module.document.dom.impl.docs.Document) Programmatic(org.apache.isis.applib.annotation.Programmatic) ArrayList(java.util.ArrayList) Inject(javax.inject.Inject) XmlType(javax.xml.bind.annotation.XmlType) Lists(com.google.common.collect.Lists) AccessLevel(lombok.AccessLevel) Parameter(org.apache.isis.applib.annotation.Parameter) IncomingInvoiceItem(org.estatio.module.capex.dom.invoice.IncomingInvoiceItem) Nullable(javax.annotation.Nullable) Action(org.apache.isis.applib.annotation.Action) BuyerFinder(org.estatio.module.capex.dom.documents.BuyerFinder) Property(org.apache.isis.applib.annotation.Property) ClockService(org.apache.isis.applib.services.clock.ClockService) OrderItemInvoiceItemLinkRepository(org.estatio.module.capex.dom.orderinvoice.OrderItemInvoiceItemLinkRepository) XmlRootElement(javax.xml.bind.annotation.XmlRootElement) LocalDate(org.joda.time.LocalDate) Mixin(org.apache.isis.applib.annotation.Mixin) SemanticsOf(org.apache.isis.applib.annotation.SemanticsOf) Editing(org.apache.isis.applib.annotation.Editing) IncomingDocViewModel(org.estatio.module.capex.app.document.IncomingDocViewModel) ReasonBuffer2(org.estatio.module.base.platform.applib.ReasonBuffer2) IncomingInvoiceApprovalStateTransition(org.estatio.module.capex.dom.invoice.approval.IncomingInvoiceApprovalStateTransition) XmlElement(javax.xml.bind.annotation.XmlElement) BudgetItem(org.estatio.module.budget.dom.budgetitem.BudgetItem) Party(org.estatio.module.party.dom.Party) OrderItem(org.estatio.module.capex.dom.order.OrderItem)

Aggregations

Property (org.apache.isis.applib.annotation.Property)2 Document (org.incode.module.document.dom.impl.docs.Document)2 Lists (com.google.common.collect.Lists)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Optional (java.util.Optional)1 SortedSet (java.util.SortedSet)1 Collectors (java.util.stream.Collectors)1 Nullable (javax.annotation.Nullable)1 Inject (javax.inject.Inject)1 NotPersistent (javax.jdo.annotations.NotPersistent)1 XmlAccessType (javax.xml.bind.annotation.XmlAccessType)1 XmlAccessorType (javax.xml.bind.annotation.XmlAccessorType)1 XmlElement (javax.xml.bind.annotation.XmlElement)1 XmlRootElement (javax.xml.bind.annotation.XmlRootElement)1 XmlTransient (javax.xml.bind.annotation.XmlTransient)1 XmlType (javax.xml.bind.annotation.XmlType)1 XmlJavaTypeAdapter (javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter)1 AccessLevel (lombok.AccessLevel)1 Getter (lombok.Getter)1