commit
f18d285eab
@ -3,7 +3,7 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe.utils import flt, cstr, cint, getdate, add_days, formatdate
|
||||
from frappe.utils import flt, cstr, cint, getdate
|
||||
from frappe import msgprint, throw, _
|
||||
from frappe.model.document import Document
|
||||
|
||||
@ -176,15 +176,7 @@ class Account(Document):
|
||||
frappe.throw(_("Due Date cannot be before Posting Date"))
|
||||
|
||||
elif credit_days is not None and diff > credit_days:
|
||||
is_credit_controller = frappe.db.get_value("Accounts Settings", None,
|
||||
"credit_controller") in frappe.user.get_roles()
|
||||
|
||||
if is_credit_controller:
|
||||
msgprint(_("Note: Due Date exceeds the allowed credit days by {0} day(s)").format(
|
||||
diff - credit_days))
|
||||
else:
|
||||
max_due_date = formatdate(add_days(posting_date, credit_days))
|
||||
frappe.throw(_("Due Date cannot be after {0}").format(max_due_date))
|
||||
msgprint(_("Note: Due Date exceeds the allowed credit days by {0} day(s)").format(diff - credit_days))
|
||||
|
||||
def validate_trash(self):
|
||||
"""checks gl entries and if child exists"""
|
||||
|
@ -149,7 +149,7 @@ class AccountsReceivableReport(object):
|
||||
if not account_map:
|
||||
frappe.throw(_("No Customer Accounts found."))
|
||||
else:
|
||||
accounts_list = ['"{0}"'.format(ac) for ac in account_map]
|
||||
accounts_list = ['"{0}"'.format(ac.replace('"', '\"')) for ac in account_map]
|
||||
conditions.append("account in ({0})".format(", ".join(accounts_list)))
|
||||
|
||||
return " and ".join(conditions), values
|
||||
|
Loading…
Reference in New Issue
Block a user