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 523-529 export default { Link Here
523
                        { value: true, description: $__("Active") },
523
                        { value: true, description: $__("Active") },
524
                        { value: false, description: $__("Inactive") },
524
                        { value: false, description: $__("Inactive") },
525
                    ],
525
                    ],
526
                    value: true,
526
                    defaultValue: true,
527
                },
527
                },
528
                {
528
                {
529
                    name: "list_currency",
529
                    name: "list_currency",
Lines 555-561 export default { Link Here
555
                        { value: true, description: $__("Yes") },
555
                        { value: true, description: $__("Yes") },
556
                        { value: false, description: $__("No") },
556
                        { value: false, description: $__("No") },
557
                    ],
557
                    ],
558
                    value: true,
558
                    defaultValue: true,
559
                    hideIn: ["List"],
559
                    hideIn: ["List"],
560
                },
560
                },
561
                {
561
                {
Lines 567-573 export default { Link Here
567
                        { value: true, description: $__("Include tax") },
567
                        { value: true, description: $__("Include tax") },
568
                        { value: false, description: $__("Don't include tax") },
568
                        { value: false, description: $__("Don't include tax") },
569
                    ],
569
                    ],
570
                    value: true,
570
                    defaultValue: true,
571
                    hideIn: ["List"],
571
                    hideIn: ["List"],
572
                },
572
                },
573
                {
573
                {
Lines 579-585 export default { Link Here
579
                        { value: true, description: $__("Include tax") },
579
                        { value: true, description: $__("Include tax") },
580
                        { value: false, description: $__("Don't include tax") },
580
                        { value: false, description: $__("Don't include tax") },
581
                    ],
581
                    ],
582
                    value: true,
582
                    defaultValue: true,
583
                    hideIn: ["List"],
584
                },
585
                {
586
                    name: "payment_method",
587
                    group: $__("Ordering information"),
588
                    type: "select",
589
                    label: $__("Payment method"),
590
                    avCat: "av_vendor_payment_methods",
591
                    allowMultipleChoices: true,
583
                    hideIn: ["List"],
592
                    hideIn: ["List"],
584
                },
593
                },
585
                {
594
                {
Lines 794-799 export default { Link Here
794
            baseResource.setWarning(errors.join("<br>"));
803
            baseResource.setWarning(errors.join("<br>"));
795
            if (errors.length) return false;
804
            if (errors.length) return false;
796
805
806
            if (vendor.payment_method && vendor.payment_method.length) {
807
                vendor.payment_method = vendor.payment_method.join("|");
808
            } else {
809
                vendor.payment_method = null;
810
            }
811
797
            if (vendorId) {
812
            if (vendorId) {
798
                baseResource.apiClient.update(vendor, vendorId).then(
813
                baseResource.apiClient.update(vendor, vendorId).then(
799
                    success => {
814
                    success => {
Lines 832-837 export default { Link Here
832
                    componentData.resource.value.discount =
847
                    componentData.resource.value.discount =
833
                        componentData.resource.value.discount.toFixed(1);
848
                        componentData.resource.value.discount.toFixed(1);
834
                }
849
                }
850
                componentData.resource.payment_method = resource.payment_method
851
                    ? resource.payment_method.split("|")
852
                    : [];
835
            }
853
            }
836
            if (caller === "show") {
854
            if (caller === "show") {
837
                let physicalAddress = "";
855
                let physicalAddress = "";
Lines 841-846 export default { Link Here
841
                    }
859
                    }
842
                });
860
                });
843
                resource.physical = physicalAddress;
861
                resource.physical = physicalAddress;
862
863
                if (resource.payment_method) {
864
                    const avs =
865
                        componentData.instancedResource.authorisedValues
866
                            .av_vendor_payment_methods;
867
                    const paymentMethods = resource.payment_method.split("|");
868
                    let displayString = "";
869
                    paymentMethods.forEach((method, i) => {
870
                        const isLastMethod = i + 1 === paymentMethods.length;
871
                        const avMatch = avs.find(av => av.value === method);
872
                        if (avMatch) {
873
                            displayString += avMatch.description;
874
                            if (!isLastMethod) displayString += ", ";
875
                        }
876
                    });
877
                    resource.payment_method = displayString;
878
                }
844
            }
879
            }
845
        };
880
        };
846
881
(-)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