List invoice types
Lists the invoice types of the company, with Finder type INV. A sales invoice always has an invoice type: it decides the numbering, whether prices include VAT, and the account for the one-off item 0.
Twinfield documentation: Sales invoices.
salesInvoices()->invoiceTypes() returns a CodeNameSearch: get() gives one page, all() every invoice type. Each item is an InvoiceTypeSummary with code, name and the company.
Pass a pattern to search, e.g. F*.
$twinfield = Example::twinfield();
// Optional search pattern from the command line, e.g. `F*`.$pattern = $argv[1] ?? '*';
foreach ($twinfield->salesInvoices()->invoiceTypes($pattern)->all() as $type) { echo $type->code, ' ', $type->name, PHP_EOL;}php examples/sales-invoices/list-invoice-types/example.phpFACTUUR FactuurUREN Uren factuurWhat 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.
Find invoice types
Section titled “Find invoice types”Twinfield documentation: Sales invoices: Find invoice types.
$twinfield->salesInvoices()->invoiceTypes()->get();The SDK sends this in the SOAP body to finder.asmx, with SOAPAction http://www.twinfield.com/Search; the access token goes in the SOAP header:
<Search xmlns="http://www.twinfield.com/"> <type>INV</type> <pattern>*</pattern> <field>0</field> <firstRow>1</firstRow> <maxRows>100</maxRows></Search>Twinfield answers with this SOAP body:
<SearchResponse xmlns="http://www.twinfield.com/"> <SearchResult/> <data> <TotalRows>2</TotalRows> <Columns> <string>Code</string> <string>Naam</string> </Columns> <Items> <ArrayOfString> <string>FACTUUR</string> <string>Factuur</string> </ArrayOfString> <ArrayOfString> <string>UREN</string> <string>Uren factuur</string> </ArrayOfString> </Items> </data></SearchResponse>Source
Section titled “Source”View examples/sales-invoices/list-invoice-types/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.