|
@@ -106,6 +106,7 @@ class UnicomComboView(View):
|
|
|
if combo_order_qs.exists():
|
|
|
combo_order = combo_order_qs.first()
|
|
|
flow_details = {
|
|
|
+ 'flowInvalid': 0,
|
|
|
'iccid': iccid,
|
|
|
'status': combo_order['status'],
|
|
|
'comboName': combo_order['combo__combo_name'],
|
|
@@ -134,12 +135,15 @@ class UnicomComboView(View):
|
|
|
flow_details['usableFlow'] = flow_details['flowTotal'] - flow
|
|
|
|
|
|
flow_details['usableFlow'] = \
|
|
|
- flow_details['flowTotal'] if flow_details['usableFlow'] <= 0 else flow_details['usableFlow']
|
|
|
+ 0.00 if flow_details['usableFlow'] <= 0 else flow_details['usableFlow']
|
|
|
flow_details['usableFlow'] = Decimal(flow_details['usableFlow']).quantize(Decimal('0.00'))
|
|
|
flow_details.pop('flowTotalUsage')
|
|
|
cls.update_combo_order_sort(iccid)
|
|
|
flow_details['comboList'] = cls.get_combo_order_list(iccid)
|
|
|
return response.json(0, flow_details)
|
|
|
+ else:
|
|
|
+ flow_details = {'iccid': iccid, 'flowInvalid': 1, 'comboList': cls.get_combo_order_list(iccid)}
|
|
|
+ return response.json(0, flow_details)
|
|
|
except Exception as e:
|
|
|
print(e.args)
|
|
|
ex = traceback.format_exc()
|