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