Revision c0f873c1
Von Kivitendo Admin vor mehr als 7 Jahren hinzugefügt
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; |
Auch abrufbar als: Unified diff
DATEV Export - nach Abteilung filtern