Skip to main content

Welcome

This guide will walk you through your first steps with PAE Inventory System, from account creation to performing basic inventory operations.
This quick start assumes you’re using the hosted SaaS version. For local development setup, see the Installation Guide.

Getting Started

1

Access the System

Navigate to the application URL provided by your system administrator. You’ll be greeted with the login screen.
2

Receive Your Credentials

Your account must be created by a Director-level user. You’ll receive:
  • Email address
  • Temporary password
  • Your assigned role (Director, Madre Procesadora, or Supervisor)
Change your password immediately after first login for security.
3

First Login

Enter your credentials on the login page:
// The login process authenticates through Supabase Auth
const { data, error } = await supabase.auth.signInWithPassword({
  email: userEmail,
  password: userPassword,
})
After successful authentication, the system verifies your user record and role from the users table.
4

Explore the Dashboard

After login, you’ll land on the Dashboard which shows:
  • Current inventory summary
  • Low stock alerts
  • Recent activity
  • Pending approvals (for Directors)
  • Quick action buttons
The Dashboard is the central hub for all operations. All features are accessible from the navigation menu.

Understanding User Roles

Your role determines what you can see and do in the system:
Full System AccessAs a Director, you have complete control:
  • ✅ Create and manage user accounts
  • ✅ Approve/reject delivery guides (guías de entrada)
  • ✅ Create, edit, and delete products
  • ✅ Register daily operations
  • ✅ View all reports and audit logs
  • ✅ Configure portion yields
  • ✅ Manage school information
Only Directors can approve delivery guides. This maker-checker workflow ensures inventory accuracy.

Common Tasks

View Current Inventory

1

Navigate to Products

Click Productos in the main navigation menu
2

Browse or Search

  • Browse the complete product list
  • Use the search box to find specific items
  • Filter by category (Lácteos, Proteínas, etc.)
  • Sort by name, stock level, or category
3

View Product Details

Each product shows:
  • Product name and description
  • Current stock level
  • Unit of measurement (kg, lt, unidades)
  • Category
  • Last updated timestamp
Products with stock below 10 units are automatically highlighted as low stock.

Register a New Delivery

1

Go to Delivery Guides

Navigate to Guías de Entrada from the main menu
2

Create New Guide

Click the Nueva Guía button and fill in:
// Required fields
{
  numero_guia_sunagro: "SUNAGRO-2026-001",  // Required: SUNAGRO guide number
  numero_guia_sisecal: "SISECAL-2026-001",  // Optional: SISECAL number
  fecha: "2026-03-03",                      // Delivery date
  vocera_nombre: "María González",          // Community representative
  telefono_vocera: "0414-1234567",         // Contact phone
  notas: "Entrega mensual febrero"         // Optional notes
}
3

Add Products

For each product in the delivery:
  • Select the product from the dropdown
  • Enter the quantity received
  • Optionally enter unit amount (e.g., number of bags)
  • Add batch details with expiration dates
Always enter expiration dates for perishable items. The system uses this for FIFO tracking and expiration alerts.
4

Save and Submit

Save the guide. It will be created with Pendiente (Pending) status.
The inventory is NOT updated yet. A Director must approve the guide first.

Director Approval

Directors can:
  • Review the guide in Aprobar Guías
  • Approve it to update inventory
  • Or reject it with a reason
When approved, the system:
  • Updates stock levels for all products
  • Stores batch information for FIFO tracking
  • Logs the approval in the audit trail

Register Daily Operations

1

Navigate to Daily Registration

Click Registro Diario in the main menu
2

Create Daily Record

Enter the following information:
  • Date: The service date
  • Shift: Desayuno (Breakfast), Almuerzo (Lunch), or Merienda (Snack)
  • Attendance: Number of students served
  • Products Used: Select products consumed for this meal
// Example daily registration
{
  fecha: "2026-03-03",
  turno: "Almuerzo",
  asistencia_total: 150,  // 150 students
  rubros: [1, 4, 5, 6]   // Product IDs: Arroz, Pollo, Caraotas, Pasta
}
3

Automatic Calculation

The system automatically:
  • Calculates required quantities based on portion yields
  • Uses FIFO logic to consume oldest batches first
  • Updates inventory stock levels
  • Creates output records for tracking
Make sure all products have portion yields configured in the Porciones section, or the calculation will fail.
4

Review and Confirm

Review the calculated quantities and confirm the registration.The system processes this through the procesar_operacion_diaria() database function:
-- Backend RPC function handles FIFO and stock updates
SELECT procesar_operacion_diaria(
  '2026-03-03',    -- fecha
  'Almuerzo',      -- turno
  150,             -- asistencia
  ARRAY[1,4,5,6]   -- rubros
);
If you see “Lotes insuficientes” (insufficient batches), there isn’t enough stock to serve the registered attendance. Check inventory levels and ensure deliveries are approved.
Understand the main sections of the application:

Dashboard

Overview of inventory status, alerts, and quick actions

Productos

Product catalog with stock levels and categories

Guías de Entrada

Create and manage incoming delivery guides

Aprobar Guías

Director-only: Approve or reject pending delivery guides

Registro Diario

Register daily meal service and attendance

Porciones

Configure portion yields for automatic quantity calculation

Reportes

Generate reports on inventory, operations, and history

Auditoría

View complete audit trail of all system operations

Usuarios

Director-only: Create and manage user accounts

Datos Plantel

View and edit school information

Key Concepts

A delivery guide represents a shipment of products received from SUNAGRO or other suppliers. It includes:
  • Official guide numbers (SUNAGRO and SISECAL)
  • Delivery date and community representative info
  • List of products with quantities and batch details
  • Approval status (Pendiente, Aprobada, Rechazada)
Guides must be approved by a Director before inventory is updated.
The system automatically tracks product batches with expiration dates and ensures that:
  • Oldest batches are used first
  • You’re alerted when items approach expiration
  • Batch quantities are deducted during daily operations
This prevents waste and ensures food safety.
Each product can have a configured yield that defines how many portions (servings) one unit provides. For example:
  • 1 kg of rice = 12 portions
  • 1 kg of chicken = 4 portions
  • 1 kg of powdered milk = 40 portions
This allows automatic calculation of quantities needed based on student attendance.
A two-step process for critical operations:
  1. Maker: Staff creates the delivery guide
  2. Checker: Director reviews and approves
This separation of duties prevents errors and fraud.

Best Practices

Log Out Securely

Always click the Cerrar Sesión button when done, especially on shared computers

Verify Deliveries

Directors should physically verify deliveries before approving guides

Enter Expiration Dates

Always record expiration dates for perishable items to enable FIFO tracking

Regular Inventory Checks

Periodically compare physical inventory with system stock levels

Configure Yields First

Set up portion yields before registering daily operations

Review Audit Logs

Directors should regularly review the audit trail for accountability

Need Help?

Installation Guide

Set up the system for local development

User Management

Learn about creating and managing user accounts

Inventory Features

Deep dive into inventory management features

Database Schema

Understand the database structure and relationships
You’re now ready to use PAE Inventory System! Start by exploring the Dashboard and familiarizing yourself with the navigation.

Build docs developers (and LLMs) love