The Nueva Venta page is where all pharmacy sales are recorded. It handles both consumer receipts (boletas) and business invoices (facturas). Once you submit a sale, the system generates the official voucher number automatically and deducts the sold quantities from inventory — no manual stock adjustments needed. Route:Documentation Index
Fetch the complete documentation index at: https://mintlify.com/15aozzz/Lab-Nova-Salud/llms.txt
Use this file to discover all available pages before exploring further.
/nueva-venta
Recording a sale
Select the document type
Choose Boleta for individual customers or Factura for businesses that require a tax invoice. The system automatically retrieves the corresponding series code (e.g.,
B001 for boletas, F001 for facturas) and the next sequential correlativo (e.g., 00000001). The full voucher number — such as B001-00000001 — is shown in the Comprobante Info panel before you submit.Look up the client
Enter the client’s DNI (8 digits) or RUC (11 digits) in the client search field. The system queries the database and pre-fills the client’s name if they already exist. If the client is new, type their name manually — they will be saved automatically when the sale is recorded.
Add products
Search for a product by its commercial name or active ingredient. Results appear as you type (minimum 2 characters). For each product, select the pricing unit — for example, a single tablet, a blister pack of 10, or a full box — then set the quantity. Each unit option shows its individual sale price.
Automatic voucher numbering
You do not need to track voucher numbers manually. When you select a document type, the system calls the database to retrieve the current series and the next available correlativo. After the sale is saved, the correlativo increments by one so the next sale receives the following number in sequence. Example voucher numbers:| Document type | Series | Correlativo | Full number |
|---|---|---|---|
| Boleta | B001 | 00000001 | B001-00000001 |
| Factura | F001 | 00000001 | F001-00000001 |
Automatic stock deduction
Stock is managed entirely by the database. Two MySQL triggers run whenever a sale line is inserted:- A before-insert trigger checks that sufficient stock exists. If the quantity requested exceeds what is available, the entire sale is cancelled and an error is returned — no partial deductions occur.
- An after-insert trigger deducts the correct number of base units from inventory, accounting for the unit equivalence of the selected pricing tier.
2 × 10) from the product’s stock.
Sale request structure
The following JSON is sent to the backend when you submit a sale. This is shown here for reference — the form on the Nueva Venta page builds this payload automatically.Viewing completed sales
After a sale is registered it becomes available in the Comprobantes section (/comprobantes), where you can search the full history by date range, document type, or client name.