def METHOD_NAME(dbcommit=False, reindex=False):
    """Update status of issues with a passed `expected_date` to late status.
    :param reindex: reindex record by record.
    :param dbcommit: commit record to database.
    :return: the number of updated issues.
    """
    from rero_ils.modules.items.api import Item, ItemsSearch
    yesterday = datetime.now(timezone.utc) - timedelta(days=1)
    yesterday = yesterday.strftime('%Y-%m-%d')
    query = ItemsSearch() \
        .filter('term', type=TypeOfItem.ISSUE) \
        .filter('term', issue__status=ItemIssueStatus.EXPECTED) \
        .filter('range', issue__expected_date={'lte': yesterday}) \
        .source(False)
    counter = 0
    for counter, hit in enumerate(query.scan(), 1):
        item = Item.get_record(hit.meta.id)
        item.issue_status = ItemIssueStatus.LATE
        item.update(item, dbcommit=dbcommit, reindex=reindex)
    return counter