Search in sources :

Example 16 with ActionLayout

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

the class EstatioAppHomePage_verifyBankAccounts method act.

@Action(semantics = SemanticsOf.IDEMPOTENT, restrictTo = RestrictTo.PROTOTYPING)
@ActionLayout(position = ActionLayout.Position.PANEL)
public EstatioAppHomePage act(final List<IncomingInvoice> invoices, @Nullable final String comment) {
    for (IncomingInvoice invoice : invoices) {
        final BankAccount bankAccount = invoice.getBankAccount();
        factoryService.mixin(BankAccount_verify.class, bankAccount).act(comment);
        factoryService.mixin(IncomingInvoice_checkApprovalState.class, invoice).act();
    }
    return homePage;
}
Also used : BankAccount_verify(org.estatio.module.capex.dom.bankaccount.verification.triggers.BankAccount_verify) IncomingInvoice(org.estatio.module.capex.dom.invoice.IncomingInvoice) BankAccount(org.estatio.module.financial.dom.BankAccount) IncomingInvoice_checkApprovalState(org.estatio.module.capex.dom.invoice.approval.tasks.IncomingInvoice_checkApprovalState) Action(org.apache.isis.applib.annotation.Action) ActionLayout(org.apache.isis.applib.annotation.ActionLayout)

Example 17 with ActionLayout

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

the class IncomingInvoice_recategorize method act.

@Action(semantics = SemanticsOf.IDEMPOTENT_ARE_YOU_SURE)
@ActionLayout(cssClassFa = "mail-reply", cssClass = "btn-danger")
public Document act(@Nullable final String comment) {
    Document document = lookupPdf();
    document.setType(DocumentTypeData.INCOMING.findUsing(documentTypeRepository));
    stateTransitionService.trigger(document, IncomingDocumentCategorisationStateTransition.class, IncomingDocumentCategorisationStateTransitionType.RESET, comment, null);
    // use events to cascade delete, eg paperclips and state transitions/tasks
    incomingInvoiceRepository.delete(incomingInvoice);
    return document;
}
Also used : Document(org.incode.module.document.dom.impl.docs.Document) Action(org.apache.isis.applib.annotation.Action) ActionLayout(org.apache.isis.applib.annotation.ActionLayout)

Example 18 with ActionLayout

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

the class Order method createSeller.

@Action(semantics = SemanticsOf.IDEMPOTENT)
@ActionLayout(named = "Create Supplier")
public Order createSeller(final OrganisationNameNumberViewModel candidate, final Country country, @Nullable 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);
    }
    partyRoleRepository.findOrCreate(organisation, IncomingInvoiceRoleTypeEnum.SUPPLIER);
    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)

Example 19 with ActionLayout

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

the class IncomingInvoice_approve method act.

@Action(domainEvent = ActionDomainEvent.class, semantics = SemanticsOf.IDEMPOTENT)
@ActionLayout(cssClassFa = "fa-thumbs-o-up")
public Object act(final String role, @Nullable final Person personToAssignNextTo, @Nullable final String comment, final boolean goToNext) {
    final IncomingInvoice next = nextAfterPendingIfRequested(goToNext);
    trigger(personToAssignNextTo, 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 20 with ActionLayout

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

the class Task_discardDocument method act.

@Action(domainEvent = Task_categoriseDocumentAsOrder.ActionDomainEvent.class, semantics = SemanticsOf.IDEMPOTENT_ARE_YOU_SURE)
@ActionLayout(contributed = Contributed.AS_ACTION, cssClassFa = "trash-o")
public Object act(@Nullable final String comment, final boolean goToNext) {
    final Object nextTaskIfAny = nextTaskOrWarnIfRequired(goToNext);
    Document mixinResult = mixin().act(comment);
    return coalesce(nextTaskIfAny, mixinResult);
}
Also used : Document(org.incode.module.document.dom.impl.docs.Document) 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