Bugzilla – Attachment 80220 Details for
Bug 21417
EDI ordering fails when basket and EAN libraries do not match
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21417: EDI ordering fails when basket and EAN libraries do not match
Bug-21417-EDI-ordering-fails-when-basket-and-EAN-l.patch (text/plain), 5.40 KB, created by
Martin Renvoize (ashimema)
on 2018-10-08 13:57:49 UTC
(
hide
)
Description:
Bug 21417: EDI ordering fails when basket and EAN libraries do not match
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2018-10-08 13:57:49 UTC
Size:
5.40 KB
patch
obsolete
>From 14ab7a7d0a07a041498a73846f3461b3093e29e4 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutiosn.com> >Date: Thu, 27 Sep 2018 06:51:27 -0400 >Subject: [PATCH] Bug 21417: EDI ordering fails when basket and EAN libraries > do not match > >When clicking Create EDIFACT Order on /acqui/basket.pl, an EDIFACT message will not be generated if aqbasket.branch does not match edifact_ean.branchcode. This failure does not generate any sort of error message, it just fails to produce a message. > >We should allow ean's to not require a branch to be set, then if we don't find a branch specific each, we can look for the default version of the ean. > >Test Plan: >1) Apply this patch set >2) Run updatedatabase >3) Verify you can create a Library EAN without setting a branchcode for it >4) Verify you can use this EAN to send an EDI order where the basket has a branchcode set > >Signed-off-by: Colin Campbell <colin.campbell@ptfs-europe.com> >Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/EDI.pm | 10 ++++++++++ > admin/edi_ean_accounts.pl | 4 ++-- > installer/data/mysql/atomicupdate/bug_21417.perl | 7 +++++++ > installer/data/mysql/kohastructure.sql | 2 +- > .../prog/en/modules/admin/edi_ean_accounts.tt | 1 + > 5 files changed, 21 insertions(+), 3 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_21417.perl > >diff --git a/Koha/EDI.pm b/Koha/EDI.pm >index 4840fe1f5a..0e632c9294 100644 >--- a/Koha/EDI.pm >+++ b/Koha/EDI.pm >@@ -81,6 +81,16 @@ sub create_edi_order { > my $ean_obj = > $schema->resultset('EdifactEan')->search($ean_search_keys)->single; > >+ # If no branch specific each can be found, look for a default ean >+ unless ($ean_obj) { >+ $ean_obj = $schema->resultset('EdifactEan')->search( >+ { >+ ean => $ean, >+ branchcode => undef, >+ } >+ )->single; >+ } >+ > my $dbh = C4::Context->dbh; > my $arr_ref = $dbh->selectcol_arrayref( > 'select id from edifact_messages where basketno = ? and message_type = \'QUOTE\'', >diff --git a/admin/edi_ean_accounts.pl b/admin/edi_ean_accounts.pl >index e22b04aead..e28457c59c 100755 >--- a/admin/edi_ean_accounts.pl >+++ b/admin/edi_ean_accounts.pl >@@ -68,7 +68,7 @@ else { > if ($change) { > $schema->resultset('EdifactEan')->find($id)->update( > { >- branchcode => scalar $input->param('branchcode'), >+ branchcode => scalar $input->param('branchcode') || undef, > description => scalar $input->param('description'), > ean => scalar $input->param('ean'), > id_code_qualifier => scalar $input->param('id_code_qualifier'), >@@ -78,7 +78,7 @@ else { > else { > my $new_ean = $schema->resultset('EdifactEan')->new( > { >- branchcode => scalar $input->param('branchcode'), >+ branchcode => scalar $input->param('branchcode') || undef, > description => scalar $input->param('description'), > ean => scalar $input->param('ean'), > id_code_qualifier => scalar $input->param('id_code_qualifier'), >diff --git a/installer/data/mysql/atomicupdate/bug_21417.perl b/installer/data/mysql/atomicupdate/bug_21417.perl >new file mode 100644 >index 0000000000..952e5b6bd3 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_21417.perl >@@ -0,0 +1,7 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ $dbh->do( "ALTER TABLE edifact_ean MODIFY branchcode VARCHAR(10) NULL DEFAULT NULL" ); >+ >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug XXXXX - description)\n"; >+} >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index c4d47d2dfb..d4ad63cbaa 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -3733,7 +3733,7 @@ DROP TABLE IF EXISTS edifact_ean; > CREATE TABLE IF NOT EXISTS edifact_ean ( > ee_id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, > description VARCHAR(128) NULL DEFAULT NULL, >- branchcode VARCHAR(10) NOT NULL REFERENCES branches (branchcode), >+ branchcode VARCHAR(10) NULL DEFAULT NULL REFERENCES branches (branchcode), > ean VARCHAR(15) NOT NULL, > id_code_qualifier VARCHAR(3) NOT NULL DEFAULT '14', > CONSTRAINT efk_branchcode FOREIGN KEY ( branchcode ) REFERENCES branches ( branchcode ) >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/edi_ean_accounts.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/edi_ean_accounts.tt >index 939b83499d..fcf40de217 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/edi_ean_accounts.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/edi_ean_accounts.tt >@@ -71,6 +71,7 @@ > <li> > <label for="branchcode">Library: </label> > <select name="branchcode" id="branchcode"> >+ <option value="">All libraries</option> > [% FOREACH branch IN branches %] > [% IF branch.branchcode == ean.branch.branchcode %] > <option value="[% branch.branchcode | html %]" selected="selected">[% branch.branchname | html %]</option> >-- >2.19.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 21417
:
79475
|
79476
|
79525
|
79528
|
79607
| 80220 |
80221