feat(fusion_accounting_followup): level_resolver service
Made-with: Cursor
This commit is contained in:
@@ -33,6 +33,7 @@ class AgingReport:
|
||||
total_amount: float = 0.0
|
||||
total_overdue_amount: float = 0.0
|
||||
line_count: int = 0
|
||||
max_days_overdue: int = 0
|
||||
|
||||
def to_dict(self):
|
||||
return {
|
||||
@@ -40,6 +41,7 @@ class AgingReport:
|
||||
'total_amount': self.total_amount,
|
||||
'total_overdue_amount': self.total_overdue_amount,
|
||||
'line_count': self.line_count,
|
||||
'max_days_overdue': self.max_days_overdue,
|
||||
'buckets': [{
|
||||
'name': b.name, 'days_min': b.days_min, 'days_max': b.days_max,
|
||||
'amount': b.amount, 'line_count': b.line_count,
|
||||
@@ -70,6 +72,8 @@ def compute_aging(*, move_lines: list[dict], as_of: date | None = None) -> Aging
|
||||
report.total_amount += amount
|
||||
if days_overdue > 0:
|
||||
report.total_overdue_amount += amount
|
||||
if days_overdue > report.max_days_overdue:
|
||||
report.max_days_overdue = days_overdue
|
||||
report.line_count += 1
|
||||
|
||||
return report
|
||||
|
||||
Reference in New Issue
Block a user