Bug 23321: DBIC Classes

Sponsored-by: PTFS Europe
Sponsored-by: Cheshire Libraries Shared Services

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Martin Renvoize 2019-07-16 17:11:26 +01:00
parent 98e4b5c04a
commit ac89be111a
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
3 changed files with 198 additions and 2 deletions

View File

@ -105,6 +105,12 @@ __PACKAGE__->table("accountlines");
is_foreign_key: 1
is_nullable: 1
=head2 register_id
data_type: 'integer'
is_foreign_key: 1
is_nullable: 1
=head2 interface
data_type: 'varchar'
@ -154,6 +160,8 @@ __PACKAGE__->add_columns(
{ data_type => "mediumtext", is_nullable => 1 },
"manager_id",
{ data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
"register_id",
{ data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
"interface",
{ data_type => "varchar", is_nullable => 0, size => 16 },
"branchcode",
@ -284,6 +292,26 @@ __PACKAGE__->belongs_to(
},
);
=head2 register
Type: belongs_to
Related object: L<Koha::Schema::Result::CashRegister>
=cut
__PACKAGE__->belongs_to(
"register",
"Koha::Schema::Result::CashRegister",
{ id => "register_id" },
{
is_deferrable => 1,
join_type => "LEFT",
on_delete => "SET NULL",
on_update => "CASCADE",
},
);
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-09-06 12:23:55
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:/8Qeh530PbLC6ryxC1Dw9w

View File

@ -346,6 +346,21 @@ __PACKAGE__->has_many(
{ cascade_copy => 0, cascade_delete => 0 },
);
=head2 cash_registers
Type: has_many
Related object: L<Koha::Schema::Result::CashRegister>
=cut
__PACKAGE__->has_many(
"cash_registers",
"Koha::Schema::Result::CashRegister",
{ "foreign.branch" => "self.branchcode" },
{ cascade_copy => 0, cascade_delete => 0 },
);
=head2 categories_branches
Type: has_many
@ -662,8 +677,8 @@ __PACKAGE__->has_many(
);
# Created by DBIx::Class::Schema::Loader v0.07048 @ 2019-07-04 04:56:47
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:15/s0/8d2cNB9YLLlsEY4w
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-07-17 07:15:23
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:qGiu+y4MHq5CvBQTj0m8QQ
__PACKAGE__->add_columns(
'+pickup_location' => { is_boolean => 1 }

View File

@ -0,0 +1,153 @@
use utf8;
package Koha::Schema::Result::CashRegister;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
=head1 NAME
Koha::Schema::Result::CashRegister
=cut
use strict;
use warnings;
use base 'DBIx::Class::Core';
=head1 TABLE: C<cash_registers>
=cut
__PACKAGE__->table("cash_registers");
=head1 ACCESSORS
=head2 id
data_type: 'integer'
is_auto_increment: 1
is_nullable: 0
=head2 name
data_type: 'varchar'
is_nullable: 0
size: 24
=head2 description
data_type: 'longtext'
is_nullable: 0
=head2 branch
data_type: 'varchar'
is_foreign_key: 1
is_nullable: 0
size: 10
=head2 branch_default
data_type: 'tinyint'
default_value: 0
is_nullable: 0
=head2 starting_float
data_type: 'decimal'
is_nullable: 1
size: [28,6]
=head2 archived
data_type: 'tinyint'
default_value: 0
is_nullable: 0
=cut
__PACKAGE__->add_columns(
"id",
{ data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
"name",
{ data_type => "varchar", is_nullable => 0, size => 24 },
"description",
{ data_type => "longtext", is_nullable => 0 },
"branch",
{ data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 },
"branch_default",
{ data_type => "tinyint", default_value => 0, is_nullable => 0 },
"starting_float",
{ data_type => "decimal", is_nullable => 1, size => [28, 6] },
"archived",
{ data_type => "tinyint", default_value => 0, is_nullable => 0 },
);
=head1 PRIMARY KEY
=over 4
=item * L</id>
=back
=cut
__PACKAGE__->set_primary_key("id");
=head1 UNIQUE CONSTRAINTS
=head2 C<name>
=over 4
=item * L</name>
=item * L</branch>
=back
=cut
__PACKAGE__->add_unique_constraint("name", ["name", "branch"]);
=head1 RELATIONS
=head2 accountlines
Type: has_many
Related object: L<Koha::Schema::Result::Accountline>
=cut
__PACKAGE__->has_many(
"accountlines",
"Koha::Schema::Result::Accountline",
{ "foreign.register_id" => "self.id" },
{ cascade_copy => 0, cascade_delete => 0 },
);
=head2 branch
Type: belongs_to
Related object: L<Koha::Schema::Result::Branch>
=cut
__PACKAGE__->belongs_to(
"branch",
"Koha::Schema::Result::Branch",
{ branchcode => "branch" },
{ is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
);
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-07-23 13:14:31
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:TfGf0U/vWS7IviRlvDdE1w
# You can replace this text with custom code or comments, and it will be preserved on regeneration
1;