Skip to main content

Overview

Inventory Documents provide a controlled transaction system for recording all inventory movements. Documents follow a Draft → Posted workflow with validation and audit trails.

Document Lifecycle

Document Status

Borrador (Draft)
  • Initial state after creation
  • Fully editable (header and lines)
  • Does NOT affect stock
  • Can be deleted
  • Must have at least 1 line to post

Document Types

The system supports five document types:

RECEIPT (Entrada)

Purpose: Record incoming inventory Fields:
  • warehouse_id: Destination warehouse (required)
  • vendor_id: Supplier (optional, recommended)
  • reference: Purchase order, invoice number
  • notes: Additional information
Lines:
  • part_id: Part being received
  • qty: Quantity received (positive)
  • to_bin_id: Destination bin (required)
  • unit_cost: Cost per unit (optional)
Effect: Increases on_hand_qty at destination Example:
Document: REC-2024-001
Type: RECEIPT
Warehouse: WH-MAIN
Vendor: ACME Supplies
Reference: PO-12345

Lines:
1. Hydraulic Pump → Qty: 2 → Bin: A-01-05 → Cost: $250
2. Oil Filter → Qty: 24 → Bin: A-03-12 → Cost: $8

ISSUE (Salida)

Purpose: Consume parts for work orders or operations Fields:
  • warehouse_id: Source warehouse (required)
  • ticket_id: Work order ID (optional, validated)
  • reference: Work order or reason
  • notes: Usage details
Lines:
  • part_id: Part being consumed
  • qty: Quantity issued (positive)
  • from_bin_id: Source bin (required)
Effect: Decreases on_hand_qty at source, releases reservation if ticket linked Validation: Checks sufficient stock before posting Example:
Document: ISS-2024-053
Type: ISSUE
Warehouse: WH-MAIN
Ticket: 12847 (accepted work order)
Reference: PM-Monthly-Pump-A

Lines:
1. Hydraulic Pump → Qty: 1 → Bin: A-01-05
2. Oil Filter → Qty: 2 → Bin: A-03-12

TRANSFER (Transferencia)

Purpose: Move parts between warehouses or bins Fields:
  • from_warehouse_id: Source warehouse (required)
  • to_warehouse_id: Destination warehouse (required)
  • reference: Transfer reason or authorization
  • notes: Movement details
Lines:
  • part_id: Part being transferred
  • qty: Quantity transferred (positive)
  • from_bin_id: Source bin (required)
  • to_bin_id: Destination bin (required)
Effect: Decreases source, increases destination Validation: Checks sufficient stock at source Example:
Document: TRF-2024-028
Type: TRANSFER
From: WH-MAIN
To: WH-SITE-A
Reference: Site A Restocking

Lines:
1. Hydraulic Pump → Qty: 1 → From: A-01-05 → To: B-02-01
2. Oil Filter → Qty: 12 → From: A-03-12 → To: B-03-05

ADJUSTMENT (Ajuste)

Purpose: Correct stock levels for cycle counts or errors Fields:
  • warehouse_id: Warehouse being adjusted (required)
  • reference: Cycle count reference or reason
  • notes: Explanation of adjustment (required)
Lines:
  • part_id: Part being adjusted
  • qty: Adjustment amount (positive or negative, cannot be 0)
  • to_bin_id: Bin location (required)
Effect: Increases (positive) or decreases (negative) on_hand_qty Validation:
  • Quantity cannot be zero
  • Result cannot be negative
Example:
Document: ADJ-2024-015
Type: ADJUSTMENT
Warehouse: WH-MAIN
Reference: Q1-2024 Cycle Count
Notes: Physical count found discrepancies

Lines:
1. Hydraulic Pump → Qty: +1 → Bin: A-01-05 (found extra)
2. Oil Filter → Qty: -3 → Bin: A-03-12 (shortage found)

RETURN (Devolución)

Purpose: Return parts from work orders to inventory Fields:
  • warehouse_id: Return destination (required)
  • ticket_id: Source work order (optional)
  • reference: Return reason
  • notes: Condition notes
Lines:
  • part_id: Part being returned
  • qty: Quantity returned (positive)
  • to_bin_id: Destination bin (required)
Effect: Increases on_hand_qty at destination Example:
Document: RET-2024-009
Type: RETURN
Warehouse: WH-MAIN
Ticket: 12847
Reference: Work completed, parts unused
Notes: Parts in good condition

Lines:
1. Oil Filter → Qty: 1 → Bin: A-03-12

Creating Documents

1

Navigate to Documents

Go to Inventory > Documentos de inventario (/inventory/docs).
2

Create New Document

Click Nuevo documento and select document type:
  • RECEIPT
  • ISSUE
  • TRANSFER
  • ADJUSTMENT
  • RETURN
3

Fill Document Header

Provide required fields based on document type:
  • Warehouse(s)
  • Vendor (if RECEIPT)
  • Ticket ID (if ISSUE/RETURN)
  • Reference
  • Notes
4

Add Lines

Click Agregar línea to add parts:
  • Select part
  • Enter quantity
  • Choose bin location(s)
  • Add unit cost (if RECEIPT)
  • Add line notes if needed
Repeat for all parts.
5

Save Draft

Click Guardar to save changes while in DRAFT status.
Draft documents can be edited multiple times before posting.
6

Review

Verify:
  • All lines are correct
  • Quantities are accurate
  • Bins are appropriate
  • No unsaved changes
7

Post Document

Click Postear to finalize:
  • Validates all data
  • Checks stock availability (ISSUE/TRANSFER)
  • Updates stock quantities
  • Creates ledger entries
  • Changes status to POSTED
Posted documents cannot be edited. Double-check before posting.

Document Editor Interface

The editor (/inventory/docs/:docId) has two panels:

Left Panel: Document Header

  • Document Type: Read-only badge
  • Status: Current status with timeline
  • Warehouse Fields: Based on document type
  • Vendor: If RECEIPT
  • Ticket ID: If ISSUE/RETURN (validates accepted)
  • Reference: Free text
  • Notes: Multi-line text

Right Panel: Document Lines

Table or card view with columns:
  • Line #: Auto-incrementing
  • Part: Dropdown selector
  • Quantity: Number input
  • UOM: Auto-filled from part
  • From Bin: If ISSUE/TRANSFER
  • To Bin: If RECEIPT/TRANSFER/ADJUSTMENT/RETURN
  • Unit Cost: If RECEIPT
  • Notes: Per-line comments
  • Actions: Edit, Delete
Changes to draft lines are tracked. Click Guardar to save modifications.

Posting Validation

Before posting, the system validates:
Common Validations
  • Document must be in DRAFT status
  • At least one line required
  • All required fields populated
  • No unsaved changes
  • User has inventory:create permission
If validation fails, the system shows specific error messages.

Cancelling Documents

To reverse a POSTED document:
1

Open Posted Document

Navigate to the document in POSTED status.
2

Click Cancel Button

Click Cancelar in the document header.
3

Confirm Cancellation

Confirm in the alert dialog.
Cancellation creates an automatic reversal document with opposite quantities.
4

Reversal Document Created

System:
  • Changes original to CANCELLED status
  • Creates new document with reversed lines
  • Links documents via reversal_doc_id
  • Automatically posts reversal
5

Stock Restored

Stock quantities return to pre-transaction state.
Example:
Original Document: ISS-2024-053
Type: ISSUE
Line: Pump, Qty: -2 (issued)

Reversal Document: ISS-2024-053-REV
Type: ISSUE (same type)
Line: Pump, Qty: +2 (returned to stock)
Status: POSTED (automatically)
Note: "Reversal of ISS-2024-053"

Service Functions

Document operations use these services:
import {
  createInventoryDoc,
  getInventoryDoc,
  updateInventoryDoc,
  deleteInventoryDoc,
  addInventoryDocLines,
  updateInventoryDocLine,
  deleteInventoryDocLine,
  postInventoryDoc,
  cancelInventoryDoc,
  listInventoryDocs
} from '@/services/inventory';

// Create draft document
const doc = await createInventoryDoc({
  doc_type: 'RECEIPT',
  warehouse_id: warehouseId,
  vendor_id: vendorId,
  reference: 'PO-12345',
  notes: 'Monthly stock replenishment'
});

// Add lines
const lines = await addInventoryDocLines([
  {
    doc_id: doc.id,
    line_no: 1,
    part_id: partId,
    uom_id: uomId,
    qty: 10,
    to_bin_id: binId,
    unit_cost: 25.50
  }
]);

// Update header
await updateInventoryDoc(doc.id, {
  notes: 'Updated notes'
});

// Update line
await updateInventoryDocLine(lines[0].id, {
  qty: 12
});

// Post document
await postInventoryDoc(doc.id);

// Cancel posted document
const reversalDocId = await cancelInventoryDoc(doc.id);

Document Numbering

Documents receive unique sequential numbers:
Format: [TYPE]-[YEAR]-[SEQUENCE]

Examples:
REC-2024-001  (First receipt of 2024)
ISS-2024-053  (53rd issue of 2024)
TRF-2024-028  (28th transfer of 2024)
ADJ-2024-015  (15th adjustment of 2024)
RET-2024-009  (9th return of 2024)
Numbers are generated on creation and cannot be changed.

Best Practices

Descriptive References

Always add meaningful references:
  • PO numbers for receipts
  • Work order numbers for issues
  • Transfer authorizations
  • Cycle count IDs for adjustments

Detailed Notes

Document the reason:
  • Receipt: Vendor, delivery date
  • Issue: Work performed
  • Adjustment: Count results, reason
  • Return: Part condition

Same-Day Posting

Don’t leave drafts open:
  • Create and post within shift
  • Reduces draft clutter
  • Maintains stock accuracy
  • Enables real-time reporting

Cost Tracking

Record unit costs on receipts:
  • Enables valuation reports
  • Tracks cost trends
  • Supports budgeting
  • Required for financial integration

Common Scenarios

Receiving from Vendor

  1. Create RECEIPT document
  2. Enter vendor and PO reference
  3. Add all parts from delivery
  4. Enter unit costs from invoice
  5. Assign to appropriate bins
  6. Post document

Issuing for Work Order

  1. Create ISSUE document
  2. Enter ticket ID (accepted WO)
  3. Add reserved parts
  4. Specify source bins
  5. Post document (releases reservations)

Moving to Remote Site

  1. Create TRANSFER document
  2. Set from_warehouse = Main
  3. Set to_warehouse = Site A
  4. Add parts and quantities
  5. Specify source and destination bins
  6. Post document

Cycle Count Adjustment

  1. Perform physical count
  2. Create ADJUSTMENT document
  3. For each discrepancy:
    • Add line with +/- quantity
    • Specify bin counted
    • Note count date and counter
  4. Post document

Stock Management

View stock levels affected by documents

Reservations

Reserve before issuing for work orders

Warehouses

Manage document locations

Parts

Maintain parts used in documents