| Line 30... |
Line 30... |
| 30 |
currentMonth = currentTimestamp.month
|
30 |
currentMonth = currentTimestamp.month
|
| 31 |
currentDay = currentTimestamp.day
|
31 |
currentDay = currentTimestamp.day
|
| 32 |
currentYear = currentTimestamp.year
|
32 |
currentYear = currentTimestamp.year
|
| 33 |
fortNight = (currentMonth - 1)*2 + (currentDay/15)
|
33 |
fortNight = (currentMonth - 1)*2 + (currentDay/15)
|
| 34 |
|
34 |
|
| 35 |
userCashbacksToBeCredited = user_app_cashbacks.query.filter(user_app_cashbacks.status=='Approved').filter(user_app_cashbacks.fortnightOfYear<fortNight).filter(user_app_cashbacks.yearVal==currentYear).all()
|
35 |
userCashbacksToBeCredited = user_app_cashbacks.query.filter(user_app_cashbacks.user_id>0).filter(user_app_cashbacks.status=='Approved').filter(user_app_cashbacks.fortnightOfYear<fortNight).filter(user_app_cashbacks.yearVal==currentYear).all()
|
| 36 |
userCashbacksMap = {}
|
36 |
userCashbacksMap = {}
|
| 37 |
for userCashback in userCashbacksToBeCredited:
|
37 |
for userCashback in userCashbacksToBeCredited:
|
| 38 |
if userCashback.user_id >0:
|
38 |
if userCashback.user_id >0:
|
| 39 |
if userCashbacksMap.has_key(userCashback.user_id):
|
39 |
if userCashbacksMap.has_key(userCashback.user_id):
|
| 40 |
cashBackAmount = userCashbacksMap.get(userCashback.user_id) + userCashback.amount
|
40 |
cashBackAmount = userCashbacksMap.get(userCashback.user_id) + userCashback.amount
|