2 package Koha::Schema::Result::Itemtype;
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
9 Koha::Schema::Result::Itemtype
16 use base 'DBIx::Class::Core';
18 =head1 TABLE: C<itemtypes>
22 __PACKAGE__->table("itemtypes");
29 default_value: (empty string)
33 unique key, a code associated with the item type
42 unique key, a code associated with the item type
49 a plain text explanation of the item type
57 the amount charged when this item is checked out/issued
59 =head2 rentalcharge_daily
65 the amount charged for each day between checkout date and due date
67 =head2 rentalcharge_daily_calendar
73 controls if the daily rental fee is calculated directly or using finesCalendar
75 =head2 rentalcharge_hourly
81 the amount charged for each hour between checkout date and due date
83 =head2 rentalcharge_hourly_calendar
89 controls if the hourly rental fee is calculated directly or using finesCalendar
91 =head2 defaultreplacecost
97 default replacement cost
105 default text be recorded in the column note when the processing fee is applied
109 data_type: 'smallint'
112 1 if the item is not for loan, 0 if the item is available for loan
120 URL for the item type icon
124 data_type: 'mediumtext'
127 information from the summary field, may include HTML
135 message that is displayed when an item with the given item type is checked in
137 =head2 checkinmsgtype
140 default_value: 'message'
144 type (CSS class) for the checkinmsg, can be 'alert' or 'message'
146 =head2 sip_media_type
152 SIP2 protocol media type for this itemtype
160 Hide the item type from the search options in OPAC
162 =head2 searchcategory
168 Group this item type with others with the same value on OPAC search options
170 =head2 automatic_checkin
176 If automatic checkin is enabled for items of this type
180 __PACKAGE__->add_columns(
182 { data_type => "varchar", default_value => "", is_nullable => 0, size => 10 },
184 { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
186 { data_type => "longtext", is_nullable => 1 },
188 { data_type => "decimal", is_nullable => 1, size => [28, 6] },
189 "rentalcharge_daily",
190 { data_type => "decimal", is_nullable => 1, size => [28, 6] },
191 "rentalcharge_daily_calendar",
192 { data_type => "tinyint", default_value => 1, is_nullable => 0 },
193 "rentalcharge_hourly",
194 { data_type => "decimal", is_nullable => 1, size => [28, 6] },
195 "rentalcharge_hourly_calendar",
196 { data_type => "tinyint", default_value => 1, is_nullable => 0 },
197 "defaultreplacecost",
198 { data_type => "decimal", is_nullable => 1, size => [28, 6] },
200 { data_type => "decimal", is_nullable => 1, size => [28, 6] },
202 { data_type => "smallint", is_nullable => 1 },
204 { data_type => "varchar", is_nullable => 1, size => 200 },
206 { data_type => "mediumtext", is_nullable => 1 },
208 { data_type => "varchar", is_nullable => 1, size => 255 },
212 default_value => "message",
217 { data_type => "varchar", is_nullable => 1, size => 3 },
219 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
221 { data_type => "varchar", is_nullable => 1, size => 80 },
223 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
236 __PACKAGE__->set_primary_key("itemtype");
240 =head2 circulation_rules
244 Related object: L<Koha::Schema::Result::CirculationRule>
248 __PACKAGE__->has_many(
250 "Koha::Schema::Result::CirculationRule",
251 { "foreign.itemtype" => "self.itemtype" },
252 { cascade_copy => 0, cascade_delete => 0 },
259 Related object: L<Koha::Schema::Result::Itemtype>
263 __PACKAGE__->has_many(
265 "Koha::Schema::Result::Itemtype",
266 { "foreign.parent_type" => "self.itemtype" },
267 { cascade_copy => 0, cascade_delete => 0 },
270 =head2 itemtypes_branches
274 Related object: L<Koha::Schema::Result::ItemtypesBranch>
278 __PACKAGE__->has_many(
279 "itemtypes_branches",
280 "Koha::Schema::Result::ItemtypesBranch",
281 { "foreign.itemtype" => "self.itemtype" },
282 { cascade_copy => 0, cascade_delete => 0 },
289 Related object: L<Koha::Schema::Result::OldReserve>
293 __PACKAGE__->has_many(
295 "Koha::Schema::Result::OldReserve",
296 { "foreign.itemtype" => "self.itemtype" },
297 { cascade_copy => 0, cascade_delete => 0 },
304 Related object: L<Koha::Schema::Result::Itemtype>
308 __PACKAGE__->belongs_to(
310 "Koha::Schema::Result::Itemtype",
311 { itemtype => "parent_type" },
315 on_delete => "RESTRICT",
316 on_update => "RESTRICT",
324 Related object: L<Koha::Schema::Result::Reserve>
328 __PACKAGE__->has_many(
330 "Koha::Schema::Result::Reserve",
331 { "foreign.itemtype" => "self.itemtype" },
332 { cascade_copy => 0, cascade_delete => 0 },
336 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-09-22 11:31:25
337 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SoRKIMEqXE2+RkGq6zBejA
339 __PACKAGE__->add_columns(
340 '+rentalcharge_hourly_calendar' => { is_boolean => 1 },
341 '+rentalcharge_daily_calendar' => { is_boolean => 1 },
342 '+automatic_checkin' => { is_boolean => 1 },
345 # Use the ItemtypeLocalization view to create the join on localization
347 __PACKAGE__->has_many(
348 "localization" => "Koha::Schema::Result::ItemtypeLocalization",
352 die "no lang specified!" unless $LANGUAGE;
355 "$args->{self_alias}.itemtype" => { -ident => "$args->{foreign_alias}.code" },
356 "$args->{foreign_alias}.lang" => $LANGUAGE,
362 sub koha_object_class {
365 sub koha_objects_class {