Bugzilla – Attachment 183019 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: Update UI to use new field
Bug-38207-Update-UI-to-use-new-field.patch (text/plain), 5.87 KB, created by
David Nind
on 2025-06-06 01:23:13 UTC
(
hide
)
Description:
Bug 38207: Update UI to use new field
Filename:
MIME Type:
Creator:
David Nind
Created:
2025-06-06 01:23:13 UTC
Size:
5.87 KB
patch
obsolete
>From 3274fa66dc6d9fdf3ec224a0b5f548b805b373d4 Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Fri, 18 Oct 2024 14:49:51 +0000 >Subject: [PATCH] Bug 38207: Update UI to use new field > >Signed-off-by: David Nind <david@davidnind.com> >--- > api/v1/swagger/definitions/vendor.yaml | 5 +++ > .../vue/components/Vendors/VendorFormAdd.vue | 7 ++-- > .../Vendors/VendorOrderingInformation.vue | 39 ++++++++++++++++++- > .../prog/js/vue/stores/vendors.js | 1 + > 4 files changed, 48 insertions(+), 4 deletions(-) > >diff --git a/api/v1/swagger/definitions/vendor.yaml b/api/v1/swagger/definitions/vendor.yaml >index 717d958bf7..c66e1f8479 100644 >--- a/api/v1/swagger/definitions/vendor.yaml >+++ b/api/v1/swagger/definitions/vendor.yaml >@@ -114,6 +114,11 @@ properties: > - string > - "null" > description: External id >+ payment_method: >+ type: >+ - string >+ - "null" >+ description: Payment method > aliases: > type: array > description: List of aliases >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 a53e146db1..7deb47883e 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 >@@ -65,6 +65,7 @@ export default { > deliverytime: null, > fax: "", > external_id: "", >+ payment_method: [], > aliases: [], > contacts: [], > interfaces: [], >@@ -97,7 +98,7 @@ export default { > > 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 || >@@ -159,9 +160,9 @@ export default { > if (errors.length) return false; > > if (vendor.payment_method && vendor.payment_method.length > 0) { >- vendor.payment_method = vendor.payment_method.join("|") >+ vendor.payment_method = vendor.payment_method.join("|"); > } else { >- vendor.payment_method = null >+ vendor.payment_method = null; > } > > const client = APIClient.acquisition; >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorOrderingInformation.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorOrderingInformation.vue >index 5fe4367cac..a954e94e1d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorOrderingInformation.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorOrderingInformation.vue >@@ -22,6 +22,12 @@ > {{ vendor.invoice_currency }} > </span> > </li> >+ <li> >+ <label>{{ $__("Payment method") }}:</label> >+ <span> >+ {{ displayPaymentMethods() }} >+ </span> >+ </li> > <li v-if="vendor.tax_rate"> > <label>{{ $__("Tax number registered") }}:</label> > <span> >@@ -106,6 +112,17 @@ > :options="currencies" > /> > </li> >+ <li> >+ <label for="payment_method">{{ $__("Payment method") }}:</label> >+ <v-select >+ id="payment_method" >+ v-model="vendor.payment_method" >+ label="description" >+ :reduce="av => av.value" >+ :options="authorisedValues.av_vendor_payment_methods" >+ multiple >+ /> >+ </li> > <li> > <label for="gst">{{ $__("Tax number registered") }}:</label> > <input >@@ -237,14 +254,34 @@ export default { > }, > setup() { > const vendorStore = inject("vendorStore"); >- const { currencies, gstValues } = storeToRefs(vendorStore); >+ const { currencies, gstValues, authorisedValues } = >+ storeToRefs(vendorStore); >+ const { get_lib_from_av } = vendorStore; > > return { > currencies, > gstValues, >+ authorisedValues, >+ get_lib_from_av, > }; > }, > methods: { >+ displayPaymentMethods() { >+ let get_lib_from_av = this.get_lib_from_av; >+ >+ if (this.vendor.payment_method) { >+ let methods = ""; >+ this.vendor.payment_method.split("|").forEach(method => { >+ const methodLib = get_lib_from_av( >+ "av_vendor_payment_methods", >+ method >+ ); >+ methods += methodLib + ", "; >+ }); >+ return methods.substring(0, methods.length - 2); >+ } >+ return ""; >+ }, > formatTaxRate(taxRate) { > if (!taxRate) return 0; > const decimalPlaces = taxRate.toString().split(".")[1]?.length || 0; >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/vendors.js b/koha-tmpl/intranet-tmpl/prog/js/vue/stores/vendors.js >index 44b0c6bfd1..65136bcfb2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/vendors.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/stores/vendors.js >@@ -16,6 +16,7 @@ export const useVendorStore = defineStore("vendors", () => { > authorisedValues: { > av_vendor_types: "VENDOR_TYPE", > av_vendor_interface_types: "VENDOR_INTERFACE_TYPE", >+ av_vendor_payment_methods: "VENDOR_PAYMENT_METHOD", > }, > }); > const sharedActions = withAuthorisedValueActions(store); >-- >2.39.5
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
|
183017
|
183018
| 183019 |
183020