e-Invoicing handled once a month, not per sale: retail sales are recorded here operationally (stock moves, price memory updates). At month end Gaia produces one consolidated summary → one consolidated e-invoice in QuickBooks/MyInvois, which LHDN permits for B2C. A customer who asks for a proper B2B e-invoice gets that single sale flipped to QBO individually.
7 sales this month · 3,846.50 MYR · July consolidation: open
Project Gaia — static mockup in Filament v3 idiom. No backend. Retail module; customer data shared with OEM underneath (channel-flagged), screens separated. Stock ships FEFO from FG with lots, same engine as OEM sales; the Double Root RM 5–8 band is the founder's real example.
Retail sales — field manifest
Field
Filament component
Type
Source
FK target
Sale # / lines
RetailSaleResource + Repeater
doc + lines
stored: retail_sales, retail_sale_lines (variant, qty, price, batch_id FEFO-picked); own RS- numbering series, separate from OEM SO series
variants / batches
Customer
Select (scoped) or Walk-in
FK nullable
stored: customers — ONE table shared with OEM, channel enum (oem / retail / both); this select is scoped to channel ∈ {retail, both}
customers
Payment
Badge + Action
enum Cash/Transfer/Unpaid
stored: retail_sales.payment_status, .due_date
—
e-Invoice
Badge, derived
enum
open → "{month} consolidated ✓" once the month-end consolidation run is posted; B2B flag exports that sale individually
SAME variant_prices + sale-history tables — retail and OEM share one memory and one floor
variant_prices
Engine notes
Shared-data doctrine: ONE customers table (channel enum oem / retail / both) and ONE variant_prices table — data shared, views scoped. What separates Retail from Sell: screens, numbering series (RS- vs SO-), CRM shape (book vs pipeline), e-invoicing path (consolidated vs per-order).
Retail sale posts a retail_sale stock movement (FEFO batch pick) — same ledger, so FG stock and batch trace stay truthful.
Month-end consolidation: one summary document per month per entity → single consolidated B2C e-invoice in QBO/MyInvois (LHDN-permitted). Gaia never talks to MyInvois directly; QBO stays the accounting system.
Floor enforcement is a policy, not a warning: below-floor lines cannot be confirmed by non-owner roles — identical in both channels.