invoice.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:zing 作者: evernote 项目源码 文件源码
def _check_single_paidtask(invoice, amount):
    local_now = timezone.localtime(invoice.now)
    current_month_start = local_now.replace(day=1, hour=0, minute=0, second=0)
    PaidTask.objects.get(
        task_type=PaidTaskTypes.CORRECTION,
        amount=(-1) * amount,
        datetime=invoice.month_end,
        description='Carryover to the next month',
        user=invoice.user,
    )
    PaidTask.objects.get(
        task_type=PaidTaskTypes.CORRECTION,
        amount=amount,
        datetime=current_month_start,
        description='Carryover from the previous month',
        user=invoice.user,
    )
    assert PaidTask.objects.filter(task_type=PaidTaskTypes.CORRECTION).count() == 2
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号