Skip to content

Instantly share code, notes, and snippets.

@samthor

samthor/HIST.PRG Secret

Created October 12, 2020 12:04
Show Gist options
  • Save samthor/10a52a7253f366470190c8f79a04f660 to your computer and use it in GitHub Desktop.
Save samthor/10a52a7253f366470190c8f79a04f660 to your computer and use it in GitHub Desktop.
* POSHIST
PUBLIC ANY,TOTCOST
HYR=C1
SHIST='SALEHIST'
BMVA=' '
DO WHILE .T.
INVNO=0
DTE=DATE()
NME=SPACE(30)
PRT=' '
GO TOP
CHOICE=C1
CALL FADE
@C10,30 SAY '��������������������������������Ŀ'
@C11,30 SAY '� �'
@C12,30 SAY '� �'
@C13,30 SAY '� �'
@C14,30 SAY '� �'
@C15,30 SAY '� �'
@C16,30 SAY '� �'
@C17,30 SAY '� �'
@C18,30 SAY '� �'
@C19,30 SAY '��������������������������������Ĵ'
@C20,30 SAY '� �'
@C21,30 SAY '����������������������������������'
@C11,32 PROMPT '1> Daily Sales '
@C12,32 PROMPT '2> Browse Invoices '
@C13,32 PROMPT '3> Invoice Details '
@C14,32 PROMPT '4> Print Invoices '
@C15,32 PROMPT '5> Print Summary '
@C16,32 PROMPT '6> List Purchasers '
@C17,32 PROMPT '7> Sales Totals '
@C18,32 PROMPT '8> Select Year - Now'
@C20,32 PROMPT 'Q> Quit to Sales '
USE POSEQUIP
HSTYR=YR0+C1-HYR
YRNOW=LTRIM(STR(HSTYR))+'/'+LTRIM(STR(HSTYR+C1))
USE
@C18,53 SAY YRNOW
MENU TO CHOICE
IF CHOICE>C8
CHOICE=C0
ENDIF
SAVE SCREEN TO SCRN2
DO CASE
CASE CHOICE=C1
IF UPPER(CMPNY1)#'COUNTER' .AND. UPPER(CMPNY1)#'MANAGEMENT' .AND.UPPER(CMPNY1)#'OFFICE'
SAVE SCREEN TO SCRNWARN
YORN=YA
CALL FADE
@C15,C10 SAY WARN1
@C16,C10 SAY WARN2
@C17,C10 SAY WARN3
@C18,C10 SAY WARN4
@C19,C10 SAY WARN5
@C16,32 SAY 'an office/counter system function.'
@C18,43 GET YORN PICTURE '!'
READ
RESTORE SCREEN FROM SCRNWARN
IF YORN#YA
LOOP
ENDIF
ENDIF
CALL FADE
PICK=C0
@C6 ,53 SAY '�������������������������Ŀ'
@C7 ,53 SAY '� �'
@C8 ,53 SAY '� �'
@C9 ,53 SAY '� �'
@C10,53 SAY '� �'
@C11,53 SAY '� �'
@C12,53 SAY '� �'
@C13,53 SAY '� �'
@C14,53 SAY '� �'
@C15,53 SAY '�������������������������Ĵ'
@C16,53 SAY '� �'
@C17,53 SAY '���������������������������'
@C7 ,55 PROMPT '1> Current Day '
@C8 ,55 PROMPT '2> Display Summary '
@C9 ,55 PROMPT '3> Display Details '
@C10,55 PROMPT '4> Display Cheques '
@C11,55 PROMPT '5> Daily Banking Report'
@C12,55 PROMPT '6> Daily Sales Summary '
@C13,55 PROMPT '7> Royalty Report '
@C14,55 PROMPT '8> Sales by Staff '
@C16,55 PROMPT 'Q> Quit to History '
SAVE SCREEN TO SCRN3
MENU TO PICK
IF PICK>C8
PICK=C0
ENDIF
DO CASE
CASE PICK=C1
IF UPPER(CMPNY1)#'COUNTER' .AND. UPPER(CMPNY1)#'MANAGEMENT'
SAVE SCREEN TO SCRNWARN
YORN=YA
CALL FADE
@C15,C10 SAY WARN1
@C16,C10 SAY WARN2
@C17,C10 SAY WARN3
@C18,C10 SAY WARN4
@C19,C10 SAY WARN5
@C18,43 GET YORN PICTURE '!'
READ
RESTORE SCREEN FROM SCRNWARN
IF YORN#YA
RESTORE SCREEN FROM SCRN2
LOOP
ENDIF
ENDIF
USE SALES
COUNT TO DAYCOUNT
@C13,C0 SAY '�����������������������������������������������������������������������Ŀ'
@C14,C0 SAY '� Since EOD Since banking �'
@C15,C0 SAY '� ��������� ������������� �'
@C16,C0 SAY '� No. of sales: Cash: �'
@C17,C0 SAY '� Cheque: �'
@C18,C0 SAY '� Credit Card: �'
@C19,C0 SAY '� Total Billed: TOTAL: �'
@C20,C0 SAY '�������������������������������������������������������������������������'
@C16,16 SAY DAYCOUNT
SUM PTYPECASH TO DAYCASH
@C16,40 SAY DAYCASH
SUM PTYPECHEQ TO DAYCHEQ
@C17,40 SAY DAYCHEQ
SUM PTYPECARD TO DAYCARD
@C18,40 SAY DAYCARD
DAYTOTAL=DAYCASH+DAYCHEQ+DAYCARD
@C19,40 SAY DAYTOTAL
SUM AMOUNT TO DAYBILL
@C19,C16 SAY DAYBILL PICTURE '999999.99'
USE CHEQUES
GO C4
BNKCASH=AMOUNT
@C16,60 SAY BNKCASH PICTURE '999999.99'
SUM AMOUNT TO BNKCHEQ FOR RECNO()>C4 .AND. LEN(TRIM(LISTED))=C0
@C17,60 SAY BNKCHEQ PICTURE '999999.99'
BNKCRED=C0
GO C2
BNKCRED=AMOUNT
GO C3
BNKCRED=BNKCRED+AMOUNT
@C18,60 SAY BNKCRED PICTURE '999999.99'
BNKTOTAL=BNKCASH+BNKCRED+BNKCHEQ
@C19,60 SAY BNKTOTAL PICTURE '999999.99'
WAIT
USE
CASE PICK=C2
USE YTDTOTAL
DTE1=DATE()-1
@C20,C20 SAY 'Start date: (dd/mm/yy)' GET DTE1
READ
LOCATE FOR DAY>=DTE1-15
CLEAR
@C22,C0 SAY '��������������������������������������������������������������������������������'
@C23,C20 SAY 'Press Esc to quit '
HELPNO=C2
DECLARE FIELD[18]
FIELD[1]='DAY'
FIELD[2]='DAYTOTGROS-DAYTOTTAX'
FIELD[3]='DAYTOTTAX'
FIELD[4]='DAYTOTGROS'
FIELD[5]='DAYNETTCUM'
FIELD[6]='DAYGROSSCU'
FIELD[7]='DAYCOST'
FIELD[8]='DAYTOTNETT-DAYCOST'
FIELD[9]='ROUND(((DAYTOTGROS-DAYTOTTAX-DAYCOST)/(DAYTOTGROS-DAYTOTTAX+0.01))*100,1)'
FIELD[10]='ROUND((DAYGROSSCU*100)/((DAYTARGET)*DAYCOUNT),1)'
FIELD[11]='DAYTOT0'
FIELD[12]='DAYTOT1'
FIELD[13]='DAYTOT2'
FIELD[14]='DAYTOT3'
FIELD[15]='DAYCA'
FIELD[16]='DAYCH'
FIELD[17]='DAYCR'
FIELD[18]='DAYNO'
DECLARE COLHEAD[18]
COLHEAD[1]='Date'
COLHEAD[2]='Net'
COLHEAD[3]='Tax'
COLHEAD[4]='Gross'
COLHEAD[5]='Cum. Net'
COLHEAD[6]='Cum. Gross'
COLHEAD[7]='Cost'
COLHEAD[8]='Margin $'
COLHEAD[9]='Margin %'
COLHEAD[10]='% Target'
COLHEAD[11]='Group 1'
COLHEAD[12]='Group 2'
COLHEAD[13]='Group 3'
COLHEAD[14]='Group 4'
COLHEAD[15]='Cash'
COLHEAD[16]='Cheque'
COLHEAD[17]='Cr.Card'
COLHEAD[18]='# Sales'
DBEDIT(C0,C0,C21,79,FIELD,0,0,COLHEAD)
@C22,C0 CLEAR
@C23,C25 SAY XPICK
USE
CASE PICK=C3
USE YTDTOTAL
DTE=DATE()
@C22,30 SAY 'Date: (dd/mm/yy)' GET DTE
READ
SUM DAYCOST TO TOTCOST FOR MONTH(DAY)=MONTH(DTE)
SET SOFTSEEK ON
LOCATE FOR DAY>=DTE
SET SOFTSEEK OFF
ANY=' '
DO WHILE .T.
IF EOF()
@C23,C20 SAY 'NOT FOUND. Any key to continue.' GET ANY
READ
ELSE
CLEAR
@C0 ,C0 SAY '������������������������������������������������������������������������������Ŀ'
@C1 ,C0 SAY '� Date Trading Day # �'
@C2 ,C0 SAY '������������������������������������������������������������������������������Ĵ'
@C3 ,C0 SAY '� # Sales �Month-to-Date Total �Average per Day: �'
@C4 ,C0 SAY '� � Gross � Gross �'
@C5 ,C0 SAY '� Gross � Tax � Tax �'
@C6 ,C0 SAY '� Tax � ������������� � ��������������� �'
@C7 ,C0 SAY '� ������������� � Net � Net �'
@C8 ,C0 SAY '� Net � � �'
@C9 ,C0 SAY '� � # Sales �Average per Sale: �'
@C10,C0 SAY '� Cost � � Gross �'
@C11,C0 SAY '� � � Tax �'
@C12,C0 SAY '� $ Margin � � ��������������� �'
@C13,C0 SAY '� % Margin � � Net �'
@C14,C0 SAY '������������������������������������������������������������������������������Ĵ'
@C15,C0 SAY '� Gross Tax Net � Banking �'
@C16,C0 SAY '� Group 1 � ������� �'
@C17,C0 SAY '� Group 2 � Cash �'
@C18,C0 SAY '� Group 3 � Cheque �'
@C19,C0 SAY '� Group 4 � Cr. Card �'
@C20,C0 SAY '� ������������ ������������ ������������� � �������������� �'
@C21,C0 SAY '� � �'
@C22,C0 SAY '��������������������������������������������������������������������������������'
@C1 ,C14 SAY DAY
@C1 ,48 SAY DAYCOUNT
@C3 ,C14 SAY DAYNO PICTURE '999999999'
@C5 ,C14 SAY DAYTOTGROS PICTURE '999999999.99'
@C6 ,C14 SAY DAYTOTTAX PICTURE '999999999.99'
@C8 ,C14 SAY DAYTOTGROS-DAYTOTTAX PICTURE '999999999.99'
@C10,C14 SAY DAYCOST PICTURE '999999999.99'
@C12,C14 SAY DAYTOTNETT-DAYCOST PICTURE '999999999.99'
@C13,C14 SAY ROUND(((DAYTOTGROS-DAYTOTTAX-DAYCOST)/(DAYTOTGROS-DAYTOTTAX+0.01))*100,1) PICTURE '999999999.99'
@C4 ,38 SAY DAYGROSSCU PICTURE '999999999.99'
@C7 ,38 SAY DAYNETTCUM PICTURE '999999999.99'
@C5 ,38 SAY DAYGROSSCU-DAYNETTCUM PICTURE '999999999.99'
RCRDNO=RECNO()
MNTHDAY=MONTH(DAY)
DY=DAY
SUM DAYNO FOR MONTH(DAY)=MNTHDAY .AND. DY>=DAY TO TOTNUM
GOTO RCRDNO
@C9 ,42 SAY TOTNUM PICTURE '99999'
DAYCNT=DAYCOUNT+.01
DAYN=DAYNO+.01
@C4 ,65 SAY DAYGROSSCU/DAYCNT PICTURE '999999999.99'
@C5 ,65 SAY (DAYGROSSCU-DAYNETTCUM)/DAYCNT PICTURE '999999999.99'
@C7 ,65 SAY DAYNETTCUM/DAYCNT PICTURE '999999999.99'
@C10,65 SAY DAYGROSSCU/DAYN PICTURE '999999999.99'
@C11,65 SAY (DAYGROSSCU-DAYNETTCUM)/DAYN PICTURE '999999999.99'
@C13,65 SAY DAYNETTCUM/DAYN PICTURE '999999999.99'
@C16,C12 SAY DAYTOT0 PICTURE '999999999.99'
@C17,C12 SAY DAYTOT1 PICTURE '999999999.99'
@C18,C12 SAY DAYTOT2 PICTURE '999999999.99'
@C19,C12 SAY DAYTOT3 PICTURE '999999999.99'
@C16,C25 SAY DAYTAX0 PICTURE '999999999.99'
@C17,C25 SAY DAYTAX1 PICTURE '999999999.99'
@C18,C25 SAY DAYTAX2 PICTURE '999999999.99'
@C19,C25 SAY DAYTAX3 PICTURE '999999999.99'
@C16,39 SAY DAYTOT0-DAYTAX0 PICTURE '999999999.99'
@C17,39 SAY DAYTOT1-DAYTAX1 PICTURE '999999999.99'
@C18,39 SAY DAYTOT2-DAYTAX2 PICTURE '999999999.99'
@C19,39 SAY DAYTOT3-DAYTAX3 PICTURE '999999999.99'
ANALYSED=DAYTOT0+DAYTOT1+DAYTOT2+DAYTOT3
ANALYTAX=DAYTAX0+DAYTAX1+DAYTAX2+DAYTAX3
@C21,C12 SAY ANALYSED PICTURE '999999999.99'
@C21,C25 SAY ANALYTAX PICTURE '999999999.99'
@C21,39 SAY ANALYSED-ANALYTAX PICTURE '999999999.99'
@C17,65 SAY DAYCA PICTURE '999999999.99'
@C18,65 SAY DAYCH PICTURE '999999999.99'
@C19,65 SAY DAYCR PICTURE '999999999.99'
BANKED=DAYCA+DAYCH+DAYCR
@C21,65 SAY BANKED PICTURE '999999999.99'
IF DAYTOTGROSS#ANALYSED .OR. ANALYSED#BANKED
@C10,32 SAY '������������������ͻ'
@C11,32 SAY '� TOTALS DO NOT �'
@C12,32 SAY '� BALANCE �'
@C13,32 SAY '������������������ͼ'
ENDIF
ENDIF
CONT='N'
@C23,C20 SAY 'Change, Next, Previous or Quit? (C/N/P/Q)' GET CONT PICTURE '!'
READ
DO CASE
CASE CONT='C'
DO HISFMT
CASE CONT='N'
SKIP
CASE CONT='P'
SKIP-1
CASE CONT='Q'
EXIT
ENDCASE
ENDDO
USE
CASE PICK=C4
USE CHEQUES
GO BOTTOM
SKIP -18
CLEAR
@C22,C0 SAY '��������������������������������������������������������������������������������'
@C23,C20 SAY 'Press Esc to quit '
HELPNO=C2
DECLARE FIELD[5]
FIELD[1]='SUBST(NAME,1,18)'
FIELD[2]='COMPANY'
FIELD[3]='AMOUNT'
FIELD[4]='DATE'
FIELD[5]='LISTED'
DECLARE COLHEAD[5]
COLHEAD[1]='Name'
COLHEAD[2]='Company'
COLHEAD[3]='Amount'
COLHEAD[4]='Date'
COLHEAD[5]=' '
DBEDIT(C0,C0,C21,79,FIELD,0,0,COLHEAD)
@C22,C0 CLEAR
USE
CASE PICK=C5
MNTH=MONTH(DATE())
@C22,30 SAY 'Month for report:' GET MNTH
READ
USE YTDTOTAL
SET PRINT ON
SET CONSOLE OFF
REPORT FORM EOPBANK FOR MONTH(DAY)=MNTH TO PRINT
SET PRINT OFF
SET CONSOLE ON
USE
CASE PICK=C6
MNTH=MONTH(DATE())
@C22,30 SAY 'Month for report:' GET MNTH
READ
USE POSEQUIP
RPNM0=SUBST(REPNAME0,1,11)
RPNM1=SUBST(REPNAME1,1,11)
RPNM2=SUBST(REPNAME2,1,11)
RPNM3=SUBST(REPNAME3,1,11)
USE YTDTOTAL
GO BOTTOM
LASTDAY=DAY
GO TOP
SET PRINT ON
SET CONSOLE OFF
? &CND
REPORT FORM EOPRPT FOR MONTH(DAY)=MNTH TO PRINT
? &UNCND
?
? ' Group 1: '+RPNM0
? ' Group 2: '+RPNM1
? ' Group 3: '+RPNM2
? ' Group 4: '+RPNM3
SET CONSOLE ON
SET PRINT OFF
USE
CASE PICK=C7
MNTH=' '
@C22,30 SAY 'Month for report:' GET MNTH
READ
DT='01/'+MNTH+'/99'
DAT=CTOD(DT)
USE POSEQUIP
RPNM0=SUBST(REPNAME0,1,11)
RPNM1=SUBST(REPNAME1,1,11)
RPNM2=SUBST(REPNAME2,1,11)
RPNM3=SUBST(REPNAME3,1,11)
RATE0=REPRATE0
RATE1=REPRATE1
RATE2=REPRATE2
RATE3=REPRATE3
USE YTDTOTAL
SET DEVICE TO PRINT
EJECT
NETTCUM0=C0
NETTCUM1=C0
NETTCUM2=C0
NETTCUM3=C0
@PROW()+C2,C20 SAY USERNAME
@PROW()+C2,C20 SAY 'MONTHLY SALES SUMMARY for '+CMONTH(DAT)
@PROW()+C2,C4 SAY 'Date '+RPNM0+' '+RPNM1+' '+RPNM2+' '+RPNM3+' TOTAL'
@PROW()+C1,C4 SAY '���� ����������� ����������� ����������� ����������� �����'
DO WHILE .NOT. EOF()
IF MONTH(DAY)=MONTH(DAT)
@PROW()+C1,C2 SAY DAY PICTURE 'E'
@PROW(),12 SAY DAYTOT0-DAYTAX0 PICTURE '9999,999.99'
@PROW(),25 SAY DAYTOT1-DAYTAX1 PICTURE '9999,999.99'
@PROW(),38 SAY DAYTOT2-DAYTAX2 PICTURE '9999,999.99'
@PROW(),51 SAY DAYTOT3-DAYTAX3 PICTURE '9999,999.99'
@PROW(),65 SAY DAYTOT0+DAYTOT1+DAYTOT2+DAYTOT3-DAYTOTTAX PICTURE '9999,999.99'
NETTCUM0=NETTCUM0+DAYTOT0-DAYTAX0
NETTCUM1=NETTCUM1+DAYTOT1-DAYTAX1
NETTCUM2=NETTCUM2+DAYTOT2-DAYTAX2
NETTCUM3=NETTCUM3+DAYTOT3-DAYTAX3
ENDIF
IF EOF()
EXIT
ELSE
SKIP
LOOP
ENDIF
ENDDO
GO BOTTOM
@PROW()+C1,C4 SAY ' ���������� ��������� ���������� ����������� ���������'
@PROW()+C1,5 SAY 'TOTAL'
@PROW(),12 SAY NETTCUM0 PICTURE '9999,999.99'
@PROW(),25 SAY NETTCUM1 PICTURE '9999,999.99'
@PROW(),38 SAY NETTCUM2 PICTURE '9999,999.99'
@PROW(),51 SAY NETTCUM3 PICTURE '9999,999.99'
@PROW(),65 SAY NETTCUM0+NETTCUM1+NETTCUM2+NETTCUM3 PICTURE '9999,999.99'
IF USERCO='COMPUTERLAND'
@PROW()+C2,C0 SAY 'ROYALTY RATE'
@PROW(),12 SAY RATE0 PICTURE '9999,999.99'
@PROW(),25 SAY RATE1 PICTURE '999,999.999'
@PROW(),38 SAY RATE2 PICTURE '999,999.999'
@PROW(),51 SAY RATE3 PICTURE '999,999.999'
@PROW()+C2,C0 SAY ' ROYALTY'
@PROW(),12 SAY NETTCUM0*RATE0/100 PICTURE '9999,999.99'
@PROW(),25 SAY NETTCUM1*RATE1/100 PICTURE '9999,999.99'
@PROW(),38 SAY NETTCUM2*RATE2/100 PICTURE '9999,999.99'
@PROW(),51 SAY NETTCUM3*RATE3/10 PICTURE '9999,999.99'
@PROW(),65 SAY (NETTCUM0*RATE0/100)+(NETTCUM1*RATE1/100)+(NETTCUM2*RATE2/100)+(NETTCUM3*RATE3/100) PICTURE '9999,999.99'
* @PROW()+C2,20 SAY 'AD. FUND @ 0%'
* @PROW(),25 SAY ADFUND PICTURE '9999,999.99'
ENDIF
SET DEVICE TO SCREEN
USE
CASE PICK=C8
USE STAFF
CLEAR
@C22,C0 SAY '��������������������������������������������������������������������������������'
@C23,C20 SAY 'Press Esc to quit '
HELPNO=C2
DECLARE FIELD[8]
FIELD[1]='PRONAME'
FIELD[2]='SURNAME'
FIELD[3]='SALES'
FIELD[4]='MTD'
FIELD[5]='YTD'
FIELD[6]='ROUND(((SALES-COST)/(SALES+0.01))*100,1)'
FIELD[7]='ROUND(((MTD-MTDCOST)/(MTD+0.01))*100,1)'
FIELD[8]='QUOTA'
DECLARE COLHEAD[8]
COLHEAD[1]='Name'
COLHEAD[2]='Surname'
COLHEAD[3]='Sales'
COLHEAD[4]='MTD Sales'
COLHEAD[5]='YTD Sales'
COLHEAD[6]='Margin'
COLHEAD[7]='MTD Margin'
COLHEAD[8]='Quota'
DBEDIT(C0,C0,C21,79,FIELD,0,0,COLHEAD)
@C22,C0 CLEAR
USE
ENDCASE PICK
CASE CHOICE=C2
USE &SHIST
IF RECSIZE()>1200
INVLINES=C11
ELSE
INVLINES=C9
ENDIF
STDATE=DATE()
@C22,32 SAY 'Start Date:' GET STDATE PICTURE 'E'
READ
LOCATE FOR INVDATE>=STDATE
CLEAR
@C22,C0 SAY '��������������������������������������������������������������������������������'
@C23,C20 SAY 'Press Esc to quit '
HELPNO=C2
IF INVLINES=C9
DECLARE FIELD[31]
ELSE
DECLARE FIELD[35]
ENDIF
FIELD[1]='INVDATE'
FIELD[2]='INV_NO'
FIELD[3]='COMPANY'
FIELD[4]='NAME'
FIELD[5]='TITLE'
FIELD[6]='STREET'
FIELD[7]='TOWN'
FIELD[8]='ACCOUNT'
FIELD[9]='INVTYPE'
FIELD[10]='PTYPECASH+PTYPECHEQ+PTYPECARD'
FIELD[11]='PAID'
FIELD[12]='PRINTED'
FIELD[13]='PART1'
FIELD[14]='NUM1'
FIELD[15]='PART2'
FIELD[16]='NUM2'
FIELD[17]='PART3'
FIELD[18]='NUM3'
FIELD[19]='PART4'
FIELD[20]='NUM4'
FIELD[21]='PART5'
FIELD[22]='NUM5'
FIELD[23]='PART6'
FIELD[24]='NUM6'
FIELD[25]='PART7'
FIELD[26]='NUM7'
FIELD[27]='PART8'
FIELD[28]='NUM8'
FIELD[29]='PART9'
FIELD[30]='NUM9'
IF INVLINES=C9
FIELD[31]='SALESMAN'
ELSE
FIELD[31]='PARTA'
FIELD[32]='NUMA'
FIELD[33]='PARTB'
FIELD[34]='NUMB'
FIELD[35]='SALESMAN'
ENDIF
IF INVLINES=C9
DECLARE COLHEAD[31]
ELSE
DECLARE COLHEAD[35]
ENDIF
COLHEAD[1]='Date'
COLHEAD[2]='Inv. No.'
COLHEAD[3]='Company'
COLHEAD[4]='Name'
COLHEAD[5]='Greeting'
COLHEAD[6]='Street'
COLHEAD[7]='Town'
COLHEAD[8]='Account'
COLHEAD[9]='Type'
COLHEAD[10]='Total'
COLHEAD[11]='Paid'
COLHEAD[12]='Printed'
COLHEAD[13]='Item 1'
COLHEAD[14]='#1'
COLHEAD[15]='Item 2'
COLHEAD[16]='#2'
COLHEAD[17]='Item 3'
COLHEAD[18]='#3'
COLHEAD[19]='Item 4'
COLHEAD[20]='#4'
COLHEAD[21]='Item 5'
COLHEAD[22]='#5'
COLHEAD[23]='Item 6'
COLHEAD[24]='#6'
COLHEAD[25]='Item 7'
COLHEAD[26]='#7'
COLHEAD[27]='Item 8'
COLHEAD[28]='#8'
COLHEAD[29]='Item 9'
COLHEAD[30]='#9'
IF INVLINES=C9
COLHEAD[31]=' '
ELSE
COLHEAD[31]='Item 10'
COLHEAD[32]='#10'
COLHEAD[33]='Item 11'
COLHEAD[34]='#11'
COLHEAD[35]=' '
ENDIF
DBEDIT(C0,C0,C21,79,FIELD,0,0,COLHEAD)
IF LASTKEY()#27
DO WHILE .T.
DO HISTFMT
READ
DO CASE
CASE ANY='Q'
EXIT
CASE ANY='P'
DO HISPRINT
CASE ANY='B'
SKIP -1
OTHERWISE
SKIP
ENDCASE
ENDDO
ENDIF
@C22,C0 CLEAR
@C23,C25 SAY XPICK
USE
CASE CHOICE=C3
ANY=' '
CALL FADE
PICK=C0
@C6 ,53 SAY '�������������������������Ŀ'
@C7 ,53 SAY '� �'
@C8 ,53 SAY '� �'
@C9 ,53 SAY '� �'
@C10,53 SAY '� �'
@C11,53 SAY '� �'
@C12,53 SAY '� �'
@C13,53 SAY '� �'
@C14,53 SAY '� �'
@C15,53 SAY '� �'
@C16,53 SAY '� �'
@C17,53 SAY '�������������������������Ĵ'
@C18,53 SAY '� �'
@C19,53 SAY '���������������������������'
@C7 ,55 PROMPT '1> Find Account Code'
@C8 ,55 PROMPT '2> Find Invoice No. '
@C9 ,55 PROMPT '3> Find Date '
@C10,55 PROMPT '4> Find Name '
@C11,55 PROMPT '5> Find Part '
@C12,55 PROMPT '6> Find Description '
@C13,55 PROMPT '7> Find Amount '
@C14,55 PROMPT '8> Find Salesperson '
@C15,55 PROMPT '9> Find Reference '
@C16,55 PROMPT '0> Find P.O. Number '
@C18,55 PROMPT 'Q> Quit to History '
MENU TO PICK
IF PICK>C10
PICK=C0
ENDIF
DTE1=CTOD('01/01/01')
DTE2=DATE()
DO CASE
CASE PICK=C1
CDE=' '
@C19,C20 SAY '�������������������������������������Ŀ'
@C20,C20 SAY '� Start date: (dd/mm/yyyy) �'
@C21,C20 SAY '� End date: (dd/mm/yyyy) �'
@C22,C20 SAY '� Account Code: �'
@C23,C20 SAY '���������������������������������������'
@C20,47 GET DTE1
@C21,47 GET DTE2
@C22,36 GET CDE PICTURE '!!!!'
READ
IF HYR=C1
USE &SHIST INDEX HISTDEX
IF RECSIZE()>1200
INVLINES=C11
ELSE
INVLINES=C9
ENDIF
SET FILTER TO INVDATE>=DTE1 .AND. INVDATE<=DTE2
GO TOP
CDE=TRIM(CDE)
SEEK CDE
DO WHILE ACCOUNT=CDE
DO HISTFMT
READ
DO CASE
CASE ANY='Q'
EXIT
CASE ANY='P'
DO HISPRINT
CASE ANY='L'
DO HISLABEL
CASE ANY='B'
SKIP -1
OTHERWISE
SKIP
ENDCASE
ENDDO
ELSE
USE &SHIST
IF RECSIZE()>1200
INVLINES=C11
ELSE
INVLINES=C9
ENDIF
SET FILTER TO INVDATE>=DTE1 .AND. INVDATE<=DTE2
GO TOP
CDE=TRIM(CDE)
LOCATE FOR CDE$UPPER(ACCOUNT)
NOTEND=.T.
DO WHILE .NOT. EOF()
IF ANY='Q'
EXIT
ENDIF
DO HISTFMT
READ
IF ANY='P'
DO HISPRINT
ENDIF
IF ANY='L'
DO HISLABEL
ENDIF
IF ANY='B'
SKIP -1
ELSE
CONTINUE
ENDIF
ENDDO
ENDIF
SET FILTER TO
USE
CASE PICK=C2
USE &SHIST
IF RECSIZE()>1200
INVLINES=C11
ELSE
INVLINES=C9
ENDIF
@C22,30 SAY 'Invoice Number:' GET INVNO PICTURE '######'
READ
GO TOP
LOCATE FOR INV_NO=INVNO
IF EOF()
ANY=' '
@C23,30 SAY 'INVOICE NOT FOUND' GET ANY
READ
LOOP
ENDIF
DO HISTFMT
READ
DO CASE
CASE ANY='Q'
EXIT
CASE ANY='P'
DO HISPRINT
CASE ANY='L'
DO HISLABEL
CASE ANY='B'
SKIP -1
OTHERWISE
SKIP
ENDCASE
USE
CASE PICK=C3
USE &SHIST
IF RECSIZE()>1200
INVLINES=C11
ELSE
INVLINES=C9
ENDIF
@C19,C20 SAY '�������������������������������������Ŀ'
@C20,C20 SAY '� Start date: (dd/mm/yyyy) �'
@C21,C20 SAY '� End date: (dd/mm/yyyy) �'
@C22,C20 SAY '���������������������������������������'
@C20,47 GET DTE1
@C21,47 GET DTE2
READ
GO TOP
LOCATE FOR INVDATE>=DTE1 .AND. INVDATE<=DTE2
DO WHILE .NOT. EOF()
IF ANY='Q'
EXIT
ENDIF
DO HISTFMT
READ
IF ANY='P'
DO HISPRINT
ENDIF
IF ANY='L'
DO HISLABEL
ENDIF
IF ANY='B'
SKIP -1
ELSE
CONTINUE
ENDIF
ENDDO
USE
CASE PICK=C4
NME=SPACE(20)
@C19,C20 SAY '�������������������������������������Ŀ'
@C20,C20 SAY '� Start date: (dd/mm/yyyy) �'
@C21,C20 SAY '� End date: (dd/mm/yyyy) �'
@C22,C20 SAY '� Name: �'
@C23,C20 SAY '���������������������������������������'
@C20,47 GET DTE1
@C21,47 GET DTE2
@C22,37 GET NME
READ
USE &SHIST
IF RECSIZE()>1200
INVLINES=C11
ELSE
INVLINES=C9
ENDIF
SET FILTER TO INVDATE>=DTE1 .AND. INVDATE<=DTE2
GO TOP
NME=TRIM(NME)
LOCATE FOR UPPER(NME)$UPPER(NAME).OR.UPPER(NME)$UPPER(COMPANY)
DO WHILE .NOT. EOF()
IF ANY='Q'
EXIT
ENDIF
DO HISTFMT
READ
IF ANY='P'
DO HISPRINT
ENDIF
IF ANY='L'
DO HISLABEL
ENDIF
IF ANY='B'
SKIP -1
ELSE
CONTINUE
ENDIF
ENDDO
SET FILTER TO
USE
CASE PICK=C5
PRT=SPACE(15)
@C19,C20 SAY '�������������������������������������Ŀ'
@C20,C20 SAY '� Start date: (dd/mm/yyyy) �'
@C21,C20 SAY '� End date: (dd/mm/yyyy) �'
@C22,C20 SAY '� Part No: �'
@C23,C20 SAY '���������������������������������������'
@C20,47 GET DTE1
@C21,47 GET DTE2
@C22,42 GET PRT PICTURE '!!!!!!!!!!!!!!!'
READ
USE &SHIST
IF RECSIZE()>1200
INVLINES=C11
ELSE
INVLINES=C9
ENDIF
GO TOP
SET FILTER TO INVDATE>=DTE1 .AND. INVDATE<=DTE2
PRT=TRIM(PRT)
IF INVLINES=C11
LOCATE FOR PRT$PART1.OR.PRT$PART2.OR.PRT$PART3.OR.PRT$PART4.OR.PRT$PART5.OR.PRT$PART6.OR.PRT$PART7.OR.PRT$PART8.OR.PRT$PART9.OR.PRT$PARTA.OR.PRT$PARTB
ELSE
LOCATE FOR PRT$PART1.OR.PRT$PART2.OR.PRT$PART3.OR.PRT$PART4.OR.PRT$PART5.OR.PRT$PART6.OR.PRT$PART7.OR.PRT$PART8.OR.PRT$PART9
ENDIF
DO WHILE .NOT. EOF()
IF ANY='Q'
EXIT
ENDIF
DO HISTFMT
READ
IF ANY='P'
DO HISPRINT
ENDIF
IF ANY='L'
DO HISLABEL
ENDIF
IF ANY='B'
SKIP -1
ELSE
CONTINUE
ENDIF
ENDDO
SET FILTER TO
USE
CASE PICK=C6
DSCR=SPACE(20)
@C19,C20 SAY '�������������������������������������Ŀ'
@C20,C20 SAY '� Start date: (dd/mm/yyyy) �'
@C21,C20 SAY '� End date: (dd/mm/yyyy) �'
@C22,C20 SAY '� Description: �'
@C23,C20 SAY '���������������������������������������'
@C20,47 GET DTE1
@C21,47 GET DTE2
@C22,37 GET DSCR
READ
USE &SHIST
IF RECSIZE()>1200
INVLINES=C11
ELSE
INVLINES=C9
ENDIF
SET FILTER TO INVDATE>=DTE1 .AND. INVDATE<=DTE2
GO TOP
DSC=TRIM(UPPER(DSCR))
IF INVLINES=C11
LOCATE FOR DSC$UPPER(DESC1).OR.DSC$UPPER(DESC2).OR.DSC$UPPER(DESC3).OR.DSC$UPPER(DESC4).OR.DSC$UPPER(DESC5).OR.DSC$UPPER(DESC6).OR.DSC$UPPER(DESC7).OR.DSC$UPPER(DESC8).OR.DSC$UPPER(DESC9).OR.DSC$UPPER(DESCA).OR.DSC$UPPER(DESCB)
ELSE
LOCATE FOR DSC$UPPER(DESC1).OR.DSC$UPPER(DESC2).OR.DSC$UPPER(DESC3).OR.DSC$UPPER(DESC4).OR.DSC$UPPER(DESC5).OR.DSC$UPPER(DESC6).OR.DSC$UPPER(DESC7).OR.DSC$UPPER(DESC8).OR.DSC$UPPER(DESC9)
ENDIF
DO WHILE .NOT. EOF()
IF ANY='Q'
EXIT
ENDIF
DO HISTFMT
READ
IF ANY='P'
DO HISPRINT
ENDIF
IF ANY='L'
DO HISLABEL
ENDIF
IF ANY='B'
SKIP -1
ELSE
CONTINUE
ENDIF
ENDDO
SET FILTER TO
USE
CASE PICK=C7
AMNT1=C0
AMNT2=C0
@C18,C20 SAY '�������������������������������������Ŀ'
@C19,C20 SAY '� Start date: (dd/mm/yyyy) �'
@C20,C20 SAY '� End date: (dd/mm/yyyy) �'
@C21,C20 SAY '� Amount greater than: �'
@C22,C20 SAY '� but less than: �'
@C23,C20 SAY '���������������������������������������'
@C19,47 GET DTE1
@C20,47 GET DTE2
@C21,47 GET AMNT1 PICTURE '99999999'
@C22,47 GET AMNT2 PICTURE '99999999'
READ
USE &SHIST
IF RECSIZE()>1200
INVLINES=C11
ELSE
INVLINES=C9
ENDIF
SET FILTER TO INVDATE>=DTE1 .AND. INVDATE<=DTE2
GO TOP
NME=TRIM(NME)
LOCATE FOR AMNT1<=AMOUNT .AND. AMNT2>=AMOUNT
DO WHILE .NOT. EOF()
IF ANY='Q'
EXIT
ENDIF
DO HISTFMT
READ
IF ANY='P'
DO HISPRINT
ENDIF
IF ANY='L'
DO HISLABEL
ENDIF
IF ANY='B'
SKIP -1
ELSE
CONTINUE
ENDIF
ENDDO
SET FILTER TO
USE
CASE PICK=C8
SLSPRSN=' '
@C19,C20 SAY '�������������������������������������Ŀ'
@C20,C20 SAY '� Start date: (dd/mm/yyyy) �'
@C21,C20 SAY '� End date: (dd/mm/yyyy) �'
@C22,C20 SAY '� Salesperson: �'
@C23,C20 SAY '���������������������������������������'
@C20,47 GET DTE1
@C21,47 GET DTE2
@C22,47 GET SLSPRSN PICTURE '!!!'
READ
USE &SHIST
IF RECSIZE()>1200
INVLINES=C11
ELSE
INVLINES=C9
ENDIF
SET FILTER TO INVDATE>=DTE1 .AND. INVDATE<=DTE2
GO TOP
NME=TRIM(NME)
LOCATE FOR SALESMAN=SLSPRSN
DO WHILE .NOT. EOF()
IF ANY='Q'
EXIT
ENDIF
DO HISTFMT
READ
IF ANY='P'
DO HISPRINT
ENDIF
IF ANY='L'
DO HISLABEL
ENDIF
IF ANY='B'
SKIP -1
ELSE
CONTINUE
ENDIF
ENDDO
SET FILTER TO
USE
CASE PICK=C9
SLSPRSN=' '
@C19,C20 SAY '�������������������������������������Ŀ'
@C20,C20 SAY '� Start date: (dd/mm/yyyy) �'
@C21,C20 SAY '� End date: (dd/mm/yyyy) �'
@C22,C20 SAY '� Reference: �'
@C23,C20 SAY '���������������������������������������'
@C20,47 GET DTE1
@C21,47 GET DTE2
RFRNC=SPACE(20)
@C22,37 GET RFRNC
READ
USE &SHIST
IF RECSIZE()>1200
INVLINES=C11
ELSE
INVLINES=C9
ENDIF
SET FILTER TO INVDATE>=DTE1 .AND. INVDATE<=DTE2
GO TOP
RFRNC=TRIM(RFRNC)
LOCATE FOR UPPER(RFRNC)=UPPER(REFERENCE)
DO WHILE .NOT. EOF()
IF ANY='Q'
EXIT
ENDIF
DO HISTFMT
READ
IF ANY='P'
DO HISPRINT
ENDIF
IF ANY='L'
DO HISLABEL
ENDIF
IF ANY='B'
SKIP -1
ELSE
CONTINUE
ENDIF
ENDDO
SET FILTER TO
USE
CASE PICK=C10
SLSPRSN=' '
@C19,C20 SAY '�������������������������������������Ŀ'
@C20,C20 SAY '� Start date: (dd/mm/yyyy) �'
@C21,C20 SAY '� End date: (dd/mm/yyyy) �'
@C22,C20 SAY '� P.O. Number: �'
@C23,C20 SAY '���������������������������������������'
@C20,47 GET DTE1
@C21,47 GET DTE2
PONO=SPACE(15)
@C22,42 GET PONO
READ
USE &SHIST
IF RECSIZE()>1200
INVLINES=C11
ELSE
INVLINES=C9
ENDIF
SET FILTER TO INVDATE>=DTE1 .AND. INVDATE<=DTE2
GO TOP
PONO=TRIM(PONO)
LOCATE FOR UPPER(PONO)$UPPER(ORDNO)
DO WHILE .NOT. EOF()
IF ANY='Q'
EXIT
ENDIF
DO HISTFMT
READ
IF ANY='P'
DO HISPRINT
ENDIF
IF ANY='L'
DO HISLABEL
ENDIF
IF ANY='B'
SKIP -1
ELSE
CONTINUE
ENDIF
ENDDO
SET FILTER TO
USE
CASE PICK=C0
RESTORE SCREEN FROM SCRN2
LOOP
ENDCASE
CASE CHOICE=C4
CALL FADE
PICK=C0
@C6 ,53 SAY '�������������������������Ŀ'
@C7 ,53 SAY '� �'
@C8 ,53 SAY '� �'
@C9 ,53 SAY '� �'
@C10,53 SAY '� �'
@C11,53 SAY '� �'
@C12,53 SAY '� �'
@C13,53 SAY '� �'
@C14,53 SAY '� �'
@C15,53 SAY '� �'
@C16,53 SAY '� �'
@C17,53 SAY '�������������������������Ĵ'
@C18,53 SAY '� �'
@C19,53 SAY '���������������������������'
@C7 ,55 PROMPT '1> Find Account Code'
@C8 ,55 PROMPT '2> Find Invoice No. '
@C9 ,55 PROMPT '3> Find Date '
@C10,55 PROMPT '4> Find Name '
@C11,55 PROMPT '5> Find Part '
@C12,55 PROMPT '6> Find Description '
@C13,55 PROMPT '7> Find Amount '
@C14,55 PROMPT '8> Find Salesperson '
@C15,55 PROMPT '9> Find Reference '
@C16,55 PROMPT '0> Find P.O. Number '
@C18,55 PROMPT 'Q> Quit to History '
MENU TO PICK
IF PICK>C10
PICK=C0
ENDIF
DTE1=CTOD('01/01/01')
DTE2=DATE()
DO CASE
CASE PICK=C1
CDE=' '
@C19,C20 SAY '�������������������������������������Ŀ'
@C20,C20 SAY '� Start date: (dd/mm/yyyy) �'
@C21,C20 SAY '� End date: (dd/mm/yyyy) �'
@C22,C20 SAY '� Account Code: �'
@C23,C20 SAY '���������������������������������������'
@C20,47 GET DTE1
@C21,47 GET DTE2
@C22,36 GET CDE PICTURE '!!!!'
READ
USE &SHIST
IF RECSIZE()>1200
INVLINES=C11
ELSE
INVLINES=C9
ENDIF
SET FILTER TO INVDATE>=DTE1 .AND. INVDATE<=DTE2
GO TOP
CDE=TRIM(CDE)
LOCATE FOR CDE$UPPER(ACCOUNT)
NOTEND=.T.
DO WHILE NOTEND=.T.
IF EOF()
NOTEND=.F.
EXIT
ENDIF
DO HISPRINT
READ
CONTINUE
ENDDO
SET FILTER TO
USE
CASE PICK=C2
USE &SHIST
IF RECSIZE()>1200
INVLINES=C11
ELSE
INVLINES=C9
ENDIF
@C22,30 SAY 'Invoice Number:' GET INVNO PICTURE '######'
READ
GO TOP
LOCATE FOR INV_NO=INVNO
IF EOF()
? 'INVOICE NOT FOUND'
WAIT 'Any key to continue '
LOOP
ENDIF
DO HISPRINT
READ
USE
CASE PICK=C3
USE &SHIST
IF RECSIZE()>1200
INVLINES=C11
ELSE
INVLINES=C9
ENDIF
@C19,C20 SAY '�������������������������������������Ŀ'
@C20,C20 SAY '� Start date: (dd/mm/yyyy) �'
@C21,C20 SAY '� End date: (dd/mm/yyyy) �'
@C22,C20 SAY '���������������������������������������'
DTE1=DATE()-1
@C20,48 GET DTE1
READ
DTE2=DTE1
@C21,48 GET DTE2
READ
GO TOP
LOCATE FOR INVDATE>=DTE1 .AND. INVDATE<=DTE2
NOTEND=.T.
DO WHILE NOTEND=.T.
IF EOF()
NOTEND=.F.
EXIT
ENDIF
DO HISPRINT
READ
CONTINUE
ENDDO
USE
CASE PICK=C4
NME=SPACE(20)
@C19,C20 SAY '�������������������������������������Ŀ'
@C20,C20 SAY '� Start date: (dd/mm/yyyy) �'
@C21,C20 SAY '� End date: (dd/mm/yyyy) �'
@C22,C20 SAY '� Name: �'
@C23,C20 SAY '���������������������������������������'
@C20,47 GET DTE1
@C21,47 GET DTE2
@C22,37 GET NME
READ
USE &SHIST
IF RECSIZE()>1200
INVLINES=C11
ELSE
INVLINES=C9
ENDIF
SET FILTER TO INVDATE>=DTE1 .AND. INVDATE<=DTE2
GO TOP
NME=TRIM(NME)
LOCATE FOR UPPER(NME)$UPPER(NAME).OR.UPPER(NME)$UPPER(COMPANY)
NOTEND=.T.
DO WHILE NOTEND=.T.
IF EOF()
NOTEND=.F.
EXIT
ENDIF
DO HISPRINT
READ
CONTINUE
ENDDO
SET FILTER TO
USE
CASE PICK=C5
PRT=SPACE(15)
@C19,C20 SAY '�������������������������������������Ŀ'
@C20,C20 SAY '� Start date: (dd/mm/yyyy) �'
@C21,C20 SAY '� End date: (dd/mm/yyyy) �'
@C22,C20 SAY '� Part No: �'
@C23,C20 SAY '���������������������������������������'
@C20,47 GET DTE1
@C21,47 GET DTE2
@C22,37 GET PRT PICTURE '!!!!!!!!!!!!!!'
READ
PRT=TRIM(PRT)
USE &SHIST
IF RECSIZE()>1200
INVLINES=C11
ELSE
INVLINES=C9
ENDIF
SET FILTER TO INVDATE>=DTE1 .AND. INVDATE<=DTE2
GO TOP
LOCATE FOR PRT$PART1.OR.PRT$PART2.OR.PRT$PART3.OR.PRT$PART4.OR.PRT$PART5.OR.PRT$PART6.OR.PRT$PART7.OR.PRT$PART8.OR.PRT$PART9
NOTEND=.T.
DO WHILE NOTEND=.T.
IF EOF()
NOTEND=.F.
EXIT
ENDIF
DO HISPRINT
READ
CONTINUE
ENDDO
SET FILTER TO
USE
CASE PICK=C6
DSCR=SPACE(20)
@C19,C20 SAY '�������������������������������������Ŀ'
@C20,C20 SAY '� Start date: (dd/mm/yyyy) �'
@C21,C20 SAY '� End date: (dd/mm/yyyy) �'
@C22,C20 SAY '� Description: �'
@C23,C20 SAY '���������������������������������������'
@C20,47 GET DTE1
@C21,47 GET DTE2
@C22,36 GET DSCR
READ
USE &SHIST
IF RECSIZE()>1200
INVLINES=C11
ELSE
INVLINES=C9
ENDIF
SET FILTER TO INVDATE>=DTE1 .AND. INVDATE<=DTE2
GO TOP
DSC=TRIM(UPPER(DSCR))
LOCATE FOR DSC$UPPER(DESC1).OR.DSC$UPPER(DESC2).OR.DSC$UPPER(DESC3).OR.DSC$UPPER(DESC4).OR.DSC$UPPER(DESC5).OR.DSC$UPPER(DESC6).OR.DSC$UPPER(DESC7).OR.DSC$UPPER(DESC8).OR.DSC$UPPER(DESC9)
NOTEND=.T.
DO WHILE NOTEND=.T.
IF EOF()
NOTEND=.F.
EXIT
ENDIF
DO HISPRINT
READ
CONTINUE
ENDDO
SET FILTER TO
USE
CASE PICK=C7
AMNT1=C0
AMNT2=C0
@C18,C20 SAY '�������������������������������������Ŀ'
@C19,C20 SAY '� Start date: (dd/mm/yyyy) �'
@C20,C20 SAY '� End date: (dd/mm/yyyy) �'
@C21,C20 SAY '� Amount greater than: �'
@C22,C20 SAY '� but less than: �'
@C23,C20 SAY '���������������������������������������'
@C19,47 GET DTE1
@C20,47 GET DTE2
@C21,47 GET AMNT1 PICTURE '99999999'
@C22,47 GET AMNT2 PICTURE '99999999'
READ
USE &SHIST
IF RECSIZE()>1200
INVLINES=C11
ELSE
INVLINES=C9
ENDIF
SET FILTER TO INVDATE>=DTE1 .AND. INVDATE<=DTE2
GO TOP
NME=TRIM(NME)
LOCATE FOR AMNT1<=AMOUNT .AND. AMNT2>=AMOUNT
NOTEND=.T.
DO WHILE NOTEND=.T.
IF EOF()
NOTEND=.F.
EXIT
ENDIF
DO HISPRINT
READ
CONTINUE
ENDDO
SET FILTER TO
USE
CASE PICK=C8
SLSPRSN=' '
@C19,C20 SAY '�������������������������������������Ŀ'
@C20,C20 SAY '� Start date: (dd/mm/yyyy) �'
@C21,C20 SAY '� End date: (dd/mm/yyyy) �'
@C22,C20 SAY '� Salesperson: �'
@C23,C20 SAY '���������������������������������������'
@C20,47 GET DTE1
@C21,47 GET DTE2
@C22,36 GET SLSPRSN PICTURE '!!!'
READ
USE &SHIST
IF RECSIZE()>1200
INVLINES=C11
ELSE
INVLINES=C9
ENDIF
SET FILTER TO INVDATE>=DTE1 .AND. INVDATE<=DTE2
GO TOP
NME=TRIM(NME)
LOCATE FOR SALESMAN=SLSPRSN
NOTEND=.T.
DO WHILE NOTEND=.T.
IF EOF()
NOTEND=.F.
EXIT
ENDIF
DO HISPRINT
READ
CONTINUE
ENDDO
SET FILTER TO
USE
CASE PICK=C9
SLSPRSN=' '
@C19,C20 SAY '�������������������������������������Ŀ'
@C20,C20 SAY '� Start date: (dd/mm/yyyy) �'
@C21,C20 SAY '� End date: (dd/mm/yyyy) �'
@C22,C20 SAY '� Salesperson: �'
@C23,C20 SAY '���������������������������������������'
@C20,47 GET DTE1
@C21,47 GET DTE2
@C22,36 GET SLSPRSN PICTURE '!!!'
READ
USE &SHIST
IF RECSIZE()>1200
INVLINES=C11
ELSE
INVLINES=C9
ENDIF
SET FILTER TO INVDATE>=DTE1 .AND. INVDATE<=DTE2
GO TOP
NME=TRIM(NME)
LOCATE FOR SALESMAN=SLSPRSN
NOTEND=.T.
DO WHILE NOTEND=.T.
IF EOF()
NOTEND=.F.
EXIT
ENDIF
DO HISPRINT
READ
CONTINUE
ENDDO
SET FILTER TO
USE
CASE PICK=C10
SLSPRSN=' '
@C19,C20 SAY '�������������������������������������Ŀ'
@C20,C20 SAY '� Start date: (dd/mm/yyyy) �'
@C21,C20 SAY '� End date: (dd/mm/yyyy) �'
@C22,C20 SAY '� Salesperson: �'
@C23,C20 SAY '���������������������������������������'
@C20,47 GET DTE1
@C21,47 GET DTE2
@C22,36 GET SLSPRSN PICTURE '!!!'
READ
USE &SHIST
IF RECSIZE()>1200
INVLINES=C11
ELSE
INVLINES=C9
ENDIF
SET FILTER TO INVDATE>=DTE1 .AND. INVDATE<=DTE2
GO TOP
NME=TRIM(NME)
LOCATE FOR SALESMAN=SLSPRSN
NOTEND=.T.
DO WHILE NOTEND=.T.
IF EOF()
NOTEND=.F.
EXIT
ENDIF
DO HISPRINT
READ
CONTINUE
ENDDO
SET FILTER TO
USE
CASE PICK=C0
RESTORE SCREEN FROM SCRN2
LOOP
ENDCASE
CASE CHOICE=C5
CALL FADE
PICK=C0
@C11,50 SAY '����������������������������Ŀ'
@C12,50 SAY '� �'
@C13,50 SAY '� �'
@C14,50 SAY '� �'
@C15,50 SAY '� �'
@C16,50 SAY '� �'
@C17,50 SAY '����������������������������Ĵ'
@C18,50 SAY '� �'
@C19,50 SAY '������������������������������'
@C12,52 PROMPT '1> List All Sales '
@C13,52 PROMPT '2> List Sales by Account '
@C14,52 PROMPT '3> List Sales by Salesman '
@C15,52 PROMPT '4> List Product by Account'
@C16,52 PROMPT '5> List Ex Tax Sales '
@C18,52 PROMPT 'Q> Quit to History '
MENU TO PICK
IF PICK>C5
PICK=C0
ENDIF
DO CASE
CASE PICK=C1
@C19,C20 SAY '�������������������������������������Ŀ'
@C20,C20 SAY '� Start date: (dd/mm/yyyy) �'
@C21,C20 SAY '� End date: (dd/mm/yyyy) �'
@C22,C20 SAY '���������������������������������������'
DTE1=DATE()
@C20,47 GET DTE1
READ
DTE2=DTE1
@C21,47 GET DTE2
READ
SELECT 1
USE &SHIST
IF RECSIZE()>1200
INVLINES=C11
ELSE
INVLINES=C9
ENDIF
SET FILTER TO INVDATE>=DTE1 .AND. INVDATE<=DTE2
GO TOP
SET PRINT ON
SET CONSOLE OFF
SET DEVICE TO PRINT
LASTDATE=INVDATE
LNCOUNT=51
TOTRCVD=C0
TOTTX=C0
TOTNT=C0
GTOTRCVD=C0
GTOTTX=C0
GTOTNT=C0
DO WHILE .NOT. EOF()
LNCOUNT=LNCOUNT+C1
IF LNCOUNT>50
EJECT
@PROW()+C2,45 SAY 'SALES SUMMARY'
@PROW()+C2,C10 SAY 'Invoice Acnt Name Received Tax Net'
@PROW()+C1,C10 SAY '------- ---- ---- -------- --- ---'
@PROW()+C1,C10 SAY SPACE(1)
LNCOUNT=C0
ENDIF
RCVD=PTYPECASH+PTYPECHEQ+PTYPECARD
IF RCVD#C0
IF INVTYPE='T' .OR. INVTYPE='W'
IF INVLINES=C9
TX=(TAX1*NUM1)+(TAX2*NUM2)+(TAX3*NUM3)+(TAX4*NUM4)+(TAX5*NUM5)+(TAX6*NUM6)+(TAX7*NUM7)+(TAX8*NUM8)+(TAX9*NUM9)
ELSE
TX=(TAX1*NUM1)+(TAX2*NUM2)+(TAX3*NUM3)+(TAX4*NUM4)+(TAX5*NUM5)+(TAX6*NUM6)+(TAX7*NUM7)+(TAX8*NUM8)+(TAX9*NUM9)+(TAXA*NUMA)+(TAXB*NUMB)
ENDIF
ELSE
TX=C0
ENDIF
NT=RCVD-TX
ELSE
TX=C0
NT=C0
ENDIF
DO CASE
CASE 'GSOC'$REFERENCE
RFRNC='GSOC'
CASE 'HUB '$REFERENCE
RFRNC='HUB'
CASE 'IST '$REFERENCE
RFRNC='IST '
OTHERWISE
RFRNC=' '
ENDCASE
@PROW()+C1,C0 SAY INVDATE
@PROW(),C11 SAY INV_NO
@PROW(),C18 SAY ACCOUNT
@PROW(),C23 SAY SUBST(NAME,1,23)
@PROW(),46 SAY RCVD PICTURE '999999.99'
@PROW(),56 SAY TX PICTURE '999999.99'
@PROW(),66 SAY NT PICTURE '999999.99'
@PROW(),76 SAY RFRNC
TOTRCVD=TOTRCVD+RCVD
TOTTX=TOTTX+TX
TOTNT=TOTNT+NT
GTOTRCVD=GTOTRCVD+RCVD
GTOTTX=GTOTTX+TX
GTOTNT=GTOTNT+NT
SKIP
IF INVDATE#LASTDATE
@PROW()+C1,46 SAY '---------'
@PROW(),56 SAY '---------'
@PROW(),66 SAY '---------'
@PROW()+C1,C10 SAY 'DAILY TOTAL'
@PROW(),46 SAY TOTRCVD PICTURE '999999.99'
@PROW(),56 SAY TOTTX PICTURE '999999.99'
@PROW(),66 SAY TOTNT PICTURE '999999.99'
@PROW()+C1,46 SAY '========='
@PROW(),56 SAY '========='
@PROW(),66 SAY '========='
LNCOUNT=LNCOUNT+C2
LASTDATE=INVDATE
TOTRCVD=C0
TOTTX=C0
TOTNT=C0
ENDIF
ENDDO
@PROW()+C1,C10 SAY 'TOTAL'
@PROW(),46 SAY GTOTRCVD PICTURE '999999.99'
@PROW(),56 SAY GTOTTX PICTURE '999999.99'
@PROW(),66 SAY GTOTNT PICTURE '999999.99'
@PROW()+C1,47 SAY '========='
@PROW(),56 SAY '========='
@PROW(),66 SAY '========='
SET PRINT OFF
SET CONSOLE ON
SET DEVICE TO SCREEN
USE
CASE PICK=C2
@C19,C20 SAY '�������������������������������������Ŀ'
@C20,C20 SAY '� Account: �'
@C21,C20 SAY '� Start date: (dd/mm/yyyy) �'
@C22,C20 SAY '� End date: (dd/mm/yyyy) �'
@C23,C20 SAY '���������������������������������������'
ACCNT=' '
@C20,34 GET ACCNT PICTURE '!!!!'
DTE1=DATE()
@C21,47 GET DTE1
READ
DTE2=DTE1
@C22,47 GET DTE2
READ
SELECT 1
USE &SHIST
IF RECSIZE()>1200
INVLINES=C11
ELSE
INVLINES=C9
ENDIF
SET FILTER TO INVDATE>=DTE1 .AND. INVDATE<=DTE2 .AND. ACCNT=ACCOUNT
GO TOP
SET PRINT ON
SET CONSOLE OFF
SET DEVICE TO PRINT
LASTDATE=INVDATE
LNCOUNT=51
TOTRCVD=C0
TOTBILL=C0
GTOTRCVD=C0
GTOTBILL=C0
DO WHILE .NOT. EOF()
LNCOUNT=LNCOUNT+C1
IF LNCOUNT>50
EJECT
@PROW()+C2,45 SAY 'SALES SUMMARY'
@PROW()+C2,C10 SAY 'Invoice Name Billed Received'
@PROW()+C1,C10 SAY '------- ---- ------ --------'
@PROW()+C1,C1 SAY ACCOUNT
@PROW()+C1,C1 SAY '----'
LNCOUNT=C0
ENDIF
RCVD=PTYPECASH+PTYPECHEQ+PTYPECARD
@PROW()+C1,C0 SAY INVDATE
@PROW(),C11 SAY INV_NO
@PROW(),C18 SAY SUBST(NAME,1,20)
@PROW(),39 SAY REFERENCE
IF AMOUNT>C0 .AND. RCVD=C0
@PROW(),60 SAY AMOUNT PICTURE '999999.99'
ENDIF
@PROW(),70 SAY RCVD PICTURE '999999.99'
IF AMOUNT>C0 .AND. RCVD=C0
TOTBILL=TOTBILL+AMOUNT
GTOTBILL=GTOTBILL+AMOUNT
ENDIF
TOTRCVD=TOTRCVD+RCVD
GTOTRCVD=GTOTRCVD+RCVD
SKIP
IF INVDATE#LASTDATE
LNCOUNT=LNCOUNT+C1
@PROW()+C1,C1 SAY ' '
LASTDATE=INVDATE
ENDIF
ENDDO
@PROW()+C2,60 SAY '---------'
@PROW(),70 SAY '---------'
@PROW()+C1,C10 SAY 'TOTAL'
@PROW(),60 SAY GTOTBILL PICTURE '999999.99'
@PROW(),70 SAY GTOTRCVD PICTURE '999999.99'
@PROW()+C1,60 SAY '========='
@PROW(),70 SAY '========='
SET PRINT OFF
SET CONSOLE ON
SET DEVICE TO SCREEN
USE
CASE PICK=C3
@C19,C20 SAY '�������������������������������������Ŀ'
@C20,C20 SAY '� Start date: (dd/mm/yyyy) �'
@C21,C20 SAY '� End date: (dd/mm/yyyy) �'
@C22,C20 SAY '� Salesman (or ALL): �'
@C23,C20 SAY '���������������������������������������'
DTE1=DATE()
@C20,47 GET DTE1
READ
DTE2=DTE1
@C21,47 GET DTE2
READ
SELECT 1
USE &SHIST
IF RECSIZE()>1200
INVLINES=C11
ELSE
INVLINES=C9
ENDIF
SET FILTER TO INVDATE>=DTE1 .AND. INVDATE<=DTE2
GO TOP
@C22,47 GET NME PICTURE '!!!'
READ
IF NME='ALL'
SELECT 2
USE STAFF
GO TOP
DO WHILE .NOT. EOF()
SELECT 1
SET CONSOLE OFF
IF INVLINES=C9
REPORT FORM HISTSMN9 FOR B->INIT=A->SALESMAN .AND. PAID=YA HEADING B->INIT TO PRINT
ELSE
REPORT FORM HISTSMAN FOR B->INIT=A->SALESMAN .AND. PAID=YA HEADING B->INIT TO PRINT
ENDIF
SET CONSOLE ON
SELECT 2
SKIP
ENDDO
SELECT 1
ELSE
SET CONSOLE OFF
IF INVLINES=C9
REPORT FORM HISTSMN9 FOR SALESMAN=NME .AND. PAID=YA HEADING NME TO PRINT
ELSE
REPORT FORM HISTSMAN FOR SALESMAN=NME .AND. PAID=YA HEADING NME TO PRINT
ENDIF
SET CONSOLE ON
ENDIF
CLOSE ALL
CASE PICK=C4
@C19,C20 SAY '�������������������������������������Ŀ'
@C20,C20 SAY '� Start date: (dd/mm/yyyy) �'
@C21,C20 SAY '� End date: (dd/mm/yyyy) �'
@C22,C20 SAY '� Account: �'
@C23,C20 SAY '���������������������������������������'
DTE1=DATE()
@C20,47 GET DTE1
READ
DTE2=DTE1
@C21,47 GET DTE2
READ
ACCNT=' '
@C22,34 GET ACCNT PICTURE '!!!!'
READ
SELECT 1
USE &SHIST
IF RECSIZE()>1200
INVLINES=C11
ELSE
INVLINES=C9
ENDIF
SET FILTER TO INVDATE>=DTE1 .AND. INVDATE<=DTE2 .AND. ACCOUNT=ACCNT
SELECT 9
USE STCOUNT
ZAP
SELECT 1
GO TOP
DO WHILE .NOT. EOF()
IF NUM1>0 .AND. SUBST(PART1,1,6)#'SPEC-D' .AND. SUBST(PART1,1,6)#'SPEC-N' .AND. SUBST(PART1,1,6)#'SPEC-P' .AND. SUBST(PART1,1,6)#'SPEC-W'
SELECT 9
APPEND BLANK
REPLACE PART WITH A->PART1
REPLACE DESC WITH A->DESC1
REPLACE NUM WITH A->NUM1
REPLACE DATE WITH A->INVDATE
SELECT 1
ENDIF
IF NUM2>0 .AND. SUBST(PART2,1,6)#'SPEC-D' .AND. SUBST(PART2,1,6)#'SPEC-N' .AND. SUBST(PART2,1,6)#'SPEC-P' .AND. SUBST(PART2,1,6)#'SPEC-W'
SELECT 9
APPEND BLANK
REPLACE PART WITH A->PART2
REPLACE DESC WITH A->DESC2
REPLACE NUM WITH A->NUM2
REPLACE DATE WITH A->INVDATE
SELECT 1
ENDIF
IF NUM3>0 .AND. SUBST(PART3,1,6)#'SPEC-D' .AND. SUBST(PART3,1,6)#'SPEC-N' .AND. SUBST(PART3,1,6)#'SPEC-P' .AND. SUBST(PART3,1,6)#'SPEC-W'
SELECT 9
APPEND BLANK
REPLACE PART WITH A->PART3
REPLACE DESC WITH A->DESC3
REPLACE NUM WITH A->NUM3
REPLACE DATE WITH A->INVDATE
SELECT 1
ENDIF
IF NUM4>0 .AND. SUBST(PART4,1,6)#'SPEC-D' .AND. SUBST(PART4,1,6)#'SPEC-N' .AND. SUBST(PART4,1,6)#'SPEC-P' .AND. SUBST(PART4,1,6)#'SPEC-W'
SELECT 9
APPEND BLANK
REPLACE PART WITH A->PART4
REPLACE DESC WITH A->DESC4
REPLACE NUM WITH A->NUM4
REPLACE DATE WITH A->INVDATE
SELECT 1
ENDIF
IF NUM5>0 .AND. SUBST(PART5,1,6)#'SPEC-D' .AND. SUBST(PART5,1,6)#'SPEC-N' .AND. SUBST(PART5,1,6)#'SPEC-P' .AND. SUBST(PART5,1,6)#'SPEC-W'
SELECT 9
APPEND BLANK
REPLACE PART WITH A->PART5
REPLACE DESC WITH A->DESC5
REPLACE NUM WITH A->NUM5
REPLACE DATE WITH A->INVDATE
SELECT 1
ENDIF
IF NUM6>0 .AND. SUBST(PART6,1,6)#'SPEC-D' .AND. SUBST(PART6,1,6)#'SPEC-N' .AND. SUBST(PART6,1,6)#'SPEC-P' .AND. SUBST(PART6,1,6)#'SPEC-W'
SELECT 9
APPEND BLANK
REPLACE PART WITH A->PART6
REPLACE DESC WITH A->DESC6
REPLACE NUM WITH A->NUM6
REPLACE DATE WITH A->INVDATE
SELECT 1
ENDIF
IF NUM7>0 .AND. SUBST(PART7,1,6)#'SPEC-D' .AND. SUBST(PART7,1,6)#'SPEC-N' .AND. SUBST(PART7,1,6)#'SPEC-P' .AND. SUBST(PART7,1,6)#'SPEC-W'
SELECT 9
APPEND BLANK
REPLACE PART WITH A->PART7
REPLACE DESC WITH A->DESC7
REPLACE NUM WITH A->NUM7
REPLACE DATE WITH A->INVDATE
SELECT 1
ENDIF
IF NUM8>0 .AND. SUBST(PART8,1,6)#'SPEC-D' .AND. SUBST(PART8,1,6)#'SPEC-N' .AND. SUBST(PART8,1,6)#'SPEC-P' .AND. SUBST(PART8,1,6)#'SPEC-W'
SELECT 9
APPEND BLANK
REPLACE PART WITH A->PART8
REPLACE DESC WITH A->DESC8
REPLACE NUM WITH A->NUM8
REPLACE DATE WITH A->INVDATE
SELECT 1
ENDIF
IF NUM9>0 .AND. SUBST(PART9,1,6)#'SPEC-D' .AND. SUBST(PART9,1,6)#'SPEC-N' .AND. SUBST(PART9,1,6)#'SPEC-P' .AND. SUBST(PART9,1,6)#'SPEC-W'
SELECT 9
APPEND BLANK
REPLACE PART WITH A->PART9
REPLACE DESC WITH A->DESC9
REPLACE NUM WITH A->NUM9
REPLACE DATE WITH A->INVDATE
SELECT 1
ENDIF
IF INVLINES>C9
IF NUMA>0 .AND. SUBST(PARTA,1,6)#'SPEC-D' .AND. SUBST(PARTA,1,6)#'SPEC-N' .AND. SUBST(PARTA,1,6)#'SPEC-P' .AND. SUBST(PARTA,1,6)#'SPEC-W'
SELECT 9
APPEND BLANK
REPLACE PART WITH A->PARTA
REPLACE DESC WITH A->DESCA
REPLACE NUM WITH A->NUMA
REPLACE DATE WITH A->INVDATE
SELECT 1
ENDIF
IF NUMB>0 .AND. SUBST(PARTB,1,6)#'SPEC-D' .AND. SUBST(PARTB,1,6)#'SPEC-N' .AND. SUBST(PARTB,1,6)#'SPEC-P' .AND. SUBST(PARTB,1,6)#'SPEC-W'
SELECT 9
APPEND BLANK
REPLACE PART WITH A->PARTB
REPLACE DESC WITH A->DESCB
REPLACE NUM WITH A->NUMB
REPLACE DATE WITH A->INVDATE
SELECT 1
ENDIF
ENDIF
SKIP
ENDDO
SELECT 9
REPLACE ALL PART WITH '{No part no.}' FOR SUBST(PART,1,4)='SPEC'
INDEX ON PART TO SPCNTDEX+DTOC(DATE)
SET CONSOLE OFF
REPORT FORM STCOUNT TO PRINT
SET CONSOLE ON
CLOSE ALL
CASE PICK=C5
@C19,C20 SAY '��������������������������������������������Ŀ'
@C20,C20 SAY '� Start date: (dd/mm/yyyy) �'
@C21,C20 SAY '� End date: (dd/mm/yyyy) �'
@C22,C20 SAY '� �'
@C23,C20 SAY '����������������������������������������������'
DTE1=DATE()
@C20,47 GET DTE1
READ
DTE2=DTE1
@C21,47 GET DTE2
READ
YORN=NA
@C22,C22 SAY 'Include previously listed records? (Y/N)' GET YORN PICTURE '!'
READ
USE &SHIST
IF RECSIZE()>1200
INVLINES=C11
ELSE
INVLINES=C9
ENDIF
SET FILTER TO INVDATE>=DTE1 .AND. INVDATE<=DTE2
GO TOP
SET CONSOLE OFF
IF YORN=YA
IF INVLINES=C9
REPORT FORM HISTTAX9 FOR (INVTYPE='X' .OR. INVTYPE='E') HEADING 'Ex Tax Sales' TO PRINT
ELSE
REPORT FORM HISTTAX FOR (INVTYPE='X' .OR. INVTYPE='E') HEADING 'Ex Tax Sales' TO PRINT
ENDIF
ELSE
IF INVLINES=C9
REPORT FORM HISTTAX9 FOR (INVTYPE='X' .OR. INVTYPE='E') .AND. TAXPR#YA HEADING 'Ex Tax Sales' TO PRINT
ELSE
REPORT FORM HISTTAX FOR (INVTYPE='X' .OR. INVTYPE='E') .AND. TAXPR#YA HEADING 'Ex Tax Sales' TO PRINT
ENDIF
ENDIF
GO TOP
DO WHILE .NOT. EOF()
IF (INVTYPE='X' .OR. INVTYPE='E')
REPLACE TAXPR WITH 'Y'
ENDIF
SKIP
ENDDO
SET CONSOLE ON
CLOSE ALL
CASE PICK=C0
RESTORE SCREEN FROM SCRN2
USE
LOOP
ENDCASE
CASE CHOICE=C6
CALL FADE
PICK=C0
@C11,56 SAY '����������������������Ŀ'
@C12,56 SAY '� �'
@C13,56 SAY '� �'
@C14,56 SAY '� �'
@C15,56 SAY '����������������������Ĵ'
@C16,56 SAY '� �'
@C17,56 SAY '������������������������'
@C12,58 PROMPT '1> Find Date '
@C13,58 PROMPT '2> Find Part '
@C14,58 PROMPT '3> Find Description'
@C16,58 PROMPT 'Q> Quit to History '
MENU TO PICK
IF PICK>C3
PICK=C0
ENDIF
DTE1=CTOD('01/01/01')
DTE2=DATE()
DO CASE
CASE PICK=C1
USE &SHIST
DTE1=DATE()-1
@C19,C20 SAY '�������������������������������������Ŀ'
@C20,C20 SAY '� Start date: (dd/mm/yyyy) �'
@C21,C20 SAY '� End date: (dd/mm/yyyy) �'
@C22,C20 SAY '���������������������������������������'
@C20,47 GET DTE1
READ
DTE2=DTE1
@C21,47 GET DTE2
READ
DTHEAD='From '+DTOC(DTE1)+' to '+DTOC(DTE2)
GO TOP
SET PRINT ON
SET CONSOLE OFF
REPORT FORM HISTLIST FOR INVDATE>=DTE1 .AND. INVDATE<=DTE2 HEADING DTHEAD TO PRINT
SET CONSOLE ON
SET PRINT OFF
USE
CASE PICK=C2
PRT=SPACE(15)
@C19,C20 SAY '�������������������������������������Ŀ'
@C20,C20 SAY '� Start date: (dd/mm/yyyy) �'
@C21,C20 SAY '� End date: (dd/mm/yyyy) �'
@C22,C20 SAY '� Part No: �'
@C23,C20 SAY '���������������������������������������'
@C20,47 GET DTE1
@C21,47 GET DTE2
@C22,34 GET PRT PICTURE '!!!!!!!!!!!!!!'
READ
PRT=TRIM(PRT)
USE &SHIST
IF RECSIZE()>1200
INVLINES=C11
ELSE
INVLINES=C9
ENDIF
SET FILTER TO INVDATE>=DTE1 .AND. INVDATE<=DTE2
GO TOP
SET PRINT ON
SET CONSOLE OFF
IF INVLINES=C9
REPORT FORM HISTLIST FOR PRT$PART1.OR.PRT$PART2.OR.PRT$PART3.OR.PRT$PART4.OR.PRT$PART5.OR.PRT$PART6.OR.PRT$PART7.OR.PRT$PART8.OR.PRT$PART9 HEADING PRT TO PRINT
ELSE
REPORT FORM HISTLIST FOR PRT$PART1.OR.PRT$PART2.OR.PRT$PART3.OR.PRT$PART4.OR.PRT$PART5.OR.PRT$PART6.OR.PRT$PART7.OR.PRT$PART8.OR.PRT$PART9.OR.PRT$PARTA.OR.PRT$PARTB HEADING PRT TO PRINT
ENDIF
SET CONSOLE ON
SET PRINT OFF
SET FILTER TO
USE
CASE PICK=C3
DSCR=SPACE(20)
@C19,C20 SAY '�������������������������������������Ŀ'
@C20,C20 SAY '� Start date: (dd/mm/yyyy) �'
@C21,C20 SAY '� End date: (dd/mm/yyyy) �'
@C22,C20 SAY '� Description: �'
@C23,C20 SAY '���������������������������������������'
@C20,47 GET DTE1
@C21,47 GET DTE2
@C22,36 GET DSCR
READ
USE &SHIST
IF RECSIZE()>1200
INVLINES=C11
ELSE
INVLINES=C9
ENDIF
SET FILTER TO INVDATE>=DTE1 .AND. INVDATE<=DTE2
GO TOP
DSC=TRIM(UPPER(DSCR))
SET PRINT ON
SET CONSOLE OFF
IF INVLINES=C9
REPORT FORM HISTLIST FOR DSC$UPPER(DESC1).OR.DSC$UPPER(DESC2).OR.DSC$UPPER(DESC3).OR.DSC$UPPER(DESC4).OR.DSC$UPPER(DESC5).OR.DSC$UPPER(DESC6).OR.DSC$UPPER(DESC7).OR.DSC$UPPER(DESC8).OR.DSC$UPPER(DESC9) HEADING DSCR TO PRINT
ELSE
REPORT FORM HISTLIST FOR ;
DSC$UPPER(DESC1).OR.DSC$UPPER(DESC2).OR.DSC$UPPER(DESC3).OR.DSC$UPPER(DESC4).OR.DSC$UPPER(DESC5).OR.DSC$UPPER(DESC6).OR.DSC$UPPER(DESC7).OR.DSC$UPPER(DESC8).OR.DSC$UPPER(DESC9).OR.DSC$UPPER(DESCA).OR.DSC$UPPER(DESCB);
HEADING DSCR TO PRINT
ENDIF
SET CONSOLE OFF
SET PRINT ON
SET FILTER TO
USE
CASE PICK=C0
RESTORE SCREEN FROM SCRN2
LOOP
ENDCASE
CASE CHOICE=C7
DTE1=CTOD('01/01/1901')
DTE2=DATE()
CALL FADE
@C19,C20 SAY '����������������������������������������Ŀ'
@C20,C20 SAY '� Start date: (dd/mm/yyyy) �'
@C21,C20 SAY '� End date: (dd/mm/yyyy) �'
@C22,C20 SAY '� �'
@C23,C20 SAY '������������������������������������������'
@C20,47 GET DTE1
@C21,47 GET DTE2
READ
SELECT 1
USE &SHIST
IF RECSIZE()>1200
INVLINES=C11
ELSE
INVLINES=C9
ENDIF
SET FILTER TO INVDATE>=DTE1 .AND. INVDATE<=DTE2
CALL FADE
PICK=C0
@C6 ,53 SAY '�������������������������Ŀ'
@C7 ,53 SAY '� �'
@C8 ,53 SAY '� �'
@C9 ,53 SAY '� �'
@C10,53 SAY '� �'
@C11,53 SAY '� �'
@C12,53 SAY '� �'
@C13,53 SAY '� �'
@C14,53 SAY '� �'
@C15,53 SAY '� �'
@C16,53 SAY '�������������������������Ĵ'
@C17,53 SAY '� �'
@C18,53 SAY '���������������������������'
@C7 ,55 PROMPT '1> All '
@C8 ,55 PROMPT '2> For Salesman '
@C9 ,55 PROMPT '3> For Name '
@C10,55 PROMPT '4> For Company '
@C11,55 PROMPT '5> For Account '
@C12,55 PROMPT '6> For Reference '
@C13,55 PROMPT '7> For Product Group'
@C14,55 PROMPT '8> For Part Number '
@C15,55 PROMPT '9> For Location '
@C17,55 PROMPT 'Q> Quit to History '
MENU TO PICK
IF PICK>C9
PICK=C0
ENDIF
DO CASE
CASE PICK=C1
YORN=NA
@C22,30 SAY 'Print (Y/N)?' GET YORN PICTURE '!'
READ
IF YORN=YA
SET PRINT ON
SET CONSOLE OFF
REPORT FORM HISTREP TO PRINT FOR PTYPECASH+PTYPECHEQ+PTYPECARD#C0
SET PRINT OFF
SET CONSOLE ON
ELSE
@C19,C20 SAY '����������������������������������������Ŀ'
@C20,C20 SAY '� Sales: �'
@C21,C20 SAY '� Cost: �'
@C22,C20 SAY '� Av Margin: �'
@C23,C20 SAY '� No. Sales: �'
@C24,C20 SAY '������������������������������������������'
SUM PTYPECASH+PTYPECHEQ+PTYPECARD TO SLSTOT
@C20,35 SAY SLSTOT PICTURE '99999999'
SUM COST TO CSTTOT FOR PAID=YA
@C21,35 SAY CSTTOT PICTURE '99999999.99'
SUM PTYPECASH+PTYPECHEQ+PTYPECARD TO TAXTOT FOR INVTYPE='T'
TAXTOT=TAXTOT*.2
@C22,35 SAY ((SLSTOT-CSTTOT-TAXTOT)/(SLSTOT+.01-TAXTOT))*100 PICTURE '99999999.99'
COUNT TO CNTTOT
@C23,35 SAY CNTTOT PICTURE '99999999'
WAIT
ENDIF
SET FILTER TO
USE
CASE PICK=C2
@C22,C22 SAY 'Salesman:' GET NME PICTURE '!!!'
READ
YORN=NA
@C22,C20 SAY '� �'
@C22,30 SAY 'Print (Y/N)?' GET YORN PICTURE '!'
READ
IF YORN=YA
SET PRINT ON
SET CONSOLE OFF
REPORT FORM HISTREP TO PRINT FOR SALESMAN=NME .AND. PTYPECASH+PTYPECHEQ+PTYPECARD#C0
SET PRINT OFF
SET CONSOLE ON
ELSE
@C19,C20 SAY '����������������������������������������Ŀ'
@C20,C20 SAY '� Sales: �'
@C21,C20 SAY '� Cost: �'
@C22,C20 SAY '� Av Margin: �'
@C23,C20 SAY '� No. Sales: �'
@C24,C20 SAY '������������������������������������������'
SUM PTYPECASH+PTYPECHEQ+PTYPECARD TO SLSTOT FOR SALESMAN=NME
@C20,35 SAY SLSTOT PICTURE '99999999.99'
SUM COST TO CSTTOT FOR SALESMAN=NME .AND. PAID=YA
@C21,35 SAY CSTTOT PICTURE '99999999.99'
SUM PTYPECASH+PTYPECHEQ+PTYPECARD TO TAXTOT FOR SALESMAN=NME .AND. INVTYPE='T'
TAXTOT=TAXTOT*.2
@C22,35 SAY ((SLSTOT-CSTTOT-TAXTOT)/(SLSTOT+.01-TAXTOT))*100 PICTURE '99999999.99'
COUNT TO CNTTOT FOR SALESMAN=NME
@C23,35 SAY CNTTOT PICTURE '99999999'
WAIT
ENDIF
SET FILTER TO
USE
CASE PICK=C3
@C22,C22 SAY 'Name:' GET NME
READ
YORN=NA
@C22,C20 SAY '� �'
@C22,30 SAY 'Print (Y/N)?' GET YORN PICTURE '!'
READ
IF YORN=YA
SET PRINT ON
SET CONSOLE OFF
REPORT FORM HISTREP TO PRINT FOR UPPER(TRIM(NME))$UPPER(NAME) .AND. PTYPECASH+PTYPECHEQ+PTYPECARD#C0
SET PRINT OFF
SET CONSOLE ON
ELSE
@C19,C20 SAY '����������������������������������������Ŀ'
@C20,C20 SAY '� Sales: �'
@C21,C20 SAY '� Cost: �'
@C22,C20 SAY '� Av Margin: �'
@C23,C20 SAY '� No. Sales: �'
@C24,C20 SAY '������������������������������������������'
NME=TRIM(NME)
SUM PTYPECASH+PTYPECHEQ+PTYPECARD TO SLSTOT FOR UPPER(TRIM(NME))$UPPER(NAME)
@C20,35 SAY SLSTOT PICTURE '99999999.99'
SUM COST TO CSTTOT FOR UPPER(NME)$UPPER(NAME)
@C21,35 SAY CSTTOT PICTURE '99999999.99'
SUM PTYPECASH+PTYPECHEQ+PTYPECARD TO TAXTOT FOR UPPER(TRIM(NME))$UPPER(NAME) .AND. INVTYPE='T'
TAXTOT=TAXTOT*.2
@C22,35 SAY ((SLSTOT-CSTTOT-TAXTOT)/(SLSTOT+.01-TAXTOT))*100 PICTURE '99999999.99'
COUNT TO CNTTOT FOR UPPER(NME)$UPPER(NAME)
@C23,35 SAY CNTTOT PICTURE '99999999'
WAIT
ENDIF
SET FILTER TO
USE
CASE PICK=C4
@C22,C22 SAY 'Company:' GET NME
READ
YORN=NA
@C22,C20 SAY '� �'
@C22,30 SAY 'Print (Y/N)?' GET YORN PICTURE '!'
READ
IF YORN=YA
SET PRINT ON
SET CONSOLE OFF
REPORT FORM HISTREP TO PRINT FOR UPPER(TRIM(NME))$UPPER(COMPANY) .AND. PTYPECASH+PTYPECHEQ+PTYPECARD#C0
SET PRINT OFF
SET CONSOLE ON
ELSE
@C19,C20 SAY '����������������������������������������Ŀ'
@C20,C20 SAY '� Sales: �'
@C21,C20 SAY '� Cost: �'
@C22,C20 SAY '� Av Margin: �'
@C23,C20 SAY '� No. Sales: �'
@C24,C20 SAY '������������������������������������������'
NME=TRIM(NME)
SUM PTYPECASH+PTYPECHEQ+PTYPECARD TO SLSTOT FOR UPPER(TRIM(NME))$UPPER(COMPANY)
@C20,35 SAY SLSTOT PICTURE '99999999.99'
SUM COST TO CSTTOT FOR UPPER(NME)$UPPER(NAME)
@C21,35 SAY CSTTOT PICTURE '99999999.99'
SUM PTYPECASH+PTYPECHEQ+PTYPECARD TO TAXTOT FOR UPPER(TRIM(NME))$UPPER(COMPANY) .AND. INVTYPE='T'
TAXTOT=TAXTOT*.2
@C22,35 SAY ((SLSTOT-CSTTOT-TAXTOT)/(SLSTOT+.01-TAXTOT))*100 PICTURE '99999999.99'
COUNT TO CNTTOT FOR UPPER(NME)$UPPER(NAME)
@C23,35 SAY CNTTOT PICTURE '99999999'
WAIT
ENDIF
SET FILTER TO
USE
CASE PICK=C5
@C22,C22 SAY 'Account:' GET NME PICTURE '!!!!'
READ
YORN=NA
@C22,C20 SAY '� �'
@C22,30 SAY 'Print (Y/N)?' GET YORN PICTURE '!'
READ
IF YORN=YA
SET PRINT ON
SET CONSOLE OFF
REPORT FORM HISTREP TO PRINT FOR ACCOUNT=NME .AND. PTYPECASH+PTYPECHEQ+PTYPECARD#C0
SET PRINT OFF
SET CONSOLE ON
ELSE
@C19,C20 SAY '����������������������������������������Ŀ'
@C20,C20 SAY '� Sales: �'
@C21,C20 SAY '� Cost: �'
@C22,C20 SAY '� Av Margin: �'
@C23,C20 SAY '� No. Sales: �'
@C24,C20 SAY '������������������������������������������'
SUM PTYPECASH+PTYPECHEQ+PTYPECARD TO SLSTOT FOR ACCOUNT=NME
@C20,35 SAY SLSTOT PICTURE '99999999.99'
SUM COST TO CSTTOT FOR ACCOUNT=NME
@C21,35 SAY CSTTOT PICTURE '99999999.99'
SUM PTYPECASH+PTYPECHEQ+PTYPECARD TO TAXTOT FOR ACCOUNT=NME .AND. INVTYPE='T'
TAXTOT=TAXTOT*.2
@C22,35 SAY ((SLSTOT-CSTTOT-TAXTOT)/(SLSTOT+.01-TAXTOT))*100 PICTURE '99999999.99'
COUNT TO CNTTOT FOR ACCOUNT=NME
@C23,35 SAY CNTTOT PICTURE '99999999'
WAIT
ENDIF
SET FILTER TO
USE
CASE PICK=C6
REF=' '
@C22,C22 SAY 'Reference:' GET REF
READ
YORN=NA
@C22,C20 SAY '� �'
@C22,30 SAY 'Print (Y/N)?' GET YORN PICTURE '!'
READ
IF YORN=YA
SET PRINT ON
SET CONSOLE OFF
REPORT FORM HISTREP TO PRINT FOR UPPER(TRIM(REF))$UPPER(REFERENCE) .AND. PTYPECASH+PTYPECHEQ+PTYPECARD#C0
SET PRINT OFF
SET CONSOLE ON
ELSE
@C19,C20 SAY '����������������������������������������Ŀ'
@C20,C20 SAY '� Sales: �'
@C21,C20 SAY '� Cost: �'
@C22,C20 SAY '� Av Margin: �'
@C23,C20 SAY '� No. Sales: �'
@C24,C20 SAY '������������������������������������������'
NME=TRIM(REF)
SUM PTYPECASH+PTYPECHEQ+PTYPECARD TO SLSTOT FOR UPPER(TRIM(REF))$UPPER(REFERENCE)
@C20,35 SAY SLSTOT PICTURE '99999999.99'
SUM COST TO CSTTOT FOR UPPER(TRIM(REF))$UPPER(REFERENCE)
@C21,35 SAY CSTTOT PICTURE '99999999.99'
SUM PTYPECASH+PTYPECHEQ+PTYPECARD TO TAXTOT FOR UPPER(REF)$UPPER(REFERENCE) .AND. INVTYPE='T'
TAXTOT=TAXTOT*.2
@C22,35 SAY ((SLSTOT-CSTTOT-TAXTOT)/(SLSTOT+.01-TAXTOT))*100 PICTURE '99999999.99'
COUNT TO CNTTOT FOR UPPER(TRIM(REF))$UPPER(REFERENCE)
@C23,35 SAY CNTTOT PICTURE '99999999'
WAIT
ENDIF
SET FILTER TO
USE
CASE PICK=C7
DPT=' '
@C19,C20 SAY '����������������������������������������Ŀ'
@C20,C20 SAY '� Product Group: �'
@C21,C20 SAY '� �'
@C22,C20 SAY '� Sales: �'
@C23,C20 SAY '� Instances: �'
@C24,C20 SAY '������������������������������������������'
@C20,37 GET DPT
READ
@C21,C21 SAY '����������������������������������������'
SUM (RETAIL1*NUM1) TO SLSTOT1 FOR DPT=DEPT1 .AND. INVTYPE='T'
SUM NUM1 TO SLSNUM1 FOR DPT=DEPT1
@C21,C21 SAY '�'
SUM (RETAIL2*NUM2) TO SLSTOT2 FOR DPT=DEPT2 .AND. INVTYPE='T'
SUM NUM2 TO SLSNUM2 FOR DPT=DEPT2
@C21,C22 SAY '�'
SUM (RETAIL3*NUM3) TO SLSTOT3 FOR DPT=DEPT3 .AND. INVTYPE='T'
SUM NUM3 TO SLSNUM3 FOR DPT=DEPT3
@C21,C23 SAY '�'
SUM (RETAIL4*NUM4) TO SLSTOT4 FOR DPT=DEPT4 .AND. INVTYPE='T'
SUM NUM4 TO SLSNUM4 FOR DPT=DEPT4
@C21,C24 SAY '�'
SUM (RETAIL5*NUM5) TO SLSTOT5 FOR DPT=DEPT5 .AND. INVTYPE='T'
SUM NUM5 TO SLSNUM5 FOR DPT=DEPT5
@C21,C25 SAY '�'
SUM (RETAIL6*NUM6) TO SLSTOT6 FOR DPT=DEPT6 .AND. INVTYPE='T'
SUM NUM6 TO SLSNUM6 FOR DPT=DEPT6
@C21,26 SAY '�'
SUM (RETAIL7*NUM7) TO SLSTOT7 FOR DPT=DEPT7 .AND. INVTYPE='T'
SUM NUM7 TO SLSNUM7 FOR DPT=DEPT7
@C21,27 SAY '�'
SUM (RETAIL8*NUM8) TO SLSTOT8 FOR DPT=DEPT8 .AND. INVTYPE='T'
SUM NUM8 TO SLSNUM8 FOR DPT=DEPT8
@C21,28 SAY '�'
SUM (RETAIL9*NUM9) TO SLSTOT9 FOR DPT=DEPT9 .AND. INVTYPE='T'
SUM NUM9 TO SLSNUM9 FOR DPT=DEPT9
@C21,29 SAY '�'
IF INVLINES=C9
@C21,30 SAY '�'
@C21,31 SAY '�'
ELSE
SUM (RETAILA*NUMA) TO SLSTOTA FOR DPT=DEPTA .AND. INVTYPE='T'
SUM NUMA TO SLSNUMA FOR DPT=DEPTA
@C21,30 SAY '�'
SUM (RETAILB*NUMB) TO SLSTOTB FOR DPT=DEPTB .AND. INVTYPE='T'
SUM NUMB TO SLSNUMB FOR DPT=DEPTB
@C21,31 SAY '�'
ENDIF
IF INVLINES=C9
SLSTOT=SLSTOT1+SLSTOT2+SLSTOT3+SLSTOT4+SLSTOT5+SLSTOT6+SLSTOT7+SLSTOT8+SLSTOT9
SLSNUM=SLSNUM1+SLSNUM2+SLSNUM3+SLSNUM4+SLSNUM5+SLSNUM6+SLSNUM7+SLSNUM8+SLSNUM9
ELSE
SLSTOT=SLSTOT1+SLSTOT2+SLSTOT3+SLSTOT4+SLSTOT5+SLSTOT6+SLSTOT7+SLSTOT8+SLSTOT9+SLSTOTA+SLSTOTB
SLSNUM=SLSNUM1+SLSNUM2+SLSNUM3+SLSNUM4+SLSNUM5+SLSNUM6+SLSNUM7+SLSNUM8+SLSNUM9+SLSNUMA+SLSNUMB
ENDIF
SUM (RETAIL1*NUM1) TO SLSTOT1 FOR DPT=DEPT1 .AND. INVTYPE='W'
@C21,32 SAY '�'
SUM (RETAIL2*NUM2) TO SLSTOT2 FOR DPT=DEPT2 .AND. INVTYPE='W'
@C21,32 SAY '�'
SUM (RETAIL3*NUM3) TO SLSTOT3 FOR DPT=DEPT3 .AND. INVTYPE='W'
@C21,33 SAY '�'
SUM (RETAIL4*NUM4) TO SLSTOT4 FOR DPT=DEPT4 .AND. INVTYPE='W'
@C21,34 SAY '�'
SUM (RETAIL5*NUM5) TO SLSTOT5 FOR DPT=DEPT5 .AND. INVTYPE='W'
@C21,35 SAY '�'
SUM (RETAIL6*NUM6) TO SLSTOT6 FOR DPT=DEPT6 .AND. INVTYPE='W'
@C21,36 SAY '�'
SUM (RETAIL7*NUM7) TO SLSTOT7 FOR DPT=DEPT7 .AND. INVTYPE='W'
@C21,37 SAY '�'
SUM (RETAIL8*NUM8) TO SLSTOT8 FOR DPT=DEPT8 .AND. INVTYPE='W'
@C21,38 SAY '�'
SUM (RETAIL9*NUM9) TO SLSTOT9 FOR DPT=DEPT9 .AND. INVTYPE='W'
@C21,39 SAY '�'
IF INVLINES=C9
@C21,40 SAY '�'
@C21,41 SAY '�'
ELSE
SUM (RETAILA*NUMA) TO SLSTOTA FOR DPT=DEPTA .AND. INVTYPE='W'
@C21,40 SAY '�'
SUM (RETAILB*NUMB) TO SLSTOTB FOR DPT=DEPTB .AND. INVTYPE='W'
@C21,41 SAY '�'
ENDIF
IF INVLINES=C9
SLSTOT=SLSTOT+SLSTOT1+SLSTOT2+SLSTOT3+SLSTOT4+SLSTOT5+SLSTOT6+SLSTOT7+SLSTOT8+SLSTOT9
ELSE
SLSTOT=SLSTOT+SLSTOT1+SLSTOT2+SLSTOT3+SLSTOT4+SLSTOT5+SLSTOT6+SLSTOT7+SLSTOT8+SLSTOT9+SLSTOTA+SLSTOTB
ENDIF
SUM (RETAIL1-TAX1)*NUM1 TO SLSTOT1 FOR DPT=DEPT1 .AND. INVTYPE='E'
@C21,42 SAY '�'
SUM (RETAIL2-TAX2)*NUM2 TO SLSTOT2 FOR DPT=DEPT2 .AND. INVTYPE='E'
@C21,43 SAY '�'
SUM (RETAIL3-TAX3)*NUM3 TO SLSTOT3 FOR DPT=DEPT3 .AND. INVTYPE='E'
@C21,44 SAY '�'
SUM (RETAIL4-TAX4)*NUM4 TO SLSTOT4 FOR DPT=DEPT4 .AND. INVTYPE='E'
@C21,45 SAY '�'
SUM (RETAIL5-TAX5)*NUM5 TO SLSTOT5 FOR DPT=DEPT5 .AND. INVTYPE='E'
@C21,46 SAY '�'
SUM (RETAIL6-TAX6)*NUM6 TO SLSTOT6 FOR DPT=DEPT6 .AND. INVTYPE='E'
@C21,47 SAY '�'
SUM (RETAIL7-TAX7)*NUM7 TO SLSTOT7 FOR DPT=DEPT7 .AND. INVTYPE='E'
@C21,48 SAY '�'
SUM (RETAIL8-TAX8)*NUM8 TO SLSTOT8 FOR DPT=DEPT8 .AND. INVTYPE='E'
@C21,49 SAY '�'
SUM (RETAIL9-TAX9)*NUM9 TO SLSTOT9 FOR DPT=DEPT9 .AND. INVTYPE='E'
@C21,50 SAY '�'
IF INVLINES=C9
@C21,51 SAY '�'
@C21,52 SAY '�'
ELSE
SUM (RETAILA-TAXA)*NUMA TO SLSTOTA FOR DPT=DEPTA .AND. INVTYPE='E'
@C21,51 SAY '�'
SUM (RETAILB-TAXB)*NUMB TO SLSTOTB FOR DPT=DEPTB .AND. INVTYPE='E'
@C21,52 SAY '�'
ENDIF
IF INVLINES=C9
SLSTOT=SLSTOT+SLSTOT1+SLSTOT2+SLSTOT3+SLSTOT4+SLSTOT5+SLSTOT6+SLSTOT7+SLSTOT8+SLSTOT9
ELSE
SLSTOT=SLSTOT+SLSTOT1+SLSTOT2+SLSTOT3+SLSTOT4+SLSTOT5+SLSTOT6+SLSTOT7+SLSTOT8+SLSTOT9+SLSTOTA+SLSTOTB
ENDIF
SUM (RETAIL1-TAX1)*NUM1 TO SLSTOT1 FOR DPT=DEPT1 .AND. INVTYPE='X'
@C21,53 SAY '�'
SUM (RETAIL2-TAX2)*NUM2 TO SLSTOT2 FOR DPT=DEPT2 .AND. INVTYPE='X'
@C21,54 SAY '�'
SUM (RETAIL3-TAX3)*NUM3 TO SLSTOT3 FOR DPT=DEPT3 .AND. INVTYPE='X'
@C21,55 SAY '�'
SUM (RETAIL4-TAX4)*NUM4 TO SLSTOT4 FOR DPT=DEPT4 .AND. INVTYPE='X'
@C21,56 SAY '�'
SUM (RETAIL5-TAX5)*NUM5 TO SLSTOT5 FOR DPT=DEPT5 .AND. INVTYPE='X'
@C21,57 SAY '�'
SUM (RETAIL6-TAX6)*NUM6 TO SLSTOT6 FOR DPT=DEPT6 .AND. INVTYPE='X'
@C21,58 SAY '�'
SUM (RETAIL7-TAX7)*NUM7 TO SLSTOT7 FOR DPT=DEPT7 .AND. INVTYPE='X'
@C21,59 SAY '�'
SUM (RETAIL8-TAX8)*NUM8 TO SLSTOT8 FOR DPT=DEPT8 .AND. INVTYPE='X'
@C21,60 SAY '�'
SUM (RETAIL9-TAX9)*NUM9 TO SLSTOT9 FOR DPT=DEPT9 .AND. INVTYPE='X'
@C21,51 SAY '�'
IF INVLINES=C9
SLSTOT=SLSTOT+SLSTOT1+SLSTOT2+SLSTOT3+SLSTOT4+SLSTOT5+SLSTOT6+SLSTOT7+SLSTOT8+SLSTOT9
ELSE
SLSTOT=SLSTOT+SLSTOT1+SLSTOT2+SLSTOT3+SLSTOT4+SLSTOT5+SLSTOT6+SLSTOT7+SLSTOT8+SLSTOT9+SLSTOTA+SLSTOTB
ENDIF
@C22,37 SAY SLSTOT PICTURE '99999999.99'
@C23,37 SAY SLSNUM PICTURE '99999999'
WAIT
SET FILTER TO
USE
CASE PICK=C8
@C19,C20 SAY '������������������������������������������Ŀ'
@C20,C20 SAY '� Part No.: �'
@C21,C20 SAY '� �'
@C22,C20 SAY '� Sales: �'
@C23,C20 SAY '� Instances: �'
@C24,C20 SAY '��������������������������������������������'
PRT=' '
@C20,37 GET PRT PICTURE '!!!!!!!!!!!!!!!'
READ
PRT=TRIM(PRT)
@C21,C21 SAY '������������������������������������������'
SUM (RETAIL1*NUM1) TO SLSTOT1 FOR PRT$PART1 .AND. INVTYPE='T'
SUM NUM1 TO SLSNUM1 FOR PRT$PART1
@C21,C21 SAY '�'
SUM (RETAIL2*NUM2) TO SLSTOT2 FOR PRT$PART2 .AND. INVTYPE='T'
SUM NUM2 TO SLSNUM2 FOR PRT$PART2
@C21,C22 SAY '�'
SUM (RETAIL3*NUM3) TO SLSTOT3 FOR PRT$PART3 .AND. INVTYPE='T'
SUM NUM3 TO SLSNUM3 FOR PRT$PART3
@C21,C23 SAY '�'
SUM (RETAIL4*NUM4) TO SLSTOT4 FOR PRT$PART4 .AND. INVTYPE='T'
SUM NUM4 TO SLSNUM4 FOR PRT$PART4
@C21,C24 SAY '�'
SUM (RETAIL5*NUM5) TO SLSTOT5 FOR PRT$PART5 .AND. INVTYPE='T'
SUM NUM5 TO SLSNUM5 FOR PRT$PART5
@C21,C25 SAY '�'
SUM (RETAIL6*NUM6) TO SLSTOT6 FOR PRT$PART6 .AND. INVTYPE='T'
SUM NUM6 TO SLSNUM6 FOR PRT$PART6
@C21,26 SAY '�'
SUM (RETAIL7*NUM7) TO SLSTOT7 FOR PRT$PART7 .AND. INVTYPE='T'
SUM NUM7 TO SLSNUM7 FOR PRT$PART7
@C21,27 SAY '�'
SUM (RETAIL8*NUM8) TO SLSTOT8 FOR PRT$PART8 .AND. INVTYPE='T'
SUM NUM8 TO SLSNUM8 FOR PRT$PART8
@C21,28 SAY '�'
SUM (RETAIL9*NUM9) TO SLSTOT9 FOR PRT$PART9 .AND. INVTYPE='T'
SUM NUM9 TO SLSNUM9 FOR PRT$PART9
@C21,29 SAY '�'
IF INVLINES=C9
@C21,30 SAY '�'
@C21,31 SAY '�'
ELSE
SUM (RETAILA*NUMA) TO SLSTOTA FOR PRT$PARTA .AND. INVTYPE='T'
SUM NUMA TO SLSNUMA FOR PRT$PARTA
@C21,30 SAY '�'
SUM (RETAILB*NUMB) TO SLSTOTB FOR PRT$PARTB .AND. INVTYPE='T'
SUM NUMA TO SLSNUMB FOR PRT$PARTB
@C21,31 SAY '�'
ENDIF
IF INVLINES=C9
SLSTOT=SLSTOT1+SLSTOT2+SLSTOT3+SLSTOT4+SLSTOT5+SLSTOT6+SLSTOT7+SLSTOT8+SLSTOT9
SLSNUM=SLSNUM1+SLSNUM2+SLSNUM3+SLSNUM4+SLSNUM5+SLSNUM6+SLSNUM7+SLSNUM8+SLSNUM9
ELSE
SLSTOT=SLSTOT1+SLSTOT2+SLSTOT3+SLSTOT4+SLSTOT5+SLSTOT6+SLSTOT7+SLSTOT8+SLSTOT9+SLSTOTA+SLSTOTB
SLSNUM=SLSNUM1+SLSNUM2+SLSNUM3+SLSNUM4+SLSNUM5+SLSNUM6+SLSNUM7+SLSNUM8+SLSNUM9+SLSNUMA+SLSNUMB
ENDIF
SUM (RETAIL1*NUM1) TO SLSTOT1 FOR PRT$PART1 .AND. INVTYPE='W'
@C21,32 SAY '�'
SUM (RETAIL2*NUM2) TO SLSTOT2 FOR PRT$PART2 .AND. INVTYPE='W'
@C21,33 SAY '�'
SUM (RETAIL3*NUM3) TO SLSTOT3 FOR PRT$PART3 .AND. INVTYPE='W'
@C21,34 SAY '�'
SUM (RETAIL4*NUM4) TO SLSTOT4 FOR PRT$PART4 .AND. INVTYPE='W'
@C21,35 SAY '�'
SUM (RETAIL5*NUM5) TO SLSTOT5 FOR PRT$PART5 .AND. INVTYPE='W'
@C21,36 SAY '�'
SUM (RETAIL6*NUM6) TO SLSTOT6 FOR PRT$PART6 .AND. INVTYPE='W'
@C21,37 SAY '�'
SUM (RETAIL7*NUM7) TO SLSTOT7 FOR PRT$PART7 .AND. INVTYPE='W'
@C21,38 SAY '�'
SUM (RETAIL8*NUM8) TO SLSTOT8 FOR PRT$PART8 .AND. INVTYPE='W'
@C21,39 SAY '�'
SUM (RETAIL9*NUM9) TO SLSTOT9 FOR PRT$PART9 .AND. INVTYPE='W'
@C21,40 SAY '�'
IF INVLINES=C9
@C21,41 SAY '�'
@C21,42 SAY '�'
ELSE
SUM (RETAILA*NUMA) TO SLSTOTA FOR PRT$PARTA .AND. INVTYPE='W'
@C21,41 SAY '�'
SUM (RETAILB*NUMB) TO SLSTOTB FOR PRT$PARTB .AND. INVTYPE='W'
@C21,42 SAY '�'
ENDIF
IF INVLINES=C9
SLSTOT=SLSTOT+SLSTOT1+SLSTOT2+SLSTOT3+SLSTOT4+SLSTOT5+SLSTOT6+SLSTOT7+SLSTOT8+SLSTOT9
ELSE
SLSTOT=SLSTOT+SLSTOT1+SLSTOT2+SLSTOT3+SLSTOT4+SLSTOT5+SLSTOT6+SLSTOT7+SLSTOT8+SLSTOT9+SLSTOTA+SLSTOTB
ENDIF
SUM (RETAIL1-TAX1)*NUM1 TO SLSTOT1 FOR PRT$PART1 .AND. INVTYPE='E'
@C21,43 SAY '�'
SUM (RETAIL2-TAX2)*NUM2 TO SLSTOT2 FOR PRT$PART2 .AND. INVTYPE='E'
@C21,44 SAY '�'
SUM (RETAIL3-TAX3)*NUM3 TO SLSTOT3 FOR PRT$PART3 .AND. INVTYPE='E'
@C21,45 SAY '�'
SUM (RETAIL4-TAX4)*NUM4 TO SLSTOT4 FOR PRT$PART4 .AND. INVTYPE='E'
@C21,46 SAY '�'
SUM (RETAIL5-TAX5)*NUM5 TO SLSTOT5 FOR PRT$PART5 .AND. INVTYPE='E'
@C21,47 SAY '�'
SUM (RETAIL6-TAX6)*NUM6 TO SLSTOT6 FOR PRT$PART6 .AND. INVTYPE='E'
@C21,48 SAY '�'
SUM (RETAIL7-TAX7)*NUM7 TO SLSTOT7 FOR PRT$PART7 .AND. INVTYPE='E'
@C21,49 SAY '�'
SUM (RETAIL8-TAX8)*NUM8 TO SLSTOT8 FOR PRT$PART8 .AND. INVTYPE='E'
@C21,50 SAY '�'
SUM (RETAIL9-TAX9)*NUM9 TO SLSTOT9 FOR PRT$PART9 .AND. INVTYPE='E'
@C21,51 SAY '�'
IF INVLINES=C9
@C21,52 SAY '�'
@C21,53 SAY '�'
ELSE
SUM (RETAILA-TAXA)*NUMA TO SLSTOTA FOR PRT$PARTA .AND. INVTYPE='E'
@C21,52 SAY '�'
SUM (RETAILB-TAXB)*NUMB TO SLSTOTB FOR PRT$PARTB .AND. INVTYPE='E'
@C21,53 SAY '�'
ENDIF
IF INVLINES=C9
SLSTOT=SLSTOT+SLSTOT1+SLSTOT2+SLSTOT3+SLSTOT4+SLSTOT5+SLSTOT6+SLSTOT7+SLSTOT8+SLSTOT9
ELSE
SLSTOT=SLSTOT+SLSTOT1+SLSTOT2+SLSTOT3+SLSTOT4+SLSTOT5+SLSTOT6+SLSTOT7+SLSTOT8+SLSTOT9+SLSTOTA+SLSTOTB
ENDIF
SUM (RETAIL1-TAX1)*NUM1 TO SLSTOT1 FOR PRT$PART1 .AND. INVTYPE='X'
@C21,54 SAY '�'
SUM (RETAIL2-TAX2)*NUM2 TO SLSTOT2 FOR PRT$PART2 .AND. INVTYPE='X'
@C21,55 SAY '�'
SUM (RETAIL3-TAX3)*NUM3 TO SLSTOT3 FOR PRT$PART3 .AND. INVTYPE='X'
@C21,56 SAY '�'
SUM (RETAIL4-TAX4)*NUM4 TO SLSTOT4 FOR PRT$PART4 .AND. INVTYPE='X'
@C21,57 SAY '�'
SUM (RETAIL5-TAX5)*NUM5 TO SLSTOT5 FOR PRT$PART5 .AND. INVTYPE='X'
@C21,58 SAY '�'
SUM (RETAIL6-TAX6)*NUM6 TO SLSTOT6 FOR PRT$PART6 .AND. INVTYPE='X'
@C21,59 SAY '�'
SUM (RETAIL7-TAX7)*NUM7 TO SLSTOT7 FOR PRT$PART7 .AND. INVTYPE='X'
@C21,60 SAY '�'
SUM (RETAIL8-TAX8)*NUM8 TO SLSTOT8 FOR PRT$PART8 .AND. INVTYPE='X'
@C21,61 SAY '�'
SUM (RETAIL9-TAX9)*NUM9 TO SLSTOT9 FOR PRT$PART9 .AND. INVTYPE='X'
@C21,62 SAY '�'
IF INVLINES=C9
SLSTOT=SLSTOT+SLSTOT1+SLSTOT2+SLSTOT3+SLSTOT4+SLSTOT5+SLSTOT6+SLSTOT7+SLSTOT8+SLSTOT9
ELSE
SLSTOT=SLSTOT+SLSTOT1+SLSTOT2+SLSTOT3+SLSTOT4+SLSTOT5+SLSTOT6+SLSTOT7+SLSTOT8+SLSTOT9+SLSTOTA+SLSTOTB
ENDIF
@C22,37 SAY SLSTOT PICTURE '99999999.99'
@C23,37 SAY SLSNUM PICTURE '99999999'
WAIT
SET FILTER TO
USE
CASE PICK=C9
LCN='G'
@C22,C24 SAY 'Location (G/E):' GET LCN PICTURE '!'
READ
YORN=NA
@C22,C20 SAY '� �'
@C22,30 SAY 'Print (Y/N)?' GET YORN PICTURE '!'
READ
IF YORN=YA
SET PRINT ON
SET CONSOLE OFF
REPORT FORM HISTREP TO PRINT FOR UPPER(TRIM(LCN))$UPPER(LOCN) .AND. PTYPECASH+PTYPECHEQ+PTYPECARD#C0
SET PRINT OFF
SET CONSOLE ON
ELSE
@C19,C20 SAY '����������������������������������������Ŀ'
@C20,C20 SAY '� Sales: �'
@C21,C20 SAY '� Cost: �'
@C22,C20 SAY '� Av Margin: �'
@C23,C20 SAY '� No. Sales: �'
@C24,C20 SAY '������������������������������������������'
NME=TRIM(NME)
SUM PTYPECASH+PTYPECHEQ+PTYPECARD TO SLSTOT FOR UPPER(TRIM(LCN))$UPPER(LOCN)
@C20,35 SAY SLSTOT PICTURE '99999999.99'
SUM COST TO CSTTOT FOR UPPER(LCN)$UPPER(LOCN)
@C21,35 SAY CSTTOT PICTURE '99999999.99'
SUM PTYPECASH+PTYPECHEQ+PTYPECARD TO TAXTOT FOR UPPER(TRIM(LCN))$UPPER(LOCN) .AND. INVTYPE='T'
TAXTOT=TAXTOT*.2
@C22,35 SAY ((SLSTOT-CSTTOT-TAXTOT)/(SLSTOT+.01-TAXTOT))*100 PICTURE '99999999.99'
COUNT TO CNTTOT FOR UPPER(LCN)$UPPER(LOCN)
@C23,35 SAY CNTTOT PICTURE '99999999'
WAIT
ENDIF
SET FILTER TO
USE
ENDCASE
CASE CHOICE=C8
CALL FADE
PICK=C0
USE POSEQUIP
YEAR1=LTRIM(STR(YR0))+'/'+LTRIM(STR(YR0+C1))
YEAR2=LTRIM(STR(YR0-C1))+'/'+LTRIM(STR(YR0))
YEAR3=LTRIM(STR(YR0-C2))+'/'+LTRIM(STR(YR0-C1))
YEAR4=LTRIM(STR(YR0-C3))+'/'+LTRIM(STR(YR0-C2))
YEAR5=LTRIM(STR(YR0-C4))+'/'+LTRIM(STR(YR0-C3))
YEAR6=LTRIM(STR(YR0-C5))+'/'+LTRIM(STR(YR0-C4))
YEAR7=LTRIM(STR(YR0-C6))+'/'+LTRIM(STR(YR0-C5))
@C14,63 SAY '��������������Ŀ'
@C15,63 SAY '� �'
@C16,63 SAY '� �'
@C17,63 SAY '� �'
@C18,63 SAY '� �'
@C19,63 SAY '� �'
@C20,63 SAY '� �'
@C21,63 SAY '� �'
@C22,63 SAY '����������������'
@C15,65 PROMPT '1>'
@C16,65 PROMPT '2>'
@C17,65 PROMPT '3>'
@C18,65 PROMPT '4>'
@C19,65 PROMPT '5>'
@C20,65 PROMPT '6>'
@C21,65 PROMPT '7>'
@C15,68 SAY YEAR1
@C16,68 SAY YEAR2
@C17,68 SAY YEAR3
@C18,68 SAY YEAR4
@C19,68 SAY YEAR5
@C20,68 SAY YEAR6
@C21,68 SAY YEAR7
MENU TO HYR
IF HYR>C7
HYR=C1
ENDIF
DO CASE
CASE HYR=C1
SHIST='SALEHIST'
CASE HYR=C2
DYR='D'+SUBSTR(LTRIM(STR(YR0)),3,2)
SHIST='OLDHIST.'+DYR
CASE HYR=C3
DYR='D'+SUBSTR(LTRIM(STR(YR0-C1)),3,2)
SHIST='OLDHIST.'+DYR
CASE HYR=C4
DYR='D'+SUBSTR(LTRIM(STR(YR0-C2)),3,2)
SHIST='OLDHIST.'+DYR
CASE HYR=C5
DYR='D'+SUBSTR(LTRIM(STR(YR0-C3)),3,2)
SHIST='OLDHIST.'+DYR
CASE HYR=C6
DYR='D'+SUBSTR(LTRIM(STR(YR0-C4)),3,2)
SHIST='OLDHIST.'+DYR
CASE HYR=C7
DYR='D'+SUBSTR(LTRIM(STR(YR0-C5)),3,2)
SHIST='OLDHIST.'+DYR
ENDCASE
USE &SHIST
IF RECSIZE()>1200
INVLINES=C11
ELSE
INVLINES=C9
ENDIF
USE
CASE CHOICE=C0
RESTORE SCREEN FROM SCRN1
RETURN
ENDCASE
RESTORE SCREEN FROM SCRN1
ENDDO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment