Transfer Out To Branch
Transfer Out To Branch prepares outbound stock for another branch. The document is loaded from the transfer-out list, the user assigns lot/batch quantities for every item, and the app submits the completed outbound payload.
App Entry Points
| App | Target |
|---|---|
| Mobile | TransferOutList -> TransferOutDetail |
| POS Terminal | transferOut -> TransferOutDetailForm |
Operational Workflow
Batch And Quantity Rules
| Rule | Behavior |
|---|---|
| Batch picker | Loads lots with getProductLots({ itemCode, whsCode: line.warehouseCode, company }). |
| Duplicate batch | The same batchNumber cannot be selected twice on one item line. |
| Available quantity | If the selected lot reports quantity, entered batch quantity cannot exceed that lot balance. |
| Pending quantity | Entered quantity cannot exceed line.quantity - (line.cal - oldBatchQty). |
| Positive quantity | Batch quantity must be greater than 0. Line quantity must also be greater than 0. |
| Complete line | The line editor cannot close while cal !== quantity; submit also blocks incomplete lines. |
| Dates | Mobile applies shared batch date validation. Terminal currently validates quantity and lot constraints in this form; date fields are carried in payload. |
| No add-product path | Transfer Out works from existing outbound document lines; it does not create new received product lines like Transfer In. |
Submit Payload
Payload details:
numAtCardis generated from the sourcedocNumplus the current timestamp.branchCodeprefersbranch.whsGrpCode, falling back tobranch.BranchCode.userNameis built from first/last name, then username/userCode fallback.- Lines are sorted by
lineNumbefore submit. - Batch
admissionDateis sent under that key inYYYY-MM-DDTHH:mm:ssformat.
Field Dictionary And Provenance
The source document is loaded with GET /transfers-out?whGrpCode={selectedWhsGrpCode}. Mobile and POS Terminal rebuild and submit the following payload to POST /transfer-out.
Header
| Field | Meaning | Source / submit rule |
|---|---|---|
company | Company code | Source document API. |
docEntry, docNum | Source document ID and number | Source document API; docNum forms numAtCard. |
docDate, docDueDate, taxDate | Document, due, and tax dates | Source document API. |
cardCode, cardName, comments | Partner identity and comment | Source document API. |
toWhsCode, toWhsName | Destination warehouse | Source document API. |
numAtCard | Generated external reference | ${docNum}_${current timestamp DD-MM-YYYY HH:mm} at submit time. |
branchId | Original branch ID | Source document API. |
branchCode, branchName | Issuing branch warehouse group | Current selected whsGrpCode/whsGrpName, with BranchCode/BranchName fallback. |
userCode, userName | Issuing user | Current user, with document fallback. |
payloadBefore | Pre-edit JSON snapshot | Created in the detail screen. |
Lines and batches
| Field | Meaning | Source / submit rule |
|---|---|---|
lineNum, itemCode, itemDescription | Source line sequence and item identity | Source document API; lines are sorted by lineNum. |
quantity, weight | Issued quantity and weight | Line/batch-editor data, converted to numbers; batch total must close the line. |
uomCode, uomEntry, vatGroup, warehouseCode | Unit, tax, and source-warehouse data | Source line API; warehouseCode scopes lot lookup. |
batchNumbers[].batchNumber, quantity | Issued lot and quantity | User picks from product lots and enters quantity; cannot exceed available lot quantity. |
admissionDate | Lot receipt date | Mapped from the lot/editor date and submitted as YYYY-MM-DDTHH:mm:ss. |
manufacturingDate, expiryDate | Lot manufacture and expiry dates | Existing lot/editor values. |
Permissions And Guards
| Topic | Behavior |
|---|---|
| Terminal menu key | transferOut |
| deptCode menu set | -2, 1, 2, 3, 4, 7, 29, 21, 8, 9, 12, 22, 27, 28 |
| Branch rule | allowNonMainBranch = true; on a non-main selected warehouse the menu is accessible even when the user's deptCode is not in the stock menu set. |
| Full non-main access | Users with non-main warehouse full access can pass menu access checks across these stock menus. |
| Visibility context | List API is scoped by selected warehouse group (whGrpCode). |
Mobile vs POS Terminal
| Topic | Mobile | POS Terminal |
|---|---|---|
| Detail surface | Full-screen stack detail | HomeScreen right detail pane |
| Batch picker | SelectionModal after loading lots | Modal inside detail form |
| Submit result | navigation.replace('TransferOutList') | Refresh list and call onSaved |
| Core rules | Duplicate, available quantity, pending quantity, complete line | Same quantity and duplicate rules |
Developer Handoff Map
| Area | Code |
|---|---|
| Mobile detail | apps/mobile/src/screens/transferOutStack/transferOutDetailScreen/index.tsx |
| Mobile helpers | apps/mobile/src/screens/transferOutStack/helpers.ts |
| Terminal detail | apps/pos-terminal/src/screens/HomeScreen/TransferOutDetailForm.tsx |
| Mobile service | apps/mobile/src/services/transferOut.ts |
| Terminal service | apps/pos-terminal/src/services/transferOuts.ts |