Bugzilla – Attachment 175142 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.58 KB, created by
Matt Blenkinsop
on 2024-12-04 10:13:20 UTC
(
hide
)
Description:
Bug 38207: Update UI to use new field
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2024-12-04 10:13:20 UTC
Size:
5.58 KB
patch
obsolete
>From f037b91a685e3ab5479cc5c7c77848c2b2f376a0 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 > >--- > api/v1/swagger/definitions/vendor.yaml | 5 +++ > .../prog/js/vue/components/Vendors/Main.vue | 1 + > .../vue/components/Vendors/VendorFormAdd.vue | 2 + > .../Vendors/VendorOrderingInformation.vue | 37 ++++++++++++++++++- > .../prog/js/vue/stores/authorised-values.js | 1 + > 5 files changed, 45 insertions(+), 1 deletion(-) > >diff --git a/api/v1/swagger/definitions/vendor.yaml b/api/v1/swagger/definitions/vendor.yaml >index 0724ea69214..0260d357d13 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/Main.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/Main.vue >index 620d679bade..7362c1af164 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/Main.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/Main.vue >@@ -66,6 +66,7 @@ export default { > const authorised_values = { > av_vendor_types: "VENDOR_TYPE", > av_vendor_interface_types: "VENDOR_INTERFACE_TYPE", >+ av_vendor_payment_methods: "VENDOR_PAYMENT_METHOD", > } > > let av_cat_array = Object.keys(authorised_values).map(function ( >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 a1663b61102..087524f457f 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 >@@ -61,6 +61,8 @@ export default { > deliverytime: null, > fax: "", > external_id: "", >+ payment_method: [], >+ language: "", > aliases: [], > contacts: [], > interfaces: [], >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 bbcaaf74c66..d73b34f12a2 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> >@@ -108,6 +114,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="av_vendor_payment_methods" >+ multiple >+ /> >+ </li> > <li> > <label for="gst">{{ $__("Tax number registered") }}:</label> > <input >@@ -232,14 +249,32 @@ export default { > const { currencies, gstValues } = storeToRefs(vendorStore) > > const AVStore = inject("AVStore") >- const { get_lib_from_av } = AVStore >+ const { get_lib_from_av, av_vendor_payment_methods } = AVStore > > return { > currencies, > gstValues, >+ av_vendor_payment_methods, >+ 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/authorised-values.js b/koha-tmpl/intranet-tmpl/prog/js/vue/stores/authorised-values.js >index ebe6a80b5fc..39f58bd3e4f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/authorised-values.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/stores/authorised-values.js >@@ -44,6 +44,7 @@ export const useAVStore = defineStore("authorised_values", { > av_item_reports_metrics: [], > av_vendor_types: [], > av_vendor_interface_types: [], >+ av_vendor_payment_methods: [], > }), > actions: { > get_lib_from_av(arr_name, av) { >-- >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