Bug 23152: Implement koha_object[s]_class when needed
[koha-equinox.git] / Koha / Schema / Result / AqinvoiceAdjustment.pm
1 use utf8;
2 package Koha::Schema::Result::AqinvoiceAdjustment;
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::AqinvoiceAdjustment
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<aqinvoice_adjustments>
19
20 =cut
21
22 __PACKAGE__->table("aqinvoice_adjustments");
23
24 =head1 ACCESSORS
25
26 =head2 adjustment_id
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 =head2 invoiceid
33
34   data_type: 'integer'
35   is_foreign_key: 1
36   is_nullable: 0
37
38 =head2 adjustment
39
40   data_type: 'decimal'
41   is_nullable: 1
42   size: [28,6]
43
44 =head2 reason
45
46   data_type: 'varchar'
47   is_nullable: 1
48   size: 80
49
50 =head2 note
51
52   data_type: 'mediumtext'
53   is_nullable: 1
54
55 =head2 budget_id
56
57   data_type: 'integer'
58   is_foreign_key: 1
59   is_nullable: 1
60
61 =head2 encumber_open
62
63   data_type: 'smallint'
64   default_value: 1
65   is_nullable: 0
66
67 =head2 timestamp
68
69   data_type: 'timestamp'
70   datetime_undef_if_invalid: 1
71   default_value: current_timestamp
72   is_nullable: 0
73
74 =cut
75
76 __PACKAGE__->add_columns(
77   "adjustment_id",
78   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
79   "invoiceid",
80   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
81   "adjustment",
82   { data_type => "decimal", is_nullable => 1, size => [28, 6] },
83   "reason",
84   { data_type => "varchar", is_nullable => 1, size => 80 },
85   "note",
86   { data_type => "mediumtext", is_nullable => 1 },
87   "budget_id",
88   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
89   "encumber_open",
90   { data_type => "smallint", default_value => 1, is_nullable => 0 },
91   "timestamp",
92   {
93     data_type => "timestamp",
94     datetime_undef_if_invalid => 1,
95     default_value => \"current_timestamp",
96     is_nullable => 0,
97   },
98 );
99
100 =head1 PRIMARY KEY
101
102 =over 4
103
104 =item * L</adjustment_id>
105
106 =back
107
108 =cut
109
110 __PACKAGE__->set_primary_key("adjustment_id");
111
112 =head1 RELATIONS
113
114 =head2 budget
115
116 Type: belongs_to
117
118 Related object: L<Koha::Schema::Result::Aqbudget>
119
120 =cut
121
122 __PACKAGE__->belongs_to(
123   "budget",
124   "Koha::Schema::Result::Aqbudget",
125   { budget_id => "budget_id" },
126   {
127     is_deferrable => 1,
128     join_type     => "LEFT",
129     on_delete     => "SET NULL",
130     on_update     => "CASCADE",
131   },
132 );
133
134 =head2 invoiceid
135
136 Type: belongs_to
137
138 Related object: L<Koha::Schema::Result::Aqinvoice>
139
140 =cut
141
142 __PACKAGE__->belongs_to(
143   "invoiceid",
144   "Koha::Schema::Result::Aqinvoice",
145   { invoiceid => "invoiceid" },
146   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
147 );
148
149
150 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-07-19 17:32:57
151 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jl0qxkZWVs2D1pi3kaRjpg
152
153 sub koha_object_class {
154     'Koha::Acquisition::Invoice::Adjustment';
155 }
156 sub koha_objects_class {
157     'Koha::Acquisition::Invoice::Adjustments';
158 }
159
160 1;