Quozl's Prepaid Accounting
|
|
Introduction
This prepaid accounting system was written for the Gilgandra Community
Technology Centre in January 2001, and is used by the staff and the
customers of the centre to track login time spent on a set of legacy
Microsoft Windows workstations.
It uses the Linux system accounting files (/var/wtmp) to generate usage
transactions, stored in a plain text database. Based on PHP, the
system also provides up to the minute account balances and accepts
payments and charges.
Changes to the utility sac that summarises wtmp
records were required to clip the data by host name, so that multiple
SMB connections from the clients were merged into one accounting
transaction.
- implemented on a Debian GNU/Linux 3.0 (woody) server running
Apache, PHP, and Samba,
- tightly integrated with the sac package,
- does not require a database package, uses PHP serialize() data
storage only,
- no transaction erasure supported (reversing transactions must be
added, in compliance with accounting principles),
Resources
- Debian package archive, add deb
http://quozl.linux.org.au/packages ./ to your /etc/apt/sources.list file and then
install the package with apt-get install
ppa,
- mailing
list for users and developers, see the first
post for expectations; subscribe before posting, or your message
will be lost,
- ppa-1.4.tar.gz (786Kb), sources, sac
binaries for Intel and Alpha, along with Win32 listener process,
- ppa-1.3.tar.gz (776Kb), sources, sac
binaries for Intel and Alpha, along with Win32 listener process,
- ppa-1.3-2003-03-21.gz, patch to
1.3 for use of host names under Samba versions without "utmp
hostnames",
- sac-1.8b8-quozl.diff, patch to
sac to provide year in output and to clip wtmp records by hostname,
- sac-1.8b8-quozl.tar.gz (50Kb),
complete redistribution of sac with my patch applied, or see the upstream sources,
- prior version ppa-1.2.tar.gz (771Kb), sources, sac binaries for Intel and Alpha, along with Win32 listener process,
- prior version ppa-1.1.tar.gz (93Kb),
sources, including a sac binary for i686 and alpha, but missing the
Makefile.
- prior version ppa-1.0.tar.gz (97Kb),
again missing the Makefile.
- install Samba
- configure smb.conf
[global]
# make the ppa server the primary domain controller for a domain
preferred master = Yes
domain master = Yes
domain logons = Yes
os level = 34
# make the ppa server support utmp
utmp directory = /var/run
wtmp directory = /var/log
utmp = Yes
# provide time server
time server = Yes
# force use of a logon script
logon script = access.bat
[netlogon]
comment = The domain logon service
path = /export/samba/logon
browseable = No
- create the logon script that sets the time and maps at least one file share
# cat << EOF >> /export/samba/logon/access.bat
net time \\server /set /yes
net use p: \\server\public
EOF
- configure clients to logon to the Windows NT domain provided by the Samba server
- test client logon by checking that the 'who' command on the Samba server shows the client logged in
- install PPA as per the INSTALL file
- menus in text format rather than images,
- add packaging in Debian format,
- fix missing host names,
- add Debian and Red Hat specific install variables,
- register globals fix for later versions of PHP,
- add transaction report by item code.
- add Samba and client installation hints to INSTALL,
- verify installation instructions for Debian GNU/Linux 3.0 (Woody),
- account transaction aggregation for reduced database size,
- fix script timeouts when many transactions exist,
- add item codes for transactions,
- fix export warnings for accounts with no transactions,
- add rounding to nearest 5c mark for usage transactions,
- fix rounding problem, 4.14 was being rendered as 4.13.
- add per-client remote control program to direct users to account balance,
- add item codes to transactions so as to improve reporting by service type,
- implement export to comma separated value file,
- move site specific configuration out of program area,
- allow for administration functions from public workstations,
- prevent loop on some versions of PHP caused by readdir() return value.
- maintains an account per customer, including
- account name
- current balance
- history of transactions
- records transactions, such as
- usage of a workstation or shell account for a period of time
- payment at front desk
- miscellanous usage of hire equipment or consumables
- displays transactions
- to customer, via web page, on login
- to administrator, on a per-customer basis
- rollover accounting period
- summarise transactions from system accounting files
- record new balances per account
- exports data
- transactions or accounts
- comma separated values (CSV) format for input to spreadsheets
These screen shots are an inclusion of the HTML documents generated by
the software. This is how they should look in your browser.
Administrator Status Screen |
---|