◆ DtoMes_Produzione.bpl

Production module

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.

30
Catalogued queries
8
Pascal units
12
Record types
3
Host modes
Architecture
MVP: Model — View — Presenter

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.

Model

UProdTypes
UProdQueryNames
UProd_QueryProvider

Presenter

UProd_DistintaPresenter
30 queries · ML capture

View

UFrProdDistinta
cxGrid · Barcode input

UProd_DistintaPresenter.pas
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;
Functional areas
From lot to pallet, all tracked

📋 Bill of materials

Loading the BOM from a stored procedure. Updating produced quantities, per-row notes, differences vs. the database. Grid with conditional coloring.

🔘 Barcode

Reading with a dedicated input. Automatic assignment to production. Counting unassigned barcodes. Sampling and serial number.

📦 Fulfilment + Pallets

Pallets with configurable capacity. Order fulfilment, confirmation, closing and pallet printing. Pallet history per lot.

🕑 Hours & Attendance

Hours logging per team and user. Production hours, format change, other times. Attendance per cost center with history.

🎯 Real-time status

Real-time calculation: available barcodes, pieces produced, to complete, current pallet. Record with 11 counters.

🤖 MemoryLens built in

Every action captured via TMLHelper. Anomalies flagged automatically (empty BOM, insufficient barcodes). Errors with exception class and stack.

Catalogued queries
30 queries in UProdQueryNames

Every query has a constant name. No hardcoded SQL strings in the Presenters. The QueryProvider centralizes data access.

AreaQueryPurpose
Lotprod_lotto_qLoad lot by ID
BOMprod_distinta_qBOM components per production
BOMprod_aggdist_qUpdate produced quantity
Barcodeprod_barcode_qBarcodes per lot/production
Fulfilmentprod_dett103_qOrder details per item
Palletprod_pallet_qActive pallet per team
Hoursprod_presteam_qTeam attendance per production

Showing 7 of 30. The full set includes history, serials, team notes and planning.

From plan to production

Production and Planning share ProdTools and the same Host.

Planning →Laboratory↑ Back to overview