@@ -, +, @@ credits - Do not automatically generate credit numbers. This is the current behaviour and the default syspref value. - Automatically generate credit numbers in the form -0001 (annual) - Automatically generate credit numbers in the form yyyymm0001 (branchyyyymmincr) where is the branch where the user (staff member) is logged in - Automatically generate credit numbers in the form 1, 2, 3 (incremental) column credit_number in table account-fines. It will be easier for testing that this credit has no number generated 1, 2, 3, ... '2020-0001', '2020-0002', ... 'BRANCHA2020020001', 'BRANCHA2020020002', ... (assuming you are connected to library BRANCHA, and it's February 2020) 'BRANCHB2020020001', 'BRANCHB2020020002', ... somewhere. Go back to Transactions tab and click on 'Print' for one line that has a credit number. Make sure the number is there. --- Koha/Account/Line.pm | 58 ++++++++++++++ Koha/Schema/Result/AccountCreditType.pm | 12 ++- Koha/Schema/Result/AccountDebitType.pm | 8 +- Koha/Schema/Result/AccountOffset.pm | 8 +- Koha/Schema/Result/Accountline.pm | 18 ++++- Koha/Schema/Result/ActionLog.pm | 8 +- Koha/Schema/Result/Aqbudget.pm | 8 +- Koha/Schema/Result/AqinvoiceAdjustment.pm | 8 +- Koha/Schema/Result/Aqorder.pm | 8 +- Koha/Schema/Result/AqordersItem.pm | 8 +- Koha/Schema/Result/AqordersTransfer.pm | 8 +- Koha/Schema/Result/ArticleRequest.pm | 8 +- Koha/Schema/Result/AuthHeader.pm | 8 +- Koha/Schema/Result/Biblio.pm | 23 +++++- Koha/Schema/Result/BiblioMetadata.pm | 8 +- Koha/Schema/Result/Biblioitem.pm | 8 +- Koha/Schema/Result/Borrower.pm | 16 ++-- Koha/Schema/Result/BorrowerDebarment.pm | 8 +- Koha/Schema/Result/BorrowerFile.pm | 8 +- Koha/Schema/Result/BorrowerModification.pm | 8 +- .../Schema/Result/BorrowerPasswordRecovery.pm | 8 +- Koha/Schema/Result/Club.pm | 8 +- Koha/Schema/Result/ClubEnrollment.pm | 8 +- Koha/Schema/Result/ClubHold.pm | 8 +- Koha/Schema/Result/ClubTemplate.pm | 8 +- Koha/Schema/Result/Course.pm | 8 +- Koha/Schema/Result/CourseItem.pm | 8 +- Koha/Schema/Result/CourseReserve.pm | 8 +- Koha/Schema/Result/CreatorBatch.pm | 8 +- Koha/Schema/Result/Currency.pm | 8 +- Koha/Schema/Result/Deletedbiblio.pm | 8 +- Koha/Schema/Result/DeletedbiblioMetadata.pm | 8 +- Koha/Schema/Result/Deletedbiblioitem.pm | 8 +- Koha/Schema/Result/Deletedborrower.pm | 8 +- Koha/Schema/Result/Deleteditem.pm | 8 +- Koha/Schema/Result/Illcomment.pm | 8 +- Koha/Schema/Result/Illrequest.pm | 8 +- Koha/Schema/Result/ImportBatch.pm | 8 +- Koha/Schema/Result/ImportRecord.pm | 8 +- Koha/Schema/Result/Issue.pm | 8 +- Koha/Schema/Result/Item.pm | 23 +++++- Koha/Schema/Result/ItemsLastBorrower.pm | 8 +- Koha/Schema/Result/LibraryGroup.pm | 8 +- Koha/Schema/Result/Message.pm | 8 +- Koha/Schema/Result/MessageQueue.pm | 8 +- Koha/Schema/Result/MiscFile.pm | 8 +- Koha/Schema/Result/NeedMergeAuthority.pm | 8 +- Koha/Schema/Result/OldIssue.pm | 8 +- Koha/Schema/Result/OldReserve.pm | 8 +- Koha/Schema/Result/OpacNews.pm | 8 +- Koha/Schema/Result/PendingOfflineOperation.pm | 8 +- Koha/Schema/Result/Rating.pm | 8 +- Koha/Schema/Result/RepeatableHoliday.pm | 13 ++- Koha/Schema/Result/Reserve.pm | 8 +- Koha/Schema/Result/SearchHistory.pm | 8 +- Koha/Schema/Result/SearchMarcToField.pm | 20 ++--- Koha/Schema/Result/Serial.pm | 11 +-- Koha/Schema/Result/SpecialHoliday.pm | 13 ++- Koha/Schema/Result/Subscriptionroutinglist.pm | 80 ++++++++----------- Koha/Schema/Result/Suggestion.pm | 8 +- Koha/Schema/Result/UploadedFile.pm | 8 +- Koha/Schema/Result/Virtualshelfcontent.pm | 8 +- Koha/Schema/Result/Virtualshelve.pm | 8 +- Koha/Schema/Result/Zebraqueue.pm | 8 +- admin/columns_settings.yml | 3 + .../data/mysql/atomicupdate/bug-19036.perl | 11 +++ installer/data/mysql/kohastructure.sql | 1 + installer/data/mysql/sysprefs.sql | 1 + .../modules/admin/preferences/accounting.pref | 7 ++ .../prog/en/modules/members/boraccount.tt | 4 +- t/db_dependent/Koha/Account.t | 50 +++++++++++- 71 files changed, 479 insertions(+), 309 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug-19036.perl --- a/Koha/Account/Line.pm +++ a/Koha/Account/Line.pm @@ -762,6 +762,64 @@ sub to_api_mapping { }; } +=head3 store + +Specific store method to generate credit number before saving + +=cut + +sub store { + my ($self) = @_; + + my $AutoCreditNumber = C4::Context->preference('AutoCreditNumber'); + if ($AutoCreditNumber && !$self->in_storage && $self->is_credit && !$self->credit_number) { + my $rs = Koha::Database->new->schema->resultset($self->_type); + + if ($AutoCreditNumber eq 'incremental') { + my $max = $rs->search({ + credit_number => { -regexp => '^[0-9]+$' } + }, { + select => \'CAST(credit_number AS UNSIGNED)', + as => ['credit_number'], + })->get_column('credit_number')->max; + $max //= 0; + $self->credit_number($max + 1); + } elsif ($AutoCreditNumber eq 'annual') { + my $now = DateTime->now; + my $prefix = sprintf('%d-', $now->year); + my $max = $rs->search({ + -and => [ + credit_number => { -regexp => '[0-9]{4}$' }, + credit_number => { -like => "$prefix%" }, + ], + })->get_column('credit_number')->max; + $max //= $prefix . '0000'; + my $incr = substr($max, length $prefix); + $self->credit_number(sprintf('%s%04d', $prefix, $incr + 1)); + } elsif ($AutoCreditNumber eq 'branchyyyymmincr') { + my $userenv = C4::Context->userenv; + if ($userenv) { + my $branch = $userenv->{branch}; + my $now = DateTime->now; + my $prefix = sprintf('%s%d%02d', $branch, $now->year, $now->month); + my $pattern = $prefix; + $pattern =~ s/([\?%_])/\\$1/g; + my $max = $rs->search({ + -and => [ + credit_number => { -regexp => '[0-9]{4}$' }, + credit_number => { -like => "$pattern%" }, + ], + })->get_column('credit_number')->max; + $max //= $prefix . '0000'; + my $incr = substr($max, length $prefix); + $self->credit_number(sprintf('%s%04d', $prefix, $incr + 1)); + } + } + } + + return $self->SUPER::store(); +} + =head2 Internal methods =cut --- a/Koha/Schema/Result/AccountCreditType.pm +++ a/Koha/Schema/Result/AccountCreditType.pm @@ -47,6 +47,12 @@ __PACKAGE__->table("account_credit_types"); default_value: 0 is_nullable: 0 +=head2 archived + + data_type: 'tinyint' + default_value: 0 + is_nullable: 0 + =cut __PACKAGE__->add_columns( @@ -58,6 +64,8 @@ __PACKAGE__->add_columns( { data_type => "tinyint", default_value => 1, is_nullable => 0 }, "is_system", { data_type => "tinyint", default_value => 0, is_nullable => 0 }, + "archived", + { data_type => "tinyint", default_value => 0, is_nullable => 0 }, ); =head1 PRIMARY KEY @@ -105,8 +113,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-14 09:59:52 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Uycu/23b681kWHNX+/gNiw +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9tQSTkjAGqGikbWnbBhlgw __PACKAGE__->add_columns( '+is_system' => { is_boolean => 1 } --- a/Koha/Schema/Result/AccountDebitType.pm +++ a/Koha/Schema/Result/AccountDebitType.pm @@ -45,7 +45,7 @@ __PACKAGE__->table("account_debit_types"); data_type: 'tinyint' default_value: 0 - is_nullable: 0 + is_nullable: 1 =head2 default_amount @@ -75,7 +75,7 @@ __PACKAGE__->add_columns( "can_be_invoiced", { data_type => "tinyint", default_value => 1, is_nullable => 0 }, "can_be_sold", - { data_type => "tinyint", default_value => 0, is_nullable => 0 }, + { data_type => "tinyint", default_value => 0, is_nullable => 1 }, "default_amount", { data_type => "decimal", is_nullable => 1, size => [28, 6] }, "is_system", @@ -129,8 +129,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-17 12:22:04 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:8FIMJZ+JAmqa+Dx7oymBjw +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:qZfg9L2ysl2pJUiaBLwUFg __PACKAGE__->add_columns( '+is_system' => { is_boolean => 1 } --- a/Koha/Schema/Result/AccountOffset.pm +++ a/Koha/Schema/Result/AccountOffset.pm @@ -58,7 +58,7 @@ __PACKAGE__->table("account_offsets"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =cut @@ -78,7 +78,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, ); @@ -153,8 +153,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-10-20 16:27:04 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:tPPrIug2c7PbDO7LCxCJAA +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:mfS1B79dpfPc8VGdjT1+YA sub koha_object_class { 'Koha::Account::Offset'; --- a/Koha/Schema/Result/Accountline.pm +++ a/Koha/Schema/Result/Accountline.pm @@ -77,6 +77,14 @@ __PACKAGE__->table("accountlines"); is_nullable: 1 size: 80 +=head2 credit_number + + data_type: 'varchar' + is_nullable: 1 + size: 20 + +autogenerated number for credits + =head2 status data_type: 'varchar' @@ -99,7 +107,7 @@ __PACKAGE__->table("accountlines"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 note @@ -153,6 +161,8 @@ __PACKAGE__->add_columns( { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 80 }, "debit_type_code", { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 80 }, + "credit_number", + { data_type => "varchar", is_nullable => 1, size => 20 }, "status", { data_type => "varchar", is_nullable => 1, size => 16 }, "payment_type", @@ -163,7 +173,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "note", @@ -363,8 +373,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-24 16:33:42 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:q4Ahb8xIxAsjT/aF9yjrdQ +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:uFM5Kclu6Vw6ui+1A/RXsQ sub koha_objects_class { 'Koha::Account::Lines'; --- a/Koha/Schema/Result/ActionLog.pm +++ a/Koha/Schema/Result/ActionLog.pm @@ -33,7 +33,7 @@ __PACKAGE__->table("action_logs"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 user @@ -77,7 +77,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "user", @@ -107,8 +107,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("action_id"); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:53 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:VVXBchLYkj+S+lLhl7bKgw +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:TmMQtaJ4596Tj8mYKvZffA # You can replace this text with custom code or comments, and it will be preserved on regeneration --- a/Koha/Schema/Result/Aqbudget.pm +++ a/Koha/Schema/Result/Aqbudget.pm @@ -82,7 +82,7 @@ __PACKAGE__->table("aqbudgets"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 budget_period_id @@ -153,7 +153,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "budget_period_id", @@ -298,8 +298,8 @@ Composing rels: L -> borrowernumber __PACKAGE__->many_to_many("borrowernumbers", "aqbudgetborrowers", "borrowernumber"); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-07-16 13:50:45 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zB7ox8a4KdDGq5fsbQfLGQ +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:wbXfOXiR6q7jVleJyzsLWQ sub koha_object_class { --- a/Koha/Schema/Result/AqinvoiceAdjustment.pm +++ a/Koha/Schema/Result/AqinvoiceAdjustment.pm @@ -68,7 +68,7 @@ __PACKAGE__->table("aqinvoice_adjustments"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =cut @@ -92,7 +92,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, ); @@ -147,8 +147,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-07-19 17:32:57 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jl0qxkZWVs2D1pi3kaRjpg +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:V0/9Hi5Uc9L2AnWcdzDn4g sub koha_object_class { 'Koha::Acquisition::Invoice::Adjustment'; --- a/Koha/Schema/Result/Aqorder.pm +++ a/Koha/Schema/Result/Aqorder.pm @@ -143,7 +143,7 @@ __PACKAGE__->table("aqorders"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 rrp @@ -371,7 +371,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "rrp", @@ -661,8 +661,8 @@ Composing rels: L -> borrowernumber __PACKAGE__->many_to_many("borrowernumbers", "aqorder_users", "borrowernumber"); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-08-31 11:51:37 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GQEXetlivZm7buQohl8m4A +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xXgooImZVlFvUzSJXHPWhQ __PACKAGE__->belongs_to( "basket", --- a/Koha/Schema/Result/AqordersItem.pm +++ a/Koha/Schema/Result/AqordersItem.pm @@ -38,7 +38,7 @@ __PACKAGE__->table("aqorders_items"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =cut @@ -52,7 +52,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, ); @@ -87,8 +87,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hvDuLTY3idYc1ujykNDrPQ +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:FLVvGzsei1T0NsB5+ubnXw # You can replace this text with custom content, and it will be preserved on regeneration --- a/Koha/Schema/Result/AqordersTransfer.pm +++ a/Koha/Schema/Result/AqordersTransfer.pm @@ -39,7 +39,7 @@ __PACKAGE__->table("aqorders_transfers"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =cut @@ -53,7 +53,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, ); @@ -127,8 +127,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Z6+vESlzZKjZloNvrEHpxA +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:FqlytCU3bCmEDqWkOm2uuw # You can replace this text with custom code or comments, and it will be preserved on regeneration --- a/Koha/Schema/Result/ArticleRequest.pm +++ a/Koha/Schema/Result/ArticleRequest.pm @@ -110,7 +110,7 @@ __PACKAGE__->table("article_requests"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 updated_on @@ -161,7 +161,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "updated_on", @@ -257,8 +257,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:53 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:BOBB3vld8wY75u45YldoEg +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:DZfgssb5lWBwXAQD4yFX2g # You can replace this text with custom code or comments, and it will be preserved on regeneration --- a/Koha/Schema/Result/AuthHeader.pm +++ a/Koha/Schema/Result/AuthHeader.pm @@ -47,7 +47,7 @@ __PACKAGE__->table("auth_header"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 origincode @@ -94,7 +94,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "origincode", @@ -122,8 +122,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("authid"); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:53 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:kHEdfMFYFtn3sQ20qsdFyg +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:78YWjMUi8plOllaNMWzmuw sub koha_object_class { 'Koha::Authority'; --- a/Koha/Schema/Result/Biblio.pm +++ a/Koha/Schema/Result/Biblio.pm @@ -95,7 +95,7 @@ __PACKAGE__->table("biblio"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 datecreated @@ -142,7 +142,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "datecreated", @@ -285,6 +285,21 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 items_bundle + +Type: might_have + +Related object: L + +=cut + +__PACKAGE__->might_have( + "items_bundle", + "Koha::Schema::Result::ItemsBundle", + { "foreign.biblionumber" => "self.biblionumber" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 old_reserves Type: has_many @@ -406,8 +421,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-01 07:08:47 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:otCex8qzJmZyc+JXpKNdpQ +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:swuobxQgc+thlB/K+3QZeA __PACKAGE__->has_one( --- a/Koha/Schema/Result/BiblioMetadata.pm +++ a/Koha/Schema/Result/BiblioMetadata.pm @@ -56,7 +56,7 @@ __PACKAGE__->table("biblio_metadata"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =cut @@ -76,7 +76,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, ); @@ -132,8 +132,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-01-30 11:34:16 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:FJk/YOw8Y/QRmmPPL3G5qQ +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:5mMqx4y01pZfu8YrNvXDTQ sub koha_object_class { 'Koha::Biblio::Metadata'; --- a/Koha/Schema/Result/Biblioitem.pm +++ a/Koha/Schema/Result/Biblioitem.pm @@ -118,7 +118,7 @@ __PACKAGE__->table("biblioitems"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 illus @@ -248,7 +248,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "illus", @@ -326,8 +326,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:53 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ogVRTKNaUQSI3BE2xC2lww +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Anhy+pvrQlPufkbe5qsJsQ __PACKAGE__->belongs_to( biblio => "Koha::Schema::Result::Biblio", "biblionumber" ); --- a/Koha/Schema/Result/Borrower.pm +++ a/Koha/Schema/Result/Borrower.pm @@ -425,7 +425,7 @@ __PACKAGE__->table("borrowers"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 lastseen @@ -640,7 +640,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "lastseen", @@ -1429,17 +1429,17 @@ __PACKAGE__->belongs_to( }, ); -=head2 subscriptionroutinglists +=head2 subscriptionroutings Type: has_many -Related object: L +Related object: L =cut __PACKAGE__->has_many( - "subscriptionroutinglists", - "Koha::Schema::Result::Subscriptionroutinglist", + "subscriptionroutings", + "Koha::Schema::Result::Subscriptionrouting", { "foreign.borrowernumber" => "self.borrowernumber" }, { cascade_copy => 0, cascade_delete => 0 }, ); @@ -1635,8 +1635,8 @@ Composing rels: L -> ordernumber __PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber"); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-10 14:31:00 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GjJLIOViIFRm185Yjl9vYA +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9Ekh2ybmnaY+m5FxB7U6mQ __PACKAGE__->add_columns( '+anonymized' => { is_boolean => 1 }, --- a/Koha/Schema/Result/BorrowerDebarment.pm +++ a/Koha/Schema/Result/BorrowerDebarment.pm @@ -62,7 +62,7 @@ __PACKAGE__->table("borrower_debarments"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 updated @@ -95,7 +95,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "updated", @@ -136,8 +136,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:53 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:J9J1ReRLqhVasOQXvde2Uw +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:tOAoFYn0a6MZgtvoFS15xQ # You can replace this text with custom code or comments, and it will be preserved on regeneration --- a/Koha/Schema/Result/BorrowerFile.pm +++ a/Koha/Schema/Result/BorrowerFile.pm @@ -62,7 +62,7 @@ __PACKAGE__->table("borrower_files"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =cut @@ -84,7 +84,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, ); @@ -119,8 +119,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sbkf7bvdO4CgmiBLgIwYQg +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CRCwGgDaSvO7nc4Nkyb3Cw # You can replace this text with custom content, and it will be preserved on regeneration --- a/Koha/Schema/Result/BorrowerModification.pm +++ a/Koha/Schema/Result/BorrowerModification.pm @@ -27,7 +27,7 @@ __PACKAGE__->table("borrower_modifications"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 verification_token @@ -428,7 +428,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "verification_token", @@ -610,8 +610,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("verification_token", "borrowernumber"); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-07-22 16:54:42 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jkZUTN+mGIdp8ySV0BYNTw +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:kwyyiaDxYxdTaYEdcEX8yg sub koha_object_class { 'Koha::Patron::Modification'; --- a/Koha/Schema/Result/BorrowerPasswordRecovery.pm +++ a/Koha/Schema/Result/BorrowerPasswordRecovery.pm @@ -38,7 +38,7 @@ __PACKAGE__->table("borrower_password_recovery"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =cut @@ -52,7 +52,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, ); @@ -70,8 +70,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("borrowernumber"); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2016-01-22 10:16:52 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:c4ehAGqOD6YHpGg85BX8YQ +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:rQvacObXzIDRx+cnDgX6uA # You can replace this text with custom code or comments, and it will be preserved on regeneration --- a/Koha/Schema/Result/Club.pm +++ a/Koha/Schema/Result/Club.pm @@ -68,7 +68,7 @@ __PACKAGE__->table("clubs"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 date_updated @@ -98,7 +98,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "date_updated", @@ -204,8 +204,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-01 07:08:47 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WbB7PSSU4xaszsKe9Eacqw +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:q0tsXoANaJ0laHSyzhvWBg # You can replace this text with custom content, and it will be preserved on regeneration --- a/Koha/Schema/Result/ClubEnrollment.pm +++ a/Koha/Schema/Result/ClubEnrollment.pm @@ -45,7 +45,7 @@ __PACKAGE__->table("club_enrollments"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 date_canceled @@ -86,7 +86,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "date_canceled", @@ -191,8 +191,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-12 17:59:47 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Ih/HQM4KIRDZ0ESXVR9FwA +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:BGc4RqbBSCR6uniY1/ra4Q sub koha_object_class { 'Koha::Club::Enrollment'; --- a/Koha/Schema/Result/ClubHold.pm +++ a/Koha/Schema/Result/ClubHold.pm @@ -51,7 +51,7 @@ __PACKAGE__->table("club_holds"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =cut @@ -69,7 +69,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, ); @@ -154,8 +154,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-01 07:08:47 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:FYGXVx1P2R+dGbeP1xshPA +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ccFlKbTvIRs4u01E8qqnRg sub koha_objects_class { 'Koha::Club::Holds'; --- a/Koha/Schema/Result/ClubTemplate.pm +++ a/Koha/Schema/Result/ClubTemplate.pm @@ -62,7 +62,7 @@ __PACKAGE__->table("club_templates"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 date_updated @@ -96,7 +96,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "date_updated", @@ -189,8 +189,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:53 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1UuejI9kkTb9eeNKvSLAQQ +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:YUzYhnCe19rp6VL0cJZQvA sub koha_object_class { 'Koha::Club::Template'; --- a/Koha/Schema/Result/Course.pm +++ a/Koha/Schema/Result/Course.pm @@ -86,7 +86,7 @@ __PACKAGE__->table("courses"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =cut @@ -121,7 +121,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, ); @@ -181,8 +181,8 @@ Composing rels: L -> borrowernumber __PACKAGE__->many_to_many("borrowernumbers", "course_instructors", "borrowernumber"); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:53 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:o0EBOuJCHxH5IG/PgsJfxg +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:yeukLUSqlLJNVHxKDC7HOQ # You can replace this text with custom content, and it will be preserved on regeneration --- a/Koha/Schema/Result/CourseItem.pm +++ a/Koha/Schema/Result/CourseItem.pm @@ -71,7 +71,7 @@ __PACKAGE__->table("course_items"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =cut @@ -100,7 +100,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, ); @@ -184,8 +184,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-09-26 16:15:09 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0hBp2R7AMxgHLLZcG/676w +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:VcUbKGA6rEwIg4cRse4fEg # You can replace this text with custom content, and it will be preserved on regeneration --- a/Koha/Schema/Result/CourseReserve.pm +++ a/Koha/Schema/Result/CourseReserve.pm @@ -55,7 +55,7 @@ __PACKAGE__->table("course_reserves"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =cut @@ -75,7 +75,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, ); @@ -141,8 +141,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:53 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:8SDdUrbxKuAwp6rgn85RmA +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ocHPOi2tze1PQCzzw9qY5w # You can replace this text with custom content, and it will be preserved on regeneration --- a/Koha/Schema/Result/CreatorBatch.pm +++ a/Koha/Schema/Result/CreatorBatch.pm @@ -56,7 +56,7 @@ __PACKAGE__->table("creator_batches"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 branch_code @@ -91,7 +91,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "branch_code", @@ -181,8 +181,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-10-24 17:34:29 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:5SOMkaJ6IxGtnqtPVFpNtg +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:g3vD+wvEsI0GBWyvSMEFqg # You can replace this text with custom content, and it will be preserved on regeneration --- a/Koha/Schema/Result/Currency.pm +++ a/Koha/Schema/Result/Currency.pm @@ -46,7 +46,7 @@ __PACKAGE__->table("currency"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 rate @@ -85,7 +85,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "rate", @@ -158,8 +158,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-01 14:23:58 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:PnJEcCgrM1Edf99phWFdyQ +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:YaSxkG7ZGqegVkIif7NDjQ sub koha_object_class { --- a/Koha/Schema/Result/Deletedbiblio.pm +++ a/Koha/Schema/Result/Deletedbiblio.pm @@ -95,7 +95,7 @@ __PACKAGE__->table("deletedbiblio"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 datecreated @@ -142,7 +142,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "datecreated", @@ -181,8 +181,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-08-05 13:53:34 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:FQaznWmkfR2Ge5NG8lDmSw +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9Xm2vadUVskBiHj/Ex84Sg sub koha_objects_class { 'Koha::Old::Biblios'; --- a/Koha/Schema/Result/DeletedbiblioMetadata.pm +++ a/Koha/Schema/Result/DeletedbiblioMetadata.pm @@ -56,7 +56,7 @@ __PACKAGE__->table("deletedbiblio_metadata"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =cut @@ -76,7 +76,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, ); @@ -132,8 +132,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-01-30 11:34:16 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:JCOh+FSSTgPlC8lMJOdOOA +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:nIqHgwWZQKbGDIGTwNcR9w # You can replace this text with custom code or comments, and it will be preserved on regeneration --- a/Koha/Schema/Result/Deletedbiblioitem.pm +++ a/Koha/Schema/Result/Deletedbiblioitem.pm @@ -117,7 +117,7 @@ __PACKAGE__->table("deletedbiblioitems"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 illus @@ -242,7 +242,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "illus", @@ -288,8 +288,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("biblioitemnumber"); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:53 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QLYBa1Ea8Jau2Wy6U+wyQw +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:A8v0vpPFLetnTSuMAb6SYA sub koha_objects_class { 'Koha::Old::Biblioitems'; --- a/Koha/Schema/Result/Deletedborrower.pm +++ a/Koha/Schema/Result/Deletedborrower.pm @@ -422,7 +422,7 @@ __PACKAGE__->table("deletedborrowers"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 lastseen @@ -625,7 +625,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "lastseen", @@ -650,8 +650,8 @@ __PACKAGE__->add_columns( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-05-22 04:33:29 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zK1jC6Wawwj8B2ch9KFByw +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:4FJOURzbg7/amSUXECLJsQ sub koha_objects_class { 'Koha::Old::Patrons'; --- a/Koha/Schema/Result/Deleteditem.pm +++ a/Koha/Schema/Result/Deleteditem.pm @@ -198,7 +198,7 @@ __PACKAGE__->table("deleteditems"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 location @@ -360,7 +360,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "location", @@ -406,8 +406,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("itemnumber"); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-02-17 10:42:24 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1+z3OHx5OpOcP82k8vyAaA +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:d5Keiv9fRJlOT27yRtMX2w sub koha_objects_class { 'Koha::Old::Items'; --- a/Koha/Schema/Result/Illcomment.pm +++ a/Koha/Schema/Result/Illcomment.pm @@ -51,7 +51,7 @@ __PACKAGE__->table("illcomments"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =cut @@ -74,7 +74,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, ); @@ -129,8 +129,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-10-26 19:57:17 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:JJC9ohn0V61+WzMppDKUJw +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:taV0nPCmNLIflefOr5YMKQ # You can replace this text with custom code or comments, and it will be preserved on regeneration --- a/Koha/Schema/Result/Illrequest.pm +++ a/Koha/Schema/Result/Illrequest.pm @@ -77,7 +77,7 @@ __PACKAGE__->table("illrequests"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 completed @@ -160,7 +160,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "completed", @@ -283,8 +283,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-02-22 14:32:49 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:I6fY8XRfEmRxSzOeVT9Krw +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:drrFZCJQY+kKFxek3IBvUQ # You can replace this text with custom code or comments, and it will be preserved on regeneration --- a/Koha/Schema/Result/ImportBatch.pm +++ a/Koha/Schema/Result/ImportBatch.pm @@ -61,7 +61,7 @@ __PACKAGE__->table("import_batches"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 overlay_action @@ -136,7 +136,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "overlay_action", @@ -235,8 +235,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:53 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:41giNJCRD9WXC4IGO/1D3A +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GmVg9yizOZg8hY8RKoKtEQ # You can replace this text with custom content, and it will be preserved on regeneration --- a/Koha/Schema/Result/ImportRecord.pm +++ a/Koha/Schema/Result/ImportRecord.pm @@ -51,7 +51,7 @@ __PACKAGE__->table("import_records"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 import_date @@ -123,7 +123,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "import_date", @@ -262,8 +262,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-04-18 10:50:48 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:bqIAQzhgioWtBWU8zFdtjw +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jKLkfH2mLNE5UpMT/ZnbEA # You can replace this text with custom content, and it will be preserved on regeneration --- a/Koha/Schema/Result/Issue.pm +++ a/Koha/Schema/Result/Issue.pm @@ -87,7 +87,7 @@ __PACKAGE__->table("issues"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 issuedate @@ -157,7 +157,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "issuedate", @@ -264,8 +264,8 @@ __PACKAGE__->might_have( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-31 12:18:38 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QVmFa5b0Pe5OhUI92n9kzQ +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Uu7Hv8HiASn3H6me2YHx1A __PACKAGE__->add_columns( '+auto_renew' => { is_boolean => 1 }, --- a/Koha/Schema/Result/Item.pm +++ a/Koha/Schema/Result/Item.pm @@ -202,7 +202,7 @@ __PACKAGE__->table("items"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 location @@ -374,7 +374,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "location", @@ -625,6 +625,21 @@ __PACKAGE__->might_have( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 items_bundle_item + +Type: might_have + +Related object: L + +=cut + +__PACKAGE__->might_have( + "items_bundle_item", + "Koha::Schema::Result::ItemsBundleItem", + { "foreign.itemnumber" => "self.itemnumber" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 items_last_borrower Type: might_have @@ -746,8 +761,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-02-17 10:42:24 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CcrMhgq+PQ1MHV6jZEN8wA +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2OAwCv4uG2OqDkHGrMQlbw __PACKAGE__->belongs_to( biblioitem => "Koha::Schema::Result::Biblioitem", "biblioitemnumber" ); --- a/Koha/Schema/Result/ItemsLastBorrower.pm +++ a/Koha/Schema/Result/ItemsLastBorrower.pm @@ -45,7 +45,7 @@ __PACKAGE__->table("items_last_borrower"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =cut @@ -61,7 +61,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, ); @@ -125,8 +125,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07040 @ 2015-10-02 12:33:33 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ByHKNZCEz4a1AqTnOJgUWA +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:uKe825x+YA0n7O8HxdC0BA # You can replace this text with custom code or comments, and it will be preserved on regeneration --- a/Koha/Schema/Result/LibraryGroup.pm +++ a/Koha/Schema/Result/LibraryGroup.pm @@ -87,7 +87,7 @@ __PACKAGE__->table("library_groups"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =cut @@ -121,7 +121,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, ); @@ -224,8 +224,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-01-30 15:43:39 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:qg0Ckj0ZBRjSaQgEcvxSZA +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:cgoo1VFsYRC2VPqVu613NQ sub koha_object_class { 'Koha::Library::Group'; --- a/Koha/Schema/Result/Message.pm +++ a/Koha/Schema/Result/Message.pm @@ -56,7 +56,7 @@ __PACKAGE__->table("messages"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 manager_id @@ -82,7 +82,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "manager_id", @@ -139,8 +139,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-02-15 13:15:09 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:kYM+0CFPm/wdNp7EosdlRw +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Czgoljvkzbs8ta0hXTxqMA sub koha_object_class { 'Koha::Patron::Message'; --- a/Koha/Schema/Result/MessageQueue.pm +++ a/Koha/Schema/Result/MessageQueue.pm @@ -80,7 +80,7 @@ __PACKAGE__->table("message_queue"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 to_address @@ -132,7 +132,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "to_address", @@ -193,8 +193,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-02-05 14:26:34 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:fSWIVVJGliKtqQaNbmZKYQ +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0L+d9pWy9VZz2uwJsQNB7Q sub koha_object_class { 'Koha::Notice::Message'; --- a/Koha/Schema/Result/MiscFile.pm +++ a/Koha/Schema/Result/MiscFile.pm @@ -67,7 +67,7 @@ __PACKAGE__->table("misc_files"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =cut @@ -91,7 +91,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, ); @@ -109,8 +109,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("file_id"); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2014-05-25 21:17:02 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:VWGyKXxK0dqymMsEGCjJxg +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QPuF+Cb4BVGp2rqB18JWnw # You can replace this text with custom code or comments, and it will be preserved on regeneration --- a/Koha/Schema/Result/NeedMergeAuthority.pm +++ a/Koha/Schema/Result/NeedMergeAuthority.pm @@ -48,7 +48,7 @@ __PACKAGE__->table("need_merge_authorities"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 done @@ -72,7 +72,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "done", @@ -92,8 +92,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("id"); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:54 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7LzwIYvExKvNgr8/HDZlsg +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:m8L0rNMzZk0cLGj2LFEDwA sub koha_object_class { 'Koha::Authority::MergeRequest'; --- a/Koha/Schema/Result/OldIssue.pm +++ a/Koha/Schema/Result/OldIssue.pm @@ -86,7 +86,7 @@ __PACKAGE__->table("old_issues"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 issuedate @@ -156,7 +156,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "issuedate", @@ -234,8 +234,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-04-10 19:55:44 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:E2N2paWcCHg916100ry+2A +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:aRRi1sRKr7IguXs8IvIoDw __PACKAGE__->add_columns( '+auto_renew' => { is_boolean => 1 }, --- a/Koha/Schema/Result/OldReserve.pm +++ a/Koha/Schema/Result/OldReserve.pm @@ -90,7 +90,7 @@ __PACKAGE__->table("old_reserves"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 itemnumber @@ -172,7 +172,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "itemnumber", @@ -297,8 +297,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-06-17 07:24:39 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZgGAW7ODBby3hGNJ41eeMA +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:I4D3WJSvd7KTyWF+9M4D4w sub koha_object_class { 'Koha::Old::Hold'; --- a/Koha/Schema/Result/OpacNews.pm +++ a/Koha/Schema/Result/OpacNews.pm @@ -60,7 +60,7 @@ __PACKAGE__->table("opac_news"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 expirationdate @@ -102,7 +102,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "expirationdate", @@ -168,8 +168,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:54 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:gApTRM/dF6uZSMYyvkt4OQ +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:gkBxrFM46U1oEQDXahQxMA sub koha_object_class { 'Koha::NewsItem'; --- a/Koha/Schema/Result/PendingOfflineOperation.pm +++ a/Koha/Schema/Result/PendingOfflineOperation.pm @@ -45,7 +45,7 @@ __PACKAGE__->table("pending_offline_operations"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 action @@ -85,7 +85,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "action", @@ -111,8 +111,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("operationid"); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-10-27 13:24:06 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:EA2gwvRWvFVCPyIB94jCdw +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:kd5wVqCpZO7PRNMlAvSeJw # You can replace this text with custom content, and it will be preserved on regeneration --- a/Koha/Schema/Result/Rating.pm +++ a/Koha/Schema/Result/Rating.pm @@ -44,7 +44,7 @@ __PACKAGE__->table("ratings"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =cut @@ -60,7 +60,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, ); @@ -112,8 +112,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:YT3jPQbA2TBuOuUXfEt7gQ +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:01Smg8hro7ZNrATvWSxsVQ # You can replace this text with custom content, and it will be preserved on regeneration --- a/Koha/Schema/Result/RepeatableHoliday.pm +++ a/Koha/Schema/Result/RepeatableHoliday.pm @@ -32,6 +32,7 @@ __PACKAGE__->table("repeatable_holidays"); =head2 branchcode data_type: 'varchar' + default_value: (empty string) is_foreign_key: 1 is_nullable: 0 size: 10 @@ -69,7 +70,13 @@ __PACKAGE__->add_columns( "id", { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, "branchcode", - { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 }, + { + data_type => "varchar", + default_value => "", + is_foreign_key => 1, + is_nullable => 0, + size => 10, + }, "weekday", { data_type => "smallint", is_nullable => 1 }, "day", @@ -112,8 +119,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-01-20 13:57:27 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:bBw2WEvzF5sX+AOteNsPPQ +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:wiRQ/s8GNyqViiJmG3HMRQ # You can replace this text with custom content, and it will be preserved on regeneration --- a/Koha/Schema/Result/Reserve.pm +++ a/Koha/Schema/Result/Reserve.pm @@ -94,7 +94,7 @@ __PACKAGE__->table("reserves"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 itemnumber @@ -186,7 +186,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "itemnumber", @@ -336,8 +336,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-01 07:08:48 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Pc5zh5iFbdwko5KS51Y9Uw +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jZhq1NVVcesKshzQvWopuw __PACKAGE__->belongs_to( "item", --- a/Koha/Schema/Result/SearchHistory.pm +++ a/Koha/Schema/Result/SearchHistory.pm @@ -67,7 +67,7 @@ __PACKAGE__->table("search_history"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =cut @@ -96,7 +96,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, ); @@ -114,8 +114,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("id"); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:54 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:d+Qf8sL7wLldvw2qPLoBgQ +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:VMVGSV8eY1KTpJVv0Nm5lA # You can replace this text with custom content, and it will be preserved on regeneration --- a/Koha/Schema/Result/SearchMarcToField.pm +++ a/Koha/Schema/Result/SearchMarcToField.pm @@ -23,12 +23,6 @@ __PACKAGE__->table("search_marc_to_field"); =head1 ACCESSORS -=head2 search - - data_type: 'tinyint' - default_value: 1 - is_nullable: 0 - =head2 search_marc_map_id data_type: 'integer' @@ -64,11 +58,15 @@ true if this field can be used to generate suggestions for browse true/false creates special sort handling, null doesn't +=head2 search + + data_type: 'tinyint' + default_value: 1 + is_nullable: 0 + =cut __PACKAGE__->add_columns( - "search", - { data_type => "tinyint", default_value => 1, is_nullable => 0 }, "search_marc_map_id", { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, "search_field_id", @@ -79,6 +77,8 @@ __PACKAGE__->add_columns( { data_type => "tinyint", default_value => 0, is_nullable => 1 }, "sort", { data_type => "tinyint", is_nullable => 1 }, + "search", + { data_type => "tinyint", default_value => 1, is_nullable => 0 }, ); =head1 PRIMARY KEY @@ -128,8 +128,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-02 12:47:22 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9mqZ/zrii+Fv+k+eQNHYUw +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:NH2gQdc4p5gyGwbKuXIlkQ # You can replace this text with custom code or comments, and it will be preserved on regeneration --- a/Koha/Schema/Result/Serial.pm +++ a/Koha/Schema/Result/Serial.pm @@ -109,11 +109,6 @@ __PACKAGE__->table("serial"); default_value: 0 is_nullable: 1 -=head2 routingnotes - - data_type: 'mediumtext' - is_nullable: 1 - =cut __PACKAGE__->add_columns( @@ -145,8 +140,6 @@ __PACKAGE__->add_columns( { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, "claims_count", { data_type => "integer", default_value => 0, is_nullable => 1 }, - "routingnotes", - { data_type => "mediumtext", is_nullable => 1 }, ); =head1 PRIMARY KEY @@ -179,8 +172,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:54 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sRygXoIOnqpdk0lqVMcBdA +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:p5Ds0c7eiE3KTmFDHVMxqQ # You can replace this text with custom code or comments, and it will be preserved on regeneration --- a/Koha/Schema/Result/SpecialHoliday.pm +++ a/Koha/Schema/Result/SpecialHoliday.pm @@ -32,6 +32,7 @@ __PACKAGE__->table("special_holidays"); =head2 branchcode data_type: 'varchar' + default_value: (empty string) is_foreign_key: 1 is_nullable: 0 size: 10 @@ -78,7 +79,13 @@ __PACKAGE__->add_columns( "id", { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, "branchcode", - { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 }, + { + data_type => "varchar", + default_value => "", + is_foreign_key => 1, + is_nullable => 0, + size => 10, + }, "day", { data_type => "smallint", default_value => 0, is_nullable => 0 }, "month", @@ -123,8 +130,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-01-20 13:57:27 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:cj8Oveni0l6kAR/azmw4SA +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:M1IWe2I5Gam4ItJoHeNntA # You can replace this text with custom content, and it will be preserved on regeneration --- a/Koha/Schema/Result/Subscriptionroutinglist.pm +++ a/Koha/Schema/Result/Subscriptionroutinglist.pm @@ -23,105 +23,89 @@ __PACKAGE__->table("subscriptionroutinglist"); =head1 ACCESSORS -=head2 routingid +=head2 routinglistid data_type: 'integer' is_auto_increment: 1 is_nullable: 0 -=head2 borrowernumber +=head2 subscriptionid data_type: 'integer' is_foreign_key: 1 is_nullable: 0 -=head2 ranking +=head2 title - data_type: 'integer' - is_nullable: 1 + data_type: 'varchar' + is_nullable: 0 + size: 256 -=head2 subscriptionid +=head2 notes - data_type: 'integer' - is_foreign_key: 1 - is_nullable: 0 + data_type: 'text' + is_nullable: 1 =cut __PACKAGE__->add_columns( - "routingid", + "routinglistid", { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, - "borrowernumber", - { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, - "ranking", - { data_type => "integer", is_nullable => 1 }, "subscriptionid", { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "title", + { data_type => "varchar", is_nullable => 0, size => 256 }, + "notes", + { data_type => "text", is_nullable => 1 }, ); =head1 PRIMARY KEY =over 4 -=item * L +=item * L =back =cut -__PACKAGE__->set_primary_key("routingid"); - -=head1 UNIQUE CONSTRAINTS - -=head2 C - -=over 4 - -=item * L - -=item * L - -=back - -=cut - -__PACKAGE__->add_unique_constraint("subscriptionid", ["subscriptionid", "borrowernumber"]); +__PACKAGE__->set_primary_key("routinglistid"); =head1 RELATIONS -=head2 borrowernumber +=head2 subscriptionid Type: belongs_to -Related object: L +Related object: L =cut __PACKAGE__->belongs_to( - "borrowernumber", - "Koha::Schema::Result::Borrower", - { borrowernumber => "borrowernumber" }, - { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, + "subscriptionid", + "Koha::Schema::Result::Subscription", + { subscriptionid => "subscriptionid" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, ); -=head2 subscriptionid +=head2 subscriptionroutings -Type: belongs_to +Type: has_many -Related object: L +Related object: L =cut -__PACKAGE__->belongs_to( - "subscriptionid", - "Koha::Schema::Result::Subscription", - { subscriptionid => "subscriptionid" }, - { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +__PACKAGE__->has_many( + "subscriptionroutings", + "Koha::Schema::Result::Subscriptionrouting", + { "foreign.routinglistid" => "self.routinglistid" }, + { cascade_copy => 0, cascade_delete => 0 }, ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:AK595c56vgTa7ZjwZjberw +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ybxwm+MNY+0Z8txgjjIahw sub koha_object_class { 'Koha::Subscription::Routinglist'; --- a/Koha/Schema/Result/Suggestion.pm +++ a/Koha/Schema/Result/Suggestion.pm @@ -117,7 +117,7 @@ __PACKAGE__->table("suggestions"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 volumedesc @@ -250,7 +250,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "volumedesc", @@ -440,8 +440,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-03-11 12:56:41 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:UsG/gxLa0HMMbcpbscV29Q +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jonzJsbNRJnB1hso6kIqUQ __PACKAGE__->belongs_to( "suggester", --- a/Koha/Schema/Result/UploadedFile.pm +++ a/Koha/Schema/Result/UploadedFile.pm @@ -54,7 +54,7 @@ __PACKAGE__->table("uploaded_files"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 uploadcategorycode @@ -94,7 +94,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "uploadcategorycode", @@ -120,8 +120,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("id"); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:54 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:kJUbIULQMBo3t51HvWC8cg +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dUELzltCRxC2Nfwy0MVpCw # You can replace this text with custom code or comments, and it will be preserved on regeneration --- a/Koha/Schema/Result/Virtualshelfcontent.pm +++ a/Koha/Schema/Result/Virtualshelfcontent.pm @@ -46,7 +46,7 @@ __PACKAGE__->table("virtualshelfcontents"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 borrowernumber @@ -78,7 +78,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "borrowernumber", @@ -138,8 +138,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ie3Gx+/HthZQ/4fHjcPF0w +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:20iSu9w0DCT2jgIOUpybyg #TODO See BZ 14544: Should be resolved by db revision __PACKAGE__->set_primary_key("shelfnumber","biblionumber"); --- a/Koha/Schema/Result/Virtualshelve.pm +++ a/Koha/Schema/Result/Virtualshelve.pm @@ -58,7 +58,7 @@ __PACKAGE__->table("virtualshelves"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =head2 created_on @@ -101,7 +101,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, "created_on", @@ -181,8 +181,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-03-08 14:19:17 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Xoq0lhLouCbkAp6F4ZyMGQ +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:59Elqv1XBtx7Sf9TI+yEDA sub koha_object_class { 'Koha::Virtualshelf'; --- a/Koha/Schema/Result/Zebraqueue.pm +++ a/Koha/Schema/Result/Zebraqueue.pm @@ -60,7 +60,7 @@ __PACKAGE__->table("zebraqueue"); data_type: 'timestamp' datetime_undef_if_invalid: 1 - default_value: current_timestamp + default_value: 'current_timestamp()' is_nullable: 0 =cut @@ -85,7 +85,7 @@ __PACKAGE__->add_columns( { data_type => "timestamp", datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", + default_value => "current_timestamp()", is_nullable => 0, }, ); @@ -103,8 +103,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("id"); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vU9ROiVUwXc7jhKt728dRg +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-20 10:01:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:n+gwp4O5CrNj25L/ZA/65g # You can replace this text with custom content, and it will be preserved on regeneration --- a/admin/columns_settings.yml +++ a/admin/columns_settings.yml @@ -516,6 +516,9 @@ modules: account-fines: - columnname: date + - + columnname: credit_number + is_hidden: 1 - columnname: account_type - --- a/installer/data/mysql/atomicupdate/bug-19036.perl +++ a/installer/data/mysql/atomicupdate/bug-19036.perl @@ -0,0 +1,11 @@ +$DBversion = 'XXX'; +if (CheckVersion($DBversion)) { + unless (column_exists('accountlines', 'credit_number')) { + $dbh->do('ALTER TABLE accountlines ADD COLUMN credit_number VARCHAR(20) NULL DEFAULT NULL COMMENT "autogenerated number for credits" AFTER debit_type_code'); + } + + $dbh->do('INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) VALUES(?, ?, ?, ?, ?)', undef, 'AutoCreditNumber', '', '', 'Automatically generate a number for account credits', 'Choice'); + + SetVersion($DBversion); + print "Upgrade to $DBversion done (Bug 19036 - Add column accountlines.credit_number)\n"; +} --- a/installer/data/mysql/kohastructure.sql +++ a/installer/data/mysql/kohastructure.sql @@ -2654,6 +2654,7 @@ CREATE TABLE `accountlines` ( `description` LONGTEXT, `credit_type_code` varchar(80) default NULL, `debit_type_code` varchar(80) default NULL, + `credit_number` varchar(20) NULL DEFAULT NULL COMMENT 'autogenerated number for credits', `status` varchar(16) default NULL, `payment_type` varchar(80) default NULL, -- optional authorised value PAYMENT_TYPE `amountoutstanding` decimal(28,6) default NULL, --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -67,6 +67,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('AuthoritySeparator','--','10','Used to separate a list of authorities in a display. Usually --','free'), ('autoBarcode','OFF','incremental|annual|hbyymmincr|EAN13|OFF','Used to autogenerate a barcode: incremental will be of the form 1, 2, 3; annual of the form 2007-0001, 2007-0002; hbyymmincr of the form HB08010001 where HB=Home Branch','Choice'), ('AutoCreateAuthorities','0',NULL,'Automatically create authorities that do not exist when cataloging records.','YesNo'), +('AutoCreditNumber', '', '', 'Automatically generate a number for account credits', 'Choice'), ('AutoEmailOpacUser','0',NULL,'Sends notification emails containing new account details to patrons - when account is created.','YesNo'), ('AutoEmailPrimaryAddress','OFF','email|emailpro|B_email|cardnumber|OFF','Defines the default email address where \'Account Details\' emails are sent.','Choice'), ('AutoShareWithMana','subscription','','defines datas automatically shared with mana','multiple'), --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/accounting.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/accounting.pref @@ -27,3 +27,10 @@ Accounting: yes: "Enable" no: "Disable" - " the point of sale feature to allow anonymous transactions with the accounting system. (Requires UseCashRegisters)" + - + - pref: AutoCreditNumber + choices: + '': 'Do not automatically generate credit numbers' + annual: 'Automatically generate credit numbers in the form -0001' + branchyyyymmincr: 'Automatically generate credit numbers in the form yyyymm0001' + incremental: 'Automatically generate credit numbers in the form 1, 2, 3' --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt @@ -44,6 +44,7 @@ Date + Credit number Account type Description of charges Barcode @@ -62,6 +63,7 @@ [% account.date |$KohaDates %] + [% account.credit_number | html %] [% PROCESS account_type_description account=account %] [%- IF account.payment_type %][% AuthorisedValues.GetByCode('PAYMENT_TYPE', account.payment_type) | html %][% END %] @@ -96,7 +98,7 @@ [% END %] - Total due + Total due [% IF ( totalcredit ) %] [% total | $Price %] [% ELSE %] --- a/t/db_dependent/Koha/Account.t +++ a/t/db_dependent/Koha/Account.t @@ -19,7 +19,7 @@ use Modern::Perl; -use Test::More tests => 11; +use Test::More tests => 12; use Test::MockModule; use Test::Exception; @@ -979,3 +979,51 @@ subtest 'Koha::Account::Line::apply() handles lost items' => sub { $schema->storage->txn_rollback; }; + +subtest 'Koha::Account::pay() generates credit number' => sub { + plan tests => 34; + + $schema->storage->txn_begin; + + Koha::Account::Lines->delete(); + + my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); + my $library = $builder->build_object( { class => 'Koha::Libraries' } ); + my $account = $patron->account; + + my $context = Test::MockModule->new('C4::Context'); + $context->mock( 'userenv', { branch => $library->id } ); + + my $now = DateTime->now; + my $year = $now->year; + my $month = $now->month; + my ($accountlines_id, $accountline); + + t::lib::Mocks::mock_preference('AutoCreditNumber', ''); + $accountlines_id = $account->pay({ amount => '1.00', library_id => $library->id }); + $accountline = Koha::Account::Lines->find($accountlines_id); + is($accountline->credit_number, undef, 'No credit number is generated when syspref is off'); + + t::lib::Mocks::mock_preference('AutoCreditNumber', 'incremental'); + for my $i (1..11) { + $accountlines_id = $account->pay({ amount => '1.00', library_id => $library->id }); + $accountline = Koha::Account::Lines->find($accountlines_id); + is($accountline->credit_number, $i); + } + + t::lib::Mocks::mock_preference('AutoCreditNumber', 'annual'); + for my $i (1..11) { + $accountlines_id = $account->pay({ amount => '1.00', library_id => $library->id }); + $accountline = Koha::Account::Lines->find($accountlines_id); + is($accountline->credit_number, sprintf('%s-%04d', $year, $i)); + } + + t::lib::Mocks::mock_preference('AutoCreditNumber', 'branchyyyymmincr'); + for my $i (1..11) { + $accountlines_id = $account->pay({ amount => '1.00', library_id => $library->id }); + $accountline = Koha::Account::Lines->find($accountlines_id); + is($accountline->credit_number, sprintf('%s%d%02d%04d', $library->id, $year, $month, $i)); + } + + $schema->storage->txn_rollback; +}; --