+
+ # get authorised values with type of MANUAL_INV
+ my @invoice_types;
+ my $dbh = C4::Context->dbh;
+ my $sth = $dbh->prepare('SELECT * FROM authorised_values WHERE category = "MANUAL_INV"');
+ $sth->execute();
+ while ( my $row = $sth->fetchrow_hashref() ) {
+ push @invoice_types, $row;
+ }
+ $template->param( invoice_types_loop => \@invoice_types );
+
+ if ( $data->{'category_type'} eq 'C') {
+ my ( $catcodes, $labels ) = GetborCatFromCatType( 'A', 'WHERE category_type = ?' );
+ my $cnt = scalar(@$catcodes);
+ $template->param( 'CATCODE_MULTI' => 1) if $cnt > 1;
+ $template->param( 'catcode' => $catcodes->[0]) if $cnt == 1;
+ }
+
+ $template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' );
+ my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'});
+ $template->param( picture => 1 ) if $picture;
+
+if (C4::Context->preference('ExtendedPatronAttributes')) {
+ my $attributes = GetBorrowerAttributes($borrowernumber);
+ $template->param(
+ ExtendedPatronAttributes => 1,
+ extendedattributes => $attributes
+ );
+}
+ $template->param(
+ borrowernumber => $borrowernumber,
+ firstname => $data->{'firstname'},
+ surname => $data->{'surname'},
+ cardnumber => $data->{'cardnumber'},
+ categorycode => $data->{'categorycode'},
+ category_type => $data->{'category_type'},
+ categoryname => $data->{'description'},
+ address => $data->{'address'},
+ address2 => $data->{'address2'},
+ city => $data->{'city'},
+ state => $data->{'state'},
+ zipcode => $data->{'zipcode'},
+ country => $data->{'country'},
+ phone => $data->{'phone'},
+ email => $data->{'email'},
+ branchcode => $data->{'branchcode'},
+ branchname => GetBranchName($data->{'branchcode'}),
+ is_child => ($data->{'category_type'} eq 'C'),
+ activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
+ );
+ output_html_with_http_headers $input, $cookie, $template->output;