Implement issue 1 search, order reuse and tracking
This commit is contained in:
@@ -11,6 +11,10 @@ from security import current_user, db, login_required
|
||||
|
||||
TRACKING_FILTERS = {
|
||||
'open': '待跟进订单',
|
||||
'work_undelivered': '未交付订单(含部分交货)',
|
||||
'work_invoice_due': '已交付已收票待付款',
|
||||
'work_completed': '已完成订单',
|
||||
'work_other': '其他待跟进 / 待核对',
|
||||
'prepayment': '需预付款',
|
||||
'invoice_due': '已收票待付款',
|
||||
'unpaid': '未付款',
|
||||
@@ -35,9 +39,17 @@ def tracking_conditions():
|
||||
completed = and_(current_payment, current_fulfillment, Order.payment_status == 'paid',
|
||||
Order.delivery_status == 'delivered')
|
||||
closed = and_(completed, Order.invoice_status == 'received')
|
||||
work_undelivered = and_(current_fulfillment, Order.delivery_status.in_(('pending', 'partial')))
|
||||
work_invoice_due = and_(current_fulfillment, current_payment,
|
||||
Order.delivery_status == 'delivered', Order.invoice_status == 'received',
|
||||
Order.payment_status.in_(('unpaid', 'partial')))
|
||||
return {
|
||||
'open': ~closed,
|
||||
'closed': closed,
|
||||
'work_undelivered': work_undelivered,
|
||||
'work_invoice_due': work_invoice_due,
|
||||
'work_completed': closed,
|
||||
'work_other': and_(~closed, ~work_undelivered, ~work_invoice_due),
|
||||
'prepayment': and_(current_fulfillment, Order.needs_prepayment.is_(True), payment_due),
|
||||
'invoice_due': and_(current_fulfillment, Order.invoice_status == 'received', payment_due),
|
||||
'unpaid': and_(current_payment, Order.payment_status == 'unpaid'),
|
||||
|
||||
Reference in New Issue
Block a user