Skip to main content

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

AppTarget
MobileTransferOutList -> TransferOutDetail
POS TerminaltransferOut -> TransferOutDetailForm

Operational Workflow

Batch And Quantity Rules

RuleBehavior
Batch pickerLoads lots with getProductLots({ itemCode, whsCode: line.warehouseCode, company }).
Duplicate batchThe same batchNumber cannot be selected twice on one item line.
Available quantityIf the selected lot reports quantity, entered batch quantity cannot exceed that lot balance.
Pending quantityEntered quantity cannot exceed line.quantity - (line.cal - oldBatchQty).
Positive quantityBatch quantity must be greater than 0. Line quantity must also be greater than 0.
Complete lineThe line editor cannot close while cal !== quantity; submit also blocks incomplete lines.
DatesMobile applies shared batch date validation. Terminal currently validates quantity and lot constraints in this form; date fields are carried in payload.
No add-product pathTransfer Out works from existing outbound document lines; it does not create new received product lines like Transfer In.

Submit Payload

Payload details:

  • numAtCard is generated from the source docNum plus the current timestamp.
  • branchCode prefers branch.whsGrpCode, falling back to branch.BranchCode.
  • userName is built from first/last name, then username/userCode fallback.
  • Lines are sorted by lineNum before submit.
  • Batch admissionDate is sent under that key in YYYY-MM-DDTHH:mm:ss format.

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.

FieldMeaningSource / submit rule
companyCompany codeSource document API.
docEntry, docNumSource document ID and numberSource document API; docNum forms numAtCard.
docDate, docDueDate, taxDateDocument, due, and tax datesSource document API.
cardCode, cardName, commentsPartner identity and commentSource document API.
toWhsCode, toWhsNameDestination warehouseSource document API.
numAtCardGenerated external reference${docNum}_${current timestamp DD-MM-YYYY HH:mm} at submit time.
branchIdOriginal branch IDSource document API.
branchCode, branchNameIssuing branch warehouse groupCurrent selected whsGrpCode/whsGrpName, with BranchCode/BranchName fallback.
userCode, userNameIssuing userCurrent user, with document fallback.
payloadBeforePre-edit JSON snapshotCreated in the detail screen.

Lines and batches

FieldMeaningSource / submit rule
lineNum, itemCode, itemDescriptionSource line sequence and item identitySource document API; lines are sorted by lineNum.
quantity, weightIssued quantity and weightLine/batch-editor data, converted to numbers; batch total must close the line.
uomCode, uomEntry, vatGroup, warehouseCodeUnit, tax, and source-warehouse dataSource line API; warehouseCode scopes lot lookup.
batchNumbers[].batchNumber, quantityIssued lot and quantityUser picks from product lots and enters quantity; cannot exceed available lot quantity.
admissionDateLot receipt dateMapped from the lot/editor date and submitted as YYYY-MM-DDTHH:mm:ss.
manufacturingDate, expiryDateLot manufacture and expiry datesExisting lot/editor values.

Permissions And Guards

TopicBehavior
Terminal menu keytransferOut
deptCode menu set-2, 1, 2, 3, 4, 7, 29, 21, 8, 9, 12, 22, 27, 28
Branch ruleallowNonMainBranch = 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 accessUsers with non-main warehouse full access can pass menu access checks across these stock menus.
Visibility contextList API is scoped by selected warehouse group (whGrpCode).

Mobile vs POS Terminal

TopicMobilePOS Terminal
Detail surfaceFull-screen stack detailHomeScreen right detail pane
Batch pickerSelectionModal after loading lotsModal inside detail form
Submit resultnavigation.replace('TransferOutList')Refresh list and call onSaved
Core rulesDuplicate, available quantity, pending quantity, complete lineSame quantity and duplicate rules

Developer Handoff Map

AreaCode
Mobile detailapps/mobile/src/screens/transferOutStack/transferOutDetailScreen/index.tsx
Mobile helpersapps/mobile/src/screens/transferOutStack/helpers.ts
Terminal detailapps/pos-terminal/src/screens/HomeScreen/TransferOutDetailForm.tsx
Mobile serviceapps/mobile/src/services/transferOut.ts
Terminal serviceapps/pos-terminal/src/services/transferOuts.ts