Skip to content

PWL-366 user enddate time #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: release
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions subscription/controls.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def createOrUpdateSubscription(partyId, partnerId, period):
subscription.partnerId = partnerObj
subscription.partyId = partyObj
subscription.startDate = now
subscription.endDate = now+datetime.timedelta(days=period)
subscription.endDate = (now+datetime.timedelta(days=period)).replace(hour=23, minute=59, second=59, microsecond=999999)

transactionType = 'create'
transactionStartDate = subscription.startDate
Expand All @@ -55,13 +55,13 @@ def createOrUpdateSubscription(partyId, partnerId, period):
endDate = subscription.endDate
if (endDate<now):
# case2: expired subscription
subscription.endDate = now + datetime.timedelta(days=period)
subscription.endDate = (now + datetime.timedelta(days=period)).replace(hour=23, minute=59, second=59, microsecond=999999)
transactionType = 'renew'
transactionStartDate = now
transactionEndDate = subscription.endDate
else:
# case3: active subscription
subscription.endDate = endDate + datetime.timedelta(days=period)
subscription.endDate = (endDate + datetime.timedelta(days=period)).replace(hour=23, minute=59, second=59, microsecond=999999)
transactionType = 'renew'
transactionStartDate = endDate
transactionEndDate = subscription.endDate
Expand Down