2b14943d3452f10137f80798fd6ffdca557203f2
[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: '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 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   {
148     data_type => "timestamp",
149     datetime_undef_if_invalid => 1,
150     is_nullable => 1,
151   },
152   "amount",
153   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
154   "description",
155   { data_type => "longtext", is_nullable => 1 },
156   "credit_type_code",
157   { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 80 },
158   "debit_type_code",
159   { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 80 },
160   "status",
161   { data_type => "varchar", is_nullable => 1, size => 16 },
162   "payment_type",
163   { data_type => "varchar", is_nullable => 1, size => 80 },
164   "amountoutstanding",
165   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
166   "timestamp",
167   {
168     data_type => "timestamp",
169     datetime_undef_if_invalid => 1,
170     default_value => \"current_timestamp",
171     is_nullable => 0,
172   },
173   "note",
174   { data_type => "mediumtext", is_nullable => 1 },
175   "manager_id",
176   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
177   "register_id",
178   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
179   "interface",
180   { data_type => "varchar", is_nullable => 0, size => 16 },
181   "branchcode",
182   { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
183 );
184
185 =head1 PRIMARY KEY
186
187 =over 4
188
189 =item * L</accountlines_id>
190
191 =back
192
193 =cut
194
195 __PACKAGE__->set_primary_key("accountlines_id");
196
197 =head1 RELATIONS
198
199 =head2 account_offsets_credits
200
201 Type: has_many
202
203 Related object: L<Koha::Schema::Result::AccountOffset>
204
205 =cut
206
207 __PACKAGE__->has_many(
208   "account_offsets_credits",
209   "Koha::Schema::Result::AccountOffset",
210   { "foreign.credit_id" => "self.accountlines_id" },
211   { cascade_copy => 0, cascade_delete => 0 },
212 );
213
214 =head2 account_offsets_debits
215
216 Type: has_many
217
218 Related object: L<Koha::Schema::Result::AccountOffset>
219
220 =cut
221
222 __PACKAGE__->has_many(
223   "account_offsets_debits",
224   "Koha::Schema::Result::AccountOffset",
225   { "foreign.debit_id" => "self.accountlines_id" },
226   { cascade_copy => 0, cascade_delete => 0 },
227 );
228
229 =head2 borrowernumber
230
231 Type: belongs_to
232
233 Related object: L<Koha::Schema::Result::Borrower>
234
235 =cut
236
237 __PACKAGE__->belongs_to(
238   "borrowernumber",
239   "Koha::Schema::Result::Borrower",
240   { borrowernumber => "borrowernumber" },
241   {
242     is_deferrable => 1,
243     join_type     => "LEFT",
244     on_delete     => "SET NULL",
245     on_update     => "CASCADE",
246   },
247 );
248
249 =head2 branchcode
250
251 Type: belongs_to
252
253 Related object: L<Koha::Schema::Result::Branch>
254
255 =cut
256
257 __PACKAGE__->belongs_to(
258   "branchcode",
259   "Koha::Schema::Result::Branch",
260   { branchcode => "branchcode" },
261   {
262     is_deferrable => 1,
263     join_type     => "LEFT",
264     on_delete     => "SET NULL",
265     on_update     => "CASCADE",
266   },
267 );
268
269 =head2 credit_type_code
270
271 Type: belongs_to
272
273 Related object: L<Koha::Schema::Result::AccountCreditType>
274
275 =cut
276
277 __PACKAGE__->belongs_to(
278   "credit_type_code",
279   "Koha::Schema::Result::AccountCreditType",
280   { code => "credit_type_code" },
281   {
282     is_deferrable => 1,
283     join_type     => "LEFT",
284     on_delete     => "RESTRICT",
285     on_update     => "CASCADE",
286   },
287 );
288
289 =head2 debit_type_code
290
291 Type: belongs_to
292
293 Related object: L<Koha::Schema::Result::AccountDebitType>
294
295 =cut
296
297 __PACKAGE__->belongs_to(
298   "debit_type_code",
299   "Koha::Schema::Result::AccountDebitType",
300   { code => "debit_type_code" },
301   {
302     is_deferrable => 1,
303     join_type     => "LEFT",
304     on_delete     => "RESTRICT",
305     on_update     => "CASCADE",
306   },
307 );
308
309 =head2 itemnumber
310
311 Type: belongs_to
312
313 Related object: L<Koha::Schema::Result::Item>
314
315 =cut
316
317 __PACKAGE__->belongs_to(
318   "itemnumber",
319   "Koha::Schema::Result::Item",
320   { itemnumber => "itemnumber" },
321   {
322     is_deferrable => 1,
323     join_type     => "LEFT",
324     on_delete     => "SET NULL",
325     on_update     => "CASCADE",
326   },
327 );
328
329 =head2 manager
330
331 Type: belongs_to
332
333 Related object: L<Koha::Schema::Result::Borrower>
334
335 =cut
336
337 __PACKAGE__->belongs_to(
338   "manager",
339   "Koha::Schema::Result::Borrower",
340   { borrowernumber => "manager_id" },
341   {
342     is_deferrable => 1,
343     join_type     => "LEFT",
344     on_delete     => "SET NULL",
345     on_update     => "CASCADE",
346   },
347 );
348
349 =head2 register
350
351 Type: belongs_to
352
353 Related object: L<Koha::Schema::Result::CashRegister>
354
355 =cut
356
357 __PACKAGE__->belongs_to(
358   "register",
359   "Koha::Schema::Result::CashRegister",
360   { id => "register_id" },
361   {
362     is_deferrable => 1,
363     join_type     => "LEFT",
364     on_delete     => "SET NULL",
365     on_update     => "CASCADE",
366   },
367 );
368
369
370 # Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-03-19 09:20:20
371 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:BuE4CYsSH4BwXZoQKE2MWw
372
373 =head2 library
374
375 Type: belongs_to
376
377 Related object: L<Koha::Schema::Result::Branch>
378
379 =cut
380
381 __PACKAGE__->belongs_to(
382   "library",
383   "Koha::Schema::Result::Branch",
384   { branchcode => "branchcode" },
385   {
386     is_deferrable => 1,
387     join_type     => "LEFT",
388     on_delete     => "SET NULL",
389     on_update     => "CASCADE",
390   },
391 );
392
393 sub koha_objects_class {
394     'Koha::Account::Lines';
395 }
396 sub koha_object_class {
397     'Koha::Account::Line';
398 }
399
400 1;