diff --git a/Koha/Acquisition/Bookseller.pm b/Koha/Acquisition/Bookseller.pm index 0b8a564767..5041582d93 100644 --- a/Koha/Acquisition/Bookseller.pm +++ b/Koha/Acquisition/Bookseller.pm @@ -23,6 +23,8 @@ use Koha::Acquisition::Bookseller::Interfaces; use Koha::Acquisition::Bookseller::Issues; use Koha::Subscriptions; +use C4::Contract qw( GetContracts ); + use base qw( Koha::Object ); =head1 NAME @@ -63,6 +65,24 @@ sub contacts { return Koha::Acquisition::Bookseller::Contacts->_new_from_dbic($contacts_rs); } +=head3 contracts + + my $vendor = Koha::Acquisition::Booksellers->find( $id ); + my @contracts = $vendor->contracts(); + +Returns the list of contracts for the vendor + +=cut + +sub contracts { + my ($self) = @_; + return GetContracts( + { + booksellerid => $self->id, + } + ); +} + =head3 subscriptions my $vendor = Koha::Acquisition::Booksellers->find( $id ); diff --git a/api/v1/swagger/definitions/vendor.yaml b/api/v1/swagger/definitions/vendor.yaml index 5f285dc9bc..e7f1f0d847 100644 --- a/api/v1/swagger/definitions/vendor.yaml +++ b/api/v1/swagger/definitions/vendor.yaml @@ -127,6 +127,15 @@ properties: - integer - "null" description: Number of linked subscriptions + interfaces: + type: array + description: List of interfaces + contacts: + type: array + description: List of contacts + contracts: + type: array + description: List of contracts additionalProperties: false required: - name \ No newline at end of file diff --git a/api/v1/swagger/paths/acquisitions_vendors.yaml b/api/v1/swagger/paths/acquisitions_vendors.yaml index 4670ff8125..98980dc757 100644 --- a/api/v1/swagger/paths/acquisitions_vendors.yaml +++ b/api/v1/swagger/paths/acquisitions_vendors.yaml @@ -139,6 +139,21 @@ summary: Get vendor parameters: - $ref: "../swagger.yaml#/parameters/vendor_id_pp" + - name: x-koha-embed + in: header + required: false + description: Embed list sent as a request header + type: array + items: + type: string + enum: + - aliases + - baskets + - subscriptions + - interfaces + - contacts + - contracts + collectionFormat: csv produces: - application/json responses: diff --git a/koha-tmpl/intranet-tmpl/prog/js/fetch/acquisition-api-client.js b/koha-tmpl/intranet-tmpl/prog/js/fetch/acquisition-api-client.js index ee706225bd..e86c184a17 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/fetch/acquisition-api-client.js +++ b/koha-tmpl/intranet-tmpl/prog/js/fetch/acquisition-api-client.js @@ -11,7 +11,8 @@ export class AcquisitionAPIClient { this.get({ endpoint: "vendors/" + id, headers: { - "x-koha-embed": "aliases", + "x-koha-embed": + "baskets,aliases,subscriptions,interfaces,contacts,contracts", }, }), getAll: (query, params) => diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorContacts.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorContacts.vue new file mode 100644 index 0000000000..28e3b97f86 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorContacts.vue @@ -0,0 +1,97 @@ + + + + {{ $__("Contact") }} + + {{ + $__("No contacts") + }} + + {{ contact.name }} + + {{ $__("Position") }}: + {{ contact.position }} + + + {{ $__("Phone") }}: + {{ contact.phone }} + + + {{ $__("Alternative phone") }}: + {{ contact.altphone }} + + + {{ $__("Fax") }}: + {{ contact.fax }} + + + {{ $__("Email") }}: + + {{ + contact.email + }} + + + + {{ $__("Notes") }}: + {{ contact.notes }} + + + {{ $__("Acquisitions options") }}: + + + + {{ $__("Primary acquisitions contact") }} + + + + {{ $__("Receives orders") }} + + + + {{ $__("Receives claims for late orders") }} + + + + + {{ $__("Serials options") }}: + + + + {{ $__("Primary serials contact") }} + + + + {{ $__("Receives claims for late issues") }} + + + + + + + + + + diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorContracts.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorContracts.vue new file mode 100644 index 0000000000..141106c365 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorContracts.vue @@ -0,0 +1,64 @@ + + {{ $__("Contract(s)") }} + + + + + + diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorDetails.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorDetails.vue new file mode 100644 index 0000000000..042c7465e6 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorDetails.vue @@ -0,0 +1,78 @@ + + + + {{ $__("Vendor details") }} + + + + {{ $__("Type") }}: + + {{ vendor.type }} + + + + {{ $__("Company name") }}: + + {{ vendor.name }} + + + + {{ $__("Postal address") }}: + + {{ vendor.postal }} + + + + {{ $__("Physical address") }}: + + {{ vendor.address1 }} + {{ vendor.address2 }} + {{ vendor.address3 }} + {{ vendor.address4 }} + + + + {{ $__("Phone") }}: + + {{ vendor.phone }} + + + + {{ $__("Fax") }}: + + {{ vendor.fax }} + + + + {{ $__("Website") }}: + + {{ vendor.url }} + + + + {{ $__("Account number") }}: + + {{ vendor.accountnumber }} + + + + {{ $__("Aliases") }}: + + + {{ alias }} + + + + + + + + + + diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorInterfaces.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorInterfaces.vue new file mode 100644 index 0000000000..4bfa8043fc --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorInterfaces.vue @@ -0,0 +1,54 @@ + + + + {{ $__("Interfaces") }} + + + {{ vi.name }} + + {{ $__("Type") }}: + NEED AUTHORISED VALUES + + + {{ $__("URI") }}: + + {{ vi.uri }} + + + + {{ $__("Login") }}: + + {{ vi.login }} + + + + {{ $__("Password") }}: + + {{ vi.password }} + + + + {{ $__("Account email") }}: + + {{ vi.account_email }} + + + + {{ $__("Notes") }}: + + {{ vi.notes }} + + + + + + + + + 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 new file mode 100644 index 0000000000..916f7bb66c --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorOrderingInformation.vue @@ -0,0 +1,75 @@ + + + + {{ $__("Ordering information") }} + + + + {{ $__("Vendor is") }}: + + {{ vendor.active ? $__("Active") : $__("Inactive") }} + + + + {{ $__("List prices are") }}: + + {{ vendor.listprice }} + + + + {{ $__("Invoice prices are") }}: + + {{ vendor.invoiceprice }} + + + + {{ $__("Tax number registered") }}: + + {{ vendor.gstreg ? $__("Yes") : $__("No") }} + + + + {{ $__("List item price includes tax") }}: + + {{ vendor.listincgst ? $__("Yes") : $__("No") }} + + + + {{ $__("Invoice item price includes tax") }}: + + {{ vendor.invoiceincgst ? $__("Yes") : $__("No") }} + + + + {{ $__("Discount") }}: + + {{ vendor.discount || 0 }} + + + + {{ $__("Tax rate") }}: + + {{ (vendor.tax_rate || 0) * 100 }} + + + + {{ $__("Delivery time") }}: + {{ vendor.deliverytime }} days + + + {{ $__("Notes") }}: + {{ vendor.notes }} days + + + + + + + + diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorShow.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorShow.vue new file mode 100644 index 0000000000..56046c19e5 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorShow.vue @@ -0,0 +1,123 @@ + + {{ $__("Loading") }} + + + + + + + + {{ vendor.name }} + + + + + + + + + + + + + + + + + + + + + diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorSubscriptions.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorSubscriptions.vue new file mode 100644 index 0000000000..99f2b94514 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorSubscriptions.vue @@ -0,0 +1,27 @@ + + + + {{ $__("Subscription details") }} + + + + {{ $__("Number of subscriptions") }}: + {{ vendor.subscriptions.length }} + {{ vendor.subscriptions.length }} + + + + + + +
+ {{ $__("Number of subscriptions") }}: + {{ vendor.subscriptions.length }} + {{ vendor.subscriptions.length }} +