Dialogbuchungen um Boolean imported erweitert.
authorJan Büren <jan@kivitendo-premium.de>
Mon, 28 Sep 2020 15:24:57 +0000 (17:24 +0200)
committerJan Büren <jan@kivitendo.de>
Mon, 14 Dec 2020 08:50:05 +0000 (09:50 +0100)
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
SL/DB/MetaSetup/GLTransaction.pm
bin/mozilla/datev.pl
locale/de/all
sql/Pg-upgrade2/add_gl_imported.sql [new file with mode: 0644]
templates/webpages/datev/export_bewegungsdaten.html

index c6ce5b2..2aff208 100644 (file)
@@ -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|;
index 4d0e41b..80c7e85 100644 (file)
@@ -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' },
index cca078b..428a391 100644 (file)
@@ -119,6 +119,7 @@ sub export3 {
     );
     $data{use_pk} = $::form->{use_pk};
     $data{locked} = $::form->{locked};
+    $data{imported} = $::form->{imported};
   } else {
     die 'invalid exporttype';
   }
index e2850f5..34e7106 100755 (executable)
@@ -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 (file)
index 0000000..a0bf715
--- /dev/null
@@ -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';
+
index 9809b1f..89bc582 100644 (file)
            <td align=left>[% 'Lock bookings' | $T8 %]</td>
            <td align=left></td>
            <td colspan="3">[% L.yes_no_tag('locked', 0) %]</td>
+        </tr>
+         <tr>
+           <td align=left>[% 'Export imported bookings' | $T8 %]</td>
+           <td align=left></td>
+           <td colspan="3">[% L.yes_no_tag('imported', 0) %]</td>
         </tr>
         </table>
      </td>