Search in sources :

Example 16 with MemberOrder

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);
}
Also used : Party(org.estatio.module.party.dom.Party) Property(org.estatio.module.asset.dom.Property) ApplicationTenancy(org.isisaddons.module.security.dom.tenancy.ApplicationTenancy) Action(org.apache.isis.applib.annotation.Action) MemberOrder(org.apache.isis.applib.annotation.MemberOrder) ActionLayout(org.apache.isis.applib.annotation.ActionLayout)

Example 17 with MemberOrder

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;
}
Also used : UnitSize(org.estatio.module.lease.dom.occupancy.tags.UnitSize) Action(org.apache.isis.applib.annotation.Action) MemberOrder(org.apache.isis.applib.annotation.MemberOrder)

Example 18 with MemberOrder

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));
}
Also used : Lease(org.estatio.module.lease.dom.Lease) Period(org.joda.time.Period) DateTime(org.joda.time.DateTime) Action(org.apache.isis.applib.annotation.Action) MemberOrder(org.apache.isis.applib.annotation.MemberOrder)

Example 19 with MemberOrder

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;
    }
}
Also used : ArrayList(java.util.ArrayList) LocalDateInterval(org.incode.module.base.dom.valuetypes.LocalDateInterval) Action(org.apache.isis.applib.annotation.Action) MemberOrder(org.apache.isis.applib.annotation.MemberOrder)

Example 20 with MemberOrder

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;
}
Also used : ArrayList(java.util.ArrayList) DistributionService(org.estatio.module.budget.dom.DistributionService) MemberOrder(org.apache.isis.applib.annotation.MemberOrder) Action(org.apache.isis.applib.annotation.Action)

Aggregations

MemberOrder (org.apache.isis.applib.annotation.MemberOrder)34 Action (org.apache.isis.applib.annotation.Action)29 ActionLayout (org.apache.isis.applib.annotation.ActionLayout)15 Document (org.incode.module.document.dom.impl.docs.Document)5 WorksheetSpec (org.isisaddons.module.excel.dom.WorksheetSpec)4 ArrayList (java.util.ArrayList)3 WorksheetContent (org.isisaddons.module.excel.dom.WorksheetContent)3 ApplicationTenancy (org.isisaddons.module.security.dom.tenancy.ApplicationTenancy)3 Period (org.joda.time.Period)3 FixtureScript (org.apache.isis.applib.fixturescripts.FixtureScript)2 Order (org.estatio.module.capex.dom.order.Order)2 OrderItem (org.estatio.module.capex.dom.order.OrderItem)2 Lease (org.estatio.module.lease.dom.Lease)2 CreateRetroInvoices (org.estatio.module.lease.migrations.CreateRetroInvoices)2 LocalDateInterval (org.incode.module.base.dom.valuetypes.LocalDateInterval)2 DocumentType (org.incode.module.document.dom.impl.types.DocumentType)2 DateTime (org.joda.time.DateTime)2 LocalDate (org.joda.time.LocalDate)2 BigDecimal (java.math.BigDecimal)1 List (java.util.List)1