Full management of the production cycle: from the bill of materials to barcodes, from order fulfilment to hours logging. MVP pattern with the Presenter separated from the View, 30 catalogued queries, MemoryLens built in.
The Presenter has no VCL dependencies. The View doesn't access data. Communication happens through typed events: the Presenter is reusable with a future HTML View.
UProdTypes
UProdQueryNames
UProd_QueryProvider
UProd_DistintaPresenter
30 queries · ML capture
UFrProdDistinta
cxGrid · Barcode input
procedure TProdDistintaPresenter.AggiornaDistinta; begin FQueryProvider.ExecSQL( FQueryProvider.GetSQL(QRY_PROD_AGG_DIST), [LQta, LIdProd]); // MemoryLens: capture user action (graceful) TMLHelper.CaptureAction(ML_MODULE, 'AggiornaDistinta', Format('{"idprod":%d,"qta":%d}', [LIdProd, LQta])); if Assigned(FOnDistintaLoaded) then FOnDistintaLoaded(Self, FQryDistinta, LCount); end;
Loading the BOM from a stored procedure. Updating produced quantities, per-row notes, differences vs. the database. Grid with conditional coloring.
Reading with a dedicated input. Automatic assignment to production. Counting unassigned barcodes. Sampling and serial number.
Pallets with configurable capacity. Order fulfilment, confirmation, closing and pallet printing. Pallet history per lot.
Hours logging per team and user. Production hours, format change, other times. Attendance per cost center with history.
Real-time calculation: available barcodes, pieces produced, to complete, current pallet. Record with 11 counters.
Every action captured via TMLHelper. Anomalies flagged automatically (empty BOM, insufficient barcodes). Errors with exception class and stack.
Every query has a constant name. No hardcoded SQL strings in the Presenters. The QueryProvider centralizes data access.
| Area | Query | Purpose |
|---|---|---|
| Lot | prod_lotto_q | Load lot by ID |
| BOM | prod_distinta_q | BOM components per production |
| BOM | prod_aggdist_q | Update produced quantity |
| Barcode | prod_barcode_q | Barcodes per lot/production |
| Fulfilment | prod_dett103_q | Order details per item |
| Pallet | prod_pallet_q | Active pallet per team |
| Hours | prod_presteam_q | Team attendance per production |
Showing 7 of 30. The full set includes history, serials, team notes and planning.
Production and Planning share ProdTools and the same Host.