JavaScript · Advanced · Ticket 5Ticket #41 · from Lena Fischer, Finance & Ops
  1. Example
  2. Warm-up 1
  3. Warm-up 2
  4. Ticket
Brief
NEW TICKET#41 · Bank reconciliation

Match bank payments to open invoices

Lena Fischer · Finance & Ops
Opened today

“Every morning I match the bank feed to open invoices by hand. Let's do a first pass automatically. For each payment, in order: if its reference is an invoice number, match that invoice. References are typed by clients, so ignore spaces at either end and capital letters ("inv-12 " is INV-12). Otherwise, match the first open invoice with exactly the same amount. Each invoice can be matched only once, and a payment with no match gets null, so I can look at it. Can you write matchPayments?”

YOUR PLAN
  1. 1Watch an example2 min
  2. 2Warm-up 11 min
  3. 3Warm-up 21 min
  4. 4Fix the ticket31 min
BY THE END YOU CAN
  • Apply matching rules in order of how sure they are
  • Track what's taken with a Set
  • Return a result for every input, including no match
About 35 minutes
Four short steps. Nothing is timed, and you can leave any time.