I also faced this issue recently. In my case, the ERPNext JS bundles were not loading, which caused erpnext.utils.get_fiscal_year() to be undefined. I simply disabled the browser cache and reloaded the page to fetch all the JS files from the server, and it started working