From 367574d24cc2df63664e83fb5e4c9a4e2c0f3ab3 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 | 2 ++ koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt | 2 ++ members/maninvoice.pl | 2 +- members/pay.pl | 1 + 5 files changed, 9 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 0717215..7ed3237 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, $skip_notify ) = @_; + 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; @@ -292,6 +292,7 @@ sub manualinvoice { date => \'NOW()', amount => $amount, description => $desc, + barcode => $barcode, accounttype => $type, amountoutstanding => $amountleft, itemnumber => $itemnum || undef, @@ -316,6 +317,7 @@ sub manualinvoice { accountno => $accountno, amount => $amount, description => $desc, + barcode => $barcode, accounttype => $type, amountoutstanding => $amountleft, notify_id => $notifyid, 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..12a6057 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_18889_added_barcode_field_to_accountlines.sql @@ -0,0 +1,2 @@ +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 ead4ce4..9c33730 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt @@ -77,6 +77,7 @@ function enableCheckboxActions(){   Fines & charges Description + Barcode Payment note Account type Notify id @@ -143,6 +144,7 @@ function enableCheckboxActions(){ [%- IF line.description %], [% line.description %][% END %] [% IF line.title %]([% line.title %])[% END %] + [%- IF line.barcode %] [% line.barcode %][% END %] [% line.accounttype %] [% line.notify_id %] diff --git a/members/maninvoice.pl b/members/maninvoice.pl index bd24a10..d0b85f5 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 70e45e2..a4415c2 100755 --- a/members/pay.pl +++ b/members/pay.pl @@ -194,6 +194,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( 'notify_id', "notify_id$line_no", 0 ); -- 2.1.4