tldm-universe/CMS/BP.CNV/TLD.ORDER.CONV
2024-09-10 15:25:06 -04:00

88 lines
2.0 KiB
Plaintext
Executable File

* TLD.ORDER.CONV
* PURPOSE : Convert orders to new 9.0 layout
* DATE : 11/07/99
*
$INCLUDE BP.MASTER CMSD.IVD
$INCLUDE BP.MASTER GEN.COMMON
*
CALL MSD.HDG("CONVERSION OF OLD ORDERS TO VERSION 9.0")
*
OPEN "PM.ORDERS.OLD" TO PMO.OLD ELSE ABORT 201,"PM.ORDERS.OLD"
OPEN "PM.ORDERS" TO PM.ORDERS ELSE ABORT 201,"PM.ORDERS"
*
EOF=0 ; CNT=0 ; WRT=0
*
SELECT PMO.OLD
LOOP
READNEXT ORDER ELSE EOF=1
UNTIL EOF DO
IF REM(CNT,100) ELSE GOSUB 2000
CNT+=1
READ OLDREC FROM PMO.OLD,ORDER ELSE CONTINUE
READ NEWREC FROM PM.ORDERS,ORDER THEN
CRT @(0,22):CL:BEEP:"ORDER ":RV:ORDER:ERV:" EXISTS! <return> :":
DANS="" ; INPUT DANS
CONTINUE
END
NEWREC=""
FOR X=1 TO 12
NEWREC<X>=OLDREC<X>
NEXT X
ICNT=DCOUNT(OLDREC<IVD$ITEM>,VM)
*== fill in distribution point
FOR I=1 TO ICNT
NEWREC<13,I>="M"
NEXT I
*==
FOR Z=14 TO 40
NEWREC<Z>=OLDREC<Z>
NEXT Z
*== fair market value
NEWREC<41>="0"
*==
FOR Y=42 TO 54
NEWREC<Y>=OLDREC<Y>
NEXT Y
*== shipto name
IF TRIM(OLDREC<55>)="" ELSE
SHIPNAME=VM:VM:VM:VM:VM:OLDREC<55>
NEWREC<55>=SHIPNAME
END
*== now load shipto address
SHIPADDR=""
SHIPADDR<1,1>=TRIM(OLDREC<57>) ;*== attn1
SHIPADDR<1,2>=TRIM(OLDREC<58>) ;*== attn2
SHIPADDR<1,3>=TRIM(OLDREC<56>) ;*== street
SHIPADDR<1,4>=TRIM(OLDREC<59>) ;*== city
SHIPADDR<1,5>=TRIM(OLDREC<60>) ;*== state
SHIPADDR<1,6>=TRIM(OLDREC<61>) ;*== zip
SHIPADDR<1,7>=TRIM(OLDREC<62>) ;*== country
SHIPADDR<1,8>="" ;*== geo code
IF TRIM(NEWREC<55>)="" THEN
NEWREC<56>=""
END ELSE
NEWREC<56>=SHIPADDR
END
NEWREC<57>=""
NEWREC<58>=""
NEWREC<59>=""
NEWREC<60>=""
NEWREC<61>=""
NEWREC<62>=""
*==
FOR AA=63 TO 78
NEWREC<AA>=OLDREC<AA>
NEXT AA
*==
WRITE NEWREC ON PM.ORDERS,ORDER
WRT+=1
REPEAT
CRT @(0,22):CL:"PROCESS COMPLETE"
STOP
*
2000 *==
*
CRT @(5,10):"TOTAL RECORDS READ :":CNT
CRT @(5,11):"TOTAL RECORDS WRITTEN :":WRT
RETURN