109 lines
2.7 KiB
Plaintext
109 lines
2.7 KiB
Plaintext
|
*------------------------------------------------------------------
|
||
|
*PGM NAME: REL8.CONV.INV
|
||
|
*PURPOSE: TO CONVERT INVENTORY FROM REL8 TO NEW REL8
|
||
|
*AUTHOR: BARKSDALE
|
||
|
*CREATED: 01/17/95
|
||
|
*------------------------------------------------------------------
|
||
|
$INCLUDE BP.MASTER GEN.COM2
|
||
|
$INCLUDE BP.MASTER INV
|
||
|
*
|
||
|
OPEN 'INV.OLD' TO INV.OLD ELSE ABORT 201,'GRACE.INV'
|
||
|
OPEN 'INVENTORY' TO INV.NEW ELSE ABORT 201,'INVENTORY'
|
||
|
*
|
||
|
EOF=0; NUM.READ=0; NUM.DONE=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 <return> to continue...":
|
||
|
INPUT ANY
|
||
|
STOP
|
||
|
*
|
||
|
1000 *
|
||
|
READ OLDREC FROM INV.OLD,ID THEN
|
||
|
NUM.READ=NUM.READ+1
|
||
|
SKIPFLAG=0
|
||
|
NEWREC=""
|
||
|
STATUS=OLDREC<11>
|
||
|
IF STATUS="N" THEN STATUS="A"
|
||
|
NEWREC<INV$STATUS.CODE>=STATUS
|
||
|
GROUP=OLDREC<9>
|
||
|
BEGIN CASE
|
||
|
CASE GROUP="CO"; GROUP="SP"
|
||
|
END CASE
|
||
|
TYPE=OLDREC<10>
|
||
|
BEGIN CASE
|
||
|
CASE TYPE="MS"; TYPE="X"
|
||
|
CASE TYPE="DN"; SKIPFLAG=1
|
||
|
END CASE
|
||
|
NEWREC<INV$GROUP.CODE>=GROUP
|
||
|
NEWREC<INV$TYPE.CODE>=TYPE
|
||
|
NEWREC<INV$ORDER.CODE>=OLDREC<12>
|
||
|
NEWREC<INV$PACKING.CODE>=OLDREC<40>
|
||
|
IF OLDREC<46>="" THEN
|
||
|
KEYITM="N"
|
||
|
END ELSE
|
||
|
KEYITM=OLDREC<46>
|
||
|
END
|
||
|
NEWREC<INV$KEY.ITEM>=KEYITM
|
||
|
IF OLDREC<26>#"" THEN
|
||
|
ASSEM=OLDREC<26>
|
||
|
END ELSE
|
||
|
ASSEM="N"
|
||
|
END
|
||
|
NEWREC<INV$ASSEMBLED>=ASSEM
|
||
|
NEWREC<INV$DESCRIPTION>=OLDREC<5>
|
||
|
NEWREC<INV$AUTHOR>=""
|
||
|
IF OLDREC<43>="" THEN
|
||
|
MEAS="EA"
|
||
|
END ELSE
|
||
|
MEAS=OLDREC<43>
|
||
|
END
|
||
|
NEWREC<INV$UNIT.MEASURE>=MEAS
|
||
|
NEWREC<INV$UNIT.WEIGHT>=OLDREC<4>
|
||
|
NEWREC<INV$UNIT.COST>=""
|
||
|
NEWREC<INV$DISTRIBUTION.CHANNEL,1>="MAIL"
|
||
|
NEWREC<INV$CHANNEL.PRICE,1>=OLDREC<2>
|
||
|
NEWREC<INV$CHANNEL.SHIPPING,1>=0
|
||
|
NEWREC<INV$CHANNEL.ROYALTY,1>=0
|
||
|
NEWREC<INV$DISTRIBUTION.CHANNEL,2>="PHONE"
|
||
|
NEWREC<INV$CHANNEL.PRICE,2>=OLDREC<2>
|
||
|
NEWREC<INV$CHANNEL.SHIPPING,2>=0
|
||
|
NEWREC<INV$CHANNEL.ROYALTY,2>=0
|
||
|
NEWREC<INV$COMPONENT.ITEMS>=OLDREC<27>
|
||
|
NEWREC<INV$COMPONENT.QTY>=OLDREC<28>
|
||
|
NEWREC<INV$CASE.COUNT>=OLDREC<15>
|
||
|
NEWREC<INV$DATE.OFFERED>=OLDREC<44>
|
||
|
NEWREC<INV$REQ.DONATION>=OLDREC<45>
|
||
|
NEWREC<INV$EVENT>=OLDREC<47>
|
||
|
NEWREC<INV$SUBSTITUTE>=OLDREC<17>
|
||
|
NEWREC<INV$ALTERNATE.ID1>=OLDREC<8>
|
||
|
NEWREC<INV$WAREHOUSE>="MTEK"
|
||
|
NEWREC<INV$QTY.INCREASES>=0
|
||
|
NEWREC<INV$QTY.REDUCTIONS>=0
|
||
|
NEWREC<INV$QTY.AVAILABLE>=0
|
||
|
NEWREC<INV$QTY.BACKORDERED>=0
|
||
|
NEWREC<INV$QTY.ON.ORDER>=0
|
||
|
NEWREC<INV$ACTIVITY.YEARS>=""
|
||
|
NEWREC<INV$LEAD.TIME>="30"
|
||
|
NEWREC<INV$REORDER.POINT>=OLDREC<18>
|
||
|
NEWREC<INV$SAFETY.STOCK>=OLDREC<19>
|
||
|
NEWREC<INV$PRIMARY.LOCATION>=OLDREC<14>
|
||
|
NEWREC<INV$ALTERNATE.LOCATION1>=OLDREC<13>
|
||
|
IF NOT(SKIPFLAG) THEN WRITE NEWREC ON INV.NEW,ID
|
||
|
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
|