View | Details | Raw Unified | Return to bug 21008
Collapse All | Expand All

(-)a/members/pay.pl (-4 / +5 lines)
Lines 151-157 sub add_accounts_to_template { Link Here
151
        }
151
        }
152
        push @accounts, $account_line;
152
        push @accounts, $account_line;
153
    }
153
    }
154
    borrower_add_additional_fields($patron->unblessed);
154
    borrower_add_additional_fields($patron);
155
155
156
    $template->param(
156
    $template->param(
157
        patron   => $patron,
157
        patron   => $patron,
Lines 229-248 sub writeoff_all { Link Here
229
}
229
}
230
230
231
sub borrower_add_additional_fields {
231
sub borrower_add_additional_fields {
232
    my $b_ref = shift;
232
    my $patron = shift;
233
233
234
# some borrower info is not returned in the standard call despite being assumed
234
# some borrower info is not returned in the standard call despite being assumed
235
# in a number of templates. It should not be the business of this script but in lieu of
235
# in a number of templates. It should not be the business of this script but in lieu of
236
# a revised api here it is ...
236
# a revised api here it is ...
237
    if ( $b_ref->{category_type} eq 'C' ) {
237
    if ( $patron->category->category_type eq 'C' ) {
238
        my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
238
        my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
239
        $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
239
        $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
240
        $template->param( 'catcode' => $patron_categories->next->categorycode )  if $patron_categories->count == 1;
240
        $template->param( 'catcode' => $patron_categories->next->categorycode )  if $patron_categories->count == 1;
241
    }
241
    }
242
242
243
    if (C4::Context->preference('ExtendedPatronAttributes')) {
243
    if (C4::Context->preference('ExtendedPatronAttributes')) {
244
        $b_ref->{extendedattributes} = GetBorrowerAttributes($borrowernumber);
244
        my $extendedattributes = GetBorrowerAttributes($patron->borrowernumber);
245
        $template->param(
245
        $template->param(
246
            extendedattributes       => $extendedattributes,
246
            ExtendedPatronAttributes => 1,
247
            ExtendedPatronAttributes => 1,
247
        );
248
        );
248
    }
249
    }
(-)a/members/paycollect.pl (-5 / +5 lines)
Lines 180-186 if ( $total_paid and $total_paid ne '0.00' ) { Link Here
180
    $total_paid = '0.00';    #TODO not right with pay_individual
180
    $total_paid = '0.00';    #TODO not right with pay_individual
181
}
181
}
182
182
183
borrower_add_additional_fields($borrower, $template);
183
borrower_add_additional_fields($borrower, $template, $category);
184
184
185
$template->param(%$borrower);
185
$template->param(%$borrower);
186
186
Lines 201-219 $template->param( Link Here
201
output_html_with_http_headers $input, $cookie, $template->output;
201
output_html_with_http_headers $input, $cookie, $template->output;
202
202
203
sub borrower_add_additional_fields {
203
sub borrower_add_additional_fields {
204
    my ( $b_ref, $template ) = @_;
204
    my ( $b_ref, $template, $category ) = @_;
205
205
206
# some borrower info is not returned in the standard call despite being assumed
206
# some borrower info is not returned in the standard call despite being assumed
207
# in a number of templates. It should not be the business of this script but in lieu of
207
# in a number of templates. It should not be the business of this script but in lieu of
208
# a revised api here it is ...
208
# a revised api here it is ...
209
    if ( $b_ref->{category_type} eq 'C' ) {
209
    if ( $category->category_type eq 'C' ) {
210
        my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
210
        my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
211
        $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
211
        $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
212
        $template->param( 'catcode' => $patron_categories->next->categorycode )  if $patron_categories->count == 1;
212
        $template->param( 'catcode' => $patron_categories->next->categorycode )  if $patron_categories->count == 1;
213
    }
213
    }
214
214
215
    if (C4::Context->preference('ExtendedPatronAttributes')) {
215
    if (C4::Context->preference('ExtendedPatronAttributes')) {
216
        $b_ref->{extendedattributes} = GetBorrowerAttributes($b_ref->{borrowernumber});
216
        my $extendedattributes = GetBorrowerAttributes($b_ref->{borrowernumber});
217
        $template->param( extendedattributes => $extendedattributes );
217
    }
218
    }
218
219
219
    return;
220
    return;
220
- 

Return to bug 21008