Bugzilla – Attachment 175140 Details for
Bug 38207
Add vendor payment methods
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38207: Add a new payment_method column to aqbooksellers
Bug-38207-Add-a-new-paymentmethod-column-to-aqbook.patch (text/plain), 4.31 KB, created by
Matt Blenkinsop
on 2024-12-04 10:13:15 UTC
(
hide
)
Description:
Bug 38207: Add a new payment_method column to aqbooksellers
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2024-12-04 10:13:15 UTC
Size:
4.31 KB
patch
obsolete
>From f0f5fc006f4fdc05b5acb23fe728d01add006fae Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Fri, 18 Oct 2024 14:48:34 +0000 >Subject: [PATCH] Bug 38207: Add a new payment_method column to aqbooksellers > >(cherry picked from commit 881f96172a8c1b35d3e74f7f0f6aa44629578021) >--- > .../bug_38207-add-vendor-payment-method.pl | 41 +++++++++++++++++++ > installer/data/mysql/kohastructure.sql | 1 + > .../vue/components/Vendors/VendorFormAdd.vue | 9 ++++ > 3 files changed, 51 insertions(+) > create mode 100644 installer/data/mysql/atomicupdate/bug_38207-add-vendor-payment-method.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_38207-add-vendor-payment-method.pl b/installer/data/mysql/atomicupdate/bug_38207-add-vendor-payment-method.pl >new file mode 100644 >index 00000000000..13adc1bb811 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_38207-add-vendor-payment-method.pl >@@ -0,0 +1,41 @@ >+use Modern::Perl; >+use Koha::Installer::Output qw(say_warning say_failure say_success say_info); >+ >+return { >+ bug_number => "38207", >+ description => "Add a payment method to the vendor table", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ unless ( column_exists( 'aqbooksellers', 'payment_method' ) ) { >+ $dbh->do( >+ q{ >+ ALTER TABLE aqbooksellers >+ ADD COLUMN `payment_method` varchar(255) NULL DEFAULT NULL >+ COMMENT 'the payment method for the vendor' >+ AFTER external_id >+ } >+ ); >+ >+ say $out "Added new column 'aqbooksellers.payment_method'"; >+ } >+ >+ $dbh->do( >+ q{ >+ INSERT IGNORE INTO authorised_value_categories( category_name, is_system ) VALUES ('VENDOR_PAYMENT_METHOD', 1); >+ } >+ ); >+ say $out "Added VENDOR_PAYMENT_METHOD authorised value category"; >+ >+ $dbh->do( >+ q{ >+ INSERT IGNORE INTO authorised_values (category, authorised_value, lib) >+ VALUES >+ ('VENDOR_PAYMENT_METHOD', 'card', 'Card'), >+ ('VENDOR_PAYMENT_METHOD', 'bacs', 'BACS'); >+ } >+ ); >+ say $out "Added Card and BACS to VENDOR_PAYMENT_METHODS authorised value category"; >+ }, >+}; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index d3686595715..428010e612d 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -502,6 +502,7 @@ CREATE TABLE `aqbooksellers` ( > `fax` varchar(50) DEFAULT NULL COMMENT 'vendor fax number', > `deliverytime` int(11) DEFAULT NULL COMMENT 'vendor delivery time', > `external_id` varchar(255) DEFAULT NULL COMMENT 'external id of the vendor', >+ `payment_method` varchar(255) DEFAULT NULL COMMENT 'the payment method for the vendor', > PRIMARY KEY (`id`), > KEY `listprice` (`listprice`), > KEY `invoiceprice` (`invoiceprice`), >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorFormAdd.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorFormAdd.vue >index 333b453206c..a1663b61102 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorFormAdd.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorFormAdd.vue >@@ -89,6 +89,9 @@ export default { > vendor.address3 && (physical += vendor.address3 + "\n") > vendor.address4 && (physical += vendor.address4 + "\n") > this.vendor.physical = physical >+ this.vendor.payment_method = vendor.payment_method >+ ? vendor.payment_method.split("|") >+ : [] > this.initialized = true > }, > error => {} >@@ -123,6 +126,12 @@ export default { > requiredProperties > ) > >+ if (vendor.payment_method && vendor.payment_method.length > 0) { >+ vendor.payment_method = vendor.payment_method.join("|") >+ } else { >+ vendor.payment_method = null >+ } >+ > const client = APIClient.acquisition > if (vendorId) { > client.vendors.update(vendor, vendorId).then( >-- >2.39.3 (Apple Git-146)
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 38207
: 175140 |
175141
|
175142
|
175143