fix(report):check amount_status

This commit is contained in:
shahzeydyfah
2025-05-29 15:31:58 +03:30
parent 2edefabd59
commit 503ee1712c
+12 -11
View File
@@ -313,17 +313,18 @@ class ReportRepository():
if report: if report:
for i in report: for i in report:
_model = ProjectPriceReport(**i) _model = ProjectPriceReport(**i)
cal = (_model.first_amount-_model.amount_status +_model.amount_adjust)/_model.first_amount if 'amount_status' in _model and 'amount_adjust' in _model:
if cal < 20: cal = (_model.first_amount-_model.amount_status +_model.amount_adjust)/_model.first_amount
result['less_than_20'].append(_model.project_id) if cal < 20:
elif cal < 50: result['less_than_20'].append(_model.project_id)
result['bet_20_50'].append(_model.project_id) elif cal < 50:
elif cal < 100: result['bet_20_50'].append(_model.project_id)
result['bet_50_100'].append(_model.project_id) elif cal < 100:
elif cal < 200: result['bet_50_100'].append(_model.project_id)
result['bet_100_200'].append(_model.project_id) elif cal < 200:
else: result['bet_100_200'].append(_model.project_id)
result['upper_than_200'].append(_model.project_id) else:
result['upper_than_200'].append(_model.project_id)
return result return result
async def progress_report(self): async def progress_report(self):