# Documents Vault & Contracts

_Client Hub (Portal)_

The Documents page is your team's shared file vault; the Client Hub > Contracts tab creates, sends, and tracks contracts with built-in e-signatures (no DocuSign needed).

## Steps
1. Files: Documents (sidebar) — drag-and-drop to upload (stored in your connected file storage provider), organize by folder.
2. Contracts: Client Hub > Contracts > "+ New Contract". Pick the Client from your Contacts (or type a full email to add them as a new contact) — this links the contract to a real contact so it shows in the Client column and knows where to send.
3. Choose "Write a contract" or "Upload a document": Write lets you type terms and use AI Polish to draft/polish; Upload lets you upload a PDF (max 25 MB, up to 50 pages) to place signature fields on.
4. For written contracts: type or paste terms, optionally click "✨ AI Polish" (with empty content it drafts from your fields; with existing content it polishes grammar and structure without changing terms). Always review.
5. CRMown auto-detects placeholder tokens in any contract (text or PDF) — recognized styles are `{Contractor}`, `{{clientName}}`, `<<Client>>`, or `[Insert Amount]`. After you finish writing or uploading, a "Fill Placeholders" form appears pre-populated with common values from the linked contact, your organization name, your user details, and today's date. Edit any pre-filled values or add missing ones, then save. For text/AI-drafted contracts, CRMown substitutes these values into the content before creation. For uploaded PDFs, CRMown places an opaque whiteout box containing each value directly over the detected placeholder token, so the client sees the real text, never the raw token.
6. For uploaded PDFs: after upload, the field editor opens. Drag-and-drop signature, initials, date, text, checkbox, and radio fields anywhere on any page to mark where the client must sign or fill. Save when done.
7. Click "Preview" to see exactly what the client will see, then "Send" from the preview footer (or the row) — CRMown emails the client a secure signing link. Status flips to "sent" ONLY after the email goes out; if it fails the contract stays a draft.
8. The client opens their unique signing link (status → viewed), sees the document in-browser with fields highlighted, fills in signatures (draw or type), text, checkboxes, and radio selections, then clicks "Finish & Sign" (status → signed).
9. Once signed, the system produces a flattened signed PDF with all fields stamped in and appends a Certificate of Completion page (signer name, email, IP address, timestamp, and document hash). All parties can download the final signed document.

## Tips
- Expiry alerts notify you before contracts lapse.
- Documents differ from Client Hub: Documents is internal team storage; Client Hub is the external client-facing portal.
- AI Polish preserves every amount, date, name, and term — it only improves wording and structure. It is CRMown AI, not a vendor tool.
- PDF uploads support signature, initials, date, text, checkbox, and radio fields. Radio fields are stamped as an "X" on the selected option, not a filled dot.
- Each signer gets a unique signing link — anyone with it can view and sign, so tell signers not to forward it. It works from any device or browser the signer chooses to open it on.
- The signed PDF with Certificate of Completion can be downloaded and stored in your Documents Vault or external storage provider.
- Placeholder filling is per-contract — the same placeholder can have different values in different contracts, and values are not carried over between contracts. The fill form pre-populates common placeholders from the linked contact, your organization, your user details, and today's date; you review and adjust before saving or sending.
- For PDF contracts with whiteout placeholders: you can manually nudge, resize, or delete any whiteout box, and add new ones by hand if CRMown missed a placeholder in its auto-detect.

## Example
Closing a 6-figure deal — the AE picks the client from Contacts, then either drafts an MSA and hits AI Polish to clean it up, OR uploads their pre-formatted PDF (their corporate MSA template with signature blocks). If uploading, they use the field editor to place signature fields at the signature lines, date fields at date blanks, and initials fields for the witness. They preview and send. The client gets an email, opens the secure link (status → viewed), draws a signature in the browser (status → signed), and the AE is notified instantly. The system auto-generates a flattened signed PDF with the signature stamped in and appends a Certificate of Completion page (client name, email, IP, timestamp, document hash). The AE downloads the completed document, and an expiry alert fires 30 days before the auto-renew.

## Troubleshooting
- **Contract says "sent" but the client never got an email — OR "Send failed"** — Send only marks a contract "sent" after the email provider accepts it. A failure leaves the contract as a draft (it does not falsely say sent). The usual cause is a missing/invalid client email. Fix: Open the contract, confirm the linked Client has a valid email address, and click Send again. If it still fails, check Settings > Communications email configuration.
- **A contract can't be sent / the Send button is missing** — The contract has no linked client contact, so there is no one to send to. Fix: Edit the contract and pick a Client from Contacts (or add one by email) before sending.
- **Documents showing "No files in this import"** — Files are stored in Google Drive/OneDrive (BYOS) and the storage token may have expired. Or files were uploaded to local storage that doesn't persist on the new server. Fix: Settings > Communications > File Storage. If Google Drive is connected, verify it shows "Connected" with a green badge. The Inbound Sync panel surfaces the actual error if the token is stale — follow its guidance. If token expired, reconnect the storage provider.
- **Files added to my Drive/OneDrive/Dropbox CRMown folder don't appear in the Vault** — Inbound sync runs every 5 minutes (or in seconds via push notifications). A file just dropped may not have been pulled yet. Fix: Settings > Communications > File Storage > Inbound Sync panel. Click "Sync now" to pull changes immediately. If the panel shows a red error, reconnect the storage provider.
- **The client says the PDF won't load** — The document is served via a time-limited presigned URL that can expire, or the browser cached a stale one. The signing link itself works from any device or browser — refreshing the signing page always fetches a fresh document URL. Fix: Have the client refresh the signing page — each load mints a fresh document link. Confirm they are opening the exact signing link from their email (not a retyped or truncated URL). If it still fails, resend the signing link from the contract row's "Resend" button.

## Error messages
- `Upload failed` — File exceeds the 50 MB limit, or storage provider connection expired. Reduce file size or reconnect storage.
