Make sure you’ve completed the installation steps before proceeding.
Launching the Application
Start the application using one of these methods:view/InventarioView.java:34).
Initial Launch Alert
On first launch, you may see a caducity alert dialog (view/InventarioView.java:161-172):
- Medicines are within 30 days of expiration
- Medicines have already expired
Understanding the Interface
The main window consists of:Search Bar
Filter inventory by name, lot, or expiration date
Inventory Table
Displays all products with columns: ID, Name, Stock, Lot, Expiration, Entry Date
Action Buttons
Agregar, Eliminar, Editar, Exportar a Excel, Ventas, Apartados
Color Coding
Red cells indicate expired/expiring medicines
Expiration Color Indicators
The table automatically highlights expiration dates (view/InventarioView.java:345-367):
- Dark Red (RGB 255, 0, 0): Product has expired
- Light Red (RGB 255, 153, 153): Product expires within 30 days
- Normal: Product has more than 30 days until expiration
Adding Your First Medicine
Let’s add a medicine product to the inventory:Open the Add Medicine dialog
Click the Agregar button in the main window. This opens 
AgregarMedicamentoView (view/AgregarMedicamentoView.java:17-21).
Fill in product details
Enter the following information:
| Field | Description | Example |
|---|---|---|
| Nombre | Medicine name | Amoxicilina 500mg |
| Existencias | Initial stock quantity (use spinner) | 100 |
| Lote | Batch/lot number | L2024-001 |
| Caducidad | Expiration year and month | Año: 2025, Mes: 12 |
The expiration date uses two dropdown menus for year and month. The system formats this as
yyyy-MM (e.g., “2025-12”) internally (view/AgregarMedicamentoView.java:147-152).Save the product
Click Guardar to add the medicine. The system will:You’ll see a success confirmation, and the product will appear in the main table.
- Validate that all fields are filled (
view/AgregarMedicamentoView.java:138-145) - Validate the expiration date format (
model/InventarioDAO.java:217-230) - Ensure stock quantity is non-negative (
model/InventarioDAO.java:114-116) - Insert the record into the
productostable (model/InventarioDAO.java:119-127) - Automatically set
fechaEntradato today’s date (model/InventarioDAO.java:118)
Recording Your First Sale
Now let’s record a sale transaction:Open the Sales window
From the main window, click Ventas. This opens
VentasView which displays the sales history table.Register a new sale
Click Agregar Venta to open
RegistrarVentaView (view/RegistrarVentaView.java:13-18).Enter:| Field | Description | Example |
|---|---|---|
| ID del Medicamento | Product ID from inventory | 1 |
| Nombre del Medicamento | Exact product name (must match) | Amoxicilina 500mg |
| Cantidad Vendida | Units sold (use spinner, min: 1) | 10 |
Sales are recorded with a foreign key relationship to products. If a product is deleted, all associated sales history is also removed (CASCADE DELETE defined in
model/InventarioDAO.java:85).Viewing and Searching Inventory
The main inventory table provides powerful search and sorting capabilities:Searching Products
Use the search bar
Type in the Buscar field at the top of the window (
view/InventarioView.java:100-106). The table filters in real-time as you type.You can search by:- Medicine name
- Lot number
- Expiration date
Sorting Columns
Click any column header to sort:- Click once: Sort ascending
- Click again: Sort descending
- Click a third time: Return to default order
view/InventarioView.java:208-217).
Selecting Multiple Items
You can select multiple products for batch operations:- Click + Drag: Select range
- Ctrl + Click (Windows/Linux) or Cmd + Click (macOS): Select individual items
- Shift + Click: Select from last selection to current
Basic Inventory Operations
Editing a Product
Open edit dialog
Click the Editar button. The
EditarMedicamentoView dialog opens with pre-filled fields.Deleting Products
Refreshing the View
Click Refrescar at any time to reload data from the database. This is useful if:- You suspect data is stale
- You’ve made changes in another window (Ventas, Apartados)
- You want to clear search filters
Exporting Data
Export your inventory to CSV format for use in Excel or other tools:Choose save location
A file dialog opens with default name
inventario.csv. Choose where to save the file.You can also export sales history and reserved products from their respective windows using the same process.
Keyboard Shortcuts and Tips
Navigation shortcuts
Navigation shortcuts
Selection shortcuts
Selection shortcuts
- Ctrl+A (Windows/Linux) or Cmd+A (macOS): Select all rows
- Ctrl+Click: Add/remove individual rows from selection
- Shift+Click: Select range of rows
UI interactions
UI interactions
- Hover over rows: Highlights row with light blue background
- Click column headers: Sort by that column
- Double-click empty space: Deselect all rows
- Right-click: Context menu (future feature)
Performance tips
Performance tips
- Use search to filter large inventories instead of scrolling
- Click Refrescar if the table seems out of sync
- Export data regularly for backup purposes
- Close unused windows (Ventas, Apartados) to save memory
Common Tasks Reference
Check expiring medicines
Look for red-highlighted rows in the Caducidad column. Dark red = expired, light red = expires soon.
Find a specific medicine
Type the name, lot, or date in the search bar. The table filters automatically.
Restock a product
Select the product, click Editar, increase Existencias, and save.
View low stock
Click the Existencias column header to sort by stock quantity (lowest first).
Undo a sale
Open Ventas window, select the sale, click Eliminar. Note: This does NOT restore inventory.
Reserve medicine
Click Apartados, then Registrar Apartado to mark products as reserved.
What’s Next?
Now that you’re familiar with the basics, explore more advanced features:Inventory Management
Complete inventory guide
Sales Tracking
Track and manage sales transactions
Product Reservation
Handle reserved inventory
CSV Export
Export data to Excel/CSV
Expiration Monitoring
Monitor expiring products
Architecture
Understand the technical design
Getting Help
If you encounter issues or have questions:Check the documentation
Browse the User Guide for detailed feature explanations.
Review error messages
The application shows descriptive error dialogs. Read them carefully for hints.
Verify data integrity
Check that:
- Product IDs exist when recording sales
- Product names match exactly (case-sensitive)
- Stock quantities are sufficient for sales