1
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user