def generate_fiscal_period(context):
    """ Generate fiscal period based on the date provided """
    reporting_end_date = context.current_parameters['reporting_end_date']
    period = 0
    if reporting_end_date:
        period = (reporting_end_date.month + 3) % 12
        period = 12 if period == 0 else period
    return period