View | Details | Raw Unified | Return to bug 4440
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tmpl (-1 / +9 lines)
Lines 33-38 Link Here
33
    <th>Amount</th>
33
    <th>Amount</th>
34
    <th>Outstanding</th>
34
    <th>Outstanding</th>
35
    <th>&nbsp;</th>
35
    <th>&nbsp;</th>
36
    <th>Print</th>	
36
  </tr>
37
  </tr>
37
38
38
	<!-- FIXME: Shouldn't hardcode dollar signs, since Euro or Pound might be needed -->
39
	<!-- FIXME: Shouldn't hardcode dollar signs, since Euro or Pound might be needed -->
Lines 50-61 Link Here
50
		&nbsp;
51
		&nbsp;
51
	<!-- /TMPL_IF -->
52
	<!-- /TMPL_IF -->
52
      </td>
53
      </td>
54
<td>
55
	<!-- TMPL_IF NAME="payment" -->
56
		<a target="_blank" href="printfeercpt.pl?action=print&borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->&accountno=<!-- TMPL_VAR NAME="accountno" -->">Print</a>
57
	<!-- TMPL_ELSE -->
58
		&nbsp;
59
	<!-- /TMPL_IF -->
60
      </td>
53
    </tr>
61
    </tr>
54
62
55
  <!-- /TMPL_LOOP -->
63
  <!-- /TMPL_LOOP -->
56
<tfoot>
64
<tfoot>
57
  <tr>
65
  <tr>
58
    <td colspan="3">Total due</td>
66
    <td colspan="4">Total due</td>
59
    <!-- TMPL_IF NAME="totalcredit" --><td colspan="2" class="credit"><!-- TMPL_ELSE --><td colspan="2" class="debit"><!-- /TMPL_IF --><!-- TMPL_VAR NAME="total" --></td>
67
    <!-- TMPL_IF NAME="totalcredit" --><td colspan="2" class="credit"><!-- TMPL_ELSE --><td colspan="2" class="debit"><!-- /TMPL_IF --><!-- TMPL_VAR NAME="total" --></td>
60
  </tr>
68
  </tr>
61
  </tfoot>
69
  </tfoot>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/fee-receipt.tmpl (+45 lines)
Line 0 Link Here
1
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2
<title>Print Receipt for <!-- TMPL_VAR NAME="cardnumber" --></title>
3
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4
<link rel="shortcut icon" href="<!-- TMPL_VAR NAME="themelang" -->/includes/favicon.ico" type="image/x-icon" />
5
<link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR NAME="themelang" -->/css/print.css" />
6
<script language="javascript">
7
        window.print();
8
        window.close();
9
</script>
10
</head>
11
<body>
12
13
<div id="receipt">
14
15
<h3><!-- TMPL_VAR name="LibraryName" --></h3>
16
<h2> Fee Receipt</h2>
17
<!-- TMPL_IF NAME="branchname" --><h2><!-- TMPL_VAR NAME="branchname" --></h2><!-- /TMPL_IF -->
18
Received with thanks from  <!-- TMPL_VAR NAME="firstname"> <!-- TMPL_VAR NAME="surname"> <br />
19
Card Number : <!-- TMPL_VAR NAME="cardnumber" --><br />
20
21
<!-- The table with the account items -->
22
<table border="1">
23
  <tr>
24
  	<th>Date</th>
25
    <th>Description of charges</th>
26
    <th>Amount</th>
27
 </tr>
28
29
  <!-- TMPL_LOOP NAME="accounts" -->
30
<tr class="highlight">
31
      <td><!-- TMPL_VAR NAME="date" --></td>
32
      <td><!-- TMPL_VAR NAME="description" --></td>
33
      <!-- TMPL_IF NAME="amountcredit" --><td class="credit"><!-- TMPL_ELSE --><td class="debit"><!-- /TMPL_IF --><!-- TMPL_VAR NAME="amount" --></td>
34
    </tr>
35
36
  <!-- /TMPL_LOOP -->
37
<tfoot>
38
  <tr>
39
    <td colspan="2">Total outstanding dues as on date : </td>
40
    <!-- TMPL_IF NAME="totalcredit" --><td class="credit"><!-- TMPL_ELSE --><td class="debit"><!-- /TMPL_IF --><!-- TMPL_VAR NAME="total" --></td>
41
  </tr>
42
  </tfoot>
43
</table>
44
</div>
45
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
(-)a/members/printfeercpt.pl (-1 / +142 lines)
Line 0 Link Here
0
- 
1
#!/usr/bin/perl
2
3
4
#writen 3rd May 2010 by kmkale@anantcorp.com adapted from boraccount.pl by chris@katipo.oc.nz
5
#script to print fee receipts
6
7
8
# Copyright Koustubha Kale
9
#
10
# This file is part of Koha.
11
#
12
# Koha is free software; you can redistribute it and/or modify it under the
13
# terms of the GNU General Public License as published by the Free Software
14
# Foundation; either version 2 of the License, or (at your option) any later
15
# version.
16
#
17
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
18
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
19
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
20
#
21
# You should have received a copy of the GNU General Public License along
22
# with Koha; if not, write to the Free Software Foundation, Inc.,
23
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24
25
use strict;
26
use warnings;
27
28
use C4::Auth;
29
use C4::Output;
30
use C4::Dates qw/format_date/;
31
use CGI;
32
use C4::Members;
33
use C4::Branch;
34
use C4::Accounts;
35
36
my $input=new CGI;
37
38
39
my ($template, $loggedinuser, $cookie)
40
    = get_template_and_user({template_name => "members/fee-receipt.tmpl",
41
                            query => $input,
42
                            type => "intranet",
43
                            authnotrequired => 0,
44
                            flagsrequired => {borrowers => 1, updatecharges => 1},
45
                            debug => 1,
46
                            });
47
48
my $borrowernumber=$input->param('borrowernumber');
49
my $action = $input->param('action') || '';
50
my $accountno = $input->param('accountno');
51
52
#get borrower details
53
my $data=GetMember('borrowernumber' => $borrowernumber);
54
55
if ( $action eq 'print' ) {
56
#  ReversePayment( $borrowernumber, $input->param('accountno') );
57
}
58
59
if ( $data->{'category_type'} eq 'C') {
60
   my  ( $catcodes, $labels ) =  GetborCatFromCatType( 'A', 'WHERE category_type = ?' );
61
   my $cnt = scalar(@$catcodes);
62
   $template->param( 'CATCODE_MULTI' => 1) if $cnt > 1;
63
   $template->param( 'catcode' =>    $catcodes->[0])  if $cnt == 1;
64
}
65
66
#get account details
67
my ($total,$accts,$numaccts)=GetMemberAccountRecords($borrowernumber);
68
my $totalcredit;
69
if($total <= 0){
70
        $totalcredit = 1;
71
}
72
my @accountrows; # this is for the tmpl-loop
73
74
my $toggle;
75
for (my $i=0;$i<$numaccts;$i++){
76
   next if ($accts->[$i]{'accountno'} ne $accountno);
77
    if($i%2){
78
            $toggle = 0;
79
    } else {
80
            $toggle = 1;
81
    }
82
    $accts->[$i]{'toggle'} = $toggle;
83
    $accts->[$i]{'amount'}+=0.00;
84
    if($accts->[$i]{'amount'} <= 0){
85
        $accts->[$i]{'amountcredit'} = 1;
86
    }
87
    $accts->[$i]{'amountoutstanding'}+=0.00;
88
    if($accts->[$i]{'amountoutstanding'} <= 0){
89
        $accts->[$i]{'amountoutstandingcredit'} = 1;
90
    }
91
    my %row = ( 'date'              => format_date($accts->[$i]{'date'}),
92
                'amountcredit' => $accts->[$i]{'amountcredit'},
93
                'amountoutstandingcredit' => $accts->[$i]{'amountoutstandingcredit'},
94
                'toggle' => $accts->[$i]{'toggle'},
95
                'description'       => $accts->[$i]{'description'},
96
				'itemnumber'       => $accts->[$i]{'itemnumber'},
97
				'biblionumber'       => $accts->[$i]{'biblionumber'},
98
                'amount'            => sprintf("%.2f",$accts->[$i]{'amount'}),
99
                'amountoutstanding' => sprintf("%.2f",$accts->[$i]{'amountoutstanding'}),
100
                'accountno' => $accts->[$i]{'accountno'},
101
                'payment' => ( $accts->[$i]{'accounttype'} eq 'Pay' ),
102
                
103
                );
104
    
105
    if ($accts->[$i]{'accounttype'} ne 'F' && $accts->[$i]{'accounttype'} ne 'FU'){
106
        $row{'printtitle'}=1;
107
        $row{'title'} = $accts->[$i]{'title'};
108
    }
109
    
110
    push(@accountrows, \%row);
111
}
112
113
$template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' );
114
115
my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'});
116
$template->param( picture => 1 ) if $picture;
117
118
$template->param(
119
    finesview           => 1,
120
    firstname           => $data->{'firstname'},
121
    surname             => $data->{'surname'},
122
    borrowernumber      => $borrowernumber,
123
    cardnumber          => $data->{'cardnumber'},
124
    categorycode        => $data->{'categorycode'},
125
    category_type       => $data->{'category_type'},
126
 #   category_description => $data->{'description'},
127
    categoryname		 => $data->{'description'},
128
    address             => $data->{'address'},
129
    address2            => $data->{'address2'},
130
    city                => $data->{'city'},
131
    zipcode             => $data->{'zipcode'},
132
    country             => $data->{'country'},
133
    phone               => $data->{'phone'},
134
    email               => $data->{'email'},
135
    branchcode          => $data->{'branchcode'},
136
	branchname			=> GetBranchName($data->{'branchcode'}),
137
    total               => sprintf("%.2f",$total),
138
    totalcredit         => $totalcredit,
139
	is_child        => ($data->{'category_type'} eq 'C'),
140
    accounts            => \@accountrows );
141
142
output_html_with_http_headers $input, $cookie, $template->output;

Return to bug 4440