private void addRuntimeStatistic(
      Integer billingProcessId, Integer language, BillingProcessRunDTOEx runDto) {
    for (Iterator iter = new BillingProcessDAS().getCountAndSum(billingProcessId);
        iter.hasNext(); ) {
      Object[] row = (Object[]) iter.next();

      BillingProcessRunTotalDTOEx totalRowDto = new BillingProcessRunTotalDTOEx();
      totalRowDto.setProcessRun(runDto);
      totalRowDto.setCurrency(new CurrencyDAS().find((Integer) row[2]));
      totalRowDto.setCurrencyName(totalRowDto.getCurrency().getDescription(language));
      totalRowDto.setId(-1);
      totalRowDto.setTotalInvoiced((BigDecimal) row[1]);
      totalRowDto.setTotalNotPaid(BigDecimal.ZERO);
      totalRowDto.setTotalPaid(BigDecimal.ZERO);

      // now go over the totals by payment method
      Hashtable totals = new Hashtable();
      for (Iterator itt =
              new BillingProcessDAS().getSuccessfulProcessCurrencyMethodAndSum(billingProcessId);
          itt.hasNext(); ) {
        Object[] payedRow = (Object[]) itt.next();
        if (payedRow[0].equals(totalRowDto.getCurrency().getId())) {
          PaymentMethodDTO paymentMethod = new PaymentMethodDAS().find((Integer) payedRow[1]);
          BigDecimal payed = (BigDecimal) payedRow[2];
          totals.put(paymentMethod.getDescription(language), payed);
          totalRowDto.setTotalPaid(totalRowDto.getTotalPaid().add(payed));
        }
      }
      totalRowDto.setPmTotals(totals);
      for (Iterator itt = new BillingProcessDAS().getFailedProcessCurrencyAndSum(billingProcessId);
          itt.hasNext(); ) {
        Object[] unpayedRow = (Object[]) itt.next();
        if (unpayedRow[0].equals(totalRowDto.getCurrency().getId())) {
          totalRowDto.setTotalNotPaid(
              totalRowDto.getTotalNotPaid().add((BigDecimal) unpayedRow[1]));
        }
      }

      runDto.setInvoicesGenerated(runDto.getInvoicesGenerated() + ((Long) row[0]).intValue());
      runDto.getTotals().add(totalRowDto);
    }
  }