2 package Koha::Schema::Result::Suggestion;
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
9 Koha::Schema::Result::Suggestion
16 use base 'DBIx::Class::Core';
18 =head1 TABLE: C<suggestions>
22 __PACKAGE__->table("suggestions");
32 unique identifier assigned automatically by Koha
40 borrowernumber for the person making the suggestion, foreign key linking to the borrowers table
45 datetime_undef_if_invalid: 1
48 date the suggestion was submitted
56 borrowernumber for the librarian managing the suggestion, foreign key linking to the borrowers table
61 datetime_undef_if_invalid: 1
64 date the suggestion was updated
72 borrowernumber for the librarian who accepted the suggestion, foreign key linking to the borrowers table
77 datetime_undef_if_invalid: 1
80 date the suggestion was marked as accepted
88 borrowernumber for the librarian who rejected the suggestion, foreign key linking to the borrowers table
93 datetime_undef_if_invalid: 1
96 date the suggestion was marked as rejected
98 =head2 lastmodificationby
104 borrowernumber for the librarian who edit the suggestion for the last time
106 =head2 lastmodificationdate
109 datetime_undef_if_invalid: 1
112 date of the last modification
118 default_value: (empty string)
122 suggestion status (ASKED, CHECKED, ACCEPTED, REJECTED, ORDERED, AVAILABLE or a value from the SUGGEST_STATUS authorised value category)
130 is the suggestion archived?
134 data_type: 'longtext'
137 note entered on the suggestion
141 data_type: 'longtext'
144 non-public note entered on the suggestion
152 author of the suggested item
160 title of the suggested item
164 data_type: 'smallint'
167 copyright date of the suggested item
175 publisher of the suggested item
179 data_type: 'timestamp'
180 datetime_undef_if_invalid: 1
181 default_value: current_timestamp
184 date and time the suggestion was updated
192 =head2 publicationyear
194 data_type: 'smallint'
204 publication place of the suggested item
212 isbn of the suggested item
220 foreign key linking the suggestion to the biblio table after the suggestion has been ordered
224 data_type: 'mediumtext'
227 reason for accepting or rejecting the suggestion
231 data_type: 'mediumtext'
234 reason for making the suggestion
242 foreign key linking the suggested budget to the aqbudgets table
251 foreign key linking the suggested branch to the branches table
253 =head2 collectiontitle
255 data_type: 'mediumtext'
258 collection name for the suggested item
270 data_type: 'smallint'
273 suggested quantity to be purchased
281 suggested currency for the suggested price
297 suggested total cost (price*quantity updated for currency)
301 __PACKAGE__->add_columns(
303 { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
305 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
307 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 0 },
309 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
311 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
313 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
315 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
317 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
319 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
320 "lastmodificationby",
321 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
322 "lastmodificationdate",
323 { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
326 accessor => "status",
327 data_type => "varchar",
333 { data_type => "tinyint", default_value => 0, is_nullable => 0 },
335 { data_type => "longtext", is_nullable => 1 },
337 { data_type => "longtext", is_nullable => 1 },
339 { data_type => "varchar", is_nullable => 1, size => 80 },
341 { data_type => "varchar", is_nullable => 1, size => 255 },
343 { data_type => "smallint", is_nullable => 1 },
345 { data_type => "varchar", is_nullable => 1, size => 255 },
348 data_type => "timestamp",
349 datetime_undef_if_invalid => 1,
350 default_value => \"current_timestamp",
354 { data_type => "varchar", is_nullable => 1, size => 255 },
356 { data_type => "smallint", default_value => 0, is_nullable => 1 },
358 { data_type => "varchar", is_nullable => 1, size => 255 },
360 { data_type => "varchar", is_nullable => 1, size => 30 },
362 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
364 { data_type => "mediumtext", is_nullable => 1 },
366 { data_type => "mediumtext", is_nullable => 1 },
368 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
370 { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
372 { data_type => "mediumtext", is_nullable => 1 },
374 { data_type => "varchar", is_nullable => 1, size => 30 },
376 { data_type => "smallint", is_nullable => 1 },
378 { data_type => "varchar", is_nullable => 1, size => 10 },
380 { data_type => "decimal", is_nullable => 1, size => [28, 6] },
382 { data_type => "decimal", is_nullable => 1, size => [28, 6] },
389 =item * L</suggestionid>
395 __PACKAGE__->set_primary_key("suggestionid");
403 Related object: L<Koha::Schema::Result::Borrower>
407 __PACKAGE__->belongs_to(
409 "Koha::Schema::Result::Borrower",
410 { borrowernumber => "acceptedby" },
414 on_delete => "SET NULL",
415 on_update => "CASCADE",
423 Related object: L<Koha::Schema::Result::Biblio>
427 __PACKAGE__->belongs_to(
429 "Koha::Schema::Result::Biblio",
430 { biblionumber => "biblionumber" },
434 on_delete => "SET NULL",
435 on_update => "CASCADE",
443 Related object: L<Koha::Schema::Result::Branch>
447 __PACKAGE__->belongs_to(
449 "Koha::Schema::Result::Branch",
450 { branchcode => "branchcode" },
454 on_delete => "SET NULL",
455 on_update => "CASCADE",
463 Related object: L<Koha::Schema::Result::Aqbudget>
467 __PACKAGE__->belongs_to(
469 "Koha::Schema::Result::Aqbudget",
470 { budget_id => "budgetid" },
474 on_delete => "SET NULL",
475 on_update => "CASCADE",
479 =head2 lastmodificationby
483 Related object: L<Koha::Schema::Result::Borrower>
487 __PACKAGE__->belongs_to(
488 "lastmodificationby",
489 "Koha::Schema::Result::Borrower",
490 { borrowernumber => "lastmodificationby" },
494 on_delete => "SET NULL",
495 on_update => "CASCADE",
503 Related object: L<Koha::Schema::Result::Borrower>
507 __PACKAGE__->belongs_to(
509 "Koha::Schema::Result::Borrower",
510 { borrowernumber => "managedby" },
514 on_delete => "SET NULL",
515 on_update => "CASCADE",
523 Related object: L<Koha::Schema::Result::Borrower>
527 __PACKAGE__->belongs_to(
529 "Koha::Schema::Result::Borrower",
530 { borrowernumber => "rejectedby" },
534 on_delete => "SET NULL",
535 on_update => "CASCADE",
543 Related object: L<Koha::Schema::Result::Borrower>
547 __PACKAGE__->belongs_to(
549 "Koha::Schema::Result::Borrower",
550 { borrowernumber => "suggestedby" },
554 on_delete => "SET NULL",
555 on_update => "CASCADE",
560 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29
561 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:3hkIGEbrTi7MUug0zjvyFg
563 __PACKAGE__->belongs_to(
565 "Koha::Schema::Result::Borrower",
566 { "foreign.borrowernumber" => "self.suggestedby" },
570 on_delete => "SET NULL",
571 on_update => "CASCADE",
575 __PACKAGE__->add_columns(
576 '+archived' => { is_boolean => 1 },
579 sub koha_objects_class {
583 sub koha_object_class {