Inventory Subroutines
Inventory management - bins, adjustments, transfers, quantities
Subroutine count: 6
Table of Contents
VB_ADJUST
Signature: SUBROUTINE ADJUST(BIN,BIN.PRODUCT,BINXREF,CO.STDS,CO.STDS.COST,ITEMCA,JOB.BIN,JOB.BINXREF,JOB.PRODUCT,LOCODE,LOT,LOTCOST,LOTCOSTXREF,LOTHIST,LOTHIST.AUDIT,LOTXREF,PRODUCT,CO,PART,MAT C,LCF,LOTNO,LOC,RDATE,BINNO,QTY,AQTY,CQTY,CLOTS,CQTYS,ADJCLOTS,ADJCQTYS,ADJOFFLOTS,ADJLOTS,ADJQTYS,ADJBINS,ADJBQTYS,CAJOBNO,INITS,CRTNO,PGM,BEL,CEL,EXPDATE,OWNER,CONSIGNFLAG,CWS,DUMMY5,CUSTDUMMY1,CUSTDUMMY2,CUSTDUMMY3,CUSTDUMMY4,CUSTDUMMY5)
Source: S:\LinuxShare\pro3prog\VBBASE\VB_ADJUST
| Property | Value |
|---|---|
| Status | [+] analyzed |
| Safety | [INT] internal |
| Pattern | Internal |
| Args | 53 |
| Description | Inventory lot adjustment subroutine. Updates LOT, BIN, LOTHIST, LOTCOST, and associated cross-reference files for both location-controlled and lot/serial-controlled parts. Handles material and cost quantity adjustments, bin tracking, LIFO/FIFO costing, consignment, and lot history maintenance. |
Arguments:
| Index | Name | Direction | Description |
|---|---|---|---|
| 0 | BIN | in | Pre-opened file handle: BIN |
| 1 | BIN.PRODUCT | in | Pre-opened file handle: BIN.PRODUCT |
| 2 | BINXREF | in | Pre-opened file handle: BINXREF |
| 3 | CO.STDS | in | Pre-opened file handle: CO.STDS |
| 4 | CO.STDS.COST | in | Pre-opened file handle: CO.STDS.COST |
| 5 | ITEMCA | in | Pre-opened file handle: ITEMCA |
| 6 | JOB.BIN | in | Pre-opened file handle: JOB.BIN |
| 7 | JOB.BINXREF | in | Pre-opened file handle: JOB.BINXREF |
| 8 | JOB.PRODUCT | in | Pre-opened file handle: JOB.PRODUCT |
| 9 | LOCODE | in | Pre-opened file handle: LOCODE |
| 10 | LOT | in | Pre-opened file handle: LOT |
| 11 | LOTCOST | in | Pre-opened file handle: LOTCOST |
| 12 | LOTCOSTXREF | in | Pre-opened file handle: LOTCOSTXREF |
| 13 | LOTHIST | in | Pre-opened file handle: LOTHIST |
| 14 | LOTHIST.AUDIT | in | Pre-opened file handle: LOTHIST.AUDIT |
| 15 | LOTXREF | in | Pre-opened file handle: LOTXREF |
| 16 | PRODUCT | in | Pre-opened file handle: PRODUCT |
| 17 | CO | in | Company number |
| 18 | PART | in | Part number to adjust |
| 19 | C | in | Cost element array (9 elements: material, MO-purch, labor, fixed OH, variable OH, outside, outside OH, MO-issue, ODC) |
| 20 | LCF | in | Lot control flag (1=location, 2=lot, 3=serial, 4=location with bins) |
| 21 | LOTNO | in | Lot number (for lot/serial control modes) |
| 22 | LOC | in | Inventory location code |
| 23 | RDATE | in | Receipt date for lot history |
| 24 | BINNO | in | Bin number |
| 25 | QTY | in | Material quantity to adjust |
| 26 | AQTY | in | Allocated quantity to adjust |
| 27 | CQTY | in | Cost quantity to adjust |
| 28 | CLOTS | in | Cost lot numbers (VM delimited) |
| 29 | CQTYS | in | Cost lot quantities (VM delimited) |
| 30 | ADJCLOTS | out | Adjusted cost lot numbers (returned) |
| 31 | ADJCQTYS | out | Adjusted cost lot quantities (returned) |
| 32 | ADJOFFLOTS | out | Adjusted offset lot numbers (returned) |
| 33 | ADJLOTS | out | Adjusted lot numbers (returned) |
| 34 | ADJQTYS | out | Adjusted lot quantities (returned) |
| 35 | ADJBINS | out | Adjusted bin numbers (returned) |
| 36 | ADJBQTYS | out | Adjusted bin quantities (returned) |
| 37 | CAJOBNO | in | Cost account job number |
| 38 | INITS | in | User initials |
| 39 | CRTNO | in | Terminal CRT number |
| 40 | PGM | in | Program name for audit trail |
| 41 | BEL | in | Terminal bell character |
| 42 | CEL | in | Clear end-of-line escape sequence |
| 43 | EXPDATE | in | Lot expiration date |
| 44 | OWNER | in | Consignment owner |
| 45 | CONSIGNFLAG | in | Consignment flag (Y/N) |
| 46 | CWS | in | Clear whole screen escape sequence |
| 47 | DUMMY5 | in | Reserved for future use |
| 48 | CUSTDUMMY1 | in | Customer dummy parameter 1 |
| 49 | CUSTDUMMY2 | in | Customer dummy parameter 2 |
| 50 | CUSTDUMMY3 | in | Customer dummy parameter 3 |
| 51 | CUSTDUMMY4 | in | Customer dummy parameter 4 |
| 52 | CUSTDUMMY5 | out | Customer dummy parameter 5 (reserved output) |
Tables Written: LOT, BIN, JOB.BIN, LOTHIST, LOTHIST.AUDIT, LOTCOST, LOTXREF, LOTCOSTXREF, LOCODE, CO.STDS
API Call Example:
POST /api/admin/subroutine/call
{
"name": "VB_ADJUST",
"args": {
"0": "",
"1": "",
"2": "",
"3": "",
"4": "",
"5": "",
"6": "",
"7": "",
"8": "",
"9": "",
"10": "",
"11": "",
"12": "",
"13": "",
"14": "",
"15": "",
"16": "",
"17": "",
"18": "",
"19": "",
"20": "",
"21": "",
"22": "",
"23": "",
"24": "",
"25": "",
"26": "",
"27": "",
"28": "",
"29": "",
"37": "",
"38": "",
"39": "",
"40": "",
"41": "",
"42": "",
"43": "",
"44": "",
"45": "",
"46": "",
"47": "",
"48": "",
"49": "",
"50": "",
"51": ""
}
}VB_BINS.REV1
Signature: SUBROUTINE VB_BINS.REV1(CO,PARTNO,LOCATION,BINDATA,MSG)
Source: S:\LinuxShare\pro3prog\VBBASE\VB_BINS.REV1
| Property | Value |
|---|---|
| Status | [+] analyzed |
| Safety | [SAFE] safe |
| Pattern | Inquiry |
| Args | 5 |
| Description | Returns the list of bins and their on-hand quantities for a given part number and location. The last-used bin (from PRODUCT field 12) is placed first in the returned list. |
Arguments:
| Index | Name | Direction | Description |
|---|---|---|---|
| 0 | CO | in | Company number |
| 1 | PARTNO | in | Part number to look up bins for |
| 2 | LOCATION | in | Inventory location code (e.g. ‘STOCK’) |
| 3 | BINDATA | out | Returned bin data: attribute 1 = VM-delimited bin numbers, attribute 2 = VM-delimited quantities |
| 4 | MSG | out | Error message if location not found |
API Call Example:
POST /api/admin/subroutine/call
{
"name": "VB_BINS.REV1",
"args": {
"0": "",
"1": "",
"2": ""
}
}VB_ITEMQTY.REV1
Signature: SUBROUTINE VB_ITEMQTY(PARTLIST,BSQL,RETURNDATA)
Source: S:\LinuxShare\pro3prog\VBBASE\VB_ITEMQTY.REV1
| Property | Value |
|---|---|
| Status | [+] analyzed |
| Safety | [SAFE] safe |
| Pattern | Inquiry |
| Args | 3 |
| Description | Executes a pre-built SQL/RetrieVe query (BSQL) against a part list to return quantity data. Forms the PARTLIST into select list 0, executes the query, and returns the resulting list as RETURNDATA. |
Arguments:
| Index | Name | Direction | Description |
|---|---|---|---|
| 0 | PARTLIST | in | List of part IDs to query (used as select list 0) |
| 1 | BSQL | in | RetrieVe/SQL command to execute against the part list |
| 2 | RETURNDATA | out | Result list from the executed query |
API Call Example:
POST /api/admin/subroutine/call
{
"name": "VB_ITEMQTY.REV1",
"args": {
"0": "",
"1": ""
}
}VB_ITEMQTY_DETAIL.REV1
Signature: SUBROUTINE VB_ITEMQTY_DETAIL.REV1(CO,PARTNO,JOBQTYREC)
Source: S:\LinuxShare\pro3prog\VBBASE\VB_ITEMQTY_DETAIL.REV1
| Property | Value |
|---|---|
| Status | [X] deprecated |
| Args | 3 |
| Superseded By | VB_ITEMQTY_DETAIL.REV2 |
Arguments:
| Index | Name | Direction | Description |
|---|---|---|---|
| 0 | CO | in | |
| 1 | PARTNO | in | |
| 2 | JOBQTYREC | out |
API Call Example:
POST /api/admin/subroutine/call
{
"name": "VB_ITEMQTY_DETAIL.REV1",
"args": {
"0": "",
"1": ""
}
}VB_ITEMQTY_DETAIL.REV2
Signature: SUBROUTINE VB_ITEMQTY_DETAIL.REV2(CO,PARTNO,JOBQTYREC)
Source: S:\LinuxShare\pro3prog\VBBASE\VB_ITEMQTY_DETAIL.REV2
| Property | Value |
|---|---|
| Status | [+] analyzed |
| Safety | [SAFE] safe |
| Pattern | Inquiry |
| Args | 3 |
| Description | Returns detailed on-hand and on-order quantity breakdown by job for a given part. Walks the lot/bin structure to build on-hand quantities per job/location/bin, and reads REQ/ALLOCXREF for on-order PO/WO data. Returns a structured JOBQTYREC with 8 attributes. |
Arguments:
| Index | Name | Direction | Description |
|---|---|---|---|
| 0 | CO | in | Company number |
| 1 | PARTNO | in | Part number to query |
| 2 | JOBQTYREC | out | Job quantity record: <1>=job numbers, <2>=allocated qtys, <3>=on-hand qtys, <4>=on-order qtys, <5>=PO/WO type, <6>=order numbers, <7>=dates, <8>=quantities (all VM-delimited by job, SVM-delimited by detail) |
API Call Example:
POST /api/admin/subroutine/call
{
"name": "VB_ITEMQTY_DETAIL.REV2",
"args": {
"0": "",
"1": ""
}
}VB_TRANSFER
Signature: SUBROUTINE TRANSFER(BIN,BIN.PRODUCT,BINXREF,CO.STDS,CO.STDS.COST,ITEMCA,JOB.BIN,JOB.BINXREF,JOB.PRODUCT,LOCODE,LOT,LOTHIST,LOTHIST.AUDIT,LOTXREF,CO,PART,MAT C,LOTNO,FLCD,TLCD,LFLAG,FBINFLAG,TBINFLAG,FBIN,TBIN,QTY,ADJLOTS,ADJQTYS,ADJCLOTS,ADJCQTYS,CAJOBNO,INITS,CRTNO,PGM,BEL,CEL)
Source: S:\LinuxShare\pro3prog\VBBASE\VB_TRANSFER
| Property | Value |
|---|---|
| Status | [+] analyzed |
| Safety | [INT] internal |
| Pattern | Internal |
| Args | 36 |
| Description | Inventory lot transfer subroutine. Transfers parts from one inventory location to another without changing overall on-hand quantity. Updates LOT, BIN, JOB.BIN, LOTHIST, LOTXREF, LOCODE, and bin cross-reference files for both location-controlled and lot/serial-controlled parts. |
Arguments:
| Index | Name | Direction | Description |
|---|---|---|---|
| 0 | BIN | in | Pre-opened file handle: BIN |
| 1 | BIN.PRODUCT | in | Pre-opened file handle: BIN.PRODUCT |
| 2 | BINXREF | in | Pre-opened file handle: BINXREF |
| 3 | CO.STDS | in | Pre-opened file handle: CO.STDS |
| 4 | CO.STDS.COST | in | Pre-opened file handle: CO.STDS.COST |
| 5 | ITEMCA | in | Pre-opened file handle: ITEMCA |
| 6 | JOB.BIN | in | Pre-opened file handle: JOB.BIN |
| 7 | JOB.BINXREF | in | Pre-opened file handle: JOB.BINXREF |
| 8 | JOB.PRODUCT | in | Pre-opened file handle: JOB.PRODUCT |
| 9 | LOCODE | in | Pre-opened file handle: LOCODE |
| 10 | LOT | in | Pre-opened file handle: LOT |
| 11 | LOTHIST | in | Pre-opened file handle: LOTHIST |
| 12 | LOTHIST.AUDIT | in | Pre-opened file handle: LOTHIST.AUDIT |
| 13 | LOTXREF | in | Pre-opened file handle: LOTXREF |
| 14 | CO | in | Company number |
| 15 | PART | in | Part number to transfer |
| 16 | C | in | Cost element array (9 elements) |
| 17 | LOTNO | in | Lot number (for lot/serial control) |
| 18 | FLCD | in | From location code |
| 19 | TLCD | in | To location code |
| 20 | LFLAG | in | Lot control flag (4=location control, else lot/serial) |
| 21 | FBINFLAG | in | From-bin flag (B=bin, J=job bin, blank=no bins) |
| 22 | TBINFLAG | in | To-bin flag (B=bin, J=job bin, blank=no bins) |
| 23 | FBIN | in | From bin number |
| 24 | TBIN | in | To bin number |
| 25 | QTY | in | Quantity to transfer |
| 26 | ADJLOTS | out | Adjusted lot numbers (returned) |
| 27 | ADJQTYS | out | Adjusted lot quantities (returned) |
| 28 | ADJCLOTS | out | Adjusted cost lot numbers (returned) |
| 29 | ADJCQTYS | out | Adjusted cost lot quantities (returned) |
| 30 | CAJOBNO | in | Cost account job number |
| 31 | INITS | in | User initials |
| 32 | CRTNO | in | Terminal CRT number |
| 33 | PGM | in | Program name for audit trail |
| 34 | BEL | in | Terminal bell character |
| 35 | CEL | out | Clear end-of-line escape sequence (unused output placeholder) |
Tables Written: LOT, BIN, JOB.BIN, LOTHIST, LOTHIST.AUDIT, LOTXREF, LOCODE, CO.STDS
API Call Example:
POST /api/admin/subroutine/call
{
"name": "VB_TRANSFER",
"args": {
"0": "",
"1": "",
"2": "",
"3": "",
"4": "",
"5": "",
"6": "",
"7": "",
"8": "",
"9": "",
"10": "",
"11": "",
"12": "",
"13": "",
"14": "",
"15": "",
"16": "",
"17": "",
"18": "",
"19": "",
"20": "",
"21": "",
"22": "",
"23": "",
"24": "",
"25": "",
"30": "",
"31": "",
"32": "",
"33": "",
"34": ""
}
}Last updated: 2026-02-05 11:29 PM