License templates stage 2: templates carry the seats a license starts with, a renewal term, a vendor from the vendor templates and the product they are sold as (database 3.2.9); a license made from one starts with its seats, gets a renewal date worked out from the purchase date and uses the client's vendor from that vendor template, or one with the same name, or has one made from the template by someone who can add vendors; New License fills in the seats, vendor and renewal date from the template and keeps the renewal date in step with the purchase date until one is typed in; Renew starts on the template's term; new licenses can be made for several clients at once with an option to skip clients that already have one; the template page and list show the new fields and the list search covers vendor and product; the license quick look shows the product and price to Sales users; deleting a vendor template or product removes it from the templates that used it

This commit is contained in:
johnnyq
2026-10-18 20:23:27 -04:00
parent f74ad10dd8
commit 0c12459eaf
16 changed files with 595 additions and 65 deletions

View File

@@ -6,7 +6,8 @@
* search. Header with renewal and seat state, the facts to copy (key, order
* reference, vendor account and phone), quick notes, then tabs for only what
* has something in it: devices, users, keys, credentials, documents, files.
* A license made from a license template says which.
* A license made from a license template says which - and, for someone who
* sees Sales, the product it is sold as.
*/
require_once '../../../includes/modal_header.php';
@@ -84,6 +85,9 @@ ob_start();
<span><?= escapeHtml($license['client_name']) ?></span>
<?php if ($template) { ?>
<span title="The license template it was made from"><i class="fas fa-fw fa-puzzle-piece me-1"></i>From <?= !empty($session_is_admin) ? '<a class="text-reset" href="/admin/software_template.php?software_template_id=' . intval($template['software_template_id']) . '">' . escapeHtml($template['software_template_name']) . '</a>' : escapeHtml($template['software_template_name']) ?></span>
<?php if (!empty($template['product_name']) && !$template['product_archived_at'] && lookupUserPermission('module_sales') >= 1) { ?>
<span title="The product it is sold as"><i class="fas fa-fw fa-box-open me-1"></i>Sold as <a class="text-reset" href="/agent/product.php?product_id=<?= intval($template['software_template_product_id']) ?>"><?= escapeHtml($template['product_name']) ?></a> · <?= escapeHtml(softwareTemplatePriceText($template)) ?></span>
<?php } ?>
<?php } ?>
</div>
</div>