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

(-)a/api/v1/swagger/definitions/vendor.yaml (+6 lines)
Lines 121-126 properties: Link Here
121
      - "null"
121
      - "null"
122
    description: External id
122
    description: External id
123
    maxLength: 255
123
    maxLength: 255
124
  payment_method:
125
    type:
126
      - string
127
      - "null"
128
    description: Payment method
129
    maxLength: 255
124
  aliases:
130
  aliases:
125
    type: array
131
    type: array
126
    description: List of aliases
132
    description: List of aliases
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorResource.vue (-4 / +39 lines)
Lines 471-477 export default { Link Here
471
                        { value: true, description: $__("Active") },
471
                        { value: true, description: $__("Active") },
472
                        { value: false, description: $__("Inactive") },
472
                        { value: false, description: $__("Inactive") },
473
                    ],
473
                    ],
474
                    value: true,
474
                    defaultValue: true,
475
                },
475
                },
476
                {
476
                {
477
                    name: "list_currency",
477
                    name: "list_currency",
Lines 503-509 export default { Link Here
503
                        { value: true, description: $__("Yes") },
503
                        { value: true, description: $__("Yes") },
504
                        { value: false, description: $__("No") },
504
                        { value: false, description: $__("No") },
505
                    ],
505
                    ],
506
                    value: true,
506
                    defaultValue: true,
507
                    hideIn: ["List"],
507
                    hideIn: ["List"],
508
                },
508
                },
509
                {
509
                {
Lines 515-521 export default { Link Here
515
                        { value: true, description: $__("Include tax") },
515
                        { value: true, description: $__("Include tax") },
516
                        { value: false, description: $__("Don't include tax") },
516
                        { value: false, description: $__("Don't include tax") },
517
                    ],
517
                    ],
518
                    value: true,
518
                    defaultValue: true,
519
                    hideIn: ["List"],
520
                },
521
                {
522
                    name: "payment_method",
523
                    group: $__("Ordering information"),
524
                    type: "select",
525
                    label: $__("Payment method"),
526
                    avCat: "av_vendor_payment_methods",
527
                    allowMultipleChoices: true,
519
                    hideIn: ["List"],
528
                    hideIn: ["List"],
520
                },
529
                },
521
                {
530
                {
Lines 527-533 export default { Link Here
527
                        { value: true, description: $__("Include tax") },
536
                        { value: true, description: $__("Include tax") },
528
                        { value: false, description: $__("Don't include tax") },
537
                        { value: false, description: $__("Don't include tax") },
529
                    ],
538
                    ],
530
                    value: true,
539
                    defaultValue: true,
531
                    hideIn: ["List"],
540
                    hideIn: ["List"],
532
                },
541
                },
533
                {
542
                {
Lines 743-748 export default { Link Here
743
            baseResource.setWarning(errors.join("<br>"));
752
            baseResource.setWarning(errors.join("<br>"));
744
            if (errors.length) return false;
753
            if (errors.length) return false;
745
754
755
            if (vendor.payment_method && vendor.payment_method.length) {
756
                vendor.payment_method = vendor.payment_method.join("|");
757
            } else {
758
                vendor.payment_method = null;
759
            }
760
746
            if (vendorId) {
761
            if (vendorId) {
747
                baseResource.apiClient.update(vendor, vendorId).then(
762
                baseResource.apiClient.update(vendor, vendorId).then(
748
                    success => {
763
                    success => {
Lines 781-786 export default { Link Here
781
                    componentData.resource.value.discount =
796
                    componentData.resource.value.discount =
782
                        componentData.resource.value.discount.toFixed(1);
797
                        componentData.resource.value.discount.toFixed(1);
783
                }
798
                }
799
                componentData.resource.payment_method = resource.payment_method
800
                    ? resource.payment_method.split("|")
801
                    : [];
784
            }
802
            }
785
            if (caller === "show") {
803
            if (caller === "show") {
786
                let physicalAddress = "";
804
                let physicalAddress = "";
Lines 790-795 export default { Link Here
790
                    }
808
                    }
791
                });
809
                });
792
                resource.physical = physicalAddress;
810
                resource.physical = physicalAddress;
811
812
                if (resource.payment_method) {
813
                    const avs =
814
                        componentData.instancedResource.authorisedValues
815
                            .av_vendor_payment_methods;
816
                    const paymentMethods = resource.payment_method.split("|");
817
                    let displayString = "";
818
                    paymentMethods.forEach((method, i) => {
819
                        const isLastMethod = i + 1 === paymentMethods.length;
820
                        const avMatch = avs.find(av => av.value === method);
821
                        if (avMatch) {
822
                            displayString += avMatch.description;
823
                            if (!isLastMethod) displayString += ", ";
824
                        }
825
                    });
826
                    resource.payment_method = displayString;
827
                }
793
            }
828
            }
794
        };
829
        };
795
830
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/stores/vendors.js (-1 / +1 lines)
Lines 17-22 export const useVendorStore = defineStore("vendors", () => { Link Here
17
        authorisedValues: {
17
        authorisedValues: {
18
            av_vendor_types: "VENDOR_TYPE",
18
            av_vendor_types: "VENDOR_TYPE",
19
            av_vendor_interface_types: "VENDOR_INTERFACE_TYPE",
19
            av_vendor_interface_types: "VENDOR_INTERFACE_TYPE",
20
            av_vendor_payment_methods: "VENDOR_PAYMENT_METHOD",
20
        },
21
        },
21
        userPermissions: null,
22
        userPermissions: null,
22
    });
23
    });
23
- 

Return to bug 38207