po, received, invoice = data['po'][0], data['receipt'][0], data['invoice'][0]
total = Decimal(po['unit_price']) * po['qty']
check('金额由Decimal计算并与发票对应', Decimal(output['invoice_total']) == total == Decimal(invoice['total']))
check('收货缺口独立算出2件', output['ordered_qty'] - output['received_qty'] == 2)
result = {'received_gap': po['qty'] - received['qty'], 'invoice_total': str(total), 'action': 'needs_review', 'extracted': output}
