Bug 23321: DBRev 19.06.00.029
[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 accounttype
67
68   data_type: 'varchar'
69   is_nullable: 1
70   size: 80
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 register_id
109
110   data_type: 'integer'
111   is_foreign_key: 1
112   is_nullable: 1
113
114 =head2 interface
115
116   data_type: 'varchar'
117   is_nullable: 0
118   size: 16
119
120 =head2 branchcode
121
122   data_type: 'varchar'
123   is_foreign_key: 1
124   is_nullable: 1
125   size: 10
126
127 =cut
128
129 __PACKAGE__->add_columns(
130   "accountlines_id",
131   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
132   "issue_id",
133   { data_type => "integer", is_nullable => 1 },
134   "borrowernumber",
135   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
136   "itemnumber",
137   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
138   "date",
139   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
140   "amount",
141   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
142   "description",
143   { data_type => "longtext", is_nullable => 1 },
144   "accounttype",
145   { data_type => "varchar", is_nullable => 1, size => 80 },
146   "status",
147   { data_type => "varchar", is_nullable => 1, size => 16 },
148   "payment_type",
149   { data_type => "varchar", is_nullable => 1, size => 80 },
150   "amountoutstanding",
151   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
152   "timestamp",
153   {
154     data_type => "timestamp",
155     datetime_undef_if_invalid => 1,
156     default_value => \"current_timestamp",
157     is_nullable => 0,
158   },
159   "note",
160   { data_type => "mediumtext", is_nullable => 1 },
161   "manager_id",
162   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
163   "register_id",
164   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
165   "interface",
166   { data_type => "varchar", is_nullable => 0, size => 16 },
167   "branchcode",
168   { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
169 );
170
171 =head1 PRIMARY KEY
172
173 =over 4
174
175 =item * L</accountlines_id>
176
177 =back
178
179 =cut
180
181 __PACKAGE__->set_primary_key("accountlines_id");
182
183 =head1 RELATIONS
184
185 =head2 account_offsets_credits
186
187 Type: has_many
188
189 Related object: L<Koha::Schema::Result::AccountOffset>
190
191 =cut
192
193 __PACKAGE__->has_many(
194   "account_offsets_credits",
195   "Koha::Schema::Result::AccountOffset",
196   { "foreign.credit_id" => "self.accountlines_id" },
197   { cascade_copy => 0, cascade_delete => 0 },
198 );
199
200 =head2 account_offsets_debits
201
202 Type: has_many
203
204 Related object: L<Koha::Schema::Result::AccountOffset>
205
206 =cut
207
208 __PACKAGE__->has_many(
209   "account_offsets_debits",
210   "Koha::Schema::Result::AccountOffset",
211   { "foreign.debit_id" => "self.accountlines_id" },
212   { cascade_copy => 0, cascade_delete => 0 },
213 );
214
215 =head2 borrowernumber
216
217 Type: belongs_to
218
219 Related object: L<Koha::Schema::Result::Borrower>
220
221 =cut
222
223 __PACKAGE__->belongs_to(
224   "borrowernumber",
225   "Koha::Schema::Result::Borrower",
226   { borrowernumber => "borrowernumber" },
227   {
228     is_deferrable => 1,
229     join_type     => "LEFT",
230     on_delete     => "SET NULL",
231     on_update     => "CASCADE",
232   },
233 );
234
235 =head2 branchcode
236
237 Type: belongs_to
238
239 Related object: L<Koha::Schema::Result::Branch>
240
241 =cut
242
243 __PACKAGE__->belongs_to(
244   "branchcode",
245   "Koha::Schema::Result::Branch",
246   { branchcode => "branchcode" },
247   {
248     is_deferrable => 1,
249     join_type     => "LEFT",
250     on_delete     => "SET NULL",
251     on_update     => "CASCADE",
252   },
253 );
254
255 =head2 itemnumber
256
257 Type: belongs_to
258
259 Related object: L<Koha::Schema::Result::Item>
260
261 =cut
262
263 __PACKAGE__->belongs_to(
264   "itemnumber",
265   "Koha::Schema::Result::Item",
266   { itemnumber => "itemnumber" },
267   {
268     is_deferrable => 1,
269     join_type     => "LEFT",
270     on_delete     => "SET NULL",
271     on_update     => "CASCADE",
272   },
273 );
274
275 =head2 manager
276
277 Type: belongs_to
278
279 Related object: L<Koha::Schema::Result::Borrower>
280
281 =cut
282
283 __PACKAGE__->belongs_to(
284   "manager",
285   "Koha::Schema::Result::Borrower",
286   { borrowernumber => "manager_id" },
287   {
288     is_deferrable => 1,
289     join_type     => "LEFT",
290     on_delete     => "SET NULL",
291     on_update     => "CASCADE",
292   },
293 );
294
295 =head2 register
296
297 Type: belongs_to
298
299 Related object: L<Koha::Schema::Result::CashRegister>
300
301 =cut
302
303 __PACKAGE__->belongs_to(
304   "register",
305   "Koha::Schema::Result::CashRegister",
306   { id => "register_id" },
307   {
308     is_deferrable => 1,
309     join_type     => "LEFT",
310     on_delete     => "SET NULL",
311     on_update     => "CASCADE",
312   },
313 );
314
315
316 # Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-09-23 10:45:21
317 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:L+QlTTT+MdGoA3shpyaBgQ
318
319 sub koha_objects_class {
320     'Koha::Account::Lines';
321 }
322 sub koha_object_class {
323     'Koha::Account::Line';
324 }
325
326 1;