Case Study · CRM + Tāmēšana ERP Integration

From no CRM to a full sales
pipeline wired into their ERP

Spals ran three product lines with no CRM at all — quotes were rebuilt by hand in Word and the estimation system lived in its own world. We built a CRM from scratch and wired it directly into Tāmēšana, their in-house ERP and estimation engine.

0 → 1
CRMs in the business
3
Product lines unified
Tāmēšana
ERP fully integrated
Seconds
Quote generation
The Challenge

Three product lines, no CRM, no link to the ERP.

Spals had no CRM in place. Sales for three different product lines — Tambour doors, Kitchens, and Scandor — was tracked across spreadsheets, inboxes, and Word documents. Each line had its own pricing logic, branding, and VAT rules, all applied by hand. Their estimation engine, Tāmēšana, held the real cost data but had no connection to whatever the client actually saw on the offer. LinkedIn lead generation lived in yet another spreadsheet nobody trusted. There was no shared pipeline, no version history, and no single number anyone agreed on.

The Solution

A CRM built from zero, bonded to the existing ERP.

We built the CRM end-to-end and integrated it directly with Tāmēšana — their existing estimation ERP — so the two systems behave as one. Deals know which product line they belong to and render the correct template, badge, and VAT automatically. Offers are versioned and numbered (YYXXXX, then {base}-v2, v3…), and the deal headline value syncs to the newest offer unless overridden. Notes, clients, folder paths, and workflow stages stay in sync across both systems via a dedicated integration layer.

Key Features

What we shipped

Greenfield CRM build

Pipeline, stages, deal types, properties, and dashboards designed around how Spals actually sells — not a generic template bent into shape.

Tāmēšana ERP integration

Notes sync both ways between deals.tamesana_notes and tamesana.description. Quick Add performs a dual insert into companies (CRM) and clients (ERP) so records line up automatically.

Shared folder bridge

Both systems write to the same S:\Klienti App tree on the file server, with emoji-stripped paths and double-prefixing prevented.

Stage mirroring

Estimation stages (Plānots, Procesā, Gatavs, Pabeigts) mirror the production board so sales, estimation, and production see the same status.

Product-line-aware deals

Tambour, Kitchen, and Scandor each get a distinct badge, template set, and property logic; Scandor enforces the Tambour doors flag automatically.

Offer versioning model

parent_offer_id / version / is_latest schema. Edit dialog's 'Save as new version' produces {base}-v{n}, keeping every offer the client ever saw.

Language-driven VAT

Offer language selects VAT automatically — EN = 0%, LV = 21% — rendered on the PDF with correct formatting and explicit VAT lines.

Branded PDF generation

Roboto-rendered templates with per-brand palettes, red discount rows, and YYXXXX numbering — generated in seconds.

LinkedIn outreach pipeline

Daily cron fills the 'Today' lane, dedupes via normalized LinkedIn URLs, and progresses stale leads with a Fisher–Yates shuffle from the potential pool.

Deal value sync

Headline value tracks the newest offer total automatically — sales, estimation, production, and finance always read from one number.

In-app notifications

Six trigger conditions with @mention formatting and per-user read state — built directly on the CRM event log.

Soft-delete everywhere

is_archived and is_deleted = false filters applied across the schema — nothing disappears, everything stays auditable.

Inside the system

What the team actually uses every day

The Flow

How the CRM and ERP became one system

1
Mapped the three product lines

Documented every rule difference between Tambour, Kitchen, and Scandor — pricing logic, branding, VAT, properties, flags — before writing a single table.

2
Designed the schema

Pipeline, stage history, deals, offers (with parent_offer_id / version / is_latest), companies, contacts, and outreach leads — all with RLS and soft-delete from day one.

3
Built the ERP bridge

Two-way notes sync, dual client inserts, shared folder path generation, and stage mirroring between CRM deals and Tāmēšana estimations.

4
PDF generation engine

Roboto-rendered branded templates with explicit VAT lines, red discount rows, language-driven VAT selection, and YYXXXX → {base}-v{n} numbering.

5
LinkedIn pipeline + cron

Outreach stages, dedup edge function on normalized URLs, daily cron filling 'Today' and progressing stale leads.

6
Notifications + dashboards

Six-trigger in-app notification system with @mentions, plus Won and Ražošana analytics fed by deal_stage_history.

7
Cutover from spreadsheets

Imported existing leads, companies, and historical deals — and switched the team off Word and Excel for quoting.

Outcomes

From no CRM to one system of record.

60× faster

Quotes that took an hour now render in seconds — with correct VAT every time.

~8 hrs/week saved

Quote prep alone, on top of the time recovered from chasing LinkedIn leads and reconciling spreadsheets.

One source of truth

Sales, estimation, production, and finance all reading from the same numbers for the first time.

Full history

Every offer version a client ever saw, every stage transition, every note — auditable and intact.

Autopilot outreach

LinkedIn pipeline runs itself daily — no more 'who's following up?' meetings.

ERP unified

Tāmēšana and the CRM behave as one system — same clients, same folders, same stages, same numbers.

Need a CRM that fits — and talks to your existing systems?

Tell us about your sales process and the tools you already rely on. We'll build the CRM around them — not the other way around.

Book a Free Consultation