From 9850e1cc8eb22e27d2fbb9b5eb7e2af5c1637a20 Mon Sep 17 00:00:00 2001 From: Brendan West Date: Mon, 29 Apr 2019 18:18:48 -0700 Subject: [PATCH] Changed the good standing discount to be a global variable (now matches the wholesale discount) --- chezbetty/datalayer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chezbetty/datalayer.py b/chezbetty/datalayer.py index 6cad5eb..f72a107 100644 --- a/chezbetty/datalayer.py +++ b/chezbetty/datalayer.py @@ -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. @@ -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)