Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit c26ee99

Browse files
committed
fix: view pending count tab
1 parent 5f4460d commit c26ee99

File tree

2 files changed

+14
-24
lines changed

2 files changed

+14
-24
lines changed

src/main/com/topcoder/web/tc/controller/legacy/pacts/controller/request/member/PaymentHistory.java

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -154,45 +154,36 @@ protected void businessProcessing() throws TCWebException {
154154
if (payment.getPaymentType() == 3 || payment.getPaymentType() == 5) {
155155
removePayments.add(payment);
156156
} else {
157-
if (payment.getCurrentStatus().equals(PaymentStatusFactory.createStatus(PaymentStatus.CANCELLED_PAYMENT_STATUS)) ||
158-
payment.getCurrentStatus().equals(PaymentStatusFactory.createStatus(PaymentStatus.EXPIRED_PAYMENT_STATUS)) ||
159-
payment.getCurrentStatus().equals(PaymentStatusFactory.createStatus(PaymentStatus.PAID_PAYMENT_STATUS))) {
157+
if (!(payment.getCurrentStatus().equals(PaymentStatusFactory.createStatus(PaymentStatus.OWED_PAYMENT_STATUS))) &&
158+
!(payment.getCurrentStatus().equals(PaymentStatusFactory.createStatus(PaymentStatus.ENTERED_INTO_PAYMENT_SYSTEM_PAYMENT_STATUS))) &&
159+
!(payment.getCurrentStatus().equals(PaymentStatusFactory.createStatus(PaymentStatus.ACCRUING_PAYMENT_STATUS)))) {
160160
removeNonPending.add(payment);
161161
}
162-
163-
// Deleted payments should not be shown either way.
164-
if (payment.getCurrentStatus().equals(PaymentStatusFactory.createStatus(PaymentStatus.DELETED_PAYMENT_STATUS))) {
165-
removePayments.add(payment);
166-
}
167162
}
168163
}
169164

170165
payments.removeAll(removePayments);
171166

172-
int totalPayment = payments.size();
173-
174-
if (!fullList && !exportToExcel) {
175-
if (removeNonPending.size() > 0) {
176-
payments.removeAll(removeNonPending);
177-
}
178-
}
179-
180-
int PaymentsPending = totalPayment - removeNonPending.size();
181-
182167
// sort the result in the first place
183168
sortResult(payments, sortCol, sortAscending);
184169

185170
if ("on".equalsIgnoreCase(com.topcoder.web.tc.Constants.GLOBAL_AD_FLAG)) {
186171
removeDuplicateReasons(payments);
187172
}
188173

174+
int totalPayment = payments.size();
175+
189176
if (!fullList && !exportToExcel) {
190-
getRequest().setAttribute("NUM_TOTAL", PaymentsPending);
191-
} else {
192-
getRequest().setAttribute("NUM_TOTAL", totalPayment);
177+
if (removeNonPending.size() > 0) {
178+
payments.removeAll(removeNonPending);
179+
}
193180
}
181+
182+
int pendingPayments = totalPayment - removeNonPending.size();
183+
184+
getRequest().setAttribute("NUM_TOTAL", payments.size());
194185
getRequest().setAttribute("NUM_PER_PAGE", numRecords);
195-
getRequest().setAttribute("NUM_PENDING", PaymentsPending);
186+
getRequest().setAttribute("NUM_PENDING", pendingPayments);
196187

197188
if (exportToExcel) {
198189
produceXLS(payments);

src/main/com/topcoder/web/tc/controller/legacy/pacts/controller/request/member/PaymentStatusSummary.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ private int getPendingPaymentsNumber() throws Exception {
8383
for (BasePayment payment : payments) {
8484
if (payment.getCurrentStatus().equals(PaymentStatusFactory.createStatus(PaymentStatus.OWED_PAYMENT_STATUS)) ||
8585
payment.getCurrentStatus().equals(PaymentStatusFactory.createStatus(PaymentStatus.ENTERED_INTO_PAYMENT_SYSTEM_PAYMENT_STATUS)) ||
86-
payment.getCurrentStatus().equals(PaymentStatusFactory.createStatus(PaymentStatus.ACCRUING_PAYMENT_STATUS)) ||
87-
payment.getCurrentStatus().equals(PaymentStatusFactory.createStatus(PaymentStatus.ON_HOLD_PAYMENT_STATUS))) {
86+
payment.getCurrentStatus().equals(PaymentStatusFactory.createStatus(PaymentStatus.ACCRUING_PAYMENT_STATUS))) {
8887
paymentPendings.add(payment);
8988
}
9089
}

0 commit comments

Comments
 (0)