Class SerialStockSync
java.lang.Object
org.bgerp.plugin.inventoru.sync1c.service.SerialStockSync
The stock of a serial tracked position on a store, reconciled per unit against 1C.
1C (series with balances per warehouse) reports such a position one row per serial number, so it
is the master not only of how many units stand on a store but of which. The import compares the
serial numbers 1C has on the store with the units counted there in ERP and proposes, for posting
in "Pending incoming": a unit to come (
ImportPending.ACTION_SERIAL_IN), a unit to leave
(ImportPending.ACTION_SERIAL_OUT), and what the part of the balance without serial numbers
must become (ImportPending.ACTION_UNCOVERED).
A unit 1C places on a store where the balance was waiting for its serial number is attached right
away, during the import: it changes no quantity, only says which unit the balance was — the first
load of a list of units would otherwise be hundreds of rows to click through.
Everything posted goes through movements and DeviceAccountingService, never by writing the
balance: units and balance stay in step, and a unit that cannot come is named with the reason.-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(ImportPending p, int userId, boolean acceptReturn) Posts a proposal, claiming it first.applyAll(List<ImportPending> list, int userId) Posts the proposals one by one: units coming first — they may attach to the unbacked balance before a correction takes it away — then units leaving, then the unbacked balance, then quantities.voidFills in what posting a proposal would do, or why it cannot — for the screen.voidreconcile(int instanceId, EngineerWarehouse ew, int storeId, int itemId, List<Api1cStock> rows) Reconciles one serial tracked position on the store against the 1C rows of it.
-
Constructor Details
-
SerialStockSync
-
-
Method Details
-
reconcile
public void reconcile(int instanceId, EngineerWarehouse ew, int storeId, int itemId, List<Api1cStock> rows) throws SQLException Reconciles one serial tracked position on the store against the 1C rows of it.- Parameters:
rows- the 1C rows of the position; empty when it is absent from the answer — then every unit of it on the store leaves- Throws:
SQLException
-
describe
Fills in what posting a proposal would do, or why it cannot — for the screen.- Throws:
SQLException
-
apply
public void apply(ImportPending p, int userId, boolean acceptReturn) throws SQLException, BGMessageException Posts a proposal, claiming it first. A refusal is thrown; the caller's transaction takes back whatever was written.- Parameters:
acceptReturn- a unit written off in a process that 1C shows back on the store is taken back — without it such a unit is refused- Throws:
SQLExceptionBGMessageException
-
applyAll
Posts the proposals one by one: units coming first — they may attach to the unbacked balance before a correction takes it away — then units leaving, then the unbacked balance, then quantities. A refused one is rolled back alone and named in the result; the rest goes on.- Throws:
SQLException
-