Overview
Commercial agreements define the negotiated terms between ICL and each FFWW client, including fiscal deposit fees, deconsolidation rates, insurance terms, and commission structures. These agreements automatically populate relevant costs when creating quotations.Agreement Structure
Each commercial agreement is linked to a single FFWW client and can optionally reference a specific end client for triangular relationships.Clients with
client_type = "Both" can have agreements as both FFWW and end client.Creating a Commercial Agreement
Access agreements
Navigate to Maestros → Acuerdos Comerciales or use the Acuerdo Comercial tab when creating/editing a client.
Select client relationship
- Cliente: Primary FFWW client (required)
- Cliente Final or Cliente FFWW: Conditional field based on client type
- If primary client is FFWW → Select a Final or Both client
- If primary client is Final → Select a FFWW or Both client
- If primary client is Both → Field hidden (no linking)
Configure rate schedules
- Tarifario: Rate schedule reference code
- Tarifario Fiscal: Fiscal rate schedule
- Moneda: Agreement currency (USD, EUR, ARS)
Set deconsolidation terms
Deconsolidation Rates
- W/M: Weight/measurement rate type
- Min: Minimum charge
- Max: Maximum charge
- Notas: Deconsolidation notes
Define fiscal deposit fees
- AGP/Tn: Agricultural inspection fee per ton
- Manejo Documentos: Document handling fee
- Log Fee: Logistics fee
- Doc Fee: Documentation fee
- Certflete: Freight certificate fee
Configure insurance terms
- Seguro %: Insurance percentage of cargo value
- Seguro Min: Minimum insurance charge
Define commercial terms
- Plazo de Pago: Payment terms (e.g., “Net 30”, “Immediate”)
- Maximo Descontar: Maximum discount percentage allowed
- Comision: Commission percentage
- Incentivo: Incentive percentage
Add notes and metadata
- Datos a Cotizar: Quote data reference
- Observaciones: General notes
- Vendedor: Sales representative managing this agreement
- Ultima Modificacion: Last modified date (auto-updated)
Agreement Display in Quotations
When you select a FFWW client in a quotation, the system:- Queries
GET /api/acuerdos?cliente_id={id} - If agreement found, displays Gastos en Deposito Fiscal section
- Shows all fee fields in read-only format
- If not found, displays: “Sin acuerdo comercial para este cliente”
Displayed Fields
Deconsolidation
- W/M rate type
- Min charge
- Max charge
Processing Fees
- AGP/Tn
- Document handling
- Log fee
- Doc fee
Additional Charges
- Freight certificate
- Insurance % and min
- BL emission
Client Type Conditional Logic
The first field in the agreement form adapts based on the primary client’s type:| Primary Client Type | Field Label | Available Options |
|---|---|---|
| FFWW | ”Cliente Final” | Clients with client_type = Final or Both |
| Final | ”Cliente FFWW” | Clients with client_type = FFWW or Both |
| Both | (field hidden) | N/A |
legal_name as the stored value (not id).
Source: docs/flows/07-gestion-maestros.md:49-60
Agreement Management Page
The Acuerdos Comerciales master page displays agreements in a grouped table:Table Columns
- Cliente: Primary FFWW client name
- Cliente Final: End client reference (if applicable)
- Vendedor: Sales representative
- Tarifario: Rate schedule code
- Moneda: Agreement currency
- Deconsolidado: W/M, Min, Max values
- Fees: AGP, Doc handling, Log fee, Doc fee
- Seguro: Insurance % and minimum
- Plazo Pago: Payment terms
- Comision/Incentivo: Commercial percentages
- Ultima Mod: Last modification date
Filter Options
- Search: Filter by client name, end client, or rate schedule
- Cliente: Multi-select client filter
- Vendedor: Filter by sales representative
- Moneda: Currency filter
Actions
- Nuevo Acuerdo: Create new agreement
- Edit: Modify agreement details
- Delete: Remove agreement (admin only)
Access Control
| Operation | Admin | Commercial User |
|---|---|---|
| View agreements | ✓ | ✓ (all) |
| Create agreement | ✓ | ✗ (403) |
| Edit agreement | ✓ | ✗ (403) |
| Delete agreement | ✓ | ✗ (403) |
| View in quotation | ✓ | ✓ (read-only) |
All users can view agreements in quotations, but only admins can create/modify them in the Maestros section.
Data Model Reference
Fromcommercial_agreements table (src/db/schema.ts:37-66):
API Endpoints
GET /api/acuerdos- List all agreements (supports?cliente_id=Xfilter)POST /api/acuerdos- Create new agreement (admin only)GET /api/acuerdos/[id]- Get agreement detailsPUT /api/acuerdos/[id]- Update agreement (admin only)DELETE /api/acuerdos/[id]- Delete agreement (admin only)
Agreement Best Practices
Currency Consistency
Set agreement currency to match the primary currency used in quotations for this client to avoid conversion complexity.
Rate Schedule Codes
Use consistent naming conventions for Tarifario codes (e.g., “2024-Q1-ASIA”, “STD-EUR-2026”) to enable easy filtering and reporting.
Fee Structure
- Leave fees as
nullif not applicable rather than setting to 0 - This distinction helps identify services that don’t apply vs. waived fees
Documentation
Use Observaciones field to note special conditions, validity periods, or exceptions to standard terms.