Bug 21065: Add koha_object(s)_class methods to accountline
[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   default_value: 0
41   is_foreign_key: 1
42   is_nullable: 0
43
44 =head2 accountno
45
46   data_type: 'smallint'
47   default_value: 0
48   is_nullable: 0
49
50 =head2 itemnumber
51
52   data_type: 'integer'
53   is_foreign_key: 1
54   is_nullable: 1
55
56 =head2 date
57
58   data_type: 'date'
59   datetime_undef_if_invalid: 1
60   is_nullable: 1
61
62 =head2 amount
63
64   data_type: 'decimal'
65   is_nullable: 1
66   size: [28,6]
67
68 =head2 description
69
70   data_type: 'longtext'
71   is_nullable: 1
72
73 =head2 accounttype
74
75   data_type: 'varchar'
76   is_nullable: 1
77   size: 5
78
79 =head2 payment_type
80
81   data_type: 'varchar'
82   is_nullable: 1
83   size: 80
84
85 =head2 amountoutstanding
86
87   data_type: 'decimal'
88   is_nullable: 1
89   size: [28,6]
90
91 =head2 lastincrement
92
93   data_type: 'decimal'
94   is_nullable: 1
95   size: [28,6]
96
97 =head2 timestamp
98
99   data_type: 'timestamp'
100   datetime_undef_if_invalid: 1
101   default_value: current_timestamp
102   is_nullable: 0
103
104 =head2 note
105
106   data_type: 'mediumtext'
107   is_nullable: 1
108
109 =head2 manager_id
110
111   data_type: 'integer'
112   is_nullable: 1
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   {
123     data_type      => "integer",
124     default_value  => 0,
125     is_foreign_key => 1,
126     is_nullable    => 0,
127   },
128   "accountno",
129   { data_type => "smallint", default_value => 0, is_nullable => 0 },
130   "itemnumber",
131   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
132   "date",
133   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
134   "amount",
135   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
136   "description",
137   { data_type => "longtext", is_nullable => 1 },
138   "accounttype",
139   { data_type => "varchar", is_nullable => 1, size => 5 },
140   "payment_type",
141   { data_type => "varchar", is_nullable => 1, size => 80 },
142   "amountoutstanding",
143   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
144   "lastincrement",
145   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
146   "timestamp",
147   {
148     data_type => "timestamp",
149     datetime_undef_if_invalid => 1,
150     default_value => \"current_timestamp",
151     is_nullable => 0,
152   },
153   "note",
154   { data_type => "mediumtext", is_nullable => 1 },
155   "manager_id",
156   { data_type => "integer", is_nullable => 1 },
157 );
158
159 =head1 PRIMARY KEY
160
161 =over 4
162
163 =item * L</accountlines_id>
164
165 =back
166
167 =cut
168
169 __PACKAGE__->set_primary_key("accountlines_id");
170
171 =head1 RELATIONS
172
173 =head2 account_offsets_credits
174
175 Type: has_many
176
177 Related object: L<Koha::Schema::Result::AccountOffset>
178
179 =cut
180
181 __PACKAGE__->has_many(
182   "account_offsets_credits",
183   "Koha::Schema::Result::AccountOffset",
184   { "foreign.credit_id" => "self.accountlines_id" },
185   { cascade_copy => 0, cascade_delete => 0 },
186 );
187
188 =head2 account_offsets_debits
189
190 Type: has_many
191
192 Related object: L<Koha::Schema::Result::AccountOffset>
193
194 =cut
195
196 __PACKAGE__->has_many(
197   "account_offsets_debits",
198   "Koha::Schema::Result::AccountOffset",
199   { "foreign.debit_id" => "self.accountlines_id" },
200   { cascade_copy => 0, cascade_delete => 0 },
201 );
202
203 =head2 borrowernumber
204
205 Type: belongs_to
206
207 Related object: L<Koha::Schema::Result::Borrower>
208
209 =cut
210
211 __PACKAGE__->belongs_to(
212   "borrowernumber",
213   "Koha::Schema::Result::Borrower",
214   { borrowernumber => "borrowernumber" },
215   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
216 );
217
218 =head2 itemnumber
219
220 Type: belongs_to
221
222 Related object: L<Koha::Schema::Result::Item>
223
224 =cut
225
226 __PACKAGE__->belongs_to(
227   "itemnumber",
228   "Koha::Schema::Result::Item",
229   { itemnumber => "itemnumber" },
230   {
231     is_deferrable => 1,
232     join_type     => "LEFT",
233     on_delete     => "SET NULL",
234     on_update     => "SET NULL",
235   },
236 );
237
238
239 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-05-16 17:00:24
240 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:pygYYKxFDRLX97PyeUeLvg
241
242 sub koha_objects_class {
243     'Koha::Account::Lines';
244 }
245 sub koha_object_class {
246     'Koha::Account::Line';
247 }
248
249 1;