X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=members%2Fpaycollect.pl;h=96ca0fb7b86764cfd83cfe7e78b590705d3650d1;hb=54616c37e25b969907f9da2cf021e7e23ced836c;hp=7dfb6223930a5cbea1c6bf71e4d3e71d2a994e6c;hpb=e7da536551623337aed4ac6f14a127d0f50bd265;p=koha.git diff --git a/members/paycollect.pl b/members/paycollect.pl index 7dfb622393..96ca0fb7b8 100755 --- a/members/paycollect.pl +++ b/members/paycollect.pl @@ -19,6 +19,7 @@ use strict; use warnings; +use URI::Escape; use C4::Context; use C4::Auth; use C4::Output; @@ -55,8 +56,9 @@ my $individual = $input->param('pay_individual'); my $writeoff = $input->param('writeoff_individual'); my $select_lines = $input->param('selected'); my $select = $input->param('selected_accts'); +my $payment_note = uri_unescape $input->param('payment_note'); my $accountno; - +my $accountlines_id; if ( $individual || $writeoff ) { if ($individual) { $template->param( pay_individual => 1 ); @@ -64,6 +66,7 @@ if ( $individual || $writeoff ) { $template->param( writeoff_individual => 1 ); } my $accounttype = $input->param('accounttype'); + $accountlines_id = $input->param('accountlines_id'); my $amount = $input->param('amount'); my $amountoutstanding = $input->param('amountoutstanding'); $accountno = $input->param('accountno'); @@ -75,6 +78,7 @@ if ( $individual || $writeoff ) { $total_due = $amountoutstanding; $template->param( accounttype => $accounttype, + accountlines_id => $accountlines_id, accountno => $accountno, amount => $amount, amountoutstanding => $amountoutstanding, @@ -83,29 +87,31 @@ if ( $individual || $writeoff ) { description => $description, notify_id => $notify_id, notify_level => $notify_level, + payment_note => $payment_note, ); } elsif ($select_lines) { $total_due = $input->param('amt'); $template->param( selected_accts => $select_lines, - amt => $total_due + amt => $total_due, + selected_accts_notes => $input->param('notes'), ); } if ( $total_paid and $total_paid ne '0.00' ) { if ( $total_paid < 0 or $total_paid > $total_due ) { $template->param( - error => sprintf( 'You must pay a value less than or equal to %f.2', - $total_due ) + error_over => 1, + total_due => $total_due ); } else { if ($individual) { if ( $total_paid == $total_due ) { - makepayment( $borrowernumber, $accountno, $total_paid, $user, - $branch ); + makepayment( $accountlines_id, $borrowernumber, $accountno, $total_paid, $user, + $branch, $payment_note ); } else { - makepartialpayment( $borrowernumber, $accountno, $total_paid, - $user, $branch ); + makepartialpayment( $accountlines_id, $borrowernumber, $accountno, $total_paid, + $user, $branch, $payment_note ); } print $input->redirect( "/cgi-bin/koha/members/pay.pl?borrowernumber=$borrowernumber"); @@ -115,8 +121,8 @@ if ( $total_paid and $total_paid ne '0.00' ) { $select = $1; # ensure passing no junk } my @acc = split /,/, $select; - recordpayment_selectaccts( $borrowernumber, $total_paid, - \@acc ); + my $note = $input->param('selected_accts_notes'); + recordpayment_selectaccts( $borrowernumber, $total_paid, \@acc, $note ); } else { recordpayment( $borrowernumber, $total_paid ); } @@ -139,6 +145,7 @@ $template->param( borrower => $borrower, total => $total_due, activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), + RoutingSerials => C4::Context->preference('RoutingSerials'), ); output_html_with_http_headers $input, $cookie, $template->output; @@ -162,7 +169,7 @@ sub borrower_add_additional_fields { } elsif ( $b_ref->{category_type} eq 'A' ) { $b_ref->{adultborrower} = 1; } - my ( $picture, $dberror ) = GetPatronImage( $b_ref->{cardnumber} ); + my ( $picture, $dberror ) = GetPatronImage( $b_ref->{borrowernumber} ); if ($picture) { $b_ref->{has_picture} = 1; }