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

(-)a/C4/Accounts.pm (-13 / +21 lines)
Lines 35-44 BEGIN { Link Here
35
	@ISA    = qw(Exporter);
35
	@ISA    = qw(Exporter);
36
	@EXPORT = qw(
36
	@EXPORT = qw(
37
		&recordpayment &makepayment &manualinvoice
37
		&recordpayment &makepayment &manualinvoice
38
		&getnextacctno &reconcileaccount &getcharges &getcredits
38
		&getnextacctno &reconcileaccount &getcharges &ModNote &getcredits
39
		&getrefunds &chargelostitem
39
		&getrefunds &chargelostitem
40
		&ReversePayment
40
		&ReversePayment
41
	); # removed &fixaccounts
41
	); 
42
}
42
}
43
43
44
=head1 NAME
44
=head1 NAME
Lines 327-333 sub chargelostitem{ Link Here
327
=head2 manualinvoice
327
=head2 manualinvoice
328
328
329
  &manualinvoice($borrowernumber, $itemnumber, $description, $type,
329
  &manualinvoice($borrowernumber, $itemnumber, $description, $type,
330
                 $amount, $user);
330
                 $amount, $note);
331
331
332
C<$borrowernumber> is the patron's borrower number.
332
C<$borrowernumber> is the patron's borrower number.
333
C<$description> is a description of the transaction.
333
C<$description> is a description of the transaction.
Lines 351-357 should be the empty string. Link Here
351
#
351
#
352
352
353
sub manualinvoice {
353
sub manualinvoice {
354
    my ( $borrowernumber, $itemnum, $desc, $type, $amount, $user ) = @_;
354
    my ( $borrowernumber, $itemnum, $desc, $type, $amount, $note ) = @_;
355
    my $manager_id = C4::Context->userenv->{'number'};
355
    my $dbh      = C4::Context->dbh;
356
    my $dbh      = C4::Context->dbh;
356
    my $notifyid = 0;
357
    my $notifyid = 0;
357
    my $insert;
358
    my $insert;
Lines 403-418 sub manualinvoice { Link Here
403
        $desc .= " " . $itemnum;
404
        $desc .= " " . $itemnum;
404
        my $sth = $dbh->prepare(
405
        my $sth = $dbh->prepare(
405
            "INSERT INTO  accountlines
406
            "INSERT INTO  accountlines
406
                        (borrowernumber, accountno, date, amount, description, accounttype, amountoutstanding, itemnumber,notify_id)
407
                        (borrowernumber, accountno, date, amount, description, accounttype, amountoutstanding, itemnumber,notify_id, note, manager_id)
407
        VALUES (?, ?, now(), ?,?, ?,?,?,?)");
408
        VALUES (?, ?, now(), ?,?, ?,?,?,?,?,?)"
408
     $sth->execute($borrowernumber, $accountno, $amount, $desc, $type, $amountleft, $itemnum,$notifyid) || return $sth->errstr;
409
        );
409
  } else {
410
        $sth->execute( $borrowernumber, $accountno, $amount, $desc, $type, $amountleft, $itemnum, $notifyid, $note, $manager_id ) || return $sth->errstr;
410
    my $sth=$dbh->prepare("INSERT INTO  accountlines
411
    } else {
411
            (borrowernumber, accountno, date, amount, description, accounttype, amountoutstanding,notify_id)
412
        my $sth = $dbh->prepare(
412
            VALUES (?, ?, now(), ?, ?, ?, ?,?)"
413
            "INSERT INTO  accountlines
414
            (borrowernumber, accountno, date, amount, description, accounttype, amountoutstanding,notify_id, note, manager_id)
415
            VALUES (?, ?, now(), ?, ?, ?, ?,?,?,?)"
413
        );
416
        );
414
        $sth->execute( $borrowernumber, $accountno, $amount, $desc, $type,
417
        $sth->execute( $borrowernumber, $accountno, $amount, $desc, $type, $amountleft, $notifyid, $note, $manager_id );
415
            $amountleft, $notifyid );
416
    }
418
    }
417
    return 0;
419
    return 0;
418
}
420
}
Lines 606-611 sub getcharges { Link Here
606
    return (@results);
608
    return (@results);
607
}
609
}
608
610
611
sub ModNote {
612
    my ( $borrowernumber, $accountno, $note ) = @_;
613
    my $dbh = C4::Context->dbh;
614
    my $sth = $dbh->prepare('UPDATE accountlines SET note = ? WHERE borrowernumber = ? AND accountno = ?');
615
    $sth->execute( $note, $borrowernumber, $accountno );
616
}
609
617
610
sub getcredits {
618
sub getcredits {
611
	my ( $date, $date2 ) = @_;
619
	my ( $date, $date2 ) = @_;
(-)a/installer/data/mysql/kohastructure.sql (+2 lines)
Lines 2289-2294 CREATE TABLE `accountlines` ( Link Here
2289
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
2289
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
2290
  `notify_id` int(11) NOT NULL default 0,
2290
  `notify_id` int(11) NOT NULL default 0,
2291
  `notify_level` int(2) NOT NULL default 0,
2291
  `notify_level` int(2) NOT NULL default 0,
2292
  `note` text NULL default NULL,
2293
  `manager_id` int( 11 ) NULL,
2292
  KEY `acctsborridx` (`borrowernumber`),
2294
  KEY `acctsborridx` (`borrowernumber`),
2293
  KEY `timeidx` (`timestamp`),
2295
  KEY `timeidx` (`timestamp`),
2294
  KEY `itemnumber` (`itemnumber`),
2296
  KEY `itemnumber` (`itemnumber`),
(-)a/installer/data/mysql/updatedatabase.pl (+16 lines)
Lines 3995-4000 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
3995
    SetVersion ($DBversion);
3995
    SetVersion ($DBversion);
3996
}
3996
}
3997
3997
3998
$DBversion = "3.03.00.XXX";
3999
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
4000
    $dbh->do("ALTER TABLE `accountlines` ADD `note` text NULL default NULL");
4001
    print "Upgrade to $DBversion done (adding note field in accountlines table)\n";
4002
    SetVersion($DBversion);
4003
}
4004
4005
$DBversion = "3.03.00.XXX";
4006
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
4007
    $dbh->do("ALTER TABLE `accountlines` ADD `manager_id` int( 11 ) NULL ");
4008
    print "Upgrade to $DBversion done (adding manager_id field in accountlines table)\n";
4009
    SetVersion($DBversion);
4010
}
4011
4012
4013
3998
=head1 FUNCTIONS
4014
=head1 FUNCTIONS
3999
4015
4000
=head2 DropAllForeignKeys($table)
4016
=head2 DropAllForeignKeys($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tmpl (+2 lines)
Lines 30-35 Link Here
30
  <tr>
30
  <tr>
31
  	<th>Date</th>
31
  	<th>Date</th>
32
    <th>Description of charges</th>
32
    <th>Description of charges</th>
33
    <th>Note</th>
33
    <th>Amount</th>
34
    <th>Amount</th>
34
    <th>Outstanding</th>
35
    <th>Outstanding</th>
35
    <!-- TMPL_IF NAME="reverse_col" -->
36
    <!-- TMPL_IF NAME="reverse_col" -->
Lines 44-49 Link Here
44
   <!-- TMPL_IF NAME="__odd__" --><tr><!-- TMPL_ELSE --><tr class="highlight"><!-- /TMPL_IF -->
45
   <!-- TMPL_IF NAME="__odd__" --><tr><!-- TMPL_ELSE --><tr class="highlight"><!-- /TMPL_IF -->
45
      <td><!-- TMPL_VAR NAME="date" --></td>
46
      <td><!-- TMPL_VAR NAME="date" --></td>
46
      <td><!-- TMPL_VAR NAME="description" -->&nbsp;<!-- TMPL_IF NAME="itemnumber" --><a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&amp;itemnumber=<!-- TMPL_VAR NAME="itemnumber" -->">View item</a>&nbsp;<!-- /TMPL_IF --><!-- TMPL_IF NAME="printtitle" --> <!-- TMPL_VAR NAME="title" escape="html" --><!-- /TMPL_IF --></td>
47
      <td><!-- TMPL_VAR NAME="description" -->&nbsp;<!-- TMPL_IF NAME="itemnumber" --><a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&amp;itemnumber=<!-- TMPL_VAR NAME="itemnumber" -->">View item</a>&nbsp;<!-- /TMPL_IF --><!-- TMPL_IF NAME="printtitle" --> <!-- TMPL_VAR NAME="title" escape="html" --><!-- /TMPL_IF --></td>
48
      <td><!-- TMPL_VAR NAME="note" --></td>
47
      <!-- TMPL_IF NAME="amountcredit" --><td class="credit"><!-- TMPL_ELSE --><td class="debit"><!-- /TMPL_IF --><!-- TMPL_VAR NAME="amount" --></td>
49
      <!-- TMPL_IF NAME="amountcredit" --><td class="credit"><!-- TMPL_ELSE --><td class="debit"><!-- /TMPL_IF --><!-- TMPL_VAR NAME="amount" --></td>
48
      <!-- TMPL_IF NAME="amountoutstandingcredit" --><td class="credit"><!-- TMPL_ELSE --><td class="debit"><!-- /TMPL_IF --><!-- TMPL_VAR NAME="amountoutstanding" --></td>
50
      <!-- TMPL_IF NAME="amountoutstandingcredit" --><td class="credit"><!-- TMPL_ELSE --><td class="debit"><!-- /TMPL_IF --><!-- TMPL_VAR NAME="amountoutstanding" --></td>
49
    <!-- TMPL_IF NAME="reverse_col" -->
51
    <!-- TMPL_IF NAME="reverse_col" -->
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tmpl (+1 lines)
Lines 43-48 $(document).ready(function(){ Link Here
43
</select></li>
43
</select></li>
44
	<li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li>
44
	<li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li>
45
	<li><label for="desc">Description: </label><input type="text" name="desc" size="50" id="desc" /></li>
45
	<li><label for="desc">Description: </label><input type="text" name="desc" size="50" id="desc" /></li>
46
	<li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li>
46
	<li><label for="amount">Amount: </label><input type="text" name="amount" id="amount" /> Example: 5.00</li>
47
	<li><label for="amount">Amount: </label><input type="text" name="amount" id="amount" /> Example: 5.00</li>
47
</ol></fieldset>
48
</ol></fieldset>
48
49
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tmpl (+1 lines)
Lines 67-72 type_fees['<!-- TMPL_VAR NAME="authorised_value" -->'] = "<!-- TMPL_VAR NAME="li Link Here
67
      </li>
67
      </li>
68
	<li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li>
68
	<li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li>
69
	<li><label for="desc">Description: </label><input type="text" name="desc" id="desc" size="50" /></li>
69
	<li><label for="desc">Description: </label><input type="text" name="desc" id="desc" size="50" /></li>
70
	<li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li>
70
	<li><label for="amount">Amount: </label><input type="text" name="amount" id="amount" /> Example: 5.00</li>
71
	<li><label for="amount">Amount: </label><input type="text" name="amount" id="amount" /> Example: 5.00</li>
71
	</ol></fieldset>
72
	</ol></fieldset>
72
<fieldset class="action"><input type="submit" name="add" value="Save" /> <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->">Cancel</a></fieldset>
73
<fieldset class="action"><input type="submit" name="add" value="Save" /> <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->">Cancel</a></fieldset>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tmpl (-2 / +10 lines)
Lines 32-37 Link Here
32
<tr>
32
<tr>
33
	<th>Fines &amp; Charges</th>
33
	<th>Fines &amp; Charges</th>
34
	<th>Description</th>
34
	<th>Description</th>
35
	<th>Note</th>
35
	<th>Account Type</th>
36
	<th>Account Type</th>
36
	<th>Notify id</th>
37
	<th>Notify id</th>
37
	<th>Level</th>
38
	<th>Level</th>
Lines 61-66 Link Here
61
	<input type="hidden" name="totals<!-- TMPL_VAR name="i" -->" value="<!-- TMPL_VAR name="totals" -->" />
62
	<input type="hidden" name="totals<!-- TMPL_VAR name="i" -->" value="<!-- TMPL_VAR name="totals" -->" />
62
	</td>
63
	</td>
63
	<td><!-- TMPL_VAR name="description" --> <!-- TMPL_VAR name="title" escape="html" --></td>
64
	<td><!-- TMPL_VAR name="description" --> <!-- TMPL_VAR name="title" escape="html" --></td>
65
	<td>
66
	<!-- TMPL_IF NAME="net_balance" -->
67
	<input type="text" name="note<!-- TMPL_VAR name="i" -->" value="
68
	<!-- /TMPL_IF -->
69
	<!-- TMPL_VAR name="note" -->
70
	<!-- TMPL_IF NAME="net_balance" -->" /><!-- /TMPL_IF -->
71
	</td>
64
	<td><!-- TMPL_VAR name="accounttype" --></td>
72
	<td><!-- TMPL_VAR name="accounttype" --></td>
65
	<td><!-- TMPL_VAR name="notify_id" --></td>
73
	<td><!-- TMPL_VAR name="notify_id" --></td>
66
	<td><!-- TMPL_VAR name="notify_level" --></td>
74
	<td><!-- TMPL_VAR name="notify_level" --></td>
Lines 71-83 Link Here
71
<!-- TMPL_IF  NAME="total"-->
79
<!-- TMPL_IF  NAME="total"-->
72
<tr>
80
<tr>
73
81
74
	<td colspan="6">Sub Total</td>
82
	<td colspan="7">Sub Total</td>
75
	<td><!-- TMPL_VAR name="total" --></td>
83
	<td><!-- TMPL_VAR name="total" --></td>
76
</tr>
84
</tr>
77
<!--/TMPL_IF-->
85
<!--/TMPL_IF-->
78
<!-- /TMPL_LOOP  -->
86
<!-- /TMPL_LOOP  -->
79
<tr>
87
<tr>
80
	<td colspan="6">Total Due</td>
88
	<td colspan="7">Total Due</td>
81
	<td><!-- TMPL_VAR name="total" --></td>
89
	<td><!-- TMPL_VAR name="total" --></td>
82
</tr>
90
</tr>
83
</table>
91
</table>
(-)a/kohaversion.pl (-1 / +1 lines)
Lines 16-22 the kohaversion is divided in 4 parts : Link Here
16
use strict;
16
use strict;
17
17
18
sub kohaversion {
18
sub kohaversion {
19
    our $VERSION = '3.03.00.018';
19
    our $VERSION = '3.03.00.XXX';
20
    # version needs to be set this way
20
    # version needs to be set this way
21
    # so that it can be picked up by Makefile.PL
21
    # so that it can be picked up by Makefile.PL
22
    # during install
22
    # during install
(-)a/members/mancredit.pl (-12 / +16 lines)
Lines 41-58 my $borrowernumber=$input->param('borrowernumber'); Link Here
41
my $data=GetMember('borrowernumber' => $borrowernumber);
41
my $data=GetMember('borrowernumber' => $borrowernumber);
42
my $add=$input->param('add');
42
my $add=$input->param('add');
43
43
44
if ($add){
44
if ($add) {
45
    my $barcode=$input->param('barcode');
45
	if(checkauth($input)){
46
    my $itemnum = GetItemnumberFromBarcode($barcode) if $barcode;
46
	    my $barcode = $input->param('barcode');
47
    my $desc=$input->param('desc');
47
	    my $itemnum = GetItemnumberFromBarcode($barcode) if $barcode;
48
    my $amount=$input->param('amount') || 0;
48
	    my $desc    = $input->param('desc');
49
    $amount = -$amount;
49
	    my $note    = $input->param('note');
50
    my $type=$input->param('type');
50
	    my $amount  = $input->param('amount') || 0;
51
    manualinvoice($borrowernumber,$itemnum,$desc,$type,$amount);
51
	    $amount = -$amount;
52
    print $input->redirect("/cgi-bin/koha/members/boraccount.pl?borrowernumber=$borrowernumber");
52
	    my $type = $input->param('type');
53
} else {
53
	    manualinvoice( $borrowernumber, $itemnum, $desc, $type, $amount, $note );
54
	my ($template, $loggedinuser, $cookie)
54
	    print $input->redirect("/cgi-bin/koha/members/boraccount.pl?borrowernumber=$borrowernumber");
55
	  = get_template_and_user({template_name => "members/mancredit.tmpl",
55
	}
56
} 
57
else {
58
    my ($template, $loggedinuser, $cookie)
59
      = get_template_and_user({template_name => "members/mancredit.tmpl",
56
					  query => $input,
60
					  query => $input,
57
					  type => "intranet",
61
					  type => "intranet",
58
					  authnotrequired => 0,
62
					  authnotrequired => 0,
(-)a/members/maninvoice.pl (-29 / +32 lines)
Lines 36-71 my $input=new CGI; Link Here
36
36
37
my $borrowernumber=$input->param('borrowernumber');
37
my $borrowernumber=$input->param('borrowernumber');
38
38
39
40
# get borrower details
39
# get borrower details
41
my $data=GetMember('borrowernumber'=>$borrowernumber);
40
my $data = GetMember( 'borrowernumber' => $borrowernumber );
42
my $add=$input->param('add');
41
my $add = $input->param('add');
43
if ($add){
42
if ($add) {
44
#  print $input->header;
43
	if(checkauth($input))
45
    my $barcode=$input->param('barcode');
44
	{
45
    #  print $input->header;
46
    my $barcode = $input->param('barcode');
46
    my $itemnum = GetItemnumberFromBarcode($barcode) if $barcode;
47
    my $itemnum = GetItemnumberFromBarcode($barcode) if $barcode;
47
    my $desc=$input->param('desc');
48
    my $desc    = $input->param('desc');
48
    my $amount=$input->param('amount');
49
    my $amount  = $input->param('amount');
49
    my $type=$input->param('type');
50
    my $type    = $input->param('type');
50
    my $error=manualinvoice($borrowernumber,$itemnum,$desc,$type,$amount);
51
    my $note    = $input->param('note');
51
	if ($error){
52
    my $error   = manualinvoice( $borrowernumber, $itemnum, $desc, $type, $amount, $note );
52
		my ($template, $loggedinuser, $cookie)
53
	    if ($error) {
53
		  = get_template_and_user({template_name => "members/maninvoice.tmpl",
54
	        my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
54
					query => $input,
55
	            {   template_name   => "members/maninvoice.tmpl",
55
					type => "intranet",
56
	                query           => $input,
56
					authnotrequired => 0,
57
	                type            => "intranet",
57
					flagsrequired => {borrowers => 1},
58
	                authnotrequired => 0,
58
					debug => 1,
59
	                flagsrequired   => { borrowers => 1 },
59
					});
60
	                debug           => 1,
60
		if ($error =~ /FOREIGN KEY/ && $error =~ /itemnumber/){
61
	            }
61
			$template->param('ITEMNUMBER' => 1);
62
	        );
62
		}
63
	        if ( $error =~ /FOREIGN KEY/ && $error =~ /itemnumber/ ) {
63
		$template->param('ERROR' => $error);
64
	            $template->param( 'ITEMNUMBER' => 1 );
64
        output_html_with_http_headers $input, $cookie, $template->output;
65
	        }
65
	}
66
	        $template->param( 'ERROR' => $error );
66
	else {
67
	        output_html_with_http_headers $input, $cookie, $template->output;
67
		print $input->redirect("/cgi-bin/koha/members/boraccount.pl?borrowernumber=$borrowernumber");
68
	    } else {
68
		exit;
69
	        print $input->redirect("/cgi-bin/koha/members/boraccount.pl?borrowernumber=$borrowernumber");
70
	        exit;
71
	    }
69
	}
72
	}
70
} else {
73
} else {
71
74
Lines 77-83 if ($add){ Link Here
77
					flagsrequired => {borrowers => 1, updatecharges => 1},
80
					flagsrequired => {borrowers => 1, updatecharges => 1},
78
					debug => 1,
81
					debug => 1,
79
					});
82
					});
80
					
83
81
  # get authorised values with type of MANUAL_INV
84
  # get authorised values with type of MANUAL_INV
82
  my @invoice_types;
85
  my @invoice_types;
83
  my $dbh = C4::Context->dbh;
86
  my $dbh = C4::Context->dbh;
(-)a/members/pay.pl (-17 / +26 lines)
Lines 1-6 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
2
3
# Copyright 2000-2002 Katipo Communications
3
# Copyright 2000-2002 Katipo Communications
4
# Parts Copyright Biblibre 2010
4
#
5
#
5
# This file is part of Koha.
6
# This file is part of Koha.
6
#
7
#
Lines 41-46 use C4::Branch; # GetBranches Link Here
41
42
42
my $input = new CGI;
43
my $input = new CGI;
43
44
45
#warn Data::Dumper::Dumper $input;
44
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
46
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
45
    {
47
    {
46
        template_name   => "members/pay.tmpl",
48
        template_name   => "members/pay.tmpl",
Lines 83-89 for ( my $i = 0 ; $i < @names ; $i++ ) { Link Here
83
        makepayment( $borrowernumber, $accountno, $amount, $user, $branch );
85
        makepayment( $borrowernumber, $accountno, $amount, $user, $branch );
84
        $check = 2;
86
        $check = 2;
85
    }
87
    }
88
     if ( $temp eq 'no'||$temp eq 'yes'||$temp eq 'wo') {
89
        my $borrowernumber = $input->param( $names[ $i + 5 ] );
90
        my $accountno      = $input->param( $names[ $i + 6 ] );
91
        my $note     = $input->param( $names[ $i + 10 ] );
92
        ModNote( $borrowernumber, $accountno, $note );
93
     }
86
}
94
}
95
87
my $total = $input->param('total') || '';
96
my $total = $input->param('total') || '';
88
if ( $check == 0 ) {
97
if ( $check == 0 ) {
89
    if ( $total ne '' ) {
98
    if ( $total ne '' ) {
Lines 105-123 if ( $check == 0 ) { Link Here
105
            if ( $accts->[$i]{'amountoutstanding'} != 0 ) {
114
            if ( $accts->[$i]{'amountoutstanding'} != 0 ) {
106
                $accts->[$i]{'amount'}            += 0.00;
115
                $accts->[$i]{'amount'}            += 0.00;
107
                $accts->[$i]{'amountoutstanding'} += 0.00;
116
                $accts->[$i]{'amountoutstanding'} += 0.00;
108
                $line{i}           = $j . "" . $i;
117
                $line{i}                 = $j . "" . $i;
109
                $line{itemnumber}  = $accts->[$i]{'itemnumber'};
118
                $line{itemnumber}        = $accts->[$i]{'itemnumber'};
110
                $line{accounttype} = $accts->[$i]{'accounttype'};
119
                $line{accounttype}       = $accts->[$i]{'accounttype'};
111
                $line{amount}      = sprintf( "%.2f", $accts->[$i]{'amount'} );
120
                $line{amount}            = sprintf( "%.2f", $accts->[$i]{'amount'} );
112
                $line{amountoutstanding} =
121
                $line{amountoutstanding} = sprintf( "%.2f", $accts->[$i]{'amountoutstanding'} );
113
                  sprintf( "%.2f", $accts->[$i]{'amountoutstanding'} );
122
                $line{borrowernumber}    = $borrowernumber;
114
                $line{borrowernumber} = $borrowernumber;
123
                $line{accountno}         = $accts->[$i]{'accountno'};
115
                $line{accountno}      = $accts->[$i]{'accountno'};
124
                $line{description}       = $accts->[$i]{'description'};
116
                $line{description}    = $accts->[$i]{'description'};
125
                $line{note}              = $accts->[$i]{'note'};
117
                $line{title}          = $accts->[$i]{'title'};
126
                $line{title}             = $accts->[$i]{'title'};
118
                $line{notify_id}      = $accts->[$i]{'notify_id'};
127
                $line{notify_id}         = $accts->[$i]{'notify_id'};
119
                $line{notify_level}   = $accts->[$i]{'notify_level'};
128
                $line{notify_level}      = $accts->[$i]{'notify_level'};
120
                $line{net_balance} = 1 if($accts->[$i]{'amountoutstanding'} > 0); # you can't pay a credit.
129
                $line{net_balance}       = 1 if ( $accts->[$i]{'amountoutstanding'} > 0 );         # you can't pay a credit.
121
                push( @loop_pay, \%line );
130
                push( @loop_pay, \%line );
122
            }
131
            }
123
        }
132
        }
Lines 129-149 if ( $check == 0 ) { Link Here
129
            'loop_pay' => \@loop_pay,
138
            'loop_pay' => \@loop_pay,
130
            'notify'   => $notify[$j],
139
            'notify'   => $notify[$j],
131
            'total'    =>  sprintf( "%.2f",$totalnotify),
140
            'total'    =>  sprintf( "%.2f",$totalnotify),
132
			
141
133
          };
142
          };
134
    }
143
    }
135
	
144
136
if ( $data->{'category_type'} eq 'C') {
145
if ( $data->{'category_type'} eq 'C') {
137
   my  ( $catcodes, $labels ) =  GetborCatFromCatType( 'A', 'WHERE category_type = ?' );
146
   my  ( $catcodes, $labels ) =  GetborCatFromCatType( 'A', 'WHERE category_type = ?' );
138
   my $cnt = scalar(@$catcodes);
147
   my $cnt = scalar(@$catcodes);
139
   $template->param( 'CATCODE_MULTI' => 1) if $cnt > 1;
148
   $template->param( 'CATCODE_MULTI' => 1) if $cnt > 1;
140
   $template->param( 'catcode' =>    $catcodes->[0])  if $cnt == 1;
149
   $template->param( 'catcode' =>    $catcodes->[0])  if $cnt == 1;
141
}
150
}
142
	
151
143
$template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' );
152
$template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' );
144
my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'});
153
my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'});
145
$template->param( picture => 1 ) if $picture;
154
$template->param( picture => 1 ) if $picture;
146
	
155
147
    $template->param(
156
    $template->param(
148
        allfile        => \@allfile,
157
        allfile        => \@allfile,
149
        firstname      => $data->{'firstname'},
158
        firstname      => $data->{'firstname'},
(-)a/t/db_dependent/lib/KohaTest/Members/GetMemberDetails.pm (-5 / +2 lines)
Lines 50-60 sub startup_create_detailed_borrower : Test( startup => 2 ) { Link Here
50
    $description = 'Test account';
50
    $description = 'Test account';
51
    $type        = 'M';
51
    $type        = 'M';
52
    $amount      = 5.00;
52
    $amount      = 5.00;
53
    $user        = '';
53
    $note        = '';
54
54
55
    my $acct_added =
55
    my $acct_added = C4::Accounts::manualinvoice( $borrowernumber, undef, $description, $type, $amount, $note );
56
      C4::Accounts::manualinvoice( $borrowernumber, undef, $description, $type, $amount,
57
        $user );
58
56
59
    ok( $acct_added == 0, 'added account for borrower' );
57
    ok( $acct_added == 0, 'added account for borrower' );
60
58
61
- 

Return to bug 5752