diff options
| -rw-r--r-- | python/Dawn/static/wire.js | 6 | ||||
| -rw-r--r-- | python/Dawn/views.py | 6 |
2 files changed, 9 insertions, 3 deletions
diff --git a/python/Dawn/static/wire.js b/python/Dawn/static/wire.js index 48f87104..b2d761c6 100644 --- a/python/Dawn/static/wire.js +++ b/python/Dawn/static/wire.js @@ -21,7 +21,11 @@ function addWire(direction, wire_data) { clone.getElementById("btn").id = direction + "-btn"; document.getElementById(direction).appendChild(clone); for(var key in wire_data) { - document.getElementById(direction + "-" + key + "-" + count).value = wire_data[key]; + if( key == "action" ){ + document.getElementById("action").value = wire_data[key]; + } else { + document.getElementById(direction + "-" + key + "-" + count).value = wire_data[key]; + } } document.getElementById(direction + "-btn").addEventListener("click", addWire(direction)); }; diff --git a/python/Dawn/views.py b/python/Dawn/views.py index 10a9eaa0..5f479878 100644 --- a/python/Dawn/views.py +++ b/python/Dawn/views.py @@ -177,10 +177,12 @@ def save_ticket(trade, old_ticket_name): def split_direction(g, direction): if direction == "outgoing": - return [{"folder": cf.folder, "amount": -cf.amount, "code": cf.code} + return [{"folder": cf.folder, "amount": -cf.amount, "code": cf.code, + "currency": cf.currency, "action": cf.action} for cf in g if cf.amount < 0] elif direction == "incoming": - return [{"folder": cf.folder, "amount": cf.amount, "code": cf.code} + return [{"folder": cf.folder, "amount": cf.amount, "code": cf.code, + "currency": cf.currency, "action": cf.action} for cf in g if cf.amount > 0] else: raise ValueError("direction can be one of 'outgoing' or 'incoming'") |
