Search in sources :

Example 1 with FixedAssetOwnership

use of org.estatio.module.asset.dom.ownership.FixedAssetOwnership in project estatio by estatio.

the class IncomingDocViewModel method deriveBuyer.

private void deriveBuyer() {
    Party ownerCandidate = null;
    if (hasProperty()) {
        for (FixedAssetOwnership fos : getProperty().getOwners()) {
            if (fos.getOwnershipType() == OwnershipType.FULL) {
                ownerCandidate = fos.getOwner();
                continue;
            }
        }
        // temporary extra search until fixed asset ownership is fully in use
        if (ownerCandidate == null && getProperty().ownerCandidates().size() > 0) {
            ownerCandidate = getProperty().ownerCandidates().get(0).getParty();
        }
    }
    setBuyer(ownerCandidate);
}
Also used : Party(org.estatio.module.party.dom.Party) FixedAssetOwnership(org.estatio.module.asset.dom.ownership.FixedAssetOwnership)

Example 2 with FixedAssetOwnership

use of org.estatio.module.asset.dom.ownership.FixedAssetOwnership in project estatio by estatio.

the class FixedAsset method addOwner.

@MemberOrder(name = "owners", sequence = "1")
public FixedAsset addOwner(final Party newOwner, final OwnershipType type) {
    FixedAssetOwnership fixedAssetOwnership = fixedAssetOwnershipRepository.newOwnership(newOwner, type, this);
    getOwners().add(fixedAssetOwnership);
    return this;
}
Also used : FixedAssetOwnership(org.estatio.module.asset.dom.ownership.FixedAssetOwnership) MemberOrder(org.apache.isis.applib.annotation.MemberOrder)

Aggregations

FixedAssetOwnership (org.estatio.module.asset.dom.ownership.FixedAssetOwnership)2 MemberOrder (org.apache.isis.applib.annotation.MemberOrder)1 Party (org.estatio.module.party.dom.Party)1