Bug 23152: Implement koha_object[s]_class when needed
[koha-equinox.git] / Koha / Schema / Result / Aqinvoice.pm
1 use utf8;
2 package Koha::Schema::Result::Aqinvoice;
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::Aqinvoice
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<aqinvoices>
19
20 =cut
21
22 __PACKAGE__->table("aqinvoices");
23
24 =head1 ACCESSORS
25
26 =head2 invoiceid
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 =head2 invoicenumber
33
34   data_type: 'longtext'
35   is_nullable: 0
36
37 =head2 booksellerid
38
39   data_type: 'integer'
40   is_foreign_key: 1
41   is_nullable: 0
42
43 =head2 shipmentdate
44
45   data_type: 'date'
46   datetime_undef_if_invalid: 1
47   is_nullable: 1
48
49 =head2 billingdate
50
51   data_type: 'date'
52   datetime_undef_if_invalid: 1
53   is_nullable: 1
54
55 =head2 closedate
56
57   data_type: 'date'
58   datetime_undef_if_invalid: 1
59   is_nullable: 1
60
61 =head2 shipmentcost
62
63   data_type: 'decimal'
64   is_nullable: 1
65   size: [28,6]
66
67 =head2 shipmentcost_budgetid
68
69   data_type: 'integer'
70   is_foreign_key: 1
71   is_nullable: 1
72
73 =head2 message_id
74
75   data_type: 'integer'
76   is_foreign_key: 1
77   is_nullable: 1
78
79 =cut
80
81 __PACKAGE__->add_columns(
82   "invoiceid",
83   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
84   "invoicenumber",
85   { data_type => "longtext", is_nullable => 0 },
86   "booksellerid",
87   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
88   "shipmentdate",
89   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
90   "billingdate",
91   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
92   "closedate",
93   { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
94   "shipmentcost",
95   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
96   "shipmentcost_budgetid",
97   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
98   "message_id",
99   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
100 );
101
102 =head1 PRIMARY KEY
103
104 =over 4
105
106 =item * L</invoiceid>
107
108 =back
109
110 =cut
111
112 __PACKAGE__->set_primary_key("invoiceid");
113
114 =head1 RELATIONS
115
116 =head2 aqinvoice_adjustments
117
118 Type: has_many
119
120 Related object: L<Koha::Schema::Result::AqinvoiceAdjustment>
121
122 =cut
123
124 __PACKAGE__->has_many(
125   "aqinvoice_adjustments",
126   "Koha::Schema::Result::AqinvoiceAdjustment",
127   { "foreign.invoiceid" => "self.invoiceid" },
128   { cascade_copy => 0, cascade_delete => 0 },
129 );
130
131 =head2 aqorders
132
133 Type: has_many
134
135 Related object: L<Koha::Schema::Result::Aqorder>
136
137 =cut
138
139 __PACKAGE__->has_many(
140   "aqorders",
141   "Koha::Schema::Result::Aqorder",
142   { "foreign.invoiceid" => "self.invoiceid" },
143   { cascade_copy => 0, cascade_delete => 0 },
144 );
145
146 =head2 booksellerid
147
148 Type: belongs_to
149
150 Related object: L<Koha::Schema::Result::Aqbookseller>
151
152 =cut
153
154 __PACKAGE__->belongs_to(
155   "booksellerid",
156   "Koha::Schema::Result::Aqbookseller",
157   { id => "booksellerid" },
158   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
159 );
160
161 =head2 message
162
163 Type: belongs_to
164
165 Related object: L<Koha::Schema::Result::EdifactMessage>
166
167 =cut
168
169 __PACKAGE__->belongs_to(
170   "message",
171   "Koha::Schema::Result::EdifactMessage",
172   { id => "message_id" },
173   {
174     is_deferrable => 1,
175     join_type     => "LEFT",
176     on_delete     => "SET NULL",
177     on_update     => "RESTRICT",
178   },
179 );
180
181 =head2 shipmentcost_budgetid
182
183 Type: belongs_to
184
185 Related object: L<Koha::Schema::Result::Aqbudget>
186
187 =cut
188
189 __PACKAGE__->belongs_to(
190   "shipmentcost_budgetid",
191   "Koha::Schema::Result::Aqbudget",
192   { budget_id => "shipmentcost_budgetid" },
193   {
194     is_deferrable => 1,
195     join_type     => "LEFT",
196     on_delete     => "SET NULL",
197     on_update     => "CASCADE",
198   },
199 );
200
201
202 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-07-16 13:50:45
203 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:mpdxTbkz/8WInG5Wp4q7Ug
204
205 sub koha_object_class {
206     'Koha::Acquisition::Invoice';
207 }
208 sub koha_objects_class {
209     'Koha::Acquisition::Invoices';
210 }
211
212 1;