fix(bx): allow reimburse submit when invoice wallet balance is insufficient
Drop the hard balance check in debit_reimburse so occupancy can exceed uploaded invoices; balance may go negative until later top-ups. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
4f75bc40b9
commit
99e4d4c69a
2 files changed
+12
-7
No files matched your search
@@ -39,3 +39,15 @@ def test_release_idempotent_guard():
|
||||
assert should_skip_release(has_debit=True, has_release=True) is True
|
||||
assert should_skip_release(has_debit=True, has_release=False) is False
|
||||
assert should_skip_release(has_debit=False, has_release=False) is True
|
||||
|
||||
|
||||
def test_summarize_allows_negative_balance():
|
||||
"""提交占用可超过已上传总额,余额可为负(补票后再回升)。"""
|
||||
rows = [
|
||||
{"entry_type": ENTRY_CREDIT_UPLOAD, "amount": Decimal("100")},
|
||||
{"entry_type": ENTRY_DEBIT_REIMBURSE, "amount": Decimal("300")},
|
||||
]
|
||||
s = summarize_entries(rows)
|
||||
assert s["total_amount"] == Decimal("100")
|
||||
assert s["used_amount"] == Decimal("300")
|
||||
assert s["balance"] == Decimal("-200")
|
||||
Reference in new issue
Block a user