mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-08 15:42:52 +00:00
Unlinked message listing all linked entries while cancelling an accounting trandsaction
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import webnotes
|
import webnotes
|
||||||
from webnotes.utils import nowdate, nowtime, cstr, flt, now, getdate, add_months
|
from webnotes.utils import nowdate, cstr, flt, now, getdate, add_months
|
||||||
from webnotes.model.doc import addchild
|
from webnotes.model.doc import addchild
|
||||||
from webnotes import msgprint, _
|
from webnotes import msgprint, _
|
||||||
from webnotes.utils import formatdate
|
from webnotes.utils import formatdate
|
||||||
@@ -64,7 +64,6 @@ def get_balance_on(account=None, date=None):
|
|||||||
try:
|
try:
|
||||||
year_start_date = get_fiscal_year(date, verbose=0)[1]
|
year_start_date = get_fiscal_year(date, verbose=0)[1]
|
||||||
except FiscalYearError, e:
|
except FiscalYearError, e:
|
||||||
from webnotes.utils import getdate
|
|
||||||
if getdate(date) > getdate(nowdate()):
|
if getdate(date) > getdate(nowdate()):
|
||||||
# if fiscal year not found and the date is greater than today
|
# if fiscal year not found and the date is greater than today
|
||||||
# get fiscal year for today's date and its corresponding year start date
|
# get fiscal year for today's date and its corresponding year start date
|
||||||
@@ -222,6 +221,10 @@ def get_cost_center_list(doctype, txt, searchfield, start, page_len, filters):
|
|||||||
tuple(filter_values + ["%%%s%%" % txt, start, page_len]))
|
tuple(filter_values + ["%%%s%%" % txt, start, page_len]))
|
||||||
|
|
||||||
def remove_against_link_from_jv(ref_type, ref_no, against_field):
|
def remove_against_link_from_jv(ref_type, ref_no, against_field):
|
||||||
|
linked_jv = webnotes.conn.sql_list("""select parent from `tabJournal Voucher Detail`
|
||||||
|
where `%s`=%s and docstatus < 2""" % (against_field, "%s"), (ref_no))
|
||||||
|
|
||||||
|
if linked_jv:
|
||||||
webnotes.conn.sql("""update `tabJournal Voucher Detail` set `%s`=null,
|
webnotes.conn.sql("""update `tabJournal Voucher Detail` set `%s`=null,
|
||||||
modified=%s, modified_by=%s
|
modified=%s, modified_by=%s
|
||||||
where `%s`=%s and docstatus < 2""" % (against_field, "%s", "%s", against_field, "%s"),
|
where `%s`=%s and docstatus < 2""" % (against_field, "%s", "%s", against_field, "%s"),
|
||||||
@@ -234,6 +237,11 @@ def remove_against_link_from_jv(ref_type, ref_no, against_field):
|
|||||||
and voucher_no != ifnull(against_voucher, '')""",
|
and voucher_no != ifnull(against_voucher, '')""",
|
||||||
(now(), webnotes.session.user, ref_type, ref_no))
|
(now(), webnotes.session.user, ref_type, ref_no))
|
||||||
|
|
||||||
|
webnotes.msgprint("{msg} {linked_jv}".format(msg = _("""Following linked Journal Vouchers \
|
||||||
|
made against this transaction has been unlinked. You can link them again with other \
|
||||||
|
transactions via Payment Reconciliation Tool."""), linked_jv="\n".join(linked_jv)))
|
||||||
|
|
||||||
|
|
||||||
@webnotes.whitelist()
|
@webnotes.whitelist()
|
||||||
def get_company_default(company, fieldname):
|
def get_company_default(company, fieldname):
|
||||||
value = webnotes.conn.get_value("Company", company, fieldname)
|
value = webnotes.conn.get_value("Company", company, fieldname)
|
||||||
|
|||||||
Reference in New Issue
Block a user