-package C4::Accounts; #asummes C4/Accounts
-
-#requires DBI.pm to be installed
-#uses DBD:Pg
+package C4::Accounts; #assumes C4/Accounts
use strict;
require Exporter;
use C4::Stats;
use C4::InterfaceCDK;
use C4::Interface::AccountsCDK;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
+use vars qw($VERSION @ISA @EXPORT);
# set the version for version checking
$VERSION = 0.01;
@ISA = qw(Exporter);
@EXPORT = qw(&checkaccount &reconcileaccount &getnextacctno);
-%EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
-
-# your exported package globals go here,
-# as well as any optionally exported functions
-
-@EXPORT_OK = qw($Var1 %Hashit);
-
-
-# non-exported package globals go here
-use vars qw(@more $stuff);
-
-# initalize package globals, first exported ones
-
-my $Var1 = '';
-my %Hashit = ();
-
-# then the others (which are still accessible as $Some::Module::stuff)
-my $stuff = '';
-my @more = ();
-
-# all file-scoped lexicals must be created before
-# the functions below that use them.
-
-# file-private lexicals go here
-my $priv_var = '';
-my %secret_hash = ();
-
-# here's a file-private function as a closure,
-# callable as &$priv_func; it cannot be prototyped.
-my $priv_func = sub {
- # stuff goes here.
-};
-
-# make all your functions, whether exported or not;
-
sub displayaccounts{
my ($env)=@_;
}
-package C4::Accounts2; #asummes C4/Accounts2
-
-#requires DBI.pm to be installed
-#uses DBD:Pg
+package C4::Accounts2; #assumes C4/Accounts2
use strict;
+use warnings;
require Exporter;
use DBI;
use C4::Database;
use C4::Stats;
use C4::Search;
use C4::Circulation::Circ2;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
+use vars qw($VERSION @ISA @EXPORT);
# set the version for version checking
$VERSION = 0.01;
@ISA = qw(Exporter);
@EXPORT = qw(&recordpayment &fixaccounts &makepayment &manualinvoice
&getnextacctno);
-%EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
-
-# your exported package globals go here,
-# as well as any optionally exported functions
-
-@EXPORT_OK = qw($Var1 %Hashit);
-
-
-# non-exported package globals go here
-use vars qw(@more $stuff);
-
-# initalize package globals, first exported ones
-
-my $Var1 = '';
-my %Hashit = ();
-
-# then the others (which are still accessible as $Some::Module::stuff)
-my $stuff = '';
-my @more = ();
-
-# all file-scoped lexicals must be created before
-# the functions below that use them.
-
-# file-private lexicals go here
-my $priv_var = '';
-my %secret_hash = ();
-
-# here's a file-private function as a closure,
-# callable as &$priv_func; it cannot be prototyped.
-my $priv_func = sub {
- # stuff goes here.
-};
-
-# make all your functions, whether exported or not;
sub displayaccounts{
my ($env)=@_;
$updquery = "insert into accountoffsets
(borrowernumber, accountno, offsetaccount, offsetamount)
values ($bornumber,$accdata->{'accountno'},$nextaccntno,$newamtos)";
- my $usth = $dbh->prepare($updquery);
+ $usth = $dbh->prepare($updquery);
$usth->execute;
$usth->finish;
}
$updquery = "insert into accountlines
(borrowernumber, accountno,date,amount,description,accounttype,amountoutstanding)
values ($bornumber,$nextaccntno,now(),$payment,'Payment,thanks - $user', 'Pay',0)";
- my $usth = $dbh->prepare($updquery);
+ $usth = $dbh->prepare($updquery);
$usth->execute;
$usth->finish;
UpdateStats($env,$user,'payment',$amount,'','','',$bornumber);
$updquery = "insert into accountoffsets
(borrowernumber, accountno, offsetaccount, offsetamount)
values ($bornumber,$accdata->{'accountno'},$nextaccntno,$newamtos)";
- my $usth = $dbh->prepare($updquery);
+ $usth = $dbh->prepare($updquery);
$usth->execute;
$usth->finish;
}
$updquery = "insert into accountoffsets
(borrowernumber, accountno, offsetaccount, offsetamount)
values ($bornumber,$accdata->{'accountno'},$nextaccntno,$newamtos)";
- my $usth = $dbh->prepare($updquery);
+ $usth = $dbh->prepare($updquery);
$usth->execute;
$usth->finish;
}
$updquery = "insert into accountoffsets
(borrowernumber, accountno, offsetaccount, offsetamount)
values ($bornumber,$accdata->{'accountno'},$nextaccntno,$newamtos)";
- my $usth = $dbh->prepare($updquery);
+ $usth = $dbh->prepare($updquery);
$usth->execute;
$usth->finish;
}
-package C4::Circmain; #asummes C4/Circulation
+package C4::Circmain; #assumes C4/Circulation
#package to deal with circulation
use C4::InterfaceCDK;
use C4::Security;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
+use vars qw($VERSION @ISA @EXPORT);
# set the version for version checking
$VERSION = 0.01;
@ISA = qw(Exporter);
@EXPORT = qw(&Start_circ);
-%EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
-
-# your exported package globals go here,
-# as well as any optionally exported functions
-
-@EXPORT_OK = qw($Var1 %Hashit);
-
-
-# non-exported package globals go here
-use vars qw(@more $stuff);
-
-# initalize package globals, first exported ones
-
-my $Var1 = '';
-my %Hashit = ();
-
-# then the others (which are still accessible as $Some::Module::stuff)
-my $stuff = '';
-my @more = ();
-
-# all file-scoped lexicals must be created before
-# the functions below that use them.
-
-# file-private lexicals go here
-my $priv_var = '';
-my %secret_hash = ();
-
-# here's a file-private function as a closure,
-# callable as &$priv_func; it cannot be prototyped.
-my $priv_func = sub {
- # stuff goes here.
-};
-
-# make all your functions, whether exported or not;
sub Start_circ{
my ($env)=@_;
-package C4::Circulation; #asummes C4/Circulation
+package C4::Circulation; #assumes C4/Circulation
#package to deal with circulation
#use C4::Interface;
use C4::Security;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
+use vars qw($VERSION @ISA @EXPORT);
# set the version for version checking
$VERSION = 0.01;
@ISA = qw(Exporter);
@EXPORT = qw(&Start_circ &scanborrower);
-#@EXPORT = qw(&Start_circ checkoverdues);
-%EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
-
-# your exported package globals go here,
-# as well as any optionally exported functions
-
-@EXPORT_OK = qw($Var1 %Hashit);
-
-
-# non-exported package globals go here
-use vars qw(@more $stuff);
-
-# initalize package globals, first exported ones
-
-my $Var1 = '';
-my %Hashit = ();
-
-# then the others (which are still accessible as $Some::Module::stuff)
-my $stuff = '';
-my @more = ();
-
-# all file-scoped lexicals must be created before
-# the functions below that use them.
-
-# file-private lexicals go here
-my $priv_var = '';
-my %secret_hash = ();
-
-# here's a file-private function as a closure,
-# callable as &$priv_func; it cannot be prototyped.
-my $priv_func = sub {
- # stuff goes here.
-};
-
-# make all your functions, whether exported or not;
sub Start_circ{
my ($env)=@_;
-package C4::Format; #asummes C4/Format
+package C4::Format; #assumes C4/Format
use strict;
require Exporter;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
+use vars qw($VERSION @ISA @EXPORT);
# set the version for version checking
$VERSION = 0.01;
@ISA = qw(Exporter);
@EXPORT = qw(&fmtstr &fmtdec);
-%EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
-
-# your exported package globals go here,
-# as well as any optionally exported functions
-
-@EXPORT_OK = qw($Var1 %Hashit);
-
-
-# non-exported package globals go here
-use vars qw(@more $stuff);
-
-# initalize package globals, first exported ones
-
-my $Var1 = '';
-my %Hashit = ();
-
-# then the others (which are still accessible as $Some::Module::stuff)
-my $stuff = '';
-my @more = ();
-
-# all file-scoped lexicals must be created before
-# the functions below that use them.
-
-# file-private lexicals go here
-my $priv_var = '';
-my %secret_hash = ();
-
-# here's a file-private function as a closure,
-# callable as &$priv_func; it cannot be prototyped.
-my $priv_func = sub {
- # stuff goes here.
-};
-
-# make all your functions, whether exported or not;
sub fmtstr {
# format (space pad) a string
-
-package C4::InterfaceCDK; #asummes C4/InterfaceCDK
+package C4::InterfaceCDK; #assumes C4/InterfaceCDK
#uses Newt
use C4::Format;
require Exporter;
use DBI;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
+use vars qw($VERSION @ISA @EXPORT);
# set the version for version checking
$VERSION = 0.01;
&textbox &menu &issuewindow &msg_yn &msg_ny &borrower_dialog &debug_msg &error_msg
&info_msg &selborrower &returnwindow &logondialog &borrowerwindow &titlepanel
&borrbind &borrfill &preeborr &borrowerbox &brmenu &prmenu);
-%EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
-
-# your exported package globals go here,
-# as well as any optionally exported functions
-
-@EXPORT_OK = qw($Var1 %Hashit);
-# non-exported package globals go here
-use vars qw(@more $stuff);
-
-# initalize package globals, first exported ones
-
-my $Var1 = '';
-my %Hashit = ();
-
-# then the others (which are still accessible as $Some::Module::stuff)
-my $stuff = '';
-my @more = ();
-
-# all file-scoped lexicals must be created before
-# the functions below that se them.
-
-# file-private lexicals go here
-my $priv_var = '';
-my %secret_hash = ();
-#defining keystrokes used for screens
-my $key_tab = chr(9);
-my $key_ctlr = chr(18);
-my $lastval = $key_ctlr;
-
-# here's a file-private function as a closure,
-# callable as &$priv_func; it cannot be prototyped.
-my $priv_func = sub {
- # stuff goes here.
-};
-
-# make all your functions, whether exported or not;
sub suspend_cb {
-
+ # is this planned for something?
}
sub startint {
use strict;
require Exporter;
+use C4::Database;
use vars qw($VERSION @ISA @EXPORT);
@ISA = qw(Exporter);
@EXPORT = qw(&slashifyDate
&fixEthnicity
+ &borrowercategories
+ ðnicitycategories
$DEBUG);
use vars qw();
return("$dateOut[2]/$dateOut[1]/$dateOut[0]")
}
-sub fixEthnicity($) { # a temporary fix ethnicity, it should really be handled
- # in Search.pm or the DB ...
+sub fixEthnicity($) {
my $ethnicity = shift;
- if ($ethnicity eq 'maori') {
- $ethnicity = 'Maori';
- } elsif ($ethnicity eq 'european') {
- $ethnicity = 'European/Pakeha';
- } elsif ($ethnicity eq 'pi') {
- $ethnicity = 'Pacific Islander'
- } elsif ($ethnicity eq 'asian') {
- $ethnicity = 'Asian';
+ my $dbh=C4Connect;
+ my $sth=$dbh->prepare("Select name from ethnicity where code = ?");
+ $sth->execute($ethnicity);
+ my $data=$sth->fetchrow_hashref;
+ $sth->finish;
+ $dbh->disconnect;
+ return $data->{'name'};
+}
+
+sub borrowercategories {
+ my $dbh=C4Connect;
+ my $sth=$dbh->prepare("Select categorycode,description from categories order by description");
+ $sth->execute;
+ my %labels;
+ my @codes;
+ while (my $data=$sth->fetchrow_hashref){
+ push @codes,$data->{'categorycode'};
+ $labels{$data->{'categorycode'}}=$data->{'description'};
}
- return $ethnicity;
+ $sth->finish;
+ $dbh->disconnect;
+ return(\@codes,\%labels);
}
+sub ethnicitycategories {
+ my $dbh=C4Connect;
+ my $sth=$dbh->prepare("Select code,name from ethnicity order by name");
+ $sth->execute;
+ my %labels;
+ my @codes;
+ while (my $data=$sth->fetchrow_hashref){
+ push @codes,$data->{'code'};
+ $labels{$data->{'code'}}=$data->{'name'};
+ }
+ $sth->finish;
+ $dbh->disconnect;
+ return(\@codes,\%labels);
+}
1;
__END__
$date = slashifyDate("01-01-2002")
-
-
+ $ethnicity=fixEthnicity('asian');
+ ($categories,$labels)=borrowercategories();
=head1 DESCRIPTION
-package C4::Maintainance; #asummes C4/Maintainance
+package C4::Maintainance; #assumes C4/Maintainance
#package to deal with marking up output
require Exporter;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
+use vars qw($VERSION @ISA @EXPORT);
# set the version for version checking
$VERSION = 0.01;
@ISA = qw(Exporter);
@EXPORT = qw(&listsubjects &updatesub &shiftgroup &deletedbib &undeletebib
&updatetype);
-%EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
-
-# your exported package globals go here,
-# as well as any optionally exported functions
-
-@EXPORT_OK = qw($Var1 %Hashit);
-
-
-# non-exported package globals go here
-use vars qw(@more $stuff);
-
-# initalize package globals, first exported ones
-
-my $Var1 = '';
-my %Hashit = ();
-
-
-# then the others (which are still accessible as $Some::Module::stuff)
-my $stuff = '';
-my @more = ();
-
-# all file-scoped lexicals must be created before
-# the functions below that use them.
-
-# file-private lexicals go here
-my $priv_var = '';
-my %secret_hash = ();
-
-# here's a file-private function as a closure,
-# callable as &$priv_func; it cannot be prototyped.
-my $priv_func = sub {
-# stuff goes here.
- };
-
-# make all your functions, whether exported or not;
sub listsubjects {
my ($sub,$num,$offset)=@_;
-package C4::Print; #asummes C4/Print.pm
+package C4::Print; #assumes C4/Print.pm
use strict;
require Exporter;
#use C4::InterfaceCDK;
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
+use vars qw($VERSION @ISA @EXPORT);
# set the version for version checking
$VERSION = 0.01;
@ISA = qw(Exporter);
@EXPORT = qw(&remoteprint &printreserve);
-%EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
-
-# your exported package globals go here,
-# as well as any optionally exported functions
-
-@EXPORT_OK = qw($Var1 %Hashit);
-
-
-# non-exported package globals go here
-use vars qw(@more $stuff);
-
-# initalize package globals, first exported ones
-
-my $Var1 = '';
-my %Hashit = ();
-
-
-# then the others (which are still accessible as $Some::Module::stuff)
-my $stuff = '';
-my @more = ();
-
-# all file-scoped lexicals must be created before
-# the functions below that use them.
-
-# file-private lexicals go here
-my $priv_var = '';
-my %secret_hash = ();
-
-# here's a file-private function as a closure,
-# callable as &$priv_func; it cannot be prototyped.
-my $priv_func = sub {
- # stuff goes here.
- };
-
-# make all your functions, whether exported or not;
sub remoteprint {
my ($env,$items,$borrower)=@_;
-package C4::Security; #asummes C4/Security
-
-#requires DBI.pm to be installed
-#uses DBD:Pg
+package C4::Security; #assumes C4/Security
use strict;
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(&Login &CheckAccess);
-%EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
-
-# your exported package globals go here,
-# as well as any optionally exported functions
-
-@EXPORT_OK = qw($Var1 %Hashit);
-
-
-# non-exported package globals go here
-use vars qw(@more $stuff);
-
-# initalize package globals, first exported ones
-
-my $Var1 = '';
-my %Hashit = ();
-
-
-# then the others (which are still accessible as $Some::Module::stuff)
-my $stuff = '';
-my @more = ();
-
-# all file-scoped lexicals must be created before
-# the functions below that use them.
-
-# file-private lexicals go here
-my $priv_var = '';
-my %secret_hash = ();
-# here's a file-private function as a closure,
-# callable as &$priv_func; it cannot be prototyped.
-my $priv_func = sub {
-# stuff goes here.
- };
-
-# make all your functions, whether exported or not;
-
sub Login {
my ($env)=@_;
my $dbh=C4Connect;
-package C4::Stats; #asummes C4/Stats
-
-#requires DBI.pm to be installed
-#uses DBD:Pg
+package C4::Stats; #assumes C4/Stats
use strict;
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(&UpdateStats &statsreport &Count &Overdues &TotalOwing
&TotalPaid &getcharges &Getpaidbranch &unfilledreserves);
-%EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
-
-# your exported package globals go here,
-# as well as any optionally exported functions
-
-@EXPORT_OK = qw($Var1 %Hashit);
-
-
-# non-exported package globals go here
-use vars qw(@more $stuff);
-
-# initalize package globals, first exported ones
-
-my $Var1 = '';
-my %Hashit = ();
-
-
-# then the others (which are still accessible as $Some::Module::stuff)
-my $stuff = '';
-my @more = ();
-
-# all file-scoped lexicals must be created before
-# the functions below that use them.
-
-# file-private lexicals go here
-my $priv_var = '';
-my %secret_hash = ();
-
-# here's a file-private function as a closure,
-# callable as &$priv_func; it cannot be prototyped.
-my $priv_func = sub {
- # stuff goes here.
- };
-
-# make all your functions, whether exported or not;
sub UpdateStats {
#module to insert stats data into stats table
-package C4::Stock; #asummes C4/Stock.pm
+package C4::Stock; #assumes C4/Stock.pm
use strict;
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(&stockreport);
-%EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
-
-# your exported package globals go here,
-# as well as any optionally exported functions
-
-@EXPORT_OK = qw($Var1 %Hashit);
-
-
-# non-exported package globals go here
-use vars qw(@more $stuff);
-
-# initalize package globals, first exported ones
-
-my $Var1 = '';
-my %Hashit = ();
-
-
-# then the others (which are still accessible as $Some::Module::stuff)
-my $stuff = '';
-my @more = ();
-
-# all file-scoped lexicals must be created before
-# the functions below that use them.
-
-# file-private lexicals go here
-my $priv_var = '';
-my %secret_hash = ();
-
-# here's a file-private function as a closure,
-# callable as &$priv_func; it cannot be prototyped.
-my $priv_func = sub {
- # stuff goes here.
- };
-
-# make all your functions, whether exported or not;
sub stockreport {
my $dbh=C4Connect;
END { } # module clean-up code here (global destructor)
+