use of org.estatio.module.asset.dom.FixedAsset in project estatio by estatio.
the class PartyRoleMemberInferenceServiceForFixedAssetRoleAndOrder method doInferMembersOf.
@Override
protected List<Person> doInferMembersOf(final FixedAssetRoleTypeEnum partyRoleType, final Order order) {
final FixedAsset fixedAsset = order.getProperty();
if (fixedAsset == null) {
// can't go any further
return null;
}
final List<FixedAssetRole> fixedAssetRoles = fixedAssetRoleRepository.findByAssetAndType(fixedAsset, partyRoleType);
return currentPersonsFrom(fixedAssetRoles);
}
use of org.estatio.module.asset.dom.FixedAsset in project estatio by estatio.
the class InvoiceAttributesVM method getUnitName.
@Programmatic
public String getUnitName() {
final Optional<InvoiceItem> invoiceItemOptional = invoice.getItems().stream().findFirst();
if (invoiceItemOptional.isPresent()) {
final InvoiceItemForLease invoiceItem = (InvoiceItemForLease) invoiceItemOptional.get();
final FixedAsset fixedAsset = invoiceItem.getFixedAsset();
if (fixedAsset != null && fixedAsset instanceof Unit) {
return fixedAsset.getName();
}
}
return null;
}
use of org.estatio.module.asset.dom.FixedAsset in project estatio by estatio.
the class IncomingInvoice method copyWithLinks.
private IncomingInvoiceItem copyWithLinks(final IncomingInvoiceItem itemToReverse, final Sort sort) {
final IncomingInvoiceType type = itemToReverse.getIncomingInvoiceType();
final String description = itemToReverse.getDescription();
final Charge charge = itemToReverse.getCharge();
final BigDecimal netAmount = itemToReverse.getNetAmount();
final BigDecimal vatAmount = itemToReverse.getVatAmount();
final BigDecimal grossAmount = itemToReverse.getGrossAmount();
final Tax tax = itemToReverse.getTax();
final LocalDate dueDate = itemToReverse.getDueDate();
final String period = itemToReverse.getPeriod();
final FixedAsset fixedAsset = itemToReverse.getFixedAsset();
final Project project = itemToReverse.getProject();
final BudgetItem budgetItem = itemToReverse.getBudgetItem();
final IncomingInvoiceItem copyItem = addItemToThis(type, charge, sort.prefixTo(description), sort.adjust(netAmount), sort.adjust(vatAmount), sort.adjust(grossAmount), tax, dueDate, period, fixedAsset, project, budgetItem);
if (sort == Sort.REVERSAL) {
copyItem.setReversalOf(itemToReverse);
}
final Optional<OrderItemInvoiceItemLink> linkIfAny = orderItemInvoiceItemLinkRepository.findByInvoiceItem(itemToReverse);
linkIfAny.ifPresent(link -> {
orderItemInvoiceItemLinkRepository.createLink(link.getOrderItem(), copyItem, sort.adjust(link.getNetAmount()));
});
return copyItem;
}
Aggregations