Subversion Repositories SmartDukaan

Rev

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

Rev 34592 Rev 34637
Line 168... Line 168...
168
            }
168
            }
169
            Bid bid = null;
169
            Bid bid = null;
170
            if (type.equals(ProfitMandiConstants.PO_TYPE.AUTO)) {
170
            if (type.equals(ProfitMandiConstants.PO_TYPE.AUTO)) {
171
                bid = bidRepository.selectById(fofoBulkOrderModels.get(0).getRowIndex());
171
                bid = bidRepository.selectById(fofoBulkOrderModels.get(0).getRowIndex());
172
                approvalRequired = false;
172
                approvalRequired = false;
-
 
173
                totalPayableAmount = totalPayableAmount - ProfitMandiConstants.BID_CHARGES;
173
            }
174
            }
174
            LOGGER.info("totalAmount of item " + totalPayableAmount);
175
            LOGGER.info("totalAmount of item " + totalPayableAmount);
175
            double walletAmount = walletService.getWalletAmount(fofoId);
176
            double walletAmount = walletService.getWalletAmount(fofoId);
176
 
177
 
177
            BigDecimal creditAvailability = sdCreditService.getAvailableAmount(fofoId);
178
            BigDecimal creditAvailability = sdCreditService.getAvailableAmount(fofoId);
Line 211... Line 212...
211
                    //throw new ProfitMandiBusinessException("Skipping order unable to create load for id - ", fofoId, " ,Sending mail to RBM");
212
                    //throw new ProfitMandiBusinessException("Skipping order unable to create load for id - ", fofoId, " ,Sending mail to RBM");
212
                }
213
                }
213
            }
214
            }
214
 
215
 
215
            LOGGER.info("finalBidStatus: {}",finalBidStatus);
216
            LOGGER.info("finalBidStatus: {}",finalBidStatus);
216
 
-
 
217
            if (finalBidStatus.equals(ProfitMandiConstants.BID_ENUM.CLOSED)) {
217
            if (finalBidStatus.equals(ProfitMandiConstants.BID_ENUM.CLOSED)) {
218
 
-
 
219
                int transactionId = transactionService.createTransactionInternally(userCart, totalPayableAmount, 0);
218
                int transactionId = transactionService.createTransactionInternally(userCart, totalPayableAmount, 0);
220
                //Set here created by
219
                //Set here created by
221
                Transaction transaction = transactionRepository.selectById(transactionId);
220
                Transaction transaction = transactionRepository.selectById(transactionId);
222
                transaction.setCreatedBy(creatorId);
221
                transaction.setCreatedBy(creatorId);
223
                LOGGER.info("transaction  created by {}", transaction.getCreatedBy());
222
                LOGGER.info("transaction created by {}", transaction.getCreatedBy());
224
                commonPaymentService.payThroughWallet(transactionId);
223
                commonPaymentService.payThroughWallet(transactionId);
225
                if (approvalRequired) {
224
                if (approvalRequired) {
226
                    this.createApproval(transactionId);
225
                    this.createApproval(transactionId);
227
                    if (loanId > 0) {
226
                    if (loanId > 0) {
228
                        LoanTransaction loanTransaction = new LoanTransaction();
227
                        LoanTransaction loanTransaction = new LoanTransaction();