]> wagnertech.de Git - kivitendo-erp.git/commitdiff
Splitbuchungen durch negative Werte als Fehler melden.
authorSven Schöling <s.schoeling@linet-services.de>
Wed, 11 Jan 2012 11:48:25 +0000 (12:48 +0100)
committerSven Schöling <s.schoeling@linet-services.de>
Wed, 11 Jan 2012 11:48:25 +0000 (12:48 +0100)
Eine Buchung der folgenden Art:

  Soll     Haben
  10
           15
  10
  -5

ist bisher durch die Maske gekommen, wurde aber intern zu einer Splitbuchung. Das wird jetzt erkannt und abgelehnt.

bin/mozilla/gl.pl
locale/de/all

index 6ed1e4c448fd69f8944662030f81761f3d60fc58..f4f87cc8f23142c731edcfa2bef7c45a63917093 100644 (file)
@@ -1312,6 +1312,7 @@ sub post_transaction {
   my $debitcount  = 0;
   my $creditcount = 0;
   my $debitcredit;
+  my %split_safety = ();
 
   my @flds = qw(accno debit credit projectnumber fx_transaction source memo tax taxchart);
 
@@ -1325,6 +1326,9 @@ sub post_transaction {
     push @a, {};
     $debitcredit = ($form->{"debit_$i"} == 0) ? "0" : "1";
 
+    $split_safety{   $form->{"debit_$i"}  <=> 0 }++;
+    $split_safety{ - $form->{"credit_$i"} <=> 0 }++;
+
     if ($debitcredit) {
       $debitcount++;
     } else {
@@ -1388,6 +1392,10 @@ sub post_transaction {
     $count++;
   }
 
+  if ($split_safety{-1} > 1 && $split_safety{1} > 1) {
+    $::form->error($::locale->text("Split entry detected. The values you have entered will result in an entry with more than one position on both debit and credit. Due to known problems involving accounting software Lx-Office does not allow these."));
+  }
+
   for my $i (1 .. $count) {
     my $j = $i - 1;
     for (@flds) { $form->{"${_}_$i"} = $a[$j]->{$_} }
index 9e3ba9eae53e63f108a5e8f670cdfc4a8d2459ba..a78038734dc326c666d8524e7168a5c2a89b6aea 100644 (file)
@@ -1635,6 +1635,7 @@ $self->{texts} = {
   'Source bank account'         => 'Quellkonto',
   'Source bin'                  => 'Quelllagerplatz',
   'Space'                       => 'Leerzeichen',
+  'Split entry detected. The values you have entered will result in an entry with more than one position on both debit and credit. Due to known problems involving accounting software Lx-Office does not allow these.' => 'Splitbuchung! Die eingebenen Werte würden eine Buchung auslösen, die jeweils mehr als eine Position auf Soll und Haben hätte. Um Kompatibilität mit DATEV zu gewährleisten erlaubt Lx-Office keine Splitbuchungen.',
   'Spoolfile'                   => 'Druckdatei',
   'Start Dunning Process'       => 'Mahnprozess starten',
   'Start analysis'              => 'Analyse beginnen',