Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 9f4817cd

Von Sven Schöling vor mehr als 12 Jahren hinzugefügt

  • ID 9f4817cd8a7ff5e12ec6900992181af33837220a
  • Vorgänger c6d7469e
  • Nachfolger 22e89662

Splitbuchungen durch negative Werte als Fehler melden.

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.

Unterschiede anzeigen:

bin/mozilla/gl.pl
1312 1312
  my $debitcount  = 0;
1313 1313
  my $creditcount = 0;
1314 1314
  my $debitcredit;
1315
  my %split_safety = ();
1315 1316

  
1316 1317
  my @flds = qw(accno debit credit projectnumber fx_transaction source memo tax taxchart);
1317 1318

  
......
1325 1326
    push @a, {};
1326 1327
    $debitcredit = ($form->{"debit_$i"} == 0) ? "0" : "1";
1327 1328

  
1329
    $split_safety{   $form->{"debit_$i"}  <=> 0 }++;
1330
    $split_safety{ - $form->{"credit_$i"} <=> 0 }++;
1331

  
1328 1332
    if ($debitcredit) {
1329 1333
      $debitcount++;
1330 1334
    } else {
......
1388 1392
    $count++;
1389 1393
  }
1390 1394

  
1395
  if ($split_safety{-1} > 1 && $split_safety{1} > 1) {
1396
    $::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."));
1397
  }
1398

  
1391 1399
  for my $i (1 .. $count) {
1392 1400
    my $j = $i - 1;
1393 1401
    for (@flds) { $form->{"${_}_$i"} = $a[$j]->{$_} }

Auch abrufbar als: Unified diff