G Gaia

Switch factory

CYTO-11 — Balakong Jaya CTSB CYTO-29 CTSB CYTOWELL-54 — Taming Jaya PIC/S CTWSB CYTOCNGZ-602 — Guangzhou CTCNGZ

Only factories you are granted appear here (Filament tenant menu).

Leo Lim

leo@navi.my · Owner / Admin

Profile settings Change password

Theme

Sign out
RetailSellR&DMakeBuyStockPlanItemsGMPAdminInsights
← Inventory / Stock movement ledger

Angelica Sinensis Extract / CK-4548

Plant Extract Material · mg
In stock
7,446,000 mg
avg 0.00024 MYR · 1,809.34 MYR
Expected
+ 2,000,000 mg
open supply below
Committed
− 377,060 mg
open commitments below
Safety stock
− 7,000,000 mg
reorder point
Calculated
2,068,940 mg
in stock + expected − committed − safety
movements since stocktake STK-58 · location 11, Balakong Jaya
Date / time Type Document Qty Balance after Unit cost Value ± Batch / lot By
7,446,000 mg Closing balance at 2026-04-12 — reconciles with Inventory "In stock" ✓
Showing 1–14 of 14 movements since STK-58 (2025-12-15) — older history replayable

Open commitments

open MO ingredient requirements — not yet issued
MO Product Status Required Issued Remaining
YGMSB-260401 / 1 [2024-04] Yes Global AlphaMax V+ Work in progress 1,049,060 mg 852,000 mg 197,060 mg
NVMSB-0309 / 2 [2024-02] Double Root Coffee Work in progress 550,000 mg 430,000 mg 120,000 mg
NVMSB-0309 / 3 [2024-04-Hologram] JuicyPop Ingredients expected 376,000 mg 316,000 mg 60,000 mg
Sum of remaining = "Committed" on Inventory ✓ 377,060 mg

Open supply

open PO lines not yet received
PO Supplier Ordered Line value ETA Status
PO-552 ITS Nutriscience Sdn Bhd 2,000,000 mg 660.00 MYR 2026-04-25 Not received
Sum of open lines = "Expected" on Inventory ✓ 2,000,000 mg
Receiving PO-552 posts a po_receipt movement (new lot + moving-average recost) and clears the Expected line.

Project Gaia — static mockup in Filament v3 table idiom. No backend. Sample data: Katana tenant snapshot 2026-04-12, location 11, Balakong Jaya. Ledger rows illustrative (movement-level detail not captured) but reconciled to the real snapshot: closing balance 7,446,000 mg, committed 377,060 mg, expected 2,000,000 mg.

Stock movements — field manifest

FieldFilament componentTypeSourceFK target
id— (hidden PK)bigintstored: stock_movements.id
Variant— (page scope, not a column)FKstored: stock_movements.variant_idvariants.id
Factory / LocationSelectFilter (header location picker)FKstored: stock_movements.factory_id + location_idfactories.id / locations.id
Date / timeTextColumn::dateTime()->sortable() (default desc)timestampstored: stock_movements.moved_at
TypeTextColumn::badge() + SelectFilterenum po_receipt | mo_issue | mo_receipt | shipment | adjustment | transfer_in | transfer_out | rnd_issue | stocktakestored: stock_movements.type
DocumentTextColumn::url() (morphTo route) ->searchable(isIndividual)polymorphicstored: document_type + document_id (PO / MO / shipment / SA / ST / STK / TRL)morph: pos / mos / shipments / stock_adjustments / stock_transfers / stocktakes / rnd_trials
QtyTextColumn::numeric()->color(fn) green + / red −signed decimal + variant UoMstored: stock_movements.qty_delta
Balance afterTextColumn (computed in query window)decimalderived: running SUM(qty_delta) in moved_at order — never stored
Unit costTextColumn::numeric(decimalPlaces: 6)decimal(20,10) MYRstored: receipt actual cost; issues valued at moving average at moved_at
Value ±TextColumn::numeric()->color(fn)money MYRderived: qty_delta × unit_cost
Batch / lotTextColumn::searchable(isIndividual)->url() (batch-trace)FK, nullablestored: stock_movements.batch_id (split issues → one movement row per batch)batches.id
ByTextColumnFKstored: stock_movements.created_byusers.id
Summary stripStatsOverviewWidget (5 stats, Calculated = success color)derivedderived: Σ ledger / open PO lines / open MO requirements / variant_location.safety_stock
Open commitments / supplyRelationManager-style tables (MoRequirements, OpenPoLines)derivedderived: open mo_ingredients − issued; open po_lines − receivedmos / pos

Engine notes

  • This is the core engine table of Project Gaia. Every inventory number on every screen — In stock, Value, batch balances, Insights — is a SUM over stock_movements. No cached stock counters.
  • Balance and moving-average cost are derived by replaying the ledger in moved_at order; the "View balance at" date picker on Inventory simply replays to a date.
  • Expected / Committed are not movements — they are derived from open PO lines and open MO ingredient requirements (the two cards below the ledger). They become movements on receipt / issue.
  • Moving average recosts only on inbound rows (po_receipt, transfer_in, positive adjustment); all outbound rows are valued at the average prevailing at moved_at.
  • Stocktake posts the count variance as a movement (STK-58 anchors this window), keeping the ledger append-only and audit-safe (GMP).
  • Document is polymorphic (document_type + document_id) — one drill-down pattern links the ledger to every module.
  • Units rule: qty_delta is stored in the variant's base unit (mass → mg, volume → ml, count → pcs); display auto-scales (1,250,000 mg shows as 1.25 kg). Units FK → admin-locked units table; unit↔unit factors (kg→g→mg, L→ml) are hard-coded system knowledge, never data — staff never type units.
  • Buy actions raise Filament Action::requiresConfirmation modals that POST a draft purchase_orders row + po_lines; drafts surface on Buy's Draft tab.