コード例 #1
0
  /**
   * using preqId from vendor credit memo initiation screen, the corresponding preq documents are
   * collected and then the distribution menthod is retrieved from it..
   *
   * @param preqId
   * @return distributionMethod
   */
  protected String getDistributionMethodFromPReq(String preqId) {
    String distributionMethod = "";

    Map criteria = new HashMap();
    criteria.put("purapDocumentIdentifier", preqId);

    List<PaymentRequestDocument> preqDocuments =
        (List<PaymentRequestDocument>)
            SpringContext.getBean(BusinessObjectService.class)
                .findMatching(PaymentRequestDocument.class, criteria);

    for (PaymentRequestDocument preqDoc : preqDocuments) {
      if (ObjectUtils.isNotNull(preqDoc.getAccountDistributionMethod())) {
        distributionMethod = preqDoc.getAccountDistributionMethod();
        return distributionMethod;
      }
    }

    return distributionMethod;
  }