code: function nextPaymentDate(loan, cb) {
      var d = Q.defer();
      var item;
      var result;
      if (!loan || !loan.dateLastPaymentWasReceived || !loan.amortizationTable) {
        d.reject('required parameters for nextPaymentDue not provided');
      } else {
        var dateLastPaymentWasReceived = moment(loan.dateLastPaymentWasReceived);
        for (var i = 0, len = loan.amortizationTable.length; i < len; i++) {
          item = loan.amortizationTable[i];
          txDate = moment(item.txDate);
          if (txDate.isAfter(dateLastPaymentWasReceived)) {
            result = item.txDate;
            break;
          }
          result = item.txDate;
        }
      }
      loan.nextPaymentDate = result;
      d.resolve(loan);
      if (cb) return cb(loan);
      return d.promise;
    }
docs: nextPaymentDate
  @param loan
  - dateLastPaymentWasReceived
  - amortizationTable
  @returns {promise|Q.promise}