refactor: hooks for monthly re-evaluation jobs

(cherry picked from commit fc4e5f165c)
This commit is contained in:
ruthra kumar
2024-07-24 18:16:20 +05:30
committed by Mergify
parent 219310e817
commit 7b3a78e04e
2 changed files with 13 additions and 0 deletions

View File

@@ -1598,6 +1598,18 @@ def auto_create_exchange_rate_revaluation_weekly() -> None:
create_err_and_its_journals(companies) create_err_and_its_journals(companies)
def auto_create_exchange_rate_revaluation_monthly() -> None:
"""
Executed by background job
"""
companies = frappe.db.get_all(
"Company",
filters={"auto_exchange_rate_revaluation": 1, "auto_err_frequency": "Montly"},
fields=["name", "submit_err_jv"],
)
create_err_and_its_journals(companies)
def get_payment_ledger_entries(gl_entries, cancel=0): def get_payment_ledger_entries(gl_entries, cancel=0):
ple_map = [] ple_map = []
if gl_entries: if gl_entries:

View File

@@ -456,6 +456,7 @@ scheduler_events = {
], ],
"monthly_long": [ "monthly_long": [
"erpnext.accounts.deferred_revenue.process_deferred_accounting", "erpnext.accounts.deferred_revenue.process_deferred_accounting",
"erpnext.accounts.utils.auto_create_exchange_rate_revaluation_monthly",
], ],
} }