]> wagnertech.de Git - kivitendo-erp.git/commitdiff
DATEV check in die 5 haupt buchungsmasken verlinkt
authorSven Schöling <s.schoeling@linet-services.de>
Thu, 24 May 2012 10:34:04 +0000 (12:34 +0200)
committerSven Schöling <s.schoeling@linet-services.de>
Thu, 24 May 2012 10:57:31 +0000 (12:57 +0200)
SL/AP.pm
SL/AR.pm
SL/GL.pm
SL/IR.pm
SL/IS.pm
config/lx_office.conf.default
locale/de/all

index 3c29ca85d89731f7f5dfcaeb9b0c6dee2df58ebf..eda1e71f41227fd0c43736038888e40b4534b0e7 100644 (file)
--- a/SL/AP.pm
+++ b/SL/AP.pm
@@ -34,6 +34,7 @@
 
 package AP;
 
+use SL::DATEV qw(:CONSTANTS);
 use SL::DBUtils;
 use SL::IO;
 use SL::MoreCommon;
@@ -353,6 +354,27 @@ sub post_transaction {
 
   IO->set_datepaid(table => 'ap', id => $form->{id}, dbh => $dbh);
 
+  # safety check datev export
+  if ($::lx_office_conf{datev_check}{check_on_ap_transaction}) {
+    my $transdate = $::form->{transdate} ? DateTime->from_lxoffice($::form->{transdate}) : undef;
+    $transdate  ||= DateTime->today;
+
+    my $datev = SL::DATEV->new(
+      exporttype => DATEV_ET_BUCHUNGEN,
+      format     => DATEV_FORMAT_KNE,
+      dbh        => $dbh,
+      from       => $transdate,
+      to         => $transdate,
+    );
+
+    $datev->export;
+
+    if ($datev->errors) {
+      $dbh->rollback;
+      die join "\n", $::locale->text('DATEV check returned errors:'), $datev->errors;
+    }
+  }
+
   if (!$provided_dbh) {
     $dbh->commit();
     $dbh->disconnect();
index e1501b7f7a68ebfef2a2faac2203af1c9b3fe652..002041ecf8fb47419044913a2c7e2ad9b11f7d06 100644 (file)
--- a/SL/AR.pm
+++ b/SL/AR.pm
@@ -35,6 +35,7 @@
 package AR;
 
 use Data::Dumper;
+use SL::DATEV qw(:CONSTANTS);
 use SL::DBUtils;
 use SL::IO;
 use SL::MoreCommon;
@@ -273,6 +274,27 @@ sub post_transaction {
 
   IO->set_datepaid(table => 'ar', id => $form->{id}, dbh => $dbh);
 
+  # safety check datev export
+  if ($::lx_office_conf{datev_check}{check_on_ar_transaction}) {
+    my $transdate = $::form->{transdate} ? DateTime->from_lxoffice($::form->{transdate}) : undef;
+    $transdate  ||= DateTime->today;
+
+    my $datev = SL::DATEV->new(
+      exporttype => DATEV_ET_BUCHUNGEN,
+      format     => DATEV_FORMAT_KNE,
+      dbh        => $dbh,
+      from       => $transdate,
+      to         => $transdate,
+    );
+
+    $datev->export;
+
+    if ($datev->errors) {
+      $dbh->rollback;
+      die join "\n", $::locale->text('DATEV check returned errors:'), $datev->errors;
+    }
+  }
+
   my $rc = 1;
   if (!$provided_dbh) {
     $rc = $dbh->commit();
index f538bc3590f191957ea286c2d402914c9145cbe8..cdd9d406ffcd6380852677cae3f8096e42f6b8aa 100644 (file)
--- a/SL/GL.pm
+++ b/SL/GL.pm
@@ -39,6 +39,7 @@
 package GL;
 
 use Data::Dumper;
+use SL::DATEV qw(:CONSTANTS);
 use SL::DBUtils;
 
 use strict;
@@ -184,6 +185,27 @@ sub post_transaction {
     do_query($form, $dbh, qq|UPDATE gl SET storno = 't' WHERE id = ?|, conv_i($form->{storno_id}));
   }
 
+  # safety check datev export
+  if ($::lx_office_conf{datev_check}{check_on_gl_transaction}) {
+    my $transdate = $::form->{transdate} ? DateTime->from_lxoffice($::form->{transdate}) : undef;
+    $transdate  ||= DateTime->today;
+
+    my $datev = SL::DATEV->new(
+      exporttype => DATEV_ET_BUCHUNGEN,
+      format     => DATEV_FORMAT_KNE,
+      dbh        => $dbh,
+      from       => $transdate,
+      to         => $transdate,
+    );
+
+    $datev->export;
+
+    if ($datev->errors) {
+      $dbh->rollback;
+      die join "\n", $::locale->text('DATEV check returned errors:'), $datev->errors;
+    }
+  }
+
   # commit and redirect
   my $rc = $dbh->commit;
   $dbh->disconnect;
index edf55f16a978361715f8ac839a6783558e0003b2..d8569acaa9f2bd6b4da55c6730af045f55e09b66 100644 (file)
--- a/SL/IR.pm
+++ b/SL/IR.pm
@@ -38,6 +38,7 @@ use SL::AM;
 use SL::ARAP;
 use SL::Common;
 use SL::CVar;
+use SL::DATEV qw(:CONSTANTS);
 use SL::DBUtils;
 use SL::DO;
 use SL::GenericTranslations;
@@ -683,6 +684,27 @@ sub post_invoice {
                                'arap_id' => $form->{id},
                                'table'   => 'ap',);
 
+  # safety check datev export
+  if ($::lx_office_conf{datev_check}{check_on_purchase_invoice}) {
+    my $transdate = $::form->{invdate} ? DateTime->from_lxoffice($::form->{invdate}) : undef;
+    $transdate  ||= DateTime->today;
+
+    my $datev = SL::DATEV->new(
+      exporttype => DATEV_ET_BUCHUNGEN,
+      format     => DATEV_FORMAT_KNE,
+      dbh        => $dbh,
+      from       => $transdate,
+      to         => $transdate,
+    );
+
+    $datev->export;
+
+    if ($datev->errors) {
+      $dbh->rollback;
+      die join "\n", $::locale->text('DATEV check returned errors:'), $datev->errors;
+    }
+  }
+
   my $rc = 1;
   if (!$provided_dbh) {
     $rc = $dbh->commit();
index 0c3b4c82c1bf1a21957fc8a63140035e2ed3bfce..d6acb2b3168622b91ccc71f1ba7d131dfa1f92de 100644 (file)
--- a/SL/IS.pm
+++ b/SL/IS.pm
@@ -40,6 +40,7 @@ use SL::AM;
 use SL::ARAP;
 use SL::CVar;
 use SL::Common;
+use SL::DATEV qw(:CONSTANTS);
 use SL::DBUtils;
 use SL::DO;
 use SL::GenericTranslations;
@@ -1080,6 +1081,27 @@ sub post_invoice {
                                'arap_id' => $form->{id},
                                'table'   => 'ar',);
 
+  # safety check datev export
+  if ($::lx_office_conf{datev_check}{check_on_sales_invoice}) {
+    my $transdate = $::form->{invdate} ? DateTime->from_lxoffice($::form->{invdate}) : undef;
+    $transdate  ||= DateTime->today;
+
+    my $datev = SL::DATEV->new(
+      exporttype => DATEV_ET_BUCHUNGEN,
+      format     => DATEV_FORMAT_KNE,
+      dbh        => $dbh,
+      from       => $transdate,
+      to         => $transdate,
+    );
+
+    $datev->export;
+
+    if ($datev->errors) {
+      $dbh->rollback;
+      die join "\n", $::locale->text('DATEV check returned errors:'), $datev->errors;
+    }
+  }
+
   my $rc = 1;
   $dbh->commit if !$provided_dbh;
 
index 396c5760dd0835f0f64a141f6a8856e8ce64c138..53bacffbfb482d2dd90579c7d6b6615ff1781e8d 100644 (file)
@@ -163,6 +163,27 @@ email_subject  = Benachrichtigung: automatisch erstellte Rechnungen
 # The template file used for the email's body.
 email_template = templates/webpages/oe/periodic_invoices_email.txt
 
+[datev_check]
+# it is possible to make a quick DATEV export everytime you post a record to ensure things
+# work nicely with their data requirements. This will result in a slight overhead though
+# you can enable this for each type of record independantly.
+
+# check when a sales invoice or a payment for a sales invoice is posted
+check_on_sales_invoice = 0
+# check when a purchase invoice or a payment for a purchase invoice is posted
+check_on_purchase_invoice = 0
+# check when an ar transaction is posted
+check_on_ar_transaction = 0
+# check when an ap transaction is posted
+check_on_ap_transaction = 0
+# check when a gl transaction is posted
+check_on_gl_transaction = 0
+
+# not implemented yet:
+#check_on_cash_and_receipt = 0
+#check_on_dunning = 0
+#check_on_sepa_import = 0
+
 [console]
 # autologin to use if none is given
 login =
index 7b16fc0f0bffd88b791c827ded0bea62a3bf8759..9e1d62aefa23a659124328ec3f0091b1ddb3fecd 100644 (file)
@@ -523,6 +523,7 @@ $self->{texts} = {
   'DATEV - Export Assistent'    => 'DATEV-Exportassistent',
   'DATEV Angaben'               => 'DATEV-Angaben',
   'DATEV Export'                => 'DATEV-Export',
+  'DATEV check returned errors:' => 'Die DATEV Prüfung dieser Buchung ergab Fehler:',
   'DATEX - Export Assistent'    => 'DATEV-Exportassistent',
   'DELETED'                     => 'Gelöscht',
   'DFV-Kennzeichen'             => 'DFV-Kennzeichen',
@@ -593,11 +594,8 @@ $self->{texts} = {
   'Delivery Order created'      => 'Lieferschein erstellt',
   'Delivery Order deleted!'     => 'Lieferschein gel&ouml;scht!',
   'Delivery Orders'             => 'Lieferscheine',
-  'Delivery Orders for this document' => 'Lieferscheine für dieses Dokument',
   'Delivery Plan'               => 'Lieferplan',
   'Delivery Plan for currently outstanding sales orders' => 'Lieferplan für offene Verkaufsaufträge',
-  'Delivery information deleted.' => 'Lieferinformation gelöscht.',
-  'Delivery information saved.' => 'Lieferinformation gespeichert.',
   'Department'                  => 'Abteilung',
   'Department 1'                => 'Abteilung (1)',
   'Department 2'                => 'Abteilung (2)',
@@ -1142,6 +1140,7 @@ $self->{texts} = {
   'Missing amount'              => 'Fehlbetrag',
   'Missing parameter #1 in call to sub #2.' => 'Fehlernder Parameter \'#1\' in Funktionsaufruf \'#2\'.',
   'Missing parameter (at least one of #1) in call to sub #2.' => 'Fehlernder Parameter (mindestens einer aus \'#1\') in Funktionsaufruf \'#2\'.',
+  'Missing qty'                 => '',
   'Missing taxkeys in invoices with taxes.' => 'Fehlende Steuerschl&uuml;ssel in Rechnungen mit Steuern',
   'Missing user id!'            => 'Benutzer ID fehlt!',
   'Mitarbeiter'                 => 'Mitarbeiter',
@@ -1250,7 +1249,6 @@ $self->{texts} = {
   'Number pages'                => 'Seiten nummerieren',
   'Number variables: \'PRECISION=n\' forces numbers to be shown with exactly n decimal places.' => 'Zahlenvariablen: Mit \'PRECISION=n\' erzwingt man, dass Zahlen mit n Nachkommastellen formatiert werden.',
   'OB Transaction'              => 'EB-Buchung',
-  'OBE-Export erfolgreich!'     => 'OBE-Export erfolgreich!',
   'Objects have been imported.' => 'Objekte wurden importiert.',
   'Obsolete'                    => 'Ungültig',
   'Oct'                         => 'Okt',