use of org.apache.isis.applib.annotation.Action 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;
}
use of org.apache.isis.applib.annotation.Action in project estatio by estatio.
the class Lease_DownloadBudgetCalculationsForLease method downloadBudgetCalculationsForLease.
@Action(semantics = SemanticsOf.SAFE)
@ActionLayout(cssClassFa = "fa-download")
@MemberOrder(name = "budgetCalculationRuns", sequence = "1")
public Blob downloadBudgetCalculationsForLease(Budget budget, BudgetCalculationType type) {
final String fileName = lease.getReference() + " - budget details" + ".xlsx";
WorksheetSpec spec = new WorksheetSpec(DetailedCalculationResultViewmodel.class, "values for lease");
WorksheetContent worksheetContent = new WorksheetContent(budgetAssignmentService.getDetailedCalculationResults(lease, budget, type), spec);
return excelService.toExcelPivot(worksheetContent, fileName);
}
use of org.apache.isis.applib.annotation.Action in project estatio by estatio.
the class LeaseTermForServiceChargeBudgetAuditManager method upload.
// endregion
// region > upload (action)
@Action(publishing = Publishing.DISABLED, semantics = SemanticsOf.IDEMPOTENT)
public LeaseTermForServiceChargeBudgetAuditManager upload(@Parameter(fileAccept = ".xlsx") @ParameterLayout(named = "Excel spreadsheet") final Blob spreadsheet) {
List<LeaseTermForServiceChargeBudgetAuditLineItem> lineItems = excelService.fromExcel(spreadsheet, LeaseTermForServiceChargeBudgetAuditLineItem.class, "lease terms");
for (LeaseTermForServiceChargeBudgetAuditLineItem lineItem : lineItems) {
final LeaseTermForServiceCharge leaseTerm = lineItem.getLeaseTerm();
leaseTerm.setAuditedValue(lineItem.getAuditedValue());
leaseTerm.setBudgetedValue(lineItem.getBudgetedValue());
final LeaseTermForServiceCharge nextLeaseTerm = (LeaseTermForServiceCharge) leaseTerm.getNext();
final LeaseTermForServiceCharge nextLeaseTermUploaded = lineItem.getNextLeaseTerm();
if (nextLeaseTerm != null && nextLeaseTerm == nextLeaseTermUploaded) {
nextLeaseTerm.setBudgetedValue(lineItem.getNextBudgetedValue());
}
}
return this;
}
use of org.apache.isis.applib.annotation.Action in project estatio by estatio.
the class KeyItemImportExportLineItem method apply.
// region > apply (action)
@Action(semantics = SemanticsOf.IDEMPOTENT, invokeOn = InvokeOn.OBJECT_AND_COLLECTION, publishing = Publishing.DISABLED)
public KeyItem apply() {
switch(getStatus()) {
case ADDED:
KeyItem keyItem = new KeyItem();
keyItem.setKeyTable(getKeyTable());
keyItem.setUnit(getUnit());
keyItem.setValue(getKeyValue().setScale(keyTable.getPrecision(), BigDecimal.ROUND_HALF_UP));
keyItem.setSourceValue(getSourceValue().setScale(2, BigDecimal.ROUND_HALF_UP));
container.persistIfNotAlready(keyItem);
break;
case UPDATED:
getKeyItem().changeValue(this.getKeyValue().setScale(keyTable.getPrecision(), BigDecimal.ROUND_HALF_UP));
getKeyItem().setSourceValue(this.getSourceValue().setScale(2, BigDecimal.ROUND_HALF_UP));
break;
case DELETED:
String message = "KeyItem for unit " + getKeyItem().getUnit().getReference() + " deleted";
getKeyItem().deleteBudgetKeyItem();
container.informUser(message);
return null;
case NOT_FOUND:
container.informUser("KeyItem not found");
return null;
default:
break;
}
return getKeyItem();
}
use of org.apache.isis.applib.annotation.Action in project estatio by estatio.
the class OrderInvoiceImportMenu method importOrdersAndInvoices.
@Action(semantics = SemanticsOf.SAFE)
@MemberOrder(sequence = "1")
public OrderInvoiceSheet importOrdersAndInvoices(final String sheetName, final Blob spreadSheet) {
final List<OrderInvoiceLine> lines = orderInvoiceImportService.createLines(sheetName, spreadSheet);
final OrderInvoiceSheet sheet = factoryService.instantiate(OrderInvoiceSheet.class);
sheet.setLines(lines);
return sheet;
}
Aggregations