Hilfstabelle für automatische GL-Buchung nach Kreditorenbuchung
authorJan Büren <jan@kivitendo.de>
Wed, 23 Feb 2022 09:16:27 +0000 (10:16 +0100)
committerJan Büren <jan@kivitendo.de>
Thu, 3 Mar 2022 12:39:24 +0000 (13:39 +0100)
SL/DB/Helper/Mappings.pm
SL/DB/Manager/ApGl.pm [new file with mode: 0644]
SL/DB/MetaSetup/ApGl.pm [new file with mode: 0644]
sql/Pg-upgrade2/ap_gl.sql [new file with mode: 0644]

index 0e9f230..8d0ed7e 100644 (file)
@@ -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 (file)
index 0000000..3cc0396
--- /dev/null
@@ -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 (file)
index 0000000..9f3f80a
--- /dev/null
@@ -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 (file)
index 0000000..cb9e01b
--- /dev/null
@@ -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);
+
+
+
+