From 34ea8fbec751600c332881debb88281b442113b3 Mon Sep 17 00:00:00 2001 From: Paul Poulain Date: Wed, 20 Mar 2013 11:37:05 +0100 Subject: [PATCH] Bug 6413 - QA Followup - Add notes for 'Pay selected' Signed-off-by: Owen Leonard Signed-off-by: Paul Poulain Signed-off-by: Galen Charlton --- C4/Accounts.pm | 8 ++++---- .../intranet-tmpl/prog/en/modules/members/boraccount.tt | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt | 6 +++--- .../intranet-tmpl/prog/en/modules/members/paycollect.tt | 4 ++++ members/pay.pl | 4 +++- members/paycollect.pl | 7 ++++--- 6 files changed, 19 insertions(+), 12 deletions(-) diff --git a/C4/Accounts.pm b/C4/Accounts.pm index 08545025d5..f087b7a75f 100644 --- a/C4/Accounts.pm +++ b/C4/Accounts.pm @@ -789,7 +789,7 @@ will be credited to the next one. =cut sub recordpayment_selectaccts { - my ( $borrowernumber, $amount, $accts ) = @_; + my ( $borrowernumber, $amount, $accts, $note ) = @_; my $dbh = C4::Context->dbh; my $newamtos = 0; @@ -849,9 +849,9 @@ sub recordpayment_selectaccts { # 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 ); if ( C4::Context->preference("FinesLog") ) { 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 727430a6f3..d64c63b394 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/pay.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt index a0a26a2a35..874dcb1d3e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt @@ -62,7 +62,7 @@ - Total Due: + Total Due: [% total | format('%.2f') %] @@ -93,7 +93,7 @@ [% line.description %] ([% line.title |html_entity %]) - + [% line.accounttype %] [% line.notify_id %] [% line.notify_level %] @@ -104,7 +104,7 @@ [% IF ( account_grp.total ) %] - Sub total: + Sub total: [% account_grp.total | format('%.2f') %] [% END %] 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 e80e6daa82..9cec275dee 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt @@ -211,6 +211,10 @@ function moneyFormat(textObj) { +
  • + + +
  • diff --git a/members/pay.pl b/members/pay.pl index 67350b4577..4efffc306e 100755 --- a/members/pay.pl +++ b/members/pay.pl @@ -249,10 +249,12 @@ sub payselected { } $amt = '&amt=' . $amt; my $sel = '&selected=' . join ',', @lines_to_pay; + my $notes = '¬es=' . join("%0A", 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 5ed6b862be..5edb64467c 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 $note = $input->param('selected_accts_notes'); + recordpayment_selectaccts( $borrowernumber, $total_paid, \@acc, $note ); } else { recordpayment( $borrowernumber, $total_paid ); } -- 2.39.5