Subversion Repositories SmartDukaan

Rev

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

Rev 34575 Rev 34576
Line 199... Line 199...
199
 
199
 
200
            double creditAmountRequired = totalPayableAmount - walletAmount;
200
            double creditAmountRequired = totalPayableAmount - walletAmount;
201
            int loanId = 0;
201
            int loanId = 0;
202
            try {
202
            try {
203
                if (creditAmountRequired > ProfitMandiConstants.MAX_NEGATIVE_WALLET_VALUE) {
203
                if (creditAmountRequired > ProfitMandiConstants.MAX_NEGATIVE_WALLET_VALUE) {
-
 
204
                    LOGGER.info("Creating new loan for: {}",userCart.getUserId());
204
                    Loan loan = sdCreditService.createLoan(userCart.getUserId(), creditAmountRequired, 0, "Credit limit assigned via SD Credit");
205
                    Loan loan = sdCreditService.createLoan(userCart.getUserId(), creditAmountRequired, 0, "Credit limit assigned via SD Credit");
205
                    loanId = loan.getId();
206
                    loanId = loan.getId();
206
                }
207
                }
207
            } catch (Exception exception){
208
            } catch (Exception exception){
208
                if (type.equals(ProfitMandiConstants.PO_TYPE.AUTO)) {
209
                if (type.equals(ProfitMandiConstants.PO_TYPE.AUTO)) {
Line 211... Line 212...
211
                    LOGGER.info("Skipping order due to insufficient balance for id - "+ fofoId+ " Cancelling the BID");
212
                    LOGGER.info("Skipping order due to insufficient balance for id - "+ fofoId+ " Cancelling the BID");
212
                    //throw new ProfitMandiBusinessException("Skipping order unable to create load for id - ", fofoId, " ,Sending mail to RBM");
213
                    //throw new ProfitMandiBusinessException("Skipping order unable to create load for id - ", fofoId, " ,Sending mail to RBM");
213
                }
214
                }
214
            }
215
            }
215
 
216
 
-
 
217
            LOGGER.info("finalBidStatus: {}",finalBidStatus);
-
 
218
 
216
            if (finalBidStatus.equals(ProfitMandiConstants.BID_ENUM.CLOSED)) {
219
            if (finalBidStatus.equals(ProfitMandiConstants.BID_ENUM.CLOSED)) {
217
 
220
 
218
                int transactionId = transactionService.createTransactionInternally(userCart, totalPayableAmount, 0);
221
                int transactionId = transactionService.createTransactionInternally(userCart, totalPayableAmount, 0);
219
                //Set here created by
222
                //Set here created by
220
                Transaction transaction = transactionRepository.selectById(transactionId);
223
                Transaction transaction = transactionRepository.selectById(transactionId);