Time & Expenses billing per period (662_1)
Browse code 662_1 (BrowseCode::TimeAndExpensesBillingPerPeriod, “Uren en onkosten (Facturatie per periode)”): the external value of the Time & Expenses entries and the amount proposed for billing, summed per period. Compare both to see what is not billed yet.
Twinfield documentation: Browse data.
teq.trs.head.yearandteq.trs.head.periodas columns give one row per period; addcustomerorproject1to split them further.teq.trs.line.valueextis the external value,ivb.trs.line.valuethe amount in invoice proposals.betweenDates('teq.trs.head.date', $from, $to): the date is a criterion only.- Time & Expenses is a separate module of Twinfield: a company without it gives no rows.
Criteria: year/period, date, user, cost centre of the user, hour code, authoriser, customer, project, cost centre of the project and activity. See browse-definitions/662_1.xml and the browse data guide.
Fields
Section titled “Fields”All fields of the browse definition (browse-definitions/662_1.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 | |
teq.trs.head.year |
Jaar | long | yes | |
teq.trs.head.period |
Periode | long | yes | |
teq.trs.head.yearperiod |
Jaar/periode (JJJJ/PP) | string | no | between |
teq.trs.head.date |
Datum | date | no | between |
teq.trs.head.user |
Gebruiker | string | yes | between |
teq.trs.head.username |
Gebruikersnaam | string | yes | |
teq.trs.head.usercostcentre |
Kostenplaatsgebruiker | string | yes | between |
teq.trs.head.usercostcentrename |
Naam kostenplaatsgebruiker | string | yes | |
teq.trs.head.code |
Urencode | string | yes | between |
teq.trs.head.authoriser |
Autorisator | string | yes | between |
teq.trs.head.authorisername |
Naam autorisator | string | yes | |
teq.trs.head.customer |
Klant | string | yes | between |
teq.trs.head.customername |
Klantnaam | string | yes | |
teq.trs.head.project1 |
Project | string | yes | between |
teq.trs.head.project1name |
Projectnaam | string | yes | |
teq.trs.head.project1costcentre |
Projectkostenplaats | string | yes | between |
teq.trs.head.project1costcentrename |
Project kostenplaatsnaam | string | yes | |
teq.trs.head.project2 |
Activiteit | string | yes | between |
teq.trs.head.project2name |
Activiteitsnaam | string | yes | |
teq.trs.head.curcode |
Valuta | string | yes | |
teq.trs.line.quantity |
Aantallen | decimal | yes | |
teq.trs.line.valueint |
Bedrag intern | value | yes | |
teq.trs.line.valueext |
Bedrag extern | value | yes | |
ivb.trs.line.quantity |
Aantallen voorgesteld | decimal | yes | |
ivb.trs.line.value |
Bedrag voorgesteld | value | yes |
$twinfield = Example::twinfield();
$year = (int) ($argv[1] ?? Example::lastYear($twinfield));$from = new DateTimeImmutable($year . '-01-01');$to = new DateTimeImmutable($year . '-12-31');
$query = $twinfield->browse(BrowseCode::TimeAndExpensesBillingPerPeriod) ->columns( 'teq.trs.head.year', 'teq.trs.head.period', 'teq.trs.head.customer', 'teq.trs.head.project1', 'teq.trs.line.quantity', 'teq.trs.line.valueext', 'ivb.trs.line.value', ) ->betweenDates('teq.trs.head.date', $from, $to);
$result = $query->get();
echo count($result), ' row(s) from ', $from->format('Y-m-d'), ' to ', $to->format('Y-m-d'), PHP_EOL;
foreach ($result as $index => $row) { echo sprintf( '[%d/%d] %d period %d, customer %s, project %s: quantity %s, value %s, proposed %s', $index + 1, count($result), $row->int('teq.trs.head.year'), $row->int('teq.trs.head.period'), $row->nullableString('teq.trs.head.customer') ?? '-', $row->string('teq.trs.head.project1'), $row->nullableDecimal('teq.trs.line.quantity') ?? '0', $row->amount('teq.trs.line.valueext'), $row->amount('ivb.trs.line.value'), ), PHP_EOL;}php examples/browse-data/662_1-time-and-expenses-billing-per-period/example.php # the last yearAdd TWINFIELD_DEBUG=1 to see the SOAP requests and responses.
2 row(s) from 2026-01-01 to 2026-12-31[1/2] 2026 period 2, customer 1000, project P0001: quantity 120, value 11400.00, proposed 11400.00[2/2] 2026 period 3, customer 1000, project P0001: quantity 96.5, value 9167.50, proposed 4560.00What 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::TimeAndExpensesBillingPerPeriod) ->columns( 'teq.trs.head.year', 'teq.trs.head.period', 'teq.trs.head.customer', 'teq.trs.head.project1', 'teq.trs.line.quantity', 'teq.trs.line.valueext', 'ivb.trs.line.value', ) ->betweenDates('teq.trs.head.date', new DateTimeImmutable('2026-01-01'), new DateTimeImmutable('2026-03-31')) ->get();The SDK sends this XML as xmlRequest of ProcessXmlString to processxml.asmx:
<columns code="662_1" optimize="true"> <column> <field>teq.trs.head.year</field> <visible>true</visible> </column> <column> <field>teq.trs.head.period</field> <visible>true</visible> </column> <column> <field>teq.trs.head.customer</field> <visible>true</visible> </column> <column> <field>teq.trs.head.project1</field> <visible>true</visible> </column> <column> <field>teq.trs.line.quantity</field> <visible>true</visible> </column> <column> <field>teq.trs.line.valueext</field> <visible>true</visible> </column> <column> <field>ivb.trs.line.value</field> <visible>true</visible> </column> <column> <field>teq.trs.head.date</field> <operator>between</operator> <from>20260101</from> <to>20260331</to> </column></columns>Twinfield answers with this XML in ProcessXmlStringResult:
<browse result="1" first="1" last="2" total="2"> <th> <td label="" hideforuser="false" type="Number">teq.trs.head.year</td> <td label="" hideforuser="false" type="Number">teq.trs.head.period</td> <td label="" hideforuser="false" type="String">teq.trs.head.customer</td> <td label="" hideforuser="false" type="String">teq.trs.head.project1</td> <td label="" hideforuser="false" type="Decimal">teq.trs.line.quantity</td> <td label="" hideforuser="false" type="Value">teq.trs.line.valueext</td> <td label="" hideforuser="false" type="Value">ivb.trs.line.value</td> </th> <tr> <td>2026</td> <td>2</td> <td>1000</td> <td>P0001</td> <td>120</td> <td>11400.00</td> <td>11400.00</td> <key> <office>1000</office> </key> </tr> <tr> <td>2026</td> <td>3</td> <td>1000</td> <td>P0001</td> <td>96.5</td> <td>9167.50</td> <td>4560.00</td> <key> <office>1000</office> </key> </tr></browse>Source
Section titled “Source”View examples/browse-data/662_1-time-and-expenses-billing-per-period/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.