# legal.retainer-drawdown
Money a client pays on account of costs is held in client account until a bill
is delivered; then it may be transferred to pay that bill. This applies the
money on account to the bills in the order given, each bill taking as much as
it can until the money runs out, and reports what each bill took, what each
still has due and what is left on account. Everything is in exact minor units:
the applied and outstanding amounts of a bill always add to the bill, and the
total applied plus the balance is always the money on account.
The order is the caller's: pass the bills oldest first to pay them in the order
they were delivered, which is the usual term in a client care letter. A bill
of zero is allowed and takes nothing. A negative bill (a credit note) is an
error: credit notes reduce a bill before this step, they do not add money to
the account.
This is arithmetic only. Whether money may be taken at all is a regulatory
question. Rule 4.3 of the SRA Accounts Rules
(https://www.sra.org.uk/solicitors/standards-regulations/accounts-rules/)
requires a bill of costs or other written notification of the costs to be given
before client money is transferred to pay them, and the payment to be for the
specific sum identified and covered by the money held for that client. Pass
only bills that have been delivered, for one client and matter. Whether the
last bill may be part-paid from what is left, as this does, or must wait until
the whole sum is held, is a question for the firm's compliance officer (COFA);
check `outstanding` on each bill and transfer nothing for a part-paid one if
your firm reads the rule strictly. All amounts must be in one currency.
## Before you rely on this
**Not professional advice.** This capability calculates legal figures from published rules. It is a software component for developers, not legal advice. Rules change and every rate here has an effective date. Check that the dates cover your case. Verify results against the official sources listed above, and have a solicitor review how you use it, before anyone relies on the output. Provided "as is" under its licence, without warranty.
**Unreviewed.** This capability's implementations agree in every language and pass its published test vectors, which were worked out from the official sources cited. But no qualified solicitor has yet checked those vectors, or confirmed that the capability covers the cases it claims. Treat it as a draft. Do not use it for real people, money or decisions without your own expert review. Once a qualified reviewer signs off, this notice is replaced with their name, qualification and the date. Each new version needs fresh sign-off.
1.0.1 marks it unreviewed. The code and the tests are unchanged.