From 3274fa66dc6d9fdf3ec224a0b5f548b805b373d4 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Fri, 18 Oct 2024 14:49:51 +0000 Subject: [PATCH] Bug 38207: Update UI to use new field Signed-off-by: David Nind --- 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 }} +
  • + + + {{ displayPaymentMethods() }} + +
  • @@ -106,6 +112,17 @@ :options="currencies" />
  • +
  • + + +
  • { + 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