nadineproject / nadine

Open Coworking Software
http://nadineproject.org
GNU Affero General Public License v3.0
163 stars 78 forks source link

Recalculating bill deletes EventLineItems but doesn't add them back #395

Open tnightingale opened 6 years ago

tnightingale commented 6 years ago

Is this intentional?

# Delete all the line items
for line_item in self.line_items.all():
    line_item.delete()

# Add everything back
for s in subscriptions:
    self.add_subscription(s)
for d in coworking_days:
    self.add_coworking_day(d)
# !!! What about events??
for c in custom_items:
    c.save()

https://github.com/nadineproject/nadine/blob/master/nadine/models/billing.py#L628-L638

tnightingale commented 6 years ago

Oh, it looks like the event I was testing with got bumped onto another bill, might be because I have been messing around with the data and it's in an invalid state. Will need to investigate further.

However the code snippet above still seems like it should address EventLineItems along with the rest.