Bug 18336: DBIC Schema changes
[koha_ffzg] / 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 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   {
122     data_type      => "integer",
123     default_value  => 0,
124     is_foreign_key => 1,
125     is_nullable    => 0,
126   },
127   "accountno",
128   { data_type => "smallint", default_value => 0, is_nullable => 0 },
129   "itemnumber",
130   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
131   "date",
132   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
133   "amount",
134   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
135   "description",
136   { data_type => "longtext", is_nullable => 1 },
137   "dispute",
138   { data_type => "longtext", is_nullable => 1 },
139   "accounttype",
140   { data_type => "varchar", is_nullable => 1, size => 5 },
141   "amountoutstanding",
142   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
143   "lastincrement",
144   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
145   "timestamp",
146   {
147     data_type => "timestamp",
148     datetime_undef_if_invalid => 1,
149     default_value => \"current_timestamp",
150     is_nullable => 0,
151   },
152   "note",
153   { data_type => "mediumtext", is_nullable => 1 },
154   "manager_id",
155   { data_type => "integer", is_nullable => 1 },
156 );
157
158 =head1 PRIMARY KEY
159
160 =over 4
161
162 =item * L</accountlines_id>
163
164 =back
165
166 =cut
167
168 __PACKAGE__->set_primary_key("accountlines_id");
169
170 =head1 RELATIONS
171
172 =head2 account_offsets_credits
173
174 Type: has_many
175
176 Related object: L<Koha::Schema::Result::AccountOffset>
177
178 =cut
179
180 __PACKAGE__->has_many(
181   "account_offsets_credits",
182   "Koha::Schema::Result::AccountOffset",
183   { "foreign.credit_id" => "self.accountlines_id" },
184   { cascade_copy => 0, cascade_delete => 0 },
185 );
186
187 =head2 account_offsets_debits
188
189 Type: has_many
190
191 Related object: L<Koha::Schema::Result::AccountOffset>
192
193 =cut
194
195 __PACKAGE__->has_many(
196   "account_offsets_debits",
197   "Koha::Schema::Result::AccountOffset",
198   { "foreign.debit_id" => "self.accountlines_id" },
199   { cascade_copy => 0, cascade_delete => 0 },
200 );
201
202 =head2 borrowernumber
203
204 Type: belongs_to
205
206 Related object: L<Koha::Schema::Result::Borrower>
207
208 =cut
209
210 __PACKAGE__->belongs_to(
211   "borrowernumber",
212   "Koha::Schema::Result::Borrower",
213   { borrowernumber => "borrowernumber" },
214   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
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-02-16 17:54:53
239 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Nqx+Byr+p91Kbsuncau0Ng
240
241
242 # You can replace this text with custom content, and it will be preserved on regeneration
243 1;