2 package Koha::Schema::Result::Aqinvoice;
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
9 Koha::Schema::Result::Aqinvoice
16 use base 'DBIx::Class::Core';
18 =head1 TABLE: C<aqinvoices>
22 __PACKAGE__->table("aqinvoices");
32 ID of the invoice, primary key
47 foreign key to aqbooksellers
52 datetime_undef_if_invalid: 1
60 datetime_undef_if_invalid: 1
68 datetime_undef_if_invalid: 1
71 invoice close date, NULL means the invoice is open
81 =head2 shipmentcost_budgetid
87 foreign key to aqbudgets, link the shipment cost to a budget
95 foreign key to edifact invoice message
99 __PACKAGE__->add_columns(
101 { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
103 { data_type => "longtext", is_nullable => 0 },
105 { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
107 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
109 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
111 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
113 { data_type => "decimal", is_nullable => 1, size => [28, 6] },
114 "shipmentcost_budgetid",
115 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
117 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
124 =item * L</invoiceid>
130 __PACKAGE__->set_primary_key("invoiceid");
134 =head2 aqinvoice_adjustments
138 Related object: L<Koha::Schema::Result::AqinvoiceAdjustment>
142 __PACKAGE__->has_many(
143 "aqinvoice_adjustments",
144 "Koha::Schema::Result::AqinvoiceAdjustment",
145 { "foreign.invoiceid" => "self.invoiceid" },
146 { cascade_copy => 0, cascade_delete => 0 },
153 Related object: L<Koha::Schema::Result::Aqorder>
157 __PACKAGE__->has_many(
159 "Koha::Schema::Result::Aqorder",
160 { "foreign.invoiceid" => "self.invoiceid" },
161 { cascade_copy => 0, cascade_delete => 0 },
168 Related object: L<Koha::Schema::Result::Aqbookseller>
172 __PACKAGE__->belongs_to(
174 "Koha::Schema::Result::Aqbookseller",
175 { id => "booksellerid" },
176 { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
183 Related object: L<Koha::Schema::Result::EdifactMessage>
187 __PACKAGE__->belongs_to(
189 "Koha::Schema::Result::EdifactMessage",
190 { id => "message_id" },
194 on_delete => "SET NULL",
195 on_update => "RESTRICT",
199 =head2 shipmentcost_budgetid
203 Related object: L<Koha::Schema::Result::Aqbudget>
207 __PACKAGE__->belongs_to(
208 "shipmentcost_budgetid",
209 "Koha::Schema::Result::Aqbudget",
210 { budget_id => "shipmentcost_budgetid" },
214 on_delete => "SET NULL",
215 on_update => "CASCADE",
220 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29
221 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:LkekSbup37Z2WVnU/c9K+g
223 __PACKAGE__->has_many(
224 "additional_field_values",
225 "Koha::Schema::Result::AdditionalFieldValue",
230 "$args->{foreign_alias}.record_id" => { -ident => "$args->{self_alias}.invoiceid" },
232 "$args->{foreign_alias}.field_id" =>
233 { -in => \'(SELECT id FROM additional_fields WHERE tablename="aqinvoices")' },
236 { cascade_copy => 0, cascade_delete => 0 },
239 sub koha_object_class {
240 'Koha::Acquisition::Invoice';
242 sub koha_objects_class {
243 'Koha::Acquisition::Invoices';