Merge branch 'master' of github.com:webnotes/erpnext
This commit is contained in:
commit
e8f7592b19
@ -141,6 +141,9 @@ class DocType:
|
|||||||
# ----------------
|
# ----------------
|
||||||
def save_entries(self, cancel, adv_adj, update_outstanding):
|
def save_entries(self, cancel, adv_adj, update_outstanding):
|
||||||
for le in self.entries:
|
for le in self.entries:
|
||||||
|
# round off upto 2 decimal
|
||||||
|
le.debit, le.credit = round(le.debit, 2), round(le.credit, 2)
|
||||||
|
|
||||||
#toggle debit, credit if negative entry
|
#toggle debit, credit if negative entry
|
||||||
if flt(le.debit) < 0 or flt(le.credit) < 0:
|
if flt(le.debit) < 0 or flt(le.credit) < 0:
|
||||||
tmp=le.debit
|
tmp=le.debit
|
||||||
|
@ -54,9 +54,9 @@ class DocType:
|
|||||||
r = []
|
r = []
|
||||||
if self.doc.cheque_no :
|
if self.doc.cheque_no :
|
||||||
if self.doc.cheque_date:
|
if self.doc.cheque_date:
|
||||||
r.append('Via cheque #%s dated %s' % (self.doc.cheque_no, formatdate(self.doc.cheque_date)))
|
r.append('Via Reference #%s dated %s' % (self.doc.cheque_no, formatdate(self.doc.cheque_date)))
|
||||||
else :
|
else :
|
||||||
msgprint("Please enter cheque date")
|
msgprint("Please enter Reference date")
|
||||||
raise Exception
|
raise Exception
|
||||||
|
|
||||||
for d in getlist(self.doclist, 'entries'):
|
for d in getlist(self.doclist, 'entries'):
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import webnotes
|
import webnotes
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
webnotes.reload_doc("support", "doctype", "communication")
|
webnotes.reload_doc("core", "doctype", "communication")
|
||||||
webnotes.conn.sql("""update tabCommunication set sender=email_address
|
webnotes.conn.sql("""update tabCommunication set sender=email_address
|
||||||
where ifnull(support_ticket,'') != ''""")
|
where ifnull(support_ticket,'') != ''""")
|
||||||
webnotes.conn.sql("""update tabCommunication set recipients=email_address where
|
webnotes.conn.sql("""update tabCommunication set recipients=email_address where
|
||||||
|
16
patches/november_2012/gle_floating_point_issue.py
Normal file
16
patches/november_2012/gle_floating_point_issue.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
def execute():
|
||||||
|
import webnotes
|
||||||
|
|
||||||
|
webnotes.conn.sql("""update `tabGL Entry`
|
||||||
|
set debit = round(debit, 2), credit = round(credit, 2)""")
|
||||||
|
|
||||||
|
gle = webnotes.conn.sql("""select voucher_type, voucher_no,
|
||||||
|
sum(ifnull(debit,0)) - sum(ifnull(credit, 0)) as diff
|
||||||
|
from `tabGL Entry`
|
||||||
|
group by voucher_type, voucher_no
|
||||||
|
having sum(ifnull(debit, 0)) != sum(ifnull(credit, 0))""", as_dict=1)
|
||||||
|
|
||||||
|
for d in gle:
|
||||||
|
webnotes.conn.sql("""update `tabGL Entry` set debit = debit - %s
|
||||||
|
where voucher_type = %s and voucher_no = %s and debit > 0 limit 1""",
|
||||||
|
(d['diff'], d['voucher_type'], d['voucher_no']))
|
@ -701,4 +701,8 @@ patch_list = [
|
|||||||
'patch_module': 'patches.november_2012',
|
'patch_module': 'patches.november_2012',
|
||||||
'patch_file': 'production_order_patch',
|
'patch_file': 'production_order_patch',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'patch_module': 'patches.november_2012',
|
||||||
|
'patch_file': 'gle_floating_point_issue',
|
||||||
|
},
|
||||||
]
|
]
|
Loading…
x
Reference in New Issue
Block a user