Skip to content

Commit

Permalink
Add adjustment logging
Browse files Browse the repository at this point in the history
  • Loading branch information
vdumoulin committed Jul 19, 2014
1 parent ccc843a commit a1c8c9f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions register.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,10 +511,18 @@ def _adjust_register_count(self, amount):
amount : float
Adjustment amount
"""
old_register_count = self.register_count
if amount < 0:
self._substract_from_register_count(abs(amount))
else:
self._add_to_register_count(amount)
new_register_count = self.register_count
self.count_logger.info(
"Adjustment by " + self.get_employee_name() + "\n" +
" Old count: %.2f$" % old_register_count + "\n" +
" New count: %.2f$" % new_register_count + "\n" +
"Difference: %.2f$" % amount
)

def _add_to_register_count(self, amount):
"""
Expand Down

0 comments on commit a1c8c9f

Please sign in to comment.