View | Details | Raw Unified | Return to bug 38207
Collapse All | Expand All

(-)a/api/v1/swagger/definitions/vendor.yaml (+5 lines)
Lines 114-119 properties: Link Here
114
      - string
114
      - string
115
      - "null"
115
      - "null"
116
    description: External id
116
    description: External id
117
  payment_method:
118
    type:
119
      - string
120
      - "null"
121
    description: Payment method
117
  aliases:
122
  aliases:
118
    type: array
123
    type: array
119
    description: List of aliases
124
    description: List of aliases
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorFormAdd.vue (-3 / +4 lines)
Lines 65-70 export default { Link Here
65
                deliverytime: null,
65
                deliverytime: null,
66
                fax: "",
66
                fax: "",
67
                external_id: "",
67
                external_id: "",
68
                payment_method: [],
68
                aliases: [],
69
                aliases: [],
69
                contacts: [],
70
                contacts: [],
70
                interfaces: [],
71
                interfaces: [],
Lines 97-103 export default { Link Here
97
98
98
                    this.vendor.payment_method = vendor.payment_method
99
                    this.vendor.payment_method = vendor.payment_method
99
                        ? vendor.payment_method.split("|")
100
                        ? vendor.payment_method.split("|")
100
                        : []
101
                        : [];
101
                    if (!this.vendor.discount) this.vendor.discount = 0.0;
102
                    if (!this.vendor.discount) this.vendor.discount = 0.0;
102
                    const decimalPlaces =
103
                    const decimalPlaces =
103
                        this.vendor.discount.toString().split(".")[1]?.length ||
104
                        this.vendor.discount.toString().split(".")[1]?.length ||
Lines 159-167 export default { Link Here
159
            if (errors.length) return false;
160
            if (errors.length) return false;
160
161
161
            if (vendor.payment_method && vendor.payment_method.length > 0) {
162
            if (vendor.payment_method && vendor.payment_method.length > 0) {
162
                vendor.payment_method = vendor.payment_method.join("|")
163
                vendor.payment_method = vendor.payment_method.join("|");
163
            } else {
164
            } else {
164
                vendor.payment_method = null
165
                vendor.payment_method = null;
165
            }
166
            }
166
167
167
            const client = APIClient.acquisition;
168
            const client = APIClient.acquisition;
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorOrderingInformation.vue (-1 / +38 lines)
Lines 22-27 Link Here
22
                    {{ vendor.invoice_currency }}
22
                    {{ vendor.invoice_currency }}
23
                </span>
23
                </span>
24
            </li>
24
            </li>
25
            <li>
26
                <label>{{ $__("Payment method") }}:</label>
27
                <span>
28
                    {{ displayPaymentMethods() }}
29
                </span>
30
            </li>
25
            <li v-if="vendor.tax_rate">
31
            <li v-if="vendor.tax_rate">
26
                <label>{{ $__("Tax number registered") }}:</label>
32
                <label>{{ $__("Tax number registered") }}:</label>
27
                <span>
33
                <span>
Lines 106-111 Link Here
106
                    :options="currencies"
112
                    :options="currencies"
107
                />
113
                />
108
            </li>
114
            </li>
115
            <li>
116
                <label for="payment_method">{{ $__("Payment method") }}:</label>
117
                <v-select
118
                    id="payment_method"
119
                    v-model="vendor.payment_method"
120
                    label="description"
121
                    :reduce="av => av.value"
122
                    :options="authorisedValues.av_vendor_payment_methods"
123
                    multiple
124
                />
125
            </li>
109
            <li>
126
            <li>
110
                <label for="gst">{{ $__("Tax number registered") }}:</label>
127
                <label for="gst">{{ $__("Tax number registered") }}:</label>
111
                <input
128
                <input
Lines 237-250 export default { Link Here
237
    },
254
    },
238
    setup() {
255
    setup() {
239
        const vendorStore = inject("vendorStore");
256
        const vendorStore = inject("vendorStore");
240
        const { currencies, gstValues } = storeToRefs(vendorStore);
257
        const { currencies, gstValues, authorisedValues } =
258
            storeToRefs(vendorStore);
259
        const { get_lib_from_av } = vendorStore;
241
260
242
        return {
261
        return {
243
            currencies,
262
            currencies,
244
            gstValues,
263
            gstValues,
264
            authorisedValues,
265
            get_lib_from_av,
245
        };
266
        };
246
    },
267
    },
247
    methods: {
268
    methods: {
269
        displayPaymentMethods() {
270
            let get_lib_from_av = this.get_lib_from_av;
271
272
            if (this.vendor.payment_method) {
273
                let methods = "";
274
                this.vendor.payment_method.split("|").forEach(method => {
275
                    const methodLib = get_lib_from_av(
276
                        "av_vendor_payment_methods",
277
                        method
278
                    );
279
                    methods += methodLib + ", ";
280
                });
281
                return methods.substring(0, methods.length - 2);
282
            }
283
            return "";
284
        },
248
        formatTaxRate(taxRate) {
285
        formatTaxRate(taxRate) {
249
            if (!taxRate) return 0;
286
            if (!taxRate) return 0;
250
            const decimalPlaces = taxRate.toString().split(".")[1]?.length || 0;
287
            const decimalPlaces = taxRate.toString().split(".")[1]?.length || 0;
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/vendors.js (-1 / +1 lines)
Lines 16-21 export const useVendorStore = defineStore("vendors", () => { Link Here
16
        authorisedValues: {
16
        authorisedValues: {
17
            av_vendor_types: "VENDOR_TYPE",
17
            av_vendor_types: "VENDOR_TYPE",
18
            av_vendor_interface_types: "VENDOR_INTERFACE_TYPE",
18
            av_vendor_interface_types: "VENDOR_INTERFACE_TYPE",
19
            av_vendor_payment_methods: "VENDOR_PAYMENT_METHOD",
19
        },
20
        },
20
    });
21
    });
21
    const sharedActions = withAuthorisedValueActions(store);
22
    const sharedActions = withAuthorisedValueActions(store);
22
- 

Return to bug 38207