Nothing to see here

Go Back"; } else { $client_id = intval($contract['contract_client_id']); enforceClientAccess(); $can_edit = lookupUserPermission('module_sales') >= 2; $can_delete = lookupUserPermission('module_sales') >= 3; $name = escapeHtml($contract['contract_name']); $page_title = $contract['contract_name']; $state = contractState($contract); $type = CONTRACT_TYPES[$contract['contract_type']] ?? CONTRACT_TYPES['other']; $notice = contractNoticeDate($contract); $today = date('Y-m-d'); $status = (string) $contract['contract_status']; $slas = contractSlaChoices(array_map(function ($part) use ($contract) { return intval($contract["contract_sla_{$part}_id"]); }, CONTRACT_SLA_PRIORITIES)); $history = auditLogHistory('Contract', $contract_id); // Signing - the rounds, newest first, the latest's state, and the copy signed by both $signing = contractSignaturesReady(); $rounds = $signing ? contractSignatureRounds($contract_id) : []; $latest = $rounds[0] ?? null; $latest_state = contractSignatureState($latest); $signed_round = contractSignatureSigned($rounds); $outdated = $signed_round && (!$latest_state || in_array($latest_state['key'], ['signed', 'withdrawn'], true)) && contractSignatureOutdated($contract, $signed_round); $can_send = $signing && $can_edit && !in_array($status, ['Ended', 'Cancelled'], true); $currency = $session_company_currency ?? ''; $money = function ($amount) use ($currency) { return escapeHtml(function_exists('billingMoney') ? billingMoney($amount, $currency) : number_format((float) $amount, 2)); }; // How far through its term it is $progress = null; if ($contract['contract_start_date'] && $contract['contract_end_date'] && in_array($state['key'], ['active', 'renewing', 'ending'], true)) { // The current term began a term's length before it ends - or when the contract started, while it is in its first // term (a first term a few days longer or shorter than the rest is still the first) $months = intval($contract['contract_term_months']); $started = strtotime($contract['contract_start_date']); $term_start = strtotime("-$months months +1 day", strtotime($contract['contract_end_date'])); if ($term_start < strtotime("+$months months", $started)) { $term_start = $started; } $term_end = strtotime($contract['contract_end_date']); $progress = [ 'percent' => $term_end > $term_start ? max(0, min(100, round((time() - $term_start) / ($term_end - $term_start) * 100))) : 100, 'days_left' => max(0, intval(floor(($term_end - strtotime($today)) / 86400))), 'from' => date('M j, Y', $term_start), ]; } ?>

From
It renews itself on for another . = $today ? 'Notice to stop it is due by ' . escapeHtml(date('M j, Y', strtotime($notice))) . ' - a good time to review it with the client.' : 'The notice date has passed.' ?> It ends on and doesn't renew itself. = $today ? 'Notice is due by ' . escapeHtml(date('M j, Y', strtotime($notice))) . '.' : '' ?> Renew it to keep it going.

Signing

Not sent to the client to sign yet. They sign from a link in an email, or in the client portal; you countersign after.

The contract has changed since it was signed. Send it to sign again for the new version.
1) { ?>
Earlier requests ()

Term

Starts
Not set' ?>
Ends
No end date' ?>
Term
Renews
Notice
By
Renewed
Cancelled

People

Client
Contact
' . escapeHtml($contract['contact_name']) . '' : 'None' ?>
Owner
No one - everyone is reminded' ?>
Added
$client_id]) ?>

What it covers

Support hours
Not set' ?>
Rates
' . $money($contract['client_rate']) . '/hr (client\'s)' ?>
Net terms
(client\'s)' : ''; ?>
SLA by priority
$part) { $sla = $slas[intval($contract["contract_sla_{$part}_id"])] ?? null; ?>
Archived' : '' ?>
The client's usual SLA

Terms

No terms written down. Add them

Notes