From 2002a757a19126c727f5e31c09827d9f607eafad Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 4 Oct 2017 13:24:48 +0000 Subject: [PATCH] Bug 19166: DO NOT PUSH - Schema updates Included to ease testing :-) --- Koha/Schema/Result/Aqbudget.pm | 19 +++- Koha/Schema/Result/Aqinvoice.pm | 19 +++- Koha/Schema/Result/InvoiceAdjustment.pm | 155 ++++++++++++++++++++++++++++++++ 3 files changed, 189 insertions(+), 4 deletions(-) create mode 100644 Koha/Schema/Result/InvoiceAdjustment.pm diff --git a/Koha/Schema/Result/Aqbudget.pm b/Koha/Schema/Result/Aqbudget.pm index 12a8c8d..4e7bef4 100644 --- a/Koha/Schema/Result/Aqbudget.pm +++ b/Koha/Schema/Result/Aqbudget.pm @@ -242,6 +242,21 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 invoice_adjustments + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "invoice_adjustments", + "Koha::Schema::Result::InvoiceAdjustment", + { "foreign.budget_id" => "self.budget_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 suggestions Type: has_many @@ -283,8 +298,8 @@ Composing rels: L -> borrowernumber __PACKAGE__->many_to_many("borrowernumbers", "aqbudgetborrowers", "borrowernumber"); -# Created by DBIx::Class::Schema::Loader v0.07033 @ 2015-03-04 10:26:49 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:E4J/D0+2j0/8JZd0YRnoeA +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-10-04 13:24:01 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xi2wYYXl8vHkwOd0WYtsAQ # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/Aqinvoice.pm b/Koha/Schema/Result/Aqinvoice.pm index 365379e..487fc53 100644 --- a/Koha/Schema/Result/Aqinvoice.pm +++ b/Koha/Schema/Result/Aqinvoice.pm @@ -143,6 +143,21 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, ); +=head2 invoice_adjustments + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "invoice_adjustments", + "Koha::Schema::Result::InvoiceAdjustment", + { "foreign.invoiceid" => "self.invoiceid" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 message Type: belongs_to @@ -184,8 +199,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07033 @ 2014-09-18 16:21:46 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:FPZXlNt8dkjhgt2Rtc+krQ +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-10-04 13:24:01 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GaAbldBJaPoaufp8Hin/3Q # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/InvoiceAdjustment.pm b/Koha/Schema/Result/InvoiceAdjustment.pm new file mode 100644 index 0000000..4112022 --- /dev/null +++ b/Koha/Schema/Result/InvoiceAdjustment.pm @@ -0,0 +1,155 @@ +use utf8; +package Koha::Schema::Result::InvoiceAdjustment; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::InvoiceAdjustment + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("invoice_adjustments"); + +=head1 ACCESSORS + +=head2 adjustment_id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +=head2 invoiceid + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +=head2 adjustment + + data_type: 'decimal' + is_nullable: 1 + size: [28,6] + +=head2 reason + + data_type: 'varchar' + is_nullable: 1 + size: 80 + +=head2 note + + data_type: 'mediumtext' + is_nullable: 1 + +=head2 budget_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 1 + +=head2 encumber_open + + data_type: 'smallint' + default_value: 1 + is_nullable: 0 + +=head2 timestamp + + data_type: 'timestamp' + datetime_undef_if_invalid: 1 + default_value: current_timestamp + is_nullable: 0 + +=cut + +__PACKAGE__->add_columns( + "adjustment_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "invoiceid", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "adjustment", + { data_type => "decimal", is_nullable => 1, size => [28, 6] }, + "reason", + { data_type => "varchar", is_nullable => 1, size => 80 }, + "note", + { data_type => "mediumtext", is_nullable => 1 }, + "budget_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, + "encumber_open", + { data_type => "smallint", default_value => 1, is_nullable => 0 }, + "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("adjustment_id"); + +=head1 RELATIONS + +=head2 budget + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "budget", + "Koha::Schema::Result::Aqbudget", + { budget_id => "budget_id" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "CASCADE", + }, +); + +=head2 invoiceid + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "invoiceid", + "Koha::Schema::Result::Aqinvoice", + { invoiceid => "invoiceid" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-09-26 14:15:50 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:4hILsU7xo1mRBV13R2LXEg + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; -- 2.1.4