Bug 32257: Label for patron attributes misaligned
[koha-ffzg.git] / Koha / Schema / Result / CashRegister.pm
1 use utf8;
2 package Koha::Schema::Result::CashRegister;
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::CashRegister
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<cash_registers>
19
20 =cut
21
22 __PACKAGE__->table("cash_registers");
23
24 =head1 ACCESSORS
25
26 =head2 id
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 unique identifier for each account register
33
34 =head2 name
35
36   data_type: 'varchar'
37   is_nullable: 0
38   size: 24
39
40 the user friendly identifier for each account register
41
42 =head2 description
43
44   data_type: 'longtext'
45   is_nullable: 0
46
47 the user friendly description for each account register
48
49 =head2 branch
50
51   data_type: 'varchar'
52   is_foreign_key: 1
53   is_nullable: 0
54   size: 10
55
56 the foreign key the library this account register belongs
57
58 =head2 branch_default
59
60   data_type: 'tinyint'
61   default_value: 0
62   is_nullable: 0
63
64 boolean flag to denote that this till is the branch default
65
66 =head2 starting_float
67
68   data_type: 'decimal'
69   is_nullable: 1
70   size: [28,6]
71
72 the starting float this account register should be assigned
73
74 =head2 archived
75
76   data_type: 'tinyint'
77   default_value: 0
78   is_nullable: 0
79
80 boolean flag to denote if this till is archived or not
81
82 =cut
83
84 __PACKAGE__->add_columns(
85   "id",
86   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
87   "name",
88   { data_type => "varchar", is_nullable => 0, size => 24 },
89   "description",
90   { data_type => "longtext", is_nullable => 0 },
91   "branch",
92   { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 },
93   "branch_default",
94   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
95   "starting_float",
96   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
97   "archived",
98   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
99 );
100
101 =head1 PRIMARY KEY
102
103 =over 4
104
105 =item * L</id>
106
107 =back
108
109 =cut
110
111 __PACKAGE__->set_primary_key("id");
112
113 =head1 UNIQUE CONSTRAINTS
114
115 =head2 C<name>
116
117 =over 4
118
119 =item * L</name>
120
121 =item * L</branch>
122
123 =back
124
125 =cut
126
127 __PACKAGE__->add_unique_constraint("name", ["name", "branch"]);
128
129 =head1 RELATIONS
130
131 =head2 accountlines
132
133 Type: has_many
134
135 Related object: L<Koha::Schema::Result::Accountline>
136
137 =cut
138
139 __PACKAGE__->has_many(
140   "accountlines",
141   "Koha::Schema::Result::Accountline",
142   { "foreign.register_id" => "self.id" },
143   { cascade_copy => 0, cascade_delete => 0 },
144 );
145
146 =head2 branch
147
148 Type: belongs_to
149
150 Related object: L<Koha::Schema::Result::Branch>
151
152 =cut
153
154 __PACKAGE__->belongs_to(
155   "branch",
156   "Koha::Schema::Result::Branch",
157   { branchcode => "branch" },
158   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
159 );
160
161 =head2 cash_register_actions
162
163 Type: has_many
164
165 Related object: L<Koha::Schema::Result::CashRegisterAction>
166
167 =cut
168
169 __PACKAGE__->has_many(
170   "cash_register_actions",
171   "Koha::Schema::Result::CashRegisterAction",
172   { "foreign.register_id" => "self.id" },
173   { cascade_copy => 0, cascade_delete => 0 },
174 );
175
176
177 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29
178 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:NNSzc20vEH34dmEsTb5K0Q
179
180 __PACKAGE__->add_columns(
181     '+archived'       => { is_boolean => 1 },
182     '+branch_default' => { is_boolean => 1 },
183 );
184
185 sub koha_objects_class {
186     'Koha::Cash::Registers';
187 }
188
189 sub koha_object_class {
190     'Koha::Cash::Register';
191 }
192
193 # You can replace this text with custom code or comments, and it will be preserved on regeneration
194 1;