Subversion Repositories SmartDukaan

Rev

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

Rev 18658 Rev 18664
Line 9089... Line 9089...
9089
                loanHistoryRec.amount = creditTxn.amount * loanTxnMultplierMap.get(creditTxn.credit_type)
9089
                loanHistoryRec.amount = creditTxn.amount * loanTxnMultplierMap.get(creditTxn.credit_type)
9090
                loanHistoryRec.credit_type = CreditTxnType._VALUES_TO_NAMES[creditTxn.credit_type]
9090
                loanHistoryRec.credit_type = CreditTxnType._VALUES_TO_NAMES[creditTxn.credit_type]
9091
                loanHistoryRec.loan_id = creditTxn.loan_id
9091
                loanHistoryRec.loan_id = creditTxn.loan_id
9092
                loanHistoryRec.due_date = datetime.datetime.now()+timedelta(days=30)
9092
                loanHistoryRec.due_date = datetime.datetime.now()+timedelta(days=30)
9093
        else:
9093
        else:
9094
            logging.info("Error: Entry already existed for "+str(paymentId) + " Shipping Id:- "+str(creditTxns.shipping_id) +" Credit Txn Type:- "+CreditTxnType._VALUES_TO_NAMES[creditTxn.credit_type]+ " in Credit History ")
9094
            logging.info("Error: Entry already existed for "+str(paymentId) + " Shipping Id:- "+str(creditTxns[0].shipping_id) +" Credit Txn Type:- "+CreditTxnType._VALUES_TO_NAMES[creditTxn.credit_type]+ " in Credit History ")
9095
            raise TransactionServiceException(227, "Error: Entry already existed for "+str(paymentId) + " Shipping Id:- "+str(creditTxns.shipping_id) +" Credit Txn Type:- "+CreditTxnType._VALUES_TO_NAMES[creditTxn.credit_type]+ " in Credit History ")
9095
            raise TransactionServiceException(227, "Error: Entry already existed for "+str(paymentId) + " Shipping Id:- "+str(creditTxns[0].shipping_id) +" Credit Txn Type:- "+CreditTxnType._VALUES_TO_NAMES[creditTxn.credit_type]+ " in Credit History ")
9096
    session.commit()   
9096
    session.commit()   
9097
    return True
9097
    return True
9098
            
9098
            
9099
def get_loan_payable_for_user_to_creditor(userId, creditorId, dueDate):
9099
def get_loan_payable_for_user_to_creditor(userId, creditorId, dueDate):
9100
    loanhistoryRecords = LoanHistory.query.filter(and_(LoanHistory.user_id==userId, LoanHistory.creditor_id==creditorId, LoanHistory.due_date<to_py_date(dueDate), LoanHistory.updated is None)).all()
9100
    loanhistoryRecords = LoanHistory.query.filter(and_(LoanHistory.user_id==userId, LoanHistory.creditor_id==creditorId, LoanHistory.due_date<to_py_date(dueDate), LoanHistory.updated is None)).all()