Propose bill matches
propose_bill_matchesPair ONE supplier's open bills to bank payments as a set, in one read-only call: each bill and each money-out bank line is used at most once, so a supplier who bills the same amounts every month cannot have one payment claimed by two bills. Pass supplier (sup-…) and optionally a from/to due-date range. A line in another currency is converted at its own date's rate and must land within 2% of the bill; among those, a line one day after the bill wins, then same-day, then by smallest FX gap. Returns {pairs [{bill, transaction, lag_days, gap_percent, tied}], settle_batches, unmatched_bills, unmatched_candidate_lines, unconvertible_lines, totals, matched, truncated, limit}. tied = true means another line fit that bill equally well, so ask the user about that pair. READ-ONLY: it proposes, never settles. Show the pairs; once the user confirms, send each settle_batches entry ({pairs [{bill, transaction}]}, at most 100 pairs) to settle_bills as its arguments. A bill in a foreign currency paid from a base-currency line may come back from settle_bills as "failed" with code "cross-currency-needs-fx"; leave those for the user.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Only bills due on/before this date (inclusive, ISO 8601). | |
| from | No | Only bills due on/after this date (inclusive, ISO 8601). | |
| supplier | Yes | The supplier id (sup-…) whose open bills to pair. |