From 74b8e41ff08d88ee9334c51dbf148742f35d003a Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Mon, 28 Aug 2017 17:42:46 +0530 Subject: [PATCH] Convert INR to USD --- foundation/erpnext_foundation/doctype/bounty/bounty.py | 9 ++++++++- .../doctype/bounty_backer/bounty_backer.json | 5 +++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/foundation/erpnext_foundation/doctype/bounty/bounty.py b/foundation/erpnext_foundation/doctype/bounty/bounty.py index 24fd2d33..62539e34 100644 --- a/foundation/erpnext_foundation/doctype/bounty/bounty.py +++ b/foundation/erpnext_foundation/doctype/bounty/bounty.py @@ -36,7 +36,14 @@ class Bounty(WebsiteGenerator): def validate(self): from frappe.utils.user import get_user_fullname - self.bounty_collected = sum([backer.amount for backer in self.bounty_backer if backer.paid]) + self.bounty_collected = 0.0 + for backer in self.bounty_backer: + if backer.paid: + amount = backer.amount + if backer.currency == 'INR': + amount = backer.amount / 65.00 + self.bounty_collected += amount + if not self.route: self.published = 1 self.route = 'bounties/' + self.feature_name.lower().replace(' ', '-') diff --git a/foundation/erpnext_foundation/doctype/bounty_backer/bounty_backer.json b/foundation/erpnext_foundation/doctype/bounty_backer/bounty_backer.json index f4ea096e..83580ba0 100644 --- a/foundation/erpnext_foundation/doctype/bounty_backer/bounty_backer.json +++ b/foundation/erpnext_foundation/doctype/bounty_backer/bounty_backer.json @@ -92,6 +92,7 @@ "label": "Amount", "length": 0, "no_copy": 0, + "options": "currency", "permlevel": 0, "precision": "", "print_hide": 0, @@ -206,8 +207,8 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2017-08-25 18:41:22.187182", - "modified_by": "Administrator", + "modified": "2017-08-28 17:42:12.216221", + "modified_by": "faris@erpnext.com", "module": "ERPNext Foundation", "name": "Bounty Backer", "name_case": "",