convert recurring period into an integerfield
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
This commit is contained in:
parent
15535433e8
commit
bcd141730d
3 changed files with 54 additions and 6 deletions
|
|
@ -315,8 +315,9 @@ class BillNico(models.Model):
|
|||
for order in Order.objects.filter(~Q(recurring_period=RecurringPeriod.ONE_TIME),
|
||||
Q(starting_date__lt=self.starting_date),
|
||||
owner=owner):
|
||||
pass
|
||||
|
||||
if order.recurring_period > 0: # avoid div/0 - these are one time payments
|
||||
pass
|
||||
|
||||
|
||||
|
||||
|
|
@ -661,8 +662,7 @@ class Order(models.Model):
|
|||
editable=False,
|
||||
blank=True)
|
||||
|
||||
recurring_period = models.CharField(max_length=32,
|
||||
choices = RecurringPeriod.choices, default = RecurringPeriod.PER_30D)
|
||||
recurring_period = models.IntegerField(choices = RecurringPeriod.choices, default = RecurringPeriod.PER_30D)
|
||||
|
||||
one_time_price = models.DecimalField(default=0.0,
|
||||
max_digits=AMOUNT_MAX_DIGITS,
|
||||
|
|
@ -766,9 +766,8 @@ class OrderTimothee(models.Model):
|
|||
editable=False,
|
||||
blank=True)
|
||||
|
||||
recurring_period = models.CharField(max_length=32,
|
||||
choices = RecurringPeriod.choices,
|
||||
default = RecurringPeriod.PER_30D)
|
||||
recurring_period = models.IntegerField(choices = RecurringPeriod.choices,
|
||||
default = RecurringPeriod.PER_30D)
|
||||
|
||||
# Trigger initial bill generation at order creation.
|
||||
def save(self, *args, **kwargs):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue