diff --git a/C4/Accounts.pm b/C4/Accounts.pm index c34b33083a..3fbb2adcc8 100644 --- a/C4/Accounts.pm +++ b/C4/Accounts.pm @@ -145,7 +145,7 @@ sub recordpayment { my $usth = $dbh->prepare( "INSERT INTO accountlines (borrowernumber, accountno,date,amount,description,accounttype,amountoutstanding,manager_id) - VALUES (?,?,now(),?,'Payment,thanks','Pay',?,?)" + VALUES (?,?,now(),?,'','Pay',?,?)" ); $usth->execute( $borrowernumber, $nextaccntno, 0 - $data, 0 - $amountleft, $manager_id ); @@ -207,7 +207,7 @@ sub makepayment { my $udp = $dbh->prepare( "UPDATE accountlines - SET amountoutstanding = 0, description = 'Payment,thanks' + SET amountoutstanding = 0 WHERE accountlines_id = ? " ); @@ -230,7 +230,7 @@ sub makepayment { $dbh->prepare( "INSERT INTO accountlines (borrowernumber, accountno, date, amount, itemnumber, description, accounttype, amountoutstanding, manager_id, note) - VALUES ( ?, ?, now(), ?, ?, 'Payment,thanks', 'Pay', 0, ?, ?)" + VALUES ( ?, ?, now(), ?, ?, '', 'Pay', 0, ?, ?)" ); $ins->execute($borrowernumber, $nextaccntno, $payment, $data->{'itemnumber'}, $manager_id, $payment_note); } @@ -412,23 +412,6 @@ sub manualinvoice { my $accountno = getnextacctno($borrowernumber); my $amountleft = $amount; - if ( $type eq 'N' ) { - $desc .= " New Card"; - } - if ( $type eq 'F' ) { - $desc .= " Fine"; - } - if ( $type eq 'A' ) { - $desc .= " Account Management fee"; - } - if ( $type eq 'M' ) { - $desc .= " Sundry"; - } - - if ( $type eq 'L' && $desc eq '' ) { - - $desc = " Lost Item"; - } if ( ( $type eq 'L' ) or ( $type eq 'F' ) or ( $type eq 'A' ) @@ -657,7 +640,7 @@ sub recordpayment_selectaccts { # create new line $sql = 'INSERT INTO accountlines ' . '(borrowernumber, accountno,date,amount,description,accounttype,amountoutstanding,manager_id,note) ' . - q|VALUES (?,?,now(),?,'Payment,thanks','Pay',?,?,?)|; + q|VALUES (?,?,now(),?,'','Pay',?,?,?)|; $dbh->do($sql,{},$borrowernumber, $nextaccntno, 0 - $amount, 0 - $amountleft, $manager_id, $note ); UpdateStats( $branch, 'payment', $amount, '', '', '', $borrowernumber, $nextaccntno ); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index a9bfbbfcb6..f8ca7170c3 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -7778,6 +7778,25 @@ if(CheckVersion($DBversion)) { SetVersion($DBversion); } +$DBversion = "3.15.00.XXX"; +if ( CheckVersion($DBversion) ) { + $dbh->do(q{ + UPDATE accountlines + SET description = '' + WHERE description IN ( + ' New Card', + ' Fine', + ' Sundry', + 'Writeoff', + ' Account Management fee', + 'Payment,thanks', 'Payment,thanks - ', + ' Lost Item' + ) + }); + print "Upgrade to $DBversion done (Bug 2546: Update fine descriptions)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) 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 d64c63b394..ca9c63a281 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt @@ -44,7 +44,19 @@ [% IF ( loop.odd ) %][% ELSE %][% END %] [% account.date %] - [% account.description %] [% IF ( account.itemnumber ) %]View item [% END %][% account.title |html %] + + [% SWITCH account.accounttype %] + [% CASE 'Pay' %]Payment,thanks + [% CASE 'N' %]New Card + [% CASE 'F' %]Fine + [% CASE 'A' %]Account management fee + [% CASE 'M' %]Sundry + [% CASE 'L' %]Lost Item + [% CASE 'W' %]Writeoff + [% CASE %][% account.accounttype %] + [%- END -%] + [%- IF account.description %], [% account.description %][% END %] +  [% IF ( account.itemnumber ) %]View item [% END %][% account.title |html %] [% account.note | html_line_break %] [% IF ( account.amountcredit ) %][% ELSE %][% END %][% account.amount %] [% IF ( account.amountoutstandingcredit ) %][% ELSE %][% END %][% account.amountoutstanding %] 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 91f1609d0d..23203b1aa0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt @@ -112,7 +112,20 @@ function enableCheckboxActions(){ - [% line.description %] ([% line.title |html_entity %]) + + [% SWITCH line.accounttype %] + [% CASE 'Pay' %]Payment,thanks + [% CASE 'N' %]New Card + [% CASE 'F' %]Fine + [% CASE 'A' %]Account management fee + [% CASE 'M' %]Sundry + [% CASE 'L' %]Lost Item + [% CASE 'W' %]Writeoff + [% CASE %][% line.accounttype %] + [%- END -%] + [%- IF line.description %], [% line.description %][% END %] + [% IF line.title %]([% line.title |html_entity %])[% END %] + [% line.accounttype %] [% line.notify_id %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tt index bb858e8133..47169e872b 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tt @@ -39,8 +39,20 @@ [% FOREACH ACCOUNT_LINE IN ACCOUNT_LINES %] [% IF ( ACCOUNT_LINE.odd ) %][% ELSE %][% END %] [% ACCOUNT_LINE.date | $KohaDates %] - [% ACCOUNT_LINE.description %] - [% IF ( ACCOUNT_LINE.title ) %][% ACCOUNT_LINE.title |html %][% END %] + + [% SWITCH ACCOUNT_LINE.accounttype %] + [% CASE 'Pay' %]Payment,thanks + [% CASE 'N' %]New Card + [% CASE 'F' %]Fine + [% CASE 'A' %]Account management fee + [% CASE 'M' %]Sundry + [% CASE 'L' %]Lost Item + [% CASE 'W' %]Writeoff + [% CASE %][% ACCOUNT_LINE.accounttype %] + [%- END -%] + [%- IF ACCOUNT_LINE.description %], [% ACCOUNT_LINE.description %][% END %] + [% IF line.title %]([% line.title |html_entity %])[% END %] + [% IF ( ACCOUNT_LINE.amountcredit ) %][% ELSE %][% END %][% ACCOUNT_LINE.amount %] [% IF ( ACCOUNT_LINE.amountoutstandingcredit ) %][% ELSE %][% END %][% ACCOUNT_LINE.amountoutstanding %]