Skip to content

Commit

Permalink
fix: Correct Invoice Calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
mrsaicharan1 committed Feb 2, 2020
1 parent a6ad219 commit 6a29b66
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 1 addition & 3 deletions app/api/helpers/scheduled_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,7 @@ def send_monthly_event_invoice():
ticket_fee_maximum = ticket_fee_object.maximum_fee
orders = Order.query.filter_by(event=event).all()
gross_revenue = event.calc_monthly_revenue()
invoice_amount = (
event.tickets_sold * gross_revenue * (ticket_fee_percentage / 100)
)
invoice_amount = gross_revenue * (ticket_fee_percentage / 100)
if invoice_amount > ticket_fee_maximum:
invoice_amount = ticket_fee_maximum
net_revenue = gross_revenue - invoice_amount
Expand Down
3 changes: 1 addition & 2 deletions tests/all/integration/api/helpers/test_scheduled_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ def test_send_monthly_invoice(self):
"""Method to test monthly invoices"""

with self.app.test_request_context():
ticket_fee_test = TicketFeesFactory()
ticket_fee_test.service_fee = 10.23
TicketFeesFactory(service_fee=10.23, maximum_fee=11)

test_event = EventFactoryBasic(state='published')

Expand Down

0 comments on commit 6a29b66

Please sign in to comment.