This commit is contained in:
csj
2026-09-17 11:12:57 +08:00
parent 45b6f693d6
commit ced5db5473
11 changed files with 550 additions and 3 deletions
+3
View File
@@ -344,6 +344,8 @@ def payment_total(items):
def enrich(state):
from match_explanation import explain_match
for item in state['invoices'] + state['payments'] + state['photos']:
item['displayAmount'] = float(invoice_amount(item) if item['type'] == 'invoice' else payment_amount(item))
item['sortDate'] = material_date(item)
@@ -354,5 +356,6 @@ def enrich(state):
match['payments'] = [lookup[item['id']] for item in match['payments']]
match['paymentTotal'] = float(payment_total(match['payments']))
match['expenseAmount'] = float(sum(max((Decimal(value) for value in item['ocr']['amounts']), default=Decimal(0)) for item in match['invoices']))
match['explanation'] = explain_match(match)
state['directoryPaymentTotal'] = float(payment_total(state['payments']))
return state