Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
merged master to dev
Browse files Browse the repository at this point in the history
  • Loading branch information
rahuldevgarg committed Jan 22, 2024
2 parents 7ec1fe9 + a5fad37 commit ebd02bd
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 13 deletions.
4 changes: 3 additions & 1 deletion frontend/mgramseva/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@
<key>NSAppleMusicUsageDescription</key>
<string>Explain why your app uses music</string>
<key>NSCameraUsageDescription</key>
<string>This app requires access to the camera.</string>
<string>This app requires access to the camera to enable you to upload expense bills.</string>
<key>NSMicrophoneUsageDescription</key>
<string>This app does not require access to the microphone.</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>We require Bluetooth permission to connect to Thermal Printers.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Explain why your app uses photo library</string>
<key>UIBackgroundModes</key>
Expand Down
54 changes: 42 additions & 12 deletions utilities/rollout-dashboard-cronjob/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,45 +682,74 @@ def getdaterange(i):
lastepoch = datetime.now().strftime('%s') + '000'

if i == 'Previous Month':
today = datetime.now().year
lastonemonth = (datetime.now() - relativedelta(months=1)).month
start_date = datetime(today, lastonemonth, 1)
end_date = datetime(today, lastonemonth + 1, 1) + timedelta(days=-1)
nowdate = datetime.now()
today = nowdate.year
lastonemonth = (nowdate - relativedelta(months=1)).month
if lastonemonth == 12:
start_date = datetime(today-1,lastonemonth,1)
end_date = datetime(today,1,1) + timedelta(days=-1)
else:
start_date = datetime(today, lastonemonth, 1)
end_date = datetime(today, lastonemonth + 1, 1) + timedelta(days=-1)
enddate = end_date.combine(end_date, time.max)
epochnow = start_date.strftime('%s') + '000'
lastepoch = enddate.strftime('%s') + '000'

if i == 'Quarter-1':
year = datetime.now().year
month = datetime.now().month
if(month < 4):
year = datetime.now().year-1
else:
year = datetime.now().year
start_date = datetime(year, 4, 1)
end_date = datetime(year, 6, 30)
end = datetime.combine(end_date,time.max)
epochnow = start_date.strftime('%s') + '000'
lastepoch = end.strftime('%s') + '000'

if i == 'Quarter-2':
year = datetime.now().year
month = datetime.now().month
if(month < 4):
year = datetime.now().year-1
else:
year = datetime.now().year
start_date = datetime(year, 7, 1)
end_date = datetime(year, 9, 30)
end = datetime.combine(end_date,time.max)
epochnow = start_date.strftime('%s') + '000'
lastepoch = end.strftime('%s') + '000'

if i == 'Quarter-3':
year = datetime.now().year
month = datetime.now().month
if(month < 4):
year = datetime.now().year-1
else:
year = datetime.now().year
start_date = datetime(year, 10, 1)
end_date = datetime(year, 12, 31)
end = datetime.combine(end_date,time.max)
epochnow = start_date.strftime('%s') + '000'
lastepoch = end.strftime('%s') + '000'

if i == 'Quarter-4':
year = datetime.now().year
start_date = datetime(year, 1, 1)
end_date = datetime(year, 3, 31)
end = datetime.combine(end_date,time.max)
epochnow = start_date.strftime('%s') + '000'
lastepoch = end.strftime('%s') + '000'

if i == 'FY to date':
today = datetime.now().year
start_date = datetime(today, 4, 1)
month = datetime.now().month
if(month < 4):
start_date = datetime(today-1, 4, 1)
else:
start_date = datetime(today, 4, 1)
epochnow = start_date.strftime('%s') + '000'
lastepoch = datetime.now().strftime('%s') + '000'

if i == 'Previous 1st FY (22-23)':
if i == 'Previous 1st FY (23-24)':
today = datetime.now().year
lastyear = today-1
start_date = datetime(lastyear, 4, 1)
Expand All @@ -729,7 +758,7 @@ def getdaterange(i):
epochnow = start_date.strftime('%s') + '000'
lastepoch = enddate.strftime('%s') + '000'

if i == 'Previous 2nd FY (21-22)':
if i == 'Previous 2nd FY (22-23)':
today = datetime.now().year
start_date = datetime(today-2, 4, 1)
end_date = datetime(today-1, 4, 1) + timedelta(days=-1)
Expand All @@ -738,7 +767,7 @@ def getdaterange(i):
lastepoch = enddate.strftime('%s') + '000'


if i == 'Previous 3rd FY (20-21)':
if i == 'Previous 3rd FY (21-22)':
today = datetime.now().year
start_date = datetime(today-3, 4, 1)
end_date = datetime(today-2, 4, 1) + timedelta(days=-1)
Expand Down Expand Up @@ -810,8 +839,9 @@ def process():

tenants = getGPWSCHeirarchy()
for tenant in tenants:
print("Tenant:", tenant['tenantId'])
activeUsersCount= getActiveUsersCount(tenant['tenantId'])
daterange = ['Last seven days','Last 15 days','currentMonth-Till date','Previous Month','Quarter-1','Quarter-2','Quarter-3','Consolidated (As on date)','FY to date','Previous 1st FY (22-23)','Previous 2nd FY (21-22)','Previous 3rd FY (20-21)']
daterange = ['Last seven days','Last 15 days','currentMonth-Till date','Previous Month','Quarter-1','Quarter-2','Quarter-3','Quarter-4','Consolidated (As on date)','FY to date','Previous 1st FY (23-24)','Previous 2nd FY (22-23)','Previous 3rd FY (21-22)']
for i,date in enumerate(daterange):
startdate,enddate= getdaterange(date)
totalAdvance= getTotalAdvanceCreated(tenant['tenantId'],startdate,enddate)
Expand Down

0 comments on commit ebd02bd

Please sign in to comment.