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
/
WORDERS.CMD
< prev
Wrap
OS/2 REXX Batch file
|
1979-12-31
|
6KB
|
226 lines
*WORDERS.PRG
*WRITE ORDERS PROGRAM
SET INTENSITY ON
RELEASE ALL
SET TALK OFF
ERASE
STORE DATE() TO DATET
STORE ' ' TO BLINK
STORE ' ' TO INVERT
STORE ' ' TO HI
DO WHILE T
@ 5,20 SAY INVERT+'WRITE ORDERS PROGRAM'
@ 6,50 SAY INVERT+' DATE '+DATET
@ 7,0 SAY '***************************************************************'
@ 8,0 SAY INVERT+' WRITE ORDERS AS RECEIVED FOR PACKING;
PRESS 1 '
@ 9,0 SAY HI+' WRITE UP GOODS COLLECTED;
PRESS 2 '
@ 10,0 SAY HI+INVERT+'WRITE UP CASH SALES;
PRESS 3 '
@ 11,0 SAY BLINK+' RETURN TO MAINMENU ;
PRESS R '
@ 12,0 SAY '**************************************************************'
WAIT TO WAIT
store !(wait) to wait
DO CASE
CASE WAIT='R'
RETURN
CASE WAIT='2'
STORE 'HOLDATA' TO FILE
CASE WAIT='3'
STORE 'DATATEMP' TO FILE
OTHERWISE
STORE 'DATAFILE' TO FILE
ENDCASE
DO WHILE T
****** DO FIND CUSTOMER ROUTINE*****
erase
STORE 0 TO X
@ 3,0 SAY INVERT+'WHAT IS THE NAME OF THE CUSTOMER FIRST PART;
ONLY ZERO (0) TO EXIT'
@ 4,0 say HI+'THEN PRESS RETURN OR ENTER'
ACCEPT TO CUST
STORE !(CUST) TO CUST
IF CUST='0'
RETURN
ENDIF
USE NAMELIST INDEX NAME
***********************
FIND &CUST
IF #=0
?? CHR(7),CHR(7),CHR(7)
LOOP
ENDIF
STORE (100-DISCOUNT)/50 TO DISCOUNTA
STORE DISCOUNT TO DIS
@ 5,0 SAY INVERT+NAME
@ 5,40 SAY INVERT+CITYPC
@ 7,0 SAY INVERT+'IS THIS CORRECT OR (N)OT'
WAIT TO CHECK1
STORE !(CHECK1) TO CHECK1
IF CHECK1='N'
LOOP
ENDIF
STORE ACCNUM TO ACCNUMA
STORE ' ' TO ORD:NUMA
STORE ' ' TO METH:SHIPA
STORE ' ' TO SALESTAX
@ 10,0 SAY INVERT+'PRESS RETURN OR ENTER AFTER ANSWERING EACH QUESTION'
@ 12,0 SAY 'CUSTOMER ORDER NUMBER IF ANY ' GET ORD:NUMA
@ 13,0 SAY 'SPECIFIC FREIGHT INSTRUCTIONS ' GET METH:SHIPA
@ 14,0 SAY 'SALES TAX EXEMPT "T"=TRUE <CR>IF NOT ';
GET SALESTAX PICT '!'
READ
************************set tax payable marker T=TAXPAYABLE ,F=NOT PAYABLE**
STORE T TO taxable
IF SALESTAX ='T'
STORE F TO taxable
endif
STORE TAXABLE TO TAXFLAG
ERASE
@ 12,0 SAY INVERT+'*********************SELECTING FILES FOR USE******;
******************'
SELECT PRIMARY
USE PRICELIS INDEX PRICECOD
SELECT SECONDARY
USE &FILE
STORE 1 TO X
ERASE
STORE ' ' TO CODEA
DO WHILE CODEA <> '0'
CLEAR GETS
STORE ' ' TO CODEA
STORE ' ' TO ORD:COMA
STORE 0001 TO QTY:ORDA
STORE ' ' TO CHEK
@ 25,0 SAY INVERT+' PRESS RETURN OR ENTER AFTER INSERTING PRODUCT CODE'
@ 1,0 SAY ' PRODUCT CODE EXACTLY AS IN THE PRICELIST OR 0 (ZERO) TO EXIT';
GET CODEA PICTURE '!!!!!!!!!'
@ 3,0
@ 2,0 SAY INVERT+'THIS IS ITEM NUMBER '+STR(X,3)
? CHR(07)
READ
IF TRIM(CODEA)='0'
ERASE
? INVERT+'**********************RETURNING TO MAIN MENU***************'
ELSE
IF TRIM(CODEA)=' '
LOOP
ENDIF
SELECT PRIMARY
FIND &CODEA
IF #=0
@ 5,0 SAY INVERT+'PRODUCT NOT FOUND TRY AGAIN'
WAIT
@ 5,0
@ 6,0
LOOP
ENDIF
@ 3,0 SAY INVERT+CODE
@ 3,12 SAY INVERT+ITEM
?? CHR(07)
STORE ' ' TO WAIT
@ 5,0 SAY ' IS THIS CORRECT <CR> OR (N)OT' GET WAIT PICT '!'
READ
@ 5,0
IF WAIT='N'
@ 3,0
LOOP
ENDIF
SET TALK OFF
STORE CODE TO CODEA
STORE F TO SPECIALA
STORE COST TO COSTA
STORE ITEM TO ITEMA
STORE TAX TO STAX
STORE 0 TO QTY:BACKOA
@ 9,0 SAY INVERT+' QUANTITY LEFT IN STOCK '+STR(STOCKED,5)
@ 10,0 SAY 'PRESS RETURN OR ENTER AFTER INSERTING REQUIRED DETAILS'
@ 11,0 SAY '****************************************************************'
@ 13,0 SAY 'QUANTITY ORDERED ' GET QTY:ORDA PICTURE '9999'
@ 14,0 SAY 'COMMENTS ON ORDERED ITEM 'GET ORD:COMA PICTURE '!!!!!!!!!!!!!;
!!!!!!!!!!!!!!!'
@ 15,0 SAY 'TO CHANGE PRESS (C)& RETURN, ELSE <CR>'GET CHEK PICTURE '!!'
@ 16,0 SAY 'TO ABORT THIS ENTRY PRESS "A"'
@ 17,0 SAY '***************************************************************'
READ
@ 8,0
@ 9,0
@ 13,29
@ 14,29
IF CHEK='A'
LOOP
ENDIF
IF CHEK ='C'
ERASE
@ 1,0 SAY INVERT+'************************CHANGE DATA ;
*******************************'
@ 2,0 SAY 'CODE' GET CODEA
@ 2,20 SAY 'QUANTITY ORDERED' GET QTY:ORDA
@ 3,0 SAY 'ITEM ' GET ITEMA
@ 3,38 SAY 'COMM' GET ORD:COMA
@ 4,0 SAY 'BASE PRICE '+str(costa,6,2)
STORE .00 TO CCOST
STORE COSTA*DISCOUNTA TO CCOST
@ 4,23 SAY 'CUSTOMERS PRICE' get ccost
@ 4,50 SAY 'DISCOUNT '
@ 4,60 SAY DIS
STORE TAXABLE TO TAXFLAG
@ 5,0 SAY 'TAX PAYABLE (T=TRUE)' GET TAXFLAG
@ 6,0 SAY 'TAX RATE ' GET STAX
@ 7,0 SAY 'QUANTITY BACK ORDERED' GET QTY:BACKOA
@ 8,0 SAY 'IS THIS A SPECIAL PRICE T=TRUE ' GET SPECIALA
@ 9,0 SAY '****************************************************************'
@ 15,0 SAY INVERT+'THE ABOVE DATA CAN NOW BE CHANGED MANUALLY;
AND ENTERED WITH A ;
RETURN '
READ
if speciala
store ccost to costa
endif
ERASE
ENDIF
*************************STOCK CONTROL *********************
REPLACE DATE:ORD WITH DATE()
REPLACE ORDERED WITH ORDERED+QTY:ORDA
REPLACE STOCKED WITH STOCKED-QTY:ORDA
SELECT SECONDARY
APPEND BLANK
REPLACE ACCNUM WITH ACCNUMA
REPLACE CODE WITH CODEA
REPLACE ITEM WITH ITEMA
REPLACE COST WITH COSTA
REPLACE TAX WITH T
IF .NOT. TAXFLAG .AND. SALESTAX='T'
REPLACE TAX WITH F
ENDIF
IF SALESTAX='T'
REPLACE TAX WITH F
ENDIF
REPLACE S:TAX WITH STAX
REPLACE QTY:ORD WITH QTY:ORDA
REPLACE ORD:COM WITH ORD:COMA
REPLACE ORD:NUM WITH ORD:NUMA
REPLACE DATE:ORD WITH DATE()
REPLACE METH:SHIP WITH METH:SHIPA
REPLACE QTY:BACKO WITH QTY:BACKOA
REPLACE SPECIAL WITH SPECIALA
IF QTY:BACKOA <> 0 .AND. .NOT. SPECIALA
REPLACE SPECIAL WITH T
ENDIF
STORE X+1 TO X
ENDIF
ENDDO
ENDDO
ENDDO
'
@ 12,0 SAY 'CUSTOMER ORDER NUMBER IF ANY ' GET ORD:NUMA
@ 13,0 SAY 'SPECIFIC FREIGHT INSTRUCTIONS ' GET METH:SHIPA
@ 14,0 SAY 'SALES TAX EXEMPT "T"=TRUE <CR>IF NOT ';
GET SALESTAX PICT '!'
READ
****