60 lines
1.5 KiB
Plaintext
Executable File
60 lines
1.5 KiB
Plaintext
Executable File
*------------------------------------------------------------------
|
|
*PGM NAME: REL8.CONV.INV.USAGE
|
|
*PURPOSE: TO CONVERT INV USAGE ON OUTSTANDING ORDERS
|
|
*AUTHOR: BARKSDALE
|
|
*CREATED: 01/18/95
|
|
*------------------------------------------------------------------
|
|
$INCLUDE BP.MASTER GEN.COM2
|
|
$INCLUDE BP.MASTER CMSD.IVD
|
|
$INCLUDE BP.MASTER INV
|
|
*
|
|
OPEN 'PM.ORDERS' TO PMO ELSE ABORT 201,'PM.ORDERS'
|
|
OPEN 'INVENTORY' TO INV ELSE ABORT 201,'INVENTORY'
|
|
*
|
|
WHSE="MTEK"
|
|
EOF=0; NUM.READ=0; NUM.DONE=0
|
|
*
|
|
EXECUTE \GET-LIST UNSHIPPED\
|
|
LOOP
|
|
READNEXT ID ELSE EOF=1
|
|
UNTIL EOF DO
|
|
IF REM(NUM.READ,100) ELSE GOSUB 2000
|
|
GOSUB 1000
|
|
REPEAT
|
|
GOSUB 2000
|
|
CRT @(0,22):CL:"Press <return> to continue...":
|
|
INPUT ANY
|
|
STOP
|
|
*
|
|
1000 *
|
|
READ OREC FROM PMO,ID THEN
|
|
NUM.READ=NUM.READ+1
|
|
ICT=DCOUNT(OREC<IVD$ITEM>,VM)
|
|
FOR I=1 TO ICT
|
|
ITEM=OREC<IVD$ITEM,I>
|
|
QTY=OREC<IVD$QTY,I>
|
|
ISTAT=OREC<IVD$ITEM.STATUS,I>[1,1]
|
|
IF ISTAT="B" OR ISTAT="R" OR ISTAT="C" THEN
|
|
READ IREC FROM INV,ITEM THEN
|
|
LOCATE(WHSE,IREC,INV$WAREHOUSE;FND) THEN
|
|
IF ISTAT="B" THEN
|
|
IREC<INV$QTY.BACKORDERED,FND>=IREC<INV$QTY.BACKORDERED,FND>+QTY
|
|
END
|
|
IF ISTAT="R" OR ISTAT="C" THEN
|
|
IREC<INV$QTY.AVAILABLE,FND>=IREC<INV$QTY.AVAILABLE,FND>-QTY
|
|
END
|
|
END
|
|
WRITE IREC ON INV,ITEM
|
|
END
|
|
END
|
|
NEXT I
|
|
NUM.DONE=NUM.DONE+1
|
|
END
|
|
RETURN
|
|
*
|
|
2000 *
|
|
CRT CS
|
|
CRT @(0,5):"NUMBER RECORDS READ: ":NUM.READ
|
|
CRT @(0,6):"NUMBER RECORDS DONE: ":NUM.DONE
|
|
RETURN
|