X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;ds=sidebyside;f=members%2Fpay.pl;h=e3377bfbffade1f03433e7c764b0a8288851bce1;hb=a9ded4fa008668df8c485fbbc76efa3cc9cc00d7;hp=9389f82018b0efd98bc2f026113eac8b972d66c2;hpb=a118102d4e2d7cf6bc1157a560c52fd6deb6f7a7;p=koha_fer diff --git a/members/pay.pl b/members/pay.pl index 9389f82018..e3377bfbff 100755 --- a/members/pay.pl +++ b/members/pay.pl @@ -103,12 +103,16 @@ for (@names) { } } +$template->param( activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne '') ); + add_accounts_to_template(); output_html_with_http_headers $input, $cookie, $template->output; sub writeoff { my ( $accountnum, $itemnum, $accounttype, $amount ) = @_; + my $manager_id = 0; + $manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv; # if no item is attached to fine, make sure to store it as a NULL $itemnum ||= undef; @@ -116,7 +120,7 @@ sub writeoff { $writeoff_sth->execute( $accountnum, $borrowernumber ); my $acct = getnextacctno($borrowernumber); - $add_writeoff_sth->execute( $borrowernumber, $acct, $itemnum, $amount ); + $add_writeoff_sth->execute( $borrowernumber, $acct, $itemnum, $amount, $manager_id ); UpdateStats( $branch, 'writeoff', $amount, q{}, q{}, q{}, $borrowernumber ); @@ -233,7 +237,13 @@ sub borrower_add_additional_fields { if ($picture) { $b_ref->{has_picture} = 1; } - $b_ref->{extendedattributes} = GetBorrowerAttributes($borrowernumber); + + if (C4::Context->preference('ExtendedPatronAttributes')) { + $b_ref->{extendedattributes} = GetBorrowerAttributes($borrowernumber); + $template->param( + ExtendedPatronAttributes => 1, + ); + } $b_ref->{branchname} = GetBranchName( $b_ref->{branchcode} ); return; @@ -274,8 +284,8 @@ sub get_writeoff_sth { . 'WHERE accountno=? and borrowernumber=?'; $writeoff_sth = $dbh->prepare($sql); my $insert = -q{insert into accountlines (borrowernumber,accountno,itemnumber,date,amount,description,accounttype)} - . q{values (?,?,?,now(),?,'Writeoff','W')}; +q{insert into accountlines (borrowernumber,accountno,itemnumber,date,amount,description,accounttype,manager_id)} + . q{values (?,?,?,now(),?,'Writeoff','W',?)}; $add_writeoff_sth = $dbh->prepare($insert); } return;