Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision febfc20e

Von Kivitendo Admin vor mehr als 1 Jahr hinzugefügt

  • ID febfc20ed407b1c80c614520627f8708852a5f16
  • Vorgänger 234666a9
  • Nachfolger 93c5375c

Konten ausziffern - in Buchungsliste einbinden

Unterschiede anzeigen:

bin/mozilla/ca.pl
38 38
use SL::CA;
39 39
use SL::DB::Default;
40 40
use SL::ReportGenerator;
41
use utf8;
41 42

  
42 43
require "bin/mozilla/reportgenerator.pl";
43 44

  
......
352 353

  
353 354
  my @hidden_variables = qw(accno fromdate todate description accounttype l_heading subtotal department projectnumber project_id sort method);
354 355

  
356
  my $chart_has_clearing = SL::DB::Manager::Chart->get_first(
357
    where  => [ accno => $form->{accno} ],
358
    select => [ qw(clearing) ]
359
  )->clearing;
360

  
361
  if ( $chart_has_clearing ) {
362
    $column_defs{'cleared'} = { 'text' => $locale->text('Cleared') };
363
    push(@columns, 'cleared');
364
    push(@hidden_variables, 'cleared');
365
  };
366

  
355 367
  my $link = build_std_url('action=list_transactions', grep { $form->{$_} } @hidden_variables);
356 368

  
357 369
  $form->{callback} = $link . '&sort=' . E($form->{sort});
358 370

  
359 371
  my %column_alignment = map { $_ => 'right' } qw(debit credit balance);
372
  $column_alignment{'cleared'} = 'center';
360 373

  
361 374
  my @custom_headers = ();
362 375
 # Zeile 1:
......
388 401
   { 'text' => $locale->text('Balance'), },
389 402
 ];
390 403

  
391

  
392

  
393

  
404
  if ( $chart_has_clearing ) {
405
    # add a new heading with its own link, which leads to Cleared controller rather than sorting rows
406
    my $cleared_link;
407
    {
408
      local $form->{script} = 'controller.pl';
409
      $cleared_link = build_std_url('action=Clearing/form', grep { $form->{$_} } @hidden_variables);
410
    }
411
    push @{$custom_headers[2]}, { 'text' => $locale->text('Cleared'), 'link' => $cleared_link };
412
  };
394 413

  
395 414
  my $report = SL::ReportGenerator->new(\%myconfig, $form);
396 415
  $report->set_custom_headers(@custom_headers);
......
444 463

  
445 464
    my $row = { };
446 465

  
466
    if ( $chart_has_clearing ) {
467
      $ca->{cleared} = $ca->{cleared} ? '✓' : '';
468
    }
469

  
447 470
    $ca->{ustrate} = $form->format_amount(\%myconfig, $ca->{ustrate} * 100, 2) if ($ca->{ustrate} != 0);
448 471

  
449 472
    if ($ca->{memo} ne "") {

Auch abrufbar als: Unified diff