Merge pull request #38 from netchampfaris/bounty-system

Convert INR to USD
This commit is contained in:
Faris Ansari
2017-08-28 17:44:27 +05:30
committed by GitHub
2 changed files with 11 additions and 3 deletions

View File

@@ -36,7 +36,14 @@ class Bounty(WebsiteGenerator):
def validate(self): def validate(self):
from frappe.utils.user import get_user_fullname 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: if not self.route:
self.published = 1 self.published = 1
self.route = 'bounties/' + self.feature_name.lower().replace(' ', '-') self.route = 'bounties/' + self.feature_name.lower().replace(' ', '-')

View File

@@ -92,6 +92,7 @@
"label": "Amount", "label": "Amount",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
"options": "currency",
"permlevel": 0, "permlevel": 0,
"precision": "", "precision": "",
"print_hide": 0, "print_hide": 0,
@@ -206,8 +207,8 @@
"issingle": 0, "issingle": 0,
"istable": 1, "istable": 1,
"max_attachments": 0, "max_attachments": 0,
"modified": "2017-08-25 18:41:22.187182", "modified": "2017-08-28 17:42:12.216221",
"modified_by": "Administrator", "modified_by": "faris@erpnext.com",
"module": "ERPNext Foundation", "module": "ERPNext Foundation",
"name": "Bounty Backer", "name": "Bounty Backer",
"name_case": "", "name_case": "",