mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 08:24:47 +00:00
fix: validate pending reposting till acc frozen date
This commit is contained in:
@@ -560,7 +560,7 @@ def is_reposting_item_valuation_in_progress():
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def check_pending_reposting(posting_date: str, throw_error: bool = True) -> bool:
|
def check_pending_reposting(posting_date: str, company: str | None = None, throw_error: bool = True) -> bool:
|
||||||
"""Check if there are pending reposting job till the specified posting date."""
|
"""Check if there are pending reposting job till the specified posting date."""
|
||||||
|
|
||||||
filters = {
|
filters = {
|
||||||
@@ -568,6 +568,8 @@ def check_pending_reposting(posting_date: str, throw_error: bool = True) -> bool
|
|||||||
"status": ["in", ["Queued", "In Progress"]],
|
"status": ["in", ["Queued", "In Progress"]],
|
||||||
"posting_date": ["<=", posting_date],
|
"posting_date": ["<=", posting_date],
|
||||||
}
|
}
|
||||||
|
if company:
|
||||||
|
filters["company"] = company
|
||||||
|
|
||||||
reposting_pending = frappe.db.exists("Repost Item Valuation", filters)
|
reposting_pending = frappe.db.exists("Repost Item Valuation", filters)
|
||||||
if reposting_pending and throw_error:
|
if reposting_pending and throw_error:
|
||||||
|
|||||||
Reference in New Issue
Block a user