# coding=utf-8
# create by oldman at 2018/1/15
from django.core.management import BaseCommand

from api.models import BuDanLuRu
from api.tasks.budan_task import settlement_create_event


class Command(BaseCommand):
    """
    修改补单录入的时间，并跑2017-12的对账单
    python manage.py update_2018_01_15_budan_luru
    """

    def handle(self, *args, **options):
        luru_ids = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 18]
        BuDanLuRu.objects.filter(id__in=luru_ids).update(created_time='2017-12-20 10:00:00',
                                                         month=201712
                                                         )
        print('数据修改完毕，开始跑对账单！')
        settlement_create_event()
        print ('对账单处理完毕！')
