π Module Summary Completed
π§© Detailed Modules
π₯ Societe (Third Parties)
100% Completedπ Description
Third party management (customers, suppliers, prospects) with automatic data validations, unique code generation and contact synchronization.
π Transformations Performed
β PHP Original
- Manual email validation
- Duplicate code verification
- Manual code generation
- Manual establishment of defaults
β Automated PostgreSQL
- Automatic regex email validation
- Automatic uniqueness constraint
- Code generation by triggers
- Automatic defaults on INSERT
π― Key Features
π» Main Function
CREATE OR REPLACE FUNCTION llx_societe_before_insert()
RETURNS trigger AS $$
BEGIN
-- Validate required name
IF NEW.nom IS NULL OR trim(NEW.nom) = '' THEN
RAISE EXCEPTION 'ErrorFieldRequired: nom';
END IF;
-- Validate email if present
IF NEW.email IS NOT NULL AND NEW.email != '' THEN
NEW.email = trim(lower(NEW.email));
IF NOT (NEW.email ~* '^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$') THEN
RAISE EXCEPTION 'ErrorBadEMail: %', NEW.email;
END IF;
END IF;
-- Generate client code automatically
IF NEW.client = 1 AND (NEW.code_client IS NULL OR trim(NEW.code_client) = '') THEN
NEW.code_client := llx_societe_get_next_code('C', NEW.entity);
END IF;
-- Set default values
NEW.entity := COALESCE(NEW.entity, 1);
NEW.status := COALESCE(NEW.status, 1);
NEW.datec := COALESCE(NEW.datec, NOW());
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
π¦ Product (Products)
100% Completedπ Description
Product and service management with automatic price control, history, stock and consistency validations.
π― Key Features
π» Automatic Price Calculation
-- Calculate TTC price automatically
IF NEW.price IS NOT NULL AND NEW.tva_tx IS NOT NULL THEN
NEW.price_ttc := NEW.price * (1 + NEW.tva_tx / 100);
END IF;
-- Register in history if price changed
IF OLD.price IS DISTINCT FROM NEW.price OR OLD.tva_tx IS DISTINCT FROM NEW.tva_tx THEN
INSERT INTO llx_product_price (
fk_product, date_price, price, price_ttc, tva_tx,
fk_user_author, entity
) VALUES (
NEW.rowid, NOW(), NEW.price, NEW.price_ttc, NEW.tva_tx,
COALESCE(NEW.fk_user_modif, NEW.fk_user_author, 1), NEW.entity
);
END IF;
π€ User (Users)
100% Completedπ Description
User system with unique login/email validations, automatic data cleanup and permission management.
π― Key Features
π¦ Banque (Bank Accounts)
100% Completedπ Description
Bank account management with automatic IBAN/BIC validations and balance control.
π― Key Features
π° Tax (Local Taxes)
100% Completedπ Description
Local tax management with automatic calculations and period validations.
π― Key Features
π Propale (Quotes)
100% Completedπ Description
Complete quotation system with automatic reference generation, total calculations and detail line management.
π― Key Features
π» Reference Generation
CREATE OR REPLACE FUNCTION llx_propal_get_next_ref(p_entity integer DEFAULT 1)
RETURNS varchar AS $$
DECLARE
v_current_year varchar(2);
v_current_month varchar(2);
v_current_num integer;
v_new_ref varchar(30);
BEGIN
-- Get current year and month
v_current_year := to_char(CURRENT_DATE, 'YY');
v_current_month := to_char(CURRENT_DATE, 'MM');
-- Find the next number
SELECT COALESCE(MAX(
CAST(
CASE
WHEN ref ~ '^PR[0-9]{2}[0-9]{2}-[0-9]{4}$'
THEN substring(ref from 8 for 4)
ELSE '0'
END AS integer
)
), 0) + 1 INTO v_current_num
FROM llx_propal
WHERE ref ~ ('^PR' || v_current_year || v_current_month || '-[0-9]{4}$')
AND entity = p_entity;
-- Generate new reference
v_new_ref := 'PR' || v_current_year || v_current_month || '-' ||
lpad(v_current_num::text, 4, '0');
RETURN v_new_ref;
END;
$$ LANGUAGE plpgsql;
π Categories (Categories)
100% Completedπ Description
Hierarchical category system with automatic relationship management and integrity validations.
π― Key Features
π Don (Donations)
100% Completedπ Description
Donation management with personal data validations and state flow control.
π― Key Features
π¨βπΌ Contact (Contacts)
100% Completedπ Description
Contact management with automatic synchronization with societes and dependency validations.
π― Key Features
π¦ Commande (Orders)
100% Completedπ Description
Complete order system with automatic reference generation, detail line management and total calculations.
π― Key Features
π» State Management
-- Control of state transitions
IF OLD.fk_statut != NEW.fk_statut THEN
-- Do not allow return to draft once validated
IF OLD.fk_statut >= 1 AND NEW.fk_statut = 0 THEN
RAISE EXCEPTION 'Cannot return a validated order to draft';
END IF;
-- Do not allow modifying closed orders
IF OLD.fk_statut = 3 THEN
RAISE EXCEPTION 'Cannot modify a closed order';
END IF;
-- Set validation date when validating
IF NEW.fk_statut = 1 AND OLD.fk_statut = 0 THEN
NEW.date_valid := COALESCE(NEW.date_valid, NOW());
-- Generate definitive reference when validating
IF NEW.ref LIKE '(PROV%' THEN
NEW.ref := llx_commande_get_next_ref(NEW.entity, NEW.fk_soc);
END IF;
END IF;
END IF;
π Facture (Invoices)
100% Completedπ Description
Complete invoicing system with automatic reference generation, total calculations, detail line management and automatic recurring billing.
π― Key Features
π» Recurring Billing
CREATE OR REPLACE FUNCTION llx_facture_rec_create_invoice(
p_rec_id integer,
p_user_id integer,
p_force_validation boolean DEFAULT false
)
RETURNS integer
LANGUAGE plpgsql AS $$
DECLARE
v_rec_data record;
v_new_facture_id integer;
v_line record;
BEGIN
-- Get template data
SELECT * INTO v_rec_data
FROM llx_facture_rec
WHERE rowid = p_rec_id;
-- Create new invoice
INSERT INTO llx_facture (
fk_soc, type, total_ht, total_tva, total_ttc,
date_creation, fk_user_author, entity,
note_public, note_private
) VALUES (
v_rec_data.fk_soc, v_rec_data.type,
v_rec_data.total_ht, v_rec_data.total_tva, v_rec_data.total_ttc,
CURRENT_TIMESTAMP, p_user_id, v_rec_data.entity,
v_rec_data.note_public, v_rec_data.note_private
) RETURNING rowid INTO v_new_facture_id;
-- Copy detail lines
FOR v_line IN
SELECT * FROM llx_facturedet_rec
WHERE fk_facture = p_rec_id
LOOP
INSERT INTO llx_facturedet (
fk_facture, fk_product, qty, pu_ht,
total_ht, total_tva, total_ttc, tva_tx
) VALUES (
v_new_facture_id, v_line.fk_product, v_line.qty, v_line.pu_ht,
v_line.total_ht, v_line.total_tva, v_line.total_ttc, v_line.tva_tx
);
END LOOP;
-- Update counter and date in template
UPDATE llx_facture_rec
SET nb_gen_done = nb_gen_done + 1,
date_last_gen = CURRENT_TIMESTAMP
WHERE rowid = p_rec_id;
RETURN v_new_facture_id;
END;
$$;
π¦ Stock (Stock Management)
100% Completedπ Description
Complete stock management with automatic movements, inventory control and product traceability.
π― Key Features
π Bookkeeping (Accounting)
100% Completedπ Description
Double-entry accounting system with automatic entries, validations and balances.
π― Key Features
π° ExpenseReport (Expense Reports)
100% Completedπ Description
Complete expense report system with automatic validations, total calculations and approval management.
π― Key Features
πͺ FournisseurCommande (Purchase Orders)
100% Completedπ Description
Purchase order system with automatic state management, references and delivery tracking.
π― Key Features
π Expeditions (Shipments)
100% Completedπ Description
Shipment management with stock control, shipping tracking and coordination with carriers.
π― Key Features
π Contracts (Contracts)
100% Completedπ Description
Contract and subscription system with automatic management of dates, states and renewals.
π― Key Features
π€ Partnership (Partner Management)
100% Completedπ Description
Manages partnerships with external entities, including partner relationships, agreements, and collaboration tracking.
π§ Interventions (Fichinter)
100% Completedπ Description
Manages technical interventions and service calls, tracking maintenance operations, repairs, and on-site services.
π« Tickets (Support Management)
100% Completedπ Description
Comprehensive ticketing system for customer support, issue tracking, and helpdesk management with SLA control.
π Supplier Proposals (Request for Quotations)
100% Completedπ Description
Manages requests for quotations from suppliers, comparing offers, and converting them to purchase orders.
π¦ Receptions (Goods Receipt)
100% Completedπ Description
Handles reception of goods from suppliers, quality control, and automatic stock updates upon receipt.
π§ Mass Emails (Mailing Campaigns)
100% Completedπ Description
Email marketing and mass mailing campaigns with tracking, templates, and recipient management.
π₯ Members (Adherent Management)
100% Completedπ Description
Association and membership management including subscriptions, member directories, and renewal tracking.
ποΈ Holiday (Leave Management)
100% Completedπ Description
Employee leave and vacation management with approval workflows, balance tracking, and calendar integration.
π° Salaries (Payroll Management)
100% Completedπ Description
Salary and payroll management including payment tracking, deductions, and integration with accounting.
π Recruitment (Hiring Process)
100% Completedπ Description
Complete recruitment process management from job postings to candidate evaluation and hiring decisions.
π’ HRM (Human Resources Management)
100% Completedπ Description
Comprehensive HR management including employee records, skills, evaluations, and career development.
β° Attendance (Fichajes - Time Tracking)
100% Completedπ Description
Employee time and attendance tracking with clock-in/out functionality, overtime calculation, and reporting.
π Projects (Project Management)
100% Completedπ Description
Project management with tasks, milestones, resource allocation, time tracking, and Gantt charts.
π Events (Actioncomm - Calendar & Activities)
100% Completedπ Description
Calendar management, events, meetings, and commercial actions with reminders and participant tracking.
π οΈ Resources (Asset Management)
100% Completedπ Description
Management of company resources and assets including equipment, rooms, vehicles, and their allocation.
πͺ Event Organization (Conference Management)
100% Completedπ Description
Complete event organization for conferences, seminars, and exhibitions with attendee management.
π¦ Product Batch (Lot/Serial Management)
100% Completedπ Description
Product batch and serial number tracking for traceability, expiry date management, and quality control.
π¨ Product Variants (Attributes & Combinations)
100% Completedπ Description
Product variants management with attributes like size, color, material, and automatic combination generation.
π BOM (Bill of Materials)
100% Completedπ Description
Bill of Materials definition for manufacturing, including components, quantities, and production costs.
βοΈ MRP (Manufacturing Resource Planning)
100% Completedπ Description
Manufacturing orders management with production planning, resource allocation, and stock consumption.
ποΈ Workstation (Production Centers)
100% Completedπ Description
Workstation and production center management for manufacturing operations and capacity planning.
π Margins (Profitability Analysis)
100% Completedπ Description
Margin and profitability analysis by product, customer, and project with detailed cost breakdown.
π¦ Loan (Credit Management)
100% Completedπ Description
Loan and credit management with payment schedules, interest calculation, and amortization tables.
πΈ Bank Transfer (SEPA Transfers)
100% Completedπ Description
Bank transfer management including SEPA credit transfers and batch payment processing.
π Simple Accounting (Basic Bookkeeping)
100% Completedπ Description
Simplified accounting for small businesses with basic journal entries and financial reports.
π Incoterms (International Trade Terms)
100% Completedπ Description
International commercial terms management for exports and imports with shipping rules and responsibilities.
π TakePOS (Point of Sale)
100% Completedπ Description
Complete point of sale system for retail with touch interface, barcode scanning, and cash management.
β²οΈ Cron (Scheduled Tasks)
100% Completedπ Description
Scheduled task management for automatic execution of recurring operations and maintenance tasks.
π³ Direct Debit (SEPA Direct Debit)
100% Completedπ Description
SEPA direct debit management for automatic collection of recurring payments from customers.
π Transformation Summary
π Global Statistics
π― Applied Patterns
Automatic Validation
BEFORE INSERT/UPDATE triggers on all main tables
46 modulesCode Generation
Specialized functions for automatic unique references
25 modulesAutomatic Calculations
Triggers for totals, subtotals and prices with VAT
18 modulesState Control
Validation of transitions and business flows
32 modulesData Cleanup
Automatic trim and format normalization
46 modulesAutomatic Audit
Timestamps and transparent change tracking
46 modulesπ Next Modules
Priority modules pending migration to complete the PostgreSQL transformation.
π Website
Website builder module with pages, templates and content management system.
π§ ModuleBuilder
Dynamic module creation tool for custom business requirements.
π Workflow
Inter-module workflow automation with business rules and triggers.
π§ EmailCollector
Email collection and processing system with ticket and project integration.
π API
RESTful API services for external system integration.
π± MultiCurrency
Multi-currency support with exchange rates and automatic conversions.
π ECM
Electronic Document Management with directories and metadata.
π BlockedLog
Immutable audit log system for compliance and security.
π Survey
Survey and voting system with customizable forms and analytics.
βοΈ Other Modules (25+ remaining)
Additional modules including Import/Export, OAuth2, Stripe, LDAP, Notifications, and more specialized integrations.