Tax number check – system description
Endpoints of the tax authority and VIES checks, the validation log, the context-based validation cache, bulk re-validation and the bank account import.
The partner module runs tax authority (queryTaxpayer XML) and VIES checks, logs the result as an audit row and writes it to the partner's validity. Supplementary endpoints take addresses and bank accounts from invoices.
Data model
Table names carry the installation's own prefix in the database.
| Table | Role |
|---|---|
company_validation | validation log (e.g. check_type = nav_taxpayer) |
company, company_address, address | validity, addresses |
invoice_ctrl | invoice control data (source of addresses and bank accounts) |
bankaccount, company_bankaccount | bank accounts |
Endpoints
querytaxpayer: tax authority call with the 8-digit tax number (nav/xmlmodel); credentials come from the tax authority row of the company with fixed id 10; returns name, short name, full tax number, group VAT id, addresses, validity; for an in-scope company it records validity (updateValidity) and writes an audit row.queryvies: VIES check via cURL; error when unavailable.taxpayercompare: field-by-field comparison (name, short name, tax number, registered office) with thetaxpayerupdateURL;taxpayerupdate(edit): rewrites the chosen fields, optionally inserts the registered office.validate: tax number and optional VIES with a context (manual/cron/pre_invoice/pre_contract/pre_bank); outside the manual context an earlier valid validation is used as cache; audit, validity, address sync (syncCompanyAddresses).revalidatestale:info=1→ a stable list of unchecked / invalid partners (findStaleCompanies); POSTids[]→ one batch (revalidateIds,manual); the library narrows to the scope.importinvoicebanks:info=1→ number of rows to process; otherwise batches withstart/limit(default 200) viaimportInvoiceBankaccounts()for in-scope suppliers.syncinvoice:syncFromInvoiceCtrl()adds addresses and links normalised, de-duplicated bank accounts (saveBankaccountForCompany); summary.
Permissions
- Function rights:
taxpayer,revalidate,import_banks,sync_invoice; scope:validate, the validity write andsyncinvoicewithcompanyInScope. - Prerequisite: a tax authority technical user; outbound HTTP for VIES.
Known limitations
- The body of the bulk tax authority refresh (
taxpayerendpoint) is commented out; it always returns success with a "- teszt" suffix. taxpayercompareandtaxpayerupdatedo not check the scope.- The credentials come from a fixed id.