Search in sources :

Example 1 with ActionLayout

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

the class IncomingInvoice_switchView method act.

@Action(semantics = SemanticsOf.SAFE)
@ActionLayout(contributed = Contributed.AS_ACTION, // not sure why this isn't being picked up from isis-non-changing.properties
cssClassFa = "fa-exchange")
@MemberOrder(sequence = "1")
public IncomingDocAsInvoiceViewModel act() {
    Optional<Document> documentIfAny = lookupAttachedPdfService.lookupIncomingInvoicePdfFrom(incomingInvoice);
    // guaranteed to return, hidden if none
    Document document = documentIfAny.get();
    final IncomingDocAsInvoiceViewModel viewModel = new IncomingDocAsInvoiceViewModel(incomingInvoice, document);
    serviceRegistry2.injectServicesInto(viewModel);
    viewModel.init();
    return viewModel;
}
Also used : Document(org.incode.module.document.dom.impl.docs.Document) Action(org.apache.isis.applib.annotation.Action) MemberOrder(org.apache.isis.applib.annotation.MemberOrder) ActionLayout(org.apache.isis.applib.annotation.ActionLayout)

Example 2 with ActionLayout

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

the class IncomingInvoice_LinkedOrderItems method linkedOrderItems.

@Action(semantics = SemanticsOf.SAFE)
@ActionLayout(contributed = Contributed.AS_ASSOCIATION)
public List<LinkedOrderItemViewModel> linkedOrderItems() {
    List<LinkedOrderItemViewModel> result = new ArrayList<>();
    for (OrderItemInvoiceItemLink link : orderItemInvoiceItemLinkRepository.findByInvoice(incomingInvoice)) {
        OrderItem item = link.getOrderItem();
        BigDecimal netAmount = item.getNetAmount();
        BigDecimal netAmountInvoiced = orderItemInvoiceItemLinkRepository.calculateNetAmountLinkedToOrderItem(item);
        result.add(new LinkedOrderItemViewModel(item, netAmount, netAmountInvoiced));
    }
    return result;
}
Also used : OrderItemInvoiceItemLink(org.estatio.module.capex.dom.orderinvoice.OrderItemInvoiceItemLink) OrderItem(org.estatio.module.capex.dom.order.OrderItem) ArrayList(java.util.ArrayList) BigDecimal(java.math.BigDecimal) Action(org.apache.isis.applib.annotation.Action) ActionLayout(org.apache.isis.applib.annotation.ActionLayout)

Example 3 with ActionLayout

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

the class Task_categoriseDocumentAsOrder method act.

@Action(domainEvent = ActionDomainEvent.class, semantics = SemanticsOf.IDEMPOTENT)
@ActionLayout(contributed = Contributed.AS_ACTION, cssClassFa = "folder-open-o")
public Object act(@Nullable final Property property, @Nullable final String comment, final boolean goToNext) {
    final Object nextTaskIfAny = nextTaskOrWarnIfRequired(goToNext);
    Object mixinResult = mixin().act(property, comment);
    if (mixinResult instanceof IncomingDocViewModel) {
        IncomingDocViewModel viewModel = (IncomingDocViewModel) mixinResult;
        // to support 'goToNext' when finished with the view model
        viewModel.setOriginatingTask(task);
    }
    return coalesce(nextTaskIfAny, mixinResult);
}
Also used : IncomingDocViewModel(org.estatio.module.capex.app.document.IncomingDocViewModel) Action(org.apache.isis.applib.annotation.Action) ActionLayout(org.apache.isis.applib.annotation.ActionLayout)

Example 4 with ActionLayout

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

the class Task_categoriseDocumentAsPropertyInvoice method act.

@Action(domainEvent = Task_categoriseDocumentAsOrder.ActionDomainEvent.class, semantics = SemanticsOf.IDEMPOTENT)
@ActionLayout(contributed = Contributed.AS_ACTION, cssClassFa = "folder-open-o")
public Object act(final Property property, @Nullable final String comment, final boolean goToNext) {
    final Object nextTaskIfAny = nextTaskOrWarnIfRequired(goToNext);
    Object mixinResult = mixin().act(property, comment);
    if (mixinResult instanceof IncomingDocViewModel) {
        IncomingDocViewModel viewModel = (IncomingDocViewModel) mixinResult;
        // to support 'goToNext' when finished with the view model
        viewModel.setOriginatingTask(task);
    }
    return coalesce(nextTaskIfAny, mixinResult);
}
Also used : IncomingDocViewModel(org.estatio.module.capex.app.document.IncomingDocViewModel) Action(org.apache.isis.applib.annotation.Action) ActionLayout(org.apache.isis.applib.annotation.ActionLayout)

Example 5 with ActionLayout

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

the class IncomingDocViewModel method createSeller.

@Action(semantics = SemanticsOf.IDEMPOTENT)
@ActionLayout(named = "Create Supplier")
public IncomingDocViewModel createSeller(final OrganisationNameNumberViewModel candidate, final Country country, @Parameter(optionality = Optionality.OPTIONAL) final String ibanNumber) {
    Organisation organisation = organisationRepository.newOrganisation(null, true, candidate.getOrganisationName(), country);
    if (candidate.getChamberOfCommerceCode() != null)
        organisation.setChamberOfCommerceCode(candidate.getChamberOfCommerceCode());
    setSeller(organisation);
    if (ibanNumber != null) {
        bankAccountRepository.newBankAccount(organisation, ibanNumber, null);
    }
    onCreateSeller(organisation);
    return this;
}
Also used : Organisation(org.estatio.module.party.dom.Organisation) 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