Subversion Repositories SmartDukaan

Rev

Rev 36518 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 36518 Rev 36534
Line 267... Line 267...
267
                }
267
                }
268
            }
268
            }
269
 
269
 
270
            LOGGER.info("finalBidStatus: {}",finalBidStatus);
270
            LOGGER.info("finalBidStatus: {}",finalBidStatus);
271
            if (finalBidStatus.equals(ProfitMandiConstants.BID_ENUM.CLOSED)) {
271
            if (finalBidStatus.equals(ProfitMandiConstants.BID_ENUM.CLOSED)) {
-
 
272
                // Block all PO creation while a first PO is pending approval for this partner
-
 
273
                if (transactionApprovalRepository.hasPendingFirstPoByRetailerId(fofoId)) {
-
 
274
                    if (type.equals(ProfitMandiConstants.PO_TYPE.MANUAL)) {
-
 
275
                        throw new ProfitMandiBusinessException(
-
 
276
                                "First PO is pending approval",
-
 
277
                                fofoId,
-
 
278
                                "First PO is already pending approval for this partner. Please wait for approval or rejection before creating another order.");
-
 
279
                    } else {
-
 
280
                        LOGGER.warn("Skipping AUTO PO for fofoId={}: first PO is pending approval", fofoId);
-
 
281
                        continue;
-
 
282
                    }
-
 
283
                }
-
 
284
 
272
                // First PO if: no transactions at all, OR all previous first-PO approvals were REJECTED
285
                // First PO if: no transactions at all, OR all previous first-PO approvals were REJECTED
273
                boolean isFirstPO = !transactionRepository.hasTransactionsByRetailerId(fofoId)
286
                boolean isFirstPO = !transactionRepository.hasTransactionsByRetailerId(fofoId)
274
                        || transactionApprovalRepository.allFirstPoRejectedByRetailerId(fofoId);
287
                        || transactionApprovalRepository.allFirstPoRejectedByRetailerId(fofoId);
275
 
288
 
276
                if (isFirstPO) {
289
                if (isFirstPO) {