use of org.apache.isis.applib.annotation.Action in project estatio by estatio.
the class Task_reprioritizePushback method act.
@Action(semantics = SemanticsOf.SAFE)
@ActionLayout(contributed = Contributed.AS_ACTION, cssClassFa = "fa-arrow-right")
public Task act(final Integer pushbackByDays) {
final LocalDateTime newDateTime = task.getCreatedOn().plusDays(pushbackByDays);
task.setCreatedOn(newDateTime);
return task;
}
use of org.apache.isis.applib.annotation.Action in project estatio by estatio.
the class OrderItemInvoiceItemLink method remove.
@Action(semantics = SemanticsOf.NON_IDEMPOTENT_ARE_YOU_SURE)
public IncomingInvoiceItem remove() {
final IncomingInvoiceItem invoiceItem = getInvoiceItem();
repository.removeLink(this);
return invoiceItem;
}
use of org.apache.isis.applib.annotation.Action in project estatio by estatio.
the class PaymentBatch method downloadReviewSummary.
@Action(semantics = SemanticsOf.SAFE)
public Blob downloadReviewSummary(@Nullable final String documentName) {
List<CreditTransferExportLine> exportLines = new ArrayList<>();
int lineNumber = 1;
for (CreditTransfer transfer : getTransfers()) {
boolean newTransfer = true;
for (PaymentLine paymentLine : transfer.getLines()) {
String firstUse = creditTransferExportService.isFirstUseBankAccount(transfer) ? "YES" : "no";
exportLines.add(new CreditTransferExportLine(lineNumber, lineNumber == 1 ? getDebtorBankAccount().getIban() : null, lineNumber == 1 ? getCreatedOn().toString("dd-MMM-yyyy HH:mm") : null, newTransfer ? transfer.getEndToEndId() : null, newTransfer ? transfer.getSellerBankAccount().getIban() : null, newTransfer ? firstUse : null, newTransfer ? transfer.getSeller().getName() : null, newTransfer ? transfer.getSeller().getReference() : null, newTransfer ? transfer.getAmount().setScale(2, RoundingMode.HALF_UP) : null, newTransfer ? transfer.getCurrency().getName() : null, paymentLine.getInvoice().getInvoiceNumber(), paymentLine.getInvoice().getInvoiceDate(), paymentLine.getInvoice().getGrossAmount().setScale(2, RoundingMode.HALF_UP), creditTransferExportService.getApprovalStateTransitionSummary(paymentLine.getInvoice()), paymentLine.getInvoice().getDescriptionSummary(), creditTransferExportService.getInvoiceDocumentName(paymentLine.getInvoice()), paymentLine.getInvoice().getType() == IncomingInvoiceType.CAPEX ? paymentLine.getInvoice().getType().name() + " (" + paymentLine.getInvoice().getProjectSummary() + ")" : paymentLine.getInvoice().getType().name(), paymentLine.getInvoice().getPropertySummary()));
newTransfer = false;
lineNumber++;
}
}
String name = documentName != null ? documentName.concat(".xlsx") : fileNameWithSuffix("xlsx");
return excelService.toExcel(exportLines, CreditTransferExportLine.class, getRequestedExecutionDate() != null ? getRequestedExecutionDate().toString("yyyyMMdd-HHmm") : "DRAFT", name);
}
use of org.apache.isis.applib.annotation.Action in project estatio by estatio.
the class ChargeImportManager method importBlob.
// region > importBlob (action)
@Action(publishing = Publishing.DISABLED, semantics = SemanticsOf.IDEMPOTENT)
@CollectionLayout(paged = -1)
public List<ChargeImport> importBlob(@Parameter(fileAccept = ".xlsx") @ParameterLayout(named = "Excel spreadsheet") final Blob spreadsheet) {
List<ChargeImport> lineItems = excelService.fromExcel(spreadsheet, ChargeImport.class, ChargeImport.class.getSimpleName());
ChargeImport previous = null;
for (ChargeImport lineItem : lineItems) {
lineItem.importData(previous);
previous = lineItem;
}
return lineItems;
}
use of org.apache.isis.applib.annotation.Action in project estatio by estatio.
the class T_createAndAttachDocumentAndScheduleRender method $$.
/**
* Create a {@link Document} and attach using a {@link Paperclip}.
*/
@Action(domainEvent = ActionDomainEvent.class, semantics = SemanticsOf.NON_IDEMPOTENT)
@ActionLayout(contributed = Contributed.AS_ACTION)
@MemberOrder(name = "documents", sequence = "3.2")
public Object $$(final DocumentTemplate template) throws IOException {
final Document document = documentCreatorService.createDocumentAndAttachPaperclips(domainObject, template);
render(template, document);
return document;
}
Aggregations