Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from django.db import transaction
- # @celery_task.task
- def auto_gen_electronic_invoices(lookback_days=1):
- """
- 定时任务,
- 1. 查询U8已审核,发票号码为空,的未开票记录
- 2. 如果Invoice表有:
- 如果发票已经开出,报错;
- 如果发票
- 3. 如果Invoice表没有,则新增,更新U8 SalesBill发票开具状态为待开票,异步调用gen_electronic_invoice,
- :return:
- """
- # 幂等性
- # @celery_task.task
- @transaction.atomic()
- def gen_electronic_invoice(invoice_id: int, force=False):
- """
- 默认并非定时任务
- 1. 根据ID获取invoice
- 2. 如果不为force, 检查是否已经开票
- 3. 如有错误,反写U8状态
- 2. 查U8
- 3. 调用接口
- 4. 反写U8状态
- :return:
- """
Add Comment
Please, Sign In to add comment