use of org.estatio.module.base.platform.applib.ReasonBuffer2 in project estatio by estatio.
the class IncomingInvoice method disableAddItem.
public String disableAddItem() {
final ReasonBuffer2 buf = ReasonBuffer2.forSingle("Cannot add item because");
buf.append(amountsCoveredByAmountsItems(), "invoice amounts are covered");
final Object viewContext = this;
reasonDisabledDueToApprovalStateIfAny(viewContext, buf);
return buf.getReason();
}
use of org.estatio.module.base.platform.applib.ReasonBuffer2 in project estatio by estatio.
the class IncomingInvoice method disableReverseItem.
public String disableReverseItem() {
ReasonBuffer2 buf = ReasonBuffer2.forAll("Invoice item cannot be reversed because");
final IncomingInvoice viewContext = this;
reasonDisabledDueToApprovalStateIfAny(viewContext, buf);
buf.append(choices0ReverseItem().isEmpty(), "no items to reverse");
return buf.getReason();
}
use of org.estatio.module.base.platform.applib.ReasonBuffer2 in project estatio by estatio.
the class IncomingInvoiceItem method disableUpdateAmounts.
public String disableUpdateAmounts() {
final ReasonBuffer2 buf = ReasonBuffer2.forSingle("Cannot update amounts because");
appendReasonIfReversalOrReportedOrApprovalState(buf);
return buf.getReason();
}
use of org.estatio.module.base.platform.applib.ReasonBuffer2 in project estatio by estatio.
the class IncomingInvoiceItem method disableReverse.
public String disableReverse() {
final ReasonBuffer2 buf = ReasonBuffer2.forAll("Item cannot be reversed because");
final IncomingInvoice viewContext = getIncomingInvoice();
getIncomingInvoice().reasonDisabledDueToApprovalStateIfAny(viewContext, buf);
buf.append(getReportedDate() == null, "item has not yet been reported");
buf.append(getReversalOf() != null, "item is itself a reversal");
return buf.getReason();
}
use of org.estatio.module.base.platform.applib.ReasonBuffer2 in project estatio by estatio.
the class IncomingInvoiceItem method chargeIsImmutableReason.
String chargeIsImmutableReason() {
// nb: dimensions *are* allowed to change irrespective of state,
// so we don't check IncomingInvoice#isImmutableDueToState()
final ReasonBuffer2 buf = ReasonBuffer2.forAll("Charge cannot be changed because");
appendReasonIfReversalOrReported(buf);
appendReasonIfLinkedToAnOrder(buf);
appendReasonIfLinkedToABudget(buf);
return buf.getReason();
}
Aggregations