Subversion Repositories SmartDukaan

Rev

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

Rev 18911 Rev 18913
Line 9176... Line 9176...
9176
            amountToLoan = amountToLoan + creditTxn.amount
9176
            amountToLoan = amountToLoan + creditTxn.amount
9177
        if creditTxn.credit_type in [CreditTxnType.BLOCKED]:
9177
        if creditTxn.credit_type in [CreditTxnType.BLOCKED]:
9178
            amountToBlocked = amountToBlocked + creditTxn.amount   
9178
            amountToBlocked = amountToBlocked + creditTxn.amount   
9179
    
9179
    
9180
    if amountToLoan > userSanction.credit_blocked:
9180
    if amountToLoan > userSanction.credit_blocked:
9181
        logging.info("Error: Not Enough Credit to Process For Loan. Payment Id:- "+str(paymentId) + " Shipping Id:- "+str(creditTxns[0].shipping_id)+" Amount to Loan:- "+str(amountToLoan))
9181
        logStr = "Error: Not Enough Credit to Process For Loan. Payment Id:- "+str(paymentId) + " Shipping Id:- "+str(creditTxns[0].shipping_id)+" Amount to Loan:- "+str(amountToLoan)+ " Credit Blocked:- "+str(userSanction.credit_blocked)
-
 
9182
        logging.info(logStr)
9182
        raise TransactionServiceException(224, "Error: Not Enough Credit to Process For Loan. Payment Id:- "+str(paymentId) + " Shipping Id:- "+str(creditTxns[0].shipping_id)+ "Amount to Loan:- "+str(amountToLoan))
9183
        raise TransactionServiceException(224, "Error: Not Enough Credit to Process For Loan. Payment Id:- "+str(paymentId) + " Shipping Id:- "+str(creditTxns[0].shipping_id)+ " Amount to Loan:- "+str(amountToLoan)+ " Credit Blocked:- "+str(userSanction.credit_blocked))
9183
    
9184
    
9184
    if amountToReversed > userSanction.credit_blocked:
9185
    if amountToReversed > userSanction.credit_blocked:
9185
        logging.info("Error: Not Enough Credit to Process For Reversal. Payment Id:- "+str(paymentId) + " Shipping Id:- "+str(creditTxns[0].shipping_id))
9186
        logStr= "Error: Not Enough Credit to Process For Reversal. Payment Id:- "+str(paymentId) + " Shipping Id:- "+str(creditTxns[0].shipping_id)+ " Amount to Reverse:- "+str(amountToReversed)+ " Credit Blocked:- "+str(userSanction.credit_blocked)
-
 
9187
        logging.info(logStr)
9186
        raise TransactionServiceException(225, "Error: Not Enough Credit to Process For Reversal. Payment Id:- "+str(paymentId) + " Shipping Id:- "+str(creditTxns[0].shipping_id))
9188
        raise TransactionServiceException(225, "Error: Not Enough Credit to Process For Reversal. Payment Id:- "+str(paymentId) + " Shipping Id:- "+str(creditTxns[0].shipping_id)+ " Amount to Reverse:- "+str(amountToReversed)+ " Credit Blocked:- "+str(userSanction.credit_blocked))
9187
    
9189
    
9188
    if amountToBlocked > availableCredit:
9190
    if amountToBlocked > availableCredit:
9189
        logging.info("Error: Not Enough Credit to be Blocked. Payment Id:- "+str(paymentId) + " Shipping Id:- "+str(creditTxns[0].shipping_id))
9191
        logStr = "Error: Not Enough Credit to be Blocked. Payment Id:- "+str(paymentId) + " Shipping Id:- "+str(creditTxns[0].shipping_id)+" Amount to Block:- "+str(amountToBlocked)+ " Credit Blocked:- "+str(userSanction.credit_blocked)
-
 
9192
        logging.info(logStr)
9190
        raise TransactionServiceException(226, "Error: Not Enough Credit to be Blocked. Payment Id:- "+str(paymentId) + " Shipping Id:- "+str(creditTxns[0].shipping_id))
9193
        raise TransactionServiceException(226, "Error: Not Enough Credit to be Blocked. Payment Id:- "+str(paymentId) + " Shipping Id:- "+str(creditTxns[0].shipping_id)+" Amount to Block:- "+str(amountToBlocked)+ " Credit Blocked:- "+str(userSanction.credit_blocked))
9191
    
9194
    
9192
    for creditTxn in creditTxns:
9195
    for creditTxn in creditTxns:
9193
        creditHistoryRec = CreditHistory.get_by(payment_id=paymentId,shipping_id=creditTxn.shipping_id)
9196
        creditHistoryRec = CreditHistory.get_by(payment_id=paymentId,shipping_id=creditTxn.shipping_id)
9194
        if creditHistoryRec is None:
9197
        if creditHistoryRec is None:
9195
            creditHistoryRec = CreditHistory()
9198
            creditHistoryRec = CreditHistory()