Bug 22521: DBRev 18.12.00.055
[koha-equinox.git] / Koha / Schema / Result / Accountline.pm
1 use utf8;
2 package Koha::Schema::Result::Accountline;
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::Accountline
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<accountlines>
19
20 =cut
21
22 __PACKAGE__->table("accountlines");
23
24 =head1 ACCESSORS
25
26 =head2 accountlines_id
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 =head2 issue_id
33
34   data_type: 'integer'
35   is_nullable: 1
36
37 =head2 borrowernumber
38
39   data_type: 'integer'
40   is_foreign_key: 1
41   is_nullable: 1
42
43 =head2 itemnumber
44
45   data_type: 'integer'
46   is_foreign_key: 1
47   is_nullable: 1
48
49 =head2 date
50
51   data_type: 'date'
52   datetime_undef_if_invalid: 1
53   is_nullable: 1
54
55 =head2 amount
56
57   data_type: 'decimal'
58   is_nullable: 1
59   size: [28,6]
60
61 =head2 description
62
63   data_type: 'longtext'
64   is_nullable: 1
65
66 =head2 accounttype
67
68   data_type: 'varchar'
69   is_nullable: 1
70   size: 16
71
72 =head2 status
73
74   data_type: 'varchar'
75   is_nullable: 1
76   size: 16
77
78 =head2 payment_type
79
80   data_type: 'varchar'
81   is_nullable: 1
82   size: 80
83
84 =head2 amountoutstanding
85
86   data_type: 'decimal'
87   is_nullable: 1
88   size: [28,6]
89
90 =head2 timestamp
91
92   data_type: 'timestamp'
93   datetime_undef_if_invalid: 1
94   default_value: current_timestamp
95   is_nullable: 0
96
97 =head2 note
98
99   data_type: 'mediumtext'
100   is_nullable: 1
101
102 =head2 manager_id
103
104   data_type: 'integer'
105   is_foreign_key: 1
106   is_nullable: 1
107
108 =head2 interface
109
110   data_type: 'varchar'
111   is_nullable: 0
112   size: 16
113
114 =head2 branchcode
115
116   data_type: 'varchar'
117   is_foreign_key: 1
118   is_nullable: 1
119   size: 10
120
121 =cut
122
123 __PACKAGE__->add_columns(
124   "accountlines_id",
125   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
126   "issue_id",
127   { data_type => "integer", is_nullable => 1 },
128   "borrowernumber",
129   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
130   "itemnumber",
131   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
132   "date",
133   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
134   "amount",
135   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
136   "description",
137   { data_type => "longtext", is_nullable => 1 },
138   "accounttype",
139   { data_type => "varchar", is_nullable => 1, size => 16 },
140   "status",
141   { data_type => "varchar", is_nullable => 1, size => 16 },
142   "payment_type",
143   { data_type => "varchar", is_nullable => 1, size => 80 },
144   "amountoutstanding",
145   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
146   "timestamp",
147   {
148     data_type => "timestamp",
149     datetime_undef_if_invalid => 1,
150     default_value => \"current_timestamp",
151     is_nullable => 0,
152   },
153   "note",
154   { data_type => "mediumtext", is_nullable => 1 },
155   "manager_id",
156   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
157   "interface",
158   { data_type => "varchar", is_nullable => 0, size => 16 },
159   "branchcode",
160   { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
161 );
162
163 =head1 PRIMARY KEY
164
165 =over 4
166
167 =item * L</accountlines_id>
168
169 =back
170
171 =cut
172
173 __PACKAGE__->set_primary_key("accountlines_id");
174
175 =head1 RELATIONS
176
177 =head2 account_offsets_credits
178
179 Type: has_many
180
181 Related object: L<Koha::Schema::Result::AccountOffset>
182
183 =cut
184
185 __PACKAGE__->has_many(
186   "account_offsets_credits",
187   "Koha::Schema::Result::AccountOffset",
188   { "foreign.credit_id" => "self.accountlines_id" },
189   { cascade_copy => 0, cascade_delete => 0 },
190 );
191
192 =head2 account_offsets_debits
193
194 Type: has_many
195
196 Related object: L<Koha::Schema::Result::AccountOffset>
197
198 =cut
199
200 __PACKAGE__->has_many(
201   "account_offsets_debits",
202   "Koha::Schema::Result::AccountOffset",
203   { "foreign.debit_id" => "self.accountlines_id" },
204   { cascade_copy => 0, cascade_delete => 0 },
205 );
206
207 =head2 borrowernumber
208
209 Type: belongs_to
210
211 Related object: L<Koha::Schema::Result::Borrower>
212
213 =cut
214
215 __PACKAGE__->belongs_to(
216   "borrowernumber",
217   "Koha::Schema::Result::Borrower",
218   { borrowernumber => "borrowernumber" },
219   {
220     is_deferrable => 1,
221     join_type     => "LEFT",
222     on_delete     => "SET NULL",
223     on_update     => "CASCADE",
224   },
225 );
226
227 =head2 branchcode
228
229 Type: belongs_to
230
231 Related object: L<Koha::Schema::Result::Branch>
232
233 =cut
234
235 __PACKAGE__->belongs_to(
236   "branchcode",
237   "Koha::Schema::Result::Branch",
238   { branchcode => "branchcode" },
239   {
240     is_deferrable => 1,
241     join_type     => "LEFT",
242     on_delete     => "SET NULL",
243     on_update     => "CASCADE",
244   },
245 );
246
247 =head2 itemnumber
248
249 Type: belongs_to
250
251 Related object: L<Koha::Schema::Result::Item>
252
253 =cut
254
255 __PACKAGE__->belongs_to(
256   "itemnumber",
257   "Koha::Schema::Result::Item",
258   { itemnumber => "itemnumber" },
259   {
260     is_deferrable => 1,
261     join_type     => "LEFT",
262     on_delete     => "SET NULL",
263     on_update     => "CASCADE",
264   },
265 );
266
267 =head2 manager
268
269 Type: belongs_to
270
271 Related object: L<Koha::Schema::Result::Borrower>
272
273 =cut
274
275 __PACKAGE__->belongs_to(
276   "manager",
277   "Koha::Schema::Result::Borrower",
278   { borrowernumber => "manager_id" },
279   {
280     is_deferrable => 1,
281     join_type     => "LEFT",
282     on_delete     => "SET NULL",
283     on_update     => "CASCADE",
284   },
285 );
286
287
288 # Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-04-17 17:00:42
289 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2NOxgVuaRQ+6oTqgYDqzBg
290
291 sub koha_objects_class {
292     'Koha::Account::Lines';
293 }
294 sub koha_object_class {
295     'Koha::Account::Line';
296 }
297
298 1;