diff --git a/landa/water_body_management/doctype/catch_log_entry/catch_log_entry.js b/landa/water_body_management/doctype/catch_log_entry/catch_log_entry.js index 0f2bf614..fe2727e2 100644 --- a/landa/water_body_management/doctype/catch_log_entry/catch_log_entry.js +++ b/landa/water_body_management/doctype/catch_log_entry/catch_log_entry.js @@ -21,5 +21,12 @@ frappe.ui.form.on("Catch Log Entry", { }); }); } + const today = new Date(); + const current_year = today.getFullYear(); + const current_month = today.getMonth(); + + if (!frm.doc.year) { + frm.set_value("year", current_month < 6 ? current_year - 1 : current_year); + } }, });