Bug 23049: (follow-up) VARCHAR(80) + ac -> account
[koha.git] / Koha / Schema / Result / Accountline.pm
bloba30290dcabe57aceb600c4158638cb70ef948b70
1 use utf8;
2 package Koha::Schema::Result::Accountline;
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
7 =head1 NAME
9 Koha::Schema::Result::Accountline
11 =cut
13 use strict;
14 use warnings;
16 use base 'DBIx::Class::Core';
18 =head1 TABLE: C<accountlines>
20 =cut
22 __PACKAGE__->table("accountlines");
24 =head1 ACCESSORS
26 =head2 accountlines_id
28 data_type: 'integer'
29 is_auto_increment: 1
30 is_nullable: 0
32 =head2 issue_id
34 data_type: 'integer'
35 is_nullable: 1
37 =head2 borrowernumber
39 data_type: 'integer'
40 is_foreign_key: 1
41 is_nullable: 1
43 =head2 itemnumber
45 data_type: 'integer'
46 is_foreign_key: 1
47 is_nullable: 1
49 =head2 date
51 data_type: 'date'
52 datetime_undef_if_invalid: 1
53 is_nullable: 1
55 =head2 amount
57 data_type: 'decimal'
58 is_nullable: 1
59 size: [28,6]
61 =head2 description
63 data_type: 'longtext'
64 is_nullable: 1
66 =head2 accounttype
68 data_type: 'varchar'
69 is_nullable: 1
70 size: 80
72 =head2 debit_type_code
74 data_type: 'varchar'
75 is_foreign_key: 1
76 is_nullable: 1
77 size: 80
79 =head2 status
81 data_type: 'varchar'
82 is_nullable: 1
83 size: 16
85 =head2 payment_type
87 data_type: 'varchar'
88 is_nullable: 1
89 size: 80
91 =head2 amountoutstanding
93 data_type: 'decimal'
94 is_nullable: 1
95 size: [28,6]
97 =head2 timestamp
99 data_type: 'timestamp'
100 datetime_undef_if_invalid: 1
101 default_value: current_timestamp
102 is_nullable: 0
104 =head2 note
106 data_type: 'mediumtext'
107 is_nullable: 1
109 =head2 manager_id
111 data_type: 'integer'
112 is_foreign_key: 1
113 is_nullable: 1
115 =head2 register_id
117 data_type: 'integer'
118 is_foreign_key: 1
119 is_nullable: 1
121 =head2 interface
123 data_type: 'varchar'
124 is_nullable: 0
125 size: 16
127 =head2 branchcode
129 data_type: 'varchar'
130 is_foreign_key: 1
131 is_nullable: 1
132 size: 10
134 =cut
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 => 80 },
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",
163 data_type => "timestamp",
164 datetime_undef_if_invalid => 1,
165 default_value => \"current_timestamp",
166 is_nullable => 0,
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 },
180 =head1 PRIMARY KEY
182 =over 4
184 =item * L</accountlines_id>
186 =back
188 =cut
190 __PACKAGE__->set_primary_key("accountlines_id");
192 =head1 RELATIONS
194 =head2 account_offsets_credits
196 Type: has_many
198 Related object: L<Koha::Schema::Result::AccountOffset>
200 =cut
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 },
209 =head2 account_offsets_debits
211 Type: has_many
213 Related object: L<Koha::Schema::Result::AccountOffset>
215 =cut
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 },
224 =head2 borrowernumber
226 Type: belongs_to
228 Related object: L<Koha::Schema::Result::Borrower>
230 =cut
232 __PACKAGE__->belongs_to(
233 "borrowernumber",
234 "Koha::Schema::Result::Borrower",
235 { borrowernumber => "borrowernumber" },
237 is_deferrable => 1,
238 join_type => "LEFT",
239 on_delete => "SET NULL",
240 on_update => "CASCADE",
244 =head2 branchcode
246 Type: belongs_to
248 Related object: L<Koha::Schema::Result::Branch>
250 =cut
252 __PACKAGE__->belongs_to(
253 "branchcode",
254 "Koha::Schema::Result::Branch",
255 { branchcode => "branchcode" },
257 is_deferrable => 1,
258 join_type => "LEFT",
259 on_delete => "SET NULL",
260 on_update => "CASCADE",
264 =head2 debit_type_code
266 Type: belongs_to
268 Related object: L<Koha::Schema::Result::AccountDebitType>
270 =cut
272 __PACKAGE__->belongs_to(
273 "debit_type_code",
274 "Koha::Schema::Result::AccountDebitType",
275 { code => "debit_type_code" },
277 is_deferrable => 1,
278 join_type => "LEFT",
279 on_delete => "SET NULL",
280 on_update => "CASCADE",
284 =head2 itemnumber
286 Type: belongs_to
288 Related object: L<Koha::Schema::Result::Item>
290 =cut
292 __PACKAGE__->belongs_to(
293 "itemnumber",
294 "Koha::Schema::Result::Item",
295 { itemnumber => "itemnumber" },
297 is_deferrable => 1,
298 join_type => "LEFT",
299 on_delete => "SET NULL",
300 on_update => "CASCADE",
304 =head2 manager
306 Type: belongs_to
308 Related object: L<Koha::Schema::Result::Borrower>
310 =cut
312 __PACKAGE__->belongs_to(
313 "manager",
314 "Koha::Schema::Result::Borrower",
315 { borrowernumber => "manager_id" },
317 is_deferrable => 1,
318 join_type => "LEFT",
319 on_delete => "SET NULL",
320 on_update => "CASCADE",
324 =head2 register
326 Type: belongs_to
328 Related object: L<Koha::Schema::Result::CashRegister>
330 =cut
332 __PACKAGE__->belongs_to(
333 "register",
334 "Koha::Schema::Result::CashRegister",
335 { id => "register_id" },
337 is_deferrable => 1,
338 join_type => "LEFT",
339 on_delete => "SET NULL",
340 on_update => "CASCADE",
345 # Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-11 11:36:33
346 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WZ2Mcd5gwQc69yDSEsJHGA
348 sub koha_objects_class {
349 'Koha::Account::Lines';
351 sub koha_object_class {
352 'Koha::Account::Line';