From 655d0ef24a6e50a32b883930f7c3cda7eea8ab85 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 8 Jul 2025 14:43:55 +0100 Subject: [PATCH] Bug 20253: Add po_is_basketname field to vendor_edi_accounts table This patch adds a new boolean field 'po_is_basketname' to the vendor_edi_accounts table to allow configuration of how basket names are used in EDIFACT. Changes: - Added atomicupdate for existing installations - Updated kohastructure.sql for new installations --- .../bug_20253_basket_name_source.pl | 22 +++++++++++++++++++ installer/data/mysql/kohastructure.sql | 1 + 2 files changed, 23 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_20253_basket_name_source.pl diff --git a/installer/data/mysql/atomicupdate/bug_20253_basket_name_source.pl b/installer/data/mysql/atomicupdate/bug_20253_basket_name_source.pl new file mode 100755 index 00000000000..3820f8ff3da --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_20253_basket_name_source.pl @@ -0,0 +1,22 @@ +use Modern::Perl; +use Koha::Installer::Output qw(say_warning say_success say_info); + +return { + bug_number => "20253", + description => "Add purchase order number configuration option to vendor_edi_accounts", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + unless ( column_exists( 'vendor_edi_accounts', 'po_is_basketname' ) ) { + $dbh->do( + q{ + ALTER TABLE vendor_edi_accounts + ADD COLUMN `po_is_basketname` tinyint(1) NOT NULL DEFAULT 0 + AFTER `plugin` + } + ); + say_success( $out, "Added column 'vendor_edi_accounts.po_is_basketname'" ); + } + }, +}; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index e39e9350f1a..f9e0502a2b9 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -6665,6 +6665,7 @@ CREATE TABLE `vendor_edi_accounts` ( `auto_orders` tinyint(1) NOT NULL DEFAULT 0, `shipment_budget` int(11) DEFAULT NULL, `plugin` varchar(256) NOT NULL DEFAULT '', + `po_is_basketname` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `vendorid` (`vendor_id`), KEY `shipmentbudget` (`shipment_budget`), -- 2.50.1