Merge branch 'master' into edge
diff --git a/accounts/doctype/journal_voucher/journal_voucher.py b/accounts/doctype/journal_voucher/journal_voucher.py
index 89114dd..79ee19f 100644
--- a/accounts/doctype/journal_voucher/journal_voucher.py
+++ b/accounts/doctype/journal_voucher/journal_voucher.py
@@ -175,9 +175,9 @@
if flag == 0 and (flt(diff) != 0):
jd = addchild(self.doc, 'entries', 'Journal Voucher Detail', self.doclist)
if diff>0:
- jd.credit = flt(diff)
+ jd.credit = flt(abs(diff))
elif diff<0:
- jd.debit = flt(diff)
+ jd.debit = flt(abs(diff))
# Set the total debit, total credit and difference
for d in getlist(self.doclist,'entries'):
diff --git a/patches/january_2013/update_number_format.py b/patches/january_2013/update_number_format.py
new file mode 100644
index 0000000..96284a6
--- /dev/null
+++ b/patches/january_2013/update_number_format.py
@@ -0,0 +1,18 @@
+from __future__ import unicode_literals
+
+import webnotes
+
+def execute():
+ from webnotes.country_info import get_all
+ data = get_all()
+
+ webnotes.reload_doc("setup", "doctype", "currency")
+
+ for c in data:
+ info = webnotes._dict(data[c])
+ if webnotes.conn.exists("Currency", info.currency):
+ doc = webnotes.doc("Currency", info.currency)
+ doc.fields.update({
+ "number_format": info.number_format,
+ })
+ doc.save()