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;
}
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());
}
Aggregations