Commit d1f6b4dd authored by thomas's avatar thomas
Browse files

[23107] add test if order is partial done and show info on selection

parent c694158c
Pipeline #22423 passed with stages
in 4 minutes and 11 seconds
......@@ -131,4 +131,18 @@ public class Order extends AbstractIdDeleteModelAdapter<ch.elexis.core.jpa.entit
}
return true;
}
@Override
public boolean isPartialDone(){
boolean foundDone = false;
boolean foundNotDone = false;
for (IOrderEntry iOrderEntry : getEntries()) {
if (iOrderEntry.getState() == OrderEntryState.DONE) {
foundDone = true;
} else {
foundNotDone = true;
}
}
return foundDone && foundNotDone;
}
}
......@@ -134,6 +134,9 @@ public class SelectBestellungDialog extends SelectionDialog {
if (order.isDone()) {
return "*";
} else {
if (order.isPartialDone()) {
return "/";
}
return "";
}
}
......
......@@ -840,6 +840,7 @@
<eParameters name="stock" eType="#//IStock"/>
<eParameters name="article" eType="#//IArticle"/>
</eOperations>
<eOperations name="isPartialDone" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="entries" upperBound="-1"
eType="#//IOrderEntry"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="timestamp" eType="ecore:EDataType types.ecore#//LocalDateTime"/>
......
......@@ -539,6 +539,7 @@
<genParameters ecoreParameter="model.ecore#//IOrder/findOrderEntry/stock"/>
<genParameters ecoreParameter="model.ecore#//IOrder/findOrderEntry/article"/>
</genOperations>
<genOperations ecoreOperation="model.ecore#//IOrder/isPartialDone"/>
</genClasses>
<genClasses ecoreClass="model.ecore#//IAddress">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute model.ecore#//IAddress/street1"/>
......
......@@ -124,4 +124,12 @@ public interface IOrder extends Identifiable, Deleteable {
*/
IOrderEntry findOrderEntry(IStock stock, IArticle article);
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @model kind="operation"
* @generated
*/
boolean isPartialDone();
} // IOrder
......@@ -6148,6 +6148,8 @@ public class ModelPackageImpl extends EPackageImpl implements ModelPackage {
addEParameter(op, this.getIStock(), "stock", 0, 1, IS_UNIQUE, IS_ORDERED);
addEParameter(op, this.getIArticle(), "article", 0, 1, IS_UNIQUE, IS_ORDERED);
addEOperation(iOrderEClass, ecorePackage.getEBoolean(), "isPartialDone", 0, 1, IS_UNIQUE, IS_ORDERED);
initEClass(iAddressEClass, IAddress.class, "IAddress", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getIAddress_Street1(), ecorePackage.getEString(), "street1", null, 0, 1, IAddress.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getIAddress_Street2(), ecorePackage.getEString(), "street2", null, 0, 1, IAddress.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment