Home / Help Center / pos-app-garment / garment / Fabric Inventory
📐 garment

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.

📍 Menu path: /garment/fabric-inventory
👤 Who uses it: Owner,Manager,Staff

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

Step-by-Step Guide

1 Record a new fabric bale

  1. Click Add Bale.
  2. Enter Bale / Lot Number * (required, e.g. "LOT-2025-001") and Fabric Type * (required, e.g. Cotton, Silk, Polyester).
  3. Enter Colour if relevant, and start typing in Supplier to see matching suppliers from your supplier list, or type a new name freely.
  4. Enter Total Meters * received, and optionally Used Meters (defaults to 0 for a brand-new bale), Cost per Meter, and Received Date.
  5. Add any Notes and click Save Bale.

2 Log fabric usage as it is cut/consumed

  1. Click the edit icon on the bale being used.
  2. Increase Used Meters by the amount just consumed (e.g. cut for a production run) and click Save Bale.
  3. 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

  1. Use the search box to filter by bale number, fabric type or supplier.
  2. Click the trash icon and confirm to permanently delete a bale record.

Every Field & Button, Explained

Field / ButtonWhat it does
Add BaleOpens 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.
ColourOptional colour of this fabric lot.
SupplierFree-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 MetersMeters consumed so far; subtracted from Total Meters to compute remaining stock.
Cost per MeterPurchase cost per meter, used to calculate the Stock Value KPI and the per-bale cost shown in the list.
Received DateDate this bale arrived at the store.
NotesFree-text notes shown under each bale row when set.
Usage progress barPercentage of the bale used so far (Used ÷ Total); green under 60%, amber 60–89%, red at 90%+.
Search boxFilters by bale number, fabric type or supplier.
Edit / Delete iconsEdit opens the form pre-filled; Delete permanently removes the bale record after a confirmation prompt.

Tips & Best Practices

Troubleshooting & FAQ

Remaining meters shows a higher number than I expect.
Remaining is always recalculated as Total Meters minus Used Meters — if it looks wrong, check that Used Meters was actually updated after the last cutting run rather than left at an old value.
The remaining figure never goes negative even though I think we used more than we received.
Both the list display and the backend clamp remaining meters at a minimum of zero (Math.max(0, total − used)), so over-consumption is silently floored rather than shown as a negative number — double check your Total Meters and Used Meters entries if a bale seems to be running out faster than expected.
Supplier autocomplete shows no suggestions.
It only searches after you type at least one character and queries GET /suppliers with a 300ms delay; if your supplier list is empty or the name does not match any existing supplier, no suggestions will appear — you can still type and save a new supplier name freely.
I deleted a bale by mistake.
Delete is permanent with no undo — there is no soft-delete/restore option exposed on this page, so re-enter the bale's details manually if it was removed in error.

🧑‍💻 Developer Notes

Source component(s):

  • frontend-app/pos-app-garment/src/pages/garment/FabricInventoryPage.jsx

Backend endpoints used:

  • GET /garment/fabric-bales
  • POST /garment/fabric-bales
  • PUT /garment/fabric-bales/:id
  • DELETE /garment/fabric-bales/:id
  • GET /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.