Logistics Reference Data (LOG)

The log submodule of com owns three orthogonal logistics building blocks: units of measure, terms of delivery, and number series. Other modules look up Uom rows for line items, attach TermsOfDelivery to sales/purchase agreements, and call the number-series writer to allocate the next free document code (purchase orders, invoices, …​). It depends on sys.loc for the unit-system reference type.

Concepts

Unit of Measure (UoM)

A registered unit code used on quantities throughout the ERP. Each UoM is classified as an SI quantity, a piece count, or a dimensionless figure, and resolves to one of the parsing rules in sys.uom.

Terms of Delivery

A delivery-policy code (such as EXW, FOB, CIF) tied to a transport mode and a delivery-location classification. The exWorks flag highlights agreements where the buyer collects from the supplier’s premises.

Number Series

A configurable counter used to allocate the next free business code for a document type. Each series has a prefix, a fixed numeric length (zero-padded), and a firstFreeNumber that increments on every allocation.

Default UoM Codes

A set of constant unit codes (kg, lb, mm, cm, m, in, m2, sqf, pcs) other modules use as their default unit when no entity-specific value is configured.

Entities

LOG entities

Unit of Measure (Uom)

A registered unit. The interpretation rules for the unit code (prefix, exponent, conversion factor) live in sys.uom; this entity is the lookup row referenced from sales/purchase/inventory lines.

FieldDescription

code

Business key (a UomCode).

uomType

Classification of the unit — see UoM Types below.

description

Human-readable name.

UoM Types (UomType)

CodeNameMeaning

S

SI Quantity

A unit that maps to one of the SI base units (mass, length, …​).

P

Pieces

Counted units (pcs, ea).

D

Dimensionless

Unitless quantities (e.g. ratios, percentages).

Terms of Delivery (TermsOfDelivery)

A named delivery-policy code (the Incoterms-style classification used on agreements).

FieldDescription

code

Business key (up to 3 characters).

description

Human-readable name.

transportMode

Optional transport mode — see Transport Modes below.

termsOfDeliveryLocation

Where the delivery responsibility transfers — see Delivery Locations below.

exWorks

Whether the terms are ex-works (buyer collects). Default false.

Transport Modes (TransportMode)

CodeNameNotes

A

Air

I

Rail

R

Road

S

Sea

Delivery Locations (TermsOfDeliveryLocation)

CodeNameUsed by

PLDY

Place of delivery

EXW, FCA

PLDN

Place of destination

CPT, CIP, DPU, DAP, DDP

POST

Port of shipment

FAS, FOB

PODN

Port of destination

CFR, CIF

Number Series (NumberSeries)

A configurable counter used to allocate the next free business code for a document type.

FieldDescription

code

Business key (up to 6 characters).

description

Human-readable name.

prefix

Static prefix prepended to every allocated code.

length

Fixed numeric length; the allocated number is zero-padded to this length.

firstFreeNumber

The next value to allocate. Default 1. Operationally maintained.

Functionality

Mandatory unit lookup

COM_LOG_QueryApi.getUom looks up a Uom by its code and raises a business exception when the code does not exist. Used wherever a missing unit must fail loudly. findUomByCode is the optional variant.

Mandatory terms-of-delivery lookup

TermsOfDeliveryReaderService exposes both an optional and a mandatory lookup of TermsOfDelivery by code. The mandatory variant raises a business exception when the code does not exist. A second helper, findOneByExWorks, returns a single TermsOfDelivery row matching a given ex-works flag — used by callers that want a representative ex-works terms code without hard-coding one.

Number-series allocation

NumberSeriesWriterService.createFirstFreeCode returns the next free business code for a number series. The series row is refreshed from the database first to avoid using a stale firstFreeNumber, the next number is composed (prefix + zero-padded number), firstFreeNumber is incremented, and the change is flushed. Callers receive the new code as a string.

Default UoM codes

COM_LOG_Constant exposes the canonical unit codes used as defaults across the system:

ConstantCodeUsage

Uom_KG

kg

Default mass unit (metric).

Uom_LB

lb

Default mass unit (imperial).

Uom_MM

mm

Length in millimetres.

Uom_CM

cm

Length in centimetres.

Uom_M

m

Length in metres.

Uom_IN

in

Length in inches.

Uom_M2

m2

Surface in square metres.

Uom_SQF

sqf

Surface in square feet.

Uom_PCS

pcs

Pieces.

Public API

COM_LOG_QueryApi

Read-side facade.

MethodDescription

getUom(HasTrace, String) / getUom(HasTrace, UomCode)

Mandatory UoM lookup; raises a business exception if not found.

findUomByCode(UomCode)

Optional UoM lookup; null when not found.

findTermsOfDeliveryByCode(Code3)

Optional terms-of-delivery lookup.

findTermsOfDeliveryByCodeMandatory(HasTrace, Code3)

Mandatory terms-of-delivery lookup.

findOneTermsOfDeliveryByExWorks(GBoolean)

A single terms-of-delivery row matching the ex-works flag, or null.

COM_LOG_CommandApi

Write-side facade.

MethodDescription

createFirstFreeCode(NumberSeries)

Allocates the next free code on the series and increments firstFreeNumber.

ViewModel actions

The submodule defines view models for Uom, TermsOfDelivery, and NumberSeries but does not declare any custom UI actions.