Skip to content

Commit

Permalink
add limits
Browse files Browse the repository at this point in the history
  • Loading branch information
mittal-ishaan committed Oct 1, 2024
1 parent 12d866f commit 594c0ce
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions home/utils/rebate_bills_saver.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,13 @@ def fix_all_bills(
long_rebates_per_period[2] += (rebate.end_date - rebate.start_date).days + 1
continue
long_rebates_per_period[2] += (period_3.end_date - rebate.start_date).days + 1
for i in range(3):
if short_rebates_per_period[i] > 8:
short_rebates_per_period[i] = 8
if short_rebates_per_period[i] < 0:
short_rebates_per_period[i] = 0
if long_rebates_per_period[i] < 0:
long_rebates_per_period[i] = 0
print(short_rebates_per_period, long_rebates_per_period)
student_bill.period1_short = short_rebates_per_period[0]
student_bill.period2_short = short_rebates_per_period[1]
Expand Down

0 comments on commit 594c0ce

Please sign in to comment.