Bug 22008: DBRev 18.12.00.031
[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: 5
71
72 =head2 payment_type
73
74   data_type: 'varchar'
75   is_nullable: 1
76   size: 80
77
78 =head2 amountoutstanding
79
80   data_type: 'decimal'
81   is_nullable: 1
82   size: [28,6]
83
84 =head2 lastincrement
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 branchcode
109
110   data_type: 'varchar'
111   is_foreign_key: 1
112   is_nullable: 1
113   size: 10
114
115 =cut
116
117 __PACKAGE__->add_columns(
118   "accountlines_id",
119   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
120   "issue_id",
121   { data_type => "integer", is_nullable => 1 },
122   "borrowernumber",
123   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
124   "itemnumber",
125   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
126   "date",
127   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
128   "amount",
129   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
130   "description",
131   { data_type => "longtext", is_nullable => 1 },
132   "accounttype",
133   { data_type => "varchar", is_nullable => 1, size => 5 },
134   "payment_type",
135   { data_type => "varchar", is_nullable => 1, size => 80 },
136   "amountoutstanding",
137   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
138   "lastincrement",
139   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
140   "timestamp",
141   {
142     data_type => "timestamp",
143     datetime_undef_if_invalid => 1,
144     default_value => \"current_timestamp",
145     is_nullable => 0,
146   },
147   "note",
148   { data_type => "mediumtext", is_nullable => 1 },
149   "manager_id",
150   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
151   "branchcode",
152   { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
153 );
154
155 =head1 PRIMARY KEY
156
157 =over 4
158
159 =item * L</accountlines_id>
160
161 =back
162
163 =cut
164
165 __PACKAGE__->set_primary_key("accountlines_id");
166
167 =head1 RELATIONS
168
169 =head2 account_offsets_credits
170
171 Type: has_many
172
173 Related object: L<Koha::Schema::Result::AccountOffset>
174
175 =cut
176
177 __PACKAGE__->has_many(
178   "account_offsets_credits",
179   "Koha::Schema::Result::AccountOffset",
180   { "foreign.credit_id" => "self.accountlines_id" },
181   { cascade_copy => 0, cascade_delete => 0 },
182 );
183
184 =head2 account_offsets_debits
185
186 Type: has_many
187
188 Related object: L<Koha::Schema::Result::AccountOffset>
189
190 =cut
191
192 __PACKAGE__->has_many(
193   "account_offsets_debits",
194   "Koha::Schema::Result::AccountOffset",
195   { "foreign.debit_id" => "self.accountlines_id" },
196   { cascade_copy => 0, cascade_delete => 0 },
197 );
198
199 =head2 borrowernumber
200
201 Type: belongs_to
202
203 Related object: L<Koha::Schema::Result::Borrower>
204
205 =cut
206
207 __PACKAGE__->belongs_to(
208   "borrowernumber",
209   "Koha::Schema::Result::Borrower",
210   { borrowernumber => "borrowernumber" },
211   {
212     is_deferrable => 1,
213     join_type     => "LEFT",
214     on_delete     => "SET NULL",
215     on_update     => "CASCADE",
216   },
217 );
218
219 =head2 branchcode
220
221 Type: belongs_to
222
223 Related object: L<Koha::Schema::Result::Branch>
224
225 =cut
226
227 __PACKAGE__->belongs_to(
228   "branchcode",
229   "Koha::Schema::Result::Branch",
230   { branchcode => "branchcode" },
231   {
232     is_deferrable => 1,
233     join_type     => "LEFT",
234     on_delete     => "SET NULL",
235     on_update     => "CASCADE",
236   },
237 );
238
239 =head2 itemnumber
240
241 Type: belongs_to
242
243 Related object: L<Koha::Schema::Result::Item>
244
245 =cut
246
247 __PACKAGE__->belongs_to(
248   "itemnumber",
249   "Koha::Schema::Result::Item",
250   { itemnumber => "itemnumber" },
251   {
252     is_deferrable => 1,
253     join_type     => "LEFT",
254     on_delete     => "SET NULL",
255     on_update     => "CASCADE",
256   },
257 );
258
259 =head2 manager
260
261 Type: belongs_to
262
263 Related object: L<Koha::Schema::Result::Borrower>
264
265 =cut
266
267 __PACKAGE__->belongs_to(
268   "manager",
269   "Koha::Schema::Result::Borrower",
270   { borrowernumber => "manager_id" },
271   {
272     is_deferrable => 1,
273     join_type     => "LEFT",
274     on_delete     => "SET NULL",
275     on_update     => "CASCADE",
276   },
277 );
278
279
280 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2019-03-22 20:06:37
281 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Op6tRrWF4pGrLcunNiXO+g
282
283 sub koha_objects_class {
284     'Koha::Account::Lines';
285 }
286 sub koha_object_class {
287     'Koha::Account::Line';
288 }
289
290 1;