Bug 18786: DBIC Schema changes
[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 dispute
74
75   data_type: 'longtext'
76   is_nullable: 1
77
78 =head2 accounttype
79
80   data_type: 'varchar'
81   is_nullable: 1
82   size: 5
83
84 =head2 payment_type
85
86   data_type: 'varchar'
87   is_nullable: 1
88   size: 80
89
90 =head2 amountoutstanding
91
92   data_type: 'decimal'
93   is_nullable: 1
94   size: [28,6]
95
96 =head2 lastincrement
97
98   data_type: 'decimal'
99   is_nullable: 1
100   size: [28,6]
101
102 =head2 timestamp
103
104   data_type: 'timestamp'
105   datetime_undef_if_invalid: 1
106   default_value: current_timestamp
107   is_nullable: 0
108
109 =head2 note
110
111   data_type: 'mediumtext'
112   is_nullable: 1
113
114 =head2 manager_id
115
116   data_type: 'integer'
117   is_nullable: 1
118
119 =cut
120
121 __PACKAGE__->add_columns(
122   "accountlines_id",
123   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
124   "issue_id",
125   { data_type => "integer", is_nullable => 1 },
126   "borrowernumber",
127   {
128     data_type      => "integer",
129     default_value  => 0,
130     is_foreign_key => 1,
131     is_nullable    => 0,
132   },
133   "accountno",
134   { data_type => "smallint", default_value => 0, is_nullable => 0 },
135   "itemnumber",
136   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
137   "date",
138   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
139   "amount",
140   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
141   "description",
142   { data_type => "longtext", is_nullable => 1 },
143   "dispute",
144   { data_type => "longtext", is_nullable => 1 },
145   "accounttype",
146   { data_type => "varchar", is_nullable => 1, size => 5 },
147   "payment_type",
148   { data_type => "varchar", is_nullable => 1, size => 80 },
149   "amountoutstanding",
150   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
151   "lastincrement",
152   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
153   "timestamp",
154   {
155     data_type => "timestamp",
156     datetime_undef_if_invalid => 1,
157     default_value => \"current_timestamp",
158     is_nullable => 0,
159   },
160   "note",
161   { data_type => "mediumtext", is_nullable => 1 },
162   "manager_id",
163   { data_type => "integer", is_nullable => 1 },
164 );
165
166 =head1 PRIMARY KEY
167
168 =over 4
169
170 =item * L</accountlines_id>
171
172 =back
173
174 =cut
175
176 __PACKAGE__->set_primary_key("accountlines_id");
177
178 =head1 RELATIONS
179
180 =head2 account_offsets_credits
181
182 Type: has_many
183
184 Related object: L<Koha::Schema::Result::AccountOffset>
185
186 =cut
187
188 __PACKAGE__->has_many(
189   "account_offsets_credits",
190   "Koha::Schema::Result::AccountOffset",
191   { "foreign.credit_id" => "self.accountlines_id" },
192   { cascade_copy => 0, cascade_delete => 0 },
193 );
194
195 =head2 account_offsets_debits
196
197 Type: has_many
198
199 Related object: L<Koha::Schema::Result::AccountOffset>
200
201 =cut
202
203 __PACKAGE__->has_many(
204   "account_offsets_debits",
205   "Koha::Schema::Result::AccountOffset",
206   { "foreign.debit_id" => "self.accountlines_id" },
207   { cascade_copy => 0, cascade_delete => 0 },
208 );
209
210 =head2 borrowernumber
211
212 Type: belongs_to
213
214 Related object: L<Koha::Schema::Result::Borrower>
215
216 =cut
217
218 __PACKAGE__->belongs_to(
219   "borrowernumber",
220   "Koha::Schema::Result::Borrower",
221   { borrowernumber => "borrowernumber" },
222   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
223 );
224
225 =head2 itemnumber
226
227 Type: belongs_to
228
229 Related object: L<Koha::Schema::Result::Item>
230
231 =cut
232
233 __PACKAGE__->belongs_to(
234   "itemnumber",
235   "Koha::Schema::Result::Item",
236   { itemnumber => "itemnumber" },
237   {
238     is_deferrable => 1,
239     join_type     => "LEFT",
240     on_delete     => "SET NULL",
241     on_update     => "SET NULL",
242   },
243 );
244
245
246 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-04-19 12:18:02
247 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:FUX/e/s202yrUtP3c13lfw
248
249
250 # You can replace this text with custom content, and it will be preserved on regeneration
251 1;