Bugzilla – Attachment 94167 Details for
Bug 23805
Add a dedicated credit_types table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23805: DBIC Classes
Bug-23805-DBIC-Classes.patch (text/plain), 7.83 KB, created by
Martin Renvoize (ashimema)
on 2019-10-15 11:05:32 UTC
(
hide
)
Description:
Bug 23805: DBIC Classes
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-10-15 11:05:32 UTC
Size:
7.83 KB
patch
obsolete
>From e1dc5dccc87d57a17f82dde2330f14d474b09984 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 15 Oct 2019 09:43:46 +0100 >Subject: [PATCH] Bug 23805: DBIC Classes > >--- > Koha/Schema/Result/AccountCreditType.pm | 113 ++++++++++++++++++ > .../Schema/Result/AccountCreditTypesBranch.pm | 97 +++++++++++++++ > Koha/Schema/Result/Accountline.pm | 31 ++++- > Koha/Schema/Result/Branch.pm | 19 ++- > 4 files changed, 253 insertions(+), 7 deletions(-) > create mode 100644 Koha/Schema/Result/AccountCreditType.pm > create mode 100644 Koha/Schema/Result/AccountCreditTypesBranch.pm > >diff --git a/Koha/Schema/Result/AccountCreditType.pm b/Koha/Schema/Result/AccountCreditType.pm >new file mode 100644 >index 0000000000..015fd3c0ec >--- /dev/null >+++ b/Koha/Schema/Result/AccountCreditType.pm >@@ -0,0 +1,113 @@ >+use utf8; >+package Koha::Schema::Result::AccountCreditType; >+ >+# Created by DBIx::Class::Schema::Loader >+# DO NOT MODIFY THE FIRST PART OF THIS FILE >+ >+=head1 NAME >+ >+Koha::Schema::Result::AccountCreditType >+ >+=cut >+ >+use strict; >+use warnings; >+ >+use base 'DBIx::Class::Core'; >+ >+=head1 TABLE: C<account_credit_types> >+ >+=cut >+ >+__PACKAGE__->table("account_credit_types"); >+ >+=head1 ACCESSORS >+ >+=head2 code >+ >+ data_type: 'varchar' >+ is_nullable: 0 >+ size: 80 >+ >+=head2 description >+ >+ data_type: 'varchar' >+ is_nullable: 1 >+ size: 200 >+ >+=head2 can_be_added_manually >+ >+ data_type: 'tinyint' >+ default_value: 1 >+ is_nullable: 0 >+ >+=head2 is_system >+ >+ data_type: 'tinyint' >+ default_value: 0 >+ is_nullable: 0 >+ >+=cut >+ >+__PACKAGE__->add_columns( >+ "code", >+ { data_type => "varchar", is_nullable => 0, size => 80 }, >+ "description", >+ { data_type => "varchar", is_nullable => 1, size => 200 }, >+ "can_be_added_manually", >+ { data_type => "tinyint", default_value => 1, is_nullable => 0 }, >+ "is_system", >+ { data_type => "tinyint", default_value => 0, is_nullable => 0 }, >+); >+ >+=head1 PRIMARY KEY >+ >+=over 4 >+ >+=item * L</code> >+ >+=back >+ >+=cut >+ >+__PACKAGE__->set_primary_key("code"); >+ >+=head1 RELATIONS >+ >+=head2 account_credit_types_branches >+ >+Type: has_many >+ >+Related object: L<Koha::Schema::Result::AccountCreditTypesBranch> >+ >+=cut >+ >+__PACKAGE__->has_many( >+ "account_credit_types_branches", >+ "Koha::Schema::Result::AccountCreditTypesBranch", >+ { "foreign.credit_type_code" => "self.code" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ >+=head2 accountlines >+ >+Type: has_many >+ >+Related object: L<Koha::Schema::Result::Accountline> >+ >+=cut >+ >+__PACKAGE__->has_many( >+ "accountlines", >+ "Koha::Schema::Result::Accountline", >+ { "foreign.credit_type_code" => "self.code" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ >+ >+# 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 >+ >+ >+# You can replace this text with custom code or comments, and it will be preserved on regeneration >+1; >diff --git a/Koha/Schema/Result/AccountCreditTypesBranch.pm b/Koha/Schema/Result/AccountCreditTypesBranch.pm >new file mode 100644 >index 0000000000..40ea9ab560 >--- /dev/null >+++ b/Koha/Schema/Result/AccountCreditTypesBranch.pm >@@ -0,0 +1,97 @@ >+use utf8; >+package Koha::Schema::Result::AccountCreditTypesBranch; >+ >+# Created by DBIx::Class::Schema::Loader >+# DO NOT MODIFY THE FIRST PART OF THIS FILE >+ >+=head1 NAME >+ >+Koha::Schema::Result::AccountCreditTypesBranch >+ >+=cut >+ >+use strict; >+use warnings; >+ >+use base 'DBIx::Class::Core'; >+ >+=head1 TABLE: C<account_credit_types_branches> >+ >+=cut >+ >+__PACKAGE__->table("account_credit_types_branches"); >+ >+=head1 ACCESSORS >+ >+=head2 credit_type_code >+ >+ data_type: 'varchar' >+ is_foreign_key: 1 >+ is_nullable: 1 >+ size: 80 >+ >+=head2 branchcode >+ >+ data_type: 'varchar' >+ is_foreign_key: 1 >+ is_nullable: 1 >+ size: 10 >+ >+=cut >+ >+__PACKAGE__->add_columns( >+ "credit_type_code", >+ { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 80 }, >+ "branchcode", >+ { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 }, >+); >+ >+=head1 RELATIONS >+ >+=head2 branchcode >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::Branch> >+ >+=cut >+ >+__PACKAGE__->belongs_to( >+ "branchcode", >+ "Koha::Schema::Result::Branch", >+ { branchcode => "branchcode" }, >+ { >+ is_deferrable => 1, >+ join_type => "LEFT", >+ on_delete => "CASCADE", >+ on_update => "RESTRICT", >+ }, >+); >+ >+=head2 credit_type_code >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::AccountCreditType> >+ >+=cut >+ >+__PACKAGE__->belongs_to( >+ "credit_type_code", >+ "Koha::Schema::Result::AccountCreditType", >+ { code => "credit_type_code" }, >+ { >+ is_deferrable => 1, >+ join_type => "LEFT", >+ on_delete => "CASCADE", >+ on_update => "RESTRICT", >+ }, >+); >+ >+ >+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-14 09:59:52 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1oX/zPeT8gmc3ZwdTiyovA >+ >+ >+# You can replace this text with custom code or comments, and it will be preserved on regeneration >+1; >diff --git a/Koha/Schema/Result/Accountline.pm b/Koha/Schema/Result/Accountline.pm >index a30290dcab..d0f3567c35 100644 >--- a/Koha/Schema/Result/Accountline.pm >+++ b/Koha/Schema/Result/Accountline.pm >@@ -63,9 +63,10 @@ __PACKAGE__->table("accountlines"); > data_type: 'longtext' > is_nullable: 1 > >-=head2 accounttype >+=head2 credit_type_code > > data_type: 'varchar' >+ is_foreign_key: 1 > is_nullable: 1 > size: 80 > >@@ -148,8 +149,8 @@ __PACKAGE__->add_columns( > { data_type => "decimal", is_nullable => 1, size => [28, 6] }, > "description", > { data_type => "longtext", is_nullable => 1 }, >- "accounttype", >- { data_type => "varchar", is_nullable => 1, size => 80 }, >+ "credit_type_code", >+ { 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 }, > "status", >@@ -261,6 +262,26 @@ __PACKAGE__->belongs_to( > }, > ); > >+=head2 credit_type_code >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::AccountCreditType> >+ >+=cut >+ >+__PACKAGE__->belongs_to( >+ "credit_type_code", >+ "Koha::Schema::Result::AccountCreditType", >+ { code => "credit_type_code" }, >+ { >+ is_deferrable => 1, >+ join_type => "LEFT", >+ on_delete => "SET NULL", >+ on_update => "CASCADE", >+ }, >+); >+ > =head2 debit_type_code > > Type: belongs_to >@@ -342,8 +363,8 @@ __PACKAGE__->belongs_to( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-11 11:36:33 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WZ2Mcd5gwQc69yDSEsJHGA >+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-14 09:59:52 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vlCQOQhtMztgyn5M5KVdOg > > sub koha_objects_class { > 'Koha::Account::Lines'; >diff --git a/Koha/Schema/Result/Branch.pm b/Koha/Schema/Result/Branch.pm >index 579edb8e39..73b50e581b 100644 >--- a/Koha/Schema/Result/Branch.pm >+++ b/Koha/Schema/Result/Branch.pm >@@ -211,6 +211,21 @@ __PACKAGE__->set_primary_key("branchcode"); > > =head1 RELATIONS > >+=head2 account_credit_types_branches >+ >+Type: has_many >+ >+Related object: L<Koha::Schema::Result::AccountCreditTypesBranch> >+ >+=cut >+ >+__PACKAGE__->has_many( >+ "account_credit_types_branches", >+ "Koha::Schema::Result::AccountCreditTypesBranch", >+ { "foreign.branchcode" => "self.branchcode" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ > =head2 account_debit_types_branches > > Type: has_many >@@ -692,8 +707,8 @@ __PACKAGE__->has_many( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-11 11:36:33 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:HCQKMSgKhVKtDSrvs1IeRg >+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-14 09:59:52 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vWDJAm3K2jiyRS3htyip6A > > __PACKAGE__->add_columns( > '+pickup_location' => { is_boolean => 1 } >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 23805
:
94153
|
94154
|
94155
|
94156
|
94157
|
94158
|
94159
|
94160
|
94161
|
94162
|
94163
|
94164
|
94166
|
94167
|
94168
|
94169
|
94170
|
94171
|
94172
|
94173
|
94174
|
94175
|
94176
|
94177
|
94178
|
94801
|
94815
|
94832
|
94895