Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision c0f873c1

Von Kivitendo Admin vor mehr als 7 Jahren hinzugefügt

  • ID c0f873c1ffccfd565995500b459d53bba394c04d
  • Vorgänger b90426d3
  • Nachfolger db64ed3a

DATEV Export - nach Abteilung filtern

Unterschiede anzeigen:

SL/DATEV.pm
374 374
  my $form     =  $main::form;
375 375

  
376 376
  my $trans_id_filter = '';
377
  my ($ar_department_id_filter, $ap_department_id_filter, $gl_department_id_filter);
378
  if ( $form->{department_id} ) {
379
    $ar_department_id_filter = " AND ar.department_id = ? ";
380
    $ap_department_id_filter = " AND ap.department_id = ? ";
381
    $gl_department_id_filter = " AND gl.department_id = ? ";
382
  }
377 383

  
378 384
  if ( $self->{trans_id} ) {
379 385
    # ignore dates when trans_id is passed so that the entire transaction is
......
400 406
         t.rate AS taxrate, t.taxdescription,
401 407
         'ar' as table,
402 408
         tc.accno AS tax_accno, tc.description AS tax_accname,
409
         ar.department_id,
403 410
         ar.notes
404 411
       FROM acc_trans ac
405 412
       LEFT JOIN ar          ON (ac.trans_id    = ar.id)
......
410 417
       WHERE (ar.id IS NOT NULL)
411 418
         AND $fromto
412 419
         $trans_id_filter
420
         $ar_department_id_filter
413 421
         $filter
414 422

  
415 423
       UNION ALL
......
422 430
         t.rate AS taxrate, t.taxdescription,
423 431
         'ap' as table,
424 432
         tc.accno AS tax_accno, tc.description AS tax_accname,
433
         ap.department_id,
425 434
         ap.notes
426 435
       FROM acc_trans ac
427 436
       LEFT JOIN ap        ON (ac.trans_id  = ap.id)
......
432 441
       WHERE (ap.id IS NOT NULL)
433 442
         AND $fromto
434 443
         $trans_id_filter
444
         $ap_department_id_filter
435 445
         $filter
436 446

  
437 447
       UNION ALL
......
444 454
         t.rate AS taxrate, t.taxdescription,
445 455
         'gl' as table,
446 456
         tc.accno AS tax_accno, tc.description AS tax_accname,
457
         gl.department_id,
447 458
         gl.notes
448 459
       FROM acc_trans ac
449 460
       LEFT JOIN gl      ON (ac.trans_id  = gl.id)
......
453 464
       WHERE (gl.id IS NOT NULL)
454 465
         AND $fromto
455 466
         $trans_id_filter
467
         $gl_department_id_filter
456 468
         $filter
457 469

  
458 470
       ORDER BY trans_id, acc_trans_id|;
459 471

  
460
  my $sth = prepare_execute_query($form, $self->dbh, $query);
472
  my @query_args;
473
  if ( $form->{department_id} ) {
474
    push(@query_args, ($form->{department_id}) x 3);
475
  }
476

  
477
  my $sth = prepare_execute_query($form, $self->dbh, $query, @query_args);
461 478
  $self->{DATEV} = [];
462 479

  
463 480
  my $counter = 0;
bin/mozilla/datev.pl
32 32
use SL::Common;
33 33
use SL::DATEV qw(:CONSTANTS);
34 34
use SL::Locale::String qw(t8);
35
use SL::DB::Department;
35 36

  
36 37
use strict;
37 38

  
......
76 77
  setup_datev_export2_action_bar();
77 78

  
78 79
  $::form->header;
80
  $::form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all;
79 81
  print $::form->parse_html_template('datev/export_bewegungsdaten');
80 82

  
81 83
  $::lxdebug->leave_sub;
templates/webpages/datev/export_bewegungsdaten.html
54 54
      </table>
55 55
    </td>
56 56
  </tr>
57
  [% IF ALL_DEPARTMENTS.as_list.size %]
58
  <tr>
59
    <th align=left>[% 'Department' | $T8 %]</th>
60
  </tr>
61
  <tr>
62
    <td>
63
       <table>
64
        <tr>
65
          <td align=left>[% 'Department' | $T8 %]</td>
66
          <td align=left></td>
67
          <td>[% L.select_tag('department_id', ALL_DEPARTMENTS, title_key = 'description', with_empty = 1) %]</td>
68
        </tr>
69
       </table>
70
    </td>
71
  </tr>
72
  [% END %]
57 73
  <tr>
58 74
    <td><hr size=3 noshade></td>
59 75
  </tr>

Auch abrufbar als: Unified diff