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
22 # FIXME - I'm pretty sure that this, along with the rest of the
23 # CDK-based stuff, is obsolete.
31 use vars qw($VERSION @ISA @EXPORT);
33 # set the version for version checking
36 @EXPORT = qw(&accountsdialog);
39 my ($env,$title,$borrower,$accountlines,$amountowing)=@_;
40 my $titlepanel = titlepanel($env,$env->{'sysarea'},"Money Owing");
43 #$borinfo[0] = "$borrower->{'cardnumber'}";
44 #$borinfo[1] = "$borrower->{'surname'}, $borrower->{'title'} $borrower->{'firstname'} ";
45 #$borinfo[2] = "$borrower->{'streetaddress'}, $borrower->{'city'}";
46 #$borinfo[3] = "<R>Total Due: </B>".fmtdec($env,$amountowing,"52");
48 # new Cdk::Label ('Message' =>\@borinfo, 'Ypos'=>4, 'Xpos'=>"RIGHT");
49 my $borpanel = borrowerbox($env,$borrower,$amountowing);
51 my @sel = ("N ","Y ");
52 my $acctlist = new Cdk::Selection ('Title'=>"Outstanding Items",
53 'List'=>\@$accountlines,'Choices'=>\@sel,'Height'=>12,'Width'=>80,
54 'Xpos'=>1,'Ypos'=>10);
55 my @amounts=$acctlist->activate();
61 for (my $i=0;$i<$count;$i++){
62 if ($amounts[$i] == 1){
64 if ($accountlines->[$i]=~ /(^[0-9]+)/){
67 if ($accountlines->[$i]=~/([0-9]+\.[0-9]+)/){
70 my $borrowerno=$borrower->{'borrowernumber'};
71 makepayment($borrowerno,$accountno,$amount2);
75 my $amountentry = new Cdk::Entry('Label'=>"Amount: ",
76 'Max'=>"10",'Width'=>"10",
77 'Xpos'=>"1",'Ypos'=>"3",
79 $amountentry->preProcess ('Function' => sub{preamt(@_,$env,$acctlist);});
83 $amount =$amountentry->activate();
85 $amountentry->set('Value'=>$amount);
86 $amount=$amountentry->activate();
88 # debug_msg($env,"accounts $amount barcode=$accountno");
89 if (!defined $amount) {
90 #debug_msg($env,"escaped");
91 #$reason="Finished user";
95 $amountentry->erase();
103 return($amount,$reason);
107 my ($input,$env,$acctlist)= @_;
108 my $key_tab = chr(9);
109 if ($input eq $key_tab) {
110 actlist ($env,$acctlist);
117 my ($env,$acctlist) = @_;
118 $acctlist->activate();
122 END { } # module clean-up code here (global destructor)