Search in sources :

Example 56 with ActionLayout

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

the class IncomingInvoice_approveAsCorporateManager method act.

@Action(domainEvent = IncomingInvoice_next.ActionDomainEvent.class, semantics = SemanticsOf.IDEMPOTENT)
@ActionLayout(cssClassFa = "fa-thumbs-o-up")
public Object act(@Nullable final String comment, final boolean goToNext) {
    final IncomingInvoice next = nextAfterPendingIfRequested(goToNext);
    trigger(comment, null);
    return objectToReturn(next);
}
Also used : IncomingInvoice(org.estatio.module.capex.dom.invoice.IncomingInvoice) Action(org.apache.isis.applib.annotation.Action) ActionLayout(org.apache.isis.applib.annotation.ActionLayout)

Example 57 with ActionLayout

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

the class IncomingInvoice_approveLocalAsCountryDirector method act.

@Action(domainEvent = ActionDomainEvent.class, semantics = SemanticsOf.IDEMPOTENT)
@ActionLayout(cssClassFa = "fa-thumbs-up")
public Object act(@Nullable final String comment, final boolean goToNext) {
    final IncomingInvoice next = nextAfterPendingIfRequested(goToNext);
    trigger(comment, null);
    return objectToReturn(next);
}
Also used : IncomingInvoice(org.estatio.module.capex.dom.invoice.IncomingInvoice) Action(org.apache.isis.applib.annotation.Action) ActionLayout(org.apache.isis.applib.annotation.ActionLayout)

Example 58 with ActionLayout

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

the class Document_categoriseAsOrder method act.

@Action(domainEvent = ActionDomainEvent.class, semantics = SemanticsOf.IDEMPOTENT)
@ActionLayout(cssClassFa = "folder-open-o")
public Object act(@Nullable final Property property, @Nullable final String comment) {
    final Document document = getDomainObject();
    document.setType(DocumentTypeData.INCOMING_ORDER.findUsing(documentTypeRepository));
    // create order
    final Order order = orderRepository.create(property, // order number
    null, // sellerOrderReference
    null, // entryDate
    clockService.now(), // orderDate
    null, // seller
    null, // buyer
    buyerFinder.buyerDerivedFromDocumentName(document), document.getAtPath(), // approval state... will cause state transition to be created automatically by subscriber
    null);
    paperclipRepository.attach(document, null, order);
    trigger(comment, null);
    return order;
}
Also used : Order(org.estatio.module.capex.dom.order.Order) Document(org.incode.module.document.dom.impl.docs.Document) Action(org.apache.isis.applib.annotation.Action) ActionLayout(org.apache.isis.applib.annotation.ActionLayout)

Example 59 with ActionLayout

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

the class Document_categoriseAsPropertyInvoice method act.

@Action(domainEvent = ActionDomainEvent.class, semantics = SemanticsOf.IDEMPOTENT)
@ActionLayout(cssClassFa = "folder-open-o")
public Object act(final Property property, @Nullable final String comment) {
    final Document document = getDomainObject();
    document.setType(DocumentTypeData.INCOMING_INVOICE.findUsing(documentTypeRepository));
    LocalDate dateReceived = document.getCreatedAt().toLocalDate();
    LocalDate dueDate = document.getCreatedAt().toLocalDate().plusDays(30);
    final IncomingInvoice incomingInvoice = incomingInvoiceRepository.create(// EST-1508: the users prefer no default
    null, // invoiceNumber
    null, property, document.getAtPath(), // buyer
    buyerFinder.buyerDerivedFromDocumentName(document), // seller
    null, // invoiceDate
    null, dueDate, null, InvoiceStatus.NEW, dateReceived, // bankAccount
    null, // approval state... will cause state transition to be created automatically by subscriber
    null);
    paperclipRepository.attach(document, null, incomingInvoice);
    trigger(comment, null);
    return incomingInvoice;
}
Also used : IncomingInvoice(org.estatio.module.capex.dom.invoice.IncomingInvoice) Document(org.incode.module.document.dom.impl.docs.Document) LocalDate(org.joda.time.LocalDate) Action(org.apache.isis.applib.annotation.Action) ActionLayout(org.apache.isis.applib.annotation.ActionLayout)

Example 60 with ActionLayout

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

the class Document_categoriseAsOtherInvoice method act.

@Action(domainEvent = ActionDomainEvent.class, semantics = SemanticsOf.IDEMPOTENT)
@ActionLayout(cssClassFa = "folder-open-o")
public Object act(final IncomingInvoiceType incomingInvoiceType, @Nullable final String comment) {
    final Document document = getDomainObject();
    document.setType(DocumentTypeData.INCOMING_INVOICE.findUsing(documentTypeRepository));
    LocalDate dateReceived = document.getCreatedAt().toLocalDate();
    LocalDate dueDate = document.getCreatedAt().toLocalDate().plusDays(30);
    final IncomingInvoice incomingInvoice = incomingInvoiceRepository.create(incomingInvoiceType, // invoiceNumber
    null, // property
    null, document.getAtPath(), // buyer
    buyerFinder.buyerDerivedFromDocumentName(document), // seller
    null, // invoiceDate
    null, dueDate, null, InvoiceStatus.NEW, dateReceived, // bankAccount
    null, // approval state... will cause state transition to be created automatically by subscriber
    null);
    paperclipRepository.attach(document, null, incomingInvoice);
    trigger(comment, null);
    return incomingInvoice;
}
Also used : IncomingInvoice(org.estatio.module.capex.dom.invoice.IncomingInvoice) Document(org.incode.module.document.dom.impl.docs.Document) LocalDate(org.joda.time.LocalDate) Action(org.apache.isis.applib.annotation.Action) ActionLayout(org.apache.isis.applib.annotation.ActionLayout)

Aggregations

ActionLayout (org.apache.isis.applib.annotation.ActionLayout)62 Action (org.apache.isis.applib.annotation.Action)61 Document (org.incode.module.document.dom.impl.docs.Document)22 MemberOrder (org.apache.isis.applib.annotation.MemberOrder)14 IncomingInvoice (org.estatio.module.capex.dom.invoice.IncomingInvoice)9 WorksheetSpec (org.isisaddons.module.excel.dom.WorksheetSpec)7 Blob (org.apache.isis.applib.value.Blob)6 ArrayList (java.util.ArrayList)5 WorksheetContent (org.isisaddons.module.excel.dom.WorksheetContent)5 DocumentTemplate (org.incode.module.document.dom.impl.docs.DocumentTemplate)3 DomainObject (org.apache.isis.applib.annotation.DomainObject)2 BudgetItem (org.estatio.module.budget.dom.budgetitem.BudgetItem)2 PartitionItem (org.estatio.module.budget.dom.partioning.PartitionItem)2 IncomingDocViewModel (org.estatio.module.capex.app.document.IncomingDocViewModel)2 Invoice (org.estatio.module.invoice.dom.Invoice)2 Lease (org.estatio.module.lease.dom.Lease)2 Organisation (org.estatio.module.party.dom.Organisation)2 DocumentType (org.incode.module.document.dom.impl.types.DocumentType)2 LocalDate (org.joda.time.LocalDate)2 LocalDateTime (org.joda.time.LocalDateTime)2