def F_GetLastYearPayrollArchive(archive_code):
result = 0
employee_id = individual_dict['ref_employee_id']
year_month_now = str(global_dict['ref_payroll_period_name'])
last_year = str(int(year_month_now[:4]) - 1)
period_start = last_year + '-12-01'
period_end = last_year + '-12-31'
employee_archives = global_dict['F_employee_archives'].get(employee_id, {}).get(archive_code, [])
for archive in employee_archives:
if not archive['expired_date'] and archive['effective_date'] <= period_end and archive['amount'] > result:
result = archive['amount']
elif archive['effective_date'] <= period_end and archive['expired_date'] >= period_start and archive['amount'] > result:
result = archive['amount']
return result