1 package C4::Interface::AccountsCDK; #asummes C4/Interface/AccountsCDK
5 # Copyright 2000-2002 Katipo Communications
7 # This file is part of Koha.
9 # Koha is free software; you can redistribute it and/or modify it under the
10 # terms of the GNU General Public License as published by the Free Software
11 # Foundation; either version 2 of the License, or (at your option) any later
14 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
15 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License along with
19 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
20 # Suite 330, Boston, MA 02111-1307 USA
28 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
30 # set the version for version checking
34 @EXPORT = qw(&accountsdialog);
35 %EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
37 # your exported package globals go here,
38 # as well as any optionally exported functions
40 @EXPORT_OK = qw($Var1 %Hashit);
41 # non-exported package globals go here
42 use vars qw(@more $stuff);
44 # initalize package globals, first exported ones
49 # then the others (which are still accessible as $Some::Module::stuff)
53 # all file-scoped lexicals must be created before
54 # the functions below that use them.
56 # file-private lexicals go here
60 # here's a file-private function as a closure,
61 # callable as &$priv_func; it cannot be prototyped.
66 # make all your functions, whether exported or not;
71 my ($env,$title,$borrower,$accountlines,$amountowing)=@_;
72 my $titlepanel = titlepanel($env,$env->{'sysarea'},"Money Owing");
75 #$borinfo[0] = "$borrower->{'cardnumber'}";
76 #$borinfo[1] = "$borrower->{'surname'}, $borrower->{'title'} $borrower->{'firstname'} ";
77 #$borinfo[2] = "$borrower->{'streetaddress'}, $borrower->{'city'}";
78 #$borinfo[3] = "<R>Total Due: </B>".fmtdec($env,$amountowing,"52");
80 # new Cdk::Label ('Message' =>\@borinfo, 'Ypos'=>4, 'Xpos'=>"RIGHT");
81 my $borpanel = borrowerbox($env,$borrower,$amountowing);
83 my @sel = ("N ","Y ");
84 my $acctlist = new Cdk::Selection ('Title'=>"Outstanding Items",
85 'List'=>\@$accountlines,'Choices'=>\@sel,'Height'=>12,'Width'=>80,
86 'Xpos'=>1,'Ypos'=>10);
87 my @amounts=$acctlist->activate();
93 for (my $i=0;$i<$count;$i++){
94 if ($amounts[$i] == 1){
96 if ($accountlines->[$i]=~ /(^[0-9]+)/){
99 if ($accountlines->[$i]=~/([0-9]+\.[0-9]+)/){
102 my $borrowerno=$borrower->{'borrowernumber'};
103 makepayment($borrowerno,$accountno,$amount2);
108 my $amountentry = new Cdk::Entry('Label'=>"Amount: ",
109 'Max'=>"10",'Width'=>"10",
110 'Xpos'=>"1",'Ypos'=>"3",
112 $amountentry->preProcess ('Function' => sub{preamt(@_,$env,$acctlist);});
116 $amount =$amountentry->activate();
118 $amountentry->set('Value'=>$amount);
119 $amount=$amountentry->activate();
121 # debug_msg($env,"accounts $amount barcode=$accountno");
122 if (!defined $amount) {
123 #debug_msg($env,"escaped");
124 #$reason="Finished user";
128 $amountentry->erase();
136 return($amount,$reason);
140 my ($input,$env,$acctlist)= @_;
141 my $key_tab = chr(9);
142 if ($input eq $key_tab) {
143 actlist ($env,$acctlist);
150 my ($env,$acctlist) = @_;
151 $acctlist->activate();
155 END { } # module clean-up code here (global destructor)