mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-27 00:44:45 +00:00
chore: resolve conflicts and pass all parameters
This commit is contained in:
@@ -657,25 +657,10 @@ def get_due_date_from_template(template_name, posting_date, bill_date):
|
|||||||
return due_date
|
return due_date
|
||||||
|
|
||||||
|
|
||||||
def validate_due_date(posting_date, due_date, bill_date=None, template_name=None):
|
def validate_due_date(posting_date, due_date, bill_date=None, template_name=None, doctype=None):
|
||||||
if getdate(due_date) < getdate(posting_date):
|
if getdate(due_date) < getdate(posting_date):
|
||||||
frappe.throw(_("Due Date cannot be before Posting / Supplier Invoice Date"))
|
frappe.throw(_("Due Date cannot be before Posting / Supplier Invoice Date"))
|
||||||
else:
|
else:
|
||||||
<<<<<<< HEAD
|
|
||||||
if not template_name:
|
|
||||||
return
|
|
||||||
|
|
||||||
default_due_date = get_due_date_from_template(template_name, posting_date, bill_date).strftime(
|
|
||||||
"%Y-%m-%d"
|
|
||||||
)
|
|
||||||
|
|
||||||
if not default_due_date:
|
|
||||||
return
|
|
||||||
|
|
||||||
if default_due_date != posting_date and getdate(due_date) > getdate(default_due_date):
|
|
||||||
is_credit_controller = (
|
|
||||||
frappe.db.get_single_value("Accounts Settings", "credit_controller") in frappe.get_roles()
|
|
||||||
=======
|
|
||||||
validate_due_date_with_template(posting_date, due_date, bill_date, template_name, doctype)
|
validate_due_date_with_template(posting_date, due_date, bill_date, template_name, doctype)
|
||||||
|
|
||||||
|
|
||||||
@@ -696,18 +681,10 @@ def validate_due_date_with_template(posting_date, due_date, bill_date, template_
|
|||||||
_("Note: Due Date exceeds allowed {0} credit days by {1} day(s)").format(
|
_("Note: Due Date exceeds allowed {0} credit days by {1} day(s)").format(
|
||||||
party_type, date_diff(due_date, default_due_date)
|
party_type, date_diff(due_date, default_due_date)
|
||||||
)
|
)
|
||||||
>>>>>>> b6d9134014 (fix: show party type in due date exceeding message)
|
|
||||||
)
|
)
|
||||||
if is_credit_controller:
|
|
||||||
msgprint(
|
else:
|
||||||
_("Note: Due / Reference Date exceeds allowed customer credit days by {0} day(s)").format(
|
frappe.throw(_("Due / Reference Date cannot be after {0}").format(formatdate(default_due_date)))
|
||||||
date_diff(due_date, default_due_date)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
frappe.throw(
|
|
||||||
_("Due / Reference Date cannot be after {0}").format(formatdate(default_due_date))
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
|
|||||||
@@ -779,17 +779,10 @@ class AccountsController(TransactionBase):
|
|||||||
if not self.due_date:
|
if not self.due_date:
|
||||||
frappe.throw(_("Due Date is mandatory"))
|
frappe.throw(_("Due Date is mandatory"))
|
||||||
|
|
||||||
validate_due_date(
|
validate_due_date(posting_date, self.due_date, None, self.payment_terms_template, self.doctype)
|
||||||
posting_date,
|
|
||||||
self.due_date,
|
|
||||||
self.payment_terms_template,
|
|
||||||
)
|
|
||||||
elif self.doctype == "Purchase Invoice":
|
elif self.doctype == "Purchase Invoice":
|
||||||
validate_due_date(
|
validate_due_date(
|
||||||
posting_date,
|
posting_date, self.due_date, self.bill_date, self.payment_terms_template, self.doctype
|
||||||
self.due_date,
|
|
||||||
self.bill_date,
|
|
||||||
self.payment_terms_template,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
def set_price_list_currency(self, buying_or_selling):
|
def set_price_list_currency(self, buying_or_selling):
|
||||||
|
|||||||
Reference in New Issue
Block a user