aboutsummaryrefslogtreecommitdiff
path: root/ihatemoney/history.py
diff options
context:
space:
mode:
authordark0dave <52840419+dark0dave@users.noreply.github.com>2020-04-29 21:57:08 +0100
committerGitHub <noreply@github.com>2020-04-29 22:57:08 +0200
commitf389c562595f74bea86e49c29949f4a7b0e78900 (patch)
treec3c0ac339ad002f47e2be9cd3a46d347012b1d70 /ihatemoney/history.py
parent162193c787341118621b36b4c8933bbe8af092df (diff)
downloadihatemoney-mirror-f389c562595f74bea86e49c29949f4a7b0e78900.zip
ihatemoney-mirror-f389c562595f74bea86e49c29949f4a7b0e78900.tar.gz
ihatemoney-mirror-f389c562595f74bea86e49c29949f4a7b0e78900.tar.bz2
Feature/currencies (#541)
Now each project can have a currency, default to None. Each bill can use a different currency, and a conversion to project default currency is done on settle. Fix #512
Diffstat (limited to 'ihatemoney/history.py')
-rw-r--r--ihatemoney/history.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/ihatemoney/history.py b/ihatemoney/history.py
index 9dda3de..faa12c0 100644
--- a/ihatemoney/history.py
+++ b/ihatemoney/history.py
@@ -105,6 +105,14 @@ def get_history(project, human_readable_names=True):
if removed:
changeset["owers_removed"] = (None, removed)
+ # Remove converted_amount if amount changed in the same way.
+ if (
+ "amount" in changeset
+ and "converted_amount" in changeset
+ and changeset["amount"] == changeset["converted_amount"]
+ ):
+ del changeset["converted_amount"]
+
for (prop, (val_before, val_after),) in changeset.items():
if human_readable_names:
if prop == "payer_id":