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 177-183 if ( $total_paid and $total_paid ne '0.00' ) { Link Here
177
    $total_paid = '0.00';    #TODO not right with pay_individual
177
    $total_paid = '0.00';    #TODO not right with pay_individual
178
}
178
}
179
179
180
borrower_add_additional_fields($borrower, $template);
180
borrower_add_additional_fields($borrower, $template, $category);
181
181
182
$template->param(%$borrower);
182
$template->param(%$borrower);
183
183
Lines 197-215 $template->param( Link Here
197
output_html_with_http_headers $input, $cookie, $template->output;
197
output_html_with_http_headers $input, $cookie, $template->output;
198
198
199
sub borrower_add_additional_fields {
199
sub borrower_add_additional_fields {
200
    my ( $b_ref, $template ) = @_;
200
    my ( $b_ref, $template, $category ) = @_;
201
201
202
# some borrower info is not returned in the standard call despite being assumed
202
# some borrower info is not returned in the standard call despite being assumed
203
# in a number of templates. It should not be the business of this script but in lieu of
203
# in a number of templates. It should not be the business of this script but in lieu of
204
# a revised api here it is ...
204
# a revised api here it is ...
205
    if ( $b_ref->{category_type} eq 'C' ) {
205
    if ( $category->category_type eq 'C' ) {
206
        my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
206
        my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
207
        $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
207
        $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
208
        $template->param( 'catcode' => $patron_categories->next->categorycode )  if $patron_categories->count == 1;
208
        $template->param( 'catcode' => $patron_categories->next->categorycode )  if $patron_categories->count == 1;
209
    }
209
    }
210
210
211
    if (C4::Context->preference('ExtendedPatronAttributes')) {
211
    if (C4::Context->preference('ExtendedPatronAttributes')) {
212
        $b_ref->{extendedattributes} = GetBorrowerAttributes($b_ref->{borrowernumber});
212
        my $extendedattributes = GetBorrowerAttributes($b_ref->{borrowernumber});
213
        $template->param( extendedattributes => $extendedattributes );
213
    }
214
    }
214
215
215
    return;
216
    return;
216
- 

Return to bug 21008