Skip to content

Commit

Permalink
Changed the good standing discount to be a global variable (now match…
Browse files Browse the repository at this point in the history
…es the wholesale discount)
  • Loading branch information
westbl committed Apr 30, 2019
1 parent 27a93e1 commit 9850e1c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion chezbetty/datalayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

global wholesale_markup
wholesale_markup = Decimal(1.20)
global good_standing_discount
good_standing_discount = Decimal(1.05)

def top_debtor_wrapper(fn):
'''Wrapper function for transactions that watches for a new top debtor.
Expand Down Expand Up @@ -190,7 +192,7 @@ def purchase(user, account, items):
elif user.role == "administrator":
discount = Decimal(1-1/wholesale_markup)
else:
discount = Decimal('0.05')
discount = Decimal(1-1/good_standing_discount)

# Need to calculate a total
amount = Decimal(0)
Expand Down

0 comments on commit 9850e1c

Please sign in to comment.