|
56 | 56 | <c:set value="<%=request.getAttribute("NUM_TOTAL")%>" var="numTotal" />
|
57 | 57 | <c:set value="<%=request.getAttribute("NUM_PER_PAGE")%>" var="numPerPage" />
|
58 | 58 | <c:set value="<%=request.getAttribute("NUM_PENDING")%>" var="numPending" />
|
| 59 | +<c:set value="<%=request.getAttribute("OWED_PAYMENTS")%>" var="owedPayments" /> |
| 60 | +<c:set value="<%=request.getAttribute("TOTAL_OWED_PAYMENTS")%>" var="totalOwedPayments" /> |
59 | 61 | <c:set value="<%=DataAccessConstants.SORT_COLUMN%>" var="sortColumn"/>
|
60 | 62 | <c:set value="<%=DataAccessConstants.SORT_DIRECTION%>" var="sortDirection"/>
|
61 | 63 |
|
|
81 | 83 | MINIMUM_PAYMENT_ACCRUAL_AMOUNT = ${MINIMUM_PAYMENT_ACCRUAL_AMOUNT};
|
82 | 84 | PAY_ME_CONFIRMATION_TEMPLATE = '${paymentConfirmationTemplate}';
|
83 | 85 |
|
| 86 | + var owedPayments = ${owedPayments}; |
| 87 | + var totalOwedPayments = ${totalOwedPayments}; |
| 88 | +
|
84 | 89 | function next() {
|
85 | 90 | var myForm = document.f;
|
86 | 91 | myForm.<%=DataAccessConstants.START_RANK%>.value = ${requestScope[defaults][startRank]} + parseInt(myForm.<%=DataAccessConstants.NUMBER_RECORDS%>.value);
|
|
139 | 144 | $('.payable[value="' + paymentId + '"]').click();
|
140 | 145 | });
|
141 | 146 |
|
| 147 | + $('.checkAll').click(function () { |
| 148 | + if (this.checked) { |
| 149 | + $('.checkAll').attr('checked', true); |
| 150 | + $('.payable').each(function () { |
| 151 | + var paymentId = this.value; |
| 152 | + $('[data-name="${PAYMENT_ID}"][data-value="'+paymentId+'"]').removeClass('checked'); |
| 153 | + $('[data-name="${PAYMENT_ID}"][data-value="'+paymentId+'"]').addClass('checked'); |
| 154 | + }); |
| 155 | + } else { |
| 156 | + $('.checkAll').attr('checked', false); |
| 157 | + $('.payable').each(function () { |
| 158 | + var paymentId = this.value; |
| 159 | + $('[data-name="${PAYMENT_ID}"][data-value="'+paymentId+'"]').removeClass('checked'); |
| 160 | + }); |
| 161 | + } |
| 162 | + }); |
| 163 | +
|
142 | 164 | $('.payable').click(function() {
|
143 | 165 | var hasSelected = false;
|
144 | 166 | $('.payable:checked').each(function () {
|
|
151 | 173 | error = $('<span />').attr('class', 'bigRed').html('The total net amount for selected payments is less than $25');
|
152 | 174 | $("#PaymentHistoryForm").prev().append('<br>').append(error)
|
153 | 175 | }
|
| 176 | + if ($('.checkable:checked').length == $('.checkable').length) { |
| 177 | + $('.checkAll').attr('checked', true); |
| 178 | + } else if ($('.checkable').not(':checked').length == $('.checkable').length) { |
| 179 | + $('.checkAll').attr('checked', false); |
| 180 | + } |
154 | 181 | });
|
155 | 182 | });
|
156 | 183 | }
|
|
224 | 251 | </c:if>
|
225 | 252 |
|
226 | 253 | <c:if test="${isReskin}">
|
| 254 | + <div class="above-tabs"> |
| 255 | + <div align="right" class="pay-me-btn"> |
| 256 | + <input type="button" value="Pay Me" id="quickPayMe"/> |
| 257 | + </div> |
| 258 | + </div> |
| 259 | + |
227 | 260 | <%-- desktop tabs --%>
|
228 | 261 | <nav class="tabs paymentHistoryTabs">
|
229 | 262 | <c:if test="${fullList}" >
|
|
285 | 318 | }
|
286 | 319 | </script>
|
287 | 320 | </div>
|
| 321 | + <%-- Mobile select all checkbox --%> |
| 322 | + <c:if test="${not empty payments}"> |
| 323 | + <div class="mobile-select-all-checkbox"> |
| 324 | + <span class="checkbox"> |
| 325 | + <input type="checkbox" class="checkAll"> |
| 326 | + <span class="checkbox-label"></span> |
| 327 | + </span> |
| 328 | + </div> |
| 329 | + </c:if> |
288 | 330 | <%-- Mobile sort-button --%>
|
289 | 331 | <c:if test="${not empty payments}">
|
290 | 332 | <a
|
|
377 | 419 | <a class="getable" href="<%=sessionInfo.getServletPath()%>?<tc-webtag:sort column="7" includeParams="true" />" >Date Paid</a>
|
378 | 420 | <%--</c:if>--%>
|
379 | 421 | </td>
|
380 |
| - <td class="header"> </td> |
| 422 | + <td class="headerC"> |
| 423 | + <span class="checkbox"> |
| 424 | + <input type="checkbox" class="checkAll"> |
| 425 | + <span class="checkbox-label"></span> |
| 426 | + </span> |
| 427 | + </td> |
| 428 | + <%-- <td class="header"> </td> --%> |
381 | 429 | </tr>
|
382 | 430 |
|
383 | 431 | <c:forEach items="${payments}" var="payment">
|
|
424 | 472 | <td class="value type">${payment.paymentTypeDesc}</td>
|
425 | 473 | <td class="valueC create-date"><fmt:formatDate value="${payment.createDate}" pattern="dd/MM/yyyy"/></td>
|
426 | 474 | <td class="valueR net-payment"><fmt:formatNumber value="${payment.netAmount}" type="currency" currencySymbol="$"/></td>
|
427 |
| - <td class="value status"><span class="status ${payment.currentStatus.desc}"><span class="status-label">${payment.currentStatus.desc}</span></span> |
| 475 | + <td class="value status"> |
| 476 | + <span class="status ${payment.currentStatus.desc}"> |
| 477 | + <span class="status-label"> |
| 478 | + <c:choose> |
| 479 | + <c:when test="${payment.currentStatus.id eq OWED}"> |
| 480 | + Available |
| 481 | + </c:when> |
| 482 | + <c:when test="${payment.currentStatus.id eq ACCRUING}"> |
| 483 | + Pending |
| 484 | + </c:when> |
| 485 | + <c:otherwise> |
| 486 | + ${payment.currentStatus.desc} |
| 487 | + </c:otherwise> |
| 488 | + </c:choose> |
| 489 | + </span> |
| 490 | + </span> |
428 | 491 | <c:forEach items="${payment.currentStatus.reasons}" var="reason">
|
429 | 492 | <br>- ${reason.desc}
|
430 | 493 | </c:forEach>
|
|
448 | 511 | <c:when test="${payment.currentStatus.id eq OWED or payment.currentStatus.id eq ACCRUING}">
|
449 | 512 | <%-- Owed, Accruing --%>
|
450 | 513 | <c:choose>
|
| 514 | + <c:when test="${payment.currentStatus.id eq ACCRUING}"> |
| 515 | + <%-- Payment is pending yet: un-checked, disabled --%> |
| 516 | + <input type="checkbox" disabled="disabled" name="${PAYMENT_ID}" value="${payment.id}"/> |
| 517 | + </c:when> |
451 | 518 | <c:when test="${payment.dueDate eq null or (payment.dueDate > now)}">
|
452 | 519 | <%-- Payment release date is not reached yet: un-checked, disabled --%>
|
453 | 520 | <input type="checkbox" disabled="disabled" name="${PAYMENT_ID}" value="${payment.id}"/>
|
|
550 | 617 | <div class="row status">
|
551 | 618 | <div class="col col-label">Status</div>
|
552 | 619 | <div class="col col-value">
|
553 |
| - <span class="status ${paymentItem.currentStatus.desc}"><span class="status-label">${paymentItem.currentStatus.desc}</span></span> |
| 620 | + <span class="status ${paymentItem.currentStatus.desc}"> |
| 621 | + <span class="status-label"> |
| 622 | + <c:choose> |
| 623 | + <c:when test="${paymentItem.currentStatus.id eq OWED}"> |
| 624 | + Available |
| 625 | + </c:when> |
| 626 | + <c:when test="${paymentItem.currentStatus.id eq ACCRUING}"> |
| 627 | + Pending |
| 628 | + </c:when> |
| 629 | + <c:otherwise> |
| 630 | + ${paymentItem.currentStatus.desc} |
| 631 | + </c:otherwise> |
| 632 | + </c:choose> |
| 633 | + </span> |
| 634 | + </span> |
554 | 635 | <c:forEach items="${paymentItem.currentStatus.reasons}" var="reason">
|
555 | 636 | <br>- ${reason.desc}
|
556 | 637 | </c:forEach>
|
|
583 | 664 | <c:when test="${paymentItem.currentStatus.id eq OWED or paymentItem.currentStatus.id eq ACCRUING}">
|
584 | 665 | <%-- Owed, Accruing --%>
|
585 | 666 | <c:choose>
|
| 667 | + <c:when test="${paymentItem.currentStatus.id eq ACCRUING}"> |
| 668 | + <%-- Payment is pending yet: un-checked, disabled --%> |
| 669 | + <span role="checkbox" class="checkbox disabled" data-name="${PAYMENT_ID}" data-value="${paymentItem.id}"></span> |
| 670 | + </c:when> |
586 | 671 | <c:when test="${paymentItem.dueDate eq null or (paymentItem.dueDate > now)}">
|
587 | 672 | <%-- Payment release date is not reached yet: un-checked, disabled --%>
|
588 | 673 | <span role="checkbox" class="checkbox disabled" data-name="${PAYMENT_ID}" data-value="${paymentItem.id}"></span>
|
|
0 commit comments