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