Bugzilla – Attachment 182584 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.36 KB, created by
Matt Blenkinsop
on 2025-05-19 11:01:02 UTC
(
hide
)
Description:
Bug 38207: Add a new payment_method column to aqbooksellers
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2025-05-19 11:01:02 UTC
Size:
4.36 KB
patch
obsolete
>From 67568dacc94f1b44ea33471f987a9399ee25f9b9 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 5dd0b1a1ab3..f58c0527903 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -501,6 +501,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 4f770c0456a..a53e146db19 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 >@@ -95,6 +95,9 @@ export default { > vendor.address4 && (physical += vendor.address4 + "\n"); > this.vendor.physical = physical; > >+ this.vendor.payment_method = vendor.payment_method >+ ? vendor.payment_method.split("|") >+ : [] > if (!this.vendor.discount) this.vendor.discount = 0.0; > const decimalPlaces = > this.vendor.discount.toString().split(".")[1]?.length || >@@ -155,6 +158,12 @@ export default { > setWarning(errors.join("<br>")); > if (errors.length) return false; > >+ 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.48.1
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
| 182584 |
182585
|
182586
|
182587