Table of Contents
- Introduction, Architecture & the Revenue Pipeline
- Login, Roles & Common Page Operations
- User Management (UM) Locked
- Master Data — Lookups & Picklists
- Account — Companies & Hierarchy Core
- Contact — People & Channels
- Lead — Capture, Score & Convert Core
- Opportunity — Pipeline & Forecast Core
- Activity — Tasks, Calls, Meetings & Calendar
- Campaign — Marketing & ROI
- Product Catalog — Products & Pricebooks
- Quote — Proposals & Approval Core
- Order — Sales Orders & Fulfillment
- Billing — Invoices, Payments & Aging Core
- Workflow — Approval Engine Bridge
- Reports & Dashboards
- Status Reference & Troubleshooting
- Glossary
Introduction, Architecture & the Revenue Pipeline
FolksCRM is the Sales & CRM member of the Folks product family. It runs on a single Microsoft SQL Server engine and is organised into fourteen modules that take a prospect from the very first marketing touch all the way to a settled invoice. Everything is built on the same SQL-first discipline used across FolksHR and FolksPMS — no ORM, no LINQ in business logic, and every operation routed through a named stored procedure.
All workflow, calculation, aggregation and approval logic lives in stored procedures. The API coordinates; the UI presents.
SP_ = single-table CRUD (5 per table). DevSP_ = multi-table workflows, dashboards, conversions, approvals.
.NET 9 Blazor Web App, server-interactive render. Kanban, forecasts and dashboards update live over SignalR.
Roles → menus → page actions, plus per-user overrides. Every state-changing DevSP writes an activity-log row.
1.1 The fourteen modules
| # | Module | Purpose | Key entities |
|---|---|---|---|
| 1 | UM Locked | Identity, roles, employees, menus, privileges, audit, inbox. | Users, Roles, Employees, MainMenu, SubMenu, UserRolePrivileges, ActivityLog |
| 2 | MasterData | Shared lookups used everywhere. | Countries, Currencies, Industries, LeadSources, OpportunityStages, TaxCodes, UnitsOfMeasure |
| 3 | Account | B2B companies, addresses, hierarchy, team. | Accounts, AccountAddresses, AccountTeam, AccountTags, Tags |
| 4 | Contact | People, multi-account links, channels. | Contacts, ContactAccounts, ContactCommunicationPreferences, ContactEmails/Phones |
| 5 | Lead | Top of funnel — capture, score, convert. | Leads, LeadScoringRules, LeadScoreHistory, LeadAssignmentRules, LeadNotes |
| 6 | Opportunity | Deal pipeline, stages, forecast. | Opportunities, OpportunityProducts, OpportunityCompetitors, OpportunityStageHistory |
| 7 | Activity | Tasks, calls, meetings, notes, calendar. | Activities, ActivityParticipants, ActivityReminders, ActivityAttachments |
| 8 | Quote | Proposals with approval & revisions. | Quotes, QuoteLines, QuoteRevisions, QuoteApprovals |
| 9 | Order | Sales orders & fulfillment. | Orders, OrderLines, OrderShipments, OrderShipmentLines |
| 10 | Campaign | Marketing campaigns & ROI. | Campaigns, CampaignTargetLists, EmailTemplates, CampaignExecutions, CampaignResponses |
| 11 | ProductCatalog | Products, pricebooks, inventory. | Products, ProductCategories, Pricebooks, PricebookItems, DiscountRules |
| 12 | Billing | Invoices, payments, aging. | Invoices, InvoiceLines, Payments, Receipts, AgingBuckets |
| 13 | Workflow | Generic approval & notification engine. | WorkflowDefinitions, WorkflowInstances, WorkflowSteps, WorkflowEscalations |
| 14 | Reports | Cross-module analytics, read-only. | ReportDefinitions, ReportSchedules, ReportRuns |
1.2 The revenue pipeline at a glance
Records carry forward. A campaign earns a lead; a qualified lead converts to an account + contact + opportunity; a won opportunity becomes a quote, then an order, then an invoice that ages in receivables.
1.3 The technology stack
FolksCRM_Dev_V1.CF.MasGen.FolksCRM.<Module>.*Login, Roles & Common Page Operations
Every session starts at the login screen. Once authenticated, the left navigation is built from your role's privileges — you only ever see the menus and buttons you are allowed to use.
2.1 Signing in
- Enter your username and password; click Sign in.
- The login DevSP validates credentials and returns your user record, roles and a token seed.
- The token is stored in
localStorageand attached asAuthorization: Bearer <token>on every subsequent call. - You land on the home dashboard mapped to your role's default path.
2.2 The standard page anatomy
Almost every list screen in FolksCRM shares the same toolbar and grid so the muscle memory transfers from module to module.
- Search & filter strip — server-side; sends your criteria to the list DevSP.
- Add — opens a modal or right-side drawer form (hidden if you lack the Add privilege).
- Data grid — server-paged, sortable columns, status badges, row actions.
- Export — pushes the current filtered set to CSV/PDF.
- Refresh — re-runs the list DevSP without losing your filters.
2.3 Roles you'll meet
| Role | Sees | Typical actions |
|---|---|---|
| SuperAdmin | Everything | Setup, security, master data, all transactions |
| Sales Rep | Own leads, opps, accounts, quotes, activities | Work the pipeline, build quotes, log activities |
| Sales Manager | Team pipeline & forecast | Reassign, approve quotes, read leaderboard |
| Marketer | Campaigns, leads, templates | Build lists, send, track ROI |
| Finance | Orders, invoices, payments | Issue, collect, age, dun |
User Management (UM)
LockedUM is the foundation module — it owns identity, role-based access, the employee directory, the menu/privilege engine, the audit log and the workflow inbox. It is ported verbatim from FolksHR and is functionally frozen; only its Blazor markup may be restyled. Every other module wires its SecurityService here.
3.1 What it manages
Directory with profile image; a user account links to an employee and one or more roles.
Hierarchical departments; designations map to default roles.
Per-role, per-sub-menu flags: View / Add / Edit / Delete / Approve, plus per-user overrides.
Activity log of who/what/when; a workflow listener feeds each user's approval inbox.
3.2 Key pages
| Page | Route | Use |
|---|---|---|
| Employee List / Registration | /um/employees | Onboard staff, set department, designation, image |
| Department / Designation Master | /um/departments | Build the org structure |
| Role Management | /um/roles | Create roles & default privileges |
| Menu Management | /um/menus | Configure main/sub menus & page routes |
| Page Privilege Assignment | /um/privileges | Grant View/Add/Edit/Delete/Approve per role |
| Activity Log | /um/audit | Filterable audit trail |
| Notification Inbox | /inbox | Pending approvals across all modules |
Master Data — Lookups & Picklists
Master Data is the single home for cross-cutting lookup tables, so the same currency, industry or stage list is reused everywhere instead of being duplicated per module. It is owned by administrators and loaded once at app start.
4.1 The lookups
| Lookup | Notes / extra fields |
|---|---|
| Countries → States → Cities | Cascading; used by every address picker |
| Currencies | Code, symbol; tags amounts across quotes/orders/invoices |
| Industries | Classifies accounts & segments target lists |
| Lead Sources / Lead Statuses | Drive lead attribution and the Kanban columns |
| Opportunity Stages | Probability %, SortOrder, type — the pipeline backbone |
| Payment Terms | Net 30 / 60 etc.; sets invoice due dates |
| Tax Codes | Rate & type; applied on quote/order/invoice lines |
| Units of Measure | Bound to products (UnitsOfMeasureID / UoMName) |
| Document Types · Salutations · Titles | Smaller reference lists |
4.2 The Master Data Console
| Stage | Probability | Order | Status | |
|---|---|---|---|---|
| Prospecting | 10% | 1 | Active | Edit |
| Qualification | 25% | 2 | Active | Edit |
| Proposal | 50% | 3 | Active | Edit |
| Negotiation | 75% | 4 | Active | Edit |
| Closed Won | 100% | 5 | Won | Edit |
Account — Companies & Hierarchy
CoreAn Account is a B2B company or organisation — the anchor for the sales hierarchy, addresses, the account team and the full 360° history. Every opportunity, quote, order and invoice ultimately rolls up to an account.
5.1 Account form — key fields
5.2 The 360° detail page
Open any account to a tabbed drawer that aggregates everything in one place via DevSP_Account_GetById_Full and DevSP_Account_GetTimeline.
- Profile — firmographics, owner, parent.
- Addresses — billing/shipping/other.
- Team — add/remove members with a role on the account.
- Timeline — merged activities, opportunities, quotes/orders and invoices, newest first.
5.3 Common actions
| Action | What happens |
|---|---|
| Create (composite) | Account + initial address + team in one transaction |
| Reassign owner | Owner change + activity log + workflow listener for the new owner |
| Link to parent | Builds the hierarchy tree (recursive CTE) |
| Merge | Folds a duplicate into the target, repointing all child FKs |
| Bulk import | Driven from a staging table populated by CSV |
Contact — People & Channels
A Contact is a person. Unlike accounts, a contact can be linked to several accounts at once (many-to-many) with one marked primary — perfect for consultants, partners and group buyers. Contacts also hold communication preferences for compliant outreach.
6.1 Linking & preferences
Attach a contact to one or more accounts; flag one primary and set a role (e.g. Decision Maker).
Per-channel opt-in/opt-out (email, SMS, WhatsApp, call) with a reason — respected by Campaign sends.
6.2 Contact 360°
| Name | Title | Primary Account | Status | |
|---|---|---|---|---|
| Aisha Rahman | CTO | Northwind Ltd | aisha@northwind.com | Active |
| Liam Chen | Procurement Head | Contoso PLC | liam@contoso.com | Active |
| Sara Okoye | Consultant | 3 accounts | sara@advisory.io | B2C |
Lead — Capture, Score & Convert
CoreA Lead is an unqualified prospect. Leads can be captured by hand, through a web-to-lead form, or imported in bulk. They are scored, assigned, qualified — and finally converted in a single click into an Account, a Contact and an Opportunity.
7.1 The lead lifecycle
7.2 Grid & Kanban
Toggle the list between a classic grid and a Kanban grouped by lead status. KPI tiles across the top come from DevSP_Lead_DashboardCounts.
7.3 Conversion — what it builds
The convert wizard runs one atomic DevSP_Lead_Convert:
- Insert (or reuse) an Account from the lead's company.
- Insert (or reuse) a Contact from the lead's person.
- Optionally create an Opportunity (you can set name & amount in the wizard).
- Stamp the lead's
converted_to_*ids and timestamp. - Write an activity-log row and emit a workflow listener for the new owner.
Opportunity — Pipeline & Forecast
CoreThe Opportunity is the active deal — the heart of the funnel. It carries an amount, a stage, an expected close date, products, competitors and a team, and feeds the pipeline forecast.
8.1 The stage Kanban
| Prospecting | Qualification | Proposal | Negotiation | Closed Won |
|---|---|---|---|---|
| Acme — $24k 10% |
Northwind — $80k 25% |
Contoso — $150k 50% |
Globex — $60k 75% |
Initech — $45k Won |
Drag a card to a new column and DevSP_Opportunity_ChangeStage updates the stage, writes a stage history row (with duration-in-stage) and emits a workflow listener if the stage is gated.
8.2 Deal detail tabs
Add from the catalog; qty × unit price − discount auto-computes the line total.
Track rival vendors with strengths/weaknesses per deal.
Assign roles — lead, support, technical.
Stage changes + activities + quotes/orders in one stream.
8.3 Forecast & close
The forecast dashboard groups pipeline by stage × month × owner, weighting each deal by its stage probability. Mark a deal Won or Lost with a reason; a won deal can be converted to a Quote in one click (Chapter 12). A weekly snapshot DevSP preserves the pipeline for trend analysis.
Activity — Tasks, Calls, Meetings & Calendar
Activities are the day-to-day work that moves deals. An activity is polymorphic — it can be linked to a Lead, Account, Contact, Opportunity, Quote or Order — so wherever you are, you can log what happened and schedule what's next.
9.1 Activity types & views
| Type | Use |
|---|---|
| Task | To-do with a due date & priority |
| Call | Phone log with outcome |
| Meeting | Scheduled, shows on the calendar |
| Note | Free-text record |
- My Activities — grouped Today / This week / Overdue.
- Team Activities — manager view across reports.
- Calendar — month/week/day for meetings & calls.
DevSP_Activity_AutoCreateFollowUp — nothing falls through the cracks.Campaign — Marketing & ROI
Campaigns drive demand and tie back to lead attribution. Build a target list by criteria, author an email template, schedule an execution, then track opens, clicks, replies and bounces — and compute ROI against budget.
10.1 Campaign flow
10.2 Tracking & attribution
| Metric | Source |
|---|---|
| Sent / Failed | CampaignExecutions counters |
| Open / Click / Reply / Bounce / Unsubscribe | CampaignResponses events |
| Lead attribution | campaign_id stamped on the Lead |
| ROI | actual_revenue ÷ actual_cost |
Product Catalog — Products & Pricebooks
The catalog feeds every line item on opportunities, quotes and orders. It holds products, a category tree, pricebooks (default + customer-specific), discount rules and on-hand inventory per warehouse.
11.1 Pricing resolution
When a line needs a price, DevSP_Product_GetPriceForContext resolves it from the right pricebook for the customer, quantity and date, then applies the best applicable discount rule:
↓
Applicable Pricebook price
− best matching Discount Rule
= Net unit price
11.2 Inventory
| Event | Inventory effect |
|---|---|
| Order line confirmed | − qty committed |
| Order cancelled | + qty released |
| Stock received | + qty on hand |
Quote — Proposals & Approval
CoreA Quote is the formal price offering between Opportunity and Order. It supports a line builder, header & line discounts, a multi-level approval chain, revisions that preserve history, PDF generation and customer accept/reject.
12.1 Quote statuses
12.2 The line builder
| Product | Qty | Unit | Disc% | Tax | Line total |
|---|---|---|---|---|---|
| FolksCRM Pro (annual) | 25 | $240 | 10% | 5% | $5,670 |
| Onboarding package | 1 | $3,000 | 0% | 5% | $3,150 |
12.3 Approval & conversion
- Submit for approval emits a workflow listener to the approver(s).
- Approver approves/rejects with comments; on approve the status advances.
- Generate the PDF payload and send to the contact.
- Record the customer's accept/reject.
- Convert to Order in one click — lines carry over (Chapter 13).
Order — Sales Orders & Fulfillment
An Order is a committed deal that drives fulfillment and invoicing. Create it from an accepted quote in one click, or manually. Confirm to lock editing, then ship in full or in parts and watch per-line shipped-vs-ordered update live.
13.1 Order statuses
| Status | Meaning |
|---|---|
| Draft | Editable, not yet committed |
| Confirmed | Locked; fulfillment can begin |
| Partially Shipped | Some lines shipped |
| Shipped | All lines shipped |
| Closed | Fulfilled & invoiced |
| Cancelled | With a captured reason |
13.2 Creating a shipment
The composite shipment DevSP inserts the shipment + its lines, increments each OrderLine.qty_shipped, and recomputes the order status — all in one transaction.
Billing — Invoices, Payments & Aging
CoreBilling is money-in. Create an invoice from an order (or manually), issue it, record full or partial payments, generate receipts, and watch receivables age across buckets — with a dunning list for overdue accounts.
14.1 Invoice statuses & payment
Recording a payment runs DevSP_Invoice_RecordPayment_Composite: it writes the payment, generates a receipt, then recomputes the invoice status and balance.
14.2 Receivables aging
A scheduled aging-snapshot DevSP refreshes the buckets; the dunning-candidates DevSP produces the list of overdue invoices to chase, which the FE renders as an email queue.
Workflow — Approval Engine
BridgeWorkflow is the generic approval/notification engine. Other modules just emit a "listener" row; this module owns the inbox, the router, the SLA escalation and the notification dispatch.
15.1 How a request flows
- A module calls
DevSP_Workflow_Trigger(Module, EntityType, EntityID, Event, Payload)after its primary write. - The engine picks the matching definition and writes the first step for the right approver.
- The approver sees it in their inbox and approves/rejects with comments.
- On approve → advance to the next level or mark the instance Complete; on reject → notify the originator.
- If a step is older than its due time, the escalation sweep bumps it to the next-up approver.
15.2 What triggers workflow
| Module | Event |
|---|---|
| Quote | Submit for approval |
| Order | Confirm (if gated) |
| Billing | Issue / Void (if gated) |
| Opportunity | Stage promotion (if configured) |
DevSP_Workflow_Inbox call.Reports & Dashboards
The Reports module is pure-read cross-module analytics. Each dashboard is one or more read-only DevSPs; admins can register new report definitions that point at any DevSP and schedule them to email recipients.
16.1 The five role dashboards
Sales Rep
My pipeline, my activities, my won this month.
Sales Manager
Team pipeline, activity & forecast.
Marketing
Campaign ROI, lead-source mix, conversion %.
Finance
AR aging, paid this month, top debtors.
Executive
Revenue, top accounts, win-rate trend, deal size.
16.2 The conversion funnel
The headline report tracks the rate at each hand-off — Lead → Opportunity → Quote → Order → Invoice — so you can see exactly where deals leak.
Status Reference & Troubleshooting
17.1 Status reference
| Entity | Statuses (in order) |
|---|---|
| Lead | New → Working → Qualified / Disqualified → Converted |
| Opportunity | Prospecting → Qualification → Proposal → Negotiation → Closed Won / Closed Lost |
| Quote | Draft → Pending Approval → Approved → Sent → Accepted / Rejected / Expired |
| Order | Draft → Confirmed → Partially Shipped → Shipped → Closed / Cancelled |
| Invoice | Draft → Issued → Partially Paid → Paid / Overdue / Cancelled |
| Workflow | Started → (per step: Pending → Approved/Rejected) → Complete / Rejected |
17.2 Common issues
I can't see a menu item I expect
My quote won't convert to an order
Lead conversion created a duplicate account
A dashboard shows stale numbers
I get "401 Unauthorized" mid-session
localStorage. Sign in again to obtain a fresh token.17.3 Scheduled jobs (v1 = manual "Run Job")
| Job | Cadence (v2) |
|---|---|
| Pipeline snapshot | Weekly |
| AR aging refresh | Nightly |
| Dunning candidates | Daily |
| Workflow escalation sweep | Hourly |
| Overdue reminders | Daily |