Skip to content

Supplier transactions (200)

Browse code 200 (BrowseCode::SupplierTransactions, “Crediteurenkaart”): the transaction lines of suppliers, with the invoice number, due date, open amount and match status. Here: the open items, the purchase invoices and payments that are not (fully) matched yet. It has the same fields as 100 for customers.

Twinfield documentation: Browse data.

  • fin.trs.line.dim2 is the supplier code, fin.trs.line.dim2name its name.
  • equal('fin.trs.line.matchstatus', 'available'): lines that are not matched yet. Use matched for paid invoices.
  • fin.trs.line.openbasevaluesigned: what is still open in the base currency; negative for an invoice you still have to pay.
  • between('fin.trs.line.dim2', $supplier, $supplier): one supplier.

Criteria: period, day book, number, status, supplier, amount, invoice number, match status, payment date and change date. See browse-definitions/200.xml and the browse data guide. The open invoices are also available with the Finder: purchaseTransactions()->openInvoices().

All fields of the browse definition (browse-definitions/200.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.yearperiod Periode string yes between (proposed $DEFAULT$ … $DEFAULT$)
fin.trs.head.code Dagboek string yes equal
fin.trs.head.shortname Naam string yes
fin.trs.head.number Boekst.nr. decimal yes between
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.dim2 Crediteur string yes between
fin.trs.line.dim2name Naam string yes
fin.trs.head.curcode Valuta string no
fin.trs.line.valuesigned Bedrag value no
fin.trs.line.basevaluesigned Euro value yes between
fin.trs.line.repvaluesigned – value no
fin.trs.line.openbasevaluesigned Openstaand bedrag value yes
fin.trs.line.invnumber Factuurnr. string yes equal
fin.trs.line.datedue Vervaldatum date yes
fin.trs.line.matchstatus Betaalstatus special: notmatchable, available, proposed, matched yes equal
fin.trs.line.matchnumber Betaalnr. string yes
fin.trs.line.matchdate Betaaldatum date yes between
fin.trs.line.openvaluesigned Openstaand bedrag transactievaluta value no
fin.trs.line.availableforpayruns Beschikbaar voor betaalrun special: false, true no
fin.trs.line.modified Wijzigingsdatum datetime yes between
$twinfield = Example::twinfield();
$supplier = $argv[1] ?? null;
$year = Example::lastYear($twinfield);
// Open items: invoices and payments that are not (fully) matched yet.
$query = $twinfield->browse(BrowseCode::SupplierTransactions)
->columns(
'fin.trs.line.dim2',
'fin.trs.line.dim2name',
'fin.trs.head.code',
'fin.trs.head.number',
'fin.trs.line.invnumber',
'fin.trs.head.date',
'fin.trs.line.datedue',
'fin.trs.line.basevaluesigned',
'fin.trs.line.openbasevaluesigned',
)
->between('fin.trs.head.yearperiod', '2000/00', sprintf('%d/55', $year))
->equal('fin.trs.head.status', 'normal')
->equal('fin.trs.line.matchstatus', 'available');
if ($supplier !== null) {
$query = $query->between('fin.trs.line.dim2', $supplier, $supplier);
}
$result = $query->get();
echo count($result), ' open item(s)', $supplier === null ? '' : ' of supplier ' . $supplier, PHP_EOL;
$open = Amount::zero();
foreach ($result as $index => $row) {
$due = $row->nullableDate('fin.trs.line.datedue');
$open = $open->plus($row->amount('fin.trs.line.openbasevaluesigned'));
echo sprintf(
'[%d/%d] %s %s, %s %d invoice %s of %s, due %s: %s, open %s',
$index + 1,
count($result),
$row->string('fin.trs.line.dim2'),
$row->nullableString('fin.trs.line.dim2name') ?? '',
$row->string('fin.trs.head.code'),
$row->int('fin.trs.head.number'),
$row->nullableString('fin.trs.line.invnumber') ?? '-',
$row->date('fin.trs.head.date')->format('Y-m-d'),
$due === null ? '-' : $due->format('Y-m-d'),
$row->amount('fin.trs.line.basevaluesigned'),
$row->amount('fin.trs.line.openbasevaluesigned'),
), PHP_EOL;
}
echo 'Total open: ', $open, PHP_EOL;
Terminal window
php examples/browse-data/200-supplier-transactions/example.php # all suppliers
php examples/browse-data/200-supplier-transactions/example.php 2001 # supplier 2001

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

11 open item(s)
[1/11] 2001 Leverancier A, INK 201600001 invoice 816700871008 of 2016-08-08, due 2016-09-05: -15.00, open -10.00
[2/11] 2001 Leverancier A, INK 201600002 invoice 816700871009 of 2016-08-08, due 2016-09-05: -20.00, open -20.00
[3/11] 2001 Leverancier A, INK 201800001 invoice 123 of 2018-02-01, due 2018-02-24: -6050.00, open -6050.00
[4/11] 2003 Brandstof BV, INK 202000001 invoice 20200124 of 2020-01-24, due 2020-01-24: -10.00, open -10.00
…
Total open: -18906.82

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::SupplierTransactions)
->columns(
'fin.trs.line.dim2',
'fin.trs.line.dim2name',
'fin.trs.head.code',
'fin.trs.head.number',
'fin.trs.line.invnumber',
'fin.trs.head.date',
'fin.trs.line.datedue',
'fin.trs.line.basevaluesigned',
'fin.trs.line.openbasevaluesigned',
)
->between('fin.trs.head.yearperiod', '2000/00', '2026/55')
->equal('fin.trs.head.status', 'normal')
->equal('fin.trs.line.matchstatus', 'available')
->get();

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

<columns code="200" optimize="true">
<column>
<field>fin.trs.line.dim2</field>
<visible>true</visible>
</column>
<column>
<field>fin.trs.line.dim2name</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.head.date</field>
<visible>true</visible>
</column>
<column>
<field>fin.trs.line.datedue</field>
<visible>true</visible>
</column>
<column>
<field>fin.trs.line.basevaluesigned</field>
<visible>true</visible>
</column>
<column>
<field>fin.trs.line.openbasevaluesigned</field>
<visible>true</visible>
</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>
<column>
<field>fin.trs.line.matchstatus</field>
<operator>equal</operator>
<from>available</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.line.dim2name</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="Date">fin.trs.head.date</td>
<td label="" hideforuser="false" type="Date">fin.trs.line.datedue</td>
<td label="" hideforuser="false" type="Value">fin.trs.line.basevaluesigned</td>
<td label="" hideforuser="false" type="Value">fin.trs.line.openbasevaluesigned</td>
</th>
<tr>
<td>2000</td>
<td>Example supplier</td>
<td>INK</td>
<td>202600003</td>
<td>F-8812</td>
<td name="05/02/2026">20260205</td>
<td name="07/03/2026">20260307</td>
<td>-60.50</td>
<td>-60.50</td>
<key>
<office>1000</office>
<code>INK</code>
<number>202600003</number>
<line>1</line>
</key>
</tr>
<tr>
<td>2001</td>
<td>Second supplier</td>
<td>INK</td>
<td>202600006</td>
<td>2026/114</td>
<td name="12/03/2026">20260312</td>
<td name="11/04/2026">20260411</td>
<td>-145.20</td>
<td>-145.20</td>
<key>
<office>1000</office>
<code>INK</code>
<number>202600006</number>
<line>1</line>
</key>
</tr>
</browse>

View examples/browse-data/200-supplier-transactions/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.