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