@@ -, +, @@ --- Koha/Schema/Result/Borrower.pm | 24 +++- Koha/Schema/Result/CashRegister.pm | 19 +++- Koha/Schema/Result/CashRegisterAction.pm | 135 +++++++++++++++++++++++ 3 files changed, 174 insertions(+), 4 deletions(-) create mode 100644 Koha/Schema/Result/CashRegisterAction.pm --- a/Koha/Schema/Result/Borrower.pm +++ a/Koha/Schema/Result/Borrower.pm @@ -929,6 +929,21 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" }, ); +=head2 cash_register_actions + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "cash_register_actions", + "Koha::Schema::Result::CashRegisterAction", + { "foreign.manager_id" => "self.borrowernumber" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 categorycode Type: belongs_to @@ -1634,9 +1649,14 @@ Composing rels: L -> ordernumber __PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber"); +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-07-23 13:21:02 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:f25Xar862YgzWuWq5/LIRA -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-10 14:31:00 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GjJLIOViIFRm185Yjl9vYA +__PACKAGE__->belongs_to( + "guarantor", + "Koha::Schema::Result::Borrower", + { borrowernumber => "guarantorid" }, +); __PACKAGE__->add_columns( '+anonymized' => { is_boolean => 1 }, --- a/Koha/Schema/Result/CashRegister.pm +++ a/Koha/Schema/Result/CashRegister.pm @@ -144,9 +144,24 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, ); +=head2 cash_register_actions -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-07-23 13:14:31 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:TfGf0U/vWS7IviRlvDdE1w +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "cash_register_actions", + "Koha::Schema::Result::CashRegisterAction", + { "foreign.register_id" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-07-23 13:21:03 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zP8my0Zp5bSARTBfws4n1A __PACKAGE__->add_columns( '+archived' => { is_boolean => 1 }, --- a/Koha/Schema/Result/CashRegisterAction.pm +++ a/Koha/Schema/Result/CashRegisterAction.pm @@ -0,0 +1,135 @@ +use utf8; +package Koha::Schema::Result::CashRegisterAction; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::CashRegisterAction + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("cash_register_actions"); + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +=head2 code + + data_type: 'varchar' + is_nullable: 0 + size: 24 + +=head2 register_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +=head2 manager_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +=head2 amount + + 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( + "id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "code", + { data_type => "varchar", is_nullable => 0, size => 24 }, + "register_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "manager_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "amount", + { 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 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("id"); + +=head1 RELATIONS + +=head2 manager + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "manager", + "Koha::Schema::Result::Borrower", + { borrowernumber => "manager_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + +=head2 register + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "register", + "Koha::Schema::Result::CashRegister", + { id => "register_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-07-23 13:21:03 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Oaee+hS82IEJHHBGuOXDtw + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; --