Partner form: NAV fill-in, duplicate check, persons

The NAV-based fill-in of the partner form, the duplicate check, the visibility of client-level fields, saving the partner's persons and the permission keys.

For a new partner the partner master form is filled from the NAV taxpayer query; for an existing partner it manages the links to the person master. Company data is written by the company model, the person–company link by the person model.

Data model

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

TableRoleOwner
companypartner; company_taxhu, company_taxgroup, company_group_id, client-level columnscompany model
company_validationvalidity audit (check_type = nav_taxpayer)company model
navNAV API datacompany model
person_companyperson ↔ company: role, signatory flag, contact_phone_ref, contact_email_ref (0 = default)person model

Saving

  • canSave (add new, edit existing); content scope for existing ones. Name required ("Warning: Partner name is required!"), tax number dedup on the 8-digit core number.
  • Persons (with the person edit right): add link (only adds, never removes), position, the company's whole signatory set in one step, per-partner contacts. The person row arrives from the server as a complete row (with company list, person list and edit).
  • Client-level fields show only with a chosen company group, but are submitted even when hidden.

Permissions

  • Function rights: list, add, edit, delete, status, taxpayer (NAV query, validation, new partner from NAV), navapi (NAV API key block), revalidate, debug; the persons block needs list and edit on the person master.
  • Content scope: saving an existing company, the persons tile and writing NAV validity stay within scope.

Known limitations

  • The NAV credentials come hard-coded from the settings of a single company.
  • The help text of the signatory switch says one signatory per company, but the code allows several.