-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Invoice identifier and generation behaviour change #7314
Conversation
app/models/event_invoice.py
Outdated
@@ -119,6 +117,9 @@ def generate_pdf(self): | |||
if invoice_amount > ticket_fee_maximum: | |||
invoice_amount = ticket_fee_maximum | |||
self.amount = round_money(invoice_amount) | |||
if self.amount == 0: | |||
logger.warning('Invoice amount of Event %s is 0, hence skipping generation', self.event) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (104 > 90 characters)
app/models/event_invoice.py
Outdated
identifier = self.issued_at.strftime('%Y%mU-') + str( | ||
EventInvoice.query.count() + 1 | ||
) | ||
identifier = self.issued_at.strftime('%Y%mU-') + '%06d' % (EventInvoice.query.count() + 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (102 > 90 characters)
app/models/event_invoice.py
Outdated
@@ -62,13 +62,11 @@ def __init__(self, **kwargs): | |||
self.identifier = self.get_new_id() | |||
|
|||
def __repr__(self): | |||
return '<EventInvoice %r>' % self.invoice_pdf_url | |||
return '<EventInvoice %r %r %r>' % (self.id, self.identifier, self.invoice_pdf_url) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (91 > 90 characters)
app/api/helpers/scheduled_jobs.py
Outdated
@@ -200,14 +200,16 @@ def send_event_invoice( | |||
try: | |||
save_to_db(event_invoice) | |||
saved = True | |||
logger.info('Generated Event invoice %s for %s. Amount: %f', event_invoice, event, event_invoice.amount) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (124 > 90 characters)
Codecov Report
@@ Coverage Diff @@
## development #7314 +/- ##
============================================
Coverage 64.12% 64.12%
============================================
Files 259 259
Lines 13078 13084 +6
============================================
+ Hits 8386 8390 +4
- Misses 4692 4694 +2
Continue to review full report at Codecov.
|
Fixes fossasia/open-event-frontend#5211