From c7cff7651eda58f2911ad48456585af4d04b536c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Mon, 28 Sep 2020 17:24:57 +0200 Subject: [PATCH] Dialogbuchungen um Boolean imported erweitert. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Buchungen mit diesem Boolean können beim DATEV-Export gefiltert werden. Anwendungsfall sind bspw. in DATEV erstellte Lohnbuchungen, die dann in kivi importiert werden --- SL/DATEV.pm | 13 +++++++++++++ SL/DB/MetaSetup/GLTransaction.pm | 1 + bin/mozilla/datev.pl | 1 + locale/de/all | 1 + sql/Pg-upgrade2/add_gl_imported.sql | 6 ++++++ templates/webpages/datev/export_bewegungsdaten.html | 5 +++++ 6 files changed, 27 insertions(+) create mode 100644 sql/Pg-upgrade2/add_gl_imported.sql diff --git a/SL/DATEV.pm b/SL/DATEV.pm index c6ce5b2a0..2aff208e6 100644 --- a/SL/DATEV.pm +++ b/SL/DATEV.pm @@ -461,6 +461,14 @@ sub locked { } return $self->{locked}; } +sub imported { + my $self = shift; + + if (@_) { + $self->{imported} = $_[0]; + } + return $self->{imported}; +} sub generate_datev_data { $main::lxdebug->enter_sub(); @@ -514,6 +522,10 @@ sub generate_datev_data { $ar_accno = "CASE WHEN ac.chart_link = 'AR' THEN ct.customernumber ELSE c.accno END as accno"; $ap_accno = "CASE WHEN ac.chart_link = 'AP' THEN ct.vendornumber ELSE c.accno END as accno"; } + my $gl_imported; + if ( !$self->imported ) { + $gl_imported = " AND NOT imported"; + } my $query = qq|SELECT ac.acc_trans_id, ac.transdate, ac.gldate, ac.trans_id,ar.id, ac.amount, ac.taxkey, ac.memo, @@ -597,6 +609,7 @@ sub generate_datev_data { $trans_id_filter $gl_itime_filter $gl_department_id_filter + $gl_imported $filter ORDER BY trans_id, acc_trans_id|; diff --git a/SL/DB/MetaSetup/GLTransaction.pm b/SL/DB/MetaSetup/GLTransaction.pm index 4d0e41b13..80c7e851a 100644 --- a/SL/DB/MetaSetup/GLTransaction.pm +++ b/SL/DB/MetaSetup/GLTransaction.pm @@ -16,6 +16,7 @@ __PACKAGE__->meta->columns( employee_id => { type => 'integer' }, gldate => { type => 'date', default => 'now' }, id => { type => 'integer', not_null => 1, sequence => 'glid' }, + imported => { type => 'boolean', default => 'false' }, itime => { type => 'timestamp', default => 'now()' }, mtime => { type => 'timestamp' }, notes => { type => 'text' }, diff --git a/bin/mozilla/datev.pl b/bin/mozilla/datev.pl index cca078b66..428a391e0 100644 --- a/bin/mozilla/datev.pl +++ b/bin/mozilla/datev.pl @@ -119,6 +119,7 @@ sub export3 { ); $data{use_pk} = $::form->{use_pk}; $data{locked} = $::form->{locked}; + $data{imported} = $::form->{imported}; } else { die 'invalid exporttype'; } diff --git a/locale/de/all b/locale/de/all index e2850f593..34e7106bd 100755 --- a/locale/de/all +++ b/locale/de/all @@ -1433,6 +1433,7 @@ $self->{texts} = { 'Export date to' => 'Exportdatum bis', 'Export error in transaction #1: Rounding error too large #2' => 'Exportfehler in Transaktion #1: Zu großer Rundungsfehler (#2)', 'Export error in transaction #1: Unbalanced ledger before next transaction (#2)' => 'Exportfehler in Transaktion #1: Unausgeglichene Buchung', + 'Export imported bookings' => 'Importierte Buchungen exportieren', 'Export with CV Charts' => 'Mit Personenkonten exportieren', 'Extend automatically by n months' => 'Automatische Verlängerung um x Monate', 'Extended' => 'Gesamt', diff --git a/sql/Pg-upgrade2/add_gl_imported.sql b/sql/Pg-upgrade2/add_gl_imported.sql new file mode 100644 index 000000000..a0bf715da --- /dev/null +++ b/sql/Pg-upgrade2/add_gl_imported.sql @@ -0,0 +1,6 @@ +-- @tag: add_gl_imported +-- @description: Dialogbuchungsimport entsprechend kennzeichnen +-- @depends: release_3_5_6 + +ALTER TABLE gl ADD imported BOOLEAN DEFAULT 'f'; + diff --git a/templates/webpages/datev/export_bewegungsdaten.html b/templates/webpages/datev/export_bewegungsdaten.html index 9809b1f60..89bc58281 100644 --- a/templates/webpages/datev/export_bewegungsdaten.html +++ b/templates/webpages/datev/export_bewegungsdaten.html @@ -107,6 +107,11 @@ [% 'Lock bookings' | $T8 %] [% L.yes_no_tag('locked', 0) %] + + + [% 'Export imported bookings' | $T8 %] + + [% L.yes_no_tag('imported', 0) %] -- 2.20.1