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.
| Table | Role | Owner |
|---|---|---|
company | partner; company_taxhu, company_taxgroup, company_group_id, client-level columns | company model |
company_validation | validity audit (check_type = nav_taxpayer) | company model |
nav | NAV API data | company model |
person_company | person ↔ company: role, signatory flag, contact_phone_ref, contact_email_ref (0 = default) | person model |
Saving
canSave(addnew,editexisting); 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
editright): 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 companylist, personlistandedit). - 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 needslistandediton 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.