Bug 8976: DBIC schema changes
[koha.git] / Koha / Schema / Result / AccountCreditType.pm
1 use utf8;
2 package Koha::Schema::Result::AccountCreditType;
3
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
6
7 =head1 NAME
8
9 Koha::Schema::Result::AccountCreditType
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<account_credit_types>
19
20 =cut
21
22 __PACKAGE__->table("account_credit_types");
23
24 =head1 ACCESSORS
25
26 =head2 code
27
28   data_type: 'varchar'
29   is_nullable: 0
30   size: 80
31
32 =head2 description
33
34   data_type: 'varchar'
35   is_nullable: 1
36   size: 200
37
38 =head2 can_be_added_manually
39
40   data_type: 'tinyint'
41   default_value: 1
42   is_nullable: 0
43
44 =head2 credit_number_enabled
45
46   data_type: 'tinyint'
47   default_value: 0
48   is_nullable: 0
49
50 Is autogeneration of credit number enabled for this credit type
51
52 =head2 is_system
53
54   data_type: 'tinyint'
55   default_value: 0
56   is_nullable: 0
57
58 =head2 archived
59
60   data_type: 'tinyint'
61   default_value: 0
62   is_nullable: 0
63
64 boolean flag to denote if this till is archived or not
65
66 =cut
67
68 __PACKAGE__->add_columns(
69   "code",
70   { data_type => "varchar", is_nullable => 0, size => 80 },
71   "description",
72   { data_type => "varchar", is_nullable => 1, size => 200 },
73   "can_be_added_manually",
74   { data_type => "tinyint", default_value => 1, is_nullable => 0 },
75   "credit_number_enabled",
76   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
77   "is_system",
78   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
79   "archived",
80   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
81 );
82
83 =head1 PRIMARY KEY
84
85 =over 4
86
87 =item * L</code>
88
89 =back
90
91 =cut
92
93 __PACKAGE__->set_primary_key("code");
94
95 =head1 RELATIONS
96
97 =head2 account_credit_types_branches
98
99 Type: has_many
100
101 Related object: L<Koha::Schema::Result::AccountCreditTypesBranch>
102
103 =cut
104
105 __PACKAGE__->has_many(
106   "account_credit_types_branches",
107   "Koha::Schema::Result::AccountCreditTypesBranch",
108   { "foreign.credit_type_code" => "self.code" },
109   { cascade_copy => 0, cascade_delete => 0 },
110 );
111
112 =head2 accountlines
113
114 Type: has_many
115
116 Related object: L<Koha::Schema::Result::Accountline>
117
118 =cut
119
120 __PACKAGE__->has_many(
121   "accountlines",
122   "Koha::Schema::Result::Accountline",
123   { "foreign.credit_type_code" => "self.code" },
124   { cascade_copy => 0, cascade_delete => 0 },
125 );
126
127
128 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29
129 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:pqgg1XzDq/zm/epjihLT8Q
130
131 __PACKAGE__->add_columns(
132     '+is_system'             => { is_boolean => 1 },
133     '+credit_number_enabled' => { is_boolean => 1 },
134     '+archived'              => { is_boolean => 1 }
135 );
136
137 sub koha_objects_class {
138     'Koha::Account::CreditTypes';
139 }
140 sub koha_object_class {
141     'Koha::Account::CreditType';
142 }
143
144 1;