Subversion Repositories SmartDukaan

Rev

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

Rev 20927 Rev 20928
Line 5988... Line 5988...
5988
 
5988
 
5989
 
5989
 
5990
 
5990
 
5991
def add_amount_in_wallet(userId, amount, reference, reference_type, isPromotional, commit_session=False):
5991
def add_amount_in_wallet(userId, amount, reference, reference_type, isPromotional, commit_session=False):
5992
    """
5992
    """
5993
    Commit to be executed by caller
5993
    Commit to be decided by caller
5994
    """
5994
    """
5995
    if not amount > 0 or WalletReferenceType._VALUES_TO_NAMES.get(reference_type) is None:
5995
    if not amount > 0 or WalletReferenceType._VALUES_TO_NAMES.get(reference_type) is None:
5996
        return 
5996
        return 
5997
    wallet = get_user_wallet(userId)
5997
    wallet = get_user_wallet(userId)
5998
    wallet.amount = wallet.amount + amount
5998
    wallet.amount = wallet.amount + amount