Skip to content

General ledger details (030_2)

Browse code 030_2 (BrowseCode::GeneralLedgerDetailsV2, “Grootboek (details) (v2)”): every transaction line with its details. Compared with 030_1 it has the relation of the transaction and the regime. 030_3 has more fields; use that one for new code.

Twinfield documentation: Browse data.

  • fin.trs.head.relation and fin.trs.head.relationname: the customer or supplier of the transaction, also on the lines that have no relation in dim2.
  • equal('fin.trs.head.regime', $regime): Fiscal, Commercial or Economic give the lines of that regime plus the generic lines; Generic only the generic lines. See Regimes.
  • between('fin.trs.head.yearperiod', $from, $to): the period can only be a criterion.

Criteria: period, status, input date, change date, the three dimensions and regime. See browse-definitions/030_2.xml and the browse data guide.

All fields of the browse definition (browse-definitions/030_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
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.head.curcode Valuta string yes
fin.trs.head.relation Relatie string yes
fin.trs.head.relationname Relatienaam string yes
fin.trs.head.inpdate Invoerdatum datetime yes between
fin.trs.head.modified Wijzigingsdatum datetime no between
fin.trs.head.username Gebruikersnaam string yes
fin.trs.line.dim1 Grootboekrek. string yes between
fin.trs.line.dim1name Grootboekrek.naam string yes
fin.trs.line.dim1type Dimensietype 1 string yes
fin.trs.line.dim2 Kpl./rel. string yes between
fin.trs.line.dim2name Kpl.-/rel.naam string yes
fin.trs.line.dim2type Dimensietype 2 string yes
fin.trs.line.dim3 Act./proj. string yes between
fin.trs.line.dim3name Act.-/proj.naam string yes
fin.trs.line.dim3type Dimensietype 3 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.debitcredit D/C special: credit, debit yes
fin.trs.line.vatcode Btw-code string yes
fin.trs.line.vatbasevaluesigned Btw-bedrag value yes
fin.trs.line.quantity Aantal decimal yes
fin.trs.line.chequenumber Cheque string yes
fin.trs.line.description Omschrijving string yes
fin.trs.line.invnumber Factuurnummer string yes
fin.trs.line.dim1group1 Groep 1 string yes
fin.trs.line.dim1group1name Groepnaam 1 string yes
fin.trs.line.dim1group2 Groep 2 string yes
fin.trs.line.dim1group2name Groepnaam 2 string yes
fin.trs.line.dim1group3 Groep 3 string yes
fin.trs.line.dim1group3name Groepnaam 3 string yes
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
fin.trs.head.origin Boekingsoorsprong special yes
fin.trs.mng.type transactie type groep string yes
fin.trs.head.regime Regime special: Generic, Commercial, Economic, Fiscal yes equal
$twinfield = Example::twinfield();
$year = (int) ($argv[1] ?? Example::lastYear($twinfield));
$regime = isset($argv[2]) ? Regime::from($argv[2]) : null;
$query = $twinfield->browse(BrowseCode::GeneralLedgerDetailsV2)
->columns(
'fin.trs.head.code',
'fin.trs.head.number',
'fin.trs.head.relation',
'fin.trs.head.relationname',
'fin.trs.line.dim1',
'fin.trs.line.dim2',
'fin.trs.line.valuesigned',
'fin.trs.head.regime',
)
->between('fin.trs.head.yearperiod', sprintf('%d/00', $year), sprintf('%d/55', $year))
->equal('fin.trs.head.status', 'normal');
if ($regime !== null) {
$query = $query->equal('fin.trs.head.regime', $regime);
}
$result = $query->get();
echo count($result), ' transaction line(s) in ', $year, $regime === null ? '' : ', regime ' . $regime->value, PHP_EOL;
foreach ($result as $index => $row) {
$relation = $row->nullableString('fin.trs.head.relation');
echo sprintf(
'[%d/%d] %s %d line %d (%s), relation %s: %s %s %s',
$index + 1,
count($result),
$row->string('fin.trs.head.code'),
$row->int('fin.trs.head.number'),
$row->transactionLine?->line,
$row->string('fin.trs.head.regime'),
$relation === null ? '-' : $relation . ' ' . ($row->nullableString('fin.trs.head.relationname') ?? ''),
$row->string('fin.trs.line.dim1'),
$row->nullableString('fin.trs.line.dim2') ?? '-',
$row->amount('fin.trs.line.valuesigned'),
), PHP_EOL;
}
Terminal window
php examples/browse-data/030_2-general-ledger-details-v2/example.php # the last year, all regimes
php examples/browse-data/030_2-general-ledger-details-v2/example.php 2026 Fiscal # the fiscal and generic lines of 2026

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

3 transaction line(s) in 2026
[1/3] VRK 202600001 line 1 (Generic), relation 1000 Example customer: 1300 1000 121.00
[2/3] VRK 202600001 line 2 (Generic), relation 1000 Example customer: 8000 - -100.00
[3/3] MEMO 202600004 line 1 (Fiscal), relation -: 4800 - 250.00

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::GeneralLedgerDetailsV2)
->columns(
'fin.trs.head.code',
'fin.trs.head.number',
'fin.trs.head.relation',
'fin.trs.head.relationname',
'fin.trs.line.dim1',
'fin.trs.line.dim2',
'fin.trs.line.valuesigned',
'fin.trs.head.regime',
)
->between('fin.trs.head.yearperiod', '2026/00', '2026/55')
->equal('fin.trs.head.status', 'normal')
->equal('fin.trs.head.regime', Regime::Fiscal)
->get();

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

<columns code="030_2" optimize="true">
<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.head.relation</field>
<visible>true</visible>
</column>
<column>
<field>fin.trs.head.relationname</field>
<visible>true</visible>
</column>
<column>
<field>fin.trs.line.dim1</field>
<visible>true</visible>
</column>
<column>
<field>fin.trs.line.dim2</field>
<visible>true</visible>
</column>
<column>
<field>fin.trs.line.valuesigned</field>
<visible>true</visible>
</column>
<column>
<field>fin.trs.head.regime</field>
<visible>true</visible>
<operator>equal</operator>
<from>Fiscal</from>
</column>
<column>
<field>fin.trs.head.yearperiod</field>
<operator>between</operator>
<from>2026/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="3" total="3">
<th>
<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.head.relation</td>
<td label="" hideforuser="false" type="String">fin.trs.head.relationname</td>
<td label="" hideforuser="false" type="String">fin.trs.line.dim1</td>
<td label="" hideforuser="false" type="String">fin.trs.line.dim2</td>
<td label="" hideforuser="false" type="Value">fin.trs.line.valuesigned</td>
<td label="" hideforuser="false" type="String">fin.trs.head.regime</td>
</th>
<tr>
<td>VRK</td>
<td>202600001</td>
<td>1000</td>
<td>Example customer</td>
<td>1300</td>
<td>1000</td>
<td>121.00</td>
<td name="Generiek">Generic</td>
<key>
<office>1000</office>
<code>VRK</code>
<number>202600001</number>
<line>1</line>
</key>
</tr>
<tr>
<td>VRK</td>
<td>202600001</td>
<td>1000</td>
<td>Example customer</td>
<td>8000</td>
<td/>
<td>-100.00</td>
<td name="Generiek">Generic</td>
<key>
<office>1000</office>
<code>VRK</code>
<number>202600001</number>
<line>2</line>
</key>
</tr>
<tr>
<td>MEMO</td>
<td>202600004</td>
<td/>
<td/>
<td>4800</td>
<td/>
<td>250.00</td>
<td name="Fiscaal">Fiscal</td>
<key>
<office>1000</office>
<code>MEMO</code>
<number>202600004</number>
<line>1</line>
</key>
</tr>
</browse>

View examples/browse-data/030_2-general-ledger-details-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.