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