@@ -0,0 +1,1750 @@
+/*%0A *%0A *  Copyright 2012-2014 Eurocommercial Properties NV%0A *%0A *%0A *  Licensed under the Apache License, Version 2.0 (the%0A *  %22License%22); you may not use this file except in compliance%0A *  with the License.  You may obtain a copy of the License at%0A *%0A *        http://www.apache.org/licenses/LICENSE-2.0%0A *%0A *  Unless required by applicable law or agreed to in writing,%0A *  software distributed under the License is distributed on an%0A *  %22AS IS%22 BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY%0A *  KIND, either express or implied.  See the License for the%0A *  specific language governing permissions and limitations%0A *  under the License.%0A */%0Apackage org.estatio.dom.lease.invoicing.dnc;%0A%0Aimport java.util.ArrayList;%0A%0Aimport com.google.common.collect.Lists;%0A%0Aimport org.apache.isis.applib.annotation.DomainService;%0Aimport org.apache.isis.applib.annotation.NatureOfService;%0A%0Aimport org.incode.module.document.dom.impl.docs.Document;%0Aimport org.incode.module.document.dom.spi.SupportingDocumentsEvaluator;%0A%0Aimport org.estatio.dom.invoice.Constants;%0A%0A@DomainService(%0A        nature = NatureOfService.DOMAIN,%0A        menuOrder = %22100%22%0A)%0Apublic class SupportingDocumentsEvaluatorBasedOnDocTypes implements SupportingDocumentsEvaluator %7B%0A%0A    private static final ArrayList%3CString%3E REGULAR_DOC_TYPES =%0A            Lists.newArrayList(Constants.DOC_TYPE_REF_INVOICE, Constants.DOC_TYPE_REF_PRELIM);%0A%0A    @Override%0A    public Document supportedBy(final Document candidateSupportingDocument) %7B%0A        return null;%0A    %7D%0A%0A    @Override%0A    public boolean isSupporting(final Document candidateSupportingDocument) %7B%0A        String docTypeRef = candidateSupportingDocument.getType().getReference();%0A%0A        return !REGULAR_DOC_TYPES.contains(docTypeRef);%0A    %7D%0A%0A%7D%0A

use SupportingDocumentEvaluator to suppress the supportingDocuments and other clobber for receipts etc.