List rates
Lists the code and name of all rates of the company, or of the rates that match a pattern. Rates are the prices of Twinfield Time & Expenses: what an hour or a kilometre costs (internal rate) and what you invoice for it (external rate).
search() uses the Finder type TRT and gives RateSummary results with code and name. all() fetches page after page while you iterate, so it also works for hundreds of rates. Use get() for the type, unit, currency and prices (see Read rate).
$twinfield = Example::twinfield();
foreach ($twinfield->rates()->search($pattern)->all() as $rate) { echo $rate->code, ' ', $rate->name, PHP_EOL;}php examples/rates/list-rates/example.phpphp examples/rates/list-rates/example.php 'T*'CONSULT ConsultancyKM KilometresT01 Bookkeeping 0 - 50Source
Section titled “Source”View examples/rates/list-rates/example.php on GitHub.
Twinfield and Wolters Kluwer are trademarks of Wolters Kluwer. Their names and logos are used only to refer to their products.