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