diff --git a/yuthon_property/models/property_bank_statements.py b/yuthon_property/models/property_bank_statements.py index 3f4bae9e2..27ac56a7f 100644 --- a/yuthon_property/models/property_bank_statements.py +++ b/yuthon_property/models/property_bank_statements.py @@ -265,13 +265,13 @@ class ReceivableModifyLine(models.Model): key=lambda l: ( 0 if l.reconciliation_date else 1, l.reconciliation_date or date.max, - l.id, + l.id if isinstance(l.id, int) else 0, ) ) cumsum = 0.0 for line in sorted_lines: - if line.id == rec.id: + if line == rec: remaining = rec.receivable_id.original_amount - cumsum rec.delivered1 = rec.receivable_id.original_amount if remaining <= 0 else remaining break