Bug 7736: Support Ordering via Edifact EDI messages
[koha.git] / Koha / Schema / Result / Aqbasket.pm
blob52cc708041101ce3a529dbb434766a8700ac30e6
1 use utf8;
2 package Koha::Schema::Result::Aqbasket;
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
7 =head1 NAME
9 Koha::Schema::Result::Aqbasket
11 =cut
13 use strict;
14 use warnings;
16 use base 'DBIx::Class::Core';
18 =head1 TABLE: C<aqbasket>
20 =cut
22 __PACKAGE__->table("aqbasket");
24 =head1 ACCESSORS
26 =head2 basketno
28 data_type: 'integer'
29 is_auto_increment: 1
30 is_nullable: 0
32 =head2 basketname
34 data_type: 'varchar'
35 is_nullable: 1
36 size: 50
38 =head2 note
40 data_type: 'mediumtext'
41 is_nullable: 1
43 =head2 booksellernote
45 data_type: 'mediumtext'
46 is_nullable: 1
48 =head2 contractnumber
50 data_type: 'integer'
51 is_foreign_key: 1
52 is_nullable: 1
54 =head2 creationdate
56 data_type: 'date'
57 datetime_undef_if_invalid: 1
58 is_nullable: 1
60 =head2 closedate
62 data_type: 'date'
63 datetime_undef_if_invalid: 1
64 is_nullable: 1
66 =head2 booksellerid
68 data_type: 'integer'
69 default_value: 1
70 is_foreign_key: 1
71 is_nullable: 0
73 =head2 authorisedby
75 data_type: 'varchar'
76 is_nullable: 1
77 size: 10
79 =head2 booksellerinvoicenumber
81 data_type: 'mediumtext'
82 is_nullable: 1
84 =head2 basketgroupid
86 data_type: 'integer'
87 is_foreign_key: 1
88 is_nullable: 1
90 =head2 deliveryplace
92 data_type: 'varchar'
93 is_nullable: 1
94 size: 10
96 =head2 billingplace
98 data_type: 'varchar'
99 is_nullable: 1
100 size: 10
102 =head2 branch
104 data_type: 'varchar'
105 is_foreign_key: 1
106 is_nullable: 1
107 size: 10
109 =cut
111 __PACKAGE__->add_columns(
112 "basketno",
113 { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
114 "basketname",
115 { data_type => "varchar", is_nullable => 1, size => 50 },
116 "note",
117 { data_type => "mediumtext", is_nullable => 1 },
118 "booksellernote",
119 { data_type => "mediumtext", is_nullable => 1 },
120 "contractnumber",
121 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
122 "creationdate",
123 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
124 "closedate",
125 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
126 "booksellerid",
128 data_type => "integer",
129 default_value => 1,
130 is_foreign_key => 1,
131 is_nullable => 0,
133 "authorisedby",
134 { data_type => "varchar", is_nullable => 1, size => 10 },
135 "booksellerinvoicenumber",
136 { data_type => "mediumtext", is_nullable => 1 },
137 "basketgroupid",
138 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
139 "deliveryplace",
140 { data_type => "varchar", is_nullable => 1, size => 10 },
141 "billingplace",
142 { data_type => "varchar", is_nullable => 1, size => 10 },
143 "branch",
144 { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
147 =head1 PRIMARY KEY
149 =over 4
151 =item * L</basketno>
153 =back
155 =cut
157 __PACKAGE__->set_primary_key("basketno");
159 =head1 RELATIONS
161 =head2 aqbasketusers
163 Type: has_many
165 Related object: L<Koha::Schema::Result::Aqbasketuser>
167 =cut
169 __PACKAGE__->has_many(
170 "aqbasketusers",
171 "Koha::Schema::Result::Aqbasketuser",
172 { "foreign.basketno" => "self.basketno" },
173 { cascade_copy => 0, cascade_delete => 0 },
176 =head2 aqorders
178 Type: has_many
180 Related object: L<Koha::Schema::Result::Aqorder>
182 =cut
184 __PACKAGE__->has_many(
185 "aqorders",
186 "Koha::Schema::Result::Aqorder",
187 { "foreign.basketno" => "self.basketno" },
188 { cascade_copy => 0, cascade_delete => 0 },
191 =head2 basketgroupid
193 Type: belongs_to
195 Related object: L<Koha::Schema::Result::Aqbasketgroup>
197 =cut
199 __PACKAGE__->belongs_to(
200 "basketgroupid",
201 "Koha::Schema::Result::Aqbasketgroup",
202 { id => "basketgroupid" },
204 is_deferrable => 1,
205 join_type => "LEFT",
206 on_delete => "RESTRICT",
207 on_update => "CASCADE",
211 =head2 booksellerid
213 Type: belongs_to
215 Related object: L<Koha::Schema::Result::Aqbookseller>
217 =cut
219 __PACKAGE__->belongs_to(
220 "booksellerid",
221 "Koha::Schema::Result::Aqbookseller",
222 { id => "booksellerid" },
223 { is_deferrable => 1, on_delete => "RESTRICT", on_update => "CASCADE" },
226 =head2 branch
228 Type: belongs_to
230 Related object: L<Koha::Schema::Result::Branch>
232 =cut
234 __PACKAGE__->belongs_to(
235 "branch",
236 "Koha::Schema::Result::Branch",
237 { branchcode => "branch" },
239 is_deferrable => 1,
240 join_type => "LEFT",
241 on_delete => "SET NULL",
242 on_update => "CASCADE",
246 =head2 contractnumber
248 Type: belongs_to
250 Related object: L<Koha::Schema::Result::Aqcontract>
252 =cut
254 __PACKAGE__->belongs_to(
255 "contractnumber",
256 "Koha::Schema::Result::Aqcontract",
257 { contractnumber => "contractnumber" },
259 is_deferrable => 1,
260 join_type => "LEFT",
261 on_delete => "RESTRICT",
262 on_update => "RESTRICT",
266 =head2 edifact_messages
268 Type: has_many
270 Related object: L<Koha::Schema::Result::EdifactMessage>
272 =cut
274 __PACKAGE__->has_many(
275 "edifact_messages",
276 "Koha::Schema::Result::EdifactMessage",
277 { "foreign.basketno" => "self.basketno" },
278 { cascade_copy => 0, cascade_delete => 0 },
281 =head2 borrowernumbers
283 Type: many_to_many
285 Composing rels: L</aqbasketusers> -> borrowernumber
287 =cut
289 __PACKAGE__->many_to_many("borrowernumbers", "aqbasketusers", "borrowernumber");
292 # Created by DBIx::Class::Schema::Loader v0.07033 @ 2014-09-02 11:37:47
293 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:tsMzwP7eofOR27sfZSTqFQ
296 # You can replace this text with custom content, and it will be preserved on regeneration