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
113 1 if the item is not for loan, 0 if the item is available for loan
121 URL for the item type icon
125 data_type: 'mediumtext'
128 information from the summary field, may include HTML
136 message that is displayed when an item with the given item type is checked in
138 =head2 checkinmsgtype
141 default_value: 'message'
145 type (CSS class) for the checkinmsg, can be 'alert' or 'message'
147 =head2 sip_media_type
153 SIP2 protocol media type for this itemtype
161 Hide the item type from the search options in OPAC
163 =head2 searchcategory
169 Group this item type with others with the same value on OPAC search options
171 =head2 automatic_checkin
177 If automatic checkin is enabled for items of this type
181 __PACKAGE__->add_columns(
183 { data_type => "varchar", default_value => "", is_nullable => 0, size => 10 },
185 { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
187 { data_type => "longtext", is_nullable => 1 },
189 { data_type => "decimal", is_nullable => 1, size => [28, 6] },
190 "rentalcharge_daily",
191 { data_type => "decimal", is_nullable => 1, size => [28, 6] },
192 "rentalcharge_daily_calendar",
193 { data_type => "tinyint", default_value => 1, is_nullable => 0 },
194 "rentalcharge_hourly",
195 { data_type => "decimal", is_nullable => 1, size => [28, 6] },
196 "rentalcharge_hourly_calendar",
197 { data_type => "tinyint", default_value => 1, is_nullable => 0 },
198 "defaultreplacecost",
199 { data_type => "decimal", is_nullable => 1, size => [28, 6] },
201 { data_type => "decimal", is_nullable => 1, size => [28, 6] },
203 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
205 { data_type => "varchar", is_nullable => 1, size => 200 },
207 { data_type => "mediumtext", is_nullable => 1 },
209 { data_type => "varchar", is_nullable => 1, size => 255 },
213 default_value => "message",
218 { data_type => "varchar", is_nullable => 1, size => 3 },
220 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
222 { data_type => "varchar", is_nullable => 1, size => 80 },
224 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
237 __PACKAGE__->set_primary_key("itemtype");
241 =head2 circulation_rules
245 Related object: L<Koha::Schema::Result::CirculationRule>
249 __PACKAGE__->has_many(
251 "Koha::Schema::Result::CirculationRule",
252 { "foreign.itemtype" => "self.itemtype" },
253 { cascade_copy => 0, cascade_delete => 0 },
260 Related object: L<Koha::Schema::Result::Itemtype>
264 __PACKAGE__->has_many(
266 "Koha::Schema::Result::Itemtype",
267 { "foreign.parent_type" => "self.itemtype" },
268 { cascade_copy => 0, cascade_delete => 0 },
271 =head2 itemtypes_branches
275 Related object: L<Koha::Schema::Result::ItemtypesBranch>
279 __PACKAGE__->has_many(
280 "itemtypes_branches",
281 "Koha::Schema::Result::ItemtypesBranch",
282 { "foreign.itemtype" => "self.itemtype" },
283 { cascade_copy => 0, cascade_delete => 0 },
290 Related object: L<Koha::Schema::Result::OldReserve>
294 __PACKAGE__->has_many(
296 "Koha::Schema::Result::OldReserve",
297 { "foreign.itemtype" => "self.itemtype" },
298 { cascade_copy => 0, cascade_delete => 0 },
305 Related object: L<Koha::Schema::Result::Itemtype>
309 __PACKAGE__->belongs_to(
311 "Koha::Schema::Result::Itemtype",
312 { itemtype => "parent_type" },
316 on_delete => "RESTRICT",
317 on_update => "RESTRICT",
325 Related object: L<Koha::Schema::Result::Reserve>
329 __PACKAGE__->has_many(
331 "Koha::Schema::Result::Reserve",
332 { "foreign.itemtype" => "self.itemtype" },
333 { cascade_copy => 0, cascade_delete => 0 },
337 # Created by DBIx::Class::Schema::Loader v0.07051 @ 2024-05-08 14:38:07
338 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9NChRQA4eBUqHpLXUFmOuw
340 __PACKAGE__->add_columns(
341 '+automatic_checkin' => { is_boolean => 1 },
342 '+hideinopac' => { is_boolean => 1 },
343 '+notforloan' => { is_boolean => 1 },
344 '+rentalcharge_daily_calendar' => { is_boolean => 1 },
345 '+rentalcharge_hourly_calendar' => { is_boolean => 1 },
348 # Use the ItemtypeLocalization view to create the join on localization
350 __PACKAGE__->has_many(
351 "localization" => "Koha::Schema::Result::ItemtypeLocalization",
355 die "no lang specified!" unless $LANGUAGE;
358 "$args->{self_alias}.itemtype" => { -ident => "$args->{foreign_alias}.code" },
359 "$args->{foreign_alias}.lang" => $LANGUAGE,
365 sub koha_object_class {
368 sub koha_objects_class {