We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 183e8af commit e953067Copy full SHA for e953067
app/models/event_invoice.py
@@ -22,6 +22,7 @@
22
23
class EventInvoice(SoftDeletionModel):
24
DUE_DATE_DAYS = 30
25
+ MIN_AMOUNT = 2 # Minimum amount for which the invoice will be generated
26
27
__tablename__ = 'event_invoices'
28
@@ -128,6 +129,14 @@ def generate_pdf(self, force=False):
128
129
self.event,
130
)
131
return
132
+ if not force and self.amount < EventInvoice.MIN_AMOUNT:
133
+ logger.warning(
134
+ 'Invoice amount of Event %s is %f which is less than %f, hence skipping generation',
135
+ self.event,
136
+ self.amount,
137
+ EventInvoice.MIN_AMOUNT,
138
+ )
139
+ return
140
net_revenue = round_money(gross_revenue - invoice_amount)
141
orders_query = self.event.get_orders_query(
142
start=latest_invoice_date, end=self.issued_at
0 commit comments