Adding a partner and data sheet – system description

The steps of saving a partner: validation, quota, client assignment, persons and signatories, tax authority and integration data, bank accounts; the tile endpoints.

Adding and editing a partner run through one save endpoint; the tiles (address, bank account, person, storage rule) use their own AJAX endpoints. Saving does not redirect and returns the new id.

Data model

Table names carry the installation's own prefix in the database.

TableRole
companypartner
permission_scopecontent right of the creator
subscription_accountthe user's home client
person_companypersons, role, signatory flag
navtax authority technical user and keys
user_api_key, company_authQUiCK API key
foxpostFoxPost account
company_bankaccount, bankaccountbank accounts
company_objstoragestorage rule per object type (local / gdrive / onedrive)

Save steps

  1. Right: canSave(company, id) – for 0 add (without an add row edit decides), for an existing one edit and companyInScope().
  2. Validation: name 1–255; exact de-dup on the 8-digit tax number stem (getCompanyIdByTaxhu8); statistical number empty or 17 digits.
  3. Quota for a new partner: Dlbtquota::checkAction(user, company, add); need_credit/need_plan returns an error with upsell data. addCompany(), content right for the creator (grantCompanyScopeToCreator); with a home client the new company goes to its subscription owner (assignToOwner), otherwise it becomes the home client (attachUserToClient); after a successful save the quota is consumed (consumeAction).
  4. Persons (with masterdata/person edit): add only; roles, then the full signatory set in one step (setCompanySignatories).
  5. With navapi: tax authority row (delete + rewrite, only with a technical user), QUiCK API key (empty = unchanged, removable with a separate flag), FoxPost account.
  6. Bank accounts: saveCompanyBankaccounts, normalised. Database errors come as DB: ….

Form endpoints

  • checkduplicate (edit): exact tax number stem; name: active company of the same name, warning only.
  • autocomplete (list), companygroup (list, scope-filtered), companygroupadd (edit).
  • addresslist / addresssave / addressdelete (list / edit, scope; postcode and country validation).
  • bankidentify (edit): normalisation and bank identification (GIRO / openiban); bankaccounts (list); syncAddresses, syncBankaccounts (edit).
  • persontile (list + person list; editable with person edit); statements (statement documents, max. 50).
  • objstoragelist / objstoragesave / objstoragedelete (edit + scope); the old Drive and local folder routes are thin forwards to the document centre's canonical storage endpoints.

Permissions

Function rights: add (not in the catalogue; header button), edit, navapi; related: masterdata/person edit, mail/notify list, document/document list. taxpayerupdate does not check the scope.