Bug 21065: DBRev 18.12.00.002
[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 =cut
114
115 __PACKAGE__->add_columns(
116   "accountlines_id",
117   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
118   "issue_id",
119   { data_type => "integer", is_nullable => 1 },
120   "borrowernumber",
121   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
122   "accountno",
123   { data_type => "smallint", default_value => 0, is_nullable => 0 },
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_nullable => 1 },
151 );
152
153 =head1 PRIMARY KEY
154
155 =over 4
156
157 =item * L</accountlines_id>
158
159 =back
160
161 =cut
162
163 __PACKAGE__->set_primary_key("accountlines_id");
164
165 =head1 RELATIONS
166
167 =head2 account_offsets_credits
168
169 Type: has_many
170
171 Related object: L<Koha::Schema::Result::AccountOffset>
172
173 =cut
174
175 __PACKAGE__->has_many(
176   "account_offsets_credits",
177   "Koha::Schema::Result::AccountOffset",
178   { "foreign.credit_id" => "self.accountlines_id" },
179   { cascade_copy => 0, cascade_delete => 0 },
180 );
181
182 =head2 account_offsets_debits
183
184 Type: has_many
185
186 Related object: L<Koha::Schema::Result::AccountOffset>
187
188 =cut
189
190 __PACKAGE__->has_many(
191   "account_offsets_debits",
192   "Koha::Schema::Result::AccountOffset",
193   { "foreign.debit_id" => "self.accountlines_id" },
194   { cascade_copy => 0, cascade_delete => 0 },
195 );
196
197 =head2 borrowernumber
198
199 Type: belongs_to
200
201 Related object: L<Koha::Schema::Result::Borrower>
202
203 =cut
204
205 __PACKAGE__->belongs_to(
206   "borrowernumber",
207   "Koha::Schema::Result::Borrower",
208   { borrowernumber => "borrowernumber" },
209   {
210     is_deferrable => 1,
211     join_type     => "LEFT",
212     on_delete     => "SET NULL",
213     on_update     => "CASCADE",
214   },
215 );
216
217 =head2 itemnumber
218
219 Type: belongs_to
220
221 Related object: L<Koha::Schema::Result::Item>
222
223 =cut
224
225 __PACKAGE__->belongs_to(
226   "itemnumber",
227   "Koha::Schema::Result::Item",
228   { itemnumber => "itemnumber" },
229   {
230     is_deferrable => 1,
231     join_type     => "LEFT",
232     on_delete     => "SET NULL",
233     on_update     => "SET NULL",
234   },
235 );
236
237
238 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-12-19 16:19:16
239 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:kvBIJshNRsm/HYJBbhm0IA
240
241 sub koha_objects_class {
242     'Koha::Account::Lines';
243 }
244 sub koha_object_class {
245     'Koha::Account::Line';
246 }
247
248 1;