use of org.apache.isis.applib.annotation.MemberOrder in project estatio by estatio.
the class InvoiceMenu method newInvoiceForLease.
@ActionLayout(contributed = Contributed.AS_NEITHER)
@Action(semantics = SemanticsOf.NON_IDEMPOTENT)
@MemberOrder(sequence = "1")
public Invoice newInvoiceForLease(final Lease lease, final LocalDate dueDate, @Parameter(optionality = Optionality.OPTIONAL) final PaymentMethod paymentMethod, final Currency currency) {
final Property propertyIfAny = lease.getProperty();
final Party seller = lease.getPrimaryParty();
final Party buyer = lease.getSecondaryParty();
final ApplicationTenancy propertySellerTenancy = estatioApplicationTenancyRepositoryForLease.findOrCreateTenancyFor(propertyIfAny, seller);
return invoiceForLeaseRepository.newInvoice(propertySellerTenancy, seller, buyer, paymentMethod == null ? lease.defaultPaymentMethod() : paymentMethod, currency, dueDate, lease, null);
}
use of org.apache.isis.applib.annotation.MemberOrder in project estatio by estatio.
the class UnitSizeMenu method newUnitSize.
@Action(semantics = SemanticsOf.NON_IDEMPOTENT)
@MemberOrder(sequence = "1")
public UnitSize newUnitSize(final String unitSizeName) {
UnitSize unitSize = newTransientInstance(UnitSize.class);
unitSize.setName(unitSizeName);
persist(unitSize);
return unitSize;
}
use of org.apache.isis.applib.annotation.MemberOrder in project estatio by estatio.
the class LeaseMenu method verifyAllLeases.
@Action(semantics = SemanticsOf.IDEMPOTENT, restrictTo = RestrictTo.PROTOTYPING)
@MemberOrder(sequence = "98")
public String verifyAllLeases() {
DateTime dt = DateTime.now();
List<Lease> leases = allLeases();
for (Lease lease : leases) {
lease.verifyUntil(clockService.now());
}
Period p = new Period(dt, DateTime.now());
return String.format("Verified %d leases in %s", leases.size(), JodaPeriodUtils.asString(p));
}
use of org.apache.isis.applib.annotation.MemberOrder in project estatio by estatio.
the class LeaseTermRepository method findTermsWithInvalidInterval.
@Action(semantics = SemanticsOf.SAFE)
@MemberOrder(sequence = "30")
public List<LeaseTerm> findTermsWithInvalidInterval() {
List<LeaseTerm> lts = allLeaseTerms();
List<LeaseTerm> returnList = new ArrayList<>();
LocalDateInterval ldi;
for (LeaseTerm lt : lts) {
try {
if ((ldi = lt.getEffectiveInterval()) == null) {
returnList.add(lt);
continue;
}
if (!ldi.isValid()) {
returnList.add(lt);
continue;
}
} catch (IllegalArgumentException e) {
e.printStackTrace();
returnList.add(lt);
}
}
if (returnList.isEmpty()) {
return null;
} else {
return returnList;
}
}
use of org.apache.isis.applib.annotation.MemberOrder in project estatio by estatio.
the class KeyTable method distributeSourceValues.
// //////////////////////////////////////
@MemberOrder(name = "items", sequence = "4")
@Action(semantics = SemanticsOf.NON_IDEMPOTENT_ARE_YOU_SURE)
public KeyTable distributeSourceValues() {
DistributionService distributionService = new DistributionService();
distributionService.distribute(new ArrayList(getItems()), getKeyValueMethod().divider(this), getPrecision());
return this;
}
Aggregations