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