From af17661828a26441934ec40b56777dc5600e7f4e Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 16 Jul 2019 17:11:26 +0100 Subject: [PATCH] Bug 23321: [DO NOT PUSH] DBIC Classes --- Koha/Schema/Result/Branch.pm | 19 +++- Koha/Schema/Result/CashRegister.pm | 138 +++++++++++++++++++++++++++++ 2 files changed, 155 insertions(+), 2 deletions(-) create mode 100644 Koha/Schema/Result/CashRegister.pm diff --git a/Koha/Schema/Result/Branch.pm b/Koha/Schema/Result/Branch.pm index b500147ea4..7f05b17fd6 100644 --- a/Koha/Schema/Result/Branch.pm +++ b/Koha/Schema/Result/Branch.pm @@ -346,6 +346,21 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 cash_registers + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "cash_registers", + "Koha::Schema::Result::CashRegister", + { "foreign.branch" => "self.branchcode" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 categories_branches Type: has_many @@ -647,8 +662,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-04-29 15:02:52 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:y+tNq5YiUeUOyAwB4r6GHw +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-07-17 07:15:23 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:qGiu+y4MHq5CvBQTj0m8QQ __PACKAGE__->add_columns( '+pickup_location' => { is_boolean => 1 } diff --git a/Koha/Schema/Result/CashRegister.pm b/Koha/Schema/Result/CashRegister.pm new file mode 100644 index 0000000000..920f7b52aa --- /dev/null +++ b/Koha/Schema/Result/CashRegister.pm @@ -0,0 +1,138 @@ +use utf8; +package Koha::Schema::Result::CashRegister; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::CashRegister + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("cash_registers"); + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +=head2 name + + data_type: 'varchar' + is_nullable: 0 + size: 24 + +=head2 description + + data_type: 'longtext' + is_nullable: 0 + +=head2 branch + + data_type: 'varchar' + is_foreign_key: 1 + is_nullable: 0 + size: 10 + +=head2 branch_default + + data_type: 'tinyint' + default_value: 0 + is_nullable: 0 + +=head2 starting_float + + data_type: 'decimal' + is_nullable: 1 + size: [28,6] + +=head2 archived + + data_type: 'tinyint' + default_value: 0 + is_nullable: 0 + +=cut + +__PACKAGE__->add_columns( + "id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "name", + { data_type => "varchar", is_nullable => 0, size => 24 }, + "description", + { data_type => "longtext", is_nullable => 0 }, + "branch", + { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 }, + "branch_default", + { data_type => "tinyint", default_value => 0, is_nullable => 0 }, + "starting_float", + { data_type => "decimal", is_nullable => 1, size => [28, 6] }, + "archived", + { data_type => "tinyint", default_value => 0, is_nullable => 0 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("id"); + +=head1 UNIQUE CONSTRAINTS + +=head2 C + +=over 4 + +=item * L + +=item * L + +=back + +=cut + +__PACKAGE__->add_unique_constraint("name", ["name", "branch"]); + +=head1 RELATIONS + +=head2 branch + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "branch", + "Koha::Schema::Result::Branch", + { branchcode => "branch" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-07-18 11:12:59 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Ynd+Fd4Xloa70FzutGDAow + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; -- 2.20.1