Class SerialTrackingGuard

java.lang.Object
org.bgerp.plugin.inventoru.service.SerialTrackingGuard

public class SerialTrackingGuard extends Object
Whether the stock of positions can be accounted per unit: the reconciliation of balances against units, and the check that refuses turning serial tracking on where it would break accounting. A position with stock switched to serial tracking with no units yet is fine — the balance runs ahead of the units until their serial numbers are filled in. Two things are not: more units on a store than its balance (a unit counted twice), and an active reserve without a serial number — the 1C export writes off exactly the unit its reserve names, and such a reserve names none, so the write-off of that process would fail. Tracking is inherited down the type hierarchy, and a type change reaches the item type cache only after the transaction commits (the cache reads with a connection of its own), so what is tracked is computed here from the types as the caller's connection sees them.