List pay runs
Lists the payment and direct debit runs of a company (GetRuns on payandcollect.asmx), without their summaries. Read a run with its summaries and invoices with the Get pay run example.
list()returns aPayRunOverviewper run: pay type, ID, run type (PaymentorDirectDebit), phase and status, bank, pay date and period.- A run stays in the list until it is finished, see the Finish pay run example.
$twinfield = Example::twinfield();
$runs = $twinfield->payAndCollect()->list();
if ($runs === []) { echo 'No pay runs in company ', $twinfield->companyCode(), '.', PHP_EOL;
exit;}
foreach ($runs as $run) { echo $run->payType, ' ', $run->id, ': ', $run->runType->name, ', ', $run->phase->name, ' ', $run->status->name, ', pay date ', $run->payDate->format('Y-m-d'), ', period ', $run->period, ', bank ', $run->bank, PHP_EOL;}TWINFIELD_COMPANY=1002_3 php examples/pay-and-collect/list-pay-runs/example.phpAdd TWINFIELD_DEBUG=1 to see the SOAP request and response.
Output of a company without runs:
No pay runs in company 1002_3.Source
Section titled “Source”View examples/pay-and-collect/list-pay-runs/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.