Search in sources :

Example 31 with ReasonBuffer2

use of org.estatio.module.base.platform.applib.ReasonBuffer2 in project estatio by estatio.

the class IncomingInvoice method reasonDisabledDueToApprovalStateIfAny.

String reasonDisabledDueToApprovalStateIfAny(final Object viewContext) {
    final ReasonBuffer2 buf = ReasonBuffer2.forSingle("Cannot modify invoice because");
    reasonDisabledDueToApprovalStateIfAny(viewContext, buf);
    return buf.getReason();
}
Also used : ReasonBuffer2(org.estatio.module.base.platform.applib.ReasonBuffer2)

Example 32 with ReasonBuffer2

use of org.estatio.module.base.platform.applib.ReasonBuffer2 in project estatio by estatio.

the class IncomingInvoice method disableEditInvoiceNumber.

public String disableEditInvoiceNumber() {
    final ReasonBuffer2 buf = ReasonBuffer2.forSingle("Cannot edit invoice number because");
    final Object viewContext = this;
    reasonDisabledDueToApprovalStateIfAny(viewContext, buf);
    return buf.getReason();
}
Also used : DomainObject(org.apache.isis.applib.annotation.DomainObject) ReasonBuffer2(org.estatio.module.base.platform.applib.ReasonBuffer2)

Example 33 with ReasonBuffer2

use of org.estatio.module.base.platform.applib.ReasonBuffer2 in project estatio by estatio.

the class IncomingInvoice method disableMergeItems.

public String disableMergeItems() {
    final ReasonBuffer2 buf = ReasonBuffer2.forSingle("Cannot merge items because");
    final Object viewContext = this;
    reasonDisabledDueToApprovalStateIfAny(viewContext, buf);
    buf.append(() -> getItems().size() < 2, "merging needs 2 or more items");
    return buf.getReason();
}
Also used : DomainObject(org.apache.isis.applib.annotation.DomainObject) ReasonBuffer2(org.estatio.module.base.platform.applib.ReasonBuffer2)

Example 34 with ReasonBuffer2

use of org.estatio.module.base.platform.applib.ReasonBuffer2 in project estatio by estatio.

the class IncomingInvoice method disableChangeDates.

public String disableChangeDates() {
    final ReasonBuffer2 buf = ReasonBuffer2.forSingle("Cannot change dates because");
    final Object viewContext = this;
    reasonDisabledDueToApprovalStateIfAny(viewContext, buf);
    return buf.getReason();
}
Also used : DomainObject(org.apache.isis.applib.annotation.DomainObject) ReasonBuffer2(org.estatio.module.base.platform.applib.ReasonBuffer2)

Example 35 with ReasonBuffer2

use of org.estatio.module.base.platform.applib.ReasonBuffer2 in project estatio by estatio.

the class IncomingInvoice method disableEditSeller.

public String disableEditSeller() {
    final ReasonBuffer2 buf = ReasonBuffer2.forSingle("Cannot edit seller because");
    final Object viewContext = this;
    reasonDisabledDueToApprovalStateIfAny(viewContext, buf);
    buf.append(this::sellerIsImmutableReason);
    return buf.getReason();
}
Also used : DomainObject(org.apache.isis.applib.annotation.DomainObject) ReasonBuffer2(org.estatio.module.base.platform.applib.ReasonBuffer2)

Aggregations

ReasonBuffer2 (org.estatio.module.base.platform.applib.ReasonBuffer2)40 Test (org.junit.Test)10 DomainObject (org.apache.isis.applib.annotation.DomainObject)7 IncomingInvoice (org.estatio.module.capex.dom.invoice.IncomingInvoice)1 IncomingInvoiceItem (org.estatio.module.capex.dom.invoice.IncomingInvoiceItem)1 InvoiceItem (org.estatio.module.invoice.dom.InvoiceItem)1