314 lines
5.4 KiB
Perl
314 lines
5.4 KiB
Perl
use utf8;
|
|
package Koha::Schema::Result::Issue;
|
|
|
|
# Created by DBIx::Class::Schema::Loader
|
|
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
|
|
|
=head1 NAME
|
|
|
|
Koha::Schema::Result::Issue
|
|
|
|
=cut
|
|
|
|
use strict;
|
|
use warnings;
|
|
|
|
use base 'DBIx::Class::Core';
|
|
|
|
=head1 TABLE: C<issues>
|
|
|
|
=cut
|
|
|
|
__PACKAGE__->table("issues");
|
|
|
|
=head1 ACCESSORS
|
|
|
|
=head2 issue_id
|
|
|
|
data_type: 'integer'
|
|
is_auto_increment: 1
|
|
is_nullable: 0
|
|
|
|
=head2 borrowernumber
|
|
|
|
data_type: 'integer'
|
|
is_foreign_key: 1
|
|
is_nullable: 1
|
|
|
|
=head2 itemnumber
|
|
|
|
data_type: 'integer'
|
|
is_foreign_key: 1
|
|
is_nullable: 1
|
|
|
|
=head2 date_due
|
|
|
|
data_type: 'datetime'
|
|
datetime_undef_if_invalid: 1
|
|
is_nullable: 1
|
|
|
|
=head2 branchcode
|
|
|
|
data_type: 'varchar'
|
|
is_nullable: 1
|
|
size: 10
|
|
|
|
=head2 returndate
|
|
|
|
data_type: 'datetime'
|
|
datetime_undef_if_invalid: 1
|
|
is_nullable: 1
|
|
|
|
=head2 lastreneweddate
|
|
|
|
data_type: 'datetime'
|
|
datetime_undef_if_invalid: 1
|
|
is_nullable: 1
|
|
|
|
=head2 renewals
|
|
|
|
data_type: 'tinyint'
|
|
default_value: 0
|
|
is_nullable: 0
|
|
|
|
=head2 auto_renew
|
|
|
|
data_type: 'tinyint'
|
|
default_value: 0
|
|
is_nullable: 1
|
|
|
|
=head2 auto_renew_error
|
|
|
|
data_type: 'varchar'
|
|
is_nullable: 1
|
|
size: 32
|
|
|
|
=head2 timestamp
|
|
|
|
data_type: 'timestamp'
|
|
datetime_undef_if_invalid: 1
|
|
default_value: current_timestamp
|
|
is_nullable: 0
|
|
|
|
=head2 issuedate
|
|
|
|
data_type: 'datetime'
|
|
datetime_undef_if_invalid: 1
|
|
is_nullable: 1
|
|
|
|
=head2 onsite_checkout
|
|
|
|
data_type: 'integer'
|
|
default_value: 0
|
|
is_nullable: 0
|
|
|
|
=head2 note
|
|
|
|
data_type: 'longtext'
|
|
is_nullable: 1
|
|
|
|
=head2 notedate
|
|
|
|
data_type: 'datetime'
|
|
datetime_undef_if_invalid: 1
|
|
is_nullable: 1
|
|
|
|
=head2 noteseen
|
|
|
|
data_type: 'integer'
|
|
is_nullable: 1
|
|
|
|
=cut
|
|
|
|
__PACKAGE__->add_columns(
|
|
"issue_id",
|
|
{ data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
|
|
"borrowernumber",
|
|
{ data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
|
|
"itemnumber",
|
|
{ data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
|
|
"date_due",
|
|
{
|
|
data_type => "datetime",
|
|
datetime_undef_if_invalid => 1,
|
|
is_nullable => 1,
|
|
},
|
|
"branchcode",
|
|
{ data_type => "varchar", is_nullable => 1, size => 10 },
|
|
"returndate",
|
|
{
|
|
data_type => "datetime",
|
|
datetime_undef_if_invalid => 1,
|
|
is_nullable => 1,
|
|
},
|
|
"lastreneweddate",
|
|
{
|
|
data_type => "datetime",
|
|
datetime_undef_if_invalid => 1,
|
|
is_nullable => 1,
|
|
},
|
|
"renewals",
|
|
{ data_type => "tinyint", default_value => 0, is_nullable => 0 },
|
|
"auto_renew",
|
|
{ data_type => "tinyint", default_value => 0, is_nullable => 1 },
|
|
"auto_renew_error",
|
|
{ data_type => "varchar", is_nullable => 1, size => 32 },
|
|
"timestamp",
|
|
{
|
|
data_type => "timestamp",
|
|
datetime_undef_if_invalid => 1,
|
|
default_value => \"current_timestamp",
|
|
is_nullable => 0,
|
|
},
|
|
"issuedate",
|
|
{
|
|
data_type => "datetime",
|
|
datetime_undef_if_invalid => 1,
|
|
is_nullable => 1,
|
|
},
|
|
"onsite_checkout",
|
|
{ data_type => "integer", default_value => 0, is_nullable => 0 },
|
|
"note",
|
|
{ data_type => "longtext", is_nullable => 1 },
|
|
"notedate",
|
|
{
|
|
data_type => "datetime",
|
|
datetime_undef_if_invalid => 1,
|
|
is_nullable => 1,
|
|
},
|
|
"noteseen",
|
|
{ data_type => "integer", is_nullable => 1 },
|
|
);
|
|
|
|
=head1 PRIMARY KEY
|
|
|
|
=over 4
|
|
|
|
=item * L</issue_id>
|
|
|
|
=back
|
|
|
|
=cut
|
|
|
|
__PACKAGE__->set_primary_key("issue_id");
|
|
|
|
=head1 UNIQUE CONSTRAINTS
|
|
|
|
=head2 C<itemnumber>
|
|
|
|
=over 4
|
|
|
|
=item * L</itemnumber>
|
|
|
|
=back
|
|
|
|
=cut
|
|
|
|
__PACKAGE__->add_unique_constraint("itemnumber", ["itemnumber"]);
|
|
|
|
=head1 RELATIONS
|
|
|
|
=head2 borrowernumber
|
|
|
|
Type: belongs_to
|
|
|
|
Related object: L<Koha::Schema::Result::Borrower>
|
|
|
|
=cut
|
|
|
|
__PACKAGE__->belongs_to(
|
|
"borrowernumber",
|
|
"Koha::Schema::Result::Borrower",
|
|
{ borrowernumber => "borrowernumber" },
|
|
{
|
|
is_deferrable => 1,
|
|
join_type => "LEFT",
|
|
on_delete => "RESTRICT",
|
|
on_update => "CASCADE",
|
|
},
|
|
);
|
|
|
|
=head2 itemnumber
|
|
|
|
Type: belongs_to
|
|
|
|
Related object: L<Koha::Schema::Result::Item>
|
|
|
|
=cut
|
|
|
|
__PACKAGE__->belongs_to(
|
|
"itemnumber",
|
|
"Koha::Schema::Result::Item",
|
|
{ itemnumber => "itemnumber" },
|
|
{
|
|
is_deferrable => 1,
|
|
join_type => "LEFT",
|
|
on_delete => "RESTRICT",
|
|
on_update => "CASCADE",
|
|
},
|
|
);
|
|
|
|
=head2 return_claim
|
|
|
|
Type: might_have
|
|
|
|
Related object: L<Koha::Schema::Result::ReturnClaim>
|
|
|
|
=cut
|
|
|
|
__PACKAGE__->might_have(
|
|
"return_claim",
|
|
"Koha::Schema::Result::ReturnClaim",
|
|
{ "foreign.issue_id" => "self.issue_id" },
|
|
{ cascade_copy => 0, cascade_delete => 0 },
|
|
);
|
|
|
|
|
|
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-31 12:18:38
|
|
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QVmFa5b0Pe5OhUI92n9kzQ
|
|
|
|
__PACKAGE__->add_columns(
|
|
'+auto_renew' => { is_boolean => 1 },
|
|
'+onsite_checkout' => { is_boolean => 1 }
|
|
);
|
|
|
|
__PACKAGE__->belongs_to(
|
|
"borrower",
|
|
"Koha::Schema::Result::Borrower",
|
|
{ borrowernumber => "borrowernumber" },
|
|
{ join_type => "LEFT", on_delete => "CASCADE", on_update => "CASCADE" },
|
|
);
|
|
|
|
__PACKAGE__->belongs_to(
|
|
"item",
|
|
"Koha::Schema::Result::Item",
|
|
{ itemnumber => "itemnumber" },
|
|
{
|
|
is_deferrable => 1,
|
|
join_type => "LEFT",
|
|
on_delete => "CASCADE",
|
|
on_update => "CASCADE",
|
|
},
|
|
);
|
|
|
|
__PACKAGE__->belongs_to(
|
|
"branch",
|
|
"Koha::Schema::Result::Branch",
|
|
{ branchcode => "branchcode" },
|
|
{
|
|
is_deferrable => 1,
|
|
join_type => "LEFT",
|
|
on_delete => "CASCADE",
|
|
on_update => "CASCADE",
|
|
},
|
|
);
|
|
|
|
sub koha_object_class {
|
|
'Koha::Checkout';
|
|
}
|
|
sub koha_objects_class {
|
|
'Koha::Checkouts';
|
|
}
|
|
|
|
1;
|