modules/phyto_tc_batch_tracker/
Direct path in the repo โ all PHP, SQL, templates, and assets
Overview
Tracks batches of tissue-culture plants from flask to sale. Each batch gets an auto-generated code, generation label (G0, G1, G2โฆ), and dates for initiation, deflasking, and certification. A provenance card shows on the product page so buyers see the batch’s full history.
Version History
v1.0 โ First Build
Batch codes, generation labels, initiation/deflask/cert dates. Provenance card on product page. Admin batch list.
v1.1 โ Five Robustness Features (current)
- Inventory auto-decrement โ when an order ships, the batch’s unit count drops automatically; transitions to “Depleted” at zero.
- Contamination incident log โ tracks contamination events by type (bacterial, fungal, viral, pest) with severity and “Mark Resolved”.
- Mother batch lineage โ each batch can point to a parent; product page shows the full ancestral chain from original mother stock.
- Printable QR label โ 88 mm label with batch code, generation, dates, and lineage breadcrumb for tube stickers.
- Low-stock alert email โ configurable threshold triggers a single warning email per batch when units are running low.
Source Layout
| Path | Purpose |
|---|---|
phyto_tc_batch_tracker.php | Module entry + hooks |
classes/PhytoTcBatch.php | ORM model for batch records |
classes/PhytoContaminationLog.php | Contamination incident model |
controllers/admin/AdminPhytoTcBatchController.php | Batch management dashboard |
sql/install.sql | Creates batch + contamination tables |
views/templates/hook/product_tab.tpl | Front-end provenance card |
views/templates/admin/qr_label.tpl | Printable QR label layout |