Bug 22417: Remove record_type from BatchUpdate*
[koha.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: 'timestamp'
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 credit_type_code
67
68   data_type: 'varchar'
69   is_foreign_key: 1
70   is_nullable: 1
71   size: 80
72
73 =head2 debit_type_code
74
75   data_type: 'varchar'
76   is_foreign_key: 1
77   is_nullable: 1
78   size: 80
79
80 =head2 credit_number
81
82   data_type: 'varchar'
83   is_nullable: 1
84   size: 20
85
86 autogenerated number for credits
87
88 =head2 status
89
90   data_type: 'varchar'
91   is_nullable: 1
92   size: 16
93
94 =head2 payment_type
95
96   data_type: 'varchar'
97   is_nullable: 1
98   size: 80
99
100 =head2 amountoutstanding
101
102   data_type: 'decimal'
103   is_nullable: 1
104   size: [28,6]
105
106 =head2 timestamp
107
108   data_type: 'timestamp'
109   datetime_undef_if_invalid: 1
110   default_value: current_timestamp
111   is_nullable: 0
112
113 =head2 note
114
115   data_type: 'mediumtext'
116   is_nullable: 1
117
118 =head2 manager_id
119
120   data_type: 'integer'
121   is_foreign_key: 1
122   is_nullable: 1
123
124 =head2 register_id
125
126   data_type: 'integer'
127   is_foreign_key: 1
128   is_nullable: 1
129
130 =head2 interface
131
132   data_type: 'varchar'
133   is_nullable: 0
134   size: 16
135
136 =head2 branchcode
137
138   data_type: 'varchar'
139   is_foreign_key: 1
140   is_nullable: 1
141   size: 10
142
143 =cut
144
145 __PACKAGE__->add_columns(
146   "accountlines_id",
147   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
148   "issue_id",
149   { data_type => "integer", is_nullable => 1 },
150   "borrowernumber",
151   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
152   "itemnumber",
153   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
154   "date",
155   {
156     data_type => "timestamp",
157     datetime_undef_if_invalid => 1,
158     is_nullable => 1,
159   },
160   "amount",
161   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
162   "description",
163   { data_type => "longtext", is_nullable => 1 },
164   "credit_type_code",
165   { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 80 },
166   "debit_type_code",
167   { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 80 },
168   "credit_number",
169   { data_type => "varchar", is_nullable => 1, size => 20 },
170   "status",
171   { data_type => "varchar", is_nullable => 1, size => 16 },
172   "payment_type",
173   { data_type => "varchar", is_nullable => 1, size => 80 },
174   "amountoutstanding",
175   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
176   "timestamp",
177   {
178     data_type => "timestamp",
179     datetime_undef_if_invalid => 1,
180     default_value => \"current_timestamp",
181     is_nullable => 0,
182   },
183   "note",
184   { data_type => "mediumtext", is_nullable => 1 },
185   "manager_id",
186   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
187   "register_id",
188   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
189   "interface",
190   { data_type => "varchar", is_nullable => 0, size => 16 },
191   "branchcode",
192   { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
193 );
194
195 =head1 PRIMARY KEY
196
197 =over 4
198
199 =item * L</accountlines_id>
200
201 =back
202
203 =cut
204
205 __PACKAGE__->set_primary_key("accountlines_id");
206
207 =head1 RELATIONS
208
209 =head2 account_offsets_credits
210
211 Type: has_many
212
213 Related object: L<Koha::Schema::Result::AccountOffset>
214
215 =cut
216
217 __PACKAGE__->has_many(
218   "account_offsets_credits",
219   "Koha::Schema::Result::AccountOffset",
220   { "foreign.credit_id" => "self.accountlines_id" },
221   { cascade_copy => 0, cascade_delete => 0 },
222 );
223
224 =head2 account_offsets_debits
225
226 Type: has_many
227
228 Related object: L<Koha::Schema::Result::AccountOffset>
229
230 =cut
231
232 __PACKAGE__->has_many(
233   "account_offsets_debits",
234   "Koha::Schema::Result::AccountOffset",
235   { "foreign.debit_id" => "self.accountlines_id" },
236   { cascade_copy => 0, cascade_delete => 0 },
237 );
238
239 =head2 borrowernumber
240
241 Type: belongs_to
242
243 Related object: L<Koha::Schema::Result::Borrower>
244
245 =cut
246
247 __PACKAGE__->belongs_to(
248   "borrowernumber",
249   "Koha::Schema::Result::Borrower",
250   { borrowernumber => "borrowernumber" },
251   {
252     is_deferrable => 1,
253     join_type     => "LEFT",
254     on_delete     => "SET NULL",
255     on_update     => "CASCADE",
256   },
257 );
258
259 =head2 branchcode
260
261 Type: belongs_to
262
263 Related object: L<Koha::Schema::Result::Branch>
264
265 =cut
266
267 __PACKAGE__->belongs_to(
268   "branchcode",
269   "Koha::Schema::Result::Branch",
270   { branchcode => "branchcode" },
271   {
272     is_deferrable => 1,
273     join_type     => "LEFT",
274     on_delete     => "SET NULL",
275     on_update     => "CASCADE",
276   },
277 );
278
279 =head2 credit_type_code
280
281 Type: belongs_to
282
283 Related object: L<Koha::Schema::Result::AccountCreditType>
284
285 =cut
286
287 __PACKAGE__->belongs_to(
288   "credit_type_code",
289   "Koha::Schema::Result::AccountCreditType",
290   { code => "credit_type_code" },
291   {
292     is_deferrable => 1,
293     join_type     => "LEFT",
294     on_delete     => "RESTRICT",
295     on_update     => "CASCADE",
296   },
297 );
298
299 =head2 debit_type_code
300
301 Type: belongs_to
302
303 Related object: L<Koha::Schema::Result::AccountDebitType>
304
305 =cut
306
307 __PACKAGE__->belongs_to(
308   "debit_type_code",
309   "Koha::Schema::Result::AccountDebitType",
310   { code => "debit_type_code" },
311   {
312     is_deferrable => 1,
313     join_type     => "LEFT",
314     on_delete     => "RESTRICT",
315     on_update     => "CASCADE",
316   },
317 );
318
319 =head2 itemnumber
320
321 Type: belongs_to
322
323 Related object: L<Koha::Schema::Result::Item>
324
325 =cut
326
327 __PACKAGE__->belongs_to(
328   "itemnumber",
329   "Koha::Schema::Result::Item",
330   { itemnumber => "itemnumber" },
331   {
332     is_deferrable => 1,
333     join_type     => "LEFT",
334     on_delete     => "SET NULL",
335     on_update     => "CASCADE",
336   },
337 );
338
339 =head2 manager
340
341 Type: belongs_to
342
343 Related object: L<Koha::Schema::Result::Borrower>
344
345 =cut
346
347 __PACKAGE__->belongs_to(
348   "manager",
349   "Koha::Schema::Result::Borrower",
350   { borrowernumber => "manager_id" },
351   {
352     is_deferrable => 1,
353     join_type     => "LEFT",
354     on_delete     => "SET NULL",
355     on_update     => "CASCADE",
356   },
357 );
358
359 =head2 register
360
361 Type: belongs_to
362
363 Related object: L<Koha::Schema::Result::CashRegister>
364
365 =cut
366
367 __PACKAGE__->belongs_to(
368   "register",
369   "Koha::Schema::Result::CashRegister",
370   { id => "register_id" },
371   {
372     is_deferrable => 1,
373     join_type     => "LEFT",
374     on_delete     => "SET NULL",
375     on_update     => "CASCADE",
376   },
377 );
378
379
380 # Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-06-25 09:19:20
381 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:I/S3NLbod+8BgBMcwYz+cA
382
383 =head2 library
384
385 Type: belongs_to
386
387 Related object: L<Koha::Schema::Result::Branch>
388
389 =cut
390
391 __PACKAGE__->belongs_to(
392   "library",
393   "Koha::Schema::Result::Branch",
394   { branchcode => "branchcode" },
395   {
396     is_deferrable => 1,
397     join_type     => "LEFT",
398     on_delete     => "SET NULL",
399     on_update     => "CASCADE",
400   },
401 );
402
403 sub koha_objects_class {
404     'Koha::Account::Lines';
405 }
406 sub koha_object_class {
407     'Koha::Account::Line';
408 }
409
410 1;