use of org.estatio.module.base.platform.applib.ReasonBuffer2 in project estatio by estatio.
the class Order_discard method disableAct.
public String disableAct() {
ReasonBuffer2 buf = ReasonBuffer2.forSingle();
buf.append(!linkRepository.findByOrder(order).isEmpty(), "One or more items have been linked to an invoice");
buf.append(reasonGuardNotSatisified());
return buf.getReason();
}
use of org.estatio.module.base.platform.applib.ReasonBuffer2 in project estatio by estatio.
the class IncomingInvoiceItem_createOrderItemLink method validate0Act.
public String validate0Act(final OrderItem orderItem) {
ReasonBuffer2 buf = ReasonBuffer2.forAll("Cannot link to this order item");
buf.append(() -> mixee.getCharge() != orderItem.getCharge(), "charge is different");
buf.append(() -> mixee.getProject() != orderItem.getProject(), "project is different");
buf.append(() -> mixee.getFixedAsset() != orderItem.getProperty(), "property is different");
return buf.getReason();
}
use of org.estatio.module.base.platform.applib.ReasonBuffer2 in project estatio by estatio.
the class IncomingInvoiceItem_createOrderItemLink method disableAct.
public String disableAct() {
ReasonBuffer2 buf = ReasonBuffer2.forSingle();
buf.append(() -> orderItemInvoiceItemLinkRepository.findByInvoiceItem(mixee).isPresent(), "Already linked to an order item");
buf.append(() -> mixee.getInvoice().getSeller() == null, "Invoice's seller is required before items can be linked");
return buf.getReason();
}
use of org.estatio.module.base.platform.applib.ReasonBuffer2 in project estatio by estatio.
the class IncomingInvoiceItem_removeOrderItemLink method disableAct.
public String disableAct() {
ReasonBuffer2 buf = ReasonBuffer2.forSingle();
buf.append(() -> !orderItemIfAny().isPresent(), "Not linked to an order item");
buf.append(() -> mixee.getReportedDate() != null, "Invoice item has been reported");
buf.append(() -> mixee.getReversalOf() != null, "Invoice item is a reversal");
return buf.getReason();
}
use of org.estatio.module.base.platform.applib.ReasonBuffer2 in project estatio by estatio.
the class IncomingInvoice method disableEditBuyer.
public String disableEditBuyer() {
final ReasonBuffer2 buf = ReasonBuffer2.forSingle("Cannot edit buyer because");
final Object viewContext = this;
reasonDisabledDueToApprovalStateIfAny(viewContext, buf);
return buf.getReason();
}
Aggregations