Vendor templates stage 2: keep client vendors in step with the template they were made from - saving a template updates the fields its vendors still shared, the template window gets the vendor window's tabs, a template page shows each client vendor as in step or the fields it differs in with Bring in line, Link and Unlink, lists hand-made vendors that look like it to link, and sets who should have it (no one, every client or clients with chosen tags) with coverage and Add to clients for those missing; the list gains Required and Out of step tabs, a client vendor shows its differences with Update from template, a client's Vendors list and overview show vendors missing, Add to clients no longer skips a client whose vendor from the template was archived, and database 3.3.5 adds vendor_template_required, vendor_template_required_tags and a vendor_template_id key on vendors

This commit is contained in:
johnnyq
2026-10-20 11:20:45 -04:00
parent dfc708145d
commit cd03a7765d
15 changed files with 1242 additions and 101 deletions

View File

@@ -166,6 +166,16 @@ function clientOverviewAttention($client_id, $access, $renewals) {
];
}
if (lookupUserPermission('module_client') >= 1) {
// Vendor templates it should have a vendor from - the strip across the top of its Vendors
$items[] = [
'count' => count(vendorTemplatesMissingFor($client_id)),
'label' => 'Vendors missing', 'icon' => 'building', 'tone' => 'warning',
'detail' => 'Ones every client like it should have',
'url' => "/agent/vendors.php?client_id=$client_id",
];
}
if ($access['docs'] && $renewals) {
$expired = count(array_filter($renewals['items'], function ($r) { return $r['days'] < 0; }));
$soon = count($renewals['items']) - $expired;