home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Du Jour
/
SoftwareDuJour.iso
/
BUSINESS
/
DBASE
/
DB3.ARC
/
JOBCOSTS.PRG
< prev
next >
Wrap
Text File
|
1984-10-25
|
6KB
|
233 lines
********** Jobcosts COMMAND FILE **********
* Provides summaries of costs by client and job number. This can
* also be used to summarize all office categories, since they fall
* into these fields.
* REPORTS ARE BY JOB NUMBER. Client code is used only in the heading.
* The report is actually prepared based on the job number, so accuracy is
* critical.
*******************************************************************
SELECT 2
USE Postfile
SELECT 3
USE Costbase INDEX Costjobs,Costname
SELECT 9
USE Billings INDEX Billjobs,Billings
*
* First, check to see whether there are still costs that have not been
* posted into the Costbase from the Postfile
SELECT 2
COUNT FOR .NOT. DELETED() TO Any
IF Any > 0
?
? 'There are '+STR(Any,5)+' entries in the Postfile.'
WAIT 'Do you still want to do the Job Costs (Y or N). ' TO Continue
IF UPPER(Continue) <> 'Y'
RETURN
ENDIF
ENDIF
*
RESTORE FROM Konstant
*
* Initialize memory variables
Random = 0
Again = ' '
*
DO WHILE LEN(Again) <> 0
MClient = ' '
MJob_Nmbr = ' '
Hardcopy = ' '
Number = 'N'
*
CLEAR
@ 2,11 SAY ' JOB COST SUMMARY :'
@ 4,11 SAY 'ENTER CLIENT CODE ' GET MClient PICTURE '!!!'
@ 5,11 SAY ' ENTER JOB NUMBER ' GET MJob_Nmbr PICTURE '!!!!'
@ 6,11 SAY ' P to PRINT ' GET Hardcopy PICTURE '!'
@ 7,11 SAY 'SHOW BILL NUMBERS ' GET Number PICTURE '!'
*
Getting = SPACE(1)
DO WHILE LEN(Getting) <> 0
READ SAVE
@ 8,0 CLEAR
IF ' ' $ MClient
@ 9,10 SAY 'CLIENT code is 3 characters.'
ENDIF
IF VAL(MJob_Nmbr) >99 .AND. VAL(MJob_Nmbr) <1000 .OR. VAL(MJob_Nmbr) <=0
* Clear to end of screen
@ 10,10 SAY 'The JOB NUMBER is wrong.'
@ 11,15 SAY 'Agency jobs are 2 digits,'
@ 12,15 SAY 'Client jobs are 4 digits.'
ENDIF
@ 14,10 SAY 'Type any key to correct it,'
WAIT '<ENTER> to finish.' TO Getting
@ 14,0
ENDDO
Again = Getting
CLEAR GETS
*
@ 8,0 CLEAR
ACCEPT ' OPTIONAL JOB DESCRIPTION ' TO Message
Message = TRIM(UPPER(Message))
*
?
?
CLEAR
IF Hardcopy = 'P'
SET PRINT ON
ENDIF
*
IF Number = 'Y'
Switch = 'Bill #'
ELSE
Switch = SPACE(0)
ENDIF
*
? DTOC(Date()) + ': COST SUMMARY' + ' FOR &MClient-'
?? &MJob_Nmbr
? SPACE(12) + Message
?
? 'DATE NAME DESCRIPTION AMOUNT';
+' &Switch'
?
SELECT 3
IF Number = 'Y'
Switch = ',Bill_Nmbr'
ELSE
Switch = ''
ENDIF
*
STORE 0 TO Costs, Inside, Buyouts, HowMany, LineCnt, Spacer
FIND &MJob_Nmbr
IF RECNO() <> 0
DO WHILE Job_Nmbr = VAL(MJob_Nmbr) .AND. .NOT. EOF()
IF .NOT. DELETED()
? Bill_Date, Name, Descrip+' ', Amount &Switch
*
IF Check_Nmbr = '--'
Inside = Inside + Amount
ELSE
Buyouts = Buyouts + Amount
ENDIF
Costs = Costs + Amount
*
LineCnt = LineCnt + 1
Spacer = Spacer + 1
*
IF Spacer = 10
Spacer = 0
?
ENDIF
*
IF LineCnt = 50
* formfeed with print on
IF Hardcopy = 'P'
SET CONSOLE OFF
? CHR(12)
SET CONSOLE ON
SET PRINT OFF
ENDIF
*
STORE 0 TO LineCnt, Spacer
*
? 'DATE NAME DESCRIPTION';
+ SPACE(16) + 'AMOUNT'
?
ENDIF
ENDIF
SKIP
ENDDO
ENDIF
*
? SPACE(54) + '----------'
? STR(Inside,9,2) +' inside costs + '+ STR(Buyouts,9,2);
+ ' buyouts = TOTAL: ' + STR(Costs,9,2)
?
Min = Inside + 1.18 * Buyouts
? SPACE(15) + 'IF ALL COSTS ARE IN, bill this amount: ' + STR(Min,9,2)
?
LineCnt = LineCnt + 5
Spacer = 0
IF LineCnt = 40
LineCnt = 0
IF Hardcopy = 'P'
SET CONSOLE OFF
? CHR(12)
SET CONSOLE ON
SET PRINT OFF
ENDIF
ELSE
?
?
?
ENDIF
*
SELECT 9
? 'BILLED TO DATE FOR &MClient-'
?? &MJob_Nmbr
?
? 'DATE INV# TAXABLE TAX TAX FREE DESCRIPTION'
?
LineCnt = LineCnt + 4
STORE 0 TO Costs, T, S, F
*
STORE 0 TO Costs, Inside, Buyouts, HowMany, LineCnt, Spacer
FIND &MJob_Nmbr
IF RECNO() <> 0
DO WHILE Job_Nmbr = VAL(MJob_Nmbr) .AND. .NOT. EOF()
IF .NOT. DELETED()
? Inv_Date, Inv_Nmbr, STR(Taxable,9,2) + ' ' +;
STR(Sales_Tax,9,2) + ' ', TaxFree, Descrip
T = T + Taxable
S = S + Sales_Tax
F = F + TaxFree
LineCnt = LineCnt + 1
Spacer = Spacer + 1
*
IF Spacer = 10
Spacer = 0
?
ENDIF
*
IF LineCnt = 50
LineCnt = 0
Spacer = 0
*
IF Hardcopy = 'P'
SET CONSOLE OFF
? CHR(12)
SET CONSOLE ON
SET PRINT OFF
ENDIF
*
? 'DATE INV# TAXABLE TAX TAX FREE';
+ ' DESCRIPTION'
?
ENDIF
ENDIF
SKIP
ENDDO
ENDIF
*
Costs = T + S + F
? SPACE(15) + '--------- --------- ---------'
? ' SUB-TOTALS: '+STR(T,9,2) + ' '+STR(S,9,2)+' ' + STR(F,9,2)
? SPACE(37) + '----------'
? SPACE(30) + 'BILLED ' + STR(T+F,9,2)
IF S > 0
?? ' + tax.'
ENDIF
*
IF Hardcopy = 'P'
SET CONSOLE OFF
? CHR(12)
SET CONSOLE ON
SET PRINT OFF
ENDIF
*
? 'Type any key to continue,'
WAIT 'press <ENTER> to exit.' TO Again
ENDDO Again
*
CLOSE DATABASE
RETURN