@@ -, +, @@ --- Koha/Schema/Result/AccountOffset.pm | 145 ++++++++++++++++++++++++++++++++++++ Koha/Schema/Result/Accountline.pm | 34 ++++++++- Koha/Schema/Result/Accountoffset.pm | 106 -------------------------- Koha/Schema/Result/Borrower.pm | 19 +---- 4 files changed, 179 insertions(+), 125 deletions(-) create mode 100644 Koha/Schema/Result/AccountOffset.pm delete mode 100644 Koha/Schema/Result/Accountoffset.pm --- a/Koha/Schema/Result/AccountOffset.pm +++ a/Koha/Schema/Result/AccountOffset.pm @@ -0,0 +1,145 @@ +use utf8; +package Koha::Schema::Result::AccountOffset; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::AccountOffset + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("account_offsets"); + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +=head2 credit_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 1 + +=head2 debit_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 1 + +=head2 type + + data_type: 'varchar' + is_nullable: 0 + size: 16 + +=head2 amount + + data_type: 'decimal' + is_nullable: 0 + size: [26,6] + +=head2 created_on + + data_type: 'timestamp' + datetime_undef_if_invalid: 1 + default_value: current_timestamp + is_nullable: 0 + +=cut + +__PACKAGE__->add_columns( + "id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "credit_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, + "debit_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, + "type", + { data_type => "varchar", is_nullable => 0, size => 16 }, + "amount", + { data_type => "decimal", is_nullable => 0, size => [26, 6] }, + "created_on", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + default_value => \"current_timestamp", + is_nullable => 0, + }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("id"); + +=head1 RELATIONS + +=head2 credit + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "credit", + "Koha::Schema::Result::Accountline", + { accountlines_id => "credit_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "CASCADE", + }, +); + +=head2 debit + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "debit", + "Koha::Schema::Result::Accountline", + { accountlines_id => "debit_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "CASCADE", + }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-07-12 14:26:28 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:eu/gSdbAUL5bwhcvC+MGsw + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; --- a/Koha/Schema/Result/Accountline.pm +++ a/Koha/Schema/Result/Accountline.pm @@ -185,6 +185,36 @@ __PACKAGE__->set_primary_key("accountlines_id"); =head1 RELATIONS +=head2 account_offsets_credits + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "account_offsets_credits", + "Koha::Schema::Result::AccountOffset", + { "foreign.credit_id" => "self.accountlines_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 account_offsets_debits + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "account_offsets_debits", + "Koha::Schema::Result::AccountOffset", + { "foreign.debit_id" => "self.accountlines_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 borrowernumber Type: belongs_to @@ -221,8 +251,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-01-26 17:18:34 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:RCQohhphtg+0+RszpB4wLg +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-07-12 14:26:28 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:88YKCYpyxgZHWCWQ4X956g # You can replace this text with custom content, and it will be preserved on regeneration --- a/Koha/Schema/Result/Accountoffset.pm +++ a/Koha/Schema/Result/Accountoffset.pm @@ -1,106 +0,0 @@ -use utf8; -package Koha::Schema::Result::Accountoffset; - -# Created by DBIx::Class::Schema::Loader -# DO NOT MODIFY THE FIRST PART OF THIS FILE - -=head1 NAME - -Koha::Schema::Result::Accountoffset - -=cut - -use strict; -use warnings; - -use base 'DBIx::Class::Core'; - -=head1 TABLE: C - -=cut - -__PACKAGE__->table("accountoffsets"); - -=head1 ACCESSORS - -=head2 borrowernumber - - data_type: 'integer' - default_value: 0 - is_foreign_key: 1 - is_nullable: 0 - -=head2 accountno - - data_type: 'smallint' - default_value: 0 - is_nullable: 0 - -=head2 offsetaccount - - data_type: 'smallint' - default_value: 0 - is_nullable: 0 - -=head2 offsetamount - - data_type: 'decimal' - is_nullable: 1 - size: [28,6] - -=head2 timestamp - - data_type: 'timestamp' - datetime_undef_if_invalid: 1 - default_value: current_timestamp - is_nullable: 0 - -=cut - -__PACKAGE__->add_columns( - "borrowernumber", - { - data_type => "integer", - default_value => 0, - is_foreign_key => 1, - is_nullable => 0, - }, - "accountno", - { data_type => "smallint", default_value => 0, is_nullable => 0 }, - "offsetaccount", - { data_type => "smallint", default_value => 0, is_nullable => 0 }, - "offsetamount", - { data_type => "decimal", is_nullable => 1, size => [28, 6] }, - "timestamp", - { - data_type => "timestamp", - datetime_undef_if_invalid => 1, - default_value => \"current_timestamp", - is_nullable => 0, - }, -); - -=head1 RELATIONS - -=head2 borrowernumber - -Type: belongs_to - -Related object: L - -=cut - -__PACKAGE__->belongs_to( - "borrowernumber", - "Koha::Schema::Result::Borrower", - { borrowernumber => "borrowernumber" }, - { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, -); - - -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OTfcUiJCPb5aU/gjqAb/bA - - -# You can replace this text with custom content, and it will be preserved on regeneration -1; --- a/Koha/Schema/Result/Borrower.pm +++ a/Koha/Schema/Result/Borrower.pm @@ -661,21 +661,6 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); -=head2 accountoffsets - -Type: has_many - -Related object: L - -=cut - -__PACKAGE__->has_many( - "accountoffsets", - "Koha::Schema::Result::Accountoffset", - { "foreign.borrowernumber" => "self.borrowernumber" }, - { cascade_copy => 0, cascade_delete => 0 }, -); - =head2 aqbasketusers Type: has_many @@ -1232,8 +1217,8 @@ Composing rels: L -> ordernumber __PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber"); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-07-08 13:37:33 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GiEcKBFRhzHwXPekj6fSPg +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-07-12 13:45:54 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:AeU4me6MM3qpKLzJryVeQw __PACKAGE__->belongs_to( "guarantor", --