Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
911 changes: 911 additions & 0 deletions Koha/MarcOrder.pm

Large diffs are not rendered by default.

63 changes: 63 additions & 0 deletions Koha/MarcOrderAccount.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package Koha::MarcOrderAccount;

# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Koha is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Koha; if not, see <http://www.gnu.org/licenses>.

use Modern::Perl;

use Koha::Database;

use base qw(Koha::Object);

=head1 NAME

Koha::MarcOrderAccount - Koha Marc Ordering Account Object class

=head1 API

=head2 Class Methods

=cut

=head3 vendor

=cut

sub vendor {
my ( $self ) = @_;
my $vendor_rs = $self->_result->vendor;
return unless $vendor_rs;
return Koha::Acquisition::Bookseller->_new_from_dbic($vendor_rs);
}

=head3 budget

=cut

sub budget {
my ( $self ) = @_;
my $budget_rs = $self->_result->budget;
return Koha::Acquisition::Fund->_new_from_dbic( $budget_rs );
}

=head3 _type

=cut

sub _type {
return 'MarcOrderAccount';
}

1;
51 changes: 51 additions & 0 deletions Koha/MarcOrderAccounts.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package Koha::MarcOrderAccounts;

# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Koha is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Koha; if not, see <http://www.gnu.org/licenses>.

use Modern::Perl;

use Koha::Database;
use Koha::MarcOrderAccount;

use base qw(Koha::Objects);

=head1 NAME

Koha::MarcOrderAccount - Koha Marc Ordering Account Object class

=head1 API

=head2 Class Methods

=cut

=head3 type

=cut

sub _type {
return 'MarcOrderAccount';
}

=head3 object_class

=cut

sub object_class {
return 'Koha::MarcOrderAccount';
}

1;
19 changes: 17 additions & 2 deletions Koha/Schema/Result/Aqbookseller.pm
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,21 @@ __PACKAGE__->belongs_to(
},
);

=head2 marc_order_accounts

Type: has_many

Related object: L<Koha::Schema::Result::MarcOrderAccount>

=cut

__PACKAGE__->has_many(
"marc_order_accounts",
"Koha::Schema::Result::MarcOrderAccount",
{ "foreign.vendor_id" => "self.id" },
{ cascade_copy => 0, cascade_delete => 0 },
);

=head2 vendor_edi_accounts

Type: has_many
Expand All @@ -510,8 +525,8 @@ __PACKAGE__->has_many(
);


# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-06-30 09:54:35
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xjeOqpcdN3Kb1wmLGDjzLg
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-07-12 16:43:09
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:4L14+X0NSAgyWGrKaFPR5w

__PACKAGE__->add_columns(
'+active' => { is_boolean => 1 },
Expand Down
19 changes: 17 additions & 2 deletions Koha/Schema/Result/Aqbudget.pm
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,21 @@ __PACKAGE__->belongs_to(
},
);

=head2 marc_order_accounts

Type: has_many

Related object: L<Koha::Schema::Result::MarcOrderAccount>

=cut

__PACKAGE__->has_many(
"marc_order_accounts",
"Koha::Schema::Result::MarcOrderAccount",
{ "foreign.budget_id" => "self.budget_id" },
{ cascade_copy => 0, cascade_delete => 0 },
);

=head2 suggestions

Type: has_many
Expand Down Expand Up @@ -349,8 +364,8 @@ Composing rels: L</aqbudgetborrowers> -> borrowernumber
__PACKAGE__->many_to_many("borrowernumbers", "aqbudgetborrowers", "borrowernumber");


# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sl+TGQXY85UWwS+Ld/vvyQ
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-07-12 16:51:53
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:pCgGAZOv1TPHe6LIQhb1BQ

__PACKAGE__->belongs_to(
"budget",
Expand Down
Loading