Add ability to hide specific recurring payments
I use fosspay for billing consulting contracts as well as accepting donations, and I don't want these to show up in the sum.
This commit is contained in:
parent
b1a2e820e5
commit
d8440a03ff
|
@ -33,7 +33,8 @@ def index():
|
||||||
selected_project = None
|
selected_project = None
|
||||||
active_recurring = (Donation.query
|
active_recurring = (Donation.query
|
||||||
.filter(Donation.type == DonationType.monthly)
|
.filter(Donation.type == DonationType.monthly)
|
||||||
.filter(Donation.active == True))
|
.filter(Donation.active == True)
|
||||||
|
.filter(Donation.hidden == False))
|
||||||
recurring_count = active_recurring.count()
|
recurring_count = active_recurring.count()
|
||||||
recurring_sum = sum([d.amount for d in active_recurring])
|
recurring_sum = sum([d.amount for d in active_recurring])
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,8 @@ class User(Base):
|
||||||
stripe_customer = Column(String(256))
|
stripe_customer = Column(String(256))
|
||||||
|
|
||||||
def set_password(self, password):
|
def set_password(self, password):
|
||||||
self.password = bcrypt.hashpw(password.encode("utf-8"), bcrypt.gensalt()).decode("utf-8")
|
self.password = bcrypt.hashpw(password.encode("utf-8"),
|
||||||
|
bcrypt.gensalt()).decode("utf-8")
|
||||||
|
|
||||||
def __init__(self, email, password):
|
def __init__(self, email, password):
|
||||||
self.email = email
|
self.email = email
|
||||||
|
@ -63,6 +64,7 @@ class Donation(Base):
|
||||||
comment = Column(String(512))
|
comment = Column(String(512))
|
||||||
active = Column(Boolean)
|
active = Column(Boolean)
|
||||||
payments = Column(Integer)
|
payments = Column(Integer)
|
||||||
|
hidden = Column(Boolean, server_default='f', nullable=False)
|
||||||
|
|
||||||
def __init__(self, user, type, amount, project=None, comment=None):
|
def __init__(self, user, type, amount, project=None, comment=None):
|
||||||
self.user = user
|
self.user = user
|
||||||
|
|
Loading…
Reference in New Issue