From b9426a68d7ffcd368deda791e403367e95b67425 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 24 Jan 2013 15:43:54 -0500 Subject: [PATCH] Bug 6413 - QA Followup - Add notes for 'Pay selected' --- C4/Accounts.pm | 9 +++++---- .../prog/en/modules/members/boraccount.tt | 2 +- .../prog/en/modules/members/paycollect.tt | 1 + members/pay.pl | 4 +++- members/paycollect.pl | 7 ++++--- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/C4/Accounts.pm b/C4/Accounts.pm index c6f5f29..ba92bf9 100644 --- a/C4/Accounts.pm +++ b/C4/Accounts.pm @@ -685,7 +685,7 @@ will be credited to the next one. =cut sub recordpayment_selectaccts { - my ( $borrowernumber, $amount, $accts ) = @_; + my ( $borrowernumber, $amount, $accts, $notes ) = @_; my $dbh = C4::Context->dbh; my $newamtos = 0; @@ -726,11 +726,12 @@ sub recordpayment_selectaccts { $sth->execute( $newamtos, $thisacct ); } + my $note = join( "\n", @$notes ); # create new line $sql = 'INSERT INTO accountlines ' . - '(borrowernumber, accountno,date,amount,description,accounttype,amountoutstanding,manager_id) ' . - q|VALUES (?,?,now(),?,'Payment,thanks','Pay',?,?)|; - $dbh->do($sql,{},$borrowernumber, $nextaccntno, 0 - $amount, 0 - $amountleft, $manager_id ); + '(borrowernumber, accountno,date,amount,description,accounttype,amountoutstanding,manager_id,note) ' . + q|VALUES (?,?,now(),?,'Payment,thanks','Pay',?,?,?)|; + $dbh->do($sql,{},$borrowernumber, $nextaccntno, 0 - $amount, 0 - $amountleft, $manager_id, $note ); UpdateStats( $branch, 'payment', $amount, '', '', '', $borrowernumber, $nextaccntno ); return; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt index 727430a..d64c63b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt @@ -45,7 +45,7 @@ [% IF ( loop.odd ) %][% ELSE %][% END %] [% account.date %] [% account.description %] [% IF ( account.itemnumber ) %]View item [% END %][% account.title |html %] - [% account.note %] + [% account.note | html_line_break %] [% IF ( account.amountcredit ) %][% ELSE %][% END %][% account.amount %] [% IF ( account.amountoutstandingcredit ) %][% ELSE %][% END %][% account.amountoutstanding %] [% IF ( reverse_col ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt index 65fec3f..23a338a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt @@ -190,6 +190,7 @@ function moneyFormat(textObj) {
+
diff --git a/members/pay.pl b/members/pay.pl index d02c830..a8c2257 100755 --- a/members/pay.pl +++ b/members/pay.pl @@ -266,10 +266,12 @@ sub payselected { } $amt = '&amt=' . $amt; my $sel = '&selected=' . join ',', @lines_to_pay; + my $notes = '¬es=' . join('__DLMTR__', map { $input->param("payment_note_$_") } @lines_to_pay ); my $redirect = "/cgi-bin/koha/members/paycollect.pl?borrowernumber=$borrowernumber" . $amt - . $sel; + . $sel + . $notes; print $input->redirect($redirect); return; diff --git a/members/paycollect.pl b/members/paycollect.pl index b4a8538..f0c7200 100755 --- a/members/paycollect.pl +++ b/members/paycollect.pl @@ -93,7 +93,8 @@ if ( $individual || $writeoff ) { $total_due = $input->param('amt'); $template->param( selected_accts => $select_lines, - amt => $total_due + amt => $total_due, + selected_accts_notes => $input->param('notes'), ); } @@ -120,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 @notes = split( '__DLMTR__', $input->param('selected_accts_notes') ); + recordpayment_selectaccts( $borrowernumber, $total_paid, \@acc, \@notes ); } else { recordpayment( $borrowernumber, $total_paid ); } -- 1.7.2.5