Projekt

Allgemein

Profil

Fehler #703 » ar_ordered.diff

Patch - Bernd Bleßmann, 05.08.2024 13:13

Unterschiede anzeigen:

SL/IS.pm
1258 1258
    }
1259 1259
  }
1260 1260

  
1261
  my %ordered_accnos;
1262
  # special order for invoice_for_advance_payment
1263
  if ($form->{type} eq 'invoice_for_advance_payment') {
1264
    push @{$ordered_accnos{$form->{id}}}, $form->{AR};
1265
    push @{$ordered_accnos{$form->{id}}}, $advance_payment_clearing_chart->accno;
1266

  
1267
  } else {
1268
    # no special order for non invoice_for_advance_payment
1269
    foreach my $trans_id (keys %{ $form->{amount} }) {
1270
      foreach my $accno (keys %{ $form->{amount}{$trans_id} }) {
1271
        push @{$ordered_accnos{$trans_id}}, $accno;
1272
      }
1273
    }
1274
  }
1275

  
1261 1276
  foreach my $trans_id (keys %{ $form->{amount} }) {
1262
    foreach my $accno (keys %{ $form->{amount}{$trans_id} }) {
1277
    foreach my $accno (@{$ordered_accnos{$trans_id}}) {
1263 1278
      next unless ($form->{expense_inventory} =~ /\Q$accno\E/);
1264 1279

  
1265 1280
      $form->{amount}{$trans_id}{$accno} = $form->round_amount($form->{amount}{$trans_id}{$accno}, 2);
......
1291 1306
      }
1292 1307
    }
1293 1308

  
1294
    foreach my $accno (keys %{ $form->{amount}{$trans_id} }) {
1309
    foreach my $accno (@{$ordered_accnos{$trans_id}}) {
1295 1310
      $form->{amount}{$trans_id}{$accno} = $form->round_amount($form->{amount}{$trans_id}{$accno}, 2);
1296 1311

  
1297 1312
      if (!$payments_only && ($form->{amount}{$trans_id}{$accno} != 0)) {
    (1-1/1)