Fabric Inventory
Fabric Inventory tracks raw fabric stock separately from finished-garment stock — one record per bale or lot, showing how many meters were received, how many have been used, and how many remain, along with supplier and cost details.
Overview
Each bale record stores a Bale/Lot Number, Fabric Type, Colour, Supplier (with autocomplete against your existing supplier list), Total Meters received, Used Meters consumed so far, Cost per Meter, a Received Date, and free-text Notes.
Remaining meters is always computed, never stored directly — it is Total Meters − Used Meters, calculated both in the list (client-side) and by the backend on every create/update response.
Three KPI tiles at the top summarise Active Bales (count), Remaining Meters (sum across all bales) and Stock Value (remaining meters × cost per meter, summed across all bales), so you get a portfolio view of your fabric stock at a glance.
Each bale row shows a usage progress bar — the percentage of the bale already used — coloured green under 60% used, amber from 60–89%, and red at 90% or more, so heavily-depleted lots stand out without reading the exact numbers.
Before You Start
- The route requires the "inventory" plan feature; there is no plan-tier gate.
- Only Bale/Lot Number and Fabric Type are required to save a record — supplier, cost and dates can be added later.
- The Supplier field is free text with autocomplete suggestions from
GET /suppliers; it is not required to match an existing supplier record.
Step-by-Step Guide
1 Record a new fabric bale
- Click Add Bale.
- Enter Bale / Lot Number * (required, e.g. "LOT-2025-001") and Fabric Type * (required, e.g. Cotton, Silk, Polyester).
- Enter Colour if relevant, and start typing in Supplier to see matching suppliers from your supplier list, or type a new name freely.
- Enter Total Meters * received, and optionally Used Meters (defaults to 0 for a brand-new bale), Cost per Meter, and Received Date.
- Add any Notes and click Save Bale.
2 Log fabric usage as it is cut/consumed
- Click the edit icon on the bale being used.
- Increase Used Meters by the amount just consumed (e.g. cut for a production run) and click Save Bale.
- Watch the row's progress bar and "X m left" figure update — remaining meters is always Total Meters minus Used Meters, recalculated on save.
3 Find and manage bales
- Use the search box to filter by bale number, fabric type or supplier.
- Click the trash icon and confirm to permanently delete a bale record.
Every Field & Button, Explained
| Field / Button | What it does |
|---|---|
Add Bale | Opens the blank bale registration form. |
Active Bales (KPI) | Count of all bale records currently loaded (soft-deleted/inactive bales are excluded server-side). |
Remaining Meters (KPI) | Sum of (Total Meters − Used Meters) across every bale, floored at zero per bale. |
Stock Value (KPI) | Sum of remaining meters × cost per meter across every bale — an estimate of the money tied up in unused fabric stock. |
Bale / Lot Number * | Required identifier for the physical roll/bundle, e.g. a supplier lot code. |
Fabric Type * | Required, e.g. Cotton, Silk, Polyester, Linen. |
Colour | Optional colour of this fabric lot. |
Supplier | Free-text field with type-ahead suggestions from your existing Suppliers list (GET /suppliers); picking a suggestion fills the field, but any text can be saved. |
Total Meters * | Meters originally received in this bale/lot. |
Used Meters | Meters consumed so far; subtracted from Total Meters to compute remaining stock. |
Cost per Meter | Purchase cost per meter, used to calculate the Stock Value KPI and the per-bale cost shown in the list. |
Received Date | Date this bale arrived at the store. |
Notes | Free-text notes shown under each bale row when set. |
Usage progress bar | Percentage of the bale used so far (Used ÷ Total); green under 60%, amber 60–89%, red at 90%+. |
Search box | Filters by bale number, fabric type or supplier. |
Edit / Delete icons | Edit opens the form pre-filled; Delete permanently removes the bale record after a confirmation prompt. |
Tips & Best Practices
- Update Used Meters as fabric is actually cut, not in a weekly batch — the progress bar and Stock Value KPI are only as accurate as this number.
- Keep Bale/Lot Number consistent with what is printed on the physical roll or the supplier's delivery note — it is the fastest way to reconcile a physical stock count against this screen.
- Watch for bales sitting at 90%+ used (red bar) as a natural reorder trigger for that fabric type/colour combination.
Troubleshooting & FAQ
Remaining meters shows a higher number than I expect.
The remaining figure never goes negative even though I think we used more than we received.
Supplier autocomplete shows no suggestions.
I deleted a bale by mistake.
🧑💻 Developer Notes
Source component(s):
frontend-app/pos-app-garment/src/pages/garment/FabricInventoryPage.jsx
Backend endpoints used:
GET /garment/fabric-balesPOST /garment/fabric-balesPUT /garment/fabric-bales/:idDELETE /garment/fabric-bales/:idGET /suppliers (autocomplete only)
Related tables (db-core repositories):
FabricBale
Redux slices:
None — local component state only
Feature flag key: inventory
FabricBale is scoped by tenantId + storeId with an `idx_FabricBale_tenant` index and an `isActive` soft-delete-style flag, but the frontend DELETE action calls the hard-delete `DELETE /garment/fabric-bales/:id` endpoint (packages/pos-core/src/garment.js deleteFabricBale performs a real SQL DELETE), not a flip of isActive — so despite the schema supporting soft-delete, this page offers no way to recover a deleted bale. FabricBale has no linkage at all to the finished-Product/ProductVariant tables or to Purchase Orders — Used Meters must be updated manually by staff each time fabric is cut; there is no automatic deduction when a garment is produced or sold.