Пример #1
0
  /**
   * Check for AVS verified required settlements when clicking the Next button on Capture & Review -
   * Offer page
   */
  public void offerNextButtonClick() {

    solveSelected();
    try {
      getAvCaches().clear();
      findSettlementAvData(dto);
      // forced to do the logic here since AvCache is a BayServ entity so we cannot use TaskRules
      boolean avsDone = true;
      String errorMsg = "Account verification status for AV required settlement account : ";
      for (ProtoAvCache item : avCaches) {
        if (!ValidationUtils.isIn(item.getAppStatus(), SystemConstants.AV_COMPLETED)) {
          String accountRef = "";
          for (ProtoSettlement settlement : quote.getSettlements()) {
            String compare = StringUtils.right(settlement.getAccount().getAccountNumber(), 10);
            if (compare.equals(item.getNumber().toString())) {
              accountRef = settlement.getFormattedAccountNumber();
              avsDone = false;
              break;
            }
          }
          errorMessage("AVS", errorMsg + accountRef + " : " + item.getAppStatus(), ERR_GLOBAL);
        }
      }
      if (!avsDone) return;

      taskRules.postOfferRules(quote, task);

      taskRules.loanCOCheckoutRules(quote);

      filterSelectedCellularOffers(quote);
      fixCurrentOffer(quote);
      dto.initialiseConfirmOfferCall();
      getRc().execute(UI_NEXT);

    } catch (ServiceException e) {
      popupErrorMessage(e.getError());
      getRc().update(UI_MAIN);
    }
  }
Пример #2
0
 /**
  * Maintains the list of selected settlements, for use in generating documents for newly selected
  * settlements
  */
 protected void maintainSelectedSettlementList(List<ProtoSettlement> settlementsList) {
   for (ProtoSettlement settlement : settlementsList) {
     logger.debug(
         "Settlement: "
             + settlement.getFormattedAccountNumber()
             + " isSelected: "
             + settlement.isSelected());
     if (settlement.isSelected()) {
       // auto settlements must not create a settlement letter
       if (!settlement.isAutoSettle()) {
         selectedSettlements.put(
             ConvertUtils.stringAsNumber(settlement.getFormattedAccountNumber(), false),
             settlement);
       }
     } else {
       selectedSettlements.remove(
           ConvertUtils.stringAsNumber(settlement.getFormattedAccountNumber(), false));
     }
   }
 }
Пример #3
0
  @Override
  public void finish(ActionEvent event) {
    dto.setSigningBranchCode(new BigDecimal(signingBranchCode));

    super.finish(event);
    // let descendants implement their own save and finish methods
    if (!this.getClass().getSimpleName().equals(TASK)) return;

    try {

      // don't do fraud checks for insurance stand-alone
      if (!dto.isInsStandalone()) runSystemFraud(dto, contructFraudSearch(dto));

      // Set Presence UCID and TimeStamp

      if (!isXdsOnlyRequired()) {

        dto.setConfirmOfferCallUCID(dto.getPb().getUcId());
        dto.setConfirmOfferCallTimeStamp(Calendar.getInstance().getTime());

        // check docs are generated and sent (contracting only)
        try {
          if (!dto.isCreditLifeSubstitution()) {

            // don't check loan offer changes if doing confirm offer insurance standalone
            if (!task.getTaskTarget().equals("task.confirm.offer.call.insurance")) {
              if (dto.getContractingMethod() == EContractingMethod.BRANCH)
                taskRules.checkOfferChangeIsGenerated(quote.getCurrentOffer());
              // TODO : Fix this, should not be disabled
              else if (!dto.getRequestedProduct().equals(EProductType.MEDICAL))
                taskRules.checkOfferChangeIsGeneratedAndSent(quote.getCurrentOffer());

              // must send it if !branchpre
              if (!dto.getContractingMethod().equals(EContractingMethod.BRANCH))
                if (!docSent) throw new ServiceException(ErrorCodes.CVA071);
            }
          }

          // generates and send all required insurance stand-alone documents (if there is no AVS)
          if (dto.isInsStandalone()) {
            String skipinsavs = getVariable(ConvertUtils.asInt(dto.getPid()), "skipinsavs");
            boolean sendDocsNow = true;
            if (skipinsavs != null) sendDocsNow = ConvertUtils.asBoolean(skipinsavs);

            if (sendDocsNow) {
              loadInsuranceDocumentsToSend();
              sendSpecificDocuments(cart, task, SystemConstants.DOC_INS_CODES);
            }
          }

          // check av (settlements only)
          avBuilder.submitAV(task, dto);
          getAvCaches().clear();
          findSettlementAvData(dto);
          // forced to do the logic here since AvCache is a BayServ entity so we cannot use
          // TaskRules
          boolean avsDone = true;
          String errorMsg = "Account verification status for AV required settlement account : ";
          for (ProtoAvCache item : avCaches) {
            if (!ValidationUtils.isIn(item.getAppStatus(), SystemConstants.AV_COMPLETED)) {
              String accountRef = "";
              for (ProtoSettlement settlement : quote.getSettlements()) {
                String compare = StringUtils.right(settlement.getAccount().getAccountNumber(), 10);
                if (compare.equals(item.getNumber().toString())) {
                  accountRef = settlement.getFormattedAccountNumber();
                  avsDone = false;
                  break;
                }
              }
              errorMessage(
                  "AVS ", errorMsg + " " + accountRef + " : " + item.getAppStatus(), ERR_GLOBAL);
            }
          }
          if (!avsDone) return;

        } catch (ServiceException e) {
          popupErrorMessage(e.getError());
          return;
        }
      }

      completeConfirmOfferFlux();

      if (!isXdsOnlyRequired()) {
        if (dto.getContractingMethod() == EContractingMethod.BRANCH
            && getFluxTask(
                        quote.getPid().intValue(),
                        "task.account.verification",
                        new EFluxTaskStatus[] {
                          EFluxTaskStatus.CREATED,
                          EFluxTaskStatus.IN_PROGRESS,
                          EFluxTaskStatus.READY,
                          EFluxTaskStatus.SUSPENDED
                        })
                    .size()
                <= 0
            && getFluxTask(
                        quote.getPid().intValue(),
                        "task.employment.confirm",
                        new EFluxTaskStatus[] {
                          EFluxTaskStatus.CREATED,
                          EFluxTaskStatus.IN_PROGRESS,
                          EFluxTaskStatus.READY,
                          EFluxTaskStatus.SUSPENDED
                        })
                    .size()
                <= 0) {
          // Now send Sign at branch sms
          if (!dto.isInsStandalone()) {
            bayserv.sendMessage(MessageBuilder.buildBranchSignSms(dto));
          }
        }
      }

      saveAndExit();

    } catch (ServiceException e) {
      logger.error(e);
      e.getError().setReference(transmitErrorData(quote, TASK));
      info.displayBugDialog(e.getError());
    } catch (Exception e) {
      logger.error(e);
      BaseError error = quote.addError(ErrorCodes.UHE000, e);
      error.setReference(transmitErrorData(quote, TASK));
      info.displayBugDialog(error);
    }
  }