Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : SBBILL.ZIP
Filename : BILLING.PRG

 
Output of file : BILLING.PRG contained in archive : SBBILL.ZIP
* TITLE......SBBILL.EXE
* AUTHOR.....CRAIG S. STEINBERG, OD
* DATE.......NOV. 18, 1987
* NOTICE.....COPYRIGHT (C) 1987, ALL RIGHTS RESERVED
*
* DESCRIPTION
* SBBILL is a simple Small Business BILLing system designed for
* sending out "single job" statements. It is not designed for a
* large service orientated business (i.e. doctors office, etc.)
* because of its lack of true aging and its inability to show only
* current (since last time balance was 0.00) charges. All of a
* clients account activity appears on statements which is ideal for
* single job type billings (i.e. carpentry, plumbing, etc.).
*
* Data File Structures and Index Files:
*
* CLIENT.DBF ACCOUNT.DBF
* 1 Clientno N 4 1 Clientno N 4
* 2 Last C 15 2 Date D 8
* 3 First C 10 3 Charge N 10 2
* 4 Title C 4 4 Paid N 10 2
* 5 Address C 25 5 Des C 60
* 6 City C 25 index on str(clientno,4)+dtos(date) to account
* 7 Zip C 5
* 8 Phone C 14 HELP.DBF
* 9 Des C 30 1 Line0 C 78
* 10 Start D 8 2 Line1 C 78
* 11 Due D 8 3 Line2 C 78
* 12 Balance N 10 2 4 Line3 C 78
* 5 Line4 C 78
*
* COMPILING
* (note: requires AUTUMN '86 or later version of Clipper)
* CLIPPER BILLING
* LINKING
* PLINK86 @BILLING
* or
* PLINK86 FI BILLING,EXTENDDB,EXTENDC,EXTENDA OUTPUT SBBILL VERBOSE
*
* Address questions to Dr. Craig S. Steinberg
* CompuServe ID 70166,337 (IBMSW SIG)
* Source ID NA2606 (NANSIG)
*
* Comments, improvements and suggestions are welcome.


* --- get command line parameter, if any (designed to override copy protect).
PARAMETER SkipCheck
* if no parameter, create a null memvar to be sure one exists
if type('SKIPCHECK')='U'
skipcheck=''
endif

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* "COPY" PROTECTION SCHEME (remove comments to activate) *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

* --- if a single command line parameter, one character, is passed, skip the
* check for a valid system and continue (for programmers benefit)
*if len(skipcheck)<>1
* --- check for valid system with enviromental variable
* must run SET BDIR=C in Autoexec.Bat to make system run
* (change or delete this to suit)
* store GETE("BDIR") to checkit && GETE is in EXTENDC
* if upper(checkit) <> 'C' && EXTENDC is not required if you
* ? && have removed these lines
* ? 'Sorry, this is an invalid copy of the billing system.'
* ?
* ?? chr(7)
* quit
* endif
*endif

* --- if the system mem file with office address isn't there, get it
if .not. file('BILLING.MEM')
do memdata
endif

* --- set default colors for color system (yellow on blue background)
if iscolor()
set color to +GR/B,B/W
else
set color to
endif

* --- in area 2 open the ACCOUNT file with its index
SELECT 2
USE account INDEX account

* --- in area 1 open the CLIENT file
SELECT 1
USE client

* --- make sure deleted records do not show up
SET deleted ON

* --- get office name and address memvars for use in system
RESTORE FROM billing ADDITIVE
PUBLIC Oname, Oaddr, Ocity, Ozip, Ophone

* --- begin main program loop
DO WHILE .T.

* --- draw menu
Clear
set message to 23

* --- business data centered at top of screen
@ 1,center('CLIENT BILLING SYSTEM') say 'CLIENT BILLING SYSTEM'
@ 3,center(trim(Oname)) say trim(Oname)
@ 4,center(trim(Oaddr)) say trim(Oaddr)
@ 5,center(trim(Ophone)) say trim(Ophone)

@ 8,center('MAIN MENU') say 'MAIN MENU'

@ 10,30 prompt ' 1 Enter New Client ' message cen('Put name and address information for a new client into the computer.')
@ 11,30 prompt ' 2 Review a Client ' message cen('Look at or change a clients basic name and address information.')
@ 12,30 prompt ' 3 Print Client List ' message cen('Display or print a list of your clients with client number.')

@ 14,30 prompt ' 4 Enter Charges ' message cen('Enter a new charge for a job, including amount and description.')
@ 15,30 prompt ' 5 Enter Payments ' message cen('Enter a client payment to credit an account that owes you money.')
@ 16,30 prompt ' 6 Review Accounts ' message cen('View a clients account or print a list of all accounts with current balance.')
@ 17,30 prompt ' 7 Print Statements ' message cen('Print a statement for one or all accounts that owe you money.')

@ 19,30 prompt ' 9 Maintenance Menu ' message cen('Maintain data files, backup data and delete clients and/or charges.')
@ 20,30 prompt ' 0 Quit and Exit ' message cen('Close all files and exit the billing system.')

* --- get selection
menu to choice

DO CASE
CASE choice = 0 .or. choice = 9
do exit
CASE choice = 1
do new
CASE choice = 2
do edit
CASE choice = 3
do cli_list
CASE choice = 4
do charges
CASE choice = 5
do payments
CASE choice = 6
do review
CASE choice = 7
do states
CASE choice = 8
do maintain
ENDCASE
ENDDO
* = = = = = = = = = = = = = = = = = = = =
* END OF MAIN PROGRAM STRUCTURE


* = = = = = = = = = = = = = = = = = = = = = = = = = = =
* * * * USER DEFINED FUNCTIONS AND PROCEDURES * * * * *
* = = = = = = = = = = = = = = = = = = = = = = = = = = =

* --- return row for a centered string
FUNCTION center
PARAM string
RETURN int((80 - len(string)) / 2)
* = = = = = = = = = = = = = = = = = = = =

* --- center a line
FUNCTION cen
PARAM string
PRIVATE l,sp
l = LEN(LTRIM(TRIM(string)))
sp = INT((80-l)/2)
RETURN SPACE(sp) + string + SPACE(sp)
* = = = = = = = = = = = = = = = = = = = =


* --- HELP.PRG
* simple program to provide help to each of the calling programs
PROCEDURE HELP
PARAMETER prg, lineno, variable

* --- if the help data file is not there, return without help
if ! file('HELP.DBF')
return
endif

* --- depending upon the calling program, get the correct help record
mrec = 0
DO CASE
CASE prg = 'BILLING'
mrec=1
CASE prg = 'EXIT'
mrec=2
CASE prg = 'NEW'
mrec=3
CASE prg = 'EDIT'
mrec=4
CASE prg = 'CLI_LIST'
mrec=5
CASE prg = 'CHARGES'
mrec=6
CASE prg = 'PAYMENTS'
mrec=7
CASE prg = 'REVIEW'
mrec=8
CASE prg = 'STATES'
mrec=9
CASE prg = 'MAINTAIN'
mrec=10
CASE prg = 'GETDATA'
mrec=11
CASE prg = 'DELCLI'
mrec=12
CASE prg = 'DELCHRG'
mrec=13
CASE prg = 'DELPAY'
mrec=14
CASE prg = 'BACKDATA'
mrec=15
CASE prg = 'MEMDATA'
mrec=16
CASE prg = 'REVIEW'
mrec=17
CASE prg = 'REVONE'
mrec=18
CASE prg = 'REVALL'
mrec=19
CASE prg = 'STAONE'
mrec=20
ENDCASE

* --- if the calling program has help available...
if mrec > 0
* --- HELP.DBF has the following structure
* line0 to line4 C 78
selected = str(select()) && remember the currently selected area
select 0 && select the next open area
use help && open the help.dbf file
if mrec > reccount() && if the help record doesn't exit...
use && close the help file
select &selected && return to the old work area
return && return to the calling program
endif
go mrec && otherwise, point to the help record
save screen && save the current screen

* --- set color to white on blue or reverse video
if iscolor()
set color to +W/B
else
set color to n/w
endif

r = 18 && starting row for help at bottom of screen

* --- clear a box at the bottom of the screen and put a line around it
@ r-3,0 clear to r+5,79
@ r-2,0 to r+6,79

* --- display the five lines (fields) of the help record
for x = 0 to 4
y=str(x,1)
@ r+x,1 say line&y
next

* --- give instruction for exiting help
@ r-2,23 say ' [ Press to leave HELP ] '

* --- restore the colors
if iscolor()
set color to +GR/B,B/W
else
set color to
endif

* --- wait for (chr13) to be pressed
i=0
do while i=0
i=inkey()
if i=13
exit
endif
enddo

* --- restore the prehelp screen and close the help file
restore screen
use
select &selected
endif
return
* eof help.prg
* = = = = = = = = = = = = = = = = = = = =





  3 Responses to “Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : SBBILL.ZIP
Filename : BILLING.PRG

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/