Merge branch 'master' into edge
This commit is contained in:
commit
9f3f3e6ee6
@ -23,6 +23,9 @@ from utilities.transaction_base import TransactionBase
|
||||
class AccountsController(TransactionBase):
|
||||
def get_gl_dict(self, args, cancel=None):
|
||||
"""this method populates the common properties of a gl entry record"""
|
||||
if cancel is None:
|
||||
cancel = (self.doc.docstatus == 2)
|
||||
|
||||
gl_dict = {
|
||||
'company': self.doc.company,
|
||||
'posting_date': self.doc.posting_date,
|
||||
@ -30,7 +33,7 @@ class AccountsController(TransactionBase):
|
||||
'voucher_no': self.doc.name,
|
||||
'aging_date': self.doc.fields.get("aging_date") or self.doc.posting_date,
|
||||
'remarks': self.doc.remarks,
|
||||
'is_cancelled': self.doc.docstatus == 2 and "Yes" or "No",
|
||||
'is_cancelled': cancel and "Yes" or "No",
|
||||
'fiscal_year': self.doc.fiscal_year,
|
||||
'debit': 0,
|
||||
'credit': 0,
|
||||
|
30
patches/march_2013/p05_payment_reconciliation.py
Normal file
30
patches/march_2013/p05_payment_reconciliation.py
Normal file
@ -0,0 +1,30 @@
|
||||
import webnotes
|
||||
|
||||
def execute():
|
||||
# delete wrong gle entries created due to a bug in make_gl_entries of Account Controller
|
||||
# when using payment reconciliation
|
||||
res = webnotes.conn.sql_list("""select distinct gl1.voucher_no
|
||||
from `tabGL Entry` gl1, `tabGL Entry` gl2
|
||||
where
|
||||
(date(gl1.modified) between "2013-03-11" and "2013-03-15")
|
||||
and date(gl1.modified) = date(gl2.modified)
|
||||
and gl1.voucher_no = gl2.voucher_no
|
||||
and gl1.voucher_type = "Journal Voucher"
|
||||
and gl1.voucher_type = gl2.voucher_type
|
||||
and gl1.posting_date = gl2.posting_date
|
||||
and gl1.account = gl2.account
|
||||
and ifnull(gl1.cost_center, "") = ifnull(gl2.cost_center, "")
|
||||
and ifnull(gl1.is_cancelled, 'No') = 'No' and ifnull(gl2.is_cancelled, 'No') = 'No'
|
||||
and ifnull(gl1.against_voucher, '') = ifnull(gl2.against_voucher, '')
|
||||
and ifnull(gl1.against_voucher_type, '') = ifnull(gl2.against_voucher_type, '')
|
||||
and gl1.remarks = gl2.remarks
|
||||
and ifnull(gl1.debit, 0) = ifnull(gl2.credit, 0)
|
||||
and ifnull(gl1.credit, 0) = ifnull(gl2.debit, 0)
|
||||
and gl1.name > gl2.name""")
|
||||
|
||||
for r in res:
|
||||
webnotes.conn.sql("""update `tabGL Entry` set `is_cancelled`='Yes'
|
||||
where voucher_type='Journal Voucher' and voucher_no=%s""", r)
|
||||
jv = webnotes.bean("Journal Voucher", r)
|
||||
jv.run_method("make_gl_entries")
|
||||
|
@ -211,4 +211,5 @@ patch_list = [
|
||||
"patches.march_2013.p02_get_global_default",
|
||||
"patches.march_2013.p03_rename_blog_to_blog_post",
|
||||
"execute:webnotes.reload_doc('hr', 'search_criteria', 'monthly_attendance_details')",
|
||||
"patches.march_2013.p05_payment_reconciliation",
|
||||
]
|
Loading…
x
Reference in New Issue
Block a user