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);
}
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;
}
Aggregations