General ledger intercompany (031_2)
Browse code 031_2 (BrowseCode::GeneralLedgerIntercompanyV2, “Grootboek (rekening-courant) (v2)”): the transaction lines of intercompany transactions, like 031, with a reporting structure as extra criterion.
Twinfield documentation: Browse data.
equal('fin.trs.head.reportingstructure', $code): only the accounts of a reporting structure (see Hierarchies). It is a criterion only.fin.trs.line.destination.*: the company and account on the other side of the line.- Only intercompany transactions are returned: a company without them gives no rows.
Criteria: period, status, the three dimensions, regime and reporting structure. See browse-definitions/031_2.xml and the browse data guide.
Fields
Section titled “Fields”All fields of the browse definition (browse-definitions/031_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.relationname |
Relatienaam | string | yes | |
fin.trs.head.inpdate |
Invoerdatum | datetime | yes | |
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.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.dim1group4 |
Groep 4 | string | yes | |
fin.trs.line.dim1group4name |
Groepnaam 4 | string | yes | |
fin.trs.line.dim1group5 |
Groep 5 | string | yes | |
fin.trs.line.dim1group5name |
Groepnaam 5 | string | yes | |
fin.trs.line.destination.officename |
Rek.-cour.administratienaam | string | yes | |
fin.trs.line.destination.dim1 |
Rek.-cour. grootboekrek. | string | yes | |
fin.trs.line.destination.dim1name |
Rek.-cour.grootboeknaam | string | yes | |
fin.trs.line.destination.dim2name |
Rek.-cour. kpl./rel.naam | string | yes | |
fin.trs.line.destination.dim3name |
Rek.-cour.act./proj.naam | string | yes | |
fin.trs.head.regime |
Regime | special: Generic, Commercial, Economic, Fiscal |
yes | equal |
fin.trs.head.reportingstructure |
Rapportagestructuur | string | no | equal |
$twinfield = Example::twinfield();
$year = (int) ($argv[1] ?? Example::lastYear($twinfield));$hierarchy = $argv[2] ?? null;
$query = $twinfield->browse(BrowseCode::GeneralLedgerIntercompanyV2) ->columns( 'fin.trs.head.code', 'fin.trs.head.number', 'fin.trs.head.date', 'fin.trs.line.dim1', 'fin.trs.line.valuesigned', 'fin.trs.line.destination.officename', 'fin.trs.line.destination.dim1', 'fin.trs.line.destination.dim1name', ) ->between('fin.trs.head.yearperiod', sprintf('%d/00', $year), sprintf('%d/55', $year)) ->equal('fin.trs.head.status', 'normal');
if ($hierarchy !== null) { $query = $query->equal('fin.trs.head.reportingstructure', $hierarchy);}
$result = $query->get();
echo count($result), ' intercompany line(s) in ', $year;echo $hierarchy === null ? '' : ' in reporting structure ' . $hierarchy, PHP_EOL;
foreach ($result as $index => $row) { echo rtrim(sprintf( '[%d/%d] %s %d line %d, %s: %s %s, other side %s %s %s', $index + 1, count($result), $row->string('fin.trs.head.code'), $row->int('fin.trs.head.number'), $row->transactionLine?->line, $row->date('fin.trs.head.date')->format('Y-m-d'), $row->string('fin.trs.line.dim1'), $row->amount('fin.trs.line.valuesigned'), $row->nullableString('fin.trs.line.destination.officename') ?? '-', $row->nullableString('fin.trs.line.destination.dim1') ?? '-', $row->nullableString('fin.trs.line.destination.dim1name') ?? '', )), PHP_EOL;}php examples/browse-data/031_2-general-ledger-intercompany-v2/example.php # the last yearphp examples/browse-data/031_2-general-ledger-intercompany-v2/example.php 2026 RS01 # only the accounts of reporting structure RS01Add TWINFIELD_DEBUG=1 to see the SOAP requests and responses.
2 intercompany line(s) in 2026[1/2] MEMO 202600007 line 1, 2026-03-31: 1900 1500.00, other side Example subsidiary 1950 Rekening-courant moeder[2/2] MEMO 202600007 line 2, 2026-03-31: 1900 -250.00, other side Second subsidiary 1950 Rekening-courant moederWhat 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.
Compose the browse request and send it
Section titled “Compose the browse request and send it”Twinfield documentation: Browse data: Compose the browse request and send it.
$twinfield->browse(BrowseCode::GeneralLedgerIntercompanyV2) ->columns( 'fin.trs.head.code', 'fin.trs.head.number', 'fin.trs.head.date', 'fin.trs.line.dim1', 'fin.trs.line.valuesigned', 'fin.trs.line.destination.officename', 'fin.trs.line.destination.dim1', 'fin.trs.line.destination.dim1name', ) ->between('fin.trs.head.yearperiod', '2026/00', '2026/55') ->equal('fin.trs.head.status', 'normal') ->get();The SDK sends this XML as xmlRequest of ProcessXmlString to processxml.asmx:
<columns code="031_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.date</field> <visible>true</visible> </column> <column> <field>fin.trs.line.dim1</field> <visible>true</visible> </column> <column> <field>fin.trs.line.valuesigned</field> <visible>true</visible> </column> <column> <field>fin.trs.line.destination.officename</field> <visible>true</visible> </column> <column> <field>fin.trs.line.destination.dim1</field> <visible>true</visible> </column> <column> <field>fin.trs.line.destination.dim1name</field> <visible>true</visible> </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="2" total="2"> <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="Date">fin.trs.head.date</td> <td label="" hideforuser="false" type="String">fin.trs.line.dim1</td> <td label="" hideforuser="false" type="Value">fin.trs.line.valuesigned</td> <td label="" hideforuser="false" type="String">fin.trs.line.destination.officename</td> <td label="" hideforuser="false" type="String">fin.trs.line.destination.dim1</td> <td label="" hideforuser="false" type="String">fin.trs.line.destination.dim1name</td> </th> <tr> <td>MEMO</td> <td>202600007</td> <td name="31/03/2026">20260331</td> <td>1900</td> <td>1500.00</td> <td>Example subsidiary</td> <td>1950</td> <td>Rekening-courant moeder</td> <key> <office>1000</office> <code>MEMO</code> <number>202600007</number> <line>1</line> </key> </tr> <tr> <td>MEMO</td> <td>202600007</td> <td name="31/03/2026">20260331</td> <td>1900</td> <td>-250.00</td> <td>Second subsidiary</td> <td>1950</td> <td>Rekening-courant moeder</td> <key> <office>1000</office> <code>MEMO</code> <number>202600007</number> <line>2</line> </key> </tr></browse>Source
Section titled “Source”View examples/browse-data/031_2-general-ledger-intercompany-v2/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.