Search in sources :

Example 1 with ReasonBuffer2

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

the class OrderItem method itemImmutableReasonIfIsImmutable.

private String itemImmutableReasonIfIsImmutable() {
    final ReasonBuffer2 buf = ReasonBuffer2.forSingle();
    itemImmutableIfLinkedToInvoiceItem(buf);
    itemImmutableIfOrderImmutable(buf);
    return buf.getReason();
}
Also used : ReasonBuffer2(org.estatio.module.base.platform.applib.ReasonBuffer2)

Example 2 with ReasonBuffer2

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

the class OrderItem_createInvoiceItemLink method validate0Act.

public String validate0Act(final IncomingInvoiceItem invoiceItem) {
    ReasonBuffer2 buf = ReasonBuffer2.forAll("Cannot link to this invoice item");
    buf.append(() -> invoiceItem.getCharge() != mixee.getCharge(), "charge is different");
    buf.append(() -> invoiceItem.getProject() != mixee.getProject(), "project is different");
    buf.append(() -> invoiceItem.getFixedAsset() != mixee.getProperty(), "property is different");
    return buf.getReason();
}
Also used : ReasonBuffer2(org.estatio.module.base.platform.applib.ReasonBuffer2)

Example 3 with ReasonBuffer2

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

the class OrderItem_updateInvoiceItemLink method validate0Act.

public String validate0Act(final IncomingInvoiceItem invoiceItem) {
    ReasonBuffer2 buf = ReasonBuffer2.forAll("Cannot link to this invoice item");
    buf.append(() -> invoiceItem.getCharge() != mixee.getCharge(), "charge is different");
    buf.append(() -> invoiceItem.getProject() != mixee.getProject(), "project is different");
    buf.append(() -> invoiceItem.getFixedAsset() != mixee.getProperty(), "property is different");
    return buf.getReason();
}
Also used : ReasonBuffer2(org.estatio.module.base.platform.applib.ReasonBuffer2)

Example 4 with ReasonBuffer2

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

the class IncomingInvoiceItem_updateOrderItemLink 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();
}
Also used : ReasonBuffer2(org.estatio.module.base.platform.applib.ReasonBuffer2)

Example 5 with ReasonBuffer2

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

the class IncomingInvoice method disableSplitItem.

public String disableSplitItem() {
    ReasonBuffer2 buf = ReasonBuffer2.forSingle("Cannot spli items because");
    reasonDisabledDueToApprovalStateIfAny(this, buf);
    buf.append(() -> choices0SplitItem().isEmpty(), "there are no items");
    return buf.getReason();
}
Also used : 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