Bug 38010: Check for invoices before allowing vendor deletion
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
ebb1e2a978
commit
0b032c2585
|
|
@ -187,6 +187,21 @@ sub issues {
|
|||
return Koha::Acquisition::Bookseller::Issues->_new_from_dbic($rs);
|
||||
}
|
||||
|
||||
=head3 invoices
|
||||
|
||||
my $vendor = Koha::Acquisition::Booksellers->find( $id );
|
||||
my @invoices = $vendor->invoices();
|
||||
|
||||
Returns the list of invoices for the vendor
|
||||
|
||||
=cut
|
||||
|
||||
sub invoices {
|
||||
my ($self) = @_;
|
||||
my $invoices_rs = $self->_result->aqinvoices;
|
||||
return Koha::Acquisition::Invoices->_new_from_dbic($invoices_rs);
|
||||
}
|
||||
|
||||
=head3 to_api_mapping
|
||||
|
||||
This method returns the mapping for representing a Koha::Acquisition::Bookseller object
|
||||
|
|
|
|||
|
|
@ -136,6 +136,9 @@ properties:
|
|||
contracts:
|
||||
type: array
|
||||
description: List of contracts
|
||||
invoices:
|
||||
type: array
|
||||
description: List of invoices
|
||||
additionalProperties: false
|
||||
required:
|
||||
- name
|
||||
|
|
@ -37,6 +37,7 @@
|
|||
- aliases
|
||||
- baskets
|
||||
- subscriptions+count
|
||||
- invoices
|
||||
collectionFormat: csv
|
||||
responses:
|
||||
"200":
|
||||
|
|
|
|||
|
|
@ -67,7 +67,9 @@ export default {
|
|||
searchTerm: null,
|
||||
tableOptions: {
|
||||
columns: this.getTableColumns(),
|
||||
options: { embed: "aliases,baskets,subscriptions+count" },
|
||||
options: {
|
||||
embed: "aliases,baskets,subscriptions+count,invoices",
|
||||
},
|
||||
url: () => this.tableURL(),
|
||||
add_filters: true,
|
||||
filters_options: {
|
||||
|
|
@ -91,7 +93,9 @@ export default {
|
|||
(!row.baskets ||
|
||||
row.baskets.length === 0) &&
|
||||
(!row.subscriptions_count ||
|
||||
row.subscriptions_count === 0),
|
||||
row.subscriptions_count === 0) &&
|
||||
(!row.invoices ||
|
||||
row.invoices.length === 0),
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue