Пример #1
0
def supervision_task():
    now = datetime.datetime.utcnow()
    last_business_day = get_business_day_of_month(month=now.month,
                                                  year=now.year,
                                                  count=-1)
    if now.day == last_business_day.day:
        send_for_all_domains(last_business_day, send_supervision_reminder)
Пример #2
0
def first_soh_task():
    now = datetime.utcnow()
    last_business_day = get_business_day_of_month(month=now.month,
                                                  year=now.year,
                                                  count=-1)
    if now.day == last_business_day.day:
        send_for_all_domains(last_business_day, SOHReminder)
Пример #3
0
def stockout_reminder_task():
    """
        6th business day of month
    """
    now = datetime.utcnow()
    last_business_day = get_business_day_of_month(month=now.month, year=now.year, count=6)
    if now.day != last_business_day.day:
        return

    send_for_all_domains(last_business_day, StockoutReminder)
Пример #4
0
def stockout_reminder_task():
    """
        6th business day of month
    """
    now = datetime.utcnow()
    last_business_day = get_business_day_of_month(month=now.month, year=now.year, count=6)
    if now.day != last_business_day.day:
        return

    send_for_all_domains(last_business_day, StockoutReminder)
Пример #5
0
def third_soh_task():
    now = datetime.utcnow()
    last_month_last_day, fifth_business_day = get_last_and_nth_business_day(
        now, 5)
    if now.day == fifth_business_day.day:
        send_for_all_domains(last_month_last_day, SOHReminder)
Пример #6
0
def third_soh_task():
    now = datetime.datetime.utcnow()
    last_month_last_day, fifth_business_day = get_last_and_nth_business_day(now, 5)
    if now.day == fifth_business_day.day:
        send_for_all_domains(last_month_last_day, send_soh_reminder)
Пример #7
0
def first_soh_task():
    now = datetime.datetime.utcnow()
    last_business_day = get_business_day_of_month(month=now.month, year=now.year, count=-1)
    if now.day == last_business_day.day:
        send_for_all_domains(last_business_day, send_soh_reminder)
Пример #8
0
def second_soh_task():
    now = datetime.datetime.utcnow()
    last_month_last_day, first_business_day = get_last_and_nth_business_day(now, 1)
    if now.day == first_business_day.day:
        send_for_all_domains(last_month_last_day, send_soh_reminder)
Пример #9
0
def second_soh_task():
    now = datetime.utcnow()
    last_month_last_day, first_business_day = get_last_and_nth_business_day(now, 1)
    if now.day == first_business_day.day:
        send_for_all_domains(last_month_last_day, SOHReminder)
Пример #10
0
def supervision_task():
    now = datetime.utcnow()
    last_business_day = get_business_day_of_month(month=now.month, year=now.year, count=-1)
    if now.day == last_business_day.day:
        send_for_all_domains(last_business_day, SupervisionReminder)