Skip to content

Customers (130_2)

Browse code 130_2 (BrowseCode::CustomersV2, “Debiteuren (v2)”): the transaction lines of customers, like 130_1, with the open amount in the currency of the transaction and the change date of the line as criteria. Use it to find the customer lines that changed since the last time, e.g. when they were paid.

Twinfield documentation: Browse data.

  • betweenDateTimes('fin.trs.line.modified', $since, $now): the lines that changed in that time, also by matching. The SDK converts the moments to UTC.
  • fin.trs.line.matchstatus, matchdate and matchnumber: whether the line is paid (matched), when, and with which match.
  • fin.trs.line.openvaluesigned is the open amount in the currency of the transaction and can be a criterion, e.g. notBetween('fin.trs.line.openvaluesigned', '0.00', '0.00').

Criteria: period, day book, status, change date of the transaction and of the line, general ledger account, customer, open amount and payment status. See browse-definitions/130_2.xml and the browse data guide.

All fields of the browse definition (browse-definitions/130_2.xml), with the label for a Dutch user, the data type and the values of a field with a fixed list (browsefields.xml). A field that is not visible is meant as criterion: asking for it as column can give a server error. Twinfield does not apply the proposed values: send every criterion you need.

Field Label Type Visible Criterion
fin.trs.head.office Administratie string yes
fin.trs.head.officename Adm.naam string yes
fin.trs.head.year Jaar long yes
fin.trs.head.period Periode long yes
fin.trs.head.yearperiod Jaar/periode (JJJJ/PP) string no between
fin.trs.head.code Dagboek string yes like
fin.trs.head.shortname Dagboeknaam string yes
fin.trs.head.number Boekingsnummer decimal yes
fin.trs.head.status Status special: draft, temporary, final, inuse, normal yes equal (proposed normal)
fin.trs.head.date Boekdatum date yes
fin.trs.line.datedue Vervaldatum date yes
fin.trs.line.invnumber Factuurnummer string yes
fin.trs.head.curcode Valuta string yes
fin.trs.head.customer.respuser Kredietbeheerder string yes
fin.trs.head.customer.respusername Naam kredietbeheerder string yes
fin.trs.head.customer.creditlimit Kredietlimiet value yes
fin.trs.head.modified Wijzigingsdatum boeking datetime no between
fin.trs.line.dim1 Grootboekrek. string yes between
fin.trs.line.dim1name Grootboekrek.naam string yes
fin.trs.line.dim2 Kpl./rel. string yes between
fin.trs.line.dim2name Kpl.-/rel.naam string yes
fin.trs.line.valuesigned Bedrag value yes
fin.trs.line.basevaluesigned Basisbedrag value yes
fin.trs.line.repvaluesigned Rapportagebedrag value yes
fin.trs.line.openvaluesigned Open amount transaction value value yes between
fin.trs.line.openbasevaluesigned Open amount base value value yes
fin.trs.line.matchstatus Betaalstatus special: notmatchable, available, proposed, matched yes equal
fin.trs.line.matchdate Betaaldatum date yes
fin.trs.line.matchnumber Afletternummer string yes
fin.trs.line.payrun Incassonummer string yes
fin.trs.line.modified Wijzigingsdatum datetime yes between
fin.trs.line.freetext1 Vrij tekstveld 1 string yes
fin.trs.line.freetext2 Vrij tekstveld 2 string yes
fin.trs.line.freetext3 Vrij tekstveld 3 string yes
$twinfield = Example::twinfield();
$year = Example::lastYear($twinfield);
$since = new DateTimeImmutable($argv[1] ?? '-30 days');
$query = $twinfield->browse(BrowseCode::CustomersV2)
->columns(
'fin.trs.line.dim2',
'fin.trs.head.code',
'fin.trs.head.number',
'fin.trs.line.invnumber',
'fin.trs.line.valuesigned',
'fin.trs.line.openvaluesigned',
'fin.trs.line.matchstatus',
'fin.trs.line.matchdate',
'fin.trs.line.modified',
)
->between('fin.trs.head.yearperiod', '2000/00', sprintf('%d/55', $year))
->equal('fin.trs.head.status', 'normal')
->betweenDateTimes('fin.trs.line.modified', $since, new DateTimeImmutable());
$result = $query->get();
echo count($result), ' customer line(s) changed since ', $since->format('Y-m-d H:i'), PHP_EOL;
foreach ($result as $index => $row) {
$paid = $row->nullableDate('fin.trs.line.matchdate');
echo sprintf(
'[%d/%d] %s %s %d invoice %s: %s, open %s, %s%s, changed %s',
$index + 1,
count($result),
$row->string('fin.trs.line.dim2'),
$row->string('fin.trs.head.code'),
$row->int('fin.trs.head.number'),
$row->nullableString('fin.trs.line.invnumber') ?? '-',
$row->amount('fin.trs.line.valuesigned'),
$row->amount('fin.trs.line.openvaluesigned'),
$row->string('fin.trs.line.matchstatus'),
$paid === null ? '' : ' on ' . $paid->format('Y-m-d'),
$row->dateTime('fin.trs.line.modified')->format('Y-m-d H:i'),
), PHP_EOL;
}
Terminal window
php examples/browse-data/130_2-customers-v2/example.php # changed in the last 30 days
php examples/browse-data/130_2-customers-v2/example.php '2026-03-01 00:00' # changed since 1 March 2026

Add TWINFIELD_DEBUG=1 to see the SOAP requests and responses.

2 customer line(s) changed since 2026-03-01 00:00
[1/2] 1000 VRK 202600002 invoice 2026-0002: 242.00, open 0.00, matched on 2026-03-12, changed 2026-03-12 08:30
[2/2] 1001 VRK 202600005 invoice 2026-0005: 60.50, open 30.25, available, changed 2026-03-10 14:15

What the SDK sends to Twinfield and what Twinfield sends back, for a call like the one in this example. The responses come from the tests, with example data.

Twinfield documentation: Browse data: Compose the browse request and send it.

$twinfield->browse(BrowseCode::CustomersV2)
->columns(
'fin.trs.line.dim2',
'fin.trs.head.code',
'fin.trs.head.number',
'fin.trs.line.invnumber',
'fin.trs.line.valuesigned',
'fin.trs.line.openvaluesigned',
'fin.trs.line.matchstatus',
'fin.trs.line.matchdate',
'fin.trs.line.modified',
)
->between('fin.trs.head.yearperiod', '2000/00', '2026/55')
->equal('fin.trs.head.status', 'normal')
->betweenDateTimes(
'fin.trs.line.modified',
new DateTimeImmutable('2026-03-01 00:00 UTC'),
new DateTimeImmutable('2026-03-31 00:00 UTC'),
)
->get();

The SDK sends this XML as xmlRequest of ProcessXmlString to processxml.asmx:

<columns code="130_2" optimize="true">
<column>
<field>fin.trs.line.dim2</field>
<visible>true</visible>
</column>
<column>
<field>fin.trs.head.code</field>
<visible>true</visible>
</column>
<column>
<field>fin.trs.head.number</field>
<visible>true</visible>
</column>
<column>
<field>fin.trs.line.invnumber</field>
<visible>true</visible>
</column>
<column>
<field>fin.trs.line.valuesigned</field>
<visible>true</visible>
</column>
<column>
<field>fin.trs.line.openvaluesigned</field>
<visible>true</visible>
</column>
<column>
<field>fin.trs.line.matchstatus</field>
<visible>true</visible>
</column>
<column>
<field>fin.trs.line.matchdate</field>
<visible>true</visible>
</column>
<column>
<field>fin.trs.line.modified</field>
<visible>true</visible>
<operator>between</operator>
<from>20260301000000</from>
<to>20260331000000</to>
</column>
<column>
<field>fin.trs.head.yearperiod</field>
<operator>between</operator>
<from>2000/00</from>
<to>2026/55</to>
</column>
<column>
<field>fin.trs.head.status</field>
<operator>equal</operator>
<from>normal</from>
</column>
</columns>

Twinfield answers with this XML in ProcessXmlStringResult:

<browse result="1" first="1" last="2" total="2">
<th>
<td label="" hideforuser="false" type="String">fin.trs.line.dim2</td>
<td label="" hideforuser="false" type="String">fin.trs.head.code</td>
<td label="" hideforuser="false" type="Decimal">fin.trs.head.number</td>
<td label="" hideforuser="false" type="String">fin.trs.line.invnumber</td>
<td label="" hideforuser="false" type="Value">fin.trs.line.valuesigned</td>
<td label="" hideforuser="false" type="Value">fin.trs.line.openvaluesigned</td>
<td label="" hideforuser="false" type="String">fin.trs.line.matchstatus</td>
<td label="" hideforuser="false" type="Date">fin.trs.line.matchdate</td>
<td label="" hideforuser="false" type="Datetime">fin.trs.line.modified</td>
</th>
<tr>
<td>1000</td>
<td>VRK</td>
<td>202600002</td>
<td>2026-0002</td>
<td>242.00</td>
<td>0.00</td>
<td name="Afgeletterd">matched</td>
<td name="12/03/2026">20260312</td>
<td name="12/03/2026 08:30:10">20260312083010</td>
<key>
<office>1000</office>
<code>VRK</code>
<number>202600002</number>
<line>1</line>
</key>
</tr>
<tr>
<td>1001</td>
<td>VRK</td>
<td>202600005</td>
<td>2026-0005</td>
<td>60.50</td>
<td>30.25</td>
<td name="Beschikbaar">available</td>
<td/>
<td name="10/03/2026 14:15:00">20260310141500</td>
<key>
<office>1000</office>
<code>VRK</code>
<number>202600005</number>
<line>1</line>
</key>
</tr>
</browse>

View examples/browse-data/130_2-customers-v2/example.php on GitHub.

Made by SolveBeam

Twinfield and Wolters Kluwer are trademarks of Wolters Kluwer. Their names and logos are used only to refer to their products.