home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
MBUG
/
MBUG102.ARC
/
RITEBACK.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1979-12-31
|
6KB
|
253 lines
*RITEBACK.PRG
*A PROGRAM DESIGNED TO ALLOW BACKORDERS TO BE SEARCHED ,REWRITTEN ,CANCELLED;
*OR AMENDED
SET TALK OFF
RELEASE ALL
STORE 1 TO POINTER
DO WHILE T
ERASE
@ 2,0 SAY 'THIS PROGRAM ALLOWS THE CANCELLATION OR RE-WRITING OF BACKORDERS'
STORE '?' TO DEC
@ 3,0 SAY 'PRESS (CR) TO CONTINUE OR (R)ETURN' GET DEC PICT '!'
READ
IF DEC='R'
RETURN
ENDIF
ERASE
STORE 0 TO GROUP
@ 1,0 SAY 'SEARCH FOR SPECIFIC CUSTOMER PRESS 1 '
@ 2,0 SAY 'SEARCH FOR CUSTOMER & BRAND PRESS 2 '
@ 3,0 SAY 'SEARCH FOR BRAND ONLY PRESS 3 '
@ 4,0 SAY 'SEARCH FOR ITEM ONLY PRESS 4 '
@ 5,0 SAY 'SEARCH FOR ALL BACK ORDERS PRESS 5 ';
GET GROUP PICT '9'
@ 6,0 SAY 'WHICH DATABASE TO SEARCH (C)URRENT OR (P)REVIOUS';
GET DEC PICT '!'
READ
********************SELECTION OF DATABASE***************
IF DEC='C'
STORE 'DATAFILE' TO DATABASE
ELSE
STORE 'DATARCH' TO DATABASE
STORE 1 TO POINTER
ENDIF
STORE '?' TO DEC
*******************GETTING END OF FILE MARKER***************
USE &DATABASE
GO BOTTOM
STORE # TO END
GO TOP
DO WHILE T
IF POINTER = END
RETURN
ENDIF
GOTO POINTER
IF DEC='N' .OR. DEC='C' .OR. DEC='W' .OR. DEC=' '
CONTINUE
ELSE
**********************************
IF GROUP=1
ERASE
STORE T TO CHECK1
DO WHILE CHECK1
@ 2,0 SAY ' ENTER NAME OF CUSTOMER FOR WHICH BACK ORDERS ARE REQUIRED '
ACCEPT TO CUST
STORE !(CUST) TO CUST
USE NAMELIST INDEX NAME
FIND &CUST
IF #=0
? 'CUSTOMER NOT FOUND, TRY AGAIN '
LOOP
ENDIF
@ 5,0 SAY NAME
@ 5,40 SAY CITYPC
@ 7,0 SAY 'IS THIS THE CORRECT CUSTOMER <CR> OR (N)OT ? '
WAIT TO CHECK2
STORE !(CHECK2) TO CHECK2
IF CHECK2='N'
LOOP
ENDIF
STORE F TO CHECK1
STORE ACCNUM TO ACCNUMA
ERASE
ENDDO
USE &DATABASE
@ 12,0 SAY '***************SEARCHING DATABASE **************************'
LOCATE FOR ACCNUM=ACCNUMA .AND. SPECIAL
ENDIF
************************************
IF GROUP=2
ERASE
STORE T TO CHECK1
DO WHILE CHECK1
@ 2,0 SAY ' ENTER NAME OF CUSTOMER FOR WHICH BACK ORDERS ARE REQUIRED '
ACCEPT TO CUST
STORE !(CUST) TO CUST
USE NAMELIST INDEX NAME
FIND &CUST
IF #=0
? 'CUSTOMER NOT FOUND, TRY AGAIN '
LOOP
ENDIF
@ 5,0 SAY NAME
@ 5,40 SAY CITYPC
@ 7,0 SAY 'IS THIS THE CORRECT CUSTOMER <CR> OR (N)OT ? '
WAIT TO CHECK2
STORE !(CHECK2) TO CHECK2
IF CHECK2='N'
LOOP
ENDIF
STORE F TO CHECK1
STORE ACCNUM TO ACCNUMA
STORE NAME TO NAMEA
ERASE
ENDDO
USE &DATABASE
@ 1,0 SAY 'CUSTOMERS NAME '
@ 1,20 SAY NAMEA
@ 4,0 SAY 'WHAT IS THE BRAND TO BE SEARCHED FOR '
ACCEPT TO BRAND
USE &DATABASE
@ 12,0 SAY '**************************SEARCHING DATABASE********************'
LOCATE FOR ACCNUM=ACCNUMA .AND. ITEM=BRAND .AND. SPECIAL
ENDIF
******************
IF GROUP=3
ERASE
USE &DATABASE
@ 2,0 SAY 'WHAT IS BRAND TO SEARCH BACK ORDERS FOR '
ACCEPT TO BRAND
ERASE
@ 12,0 SAY '****************************SEARCHING**************************'
LOCATE FOR ITEM=BRAND .AND. SPECIAL
ENDIF
*********************
IF GROUP=4
ERASE
STORE T TO CHECK1
DO WHILE CHECK1
@ 2,0 SAY 'WHAT IS THE ITEM (CODE NUMBER ) TO BE SEARCHED FOR '
ACCEPT TO CODEA
USE PRICELIS INDEX PRICECOD
FIND &CODEA
@ 5,0 SAY CODE
@ 5,15 SAY ITEM
@ 7,0 SAY 'IS THIS CORRECT <CR> OR (N)OT? '
WAIT TO CHECK2
STORE !(CHECK2) TO CHECK2
IF CHECK2='N'
ERASE
LOOP
ENDIF
STORE F TO CHECK1
ENDDO
USE &DATABASE
? '*****************************SEARCHING DATABASE********************'
LOCATE FOR CODE=CODEA .AND. SPECIAL
ENDIF
**********************
IF GROUP=5
LOCATE FOR SPECIAL
ENDIF
*********************
ENDIF
*********************
STORE INVNUM TO INVNUMA
STORE DATE:ORD TO DATE:ORDA
STORE ACCNUM TO ACCNUMA
STORE CODE TO CODEA
STORE ITEM TO ITEMA
STORE COST TO COSTA
STORE TAX TO TAXA
STORE S:TAX TO S:TAXA
STORE ORD:COM TO ORD:COMA
STORE QTY:BACKO TO QTY
STORE METH:SHIP TO METH:SHIPA
STORE # TO POINTER
IF DEC='P' .OR. DEC='?'
ERASE
ENDIF
USE NAMELIST INDEX NAMENUM
FIND &ACCNUMA
STORE NAME TO NAMEA
STORE CITYPC TO CITYPCA
IF .NOT. EOF
@ 2,0 SAY 'NAME OF CUSTOMER'
@ 2,20 SAY NAMEA
@ 3,0 SAY 'ADDRESS'
@ 3,20 SAY CITYPCA
@ 4,0 SAY '+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++'
@ 5,0 SAY 'DATE ORDERED'
@ 5,20 SAY DATE:ORDA
@ 5,30 SAY 'INVOICE #'
@ 5,50 SAY INVNUMA
@ 6,0 SAY'-----------------------------------------------------------------'
@ 7,0 SAY 'QUANTITY BACK ORDERED 'GET QTY
@ 8,0 SAY 'ITEM ' GET ITEMA
@ 9,0 SAY 'ORDERED COMMENTS ' GET ORD:COMA
@ 10,0 SAY 'SHIPPED BY ' GET METH:SHIPA
@ 11,0 SAY'CHANGE THE ABOVE IF NECESSARY'
@ 13,0 SAY 'PRESS (?) TO: (C)ANCEL , (N)EXT (W)RITE (E)ND' GET DEC PICT '!'
@ 15,0 SAY 'IF W IS SELECTED, ORDER WILL BE WRITTEN FOR QUANTITY'
@ 16,0 SAY 'SHOWN AS BACKORDERED AND THE BACKORDER CANCELLED.'
STORE ' ' TO DEC
@ 17,0 SAY '================================================================'
READ
ENDIF
IF EOF
ERASE
RETURN
ENDIF
IF DEC='E'
RETURN
ENDIF
IF DEC='C'
USE &DATABASE
GOTO POINTER
REPLACE SPECIAL WITH F
CLEAR GETS
LOOP
ENDIF
IF DEC='W'
USE &DATABASE
GOTO POINTER
REPLACE SPECIAL WITH F
USE DATAFILE
APPEND BLANK
REPLACE DATE:ORD WITH DATE:ORDA, ACCNUM WITH ACCNUMA,CODE WITH CODEA,;
ITEM WITH ITEMA,COST WITH COSTA,TAX WITH TAXA, ORD:COM WITH ORD:COMA
REPLACE QTY:ORD WITH QTY ,METH:SHIP WITH METH:SHIPA , PACKED WITH F,;
INVOICED WITH F,SPECIAL WITH F ,S:TAX WITH S:TAXA , ORD:NUM WITH 'BACKORDR'
*************************STOCK CONTROL**************************
USE PRICELIS INDEX PRICECOD
FIND &CODEA
REPLACE ORDERED WITH ORDERED+QTY
REPLACE B:ORDERED WITH B:ORDERED-QTY
REPLACE DATE:ORD WITH DATE()
*****************************************************************
CLEAR GETS
USE &DATABASE
LOOP
ENDIF
IF DEC='N' .OR. DEC=' '
CLEAR GETS
USE &DATABASE
LOOP
ENDIF
ENDDO
LOOP
ENDDO
ERASE
ENDDO
USE &DATABASE
@ 12,0 SAY '***************SEARCHING DATABASE **************************'
LOCATE FOR ACCNUM=ACCNUMA .AND. SPECIAL
ENDIF
************************************
IF GROUP=2
ERASE
STORE T TO CHECK1
DO WHILE CHECK1
@ 2,0 SAY ' ENTER NAME OF C