Skip to content

Commit

Permalink
quick fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mittal-ishaan committed Oct 1, 2024
1 parent 304370b commit c266fd6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions home/utils/rebate_bills_saver.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from datetime import timedelta

from home.models.students import LongRebate, Rebate

from ..models import (
Expand Down Expand Up @@ -190,13 +192,13 @@ def fix_all_bills(
rebate.end_date - rebate.start_date
).days + 1
continue
rebate.start_date = period_1.end_date + 1
rebate.start_date = period_1.end_date + timedelta(days=1)
if rebate.end_date <= period_2.end_date:
short_rebates_per_period[1] += (
rebate.end_date - rebate.start_date
).days + 1
continue
rebate.start_date = period_2.end_date + 1
rebate.start_date = period_2.end_date + timedelta(days=1)
if rebate.end_date <= period_3.end_date:
short_rebates_per_period[2] += (
rebate.end_date - rebate.start_date
Expand All @@ -215,11 +217,11 @@ def fix_all_bills(
if rebate.end_date <= period_1.end_date:
long_rebates_per_period[0] += (rebate.end_date - rebate.start_date).days + 1
continue
rebate.start_date = period_1.end_date + 1
rebate.start_date = period_1.end_date + timedelta(days=1)
if rebate.end_date <= period_2.end_date:
long_rebates_per_period[1] += (rebate.end_date - rebate.start_date).days + 1
continue
rebate.start_date = period_2.end_date + 1
rebate.start_date = period_2.end_date + timedelta(days=1)
if rebate.end_date <= period_3.end_date:
long_rebates_per_period[2] += (rebate.end_date - rebate.start_date).days + 1
continue
Expand Down

0 comments on commit c266fd6

Please sign in to comment.