X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fgl.pl;h=f4f87cc8f23142c731edcfa2bef7c45a63917093;hb=22e896625b26471f6b91834d97eb8c8d2ca1f1e3;hp=6ed1e4c448fd69f8944662030f81761f3d60fc58;hpb=eca3a47857617e4283e53c30bba3588f5cf0d31c;p=kivitendo-erp.git diff --git a/bin/mozilla/gl.pl b/bin/mozilla/gl.pl index 6ed1e4c44..f4f87cc8f 100644 --- a/bin/mozilla/gl.pl +++ b/bin/mozilla/gl.pl @@ -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]->{$_} }