#!/usr/bin/perl
# Copyright 2001-2008 Leslie Richardson
# This file is part of Open Admin for Schools.
# Open Admin for Schools is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
# Generate Receipts for Payments.
# Note: The payment id (id of record with a trans_type = 'pay'), will
# find all of the payments on existing records, but will not locate
# any new roa (received on account) records created by this
# payment. These are found by looking up the receipt number for a
# record of type 'roa'. This will be a new roa type created by this
# payment. roa records are only generated if a particular charge is
# not paid in full by the payment. Since this payment cannot be linked
# to this charge (since not paid in full), a non linked roa record is
# created instead.
# ROA's are NULL for paid_id but have a receipt value from payment
# that created them. Once 'paid'... associated with a payment
# transaction... the paid_id is filled in with this payment
# transaction.
my %lex = ('View / Print Receipts' => 'View / Print Receipts',
'No Transactions Found' => 'No Transactions Found',
'Fees' => 'Fees',
'Main' => 'Main',
'Total' => 'Total',
'Payment' => 'Payment',
'Date' => 'Date',
'Invoice' => 'Invoice',
'Description' => 'Description',
'Owing' => 'Owing',
'Receipt Number' => 'Receipt Number',
'Paid' => 'Paid',
'Total Paid' => 'Total Paid',
'View Log File' => 'View Log File',
'Student' => 'Student',
'Action' => 'Action',
'Search' => 'Search',
'No Students Found' => 'No Students Found',
'Please search again' => 'Please search again',
'Student (Last,First/Last/Initials/Studnum)' =>
'Student (Last,First/Last/Initials/Studnum)',
'Print Receipt' => 'Print Receipt',
'Continue' => 'Continue',
'Date' => 'Date',
'Amount' => 'Amount',
'Description' => 'Description',
'View/Download' => 'View/Download',
'Grade' => 'Grade',
'Receipt' => 'Receipt',
'Address' => 'Address',
'Phone' => 'Phone',
'Fax' => 'Fax',
'Payment' => 'Payment',
'Signature' => 'Signature',
'Payee' => 'Payee',
'Name' => 'Name',
'Error' => 'Error',
);
my $self = 'receipt.pl';
use CGI;
use DBI;
use Cwd;
my $q = new CGI;
print $q->header;
my %arr = $q->Vars;
eval require "../../etc/admin.conf";
if ( $@ ) {
print $lex{Error}. " $@
\n";
die $lex{Error}. " $@\n";
}
eval require "../../etc/fees.conf";
if ( $@ ) {
print $lex{Error}. " $@
\n";
die $lex{Error}. " $@\n";
}
my $dsn = "DBI:$dbtype:dbname=$dbase";
my $dbh = DBI->connect($dsn,$user,$password);
# Get current dir so know what CSS to display;
#if (getcwd() =~ /tcgi/){ # we are in tcgi
# $css = $tchcss;
#}
# Show page Header
print "$doctype\n
| ". $lex{Student}. " | ". $lex{Date}. " | "; print $lex{Amount}. " | "; print $lex{Description}. " | ". $lex{Action}. " |
|---|---|---|---|---|
| $firstname $lastname | \n"; print "$trans_date | $total | $description | \n"; print " |