Bug 7413: update DBIC schema classes
[koha.git] / Koha / Schema / Result / Aqorder.pm
1 use utf8;
2 package Koha::Schema::Result::Aqorder;
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::Aqorder
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<aqorders>
19
20 =cut
21
22 __PACKAGE__->table("aqorders");
23
24 =head1 ACCESSORS
25
26 =head2 ordernumber
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 =head2 biblionumber
33
34   data_type: 'integer'
35   is_foreign_key: 1
36   is_nullable: 1
37
38 =head2 entrydate
39
40   data_type: 'date'
41   datetime_undef_if_invalid: 1
42   is_nullable: 1
43
44 =head2 quantity
45
46   data_type: 'smallint'
47   is_nullable: 1
48
49 =head2 currency
50
51   data_type: 'varchar'
52   is_nullable: 1
53   size: 3
54
55 =head2 listprice
56
57   data_type: 'decimal'
58   is_nullable: 1
59   size: [28,6]
60
61 =head2 totalamount
62
63   data_type: 'decimal'
64   is_nullable: 1
65   size: [28,6]
66
67 =head2 datereceived
68
69   data_type: 'date'
70   datetime_undef_if_invalid: 1
71   is_nullable: 1
72
73 =head2 invoiceid
74
75   data_type: 'integer'
76   is_foreign_key: 1
77   is_nullable: 1
78
79 =head2 freight
80
81   data_type: 'decimal'
82   is_nullable: 1
83   size: [28,6]
84
85 =head2 unitprice
86
87   data_type: 'decimal'
88   is_nullable: 1
89   size: [28,6]
90
91 =head2 quantityreceived
92
93   data_type: 'smallint'
94   default_value: 0
95   is_nullable: 0
96
97 =head2 cancelledby
98
99   data_type: 'varchar'
100   is_nullable: 1
101   size: 10
102
103 =head2 datecancellationprinted
104
105   data_type: 'date'
106   datetime_undef_if_invalid: 1
107   is_nullable: 1
108
109 =head2 notes
110
111   data_type: 'mediumtext'
112   is_nullable: 1
113
114 =head2 supplierreference
115
116   data_type: 'mediumtext'
117   is_nullable: 1
118
119 =head2 purchaseordernumber
120
121   data_type: 'mediumtext'
122   is_nullable: 1
123
124 =head2 basketno
125
126   data_type: 'integer'
127   is_foreign_key: 1
128   is_nullable: 1
129
130 =head2 timestamp
131
132   data_type: 'timestamp'
133   datetime_undef_if_invalid: 1
134   default_value: current_timestamp
135   is_nullable: 0
136
137 =head2 rrp
138
139   data_type: 'decimal'
140   is_nullable: 1
141   size: [13,2]
142
143 =head2 ecost
144
145   data_type: 'decimal'
146   is_nullable: 1
147   size: [13,2]
148
149 =head2 gstrate
150
151   data_type: 'decimal'
152   is_nullable: 1
153   size: [6,4]
154
155 =head2 discount
156
157   data_type: 'float'
158   is_nullable: 1
159   size: [6,4]
160
161 =head2 budget_id
162
163   data_type: 'integer'
164   is_nullable: 0
165
166 =head2 budgetgroup_id
167
168   data_type: 'integer'
169   is_nullable: 0
170
171 =head2 budgetdate
172
173   data_type: 'date'
174   datetime_undef_if_invalid: 1
175   is_nullable: 1
176
177 =head2 sort1
178
179   data_type: 'varchar'
180   is_nullable: 1
181   size: 80
182
183 =head2 sort2
184
185   data_type: 'varchar'
186   is_nullable: 1
187   size: 80
188
189 =head2 sort1_authcat
190
191   data_type: 'varchar'
192   is_nullable: 1
193   size: 10
194
195 =head2 sort2_authcat
196
197   data_type: 'varchar'
198   is_nullable: 1
199   size: 10
200
201 =head2 uncertainprice
202
203   data_type: 'tinyint'
204   is_nullable: 1
205
206 =head2 claims_count
207
208   data_type: 'integer'
209   default_value: 0
210   is_nullable: 1
211
212 =head2 claimed_date
213
214   data_type: 'date'
215   datetime_undef_if_invalid: 1
216   is_nullable: 1
217
218 =head2 subscriptionid
219
220   data_type: 'integer'
221   is_foreign_key: 1
222   is_nullable: 1
223
224 =head2 parent_ordernumber
225
226   data_type: 'integer'
227   is_nullable: 1
228
229 =head2 orderstatus
230
231   data_type: 'varchar'
232   default_value: 'new'
233   is_nullable: 1
234   size: 16
235
236 =cut
237
238 __PACKAGE__->add_columns(
239   "ordernumber",
240   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
241   "biblionumber",
242   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
243   "entrydate",
244   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
245   "quantity",
246   { data_type => "smallint", is_nullable => 1 },
247   "currency",
248   { data_type => "varchar", is_nullable => 1, size => 3 },
249   "listprice",
250   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
251   "totalamount",
252   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
253   "datereceived",
254   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
255   "invoiceid",
256   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
257   "freight",
258   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
259   "unitprice",
260   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
261   "quantityreceived",
262   { data_type => "smallint", default_value => 0, is_nullable => 0 },
263   "cancelledby",
264   { data_type => "varchar", is_nullable => 1, size => 10 },
265   "datecancellationprinted",
266   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
267   "notes",
268   { data_type => "mediumtext", is_nullable => 1 },
269   "supplierreference",
270   { data_type => "mediumtext", is_nullable => 1 },
271   "purchaseordernumber",
272   { data_type => "mediumtext", is_nullable => 1 },
273   "basketno",
274   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
275   "timestamp",
276   {
277     data_type => "timestamp",
278     datetime_undef_if_invalid => 1,
279     default_value => \"current_timestamp",
280     is_nullable => 0,
281   },
282   "rrp",
283   { data_type => "decimal", is_nullable => 1, size => [13, 2] },
284   "ecost",
285   { data_type => "decimal", is_nullable => 1, size => [13, 2] },
286   "gstrate",
287   { data_type => "decimal", is_nullable => 1, size => [6, 4] },
288   "discount",
289   { data_type => "float", is_nullable => 1, size => [6, 4] },
290   "budget_id",
291   { data_type => "integer", is_nullable => 0 },
292   "budgetgroup_id",
293   { data_type => "integer", is_nullable => 0 },
294   "budgetdate",
295   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
296   "sort1",
297   { data_type => "varchar", is_nullable => 1, size => 80 },
298   "sort2",
299   { data_type => "varchar", is_nullable => 1, size => 80 },
300   "sort1_authcat",
301   { data_type => "varchar", is_nullable => 1, size => 10 },
302   "sort2_authcat",
303   { data_type => "varchar", is_nullable => 1, size => 10 },
304   "uncertainprice",
305   { data_type => "tinyint", is_nullable => 1 },
306   "claims_count",
307   { data_type => "integer", default_value => 0, is_nullable => 1 },
308   "claimed_date",
309   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
310   "subscriptionid",
311   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
312   "parent_ordernumber",
313   { data_type => "integer", is_nullable => 1 },
314   "orderstatus",
315   {
316     data_type => "varchar",
317     default_value => "new",
318     is_nullable => 1,
319     size => 16,
320   },
321 );
322
323 =head1 PRIMARY KEY
324
325 =over 4
326
327 =item * L</ordernumber>
328
329 =back
330
331 =cut
332
333 __PACKAGE__->set_primary_key("ordernumber");
334
335 =head1 RELATIONS
336
337 =head2 aqorders_items
338
339 Type: has_many
340
341 Related object: L<Koha::Schema::Result::AqordersItem>
342
343 =cut
344
345 __PACKAGE__->has_many(
346   "aqorders_items",
347   "Koha::Schema::Result::AqordersItem",
348   { "foreign.ordernumber" => "self.ordernumber" },
349   { cascade_copy => 0, cascade_delete => 0 },
350 );
351
352 =head2 aqorders_transfers_ordernumber_from
353
354 Type: might_have
355
356 Related object: L<Koha::Schema::Result::AqordersTransfer>
357
358 =cut
359
360 __PACKAGE__->might_have(
361   "aqorders_transfers_ordernumber_from",
362   "Koha::Schema::Result::AqordersTransfer",
363   { "foreign.ordernumber_from" => "self.ordernumber" },
364   { cascade_copy => 0, cascade_delete => 0 },
365 );
366
367 =head2 aqorders_transfers_ordernumber_to
368
369 Type: might_have
370
371 Related object: L<Koha::Schema::Result::AqordersTransfer>
372
373 =cut
374
375 __PACKAGE__->might_have(
376   "aqorders_transfers_ordernumber_to",
377   "Koha::Schema::Result::AqordersTransfer",
378   { "foreign.ordernumber_to" => "self.ordernumber" },
379   { cascade_copy => 0, cascade_delete => 0 },
380 );
381
382 =head2 basketno
383
384 Type: belongs_to
385
386 Related object: L<Koha::Schema::Result::Aqbasket>
387
388 =cut
389
390 __PACKAGE__->belongs_to(
391   "basketno",
392   "Koha::Schema::Result::Aqbasket",
393   { basketno => "basketno" },
394   {
395     is_deferrable => 1,
396     join_type     => "LEFT",
397     on_delete     => "CASCADE",
398     on_update     => "CASCADE",
399   },
400 );
401
402 =head2 biblionumber
403
404 Type: belongs_to
405
406 Related object: L<Koha::Schema::Result::Biblio>
407
408 =cut
409
410 __PACKAGE__->belongs_to(
411   "biblionumber",
412   "Koha::Schema::Result::Biblio",
413   { biblionumber => "biblionumber" },
414   {
415     is_deferrable => 1,
416     join_type     => "LEFT",
417     on_delete     => "CASCADE",
418     on_update     => "CASCADE",
419   },
420 );
421
422 =head2 invoiceid
423
424 Type: belongs_to
425
426 Related object: L<Koha::Schema::Result::Aqinvoice>
427
428 =cut
429
430 __PACKAGE__->belongs_to(
431   "invoiceid",
432   "Koha::Schema::Result::Aqinvoice",
433   { invoiceid => "invoiceid" },
434   {
435     is_deferrable => 1,
436     join_type     => "LEFT",
437     on_delete     => "CASCADE",
438     on_update     => "CASCADE",
439   },
440 );
441
442 =head2 subscriptionid
443
444 Type: belongs_to
445
446 Related object: L<Koha::Schema::Result::Subscription>
447
448 =cut
449
450 __PACKAGE__->belongs_to(
451   "subscriptionid",
452   "Koha::Schema::Result::Subscription",
453   { subscriptionid => "subscriptionid" },
454   {
455     is_deferrable => 1,
456     join_type     => "LEFT",
457     on_delete     => "CASCADE",
458     on_update     => "CASCADE",
459   },
460 );
461
462
463 # Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-22 13:37:51
464 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:+bznx/vy8sLxOYDBZkwycw
465
466
467 # You can replace this text with custom content, and it will be preserved on regeneration
468 1;