From c84b638d013a46ad4170f5ac73fe82c018fd2e07 Mon Sep 17 00:00:00 2001 From: PTFS Date: Sat, 25 Jul 2009 10:22:51 +0100 Subject: [PATCH] Add predefined fee types Ability in system administration to define additional fee and fine options that appear in dropdown box on the create manual invoice tab in patron fines. To use create authorised values with the category MANUAL_INV, Authorized Value is the description, and Description is the default fee, if any. This work sponsered by East Brunswick Public Library, East Brunswick, NJ, USA Signed-off-by: Colin Campbell --- .../prog/en/modules/members/maninvoice.tmpl | 31 ++++++++++++++----- members/maninvoice.pl | 13 +++++++- 2 files changed, 36 insertions(+), 8 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tmpl index e4824f5080..a7c49e8482 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tmpl @@ -41,13 +41,30 @@ $(document).ready(function(){
Manual Invoice
    -
  1. +
  2. + + + +
  3. Example: 5.00
  4. diff --git a/members/maninvoice.pl b/members/maninvoice.pl index a0b0832044..ff0b9ff5be 100755 --- a/members/maninvoice.pl +++ b/members/maninvoice.pl @@ -34,13 +34,14 @@ my $input=new CGI; my $borrowernumber=$input->param('borrowernumber'); + # get borrower details my $data=GetMember($borrowernumber,'borrowernumber'); my $add=$input->param('add'); if ($add){ # print $input->header; my $barcode=$input->param('barcode'); - my $itemnum = GetItemnumberFromBarcode($barcode) if $barcode; + my $itemnum = GetItemnumberFromBarcode($barcode) if $barcode; my $desc=$input->param('desc'); my $amount=$input->param('amount'); my $type=$input->param('type'); @@ -75,6 +76,16 @@ if ($add){ debug => 1, }); + # 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); -- 2.39.5