Bug 8798: DBIx::Class base classes for all Koha tables
[koha.git] / Koha / Schema / Result / Aqinvoice.pm
1 package Koha::Schema::Result::Aqinvoice;
2
3 # Created by DBIx::Class::Schema::Loader
4 # DO NOT MODIFY THE FIRST PART OF THIS FILE
5
6 use strict;
7 use warnings;
8
9 use base 'DBIx::Class::Core';
10
11
12 =head1 NAME
13
14 Koha::Schema::Result::Aqinvoice
15
16 =cut
17
18 __PACKAGE__->table("aqinvoices");
19
20 =head1 ACCESSORS
21
22 =head2 invoiceid
23
24   data_type: 'integer'
25   is_auto_increment: 1
26   is_nullable: 0
27
28 =head2 invoicenumber
29
30   data_type: 'mediumtext'
31   is_nullable: 0
32
33 =head2 booksellerid
34
35   data_type: 'integer'
36   is_foreign_key: 1
37   is_nullable: 0
38
39 =head2 shipmentdate
40
41   data_type: 'date'
42   is_nullable: 1
43
44 =head2 billingdate
45
46   data_type: 'date'
47   is_nullable: 1
48
49 =head2 closedate
50
51   data_type: 'date'
52   is_nullable: 1
53
54 =head2 shipmentcost
55
56   data_type: 'decimal'
57   is_nullable: 1
58   size: [28,6]
59
60 =head2 shipmentcost_budgetid
61
62   data_type: 'integer'
63   is_foreign_key: 1
64   is_nullable: 1
65
66 =cut
67
68 __PACKAGE__->add_columns(
69   "invoiceid",
70   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
71   "invoicenumber",
72   { data_type => "mediumtext", is_nullable => 0 },
73   "booksellerid",
74   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
75   "shipmentdate",
76   { data_type => "date", is_nullable => 1 },
77   "billingdate",
78   { data_type => "date", is_nullable => 1 },
79   "closedate",
80   { data_type => "date", is_nullable => 1 },
81   "shipmentcost",
82   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
83   "shipmentcost_budgetid",
84   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
85 );
86 __PACKAGE__->set_primary_key("invoiceid");
87
88 =head1 RELATIONS
89
90 =head2 booksellerid
91
92 Type: belongs_to
93
94 Related object: L<Koha::Schema::Result::Aqbookseller>
95
96 =cut
97
98 __PACKAGE__->belongs_to(
99   "booksellerid",
100   "Koha::Schema::Result::Aqbookseller",
101   { id => "booksellerid" },
102   { on_delete => "CASCADE", on_update => "CASCADE" },
103 );
104
105 =head2 shipmentcost_budgetid
106
107 Type: belongs_to
108
109 Related object: L<Koha::Schema::Result::Aqbudget>
110
111 =cut
112
113 __PACKAGE__->belongs_to(
114   "shipmentcost_budgetid",
115   "Koha::Schema::Result::Aqbudget",
116   { budget_id => "shipmentcost_budgetid" },
117   { join_type => "LEFT", on_delete => "CASCADE", on_update => "CASCADE" },
118 );
119
120 =head2 aqorders
121
122 Type: has_many
123
124 Related object: L<Koha::Schema::Result::Aqorder>
125
126 =cut
127
128 __PACKAGE__->has_many(
129   "aqorders",
130   "Koha::Schema::Result::Aqorder",
131   { "foreign.invoiceid" => "self.invoiceid" },
132   { cascade_copy => 0, cascade_delete => 0 },
133 );
134
135
136 # Created by DBIx::Class::Schema::Loader v0.07000 @ 2012-09-02 08:44:15
137 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:O5JnKjtyloB4VdJzZMpQng
138
139
140 # You can replace this text with custom content, and it will be preserved on regeneration
141 1;