From: Jan Büren Date: Wed, 23 Feb 2022 09:16:27 +0000 (+0100) Subject: Hilfstabelle für automatische GL-Buchung nach Kreditorenbuchung X-Git-Tag: kivitendo-mebil_0.1-0~10^2~2^2~159 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=a8536f428f1506316a09121f3ff7568c6354c7ab;p=kivitendo-erp.git Hilfstabelle für automatische GL-Buchung nach Kreditorenbuchung --- diff --git a/SL/DB/Helper/Mappings.pm b/SL/DB/Helper/Mappings.pm index 0e9f23075..8d0ed7e0c 100644 --- a/SL/DB/Helper/Mappings.pm +++ b/SL/DB/Helper/Mappings.pm @@ -99,6 +99,7 @@ my %kivitendo_package_names = ( 'auth.user_group' => 'auth_user_group', ar => 'invoice', ap => 'purchase_invoice', + ap_gl => 'ap_gl', assembly => 'assembly', assortment_items => 'assortment_item', background_jobs => 'background_job', diff --git a/SL/DB/Manager/ApGl.pm b/SL/DB/Manager/ApGl.pm new file mode 100644 index 000000000..3cc0396b7 --- /dev/null +++ b/SL/DB/Manager/ApGl.pm @@ -0,0 +1,14 @@ +# This file has been auto-generated only because it didn't exist. +# Feel free to modify it at will; it will not be overwritten automatically. + +package SL::DB::Manager::ApGl; + +use strict; + +use parent qw(SL::DB::Helper::Manager); + +sub object_class { 'SL::DB::ApGl' } + +__PACKAGE__->make_manager_methods; + +1; diff --git a/SL/DB/MetaSetup/ApGl.pm b/SL/DB/MetaSetup/ApGl.pm new file mode 100644 index 000000000..9f3f80abe --- /dev/null +++ b/SL/DB/MetaSetup/ApGl.pm @@ -0,0 +1,35 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::ApGl; + +use strict; + +use parent qw(SL::DB::Object); + +__PACKAGE__->meta->table('ap_gl'); + +__PACKAGE__->meta->columns( + ap_id => { type => 'integer', not_null => 1 }, + gl_id => { type => 'integer', not_null => 1 }, + itime => { type => 'timestamp', default => 'now()' }, + mtime => { type => 'timestamp' }, +); + +__PACKAGE__->meta->primary_key_columns([ 'ap_id', 'gl_id' ]); + +__PACKAGE__->meta->allow_inline_column_values(1); + +__PACKAGE__->meta->foreign_keys( + ap => { + class => 'SL::DB::PurchaseInvoice', + key_columns => { ap_id => 'id' }, + }, + + gl => { + class => 'SL::DB::GLTransaction', + key_columns => { gl_id => 'id' }, + }, +); + +1; +; diff --git a/sql/Pg-upgrade2/ap_gl.sql b/sql/Pg-upgrade2/ap_gl.sql new file mode 100644 index 000000000..cb9e01b37 --- /dev/null +++ b/sql/Pg-upgrade2/ap_gl.sql @@ -0,0 +1,16 @@ +-- @tag: ap_gl +-- @description: Hilfstabelle für automatische GL-Buchung nach Kreditorenbuchung +-- @depends: release_3_5_0 +-- @ignore: 0 + CREATE TABLE ap_gl ( + ap_id integer, + gl_id integer, + itime TIMESTAMP DEFAULT now(), + mtime TIMESTAMP, + PRIMARY KEY (ap_id, gl_id), + FOREIGN KEY (ap_id) REFERENCES ap (id), + FOREIGN KEY (gl_id) REFERENCES gl (id) ON DELETE CASCADE); + + + +