Subversion Repositories SmartDukaan

Rev

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

Rev 20963 Rev 20965
Line 6009... Line 6009...
6009
    if not amount > 0 or WalletReferenceType._VALUES_TO_NAMES.get(reference_type) is None:
6009
    if not amount > 0 or WalletReferenceType._VALUES_TO_NAMES.get(reference_type) is None:
6010
        return 
6010
        return 
6011
    wallet = get_user_wallet(userId)
6011
    wallet = get_user_wallet(userId)
6012
    wallet.amount = wallet.amount + amount
6012
    wallet.amount = wallet.amount + amount
6013
    history = UserWalletHistory()
6013
    history = UserWalletHistory()
-
 
6014
    history.refundable_amount = 0
6014
    if not isPromotional:
6015
    if not isPromotional:
6015
        wallet.refundable_amount = wallet.refundable_amount + amount
6016
        wallet.refundable_amount = wallet.refundable_amount + amount
-
 
6017
        history.refundable_amount = amount
6016
    history.amount = amount
6018
    history.amount = amount
6017
    history.refundable_amount = amount
-
 
6018
    history.reference = reference
6019
    history.reference = reference
6019
    history.reference_type = WalletReferenceType._VALUES_TO_NAMES.get(reference_type)
6020
    history.reference_type = WalletReferenceType._VALUES_TO_NAMES.get(reference_type)
6020
    history.wallet = wallet
6021
    history.wallet = wallet
6021
    history.timestamp = datetime.datetime.now()
6022
    history.timestamp = datetime.datetime.now()
6022
    if commit_session:
6023
    if commit_session: