Bug 19066: DBRev 18.12.00.004
[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 accountno
44
45   data_type: 'smallint'
46   default_value: 0
47   is_nullable: 0
48
49 =head2 itemnumber
50
51   data_type: 'integer'
52   is_foreign_key: 1
53   is_nullable: 1
54
55 =head2 date
56
57   data_type: 'date'
58   datetime_undef_if_invalid: 1
59   is_nullable: 1
60
61 =head2 amount
62
63   data_type: 'decimal'
64   is_nullable: 1
65   size: [28,6]
66
67 =head2 description
68
69   data_type: 'longtext'
70   is_nullable: 1
71
72 =head2 accounttype
73
74   data_type: 'varchar'
75   is_nullable: 1
76   size: 5
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 lastincrement
91
92   data_type: 'decimal'
93   is_nullable: 1
94   size: [28,6]
95
96 =head2 timestamp
97
98   data_type: 'timestamp'
99   datetime_undef_if_invalid: 1
100   default_value: current_timestamp
101   is_nullable: 0
102
103 =head2 note
104
105   data_type: 'mediumtext'
106   is_nullable: 1
107
108 =head2 manager_id
109
110   data_type: 'integer'
111   is_nullable: 1
112
113 =head2 branchcode
114
115   data_type: 'varchar'
116   is_foreign_key: 1
117   is_nullable: 1
118   size: 10
119
120 =cut
121
122 __PACKAGE__->add_columns(
123   "accountlines_id",
124   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
125   "issue_id",
126   { data_type => "integer", is_nullable => 1 },
127   "borrowernumber",
128   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
129   "accountno",
130   { data_type => "smallint", default_value => 0, is_nullable => 0 },
131   "itemnumber",
132   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
133   "date",
134   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
135   "amount",
136   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
137   "description",
138   { data_type => "longtext", is_nullable => 1 },
139   "accounttype",
140   { data_type => "varchar", is_nullable => 1, size => 5 },
141   "payment_type",
142   { data_type => "varchar", is_nullable => 1, size => 80 },
143   "amountoutstanding",
144   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
145   "lastincrement",
146   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
147   "timestamp",
148   {
149     data_type => "timestamp",
150     datetime_undef_if_invalid => 1,
151     default_value => \"current_timestamp",
152     is_nullable => 0,
153   },
154   "note",
155   { data_type => "mediumtext", is_nullable => 1 },
156   "manager_id",
157   { data_type => "integer", is_nullable => 1 },
158   "branchcode",
159   { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
160 );
161
162 =head1 PRIMARY KEY
163
164 =over 4
165
166 =item * L</accountlines_id>
167
168 =back
169
170 =cut
171
172 __PACKAGE__->set_primary_key("accountlines_id");
173
174 =head1 RELATIONS
175
176 =head2 account_offsets_credits
177
178 Type: has_many
179
180 Related object: L<Koha::Schema::Result::AccountOffset>
181
182 =cut
183
184 __PACKAGE__->has_many(
185   "account_offsets_credits",
186   "Koha::Schema::Result::AccountOffset",
187   { "foreign.credit_id" => "self.accountlines_id" },
188   { cascade_copy => 0, cascade_delete => 0 },
189 );
190
191 =head2 account_offsets_debits
192
193 Type: has_many
194
195 Related object: L<Koha::Schema::Result::AccountOffset>
196
197 =cut
198
199 __PACKAGE__->has_many(
200   "account_offsets_debits",
201   "Koha::Schema::Result::AccountOffset",
202   { "foreign.debit_id" => "self.accountlines_id" },
203   { cascade_copy => 0, cascade_delete => 0 },
204 );
205
206 =head2 borrowernumber
207
208 Type: belongs_to
209
210 Related object: L<Koha::Schema::Result::Borrower>
211
212 =cut
213
214 __PACKAGE__->belongs_to(
215   "borrowernumber",
216   "Koha::Schema::Result::Borrower",
217   { borrowernumber => "borrowernumber" },
218   {
219     is_deferrable => 1,
220     join_type     => "LEFT",
221     on_delete     => "SET NULL",
222     on_update     => "CASCADE",
223   },
224 );
225
226 =head2 branchcode
227
228 Type: belongs_to
229
230 Related object: L<Koha::Schema::Result::Branch>
231
232 =cut
233
234 __PACKAGE__->belongs_to(
235   "branchcode",
236   "Koha::Schema::Result::Branch",
237   { branchcode => "branchcode" },
238   {
239     is_deferrable => 1,
240     join_type     => "LEFT",
241     on_delete     => "SET NULL",
242     on_update     => "CASCADE",
243   },
244 );
245
246 =head2 itemnumber
247
248 Type: belongs_to
249
250 Related object: L<Koha::Schema::Result::Item>
251
252 =cut
253
254 __PACKAGE__->belongs_to(
255   "itemnumber",
256   "Koha::Schema::Result::Item",
257   { itemnumber => "itemnumber" },
258   {
259     is_deferrable => 1,
260     join_type     => "LEFT",
261     on_delete     => "SET NULL",
262     on_update     => "SET NULL",
263   },
264 );
265
266
267 # Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-01-03 16:10:04
268 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:BO7iSB+QzoJNuZ8Uttba6A
269
270 sub koha_objects_class {
271     'Koha::Account::Lines';
272 }
273 sub koha_object_class {
274     'Koha::Account::Line';
275 }
276
277 1;