From 20d22f17be639489ee3e1be0c220cc449f2e17f3 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 16 Feb 2024 12:21:25 +0000 Subject: [PATCH] Bug 34478: Add cud-pay and cud-writeoff to paycollect Signed-off-by: Jonathan Druart --- .../prog/en/modules/members/paycollect.tt | 5 +++++ members/paycollect.pl | 18 +++++++++--------- 2 files changed, 14 insertions(+), 9 deletions(-) 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 b04eab2647..0fa0259b2e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt @@ -366,6 +366,11 @@ [% END %]
+ [% IF type != 'WRITEOFF' %] + + [% ELSE %] + + [% END %] Cancel
diff --git a/members/paycollect.pl b/members/paycollect.pl index fee692356e..ddea7cb4cd 100755 --- a/members/paycollect.pl +++ b/members/paycollect.pl @@ -138,7 +138,7 @@ if ( $selected_accts ) { $total_due = $sum->_resultset->first->get_column('total_amountoutstanding'); } -if ( $total_paid and $total_paid ne '0.00' && ( $op eq 'cud-writeoff_individual' || $op eq 'cud-pay_individual' ) ) { +if ( $total_paid and $total_paid ne '0.00' ) { $accountlines_id = $input->param('accountlines_id'); $total_paid = $total_due if (abs($total_paid - $total_due) < 0.01) && C4::Context->preference('RoundFinesAtPayment'); if ( $total_paid < 0 or $total_paid > $total_due ) { @@ -206,7 +206,7 @@ if ( $total_paid and $total_paid ne '0.00' && ( $op eq 'cud-writeoff_individual' $payment_id = $pay_result->{payment_id}; $url = "/cgi-bin/koha/members/pay.pl"; - } else { + } elsif ( $op eq 'cud-pay' || $op eq 'cud-writeoff' ) { if ($selected_accts) { if ( $total_paid > $total_due ) { $template->param( @@ -292,13 +292,13 @@ if ( $input->param('error_over') ) { } $template->param( - payment_id => $payment_id, - - type => $type, - borrowernumber => $borrowernumber, # some templates require global - patron => $patron, - total => $total_due, - available_additional_fields => [ Koha::AdditionalFields->search({ tablename => 'accountlines:credit' })->as_list ], + payment_id => $payment_id, + type => $type, + borrowernumber => $borrowernumber, # some templates require global + patron => $patron, + total => $total_due, + available_additional_fields => + [ Koha::AdditionalFields->search( { tablename => 'accountlines:credit' } )->as_list ], ); output_html_with_http_headers $input, $cookie, $template->output; -- 2.39.5