@@ -, +, @@ displayed in all cases - Generate and pay some different kinds of fees for a patron without filling the 'description' field. - In Fines>Account, click on the 'print' link. - Before this patch, the "description of charges" values is empty if no description was given. It is a regression introduced by bug 2546, a default value was inserted in the description field depending on the account type selected. - After this patch, the "description of charges" values should be based on the account type. The string display on printing receipt should be the same as on the account screen (staff and opac). --- C4/Accounts.pm | 2 +- .../prog/en/modules/members/printfeercpt.tt | 17 ++++++++++++++++- .../prog/en/modules/members/printinvoice.tt | 17 ++++++++++++++++- members/printfeercpt.pl | 3 +-- members/printinvoice.pl | 2 +- 5 files changed, 35 insertions(+), 6 deletions(-) --- a/C4/Accounts.pm +++ a/C4/Accounts.pm @@ -720,7 +720,7 @@ sub makepartialpayment { . ' VALUES (?, ?, now(), ?, ?, ?, 0, ?, ?, ?)'; $dbh->do( $insert, undef, $borrowernumber, $nextaccntno, $amount, - "Payment, thanks - $user", 'Pay', $data->{'itemnumber'}, $manager_id, $payment_note); + '', 'Pay', $data->{'itemnumber'}, $manager_id, $payment_note); UpdateStats({ branch => $user, --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt @@ -43,7 +43,22 @@ [% FOREACH account IN accounts %] [% account.date %] - [% account.description %] + + [% SWITCH account.accounttype %] + [% CASE 'Pay' %]Payment, thanks + [% CASE 'Pay00' %]Payment, thanks (cash via SIP2) + [% CASE 'Pay01' %]Payment, thanks (VISA via SIP2) + [% CASE 'Pay02' %]Payment, thanks (credit card via SIP2) + [% 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.amountcredit ) %][% ELSE %][% END %][% account.amount %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt @@ -44,7 +44,22 @@ [% FOREACH account IN accounts %] [% account.date %] - [% account.description %] + + [% SWITCH account.accounttype %] + [% CASE 'Pay' %]Payment, thanks + [% CASE 'Pay00' %]Payment, thanks (cash via SIP2) + [% CASE 'Pay01' %]Payment, thanks (VISA via SIP2) + [% CASE 'Pay02' %]Payment, thanks (credit card via SIP2) + [% 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.amountcredit ) %][% ELSE %][% END %][% account.amount %] [% IF ( account.amountoutstandingcredit ) %][% ELSE %][% END %][% account.amountoutstanding %] --- a/members/printfeercpt.pl +++ a/members/printfeercpt.pl @@ -99,8 +99,7 @@ for (my $i=0;$i<$numaccts;$i++){ 'amount' => sprintf("%.2f",$accts->[$i]{'amount'}), 'amountoutstanding' => sprintf("%.2f",$accts->[$i]{'amountoutstanding'}), 'accountno' => $accts->[$i]{'accountno'}, - 'payment' => ( $accts->[$i]{'accounttype'} =~ /^Pay/ ), - + accounttype => $accts->[$i]{accounttype}, ); if ($accts->[$i]{'accounttype'} ne 'F' && $accts->[$i]{'accounttype'} ne 'FU'){ --- a/members/printinvoice.pl +++ a/members/printinvoice.pl @@ -99,7 +99,7 @@ for ( my $i = 0 ; $i < $numaccts ; $i++ ) { 'amount' => sprintf( "%.2f", $accts->[$i]{'amount'} ), 'amountoutstanding' => sprintf( "%.2f", $accts->[$i]{'amountoutstanding'} ), 'accountno' => $accts->[$i]{'accountno'}, - 'payment' => ( $accts->[$i]{'accounttype'} =~ /^Pay/ ), + accounttype => $accts->[$i]{accounttype}, ); if ( $accts->[$i]{'accounttype'} ne 'F' && $accts->[$i]{'accounttype'} ne 'FU' ) { --