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

(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorList.vue (-1 / +1 lines)
Lines 138-144 export default { Link Here
138
            event.preventDefault();
138
            event.preventDefault();
139
            this.$router.push({
139
            this.$router.push({
140
                name: "VendorShow",
140
                name: "VendorShow",
141
                params: { vendor_id: id },
141
                params: { id: id },
142
            });
142
            });
143
        },
143
        },
144
        doReceive({ id }, dt, event) {
144
        doReceive({ id }, dt, event) {
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorShow.vue (+46 lines)
Lines 36-41 Link Here
36
                :title="$__('Edit vendor')"
36
                :title="$__('Edit vendor')"
37
            />
37
            />
38
            <ToolbarButton
38
            <ToolbarButton
39
                v-if="
40
                    vendor.active &&
41
                    vendor.baskets?.length > 0 &&
42
                    isUserPermitted('CAN_user_acquisition_order_receive')
43
                "
39
                :to="{
44
                :to="{
40
                    path: '/cgi-bin/koha/acqui/parcels.pl',
45
                    path: '/cgi-bin/koha/acqui/parcels.pl',
41
                    query: { booksellerid: vendor.id },
46
                    query: { booksellerid: vendor.id },
Lines 44-49 Link Here
44
                :title="$__('Receive shipments')"
49
                :title="$__('Receive shipments')"
45
                callback="redirect"
50
                callback="redirect"
46
            />
51
            />
52
            <a
53
                v-if="
54
                    (!vendor.baskets || vendor.baskets.length === 0) &&
55
                    (!vendor.subscriptions_count ||
56
                        vendor.subscriptions_count === 0) &&
57
                    (!vendor.invoices || vendor.invoices.length === 0)
58
                "
59
                @click="doDelete(vendor.id, vendor.name)"
60
                class="btn btn-default"
61
                ><font-awesome-icon icon="trash" /> {{ $__("Delete") }}</a
62
            >
47
        </Toolbar>
63
        </Toolbar>
48
        <h1>
64
        <h1>
49
            {{ vendor.name }}
65
            {{ vendor.name }}
Lines 89-97 export default { Link Here
89
    setup() {
105
    setup() {
90
        const { setConfirmationDialog, setMessage } = inject("mainStore");
106
        const { setConfirmationDialog, setMessage } = inject("mainStore");
91
107
108
        const permissionsStore = inject("permissionsStore");
109
        const { isUserPermitted } = permissionsStore;
110
92
        return {
111
        return {
93
            setConfirmationDialog,
112
            setConfirmationDialog,
94
            setMessage,
113
            setMessage,
114
            isUserPermitted,
95
        };
115
        };
96
    },
116
    },
97
    data() {
117
    data() {
Lines 116-121 export default { Link Here
116
                error => {}
136
                error => {}
117
            );
137
            );
118
        },
138
        },
139
        doDelete(id, name) {
140
            this.setConfirmationDialog(
141
                {
142
                    title: this.$__(
143
                        "Are you sure you want to remove this vendor?"
144
                    ),
145
                    message: name,
146
                    accept_label: this.$__("Yes, delete"),
147
                    cancel_label: this.$__("No, do not delete"),
148
                },
149
                () => {
150
                    const client = APIClient.acquisition;
151
                    client.vendors.delete(id).then(
152
                        success => {
153
                            this.setMessage(
154
                                this.$__("Vendor %s deleted").format(name),
155
                                true
156
                            );
157
                            this.$router.push({ name: "VendorList" });
158
                        },
159
                        error => {}
160
                    );
161
                }
162
            );
163
        },
119
    },
164
    },
120
    components: {
165
    components: {
121
        Toolbar,
166
        Toolbar,
Lines 127-132 export default { Link Here
127
        VendorContacts,
172
        VendorContacts,
128
        VendorSubscriptions,
173
        VendorSubscriptions,
129
        VendorContracts,
174
        VendorContracts,
175
        DropdownButtons,
130
    },
176
    },
131
    name: "VendorShow",
177
    name: "VendorShow",
132
};
178
};
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/acquisition-api-client.js (-2 / +1 lines)
Lines 14-20 export class AcquisitionAPIClient extends HttpClient { Link Here
14
                    endpoint: "vendors/" + id,
14
                    endpoint: "vendors/" + id,
15
                    headers: {
15
                    headers: {
16
                        "x-koha-embed":
16
                        "x-koha-embed":
17
                            "aliases,subscriptions+count,interfaces,contacts,contracts",
17
                            "aliases,subscriptions+count,interfaces,contacts,contracts,baskets",
18
                    },
18
                    },
19
                }),
19
                }),
20
            getAll: (query, params) =>
20
            getAll: (query, params) =>
21
- 

Return to bug 38010