From fbfdf81a704019ce56fbefe3da9606fe91f90ef9 Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Mon, 27 Nov 2017 13:11:09 +1300 Subject: [PATCH] Bug 18889 - Storing and display of barcode with fines in intranet Test plan: 1. Create a manual invoice fine making sure you enter in a barcode value 2. Go to the 'Pay fines' tab and notice that the barcode value is not displayed 3. Apply patch 4. Update your database by running the updatedatabase.pl script in koha-shell This will run the atomicupdate file bug_18889_added_barcode_field_to_accountlines.sql which contains the database changes 5. Update your DBIx by running the command (in the Koha root directory): misc/devel/update_dbix_class_files.pl --db_name= --db_user= --db_pass= 6. Repeat step 1 and 2 and notice that there is a new front end column in the 'Pay fines' page which displays the item barcode Sponsored-By: Catalyst IT --- C4/Accounts.pm | 4 +++- .../atomicupdate/bug_18889_added_barcode_field_to_accountlines.sql | 1 + koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt | 2 ++ members/maninvoice.pl | 2 +- members/pay.pl | 1 + 5 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_18889_added_barcode_field_to_accountlines.sql diff --git a/C4/Accounts.pm b/C4/Accounts.pm index b84627b..4183926 100644 --- a/C4/Accounts.pm +++ b/C4/Accounts.pm @@ -266,7 +266,7 @@ should be the empty string. # sub manualinvoice { - my ( $borrowernumber, $itemnum, $desc, $type, $amount, $note ) = @_; + my ( $borrowernumber, $itemnum, $desc, $type, $amount, $note, $barcode, $skip_notify ) = @_; my $manager_id = 0; $manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv; my $dbh = C4::Context->dbh; @@ -281,6 +281,7 @@ sub manualinvoice { date => \'NOW()', amount => $amount, description => $desc, + barcode => $barcode, accounttype => $type, amountoutstanding => $amountleft, itemnumber => $itemnum || undef, @@ -304,6 +305,7 @@ sub manualinvoice { accountno => $accountno, amount => $amount, description => $desc, + barcode => $barcode, accounttype => $type, amountoutstanding => $amountleft, note => $note, diff --git a/installer/data/mysql/atomicupdate/bug_18889_added_barcode_field_to_accountlines.sql b/installer/data/mysql/atomicupdate/bug_18889_added_barcode_field_to_accountlines.sql new file mode 100644 index 0000000..20347bb --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_18889_added_barcode_field_to_accountlines.sql @@ -0,0 +1 @@ +ALTER TABLE accountlines add barcode varchar(20) DEFAULT NULL; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt index 34b6d11..78a737e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt @@ -41,6 +41,7 @@   Fines & charges Description + Barcode Payment note Account type Amount @@ -101,6 +102,7 @@ [%- IF line.description %], [% line.description %][% END %] [% IF line.title %]([% line.title %])[% END %] + [%- IF line.barcode %] [% line.barcode %][% END %] [% line.accounttype %] [% line.amount | $Price %] diff --git a/members/maninvoice.pl b/members/maninvoice.pl index 84ed122..816b005 100755 --- a/members/maninvoice.pl +++ b/members/maninvoice.pl @@ -61,7 +61,7 @@ if ($add){ my $amount=$input->param('amount'); my $type=$input->param('type'); my $note = $input->param('note'); - my $error = manualinvoice( $borrowernumber, $itemnum, $desc, $type, $amount, $note ); + my $error = manualinvoice( $borrowernumber, $itemnum, $desc, $type, $amount, $note, $barcode ); if ($error) { my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { template_name => "members/maninvoice.tt", diff --git a/members/pay.pl b/members/pay.pl index 05b73e5..d23b9a4 100755 --- a/members/pay.pl +++ b/members/pay.pl @@ -178,6 +178,7 @@ sub redirect_to_paycollect { $redirect .= get_for_redirect( 'amountoutstanding', "amountoutstanding$line_no", 1 ); $redirect .= get_for_redirect( 'description', "description$line_no", 0 ); + $redirect .= get_for_redirect( 'barcode', "description$line_no", 0 ); $redirect .= get_for_redirect( 'title', "title$line_no", 0 ); $redirect .= get_for_redirect( 'itemnumber', "itemnumber$line_no", 0 ); $redirect .= get_for_redirect( 'accountlines_id', "accountlines_id$line_no", 0 ); -- 2.1.4