Skip to content

Credit management (164)

Browse code 164 (BrowseCode::CreditManagement, “Kredietbeheer”): the open invoices of customers with the credit management actions on them, such as a dispute or a reminder, with the date, amount and the credit manager.

Twinfield documentation: Browse data.

  • fin.trs.line.actioncode and actionname: the action, e.g. a dispute code. actiondate, actionvalue, actiondescription, actioncreated and actionuser/actionusername give the details.
  • betweenDates('fin.trs.line.actiondate', $from, $to): the actions in a period. The browse code has no period criterion.
  • between('fin.trs.line.dim2', $customer, $customer): one customer; fin.trs.costcenter can be a criterion as well.

Criteria: customer, cost centre and action date. See browse-definitions/164.xml and the browse data guide.

All fields of the browse definition (browse-definitions/164.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.line.dim2 Debiteur string yes between
fin.trs.line.dim2name Naam string yes
fin.trs.costcenter KPL string yes between
fin.trs.costcentername Kpl.-naam string yes
fin.trs.line.invnumber Factuurnr. string yes
fin.trs.head.date Factuurdatum date yes
fin.trs.line.basevaluesigned Basisbedrag value yes
fin.trs.line.openbasevaluesigned Openstaand bedrag value yes
fin.trs.line.datedue Vervaldatum date yes
fin.trs.line.actioncode Dispuutcode string yes
fin.trs.line.actionname Dispuutnaam string yes
fin.trs.line.actiondate Dispuutdatum date yes between
fin.trs.line.actionvalue Dispuutbedrag value yes
fin.trs.line.actiondescription Dispuutomschrijving string yes
fin.trs.line.actioncreated Aanmaakdatum dispuut date yes
fin.trs.line.actionuser Kredietbeheerder string yes
fin.trs.line.actionusername Naam kredietbeheerder string yes
$twinfield = Example::twinfield();
$customer = $argv[1] ?? null;
$query = $twinfield->browse(BrowseCode::CreditManagement)
->columns(
'fin.trs.line.dim2',
'fin.trs.line.dim2name',
'fin.trs.line.invnumber',
'fin.trs.line.datedue',
'fin.trs.line.openbasevaluesigned',
'fin.trs.line.actioncode',
'fin.trs.line.actionname',
'fin.trs.line.actiondate',
'fin.trs.line.actionvalue',
'fin.trs.line.actionusername',
);
if ($customer !== null) {
$query = $query->between('fin.trs.line.dim2', $customer, $customer);
}
$result = $query->get();
echo count($result), ' credit management action(s)', $customer === null ? '' : ' of customer ' . $customer, PHP_EOL;
foreach ($result as $index => $row) {
$due = $row->nullableDate('fin.trs.line.datedue');
$date = $row->nullableDate('fin.trs.line.actiondate');
echo sprintf(
'[%d/%d] %s %s invoice %s, due %s, open %s: %s %s on %s, %s by %s',
$index + 1,
count($result),
$row->string('fin.trs.line.dim2'),
$row->nullableString('fin.trs.line.dim2name') ?? '',
$row->nullableString('fin.trs.line.invnumber') ?? '-',
$due === null ? '-' : $due->format('Y-m-d'),
$row->amount('fin.trs.line.openbasevaluesigned'),
$row->nullableString('fin.trs.line.actioncode') ?? '-',
$row->nullableString('fin.trs.line.actionname') ?? '',
$date === null ? '-' : $date->format('Y-m-d'),
$row->amount('fin.trs.line.actionvalue'),
$row->nullableString('fin.trs.line.actionusername') ?? '-',
), PHP_EOL;
}
Terminal window
php examples/browse-data/164-credit-management/example.php # all customers
php examples/browse-data/164-credit-management/example.php 1000 # customer 1000

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

2 credit management action(s)
[1/2] 1000 Example customer invoice 2026-0002, due 2026-03-03, open 242.00: D01 Dispuut prijs on 2026-03-10, 242.00 by Example user
[2/2] 1000 Example customer invoice 2026-0008, due 2026-04-15, open 96.80: 303 Elektronisch gefactureerd on 2026-03-16, 96.80 by Example user

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::CreditManagement)
->columns(
'fin.trs.line.dim2',
'fin.trs.line.dim2name',
'fin.trs.line.invnumber',
'fin.trs.line.datedue',
'fin.trs.line.openbasevaluesigned',
'fin.trs.line.actioncode',
'fin.trs.line.actionname',
'fin.trs.line.actiondate',
'fin.trs.line.actionvalue',
'fin.trs.line.actionusername',
)
->between('fin.trs.line.dim2', '1000', '1000')
->get();

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

<columns code="164" optimize="true">
<column>
<field>fin.trs.line.dim2</field>
<visible>true</visible>
<operator>between</operator>
<from>1000</from>
<to>1000</to>
</column>
<column>
<field>fin.trs.line.dim2name</field>
<visible>true</visible>
</column>
<column>
<field>fin.trs.line.invnumber</field>
<visible>true</visible>
</column>
<column>
<field>fin.trs.line.datedue</field>
<visible>true</visible>
</column>
<column>
<field>fin.trs.line.openbasevaluesigned</field>
<visible>true</visible>
</column>
<column>
<field>fin.trs.line.actioncode</field>
<visible>true</visible>
</column>
<column>
<field>fin.trs.line.actionname</field>
<visible>true</visible>
</column>
<column>
<field>fin.trs.line.actiondate</field>
<visible>true</visible>
</column>
<column>
<field>fin.trs.line.actionvalue</field>
<visible>true</visible>
</column>
<column>
<field>fin.trs.line.actionusername</field>
<visible>true</visible>
</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.line.dim2name</td>
<td label="" hideforuser="false" type="String">fin.trs.line.invnumber</td>
<td label="" hideforuser="false" type="Date">fin.trs.line.datedue</td>
<td label="" hideforuser="false" type="Value">fin.trs.line.openbasevaluesigned</td>
<td label="" hideforuser="false" type="String">fin.trs.line.actioncode</td>
<td label="" hideforuser="false" type="String">fin.trs.line.actionname</td>
<td label="" hideforuser="false" type="Date">fin.trs.line.actiondate</td>
<td label="" hideforuser="false" type="Value">fin.trs.line.actionvalue</td>
<td label="" hideforuser="false" type="String">fin.trs.line.actionusername</td>
</th>
<tr>
<td>1000</td>
<td>Example customer</td>
<td>2026-0002</td>
<td name="03/03/2026">20260303</td>
<td>242.00</td>
<td>D01</td>
<td>Dispuut prijs</td>
<td name="10/03/2026">20260310</td>
<td>242.00</td>
<td>Example user</td>
<key>
<office>1000</office>
<code>VRK</code>
<number>202600002</number>
<line>1</line>
</key>
</tr>
<tr>
<td>1000</td>
<td>Example customer</td>
<td>2026-0008</td>
<td name="15/04/2026">20260415</td>
<td>96.80</td>
<td>303</td>
<td>Elektronisch gefactureerd</td>
<td name="16/03/2026">20260316</td>
<td>96.80</td>
<td>Example user</td>
<key>
<office>1000</office>
<code>VRK</code>
<number>202600008</number>
<line>1</line>
</key>
</tr>
</browse>

View examples/browse-data/164-credit-management/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.