*------------------------------------------------------------------ *PGM NAME: REL8.CONV.INV.COST *PURPOSE: TO INITIALIZE INVENTORY COST DATA *AUTHOR: BARKSDALE *CREATED: 01/20/95 *------------------------------------------------------------------ $INCLUDE BP.MASTER GEN.COM2 $INCLUDE BP.MASTER INV * OPEN 'INV.OLD' TO INV.OLD ELSE ABORT 201,'INV.OLD' OPEN 'INVENTORY' TO INV.NEW ELSE ABORT 201,'INVENTORY' OPEN 'INV.COST' TO INV.CST ELSE ABORT 201,'INV.COST' * WHSE="MTEK" EOF=0; NUM.READ=0; NUM.DONE=0; NUM.ADD=0 * SELECT INV.OLD * 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 to continue...": INPUT ANY STOP * 1000 * READ IREC FROM INV.NEW,ID THEN NUM.READ=NUM.READ+1 LOCATE(WHSE,IREC,INV$WAREHOUSE;FND) THEN PHYSICAL=IREC-IREC IF PHYSICAL > 0 THEN QTY=PHYSICAL READV COST FROM INV.OLD,ID,3 ELSE COST=0 COST=COST*100 CKEY=WHSE:"|":ID CREC="" CREC<1>=DATE() CREC<2>=QTY CREC<3>=COST CREC<4>="CONV" CREC<5>="CONV" WRITE CREC ON INV.CST,CKEY NUM.ADD=NUM.ADD+1 END END 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 CRT @(0,7):"NUMBER COST RECS ADDED: ":NUM.ADD RETURN